From 27d747817373e0181f0469f3af8817fc0c158751 Mon Sep 17 00:00:00 2001
From: heyujie <516346543@qq.com>
Date: 星期四, 03 三月 2022 16:53:31 +0800
Subject: [PATCH] 我的订单

---
 src/pages/ai/index/detail.vue |  105 +++++++++++++++++++++++++++++++++-------------------
 1 files changed, 67 insertions(+), 38 deletions(-)

diff --git a/src/pages/ai/index/detail.vue b/src/pages/ai/index/detail.vue
index a976d87..7a62b20 100644
--- a/src/pages/ai/index/detail.vue
+++ b/src/pages/ai/index/detail.vue
@@ -38,7 +38,7 @@
             <el-button
               size="mini"
               round
-              v-if="!isActive && showInstallNotActive"
+              v-if="!isActive && (!detailPrice || showInstallNotActive)"
               @click="downloadSdkInSide"
               >瀹夎</el-button
             >
@@ -50,14 +50,14 @@
               clearable
               :autofocus="true"
               v-model="activeCode"
-              v-if="!isActive && !showInstallNotActive"
+              v-if="!isActive && !showInstallNotActive && detailPrice"
             >
             </el-input>
             <el-button
               size="mini"
               round
               class="act-btn"
-              v-if="!isActive && !showInstallNotActive"
+              v-if="!isActive && !showInstallNotActive && detailPrice"
               @click="actived"
               >婵�娲�</el-button
             >
@@ -69,14 +69,14 @@
             > -->
           </div>
         </div>
-        <div class="back-btn" @click="goback">
+        <!-- <div class="back-btn" @click="goback">
           <span class="icon iconfont">&#xe680;</span>
           <span class="back-text">杩斿洖</span>
-        </div>
+        </div> -->
       </div>
       <div class="text-area">
         <div class="text-line">
-          <span class="icon iconfont" >&#xe710;</span>
+          <span class="icon iconfont">&#xe710;</span>
           <span class="title">鐗堟湰锛�</span>
           <span class="desc">{{ productDetail.productVersion }}</span>
         </div>
@@ -144,7 +144,7 @@
           class="rec-item"
           v-for="(item, index) in otherProducts"
           :key="index"
-            @click="checkInWindow(item)"
+          @click="checkInWindow(item)"
         >
           <div class="icon-img">
             <img
@@ -165,7 +165,6 @@
             <el-button
               size="small"
               type="primary"
-             
               round
               @click="checkInWindow(item)"
               >鏌ョ湅</el-button
@@ -275,7 +274,6 @@
       isSDKDetail: true,
       actType: "",
       actId: "",
