Explorar el Código

12/23 vip商品文案 & 开始游戏弹窗及报告加载弹窗的显示

Foystor hace 3 años
padre
commit
77e002d056

+ 96 - 124
src/components/index/personal.vue

@@ -190,8 +190,14 @@
 </template>
 
 <script>
-import { userUpdateLoginTime} from "../../requests/user";
-import { couponReceiveFirst, couponReceiveFirstID, outputCoupon, couponReceive, outCardCoupon } from "../../requests/coupons";
+import { userUpdateLoginTime } from "../../requests/user";
+import {
+  couponReceiveFirst,
+  couponReceiveFirstID,
+  outputCoupon,
+  couponReceive,
+  outCardCoupon,
+} from "../../requests/coupons";
 import Toast from "../../../static/vant/toast/toast";
 import { reload_userinfo } from "../../utils/user";
 import { timestampTwoNum } from "../../utils/index";
@@ -213,14 +219,14 @@ export default {
       // 外发
       output: false,
       is_outShow: false,
-      outCouponData:{
-        type:Number,
-        validity_time:{
-          type:Number
+      outCouponData: {
+        type: Number,
+        validity_time: {
+          type: Number,
+        },
+        discount: {
+          type: Number,
         },
-        discount:{
-          type:Number
-        }
       },
       // gift_time: Number
     };
@@ -260,29 +266,31 @@ export default {
     //   }
     // },
     //领取外发卡券
-    get_coupon(){
-       wx.setStorageSync("is_out", false);
-       couponReceive($this.outCouponData).then((res) => {
-        let $res = res.data;
-        if ($res.code == 0) {
-          Toast.success({
-            message: $res.errmsg,
-            duration:800,
-            onClose() {
-              reload_userinfo($this);
-            }
-          })
-          $this.is_outShow = false
-        } else {
-          Toast.fail({
-            message: $res.errmsg,
-            duration:800,
-          })
-          $this.is_outShow = false
-        }
-      }).catch((err)=>{
-        console.log("错误",err)
-      })
+    get_coupon() {
+      wx.setStorageSync("is_out", false);
+      couponReceive($this.outCouponData)
+        .then((res) => {
+          let $res = res.data;
+          if ($res.code == 0) {
+            Toast.success({
+              message: $res.errmsg,
+              duration: 800,
+              onClose() {
+                reload_userinfo($this);
+              },
+            });
+            $this.is_outShow = false;
+          } else {
+            Toast.fail({
+              message: $res.errmsg,
+              duration: 800,
+            });
+            $this.is_outShow = false;
+          }
+        })
+        .catch((err) => {
+          console.log("错误", err);
+        });
     },
     //修改第一次登录状态
     close_pop() {
@@ -308,51 +316,54 @@ export default {
     change_login_status() {
       $this.$emit("change_login_status");
     },
+    // 外发通用数据处理
+    handle_coupon_data(res) {
+      if (res.data.code == 0) {
+        let $newData = res.data.data;
+        $newData.validity_time["start_time_format"] = timestampTwoNum(
+          $newData.validity_time["start_time"]
+        );
+        $newData.validity_time["end_time_format"] = timestampTwoNum(
+          $newData.validity_time["end_time"]
+        );
+        $newData.validity_time["time_format"] = timestampTwoNum(
+          $newData.validity_time["time"]
+        );
+
+        $this.outCouponData = $newData;
+        console.log("外发数据:", $this.outCouponData);
+        $this.is_outShow = true;
+      } else {
+        wx.setStorageSync("is_out", false);
+        $this.output = false;
+      }
+    },
+    // 获取不同外发券
+    check_output_coupon() {
+      //外发
+      $this.output = wx.getStorageSync("is_out");
+      reload_userinfo($this);
+
+      //获取外发数据
+      if ($this.output == true) {
+        // 判断外发哪种券
+        if (wx.getStorageSync("is_other") == false) {
+          outputCoupon().then((res) => {
+            handle_coupon_data(res)
+          });
+        } else {
+          outCardCoupon().then((res) => {
+            handle_coupon_data(res)
+          });
+        }
+      }
+    },
   },
   mounted() {
     $this.first = wx.getStorageSync("is_first");
     $this.invite_code = wx.getStorageSync("code");
-    //外发
-    $this.output = wx.getStorageSync("is_out");
-    reload_userinfo($this);
-    
-    //获取外发数据
-    if($this.output == true){
-      // 判断外发哪种券
-      if(wx.getStorageSync("is_other") == false){
-         outputCoupon().then((res)=>{
-         if(res.data.code == 0){
-           let $newData = res.data.data
-           $newData.validity_time['start_time_format'] = timestampTwoNum($newData.validity_time['start_time'])
-           $newData.validity_time['end_time_format'] = timestampTwoNum($newData.validity_time['end_time'])
-           $newData.validity_time['time_format'] = timestampTwoNum($newData.validity_time['time'])
-
-           $this.outCouponData = $newData
-           console.log('外发数据:',$this.outCouponData)
-           $this.is_outShow = true
-         }else{
-           wx.setStorageSync("is_out", false);
-           $this.output = false
-         }
-       })
-      }else{
-        outCardCoupon().then((res)=>{
-         if(res.data.code == 0){
-           let $newData = res.data.data
-           $newData.validity_time['start_time_format'] = timestampTwoNum($newData.validity_time['start_time'])
-           $newData.validity_time['end_time_format'] = timestampTwoNum($newData.validity_time['end_time'])
-           $newData.validity_time['time_format'] = timestampTwoNum($newData.validity_time['time'])
 
-           $this.outCouponData = $newData
-           console.log('外发数据:',$this.outCouponData)
-           $this.is_outShow = true
-         }else{
-           wx.setStorageSync("is_out", false);
-           $this.output = false
-         }
-       })
-      }  
-    }
+    $this.check_output_coupon();
 
     //判断是否每月20号
     // let day = new Date().getDate();
@@ -369,48 +380,7 @@ export default {
     // console.log("可以领注册体验券吗", $this.first & $this.twenty);
   },
   onShow() {
-    //外发
-    $this.output = wx.getStorageSync("is_out");
-
-    reload_userinfo($this);
-
-    // 获取外发信息
-    if($this.output == true){
-    // 判断外发哪种券
-    if(wx.getStorageSync("is_other") == false){
-       outputCoupon().then((res)=>{
-       if(res.data.code == 0){
-         let $newData = res.data.data
-         $newData.validity_time['start_time_format'] = timestampTwoNum($newData.validity_time['start_time'])
-         $newData.validity_time['end_time_format'] = timestampTwoNum($newData.validity_time['end_time'])
-         $newData.validity_time['time_format'] = timestampTwoNum($newData.validity_time['time'])
-
-         $this.outCouponData = $newData
-         console.log('外发数据:',$this.outCouponData)
-         $this.is_outShow = true
-       }else{
-         wx.setStorageSync("is_out", false);
-         $this.output = false
-       }
-     })
-    }else{
-      outCardCoupon().then((res)=>{
-       if(res.data.code == 0){
-         let $newData = res.data.data
-         $newData.validity_time['start_time_format'] = timestampTwoNum($newData.validity_time['start_time'])
-         $newData.validity_time['end_time_format'] = timestampTwoNum($newData.validity_time['end_time'])
-         $newData.validity_time['time_format'] = timestampTwoNum($newData.validity_time['time'])
-
-         $this.outCouponData = $newData
-         console.log('外发数据:',$this.outCouponData)
-         $this.is_outShow = true
-       }else{
-         wx.setStorageSync("is_out", false);
-         $this.output = false
-       }
-     })
-    }  
-  }
+    $this.check_output_coupon();
   },
   created() {
     $this = this;
@@ -469,16 +439,16 @@ export default {
   background-size: 100% 100%;
   width: 270px;
   height: 235px;
-  padding-left: 5px
+  padding-left: 5px;
 }
-.quan_container_lil{
+.quan_container_lil {
   background-image: url("https://img.shuimuai.com/pic_getCouponlil.png");
   background-position: center;
   background-size: 100% 100%;
   width: 185px;
   height: 56px;
   display: flex;
-  align-items: center
+  align-items: center;
 }
 /*标题*/
 .quan_container .title {
@@ -500,29 +470,31 @@ export default {
 /*分钟数*/
 .quan_container .time {
   font-weight: bold;
-  color: #6858C4;
+  color: #6858c4;
 }
-.hexiao,.discount,.experience{
+.hexiao,
+.discount,
+.experience {
   font-size: 36px;
 }
-.random{
+.random {
   font-size: 19px;
 }
-.manjian{
+.manjian {
   font-size: 24px;
 }
 /*分钟二字*/
 .quan_container .time_text {
   font-size: 12px;
   font-weight: 400;
-  color: #6858C4;
+  color: #6858c4;
 }
 
 /* 领取按钮 */
-.get_btn{
+.get_btn {
   width: 119px;
   height: 31px;
-  background: #6858C4;
+  background: #6858c4;
   border-radius: 15px;
 }
 /*弹窗模块*/

+ 7 - 6
src/pages/index/index.vue

@@ -189,12 +189,13 @@ export default {
     //     });
     //   },
     // });
-    userDetail().then((res) => {
-      let $data = res.data;
-      //判断如果是第一次登录就 弹出领取体验卡
-      $this.userinfo = $data.data;
-      user_store.setters.set_userinfo($this.userinfo);
-    });
+    
+    // userDetail().then((res) => {
+    //   let $data = res.data;
+    //   //判断如果是第一次登录就 弹出领取体验卡
+    //   $this.userinfo = $data.data;
+    //   user_store.setters.set_userinfo($this.userinfo);
+    // });
   },
   onHide() {
   },

+ 3 - 1
src/pages/report/index.vue

@@ -750,7 +750,9 @@ export default {
       });
       gameDetail($record_id).then(
         (res) => {
-          Toast.clear();
+          wx.nextTick(() => {
+            Toast.clear();
+          });
           let $res = res.data;
 
           $this.report_show = $res.data.line.length > 0;

+ 12 - 10
src/pages/user_center/recharge/index.vue

@@ -36,19 +36,19 @@
       >
         <van-row>
           <van-col
-            span="10"
+            span="9"
             offset="6"
           >
             <div
               class="card_body"
               style="padding-top:14px;"
             >
-              <view>
+              <view class="margin-bottom">
                 <!-- <text class="mine_min  text-white">{{ item.play_time }}</text> -->
-                <text class="text-white">&nbsp;分钟</text>
+                <text class="text-white text-lg" v-text="vip_text[index]"></text>
               </view>
               <view>
-                <text class="text-white text-sm subGrey">{{ item.title1 }}</text>
+                <text class="text-white subGrey">{{ item.title1 }}</text>
               </view>
 
             </div>
@@ -58,7 +58,7 @@
 
           <van-col
             span="6"
-            offset="1"
+            offset="2"
           >
             <div class="card_body">
 
@@ -148,13 +148,14 @@
             <div
               class="card_body"
               style="padding-top:14px;"
+              :class="index==0?'relax_text':'hard_text'"
             >
               <view>
-                <text class="mine_min" :class="index==0?'relax_text':'hard_text'">{{ item.play_time }}</text>
-                <text :class="index==0?'relax_text':'hard_text'">&nbsp;分钟</text>
+                <text class="mine_min">{{ item.play_time }}</text>
+                <text>&nbsp;分钟</text>
               </view>
               <view>
-                <text class="text-white text-sm subGrey">{{ item.title1 }}</text>
+                <text class="subGrey">{{ item.title1 }}</text>
               </view>
 
             </div>
@@ -293,6 +294,8 @@ export default {
       userinfo: {},
       //  选中的充值卡
       selection_card: {},
+      // 家庭vip文字
+      vip_text:["包月","包季","包年"],
       // vip购买提示弹窗
       vip_err_show:false,
       cant_buy_vip:"",
@@ -700,10 +703,9 @@ export default {
   margin-left: -8px;
 }
 .subGrey {
-  font-size: 10px;
+  font-size: 11px;
   font-family: Microsoft YaHei;
   font-weight: 400;
-  color: #ffffff;
   opacity: 0.8;
 }
 .price {