From 4a800a8fc83c6bd1f86a8e847b079a51a7532c09 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期三, 20 七月 2022 15:05:58 +0800
Subject: [PATCH] 修复国标配置的bug

---
 src/pages/desktop/index/components/Desktop.vue |   94 +++++++++++++++++++++++++++-------------------
 1 files changed, 55 insertions(+), 39 deletions(-)

diff --git a/src/pages/desktop/index/components/Desktop.vue b/src/pages/desktop/index/components/Desktop.vue
index 11c59fb..a0737fb 100644
--- a/src/pages/desktop/index/components/Desktop.vue
+++ b/src/pages/desktop/index/components/Desktop.vue
@@ -12,7 +12,9 @@
 
     <div class="warn-tag" v-if="showFreeVersion">
       <span v-if="!snExpire" class="text"
-        >璇曠敤鐗堝皻鏈縺娲伙紝浠呮敮鎸佷娇鐢ㄩ儴鍒嗗姛鑳斤紝濡傞渶浣跨敤鍏ㄩ儴鍔熻兘锛岃灏藉揩婵�娲汇��</span
+        >{{
+          versionName
+        }}灏氭湭婵�娲伙紝浠呮敮鎸佷娇鐢ㄩ儴鍒嗗姛鑳斤紝濡傞渶浣跨敤鍏ㄩ儴鍔熻兘锛岃灏藉揩婵�娲汇��</span
       >
       <span v-else class="text">SmartAIOS 璇曠敤鏈熷凡鍒版湡锛岃鎮ㄥ敖蹇縺娲荤郴缁�</span>
       <div>
@@ -49,7 +51,6 @@
           </span>
         </div>
         <div class="login-content">
-          <!-- status-icon -->
           <el-form
             :model="phone"
             :rules="phoneCodeRule"
@@ -92,13 +93,11 @@
         </span>
       </el-dialog>
       <div class="ver">
-        <span class="ver-text">鐗堟湰锛�</span>{{ versionName }}
+        <span class="ver-text">鐗堟湰锛�</span>SmartAI{{ versionName }}
       </div>
-      <div class="ver">
-        <span class="ver-text">鐘舵�侊細</span>{{ versionState }}
-      </div>
+      <div class="ver"><span class="ver-text">鐘舵�侊細</span>灏氭湭婵�娲�</div>
       <el-divider></el-divider>
-      <div class="info" v-if="versionName == 'SmartAI姝e紡鐗�'">
+      <div class="info" v-if="versionName == '姝e紡鐗�'">
         <span style="font-weight: bold; font-size: 18px">路 </span>
         <span style="font-size: 14px; line-height: 21px; color: #5f5f5f">
           濡傛灉鎮ㄥ凡杩炴帴鍒癐nternet骞朵笖宸茶喘涔颁骇鍝佸瘑閽ワ紝鍙互灏濊瘯楠岃瘉SmartAI鍟嗗煄璐︽埛婵�娲荤郴缁熴��
@@ -109,13 +108,13 @@
           </el-button>
         </div>
       </div>
-      <div class="info" v-if="versionName == 'SmartAI姝e紡鐗�'">
+      <div class="info" v-if="versionName == '姝e紡鐗�'">
         <span style="font-weight: bold; font-size: 18px">路 </span>
         <span style="font-size: 14px; line-height: 21px; color: #5f5f5f">
           濡傛灉鎮ㄦ湭杩炴帴Internet鎴栨縺娲诲け璐ワ紝鍙皾璇曠绾挎縺娲伙紝璇风敤鎵嬫満鎵爜璐拱浜у搧鎴栭獙璇丼martAI鍟嗗煄璐︽埛婵�娲荤郴缁熴��
         </span>
       </div>
-      <div class="info" v-if="versionName !== 'SmartAI姝e紡鐗�'">
+      <div class="info" v-if="versionName !== '姝e紡鐗�'">
         <span style="font-weight: bold; font-size: 18px">路 </span>
         <span style="font-size: 14px; line-height: 21px; color: #5f5f5f">
           濡傛灉杩樻病鏈変骇鍝佸瘑閽ワ紝浣犲彲浠ヤ娇鐢ㄦ墜鏈烘壂鐮佹垨鍓嶅線姝ら摼鎺�
