Sfoglia il codice sorgente

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

yerong 4 anni fa
parent
commit
f832f73458

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit 029cef862c8875c217b3b1196c8f2ba0059ef54b
+Subproject commit fb362463d164cf7fdcf6268a497bd3b9f694b7cb

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

+ 1 - 1
src/components/device/device.vue

@@ -166,7 +166,7 @@ export default {
               fail(err) {
                 if (err['errCode'] == 10001) {
                   Toast.fail({
-                    message: "请连接蓝牙"
+                    message: "请打开手机蓝牙,并启动脑环!"
                   })
                 } else {
                   Toast.fail({

+ 1 - 0
src/components/index/login.vue

@@ -70,6 +70,7 @@ export default {
 
 
     }
+    // 测试注释
     // else {
     //   // 跳转到关于水母页面
     //   this.$emit('changeStatus', 'scan')

+ 10 - 8
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,7 +73,7 @@
           <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" @click="to_coupons">
@@ -153,6 +153,7 @@
 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 {
@@ -216,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);
     })
 
@@ -247,7 +249,7 @@ export default {
 #personal {
   width: 100%;
   position: relative;
-  top: -60px;
+  top: -95px;
   z-index: 3;
 }
 

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

+ 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: [],

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

@@ -35,10 +35,10 @@
             <van-row gutter="10">
               <van-col span="14" offset="1">
                 <div class="padding-top-sm">
-                  <text class="title">{{ item.title }}</text>
+                  <text class="title">{{ item.name }}</text>
                 </div>
                 <div>
-                  <text class="subtitle">{{ item.validity_time }}之前领取有效</text>
+<!--                  <text class="subtitle">{{ item.validity_time }}之前领取有效</text>-->
                 </div>
 
                 <view class="padding-tb">

+ 2 - 1
src/pages/coupons/main.json

@@ -8,6 +8,7 @@
     "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-tabs": "../../static/vant/tabs/index",
+    "van-toast": "../../static/vant/toast/index"
   }
 }

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

+ 1 - 1
src/utils/index.js

@@ -33,7 +33,7 @@ export function formatValidityTime(date) {
 }
 
 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)
+  })
+}