From 38395204ab04bbca22a5e22be988d826afd5b227 Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期四, 10 十一月 2022 15:46:27 +0800
Subject: [PATCH] 修复bug,优化下单

---
 gui.py |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)

diff --git a/gui.py b/gui.py
index 33d21c3..613375c 100644
--- a/gui.py
+++ b/gui.py
@@ -300,14 +300,25 @@
                 count = 0
                 if codes:
                     count = len(codes)
-                cl_buy_1.configure(text="{}".format(count), foreground="#008000")
+                if count < 1:
+                    normal = False
+                    cl_buy_1.configure(text="{}".format(count), foreground="#FF7F27")
+                else:
+                    cl_buy_1.configure(text="{}".format(count), foreground="#008000")
             except:
                 pass
 
             try:
-                cl_price_count.configure(
-                    text="{}".format(self.codeActualPriceProcessor.get_current_price_codes_count()),
-                    foreground="#008000")
+                count = self.codeActualPriceProcessor.get_current_price_codes_count()
+                if count is None or int(count) < 1:
+                    normal = False
+                    cl_price_count.configure(
+                        text="{}".format(count),
+                        foreground="#FF7F27")
+                else:
+                    cl_price_count.configure(
+                        text="{}".format(count),
+                        foreground="#008000")
             except:
                 pass
 
@@ -459,8 +470,6 @@
                     showinfo("鎻愮ず", "淇瀹屾垚")
                 except Exception as e:
                     showerror("淇鍑洪敊", str(e))
-
-
 
             # 鍒涘缓鐣岄潰
             win = Tk()

--
Gitblit v1.8.0