Explorar o código

7/22过期变灰

Foystor %!s(int64=3) %!d(string=hai) anos
pai
achega
daf4700b7c

+ 2 - 1
config/prod.env.js

@@ -1,4 +1,5 @@
 module.exports = {
   NODE_ENV: '"production"',
-  REQUEST_URI: "'https://api.shuimuai.com/'"
+  // REQUEST_URI: "'https://api.shuimuai.com/'"
+  REQUEST_URI:"'https://testapi.shuimuai.com/'"
 }

+ 54 - 29
project.config.json

@@ -1,32 +1,57 @@
 {
-    "description": "项目配置文件。",
-    "setting": {
-        "urlCheck": true,
-        "es6": false,
-        "postcss": true,
-        "minified": true,
-        "newFeature": true
+  "description": "项目配置文件。",
+  "setting": {
+    "urlCheck": false,
+    "es6": true,
+    "enhance": false,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "nodeModules": false,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "uglifyFileName": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "compileHotReLoad": false,
+    "useMultiFrameRuntime": true,
+    "useApiHook": true,
+    "useApiHostProcess": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
     },
-    "miniprogramRoot": "dist/wx/",
-    "compileType": "miniprogram",
-    "appid": "wx6ae2b756f0f6b9ec",
-    "projectname": "mpapp",
-    "condition": {
-        "search": {
-            "current": -1,
-            "list": []
-        },
-        "conversation": {
-            "current": -1,
-            "list": []
-        },
-        "game": {
-            "currentL": -1,
-            "list": []
-        },
-        "miniprogram": {
-            "current": -1,
-            "list": []
-        }
+    "bundle": false,
+    "useIsolateContext": true,
+    "useCompilerModule": true,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "userConfirmedBundleSwitch": false,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true
+  },
+  "miniprogramRoot": "dist/wx/",
+  "compileType": "miniprogram",
+  "projectname": "mpapp",
+  "appid": "wx6ae2b756f0f6b9ec",
+  "condition": {
+    "search": {
+      "list": []
+    },
+    "conversation": {
+      "list": []
+    },
+    "game": {
+      "currentL": -1,
+      "list": []
+    },
+    "miniprogram": {
+      "list": []
     }
-}
+  }
+}

+ 30 - 0
project.private.config.json

@@ -0,0 +1,30 @@
+{
+  "setting": {},
+  "condition": {
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "name": "pages/index/main",
+          "pathName": "pages/index/main",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "pages/coupons/main",
+          "pathName": "pages/coupons/main",
+          "query": "",
+          "scene": null
+        }
+      ]
+    }
+  }
+}

+ 0 - 3
src/App.vue

@@ -51,9 +51,6 @@ export default {
   height: 241px;
 }
 
