Luhan1997 vor 4 Jahren
Ursprung
Commit
4fb8ec5055

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit 24ba5d3543ea15720ead714a6fff20dbd87cdfbe
+Subproject commit fb362463d164cf7fdcf6268a497bd3b9f694b7cb

+ 1 - 0
src/app.json

@@ -5,6 +5,7 @@
     "pages/report/main",
     "pages/game_record/main",
     "pages/user_center/main",
+    "pages/coupons/main",
     "pages/user_center/edit/main",
     "pages/user_center/edit/confirm_phone_first/main",
     "pages/user_center/edit/confirm_phone_finally/main",

+ 1 - 1
src/components/banner.vue

@@ -1,7 +1,7 @@
 <template>
   <div id="banner_container">
     <img src="https://img.shuimuai.com/web/banner1.png" class="full_img main_banner" alt="">
-    <button class="cu-btn bg-yellow text-white join_button">立即参与</button>
+<!--    <button class="cu-btn bg-yellow text-white join_button">立即参与</button>-->
   </div>
 </template>
 

+ 5 - 0
src/components/device/device.vue

@@ -187,8 +187,13 @@ export default {
               fail(err) {
                 if (err["errCode"] == 10001) {
                   Toast.fail({
+<<<<<<< HEAD
                     message: "请连接蓝牙",
                   });
+=======
+                    message: "请打开手机蓝牙,并启动脑环!"
+                  })
+>>>>>>> f832f7345814f153ecaa4b08bee96a4b1c3d10bf
                 } else {
                   Toast.fail({
                     message: "蓝牙连接失败",

+ 24 - 4
src/components/index/login.vue

@@ -23,6 +23,7 @@
 </template>
 <script>
 import Toast from '../../../static/vant/toast/toast';
+import {userCheckCode, userCheckInvite} from "../../requests/user";
 
 export default {
   name: "login_container",
@@ -36,6 +37,7 @@ export default {
     }
   },
   onLoad(options) {
+    let $this = this
     // 原有的code
     let $_code = wx.getStorageSync('code')
 
@@ -49,12 +51,30 @@ export default {
       if ($_code && $_code != $code) {
         Toast.fail('该用户已绑定邀请码')
       }
+      //本地存储没有邀请码
+      if (!$_code) {
+        //校验邀请码
+        userCheckInvite($code).then((res) => {
+          let $res = res.data;
+          if ($res.code != 0) {
+            Toast.fail({
+              message: $res.errmsg,
+              duration: 3,
+              onClose() {
+                $this.$emit('changeStatus', 'scan')
+              }
+            })
+          }
+        })
+      }
+
 
     }
-    else {
-      // 跳转到关于水母页面
-      this.$emit('changeStatus', 'scan')
-    }
+    // 测试注释
+    // else {
+    //   // 跳转到关于水母页面
+    //   this.$emit('changeStatus', 'scan')
+    // }
   }
 }
 </script>

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

@@ -45,7 +45,7 @@
                 </template>
 
               </button>
-              <view class="text-xs padding-left">有效期至 2020.11.11</view>
+              <view class="text-xs padding-left">有效期至 {{ userinfo['validity_time'] }}</view>
             </div>
           </div>
         </van-col>
@@ -73,10 +73,10 @@
           <div class="flex flex-direction align-center">
 
             <text class="text-xxl">{{ userinfo.play_time }}</text>
-            <text class="font-sm">可用时长(分钟)</text>
+            <text class="font-sm">可用时长(分钟)</text>
           </div>
         </van-col>
-        <van-col span="6" offset="2">
+        <van-col span="6" offset="2" @click="to_coupons">
           <div class="flex flex-direction align-center">
 
             <text class="text-xxl">{{ userinfo.coupon }}</text>
@@ -144,11 +144,16 @@
         <button class="cu-btn lg bg-primary text-white" @click="to_recharge">立即充值</button>
       </div>
     </van-popup>
+    <van-toast id="van-toast"/>
+
   </div>
 </template>
 
 <script>
 import {userDetail} from "../../requests/user";
+import {couponReceiveFirst} from "../../requests/coupons";
+import Toast from '../../../static/vant/toast/toast';
+import {formatTime} from "../../utils";
 
 var $this
 export default {
@@ -174,8 +179,15 @@ export default {
   },
   methods: {
     get_ticket() {
-      this.userinfo.first = 0
-      console.log('获取体验券');
+      couponReceiveFirst().then((res) => {
+        let $res = res.data;
+        if ($res.code == 0) {
+          $this.first = false
+          Toast.success($res.errmsg)
+        }else{
+          Toast.fail($res.errmsg)
+        }
+      })
     },
     close_pop() {
       this.pop_show = false
@@ -191,6 +203,11 @@ export default {
       mpvue.navigateTo({
         url: "/pages/user_center/main"
       })
+    },
+    to_coupons(){
+      mpvue.navigateTo({
+        url: "/pages/coupons/main"
+      })
     }
   },
   mounted() {
@@ -200,11 +217,12 @@ export default {
       let $data = res.data
       //判断如果是第一次登录就 弹出领取体验卡
       $this.userinfo = $data.data
-      // if ($this.userinfo.login_time == 0) {
-      //   $this.first = true
-      // } else if ($this.userinfo.play_time == 0) {
-      //   $this.pop_show = true
-      // }
+      $this.userinfo['validity_time'] = formatTime($this.userinfo['validity_time'])
+      if ($this.userinfo.login_time == 0) {
+        $this.first = true
+      } else if ($this.userinfo.play_time == 0) {
+        $this.pop_show = true
+      }
       $this.$store.commit('set_userinfo', $data.data);
     })
 
@@ -231,7 +249,7 @@ export default {
 #personal {
   width: 100%;
   position: relative;
-  top: -60px;
+  top: -95px;
   z-index: 3;
 }
 

+ 1 - 1
src/components/static/device.css

@@ -1,6 +1,6 @@
 #device_container {
   position: relative;
-  top: -60px;
+  top: -80px;
 }
 
 .head .line {

+ 1 - 1
src/pages/agent/customer/index.vue

@@ -119,7 +119,7 @@ export default {
         unsettle_account: 65.00,
       },
       //客户数量
-      customer_count: 3,
+      customer_count: 0,
       calendar_show: false,
       start_time: "",
       end_time: "",

+ 2 - 1
src/pages/agent/extend/orders/index.vue

@@ -25,7 +25,7 @@
         </text>
       </view>
       <view>
-        <text class="text-bold text-sl text-price">{{ userinfo.order_counts }}</text>
+        <text class="text-bold text-sl">{{ order_counts }}</text>
       </view>
     </div>
 
@@ -185,6 +185,7 @@ export default {
     }
   },
   mounted() {
+    $this.get_order_list()
     $this.min_date = new Date(2020, 1, 1).getTime()
   },
   created() {

+ 2 - 2
src/pages/agent/income_cal/index.vue

@@ -115,9 +115,9 @@ export default {
       filter_action: 1,
       total: {
         //累计收益
-        balance_freeze: 16824.50,
+        balance_freeze: 0,
         //含待结算
-        balance: 65.00,
+        balance: 0.00,
       },
       balance_list: [],
       calendar_show: false,

+ 9 - 3
src/pages/agent/index/index.vue

@@ -14,7 +14,7 @@
           <van-col span="6" offset="1">
             <view class="label">
               <view class="text-bold">
-                <text class="text-white text-lg">{{ userinfo.nick_name }}</text>
+                <text class="text-white text-lg">{{ userinfo.user_name }}</text>
               </view>
               <view class="padding-tb-sm">
                 <text class="text-white text-sm">{{ userinfo.level_name }}</text>
@@ -27,7 +27,7 @@
       </van-row>
 
       <!--      收益模块-->
-      <div class="profit_container text-center">
+      <div class="profit_container text-center" @click="to_income">
         <view>
           <text class="text-normal padding">累计收益(元)</text>
         </view>
@@ -120,6 +120,12 @@ export default {
     }
   },
   methods: {
+    //跳转收益中心
+    to_income(){
+      mpvue.navigateTo({
+        url: "/pages/agent/income_cal/main"
+      })
+    },
     //  跳转推广订单
     to_extend_order() {
       mpvue.navigateTo({
@@ -159,7 +165,7 @@ export default {
   mounted() {
     $this.get_agent_detail()
     $this.userinfo = wx.getStorageSync('userinfo')
-    $this.userinfo['level_name'] = utils.get_level_name()
+    $this.userinfo['level_name'] = utils.get_level_name($this.userinfo.level)
   },
   created() {
     $this = this

+ 2 - 2
src/pages/agent/invite_card_inventory/index.vue

@@ -66,7 +66,7 @@
         <view slot="num">
           <view>
             <text class="text-gray text-sm margin-right-lg">卡号</text>
-            <text class="text-sm text-gray">{{ cu.code }}</text>
+            <text class="text-sm text-gray">{{ cu.invite_id }}</text>
           </view>
         </view>
       </van-card>
@@ -94,7 +94,7 @@ export default {
   components: {},
   data() {
     return {
-      total_count: 269,
+      total_count: 0,
       stock_count: 0,
       use_count: 0,
       invite_list: [],

+ 64 - 0
src/pages/coupons/index.css

@@ -0,0 +1,64 @@
+
+.quan_container {
+  background-image: url("https://img.shuimuai.com/web/index_item_quan.png");
+  background-position: center;
+  background-size: 100% 100%;
+  width: 340px;
+  height: 115px;
+  margin: 10px auto;
+}
+
+.quan_container_gray {
+  background-image: url("https://img.shuimuai.com/web/quan_huise.png");
+  background-position: center;
+  background-size: 100% 100%;
+  width: 340px;
+  height: 115px;
+  margin: 10px auto;
+}
+
+/*标题*/
+.title {
+  font-size: 15px;
+  font-weight: 400;
+  color: #030000;
+  line-height: 24px;
+
+}
+
+/*子标题*/
+.sub-title {
+  font-size: 10px;
+  font-weight: 400;
+  color: #030000;
+  line-height: 24px;
+
+}
+
+/*分钟数*/
+.time {
+  font-size: 36px;
+  font-weight: 400;
+  color: #030000;
+  line-height: 24px;
+}
+
+/*分钟二字*/
+.time_text {
+  font-size: 12px;
+  font-weight: 400;
+  color: #030000;
+  line-height: 24px;
+}
+
+/*领取二字*/
+.get_ticket_text {
+  font-size: 18px;
+  font-weight: 400;
+  color: #FFFFFF;
+  line-height: 24px;
+  margin: 45px 0px;
+}
+
+.quan_list {
+}

+ 134 - 0
src/pages/coupons/index.vue

@@ -0,0 +1,134 @@
+<template>
+  <div id="game_record_container">
+    <van-tabs :active="active" @change="" color="#4B3AB0">
+      <van-tab title="待领取" name="0">
+        <div class="quan_list">
+
+          <div class="quan_container" v-for="(item,index) in rec_list" :key="index">
+            <van-row gutter="10">
+              <van-col span="14" offset="1">
+                <div class="padding-top-sm">
+                  <text class="title">{{ item.name }}</text>
+                </div>
+                <div>
+                  <text class="subtitle">{{ item.end_time }}之前领取有效</text>
+                </div>
+
+                <view class="padding-tb">
+                  <text class="time">{{ item.play_time }}</text>
+                  <text class="time_text">分钟</text>
+                </view>
+              </van-col>
+              <van-col span="5" offset="4" class="" @click="get_ticket(item.coupon_category_id)">
+                <view class="get_ticket_text">领取</view>
+              </van-col>
+            </van-row>
+          </div>
+
+
+        </div>
+      </van-tab>
+      <van-tab title="已领取" name="1">
+        <div class="quan_list">
+
+          <div class="quan_container_gray" v-for="(item,index) in cp_list" :key="index">
+            <van-row gutter="10">
+              <van-col span="14" offset="1">
+                <div class="padding-top-sm">
+                  <text class="title">{{ item.name }}</text>
+                </div>
+                <div>
+<!--                  <text class="subtitle">{{ item.validity_time }}之前领取有效</text>-->
+                </div>
+
+                <view class="padding-tb">
+                  <text class="time">10</text>
+                  <text class="time_text">分钟</text>
+                </view>
+              </van-col>
+              <van-col span="5" offset="3">
+                <view class="get_ticket_text">已领取</view>
+              </van-col>
+            </van-row>
+          </div>
+
+
+        </div>
+      </van-tab>
+    </van-tabs>
+    <van-toast id="van-toast"/>
+
+  </div>
+</template>
+
+<script>
+import Toast from '../../../static/vant/toast/toast';
+
+
+import {couponReceive, getCouponList, getCouponReceiveList} from "../../requests/coupons";
+import {formatValidityTime} from '@/utils/index'
+
+var $this
+export default {
+  name: "game_record_container",
+  components: {},
+  data() {
+    return {
+      active: '0',
+      rec_list: [],
+      cp_list: [],
+      limit: 10
+    }
+  },
+  methods: {
+    //获取已优惠券列表
+    get_coupon_list() {
+      getCouponList($this.limit).then((res) => {
+        let $res = res.data;
+        $this.cp_list = $res.data;
+        $this.cp_list.forEach(($val, $index) => {
+          $val['validity_time'] = formatValidityTime($val['validity_time'])
+        })
+      })
+    },
+    //获取待领取优惠券列表
+    get_rec_coupon_list() {
+      getCouponReceiveList($this.limit).then((res) => {
+        let $res = res.data;
+        $this.rec_list = $res.data.list;
+        $this.rec_list.forEach(($val, $index) => {
+          $val['end_time'] = formatValidityTime($val['end_time'])
+        })
+      })
+    },
+    //  领取优惠券
+    get_ticket($id) {
+      couponReceive($id).then((res) => {
+        let $res = res.data;
+        if ($res.code == 0) {
+          Toast.success({
+            message: $res.errmsg,
+            onClose() {
+              $this.get_coupon_list()
+              $this.get_rec_coupon_list()
+            }
+          })
+        }else{
+          Toast.fail($res.errmsg)
+        }
+      })
+    }
+  },
+  mounted() {
+    $this.get_coupon_list()
+    $this.get_rec_coupon_list()
+  },
+  created() {
+    $this = this
+  }
+}
+</script>
+
+<style scoped>
+@import "index.css";
+</style>

+ 12 - 0
src/pages/coupons/main.js

@@ -0,0 +1,12 @@
+import Vue from 'vue'
+import App from './index'
+
+// add this to handle exception
+Vue.config.errorHandler = function (err) {
+  if (console && console.error) {
+    console.error(err)
+  }
+}
+
+const app = new Vue(App)
+app.$mount()

+ 14 - 0
src/pages/coupons/main.json

@@ -0,0 +1,14 @@
+{
+  "usingComponents": {
+    "van-row": "../../static/vant/row/index",
+    "van-col": "../../static/vant/col/index",
+    "van-popup": "../../static/vant/popup/index",
+    "van-overlay": "../../static/vant/overlay/index",
+    "van-divider": "../../static/vant/divider/index",
+    "van-cell": "../../static/vant/cell/index",
+    "van-cell-group": "../../static/vant/cell-group/index",
+    "van-tab": "../../static/vant/tab/index",
+    "van-tabs": "../../static/vant/tabs/index",
+    "van-toast": "../../static/vant/toast/index"
+  }
+}

+ 2 - 2
src/pages/index/index.vue

@@ -33,9 +33,9 @@
         </div>
       </div>
       <div class="content">
-        <img src="https://img.shuimuai.com/web/index_btn_chongzhizhongxin.png" @click="to_page('recharge')"></img>
+        <img src="https://img.shuimuai.com/web/index_btn_chongzhizhongxin.png" @click="to_recharge"></img>
         <img src="https://img.shuimuai.com/web/index_btn_gerenzhongxin.png" @click="to_page('user_center')"></img>
-        <img src="https://img.shuimuai.com/web/index_btn_chengjijilu.png" @click="to_page('report')"></img>
+        <img src="https://img.shuimuai.com/web/index_btn_chengjijilu.png" @click="to_page('game_record')"></img>
         <img src="https://img.shuimuai.com/web/index_btn_dailishang.png" @click="to_page('agent/index')"></img>
       </div>
     </div>

+ 32 - 14
src/pages/report/index.vue

@@ -7,8 +7,8 @@
         <view class="left">
           <img src="https://img.shuimuai.com/weixintouxiang.png"/>
           <view>
-            <text>小疯兔</text>
-            <text>普通会员</text>
+            <text>{{ record.user_name }}</text>
+            <text>{{ userinfo.level_name }}</text>
           </view>
         </view>
         <view class="right">
@@ -29,16 +29,16 @@
     </view>
     <view class="detail">
       <view>
-        <view>80</view>
+        <view>{{ record.att_max }}</view>
         <view>专注力最高分</view>
       </view>
       <view>
-        <view>20</view>
-        <view>专注力最长稳定时间(秒)</view>
+        <view>{{ record.med_max }}</view>
+        <view>放松度最高值</view>
       </view>
       <view>
-        <view>80</view>
-        <view>专注力平均分值</view>
+        <view>{{ record.med_average }}</view>
+        <view>放松度均值</view>
       </view>
     </view>
     <view class="bar">
@@ -59,13 +59,15 @@
     </view>
     <view class="sheet">
       <view class="left">
-        <view>专注力训练设备: 喷水音箱</view>
-        <view>核销方式: 会员卡</view>
-        <view>会员卡剩余时间: 100分钟2秒</view>
-        <view>次卡剩余: 2次</view>
+        <view>专注力训练设备: {{ record.name }}</view>
+        <view>核销方式:
+          <text v-if="record.consumption_type==1">次卡</text>
+          <text v-if="record.consumption_type==2">时间卡</text>
+        </view>
+        <view>会员游玩时间: {{record.play_time}}秒</view>
       </view>
       <view class="right">
-        <view>专注力训练时长: 8分钟23秒</view>
+        <view>专注力训练时长: {{record.play_time}}秒</view>
       </view>
     </view>
 
@@ -76,6 +78,8 @@
 import mpvueEcharts from 'mpvue-echarts'
 import echarts from '../../../static/echarts.min';
 import util from '../../utils/index'
+import {gameDetail} from "../../requests/game";
+import game_store from "../../store/game";
 
 var att_charts,
   $this
@@ -105,12 +109,26 @@ export default {
       // 0:未选择 1:时间 2:次数
       // 折线图
       attCharts: initAttChart,
-      echarts
+      echarts,
+      record: {},
+      userinfo: {}
     }
   },
-  methods: {}
+  methods: {
+    //  获取游戏报告
+    get_report() {
+      let $record_id = game_store.getters.getGameRecordId
+      gameDetail($record_id).then((res) => {
+        let $res = res.data;
+        $this.record = $res.data
+      })
+    }
+  }
   ,
   mounted() {
+    $this.get_report()
+    $this.userinfo = wx.getStorageSync('userinfo')
+    $this.userinfo['level_name'] = util.get_level_name($this.userinfo.level)
   },
   created() {
     $this = this;

+ 2 - 1
src/pages/start/index.vue

@@ -370,7 +370,8 @@ export default {
     post_data() {
       let $params = {
         game_record_id: game_store.getters.getGameRecordId,
-        line: $this.att_list
+        line: $this.att_list,
+        line_med: $this.med_list
       }
       gameAddLine($params).then((res) => {
         let $data = res.data

+ 2 - 0
src/pages/user_center/edit/confirm_phone_finally/index.vue

@@ -117,6 +117,8 @@ export default {
   }
   ,
   mounted() {
+    let $userinfo = wx.getStorageSync('userinfo')
+    $this.phone = $this.base_phone = $userinfo['phone']
     $this.phone = $this.cut_phone($this.phone)
   },
   created() {

+ 2 - 0
src/pages/user_center/edit/confirm_phone_first/index.vue

@@ -120,6 +120,8 @@ export default {
   }
   ,
   mounted() {
+    let $userinfo = wx.getStorageSync('userinfo')
+    $this.phone = $this.base_phone = $userinfo['phone']
     $this.phone = $this.cut_phone($this.phone)
   },
   created() {

+ 8 - 9
src/pages/user_center/edit/index.vue

@@ -20,8 +20,8 @@
       </template>
     </van-cell>
     <van-cell title="生日" :value="userinfo.birthday" is-link @click="birthday_picker = true"/>
-    <van-cell title="家庭组" :value="userinfo.home_group" is-link/>
-    <van-cell title="推荐人" :value="userinfo.recommend"/>
+    <!--    <van-cell title="家庭组" :value="userinfo.home_group" is-link/>-->
+    <van-cell title="推荐人" :value="userinfo.invite_name"/>
 
     <van-popup
       :show="gender_picker"
@@ -52,6 +52,7 @@
         @confirm="onDateChange"
         @cancel="birthday_picker = false"
         :max-date="max_date"
+        :min-date="min_date"
       />
     </van-popup>
 
@@ -62,6 +63,7 @@
 import {userChangeBirthday, userChangeSex, userDetail} from "../../../requests/user";
 import Toast from "../../../../static/vant/toast/toast";
 import {formatBirthday} from '../../../utils/index'
+import {reload_userinfo} from "../../../utils/user";
 
 var $this
 export default {
@@ -73,6 +75,7 @@ export default {
         '保密', '男', '女'
       ],
       _birthday: "",
+      min_date: -1,
       max_date: new Date().getTime(),
       userinfo: {
         avatar: "https://img.shuimuai.com/weixintouxiang.png",
@@ -111,19 +114,15 @@ export default {
       userChangeBirthday($params).then((res) => {
         let $data = res.data;
         Toast.success($data.errmsg)
+        reload_userinfo($this)
       })
       $this.birthday_picker = false
 
     }
   }
   ,
-  mounted() {
-    userDetail().then((res) => {
-      let $data = res.data;
-      $this.userinfo = $data.data;
-      $this.userinfo.birthday = formatBirthday($this.userinfo.birthday)
-
-    })
+  onShow() {
+    reload_userinfo($this)
   },
   created() {
     $this = this;

+ 27 - 7
src/pages/user_center/index.css

@@ -113,16 +113,11 @@ image.bianji {
 .detail {
   width: 100%;
   height: 102px;
-  display: flex;
-  align-items: center;
-  justify-content: space-around;
+  text-align: center;
+  margin: 10px auto;
 }
 
 .detail view {
-  display: flex;
-  flex-direction: column;
-  align-items: center;
-  justify-content: space-around;
   color: #6C6C6C;
   font-size: 10px;
 }
@@ -157,3 +152,28 @@ image.bianji {
   bottom: 45px;
   opacity: 0;
 }
+
+.icon1{
+  width: 19px;
+  height: 20px;
+  padding:1px 2px;
+  margin: 0px 2px;
+}
+.icon2{
+  width: 20px;
+  height: 23px;
+  padding:1px 2px;
+  margin: 0px 2px;
+}
+.icon3{
+  width: 21px;
+  height: 21px;
+  padding:1px 2px;
+  margin: 0px 2px;
+}
+.icon4{
+  width: 17px;
+  height: 20px;
+  padding:1px 2px;
+  margin: 0px 2px;
+}

+ 32 - 18
src/pages/user_center/index.vue

@@ -13,10 +13,10 @@
             <text>{{ userinfo.level_name }} 有效期至 {{ userinfo.validity_time }}</text>
           </view>
         </view>
-<!--        <view class="right">-->
-<!--          <img src="https://img.shuimuai.com/m_icon_xiaoxi%402x.png"/>-->
-<!--          <text>消息中心</text>-->
-<!--        </view>-->
+        <!--        <view class="right">-->
+        <!--          <img src="https://img.shuimuai.com/m_icon_xiaoxi%402x.png"/>-->
+        <!--          <text>消息中心</text>-->
+        <!--        </view>-->
       </view>
       <view class="down">
         <view>0</view>
@@ -26,21 +26,22 @@
         </view>
       </view>
     </view>
-    <view class="detail">
-      <view>
+
+    <van-row class="detail">
+      <van-col span="6" offset="1">
         <view>{{ userinfo.play_time }}</view>
         <view>可用时长(分钟)</view>
-      </view>
-      <view>
+      </van-col>
+      <van-col span="6" offset="2" @click="to_coupons">
         <view>{{ userinfo.coupon }}</view>
         <view>体验券</view>
-      </view>
-      <view>
+      </van-col>
+      <van-col span="6" offset="2">
         <view>{{ userinfo.experience }}</view>
         <view>次卡</view>
-      </view>
-    </view>
-    <view class="detail">
+      </van-col>
+    </van-row>
+    <view class="detail flex justify-around">
       <!--      会员码-->
       <img src="https://img.shuimuai.com/m_btn_huiyuanma%402x.png" @click="to_vip_code"/>
       <!--      会员权益-->
@@ -51,11 +52,19 @@
 
     <!--    菜单模块-->
     <van-cell-group class="menu">
-      <van-cell title="我的订单" icon="notes-o" is-link url="/pages/user_center/orders/main"/>
-      <van-cell title="代理商中心" icon="manager-o" is-link url="/pages/agent/index/main"/>
-<!--      <van-cell title="家庭组" icon="wap-home-o" is-link/>-->
-      <van-cell title="收货地址" icon="location-o" is-link url="/pages/user_center/address/edit/main"/>
-      <van-cell title="联系客服" icon="service-o" is-link/>
+      <van-cell title="我的订单"  is-link url="/pages/user_center/orders/main">
+        <img src="https://img.shuimuai.com/web/icon/icon_dingdan.png" alt=""  slot="icon" class="icon1">
+      </van-cell>
+      <van-cell title="代理商中心"  is-link url="/pages/agent/index/main">
+        <img src="https://img.shuimuai.com/web/icon/icon_dailishang.png" alt=""  slot="icon" class="icon2">
+      </van-cell>
+      <!--      <van-cell title="家庭组" icon="wap-home-o" is-link/>-->
+      <van-cell title="收货地址"  is-link url="/pages/user_center/address/edit/main">
+        <img src="https://img.shuimuai.com/web/icon/sign_add.png" alt=""  slot="icon" class="icon3">
+      </van-cell>
+      <van-cell title="联系客服"  is-link>
+        <img src="https://img.shuimuai.com/web/icon/icon_kefu.png" alt=""  slot="icon" class="icon4">
+      </van-cell>
       <van-button open-type="contact" block custom-class="contact_button">
         <div>
           <view>
@@ -103,6 +112,11 @@ export default {
       mpvue.navigateTo({
         url: "/pages/user_center/vip_code/main"
       })
+    },
+    to_coupons() {
+      mpvue.navigateTo({
+        url: "/pages/coupons/main"
+      })
     }
   }
   ,

+ 6 - 1
src/pages/user_center/recharge/index.vue

@@ -6,7 +6,7 @@
         <view>
           <text class="text-gray">当前剩余时长(分钟)</text>
         </view>
-        <view>
+        <view @click="to_orderlist">
           <text class="cuIcon-calendar"></text>
           <text class="under_line">我的订单</text>
         </view>
@@ -322,6 +322,11 @@ export default {
           $this.frequency_card[$index]['price'] = Math.round($val['price'])
         })
       })
+    },
+    to_orderlist(){
+      mpvue.navigateTo({
+        url:"/pages/user_center/orders/main"
+      })
     }
   }
   ,

+ 45 - 7
src/pages/user_center/vip/index.css

@@ -1,8 +1,9 @@
 .banner {
   width: 100%;
   height: 100px;
-  background-color: #4B3AB0;
-  border: 1px solid #fff
+  background-image: url("https://img.shuimuai.com/web/banner_huiyuan.png");
+  background-size: 100% 100%;
+  background-position: center;
 }
 
 .uc_vip_container .content {
@@ -29,11 +30,6 @@
   height: 31px;
 }
 
-.benefit .icon {
-  width: 40px;
-  height: 40px;
-}
-
 .benefit .title {
   font-size: 14px;
   font-family: PingFang SC;
@@ -61,3 +57,45 @@
   line-height: 20px;
   padding: 15px;
 }
+
+.banner_text {
+  width: 100%;
+  height: 17px;
+  font-size: 18px;
+  font-family: Microsoft YaHei;
+  font-weight: bold;
+  color: #FFFFFF;
+  text-align: center;
+  padding-top: 60px;
+
+}
+
+.icon1 {
+  width: 44px;
+  height: 31px;
+}
+
+.icon2 {
+  width: 35px;
+  height: 37px;
+}
+
+.icon3 {
+  width: 45px;
+  height: 43px;
+}
+
+.icon4 {
+  width: 34px;
+  height: 39px;
+}
+
+.icon5 {
+  width: 37px;
+  height: 32px;
+}
+
+.icon6 {
+  width: 33px;
+  height: 36px;
+}

+ 80 - 59
src/pages/user_center/vip/index.vue

@@ -1,7 +1,9 @@
 <template>
   <div class="uc_vip_container">
     <div class="banner">
-
+      <view class="banner_text">
+        <text>{{ userinfo['level_name'] }}</text>
+      </view>
     </div>
 
     <div class="content">
@@ -11,14 +13,69 @@
 
       <!--      权益列表-->
       <van-row gutter="10" class="benefit-row">
-        <van-col span="8" v-for="(item,index) in benefits" :key="index">
+        <van-col span="8">
+          <view class="benefit">
+            <img src="https://img.shuimuai.com/quanyi_icon_1.png" alt="" class="icon1">
+            <view>
+              <text class="title">会员卡</text>
+            </view>
+            <view>
+              <text class="subtitle">{{ datas.card }}张</text>
+            </view>
+          </view>
+        </van-col>
+        <van-col span="8">
+          <view class="benefit">
+            <img src="https://img.shuimuai.com/quanyi_icon_2.png" alt="" class="icon2">
+            <view>
+              <text class="title">核销时间{{ datas.play_time }}分钟</text>
+            </view>
+            <view>
+              <text class="subtitle">游玩限期{{ datas.validity }}个月</text>
+            </view>
+          </view>
+        </van-col>
+        <van-col span="8">
+          <view class="benefit">
+            <img src="https://img.shuimuai.com/quanyi_icon_3.png" alt="" class="icon3">
+            <view>
+              <text class="title">参与活动</text>
+            </view>
+            <view>
+              <text class="subtitle">{{ datas.validity }}个月内</text>
+            </view>
+          </view>
+        </van-col>
+        <van-col span="8">
+          <view class="benefit">
+            <img src="https://img.shuimuai.com/quanyi_icon_4.png" alt="" class="icon4">
+            <view>
+              <text class="title">租售产品</text>
+            </view>
+            <view>
+              <text class="subtitle">租{{ datas.lease_time }}套每天15分钟</text>
+            </view>
+          </view>
+        </van-col>
+        <van-col span="8">
           <view class="benefit">
-            <img :src="item.icon" alt="" class="icon">
+            <img src="https://img.shuimuai.com/quanyi_icon_5.png" alt="" class="icon5">
             <view>
-              <text class="title">{{ item.title }}</text>
+              <text class="title">参与课程</text>
             </view>
             <view>
-              <text class="subtitle">{{ item.sub_title }}</text>
+              <text class="subtitle">{{ datas.lease_time }}个月</text>
+            </view>
+          </view>
+        </van-col>
+        <van-col span="8">
+          <view class="benefit">
+            <img src="https://img.shuimuai.com/quanyi_icon_6.png" alt="" class="icon6">
+            <view>
+              <text class="title">邀请有奖</text>
+            </view>
+            <view>
+              <text class="subtitle">{{ datas.lease_time }}个月</text>
             </view>
           </view>
         </van-col>
@@ -26,21 +83,7 @@
 
 
       <!--      权益描述-->
-      <view class="desc">
-        黄金会员权益:
-        <br>
-        1)获得核销时间为200分钟,有效期3个自然月(从购买当日时间开始计时)。
-        <br>
-        2)获得5张次卡(实体卡),次卡不能自己使用,只能用给其它人使用。获得次卡的用户A可进行1次到店体验,且成为黄金会员的一级分销用户。
-        <br>
-        如果次卡用户A进行消费,则黄金会员用户则获得以下对应的分润:
-        <br>
-        购买次卡获得20元分润,购买黄金会员卡获得50元分润,购买白金会员获得100元分润,购买钻石会员则获得200元分润,线下购买创客代理获得300元分润,线下购买区域代理获得600元分润,线下购买合伙人,获得2000元分润。
-        <br>
-        <br>
-        如果次卡用户A发展其它人B成为水母会员用户,则B作为次卡用户A的一级分销用户,也是黄金会员的二级分销用户,如果B产生消费,则次卡会员A获得一级分润(同上述的黄金会员一级分润)黄金会员可获得如下二级分润:
-        <br>
-        B购买次卡获得5元分润,购买黄金会员卡获得15元分润,购买白金会员获得30元分润,购买钻石会员则获得60元分润。线下购买创客代理获得90元分润,线下购买区域代理获得180元分润,线下购买合伙人,获得600元分润。
+      <view class="desc" v-html="datas.content">
       </view>
     </div>
   </div>
@@ -48,55 +91,33 @@
 
 <script>
 
+import {vipPowerLevel} from "../../../requests/vip";
+import utils from '../../../utils/index'
+
 var $this
 export default {
   name: "uc_vip_container",
   components: {},
   data() {
     return {
-      benefits: [
-        {
-          id: 1,
-          icon: "https://img.shuimuai.com/quanyi_icon_1.png",
-          title: "会员卡",
-          sub_title: "1张"
-        },
-        {
-          id: 2,
-          icon: "https://img.shuimuai.com/quanyi_icon_2.png",
-          title: "核销时间1700分钟",
-          sub_title: "游玩限期3个月"
-        },
-        {
-          id: 3,
-          icon: "https://img.shuimuai.com/quanyi_icon_3.png",
-          title: "参与活动",
-          sub_title: "3个月内"
-        },
-        {
-          id: 4,
-          icon: "https://img.shuimuai.com/quanyi_icon_4.png",
-          title: "销售产品",
-          sub_title: "租1套、每天15分钟"
-        },
-        {
-          id: 5,
-          icon: "https://img.shuimuai.com/quanyi_icon_5.png",
-          title: "参与课程",
-          sub_title: "3个月"
-        },
-        {
-          id: 6,
-          icon: "https://img.shuimuai.com/quanyi_icon_6.png",
-          title: "分润",
-          sub_title: "一级分润、二级分润"
-        },
-      ],
+      datas: [],
+      userinfo: {},
     }
   },
-  methods: {}
+  methods: {
+    //获取页面数据初始化
+    getData() {
+      vipPowerLevel().then((res) => {
+        let $data = res.data;
+        $this.datas = $data.data
+      })
+    }
+  }
   ,
   mounted() {
+    $this.getData()
+    $this.userinfo = wx.getStorageSync('userinfo')
+    $this.userinfo['level_name'] = utils.get_level_name($this.userinfo['level'])
   },
   created() {
     $this = this;

+ 36 - 0
src/requests/coupons.js

@@ -0,0 +1,36 @@
+import fly from "./main";
+import store from "@/store/index"
+
+//优惠券领取列表
+export function getCouponReceiveList($limit = 0) {
+  let $params = {}
+  $params['limit'] = $limit
+  $params['status'] = 1
+  $params['access_token'] = wx.getStorageSync('token')
+  return fly.post('coupon/coupon-receive-list', $params)
+}
+
+//已优惠券列表
+export function getCouponList($limit = 0) {
+  let $params = {}
+  $params['limit'] = $limit
+  $params['access_token'] = wx.getStorageSync('token')
+  return fly.post('coupon/coupon-list', $params)
+}
+
+//待领取优惠券
+export function couponReceive($id) {
+  let $params = {}
+  $params['coupon_category_id'] = $id
+  $params['access_token'] = wx.getStorageSync('token')
+  return fly.post('coupon/coupon-receive', $params)
+}
+
+//首次登录领取优惠券
+export function couponReceiveFirst() {
+  let $params = {
+    "access_token": wx.getStorageSync('token'),
+    "coupon_category_id": 1,
+  }
+  return fly.post('coupon/coupon-receive', $params)
+}

+ 3 - 1
src/requests/game.js

@@ -20,7 +20,9 @@ export function gameEnd($params) {
 }
 
 //游戏记录详情
-export function gameDetail($params) {
+export function gameDetail($record_id) {
+  let $params = {}
+  $params['game_record_id'] = $record_id
   $params['access_token'] = wx.getStorageSync('token')
   return fly.post('game/game-detail', $params)
 }

+ 9 - 0
src/requests/user.js

@@ -54,3 +54,12 @@ export function userChangeBirthday($params) {
   $params['access_token'] = $token
   return fly.post('user/change-birthday', $params)
 }
+
+//校验验证码
+export function userCheckInvite($invite_code) {
+  let $params = {
+    'invite': $invite_code,
+    access_token: wx.getStorageSync('token')
+  }
+  return fly.post('user/check-invite', $params);
+}

+ 7 - 0
src/requests/vip.js

@@ -0,0 +1,7 @@
+import fly from "./main";
+import store from "@/store/index"
+
+export function vipPowerLevel($params = {}) {
+  $params['access_token'] = wx.getStorageSync('token')
+  return fly.post('power/power-level', $params)
+}

+ 19 - 3
src/utils/index.js

@@ -4,6 +4,9 @@ function formatNumber(n) {
 }
 
 export function formatTime(date) {
+  if (date.length <= 11) {
+    date = date * 1000
+  }
   var date = new Date(date)
   const year = date.getFullYear()
   const month = date.getMonth() + 1
@@ -11,13 +14,26 @@ export function formatTime(date) {
 
   const hour = date.getHours()
 
-  const t1 = [year, month, day].map(formatNumber).join('/')
+  return year + "/" + month + "/" + day
+}
+
 
-  return `${t1}`
+export function formatValidityTime(date) {
+  if (date.toString().length <= 11) {
+    date = date * 1000
+  }
+  var date = new Date(date)
+  const year = date.getFullYear()
+  const month = date.getMonth() + 1
+  const day = date.getDate()
+
+  const hour = date.getHours()
+
+  return year + "/" + month + "/" + day + " " + hour + "时"
 }
 
 export function formatBirthday(date) {
-  var date = new Date(date)
+  var date = new Date(date * 1000)
   const year = date.getFullYear()
   const month = date.getMonth() + 1
   const day = date.getDate()

+ 13 - 0
src/utils/user.js

@@ -0,0 +1,13 @@
+import {userDetail} from "../requests/user";
+import {formatBirthday} from "./index";
+
+//刷新用户信息
+
+export function reload_userinfo($this) {
+  userDetail().then((res) => {
+    let $data = res.data;
+    $this.userinfo = $data.data;
+    $this.userinfo.birthday = formatBirthday($this.userinfo.birthday)
+    $this.$store.commit('set_userinfo', $this.userinfo)
+  })
+}