Prechádzať zdrojové kódy

feature:增加信息配置更新

liuzhenlin 4 mesiacov pred
rodič
commit
e8b55661ff

+ 3 - 3
pages/home/index.vue

@@ -67,7 +67,7 @@
                   <!-- <view class="line">
                 <view id="wheek_rate" class="realline"></view>
               </view> -->
-                  <p class="num">{{ instrInfo.useTimeWeek }}小时</p>
+                  <p class="num">{{ instrInfo.useTimeWeek.toFixed(2) }}小时</p>
                 </view>
               </li>
 
@@ -91,7 +91,7 @@
                 <view id="month_rate" class="realline"></view>
               </view> -->
 
-                  <p class="num">{{ instrInfo.useTimeMonth }}小时</p>
+                  <p class="num">{{ instrInfo.useTimeMonth.toFixed(2) }}小时</p>
                 </view>
               </li>
             </ul>
@@ -790,7 +790,7 @@ export default {
 
 .num {
   display: inline-block;
-  width: 20%;
+  width: 50%;
   color: #303133;
   margin-left: 10px;
   font-size: 1.4vw;

+ 53 - 2
pages/setting/index.vue

@@ -2,6 +2,7 @@
   <view class="setting-wrap">
     <div class="header">
       <div class="name">智能实验终端</div>
+      <div class="activation-btn" @click="confirmInfo" style="border-right: 1px solid;">修改信息</div>
       <div class="activation-btn" @click="confirm">激活终端</div>
     </div>
     <view class="lab-input-wrap">
@@ -139,7 +140,7 @@ export default {
         });
         return;
       }
-      this.sdkKey = res.data.configValue|| ''
+      this.sdkKey = res.data.configValue || ''
     },
     testSave() {
       // 测试用的方法
@@ -233,7 +234,7 @@ export default {
             });
           } else {
             uni.showToast({
-              title: "激活失败,请重新确认激活",
+              title: "激活失败,错误编号:" + res.code,
               icon: "none",
               duration: 1000,
             });
@@ -241,6 +242,56 @@ export default {
         }
       );
     },
+    // 只注册信息
+    confirmInfo() {
+      if (!this.no) {
+        uni.showToast({
+          title: "终端编号不能为空",
+          icon: "none",
+          duration: 1000,
+        });
+        return;
+      }
+      uni.showModal({
+        title: "提示",
+        content: "确认设置" + this.no + "为当前系统的终端编号?",
+        success: (res) => {
+          if (res.confirm) {
+
+            uni.setStorageSync("labsop_ip", this.ip || "");
+
+            uni.setStorageSync("labsop_no", this.no || "");
+
+            uni.setStorageSync("labsop_tenant", this.tenant || "");
+
+            uni.setStorageSync(
+              "labsop_android_token",
+              this.token || ""
+            );
+
+            uni.setStorageSync(
+              "labsop_service_path",
+              this.service_path || ""
+            );
+
+            uni.setStorageSync(
+              "labsop_headerImg",
+              this.headerImg || "static/images/header.png"
+            );
+
+            uni.setStorageSync("labsop_filePath", this.filePath || "");
+
+            uni.showToast({
+              title: "保存成功",
+              duration: 1000,
+            });
+            setTimeout(() => {
+              plus.runtime.restart();
+            }, 1000);
+          }
+        },
+      });
+    },
     // 清空人脸库
     clearFace() {
       module.clearFace((res) => {

Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/app-plus/app-service.js


Rozdielové dáta súboru neboli zobrazené, pretože súbor je príliš veľký
+ 0 - 0
unpackage/dist/build/app-plus/app-view.js


Niektoré súbory nie sú zobrazené, pretože je v týchto rozdielových dátach zmenené mnoho súborov