-#container {
-
-}
 
 .title_color {
   color: #4C4C4C;

+ 80 - 63
src/components/index/personal.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="personal">
     <!--    用户信息-->
-    <div class="userinfo">
+    <div :class="{userinfoYellow:userinfo.isActive, userinfoGrey:userinfo.isntActive}" >
       <van-row class="padding">
         <van-col span="3" offset="2">
           <view class="cu-avatar radius lg" :style="'background-image:url('+userinfo.portrait+');'"></view>
@@ -12,7 +12,7 @@
               <text class="text-black text-bold">{{ userinfo.user_name }}</text>
             </div>
             <div class="flex justify-between align-center">
-              <button class="cu-btn sm round level_btn">
+              <button class="cu-btn sm round" :class="{level_btn_yellow:userinfo.isActive, level_btn_grey:userinfo.isntActive}">
                 {{ userinfo.level_name }}
 
               </button>
@@ -72,7 +72,7 @@
 
     <!--    领券弹窗-->
     <van-popup
-      :show="first"
+      :show="twenty&first"
       :close-on-click-overlay="false"
       custom-class="pop"
       overlay
@@ -81,17 +81,15 @@
       <div class="quan_container">
         <van-row gutter="10">
           <van-col span="14" offset="1">
-            <div class="padding-top-sm">
+            <div class="padding-top-sm margin-bottom-sm">
               <text class="title">
                 水母会员次卡体验券1张
               </text>
-            </div>
-            <div>
-              <text class="subtitle">
-                新人有效
+                <text class="text-xs ">
+                {{userinfo.certainTime}}&nbsp;当天领取有效
               </text>
             </div>
-
+            
             <view class="padding-tb">
               <text class="time">
                 10
@@ -133,13 +131,13 @@
 </template>
 
 <script>
-import {userUpdateLoginTime} from "../../requests/user";
-import {couponReceiveFirst} from "../../requests/coupons";
-import Toast from '../../../static/vant/toast/toast';
-import {reload_userinfo} from "../../utils/user";
-import user_store from '@/store/index'
+import { userUpdateLoginTime } from "../../requests/user";
+import { couponReceiveFirst } from "../../requests/coupons";
+import Toast from "../../../static/vant/toast/toast";
+import { reload_userinfo } from "../../utils/user";
+import user_store from "@/store/index";
 
-var $this
+var $this;
 export default {
   name: "personal",
   data() {
@@ -150,90 +148,107 @@ export default {
       first: false,
       pop_show: false,
       receive: 0,
-      invite_code: false
-    }
+      invite_code: false,
+      twenty: false,
+    };
   },
   methods: {
     get_ticket() {
-      if ($this.receive==0){
-        $this.receive +=1
-        console.log($this.receive)
-        $this.first = false
+      if ($this.receive == 0) {
+        $this.receive += 1;
+        console.log($this.receive);
+        $this.first = false;
         couponReceiveFirst().then((res) => {
           let $res = res.data;
           if ($res.code == 0) {
-            $this.first = false
+            $this.first = false;
             userUpdateLoginTime().then((res) => {
-              let $res = res.data
-              $this.userinfo['login_time'] = $res.data
-              $this.$store = user_store.setters.set_userinfo($this.userinfo)
-
-              wx.setStorageSync("is_first", false)
-              reload_userinfo($this)
-            })
-            Toast.success($res.errmsg)
+              let $res = res.data;
+              $this.userinfo["login_time"] = $res.data;
+              $this.$store = user_store.setters.set_userinfo($this.userinfo);
+
+              wx.setStorageSync("is_first", false);
+              reload_userinfo($this);
+            });
+            Toast.success($res.errmsg);
           } else {
-            Toast.fail($res.errmsg)
+            Toast.fail($res.errmsg);
           }
-        })
+        });
       }
     },
     //修改第一次登录状态
     close_pop() {
-      this.pop_show = false
+      this.pop_show = false;
     },
     //跳转充值中心
     to_recharge() {
       mpvue.navigateTo({
-        url: "/pages/user_center/recharge/main"
-      })
+        url: "/pages/user_center/recharge/main",
+      });
     },
     //跳转用户中心
     to_user_center() {
       mpvue.navigateTo({
-        url: "/pages/user_center/main"
-      })
+        url: "/pages/user_center/main",
+      });
     },
     to_coupons() {
       mpvue.navigateTo({
-        url: "/pages/coupons/main"
-      })
+        url: "/pages/coupons/main",
+      });
     },
     change_login_status() {
-      $this.$emit('change_login_status')
-    }
+      $this.$emit("change_login_status");
+    },
   },
   mounted() {
-    $this.first = wx.getStorageSync('is_first')
-    $this.invite_code = wx.getStorageSync('code')
-    reload_userinfo($this)
-  }
-  ,
+    $this.first = wx.getStorageSync("is_first");
+    $this.invite_code = wx.getStorageSync("code");
+    reload_userinfo($this);
+
+    //判断是否每月20号
+    let day = new Date().getDate();
+    if (day == 20) {
+      wx.setStorageSync("is_twenty", true);
+    } else {
+      wx.setStorageSync("is_twenty", false);
+    }
+    $this.twenty = wx.getStorageSync("is_twenty");
+    console.log("状态", $this.first & $this.twenty);
+  },
   onShow() {
-    reload_userinfo($this)
-  }
-  ,
+    reload_userinfo($this);
+  },
   created() {
-    $this = this
+    $this = this;
   },
   onPullDownRefresh() {
-    reload_userinfo($this)
+    reload_userinfo($this);
   },
-}
+};
 </script>
 
 
 <style scoped>
