Browse Source

1、封装了扫描连接蓝牙模块
2、修复了邀请卡库存显示模块

yerong 4 năm trước cách đây
mục cha
commit
a6a3980828

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit 1c4de1da30c1731cc4e1f4f0c401a72b44d887e7
+Subproject commit e26095c4d3497a8ed6dc3a45ed7e568b11a3014a

+ 2 - 10
src/components/device/device.vue

@@ -162,16 +162,6 @@ export default {
       device_power: 100
     };
   },
-  watch: {
-    device_status($new, $old) {
-      //成功连接的方法
-      if ($new == 2) {
-        $this.connect_show = true;
-      } else if ($new == 0) {
-        $this.connect_show = false;
-      }
-    },
-  },
   methods: {
     //打开 扫描二维码
     open_scan() {
@@ -279,6 +269,8 @@ export default {
           },
         });
         wx.closeBluetoothAdapter()
+      } else if ($status == 2) {
+        $this.connect_show = true
       }
     },
 

+ 1 - 30
src/components/index/personal.vue

@@ -13,36 +13,7 @@
             </div>
             <div class="flex justify-between align-center">
               <button class="cu-btn sm round level_btn">
-                <template v-if="userinfo.level == 0">
-                  普通会员
-                </template>
-                <template v-if="userinfo.level == 1">
-                  体验会员
-                </template>
-                <template v-if="userinfo.level == 2">
-                  黄金会员
-                </template>
-                <template v-if="userinfo.level == 3">
-                  白金会员
-                </template>
-                <template v-if="userinfo.level == 4">
-                  钻石会员
-                </template>
-                <template v-if="userinfo.level == 5">
-                  创客代理
-                </template>
-                <template v-if="userinfo.level == 6">
-                  区域代理
-                </template>
-                <template v-if="userinfo.level == 7">
-                  合伙人
-                </template>
-                <template v-if="userinfo.level == 8">
-                  店员
-                </template>
-                <template v-if="userinfo.level == 9">
-                  店长
-                </template>
+                {{ userinfo.level_name }}
 
               </button>
               <view class="text-xs padding-left" v-if="userinfo.level != 1">有效期至 {{ userinfo['validity_time'] }}</view>

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

