From d365829b14ca4256d39694b9cdcd43bad0ad8595 Mon Sep 17 00:00:00 2001
From: ZZJ <zzjdsg2300@163.com>
Date: 星期五, 11 二月 2022 18:18:39 +0800
Subject: [PATCH] bug修复

---
 src/pages/ai/index/detail.vue |   81 +++++++++++++++++++++++++++-------------
 1 files changed, 55 insertions(+), 26 deletions(-)

diff --git a/src/pages/ai/index/detail.vue b/src/pages/ai/index/detail.vue
index 9dc456b..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
@@ -312,6 +311,7 @@
     detailProductID: {
       type: String,
     },
+    detailPrice: {},
   },
   directives: {
     focus: {
@@ -325,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;
 
@@ -545,7 +550,7 @@
               if (res && res.success) {
                 app.unloadLoading = false;
                 // _this.getAllApps();
-                this.$emit("flushApp")
+                this.$emit("flushApp");
                 window.parent.postMessage(
                   {
                     msg: "AppUpdate",
@@ -557,7 +562,7 @@
                   message: "鍗歌浇搴旂敤鎴愬姛",
                   type: "success",
                 });
-                this.goback()
+                this.goback();
               }
             })
             .catch((e) => {
@@ -766,9 +771,9 @@
                 sdk.unloadLoading = false;
                 this.$notify.success("鍗歌浇瀹屾垚");
                 // _this.getAllSdk();
-                this.$emit("flushSdk")
+                this.$emit("flushSdk");
                 window.parent.postMessage({ msg: "AppUpdate" }, "*");
-                this.goback()
+                this.goback();
               }
             })
             .catch((e) => {
@@ -857,7 +862,7 @@
     inputBlur(item) {
       this.$set(item, "isEdit", false);
     },
-     autoRefreshAppAndSdkState() {
+    autoRefreshAppAndSdkState() {
       this.getAllApps();
       this.getAllSdk();
       if (!this.autoRefresh) {
@@ -871,6 +876,29 @@
           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