Selaa lähdekoodia

完成代理商接口对接,未完成代理商页面确认

yerong 4 vuotta sitten
vanhempi
commit
9471f16f97

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit 24ba5d3543ea15720ead714a6fff20dbd87cdfbe
+Subproject commit 029cef862c8875c217b3b1196c8f2ba0059ef54b

+ 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",

+ 23 - 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,29 @@ 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>

+ 19 - 3
src/components/index/personal.vue

@@ -76,7 +76,7 @@
             <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,15 @@
         <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';
 
 var $this
 export default {
@@ -174,8 +178,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 +202,11 @@ export default {
       mpvue.navigateTo({
         url: "/pages/user_center/main"
       })
+    },
+    to_coupons(){
+      mpvue.navigateTo({
+        url: "/pages/coupons/main"
+      })
     }
   },
   mounted() {

+ 2 - 2
src/components/index/regist.vue

@@ -197,8 +197,8 @@ export default {
     }
   },
   mounted() {
-    $this.invite = $this.$store.getters.get_invite_code ? $this.$store.getters.get_invite_code : wx.getStorageSync('code')
-    // $this.invite = 3
+    // $this.invite = $this.$store.getters.get_invite_code ? $this.$store.getters.get_invite_code : wx.getStorageSync('code')
+    $this.invite = 3
     console.log('regist-invite', $this.invite)
     mpvue.login({
       success($res) {

+ 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.title }}</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()

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

@@ -0,0 +1,13 @@
+{
+  "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"
+  }
+}

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

@@ -32,9 +32,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

+ 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)
+}

+ 18 - 2
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,9 +14,22 @@ 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) {