Jelajahi Sumber

手机端非标产品提示

yangc 7 tahun lalu
induk
melakukan
62ca4f8dee

+ 23 - 10
components/mobile/common/RemindBox.vue

@@ -1,5 +1,7 @@
 <template>
-  <div class="com-remind-box" v-show="showBox">{{title}}</div>
+  <div class="com-remind-box" v-show="showBox">
+    <div>{{title}}</div>
+  </div>
 </template>
 <script>
   export default {
@@ -24,25 +26,36 @@
       setTimer: function () {
         let _this = this
         _this.showBox = true
+        let timeout = 1000
+        if (_this.title === '收藏成功' || _this.title === '取消成功') {
+          timeout = 1000
+        } else {
+          timeout = 2000
+        }
         _this.timer = setTimeout(function () {
           _this.showBox = false
-        }, 1000)
+        }, timeout)
       }
     }
   }
 </script>
-<style>
+<style lang="scss" scoped>
   .com-remind-box{
     position: fixed;
     top: 50%;
-    left: 50%;
-    margin-left: -1.07rem;
+    left: 0;
+    right: 0;
     margin-top: -.6rem;
     z-index: 100;
-    background: rgba(0,0,0,.6);
-    color: #fff;
-    font-size: .28rem;
-    padding: .44rem .51rem;
-    border-radius: .1rem;
+    div {
+      background: rgba(0,0,0,.6);
+      color: #fff;
+      font-size: .28rem;
+      padding: .44rem .51rem;
+      border-radius: .1rem;
+      width: max-content;
+      margin: 0 auto;
+      max-width: 70%;
+    }
   }
 </style>

+ 6 - 1
components/mobile/store/StoreDetail.vue

@@ -177,7 +177,12 @@
         }
       },
       goProductDetail: function (uuid) {
-        this.$router.push('/mobile/brand/componentDetail/' + uuid)
+        if (uuid) {
+          this.$router.push('/mobile/brand/componentDetail/' + uuid)
+        } else {
+          this.collectResult = '卖家上传的产品暂无参数,请联系卖家了解具体详情。'
+          this.timeoutCount ++
+        }
       },
       collectStore: function () {
         if (this.user.logged) {

+ 6 - 1
pages/mobile/search/_keycode.vue

@@ -176,7 +176,12 @@
       },
       goComponent: function (uuid) {
         if (!this.isClickCollect) {
-          this.$router.push('/mobile/brand/componentDetail/' + uuid)
+          if (uuid) {
+            this.$router.push('/mobile/brand/componentDetail/' + uuid)
+          } else {
+            this.collectResult = '卖家上传的产品暂无参数,请联系卖家了解具体详情。'
+            this.timeoutCount++
+          }
         } else {
           this.isClickCollect = false
         }