Эх сурвалжийг харах

更新弹窗跳转页面,红点跳转页面

lang 3 жил өмнө
parent
commit
bf07706f06

+ 49 - 33
Controller/AppSetController.py

@@ -57,7 +57,7 @@ class AppSetView(View):
             tko = TokenObject(token)
             if tko.code == 0:
                 userID = tko.userID
-                if operation == 'page_set': # app弹窗标记红点设置
+                if operation == 'page_set':  # app弹窗标记红点设置
                     return self.do_page_set(userID, request_dict, response)
             else:
                 return response.json(tko.code)
@@ -166,55 +166,71 @@ class AppSetView(View):
         dict_json['popups'] = {
             'title': '20% off',
             'content': 'on Cloud Storage Subscription',
-            'start_time': 1653275226,
-            'end_time': 1753275226,
-            'now_time': int(time.time())
+            # 'start_time': 1653275226,
+            # 'end_time': 1753275226,
+            'status': 1,
+            'tag': 1,
         }
+        dict_json['now_time'] = int(time.time())
 
         # 红点标记 后续根据数据库配置
-        dict_json['red_dots'] = {
-            'cloud_storage': {
+        dict_json['red_dots'] = [
+            {
+                'module': 'cloud_storage',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,  # 跳转页面,1:云存储购 2:AI购买 3:优惠券
             },
-            'ai_detection': {
+            {
+                'module': 'ai_detection',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,
             },
-            'coupon': {
+            {
+                'module': 'coupon',
                 'status': 1,
-                'start_time': 1653275226,
-                'end_time': '1753275226',
+                # 'start_time': 1653275226,
+                # 'end_time': '1753275226',
+                'tag': 1,
             },
-            'add': {
+            {
+                'module': 'add',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,
             },
-            'setting': {
+            {
+                'module': 'setting',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,
             },
-            'my': {
+            {
+                'module': 'my',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,
             },
-            'cloud_storage_purchases': {
+            {
+                'module': 'cloud_storage_purchases',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,
             },
-            'ai_detects_purchases': {
+            {
+                'module': 'ai_detects_purchases',
                 'status': 0,
-                'start_time': 0,
-                'end_time': 0,
+                # 'start_time': 0,
+                # 'end_time': 0,
+                'tag': 1,
             },
-        }
-
+        ]
+        dict_json['red_dots'] = list(dict_json['red_dots'])
         return response.json(0, dict_json)
-
-