From 1e09a7a01a6c1888e1a2a832eb007fb8c2b653a0 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期三, 26 一月 2022 11:06:27 +0800
Subject: [PATCH] Merge branch 'bhomebus' of http://192.168.5.5:10010/r/web/vue-smart-ai into bhomebus

---
 src/pages/desktop/index/components/Desktop.vue |   40 +++++++++++++++++++++++++++-------------
 1 files changed, 27 insertions(+), 13 deletions(-)

diff --git a/src/pages/desktop/index/components/Desktop.vue b/src/pages/desktop/index/components/Desktop.vue
index c14e20e..e9e9615 100644
--- a/src/pages/desktop/index/components/Desktop.vue
+++ b/src/pages/desktop/index/components/Desktop.vue
@@ -11,8 +11,11 @@
     ></safari>
 
     <div class="warn-tag" v-if="showFreeVersion">
-      <span class="text"
+      <span v-if="!snExpire" class="text"
         >璇曠敤鐗堝皻鏈縺娲伙紝浠呮敮鎸侀儴鍒嗗姛鑳戒娇鐢紝濡傞渶浣跨敤鍏ㄩ儴鍔熻兘锛岃灏藉揩婵�娲荤郴缁熴��</span
+      >
+      <span v-else class="text"
+        >SmartAIOS 璇曠敤鏈熷凡鍒版湡锛岃鎮ㄥ敖蹇縺娲荤郴缁�</span
       >
       <span class="go-to" @click="gotoActive">鍓嶅線婵�娲�</span>
       <span class="icon iconfont" @click="showFreeVersion = false"
@@ -22,7 +25,7 @@
 
     <el-dialog
       title="婵�娲籗martAI"
-      :visible.sync="dialogVisible"
+      :visible.sync="activeDialog"
       width="750px"
       :show-close="false"
       :close-on-click-modal="false"
@@ -35,8 +38,8 @@
       <el-divider></el-divider>
       <div class="info">
         濡傛灉杩樻病鏈変骇鍝佸瘑閽ワ紝浣犲彲浠ヤ娇鐢ㄦ墜鏈烘壂鐮佹垨鍓嶅線姝ら摼鎺�
-        <a href="http://os.smartai.com:7004" target="_blank"
-          >http://os.smartai.com:7004</a
+        <a href="http://apps.smartai.com" target="_blank"
+          >http://apps.smartai.com</a
         >
         璐拱銆�
       </div>
@@ -46,7 +49,6 @@
       <div class="ask">
         濡傛灉浣犲叿鏈塖martAI鎻愪緵鐨勪骇鍝佸瘑閽ワ紝璇峰湪姝ゅ杈撳叆婵�娲籗martAI銆�
       </div>
-
       <div class="validate">
         <form id="myForm">
           <el-input
@@ -71,7 +73,8 @@
       </div>
 
       <span slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">缁х画璇曠敤</el-button>
+        <el-button v-if="!snExpire" @click="activeDialog = false">缁х画璇曠敤</el-button>
+        <el-button v-else @click="quit">閫�鍑虹櫥褰�</el-button>
         <el-button type="primary" @click="activateVersion">婵�娲�</el-button>
       </span>
     </el-dialog>
@@ -96,19 +99,24 @@
   data() {
     return {
       showFreeVersion: false,
-      dialogVisible: false,
+      activeDialog: false,
       version: "SmartAI璇曠敤鐗�",
       versionState: "灏氭湭婵�娲�",
       secrectKey: "",
+      snExpire: false
     };
   },
   mounted() {
     this.validateSn();
   },
   methods: {
+    quit(){
+      this.$emit("quit")
+    },
     validateSn() {
       getSN().then((res) => {
-        this.showFreeVersion = res.data.sn == "";
+        this.snExpire = res.data.expire;
+        this.showFreeVersion = res.data.sn == "" || res.data.expire;
       });
     },
     activateVersion() {
@@ -118,11 +126,12 @@
       }
       activateVersion({ code: this.secrectKey.trim() })
         .then((res) => {
+          debugger
           if (res.code == 200) {
             this.$notify.success("婵�娲绘垚鍔�");
             this.validateSn();
             this.goToSysInfo();
-            this.dialogVisible = false;
+            this.activeDialog = false;
           } else {
             this.$notify.error(res.msg);
           }
@@ -135,18 +144,23 @@
       window.parent.postMessage({ msg: `toVindicate?menu=绯荤粺淇℃伅` }, "*");
     },
     gotoActive() {
-      this.dialogVisible = true;
+      this.activeDialog = true;
     },
     uploadKey(params) {
+      debugger;
       let param = new FormData();
       param.append("code", params.file);
       uploadKey(param).then(
         (res) => {
-          this.$message.success("瀵煎叆鎴愬姛");
-          this.secrectKey = res.data;
+          if (res.code == 200) {
+            this.$message.success("瀵煎叆鎴愬姛");
+            this.secrectKey = res.data;
+          } else {
+            this.$message.error(res.msg);
+          }
         },
         (err) => {
-          this.$message.error("瀵煎叆澶辫触");
+          this.$message.error(err.msg);
         }
       );
     },

--
Gitblit v1.8.0