فهرست منبع

健康分析判断剩余次数

cc12458 1 سال پیش
والد
کامیت
8b6c70ab5e

+ 6 - 2
miniprogram/app.json

@@ -58,9 +58,13 @@
     }
   },
   "window": {
-    "navigationBarBackgroundColor": "#0F2226",
+    "navigationStyle": "custom",
     "navigationBarTextStyle": "white",
-    "navigationStyle": "custom"
+    "navigationBarBackgroundColor": "#0f2226",
+    "backgroundColor": "#0f2226",
+    "backgroundColorContent": "#0f2226",
+    "backgroundColorTop": "#0f2226",
+    "backgroundColorBottom": "#0f2226"
   },
   "rendererOptions": {
     "skyline": {

+ 6 - 0
miniprogram/module/article/pages/science-info/science-info.json

@@ -1,5 +1,11 @@
 {
   "renderer": "webview",
+  "navigationBarTextStyle": "white",
+  "navigationBarBackgroundColor": "#0f2226",
+  "backgroundColor": "#0f2226",
+  "backgroundColorContent": "#0f2226",
+  "backgroundColorTop": "#0f2226",
+  "backgroundColorBottom": "#0f2226",
   "component": true,
   "usingComponents": {}
 }

+ 4 - 0
miniprogram/module/chats/components/message-system/message-system.scss

@@ -18,4 +18,8 @@
     color: #999;
     margin-bottom: 6px;
   }
+}
+
+button {
+  line-height: 18px;
 }

+ 7 - 1
miniprogram/module/chats/components/message-system/message-system.ts

@@ -7,9 +7,15 @@ Component({
   observers: {
     'payload.date'(value) {
       if (value) this.setData({ date: dayjs(value).format('MM-DD HH:mm:ss') })
+    },
+    'payload.title'(value) {
+      if (value) {
+        if (value.includes('联系工作人员')) this.setData({ openType: 'contact' })
+      }
     }
   },
   data: {
-    date:''
+    date:'',
+    openType: '',
   }
 })

+ 2 - 1
miniprogram/module/chats/components/message-system/message-system.wxml

@@ -2,5 +2,6 @@
 
 <view class="system-wrapper">
   <view class="date">{{date}}</view>
-  <view class="title">{{payload.title}}</view>
+  <button wx:if="{{openType}}" class="title" open-type="{{openType}}">{{payload.title}}</button>
+  <view wx:else class="title" open-type="contact">{{payload.title}}</view>
 </view>

+ 24 - 7
miniprogram/module/chats/components/questionnaire/questionnaire.ts

@@ -55,13 +55,30 @@ Component({
 
       this._next()
     },
-    _start() {
-      this.setData({
-        [`_next.dialogId`]: '',
-        [`_next.questions`]: [],
-        _timestamp: Date.now(),
-      })
-      this._next();
+    async _start() {
+      try {
+        const count = await Post(`/patientInfoManage/rechargeUseDetail`, {}, {
+          transform({ data }: any) {
+            return data?.residuedCou
+          }
+        });
+        if (count > 0) {
+          this.setData({
+            [`_next.dialogId`]: '',
+            [`_next.questions`]: [],
+            _timestamp: Date.now(),
+          })
+          this._next();
+        } else {
+          throw {errMsg: `您的健康分析次数已用完,请联系工作人员。`}
+        }
+      } catch (error) {
+        this._createMessage({
+          id: `system-start`, type: 'system',
+          payload: { date: Date.now(), title: error.errMsg ?? `分析错误,请重试!`, }
+        });
+        this._end();
+      }
     },
     _end() {
       this.setData({