Bladeren bron

打包测试会员日体验卡

Foystor 3 jaren geleden
bovenliggende
commit
d58f58b21d
3 gewijzigde bestanden met toevoegingen van 19 en 13 verwijderingen
  1. 1 1
      src/App.vue
  2. 16 11
      src/components/index/personal.vue
  3. 2 1
      src/requests/coupons.js

+ 1 - 1
src/App.vue

@@ -9,7 +9,7 @@ export default {
   onLaunch(options){
       console.log('启动小程序的场景值:', options.scene)
       let scene = options.scene
-      if(scene == 1007 || scene == 1008 || scene == 1035 ){
+      if(scene == 1007 || scene == 1008 || scene == 1035){
         console.log('外发给你哦')
         wx.setStorageSync("is_out", true);
       }else{

+ 16 - 11
src/components/index/personal.vue

@@ -78,8 +78,8 @@
       overlay
       z-index="99"
     >
-      <div class="quan_container padding-top-xl">
-        <view class=" margin-top-xl flex justify-center">
+      <div class="quan_container padding-top-lg">
+        <view class=" margin-top-lg flex justify-center">
               <text class="title" >
                 水母会员次卡体验券1张
               </text>
@@ -91,20 +91,20 @@
               </text>
             </view>
 
-            <view class="flex justify-center margin-top-xl padding-top-xs">
+            <view class="flex justify-center margin-top-xs">
                 <text class="experience time margin-right-xs">
-                10
+                {{gift_time}}
               </text>
               <text class="time_text margin-top-xs">
-                分钟
+                
               </text>
             </view>
-            
+          </div>  
             <view class="flex justify-center margin-top-xl">
               <button class="cu-btn get_btn text-white" @click="get_ticket">领取</button>
             </view>
 
-      </div>
+      
     </van-popup>
 
     <!--    外发领券弹窗-->
@@ -187,12 +187,12 @@
                 </text>
             </view>
-            
+            </div>
             <view class="flex justify-center margin-top-xl">
               <button class="cu-btn get_btn text-white" @click="get_coupon">领取</button>
             </view>
 
-      </div>
+      
     </van-popup>
 
     <!--    窗口弹出-->
@@ -249,7 +249,8 @@ export default {
         discount:{
           type:Number
         }
-      }
+      },
+      gift_time: Number
     };
   },
   methods: {
@@ -364,8 +365,12 @@ export default {
 
     //判断是否每月20号
     let day = new Date().getDate();
-    if (day == 20) {
+    if (day == 19) {
       wx.setStorageSync("is_twenty", true);
+      couponReceiveFirstID().then((res)=>{
+        console.log('体验次卡',res.data.data.discount.time)
+        $this.gift_time = res.data.data.discount.time
+      })
     } else {
       wx.setStorageSync("is_twenty", false);
     }

+ 2 - 1
src/requests/coupons.js

@@ -71,4 +71,5 @@ export function outputCoupon() {
     "access_token": wx.getStorageSync('token'),
   }
   return fly.post('coupon/out-list', $params)
-}
+}
+