-      input3: "",
       select: "",
       activedSdkOrApp: {
         activateCode: "",
@@ -288,8 +286,8 @@
       installedApps: [],
       storeApps: [],
       installFile: {},
-      appUpgreading: true,
-      sdkUpgreading: true,
+      appUpgreading: false,
+      sdkUpgreading: false,
       autoRefresh: true,
       productDetailVisible: false,
       isUpgrading: false,
@@ -313,6 +311,7 @@
     detailProductID: {
       type: String,
     },
+    detailPrice: {},
   },
   directives: {
     focus: {
@@ -326,15 +325,20 @@
     this.autoRefreshAppAndSdkState();
     this.getUnActivedList();
     this.getUnActivedAppList();
+    this.showBackBtn();
+    this.addBackListener();
   },
   beforeDestroy() {
     this.autoRefresh = false;
+    this.hiddenBackBtn();
   },
   methods: {
     getDetail(id) {
       getAppDetail({ id: id || this.detailProductID })
         .then((res) => {
           if (res.success) {
+            console.log("----------");
+            console.log(res);
             this.productDetail = res.data.detail;
             this.otherProducts = res.data.randoms;
 
@@ -517,7 +521,6 @@
           );
           if (obj.progressMsg !== "" && obj.progressMsg !== "宸插畨瑁�") {
             obj.upgradeLoading = true;
-
             this.appUpgreading = true;
           }
 
@@ -546,7 +549,8 @@
             .then((res) => {
               if (res && res.success) {
                 app.unloadLoading = false;
-                _this.getAllApps();
+                // _this.getAllApps();
+                this.$emit("flushApp");
                 window.parent.postMessage(
                   {
                     msg: "AppUpdate",
@@ -558,6 +562,7 @@
                   message: "鍗歌浇搴旂敤鎴愬姛",
                   type: "success",
                 });
+                this.goback();
               }
             })
             .catch((e) => {
@@ -725,7 +730,6 @@
           );
           if (obj.progressMsg !== "" && obj.progressMsg !== "宸插畨瑁�") {
             obj.upgradeLoading = true;
-
             this.sdkUpgreading = true;
           }
 
@@ -766,8 +770,10 @@
               if (res && res.success) {
                 sdk.unloadLoading = false;
                 this.$notify.success("鍗歌浇瀹屾垚");
-                _this.getAllSdk();
+                // _this.getAllSdk();
+                this.$emit("flushSdk");
                 window.parent.postMessage({ msg: "AppUpdate" }, "*");
+                this.goback();
               }
             })
             .catch((e) => {
@@ -857,20 +863,42 @@
       this.$set(item, "isEdit", false);
     },
     autoRefreshAppAndSdkState() {
-      // 鍏抽棴鍚庨��鍑�
+      this.getAllApps();
+      this.getAllSdk();
       if (!this.autoRefresh) {
         return;
       }
-      if (this.appUpgreading) {
-        this.getAllApps();
-      }
-      if (this.sdkUpgreading) {
-        this.getAllSdk();
-      }
-      let _this = this;
       setTimeout(() => {
-        _this.autoRefreshAppAndSdkState();
-      }, 500);
+        if (this.appUpgreading) {
+          this.getAllApps();
+        }
+        if (this.sdkUpgreading) {
+          this.getAllSdk();
+        }
+      }, 1000);
+    },
+    showBackBtn() {
+      window.parent.postMessage(
+        {
+          msg: "showBack",
+        },
+        "*"
+      );
+    },
+    hiddenBackBtn() {
+      window.parent.postMessage(
+        {
+          msg: "hiddenBack",
+        },
+        "*"
+      );
+    },
+    addBackListener() {
+      window.addEventListener("message", (e) => {
+        if (e.data.msg === "杩斿洖搴旂敤涓績") {
+          this.goback();
+        }
+      });
     },
   },
 };
@@ -1009,8 +1037,7 @@
         height: 25px;
         .icon {
           font-size: 14px;
-           margin-right: 4px;
-
+          margin-right: 4px;
         }
         .title {
           font-size: 12px;
@@ -1042,16 +1069,13 @@
         margin-bottom: 10px;
 
         .title {
-          width: 80px;
-          height: 20px;
+          display: inline-block;
+          line-height: 20px;
+          padding: 0px 10px;
           letter-spacing: 0.5px;
           font-size: 12px;
           color: #828282;
-          display: flex;
-          align-items: center;
-          justify-content: center;
           font-weight: bold;
-          border: 1px solid;
           border: 1px solid #e0e0e0;
           box-sizing: border-box;
           border-radius: 22px;
@@ -1122,9 +1146,14 @@
           font-size: 14px;
           font-weight: bold;
           line-height: 28px;
+          width: 116px;
           height: 28px;
           letter-spacing: 0.1px;
           color: #4f4f4f;
+
+          overflow: hidden;
+          white-space: nowrap;
+          text-overflow: ellipsis;
         }
         .desc-2 {
           font-size: 12px;
@@ -1136,11 +1165,11 @@
         .el-button {
           padding: 3px 12px;
           border-radius: 22px;
-            background-color: #f2f2f7 !important;
-                border-color: #f2f2f7 !important;
-                color: #4f4f4f;
-                font-size: 12px;
-                font-weight: bold;
+          background-color: #f2f2f7 !important;
+          border-color: #f2f2f7 !important;
+          color: #4f4f4f;
+          font-size: 12px;
+          font-weight: bold;
         }
         // .el-button--primary:hover {
         //   background: #089fb3 !important;

--
Gitblit v1.8.0