@@ -157,19 +156,18 @@
       <!-- <el-divider></el-divider> -->
 
       <span slot="footer" class="dialog-footer">
-        <!-- v-if="!snExpire && versionName != 'SmartAI姝e紡鐗�'" -->
         <div class="btns">
           <el-button
-            v-if="!snExpire && versionName != 'SmartAI姝e紡鐗�'"
+            v-if="!snExpire && versionName != '姝e紡鐗�'"
             class="cancel"
             @click="activeDialog = false"
             >缁х画璇曠敤</el-button
           >
           <el-button
             class="cancel"
-            v-if="snExpire && versionName != 'SmartAI姝e紡鐗�'"
+            v-if="snExpire && versionName != '姝e紡鐗�'"
             @click="$emit('quit')"
-            >閫�鍑虹櫥褰�
+            >閫�鍑虹櫥闄�
           </el-button>
           <el-button class="ok" type="primary" @click="activateVersion"
             >婵�娲�</el-button
@@ -208,20 +206,33 @@
               <span>{{ item.orderMoney }} 鍏�</span>
             </div>
             <div class="desc">
+              <div>璁㈠崟鐢熸垚鏃ユ湡锛歿{ item.createTime }}</div>
+              <div>浜у搧鍚嶇О锛歿{ prod.productName }}</div>
+              <div>浜у搧绫诲瀷锛歿{ prod.productTypeName }}</div>
               <div>绯荤粺鐗堟湰锛歿{ prod.edition }}</div>
               <div>閫氶亾鏁伴噺锛歿{ prod.ChCount }}</div>
-              <div>鎽勫儚鏈烘暟閲忥細{{ prod.cameraCount }}</div>
-              <div>鏈嶅姟鏃堕暱锛歿{ prod.serveYear }} 骞�</div>
+              <div>鎺堟潈鏁伴噺锛歿{ prod.authCount }}</div>
+              <div>
+                璧锋鏈嶅姟鏃堕棿 锛歿{
+                  startAndEnd(item.createTime, prod.serveYear)
+                }}
+              </div>
             </div>
           </div>
         </div>
       </div>
-      <div class="no-order-list" v-else>鎶辨瓑锛屾病鏈夋煡璇㈠埌璁㈠崟銆�</div>
+      <div class="no-order-list" v-else>
+        {{
+          loadingOrders ? "璁㈠崟鍔犺浇涓紝璇风◢鍚�..." : "鎶辨瓑锛屾湭鏌ヨ鍒拌鍗曚俊鎭紒"
+        }}
+      </div>
       <span slot="footer" class="dialog-footer">
-       <div class="btns">
+        <div class="btns">
           <el-button class="cancel" @click="$emit('quit')">閫�鍑虹櫥褰�</el-button>
-        <el-button class="ok" type="primary" @click="activeVerByOrd">婵�娲�</el-button>
-       </div>
+          <el-button class="ok" type="primary" @click="activeVerByOrd"
+            >婵�娲�</el-button
+          >
+        </div>
       </span>
     </el-dialog>
   </div>
@@ -252,10 +263,9 @@
       showFreeVersion: false,
       activeDialog: false,
       countdown: 60,
-      innerDialog: true,
+      innerDialog: false,
       versionName: "",
       codeMsg: "鑾峰彇楠岃瘉鐮�",
-      versionState: "灏氭湭婵�娲�",
       secrectKey: "",
       curOrder: {},
       curProd: {},
@@ -264,6 +274,7 @@
       snExpire: false,
       timer: null,
       token: "",
