소스 검색

fix:pc端我的奖券更改

yangfeng 3 년 전
부모
커밋
8da0483dd8

+ 14 - 0
src/web/staticres/frontRouter/pc/coupon/css/coupon-list.css

@@ -298,4 +298,18 @@
 }
 .coupon-item .coupon-yellow-color{
   color: #ff9f40;
+}
+.custom-toast .toast-container{
+  /* display: none; */
+  position: fixed;
+  top: 50%;
+  left: 50%;
+  width: auto;
+  padding: 16px 32px;
+  font-size: 16px;
+  background: rgba(0, 0, 0, 0.65);
+  border-radius: 8px;
+  color: #fff;
+  transform: translateX(-50%) translateY(-50%);
+  z-index: 99;
 }

+ 1 - 1
src/web/staticres/frontRouter/pc/coupon/js/coupon-item-template.js

@@ -63,7 +63,7 @@ var couponItemString = `
             <div class="product-list">
                 <div class="product-item" :class="productions.length - 1 == index ? 'last' : ''" v-for="(item,index) in productions" :key="index">
                     <span class="product-name ellipsis">{{ item.name }}</span>
-                    <a class="product-action" :href="item.url" target="_blank">去使用</a>
+                    <a class="product-action" @click="toUseFn(item.url)" href="javascript:;">去使用</a>
                 </div>
             </div>
         </el-popover>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
src/web/staticres/frontRouter/pc/coupon/js/coupon-item-template.min.js


+ 21 - 0
src/web/staticres/frontRouter/pc/coupon/js/coupon-list.js

@@ -114,6 +114,27 @@ Vue.component('coupon-item', {
                 trigger: 'hover'
             }
         }
+    },
+    methods: {
+      toUseFn: function (url) {
+        if (url) {
+          window.open(url)
+        } else {
+          this.toastFn('PC端暂无该产品,请前往移动端使用', 5000)
+        }
+      },
+      toastFn: function (text, duration) {
+        if (duration) {
+          duration = 3000
+        }
+        var _html = ""
+        _html+='<div class="custom-toast"><div class="mask" style="background-color: transparent;"></div><div class="toast-container">'
+        _html+='<span>' + text + '</span></div></div>'
+        $('body').append(_html)
+        setTimeout(function(){
+          $(".custom-toast").fadeOut().remove();
+        },duration)
+      }
     }
 })
 

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.