@@ -195,7 +195,7 @@ export default {
     toggle_type($id) {
       $this.customer_type_action = $id
       //根据类型获取用户列表
-      $this.get_user_list($id - 1)
+      $this.get_user_list($id - 1,$this.start_time,$this.end_time)
     },
     get_user_list($type, $start_time, $end_time) {
       Toast.loading({

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

@@ -88,6 +88,7 @@
 import {agentOrderList} from "../../../../requests/agent";
 import util from '@/utils/index'
 import Toast from '../../../../../static/vant/toast/toast'
+import {formatAllTime} from "../../../../utils";
 
 var $this
 export default {
@@ -189,7 +190,7 @@ export default {
         $this.order_counts = $result.count;
         let $list = $result.list;
         $list.forEach(($val, $index) => {
-          $list[$index]['create_time'] = util.formatTime($val['create_time'])
+          $list[$index]['create_time'] = formatAllTime($val['create_time'])
         })
         $this.order_list = $list
       })

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

@@ -84,6 +84,7 @@
 import {agentIncomeDetail, agentIncomeList} from "../../../requests/agent";
 import util from '@/utils/index'
 import Toast from '../../../../static/vant/toast/toast'
+import {formatAllTime} from "../../../utils";
 
 var $this
 export default {
@@ -183,7 +184,7 @@ export default {
         $this.total = $result.total;
         let $incomes = $result.list;
         $incomes.forEach(($val, $index) => {
-          $incomes[$index]['create_time'] = util.formatTime($val['create_time'])
+          $incomes[$index]['create_time'] = formatAllTime($val['create_time'])
         })
         $this.balance_list = $incomes
       })

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

@@ -123,19 +123,19 @@ export default {
     //跳转收益中心
     to_income() {
       mpvue.navigateTo({
-        url: "/pages/agent/income_cal/main"
+        url: "/pages/agent/income_cal/main?tab=1"
       })
     },
     //  跳转推广订单
     to_extend_order() {
       mpvue.navigateTo({
-        url: "/pages/agent/extend/orders/main"
+        url: "/pages/agent/extend/orders/main?tab=1"
       })
     },
     //  跳转推广客户
     to_customer() {
       mpvue.navigateTo({
-        url: "/pages/agent/customer/main"
+        url: "/pages/agent/customer/main?tab=1"
       })
     },
     //  跳转代理商结算中心
@@ -165,7 +165,6 @@ export default {
   mounted() {
     $this.get_agent_detail()
     $this.userinfo = wx.getStorageSync('userinfo')
-    $this.userinfo['level_name'] = utils.get_level_name($this.userinfo.level)
   },
   onShow() {
     $this.get_agent_detail()

+ 8 - 4
src/pages/agent/invite_card_inventory/index.vue

@@ -45,7 +45,7 @@
     <!--    小title-->
     <div class="line_container padding">
       <div>
-        <text class="text-sm text-gray">订单记录</text>
+        <text class="text-sm text-gray">邀请卡记录</text>
         <van-divider customStyle="border:.1px solid;margin:0px;"/>
       </div>
     </div>
@@ -56,10 +56,12 @@
               style="background-image:url(https://img.shuimuai.com/web/icon_dingdan.png);"></view>
         <view slot="title" class="flex justify-between">
           <view>
-            <text class="text-sm">{{ cu.user_name }}</text>
+            <text class="text-sm" v-if="cu.status == 1">未注册</text>
+            <text class="text-sm" v-else>{{ cu.user_name }}</text>
           </view>
           <view>
-            <text class="text-gray text-sm">{{ cu.bind_time }}</text>
+            <text class="text-gray text-sm" v-if="cu.status == 1">{{ cu.invite_time }}</text>
+            <text class="text-gray text-sm" v-if="cu.status == 2">{{ cu.bind_time }}</text>
           </view>
         </view>
 
@@ -87,6 +89,7 @@
 
 import {agentInviteStock} from "../../../requests/agent";
 import util from '@/utils/index'
+import {formatAllTime} from "../../../utils";
 
 var $this
 export default {
@@ -114,7 +117,8 @@ export default {
         $this.use_count = $data.unuse
         $this.invite_list = $data.list
         $this.invite_list.forEach(($val,$index)=>{
-          $this.invite_list[$index]['bind_time'] = util.formatTime($val['bind_time'])
+          $this.invite_list[$index]['bind_time'] = formatAllTime($val['bind_time'])
+          $this.invite_list[$index]['invite_time'] = formatAllTime($val['invite_time'])
         })
         $this.percent = ($data.stock / $data.total).toFixed(2) * 100
       })

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

@@ -112,8 +112,7 @@ export default {
     to_page($page) {
       if ($page == 'agent/index') {
         //店员店长不可进
-        console.log([8, 9].indexOf($this.userinfo.level)!=-1)
-        if ([8, 9].indexOf($this.userinfo.level) != -1) {
+        if ($this.userinfo.level == 8 || $this.userinfo.level == 9) {
           Toast.fail("店员、店长不可进")
           return false
         }

+ 10 - 1
src/pages/user_center/index.vue

@@ -56,7 +56,7 @@
       <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">
+      <van-cell title="代理商中心" is-link @click="to_agent">
         <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/>-->
@@ -123,6 +123,15 @@ export default {
       mpvue.navigateTo({
         url: "/pages/coupons/main"
       })
+    },
+    to_agent(){
+      if ($this.userinfo.level == 8 || $this.userinfo.level == 9) {
+        Toast.fail("店员、店长不可进")
+        return false
+      }
+      mpvue.navigateTo({
+        url:"/pages/agent/index/main"
+      })
     }
   }
   ,

+ 18 - 1
src/utils/index.js

@@ -17,6 +17,23 @@ export function formatTime(date) {
   return year + "/" + month + "/" + day
 }
 
+
+export function formatAllTime(date) {
+  if (date.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()
+  const minutes = date.getMinutes()
+
+  return year + "/" + month + "/" + day + " " + hour + ":" + minutes
+}
+
+
 export function formatTimeForSeconds(date) {
   if (date.length <= 11) {
     date = date * 1000
@@ -290,7 +307,7 @@ export function formatSeconds(value) {
 
 //获取等级名称
 function get_level_name($level_id) {
-  let $level = ['普通用户', '体验会员', '黄金会员', '白金会员', '钻石会员', '创客代理', '合伙人', '店员', '店长']
+  let $level = ['普通用户', '体验会员', '黄金会员', '白金会员', '钻石会员', '创客代理', '区域代理', '合伙人', '店员', '店长']
   return $level[$level_id]
 }