+      loadingOrders: true,
       orderList: [],
       phone: {
         phoneNum: "",
@@ -281,6 +292,11 @@
     this.validateSn();
   },
   methods: {
+    startAndEnd(createTime, serveYear) {
+      let year = createTime.split("-")[0];
+      let endTime = parseInt(year) + serveYear + createTime.slice(4);
+      return createTime + " - " + endTime;
+    },
     activeVerByOrd() {
       activeByOrder({
         token: this.token,
@@ -300,6 +316,7 @@
     validateSn() {
       getSN().then((res) => {
         this.snExpire = res.data.expire;
+        this.activeDialog = res.data.expire;
         this.showFreeVersion = res.data.sn == "" || res.data.expire;
         this.versionName = this.getVersionName(res.data.edition);
       });
@@ -319,24 +336,23 @@
       }
     },
     choseProd(order, prod) {
-      debugger;
       this.curOrder = order;
       this.curProd = prod;
     },
     getVersionName(s) {
       switch (s) {
         case "alpha":
-          return "SmartAI鍐呮祴鐗�";
+          return "鍐呮祴鐗�";
         case "beta":
-          return "SmartAI鍏祴鐗�";
+          return "鍏祴鐗�";
         case "trial":
-          return "SmartAI璇曠敤鐗�";
+          return "璇曠敤鐗�";
         case "test":
-          return "SmartAI娴嬭瘯鐗�";
+          return "娴嬭瘯鐗�";
         case "official":
-          return "SmartAI姝e紡鐗�";
+          return "姝e紡鐗�";
         default:
-          return "SmartAI瀹氬埗鐗�";
+          return "瀹氬埗鐗�";
           break;
       }
     },
@@ -350,11 +366,13 @@
           loginShopInSmart(param).then((res) => {
             this.innerDialog = true;
             this.activeDialog = false;
+
             this.token = res.data.access_token;
             getShopOrderList({ token: this.token })
               .then((res) => {
                 if (res.code == 200) {
                   this.orderList = res.data.list;
+                  this.loadingOrders = false;
                 } else {
                   this.$notify.error("鑾峰彇璁㈠崟鍒楄〃澶辫触");
                 }
@@ -404,7 +422,6 @@
       }
       activateVersion({ code: this.secrectKey.trim() })
         .then((res) => {
-          debugger;
           if (res.code == 200) {
             this.$notify.success("婵�娲绘垚鍔�");
             this.validateSn();
@@ -425,7 +442,6 @@
       this.activeDialog = true;
     },
     uploadKey(params) {
-      debugger;
       let param = new FormData();
       param.append("code", params.file);
       uploadKey(param).then(
@@ -674,6 +690,7 @@
   }
 }
 .el-dialog.my-order {
+  border-radius: 24px;
   .el-dialog__body {
     padding: 22px 20px;
   }
@@ -681,7 +698,7 @@
     display: flex;
     justify-content: right;
     .cancel {
-     width: 140px;
+      width: 140px;
 
       height: 40px;
       cursor: pointer;
@@ -695,7 +712,7 @@
       justify-content: center;
     }
     .ok {
-     width: 140px;
+      width: 140px;
       height: 40px;
       cursor: pointer;
       border-radius: 20px;
@@ -710,14 +727,13 @@
     }
   }
   .tip {
-        width: auto;
-    /* height: 40px; */
+    width: auto;
     display: -webkit-box;
     display: -ms-flexbox;
     display: flex;
     padding: 0 10px;
     border-radius: 5px;
-    color: #5F5F5F;
+    color: #5f5f5f;
     line-height: 20px;
     font-weight: bold;
     -ms-flex-align: center;
@@ -742,10 +758,8 @@
     height: 550px;
     overflow-y: auto;
     .order-card {
-      height: 150px;
       background: #fff;
       margin-bottom: 15px;
-
       border-radius: 8px;
       box-shadow: 0px 0px 4px rgb(0 0 0 / 25%);
       .head {
@@ -763,10 +777,12 @@
         display: flex;
         flex-direction: column;
         justify-content: space-evenly;
-        height: 110px;
         text-align: left;
         box-sizing: border-box;
-        padding: 0 20px;
+        font-size: 13px;
+
+        padding: 8px 20px;
+        line-height: 20px;
       }
     }
   }

--
Gitblit v1.8.0