-.userinfo {
+.userinfoYellow {
   background-image: url("https://img.shuimuai.com/huiyuankadiban.png");
   background-position: center;
   background-size: 100% 100%;
-  width: 95%;
-  height: 181px;
+  width: 99%;
+  height: 173px;
   margin: 0px auto;
-
 }
 
+.userinfoGrey {
+  background-image: url("https://img.shuimuai.com/pic_grey.png");
+  /* background-image: url("https://img.shuimuai.com/huiyuankadiban.png"); */
+  background-position: center;
+  background-size: 100% 100%;
+  width: 99%;
+  height: 173px;
+  margin: 0px auto;
+}
 #personal {
   width: 100%;
   position: relative;
@@ -241,10 +256,13 @@ export default {
   z-index: 3;
 }
 
-.level_btn {
-  background-color: #E3A000;
+.level_btn_yellow {
+  background-color: #e3a000;
 }
 
+.level_btn_grey {
+  background-color: #909090;
+}
 .jifen {
   position: absolute;
   top: 73px;
@@ -268,7 +286,6 @@ export default {
   font-weight: 400;
   color: #030000;
   line-height: 24px;
-
 }
 
 /*子标题*/
@@ -277,7 +294,6 @@ export default {
   font-weight: 400;
   color: #030000;
   line-height: 24px;
-
 }
 
 /*分钟数*/
@@ -294,13 +310,14 @@ export default {
   font-weight: 400;
   color: #030000;
   line-height: 24px;
+  margin-left: -5px;
 }
 
 /*领取二字*/
 .quan_container .get_ticket_text {
   font-size: 18px;
   font-weight: 400;
-  color: #FFFFFF;
+  color: #ffffff;
   line-height: 24px;
   margin: 45px 0px;
 }
@@ -316,7 +333,7 @@ export default {
 .err_container .title {
   font-size: 20px;
   font-weight: bold;
-  color: #4C4C4C;
+  color: #4c4c4c;
   line-height: 24px;
 }
 
@@ -325,7 +342,7 @@ export default {
   font-size: 12px;
   font-family: Microsoft YaHei;
   font-weight: 400;
-  color: #4B4B4B;
+  color: #4b4b4b;
   line-height: 24px;
 }
 

+ 99 - 31
src/pages/user_center/recharge/index.vue

@@ -1,10 +1,10 @@
 <template>
-  <div class="uc_recharge_container">
+  <div class="uc_recharge_container margin-bottom-xl">
     <!--    头部卡片-->
     <div class="mine padding">
       <div class="flex justify-between">
         <view>
-          <text class="text-gray">当前剩余时长(分钟)</text>
+          <text class="gray">当前剩余时长(分钟)</text>
         </view>
         <view @click="to_orderlist">
           <text class="cuIcon-calendar"></text>
@@ -12,20 +12,21 @@
         </view>
       </div>
       <view>
-        <text class="text-bold mine_min">{{ userinfo.play_time }}</text>
+        <text class="mine_min">{{ userinfo.play_time }}</text>
       </view>
     </div>
 
     <!--    标题-->
-    <div class="title flex padding align-center">
-      <div class="line margin-right"></div>
-      <text>会员升级</text>
+    <div class="title flex padding-left align-center margin-top-xl margin-bottom-xs">
+      <div class="line margin-right-xs "></div>
+      <text class="titles">会员升级</text>
     </div>
 
     <!--    黄金会员-->
     <div
       v-for="(item,index) in time_cards"
       :key="index"
+      class="margin-bottom-df"
     >
       <div
         class="vip"
@@ -43,26 +44,28 @@
             >
               <view>
                 <text class="mine_min  text-white">{{ item.play_time }}</text>
-                <text class="text-white">分钟</text>
+                <text class="text-white">&nbsp;分钟</text>
               </view>
               <view>
-                <text class="text-white text-sm">{{ item.title1 }}</text>
+                <text class="text-white text-sm subGrey">{{ item.title1 }}</text>
               </view>
 
             </div>
           </van-col>
 
+          
+
           <van-col
             span="6"
             offset="1"
           >
             <div class="card_body">
 
-              <view>
+              <view class="price">
                 <text class="text-white text-sm">价格</text>
               </view>
               <view class="text-center">
-                <text class="text-white mine_min">{{ item.price }} <text class="text-white text-sm">&yen;</text> </text>
+                <text class="text-white mine_min_litt">{{ item.price }} <text class="text-white text-sm"></text> </text>
               </view>
               <view class="text-center">
                 <img
@@ -88,35 +91,40 @@
       <view v-if="card_action_show == item.goods_id">
 
         <!--    描述-->
+        <view class="flex justify-center">
         <view
           class="desc"
           v-html="item.content"
         >
 
         </view>
+        </view>
 
         <!--    购买按钮-->
         <div class="buy_button">
           <button
-            class="cu-btn lg bg-orange text-center margin "
+            class="cu-btn lg bg-orange text-center margin yellowButt"
             @click="open_order_confirm(item)"
           >购买{{item.goods_name}}</button>
         </div>
       </view>
     </div>
 
-    <div class="title flex padding align-center">
-      <div class="line margin-right"></div>
-      <text>体验次卡</text>
+
+    <div class="title flex padding-left align-center margin-top-lg margin-bottom-xs">
+      <div class="line margin-right-xs"></div>
+      <text class="titles">体验次卡</text>
     </div>
     <!--  体验次卡-->
     <div
       v-for="(item,index) in frequency_card"
       :key="index"
+      class="margin-bottom-df"
     >
 
       <div
-        class="normal vip"
+        class="vip"
+        :class="item.bgBott"
         @click="changeCardShow(item.goods_id)"
       >
         <van-row>
@@ -129,11 +137,11 @@
               style="padding-top:14px;"
             >
               <view>
-                <text class="mine_min  text-white">{{ item.play_time }}</text>
-                <text class="text-white"></text>
+                <text class="mine_min  text-white">{{ item.title2 }}</text>
+                <text class="text-white">&nbsp;{{ item.date }}</text>
               </view>
               <view>
-                <text class="text-white text-sm">{{ item.title1 }}</text>
+                <text class="text-white text-sm subGrey">{{ item.title1 }}</text>
               </view>
 
             </div>
@@ -145,12 +153,13 @@
           >
             <div class="card_body">
 
-              <view>
+              <view class="price">
                 <text class="text-white text-sm">价格</text>
               </view>
               <view class="text-center">
-                <text class="text-white mine_min">{{ item.price }} <text class="text-white text-sm">&yen;</text> </text>
+                <text class="text-white mine_min_litt">{{ item.price }}</text>
               </view>
+               <view class="text-center">
               <img
                 src="https://img.shuimuai.com/web/btn_seedetil_1%402x.png"
                 class="check_detail"
@@ -163,6 +172,7 @@
                 alt=""
                 v-else
               >
+              </view>
 
             </div>
           </van-col>
@@ -172,17 +182,19 @@
       <view v-if="card_action_show == item.goods_id">
 
         <!--    描述-->
+        <view class="flex justify-center">
         <view
           class="desc"
           v-html="item.content"
         >
 
         </view>
+        </view>
 
         <!--    购买按钮-->
         <div class="buy_button">
           <button
-            class="cu-btn lg bg-orange text-center margin "
+            class="cu-btn lg bg-orange text-center margin yellowButt"
             @click="open_order_confirm(item)"
           >购买{{
             item.goods_name
@@ -337,7 +349,7 @@ export default {
     //弹出确认订单
     open_order_confirm($item) {
       $this.order_confirm = true;
-      $item['total_price'] = ($item.price * $item.discount).toFixed(2); 
+      $item["total_price"] = ($item.price * $item.discount).toFixed(2);
       $this.selection_card = $item;
     },
     //关闭确认订单
@@ -473,13 +485,14 @@ export default {
         let $data = res.data.data;
         $this.time_cards = $data.time_card;
         let $bg = ["gold", "platina", "diamond"];
+        let $bgBott = ["normal", "oneMonth"];
         $this.time_cards.forEach(($val, $index) => {
           $this.time_cards[$index]["bg"] = $bg[$index];
           $this.time_cards[$index]["price"] = Math.ceil($val["price"]);
         });
         $this.frequency_card = $data.frequency_card;
         $this.frequency_card.forEach(($val, $index) => {
-          $this.frequency_card[$index]["bg"] = "normal";
+          $this.frequency_card[$index]["bgBott"] = $bgBott[$index];
           $this.frequency_card[$index]["price"] = Math.round($val["price"]);
         });
       });
@@ -516,12 +529,11 @@ export default {
 
 <style scoped>
 .uc_recharge_container {
-  padding: 0px 10px;
+  /* padding: 0px 10px; */
 }
-
 .mine {
-  width: 354px;
-  height: 93px;
+  width: 330px;
+  height: 84px;
   background: rgba(242, 243, 255, 0.6);
   box-shadow: 0px 3px 7px 0px rgba(159, 159, 159, 0.84);
   border-radius: 0px 0px 11px 11px;
@@ -529,7 +541,15 @@ export default {
 }
 
 .mine_min {
-  font-size: 40px;
+  font-size: 36px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+}
+
+.mine_min_litt {
+  font-size: 30px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
 }
 
 .line {
@@ -562,9 +582,12 @@ export default {
 .normal {
   background-image: url("https://img.shuimuai.com/web/frame_cika.png");
 }
+.oneMonth {
+  background-image: url("https://img.shuimuai.com/frame_oneMonth.png");
+}
 
 .card_body {
-  padding: 5px 0px;
+  padding: 3px 0px;
 }
 
 .check_detail {
@@ -574,12 +597,18 @@ export default {
 
 .desc {
   width: 324px;
-  /*height: 128px;*/
+  /* height: 128px; */
   margin: 10px auto;
   font-size: 10px;
   color: #6b6b6b;
+  line-height: 18px;
+}
+.titles {
+  font-size: 15px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #010101;
 }
-
 .buy_button {
   text-align: center;
 }
@@ -639,4 +668,43 @@ export default {
   /*background-position: center;*/
   background-color: rgba(255, 255, 255, 0);
 }
+.under_line {
+  margin-left: 5px;
+  font-size: 12px;
+  font-family: PingFang;
+  font-weight: 400;
+  text-decoration: underline;
+  color: #000000;
+}
+.gray {
+  font-size: 12px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #6d6d6d;
+}
+.title {
+  margin-left: -8px;
+}
+.subGrey {
+  font-size: 10px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #ffffff;
+  opacity: 0.8;
+}
+.price {
+  margin: 3px 0 0 3px;
+  font-size: 10px;
+  font-family: Microsoft YaHei;
+  font-weight: 400;
+  color: #ffffff;
+}
+.yellowButt {
+  width: 208px;
+  height: 44px;
+  background: #ffb400;
+  box-shadow: 0px 3px 7px 0px #ff9306;
+  border-radius: 5px;
+  margin-bottom: 27px;
+}
 </style>

+ 6 - 0
src/requests/user.js

@@ -26,6 +26,12 @@ export function userDetail() {
   return fly.post('user/user-detail', $params)
 }
 
+//获取时间戳(10)
+export function  timestamp(){
+  let outcome = Math.round(new Date().getTime()/1000).toString();
+  return outcome
+}
+
 //校验验证码
 export function userCheckCode($params) {
   let $token = wx.getStorageSync('token')

+ 3 - 0
src/utils/index.js

@@ -670,11 +670,14 @@ export function interfereAction($data) {
     for (var i = 0; i < 1200; i++) {
       $objData[i] = 0;
     }
+    console.log($objData);
     var $newObj = Object.assign($objData, $data);
     // 对象转数组
+    console.log($newObj);
     for (const key in $newObj) {
       $interfereArr.push($newObj[key]);
     }
+    console.log($interfereArr);
     return $interfereArr
 
   } else {

+ 37 - 7
src/utils/user.js

@@ -1,5 +1,5 @@
-import {userDetail} from "../requests/user";
-import {formatBirthday, formatSeconds, formatTime} from "./index";
+import { userDetail, timestamp } from "../requests/user";
+import { formatBirthday, formatSeconds, formatTime } from "./index";
 import utils from "./index";
 import user_store from '../store/index'
 
@@ -8,22 +8,52 @@ import user_store from '../store/index'
 export function reload_userinfo($this) {
   wx.showLoading({
     title: '加载中',
-    mask:true
+    mask: true
   }),
-  setTimeout(function () {
-    wx.hideLoading()
-  }, 4000)
+    setTimeout(function () {
+      wx.hideLoading()
+    }, 4000)
   let $errcode = [
     1001, 1002, 1011, 1012, 1021, 1031
   ]
   userDetail().then((res) => {
+    // console.log("数据:",  $this.userinfo['validity_unformattedTime']);
+    let _data = res.data.data.validity_time;
+    console.log("有效时间:" + _data);
+
     let $data = res.data;
     if ($errcode.indexOf($data.code) != -1) {
       do_logout($this)
     }
+    // if ($this.userinfo['validity_time'] != -1) {
+    //   do_logout($this)
+    // }
     $this.userinfo = $data.data;
     $this.userinfo.birthday = formatBirthday($this.userinfo.birthday)
+    $this.userinfo['validity_unformattedTime'] = $this.userinfo['validity_time']
+
+    let nowTime = timestamp()
+    //判断是否过期
+    if (nowTime > $this.userinfo['validity_unformattedTime']) {
+      $this.userinfo.isActive = false
+      $this.userinfo.isntActive = true
+    } else {
+      $this.userinfo.isActive = true
+      $this.userinfo.isntActive = false
+    }
+
+    //当天具体日期
+    let date = new Date();
+    let day = date.getDate();
+    let Y = date.getFullYear() + "."
+    let M = (date.getMonth() + 1 < 10 ?
+      "0" + (date.getMonth() + 1) :
+      date.getMonth() + 1) + ".";
+    let D = (day < 10 ? "0" + day : day);
+    $this.userinfo.certainTime = Y + M + D;
+
     $this.userinfo['validity_time'] = formatTime($this.userinfo['validity_time'])
+    // console.log("数据:", $this.userinfo['validity_unformattedTime']);
     $this.userinfo['level_name'] = utils.get_level_name($this.userinfo['level'])
     $this.userinfo['free_time'] = formatSeconds($this.userinfo['free_time'])
     //设置邀请码
@@ -51,7 +81,7 @@ function do_logout($this) {
       try {
         $this.change_login_status()
       } catch
-        (e) {
+      (e) {
         console.log(e)
       }
     }