Ver Fonte

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

yerong há 4 anos atrás
pai
commit
c1e85595b3

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit 0de22cf11675ba564d8959a2f6cfe7257ad37b93
+Subproject commit 1c4de1da30c1731cc4e1f4f0c401a72b44d887e7

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

@@ -224,10 +224,23 @@ export default {
   mounted() {
     $this.min_date = new Date(2020, 10, 11).getTime()
     $this.max_date = new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()
-    $this.get_user_list(0, false, false)
   },
   created() {
     $this = this
+  },
+  onLoad($options) {
+    if ($options.tab) {
+      let $tab = $this.filter_action = $options.tab
+      let $_filter = {}
+      $this.filter_list.forEach(($val, $index) => {
+        if ($val['id'] == $tab) {
+          $_filter = $val
+        }
+      })
+      $this.get_user_list(0, $_filter['start_time'], $_filter['end_time'])
+    } else {
+      $this.get_user_list(0, false, false)
+    }
   }
 }
 </script>

+ 16 - 3
src/pages/agent/extend/orders/index.vue

@@ -174,8 +174,8 @@ export default {
     //获取订单列表
     get_order_list($start_time, $end_time) {
       Toast.loading({
-        message:"加载中",
-        duration:0
+        message: "加载中",
+        duration: 0
       })
       let $params = {}
       if ($start_time && $end_time) {
@@ -196,12 +196,25 @@ export default {
     }
   },
   mounted() {
-    $this.get_order_list()
     $this.min_date = new Date(2020, 10, 11).getTime()
     $this.max_date = new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()
   },
   created() {
     $this = this
+  },
+  onLoad($options) {
+    if ($options.tab) {
+      let $tab = $this.filter_action = $options.tab
+      let $_filter = {}
+      $this.filter_list.forEach(($val, $index) => {
+        if ($val['id'] == $tab) {
+          $_filter = $val
+        }
+      })
+      $this.get_order_list($_filter['start_time'], $_filter['end_time'])
+    } else {
+      $this.get_order_list()
+    }
   }
 }
 </script>

+ 17 - 4
src/pages/agent/income_cal/index.vue

@@ -75,7 +75,7 @@
       :max-date="max_date"
     ></van-calendar>
 
-<van-toast id="van-toast" />
+    <van-toast id="van-toast"/>
   </div>
 </template>
 
@@ -168,8 +168,8 @@ export default {
     // 收益列表
     get_income_list($start_time, $end_time) {
       Toast.loading({
-        message:"加载中",
-        duration:0
+        message: "加载中",
+        duration: 0
       })
       let $params = {}
       if ($start_time && $end_time) {
@@ -193,10 +193,23 @@ export default {
     $this.min_date = new Date(2020, 10, 11).getTime()
     $this.max_date = new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()
     //一开始查询全部
-    $this.get_income_list(false, false)
   },
   created() {
     $this = this
+  },
+  onLoad($options) {
+    if ($options.tab) {
+      let $tab = $this.filter_action = $options.tab
+      let $_filter = {}
+      $this.filter_list.forEach(($val, $index) => {
+        if ($val['id'] == $tab) {
+          $_filter = $val
+        }
+      })
+      $this.get_income_list($_filter['start_time'], $_filter['end_time'])
+    } else {
+      $this.get_income_list(false, false)
+    }
   }
 }
 </script>

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

@@ -84,15 +84,15 @@
 
     <!--      菜单列表-->
     <div class="menu">
-      <van-cell title="今日收益(元)" :value="income_info.rebater" is-link url="/pages/agent/income_cal/main">
+      <van-cell title="今日收益(元)" :value="income_info.rebater" is-link url="/pages/agent/income_cal/main?tab=2">
         <van-icon name="balance-o" slot="icon" color="#4B3AB0" class="margin-lr-sm" size="20px"></van-icon>
       </van-cell>
 
-      <van-cell title="今日订单" :value="income_info.today_order" is-link url="/pages/agent/extend/orders/main">
+      <van-cell title="今日订单" :value="income_info.today_order" is-link url="/pages/agent/extend/orders/main?tab=2">
         <van-icon name="notes-o" slot="icon" color="#4B3AB0" class="margin-lr-sm" size="20px"></van-icon>
       </van-cell>
 
-      <van-cell title="今日新增客户" :value="income_info.today_user" is-link url="/pages/agent/customer/main">
+      <van-cell title="今日新增客户" :value="income_info.today_user" is-link url="/pages/agent/customer/main?tab=2">
         <van-icon name="contact" slot="icon" color="#4B3AB0" class="margin-lr-sm" size="20px"></van-icon>
       </van-cell>
 

+ 15 - 10
src/pages/index/index.vue

@@ -31,7 +31,8 @@
       <div class="content">
         <van-row>
           <van-col span="12">
-            <img src="https://img.shuimuai.com/index_btn_chongzhizhongxin.png"  @click="to_page('user_center/recharge')"></img>
+            <img src="https://img.shuimuai.com/index_btn_chongzhizhongxin.png"
+                 @click="to_page('user_center/recharge')"></img>
           </van-col>
           <van-col span="12">
             <img src="https://img.shuimuai.com/web/index_btn_gerenzhongxin.png" @click="to_page('user_center')"></img>
@@ -50,8 +51,8 @@
     </div>
     <van-toast id="van-toast"/>
 
-<!--     <button class="cu-btn lg cu-btn-primary text-white text-center margin-tb" @click="auth_msg">获取消息授权-->
-<!--    </button>-->
+    <!--     <button class="cu-btn lg cu-btn-primary text-white text-center margin-tb" @click="auth_msg">获取消息授权-->
+    <!--    </button>-->
   </div>
 </template>
 
@@ -109,10 +110,14 @@ export default {
     },
     //跳转页面
     to_page($page) {
-      // if ($page == 'agent/index'){
-      //   Toast.fail("暂未开通")
-      //   return false
-      // }
+      if ($page == 'agent/index') {
+        //店员店长不可进
+        console.log([8, 9].indexOf($this.userinfo.level)!=-1)
+        if ([8, 9].indexOf($this.userinfo.level) != -1) {
+          Toast.fail("店员、店长不可进")
+          return false
+        }
+      }
       if (!this.is_login) {
         Toast.fail("请先登录")
         return false
@@ -121,10 +126,10 @@ export default {
         url: "/pages/" + $page + "/main"
       })
     },
-    auth_msg(){
+    auth_msg() {
       wx.requestSubscribeMessage({
-        tmplIds:['NV-xb_oOPutXLVge0ZnBxct_nNxS1j1XNCMtfp2c8zw','70xngszQ62NWHbbCjbggbz5-pvOu3Z8ttLbjfplJXLg'],
-        success(res){
+        tmplIds: ['NV-xb_oOPutXLVge0ZnBxct_nNxS1j1XNCMtfp2c8zw', '70xngszQ62NWHbbCjbggbz5-pvOu3Z8ttLbjfplJXLg'],
+        success(res) {
           console.log(res)
           Toast.success("授权成功")
         }

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

@@ -10,8 +10,8 @@
             <text>
               <text>{{ userinfo.user_name }}</text>
             </text>
-              <text v-if="userinfo.level != 1">{{ userinfo.level_name }}&emsp;有效期至 {{ userinfo.validity_time }}</text>
-              <text v-else>{{ userinfo.level_name }}</text>
+            <text v-if="userinfo.level != 1">{{ userinfo.level_name }}&emsp;有效期至 {{ userinfo.validity_time }}</text>
+            <text v-else>{{ userinfo.level_name }}</text>
           </view>
         </view>
         <!--        <view class="right">-->
@@ -56,8 +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="open_scan">
+      <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/>-->

+ 19 - 11
src/pages/user_center/recharge/index.vue

@@ -46,7 +46,7 @@
                 <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">{{ item.price }} <text class="text-white text-sm">&yen;</text> </text>
               </view>
               <view class="text-center">
                 <img src="https://img.shuimuai.com/web/btn_seedetil_2.png" class="check_detail" alt=""
@@ -71,10 +71,7 @@
 
         <!--    购买按钮-->
         <div class="buy_button">
-          <button class="cu-btn lg bg-orange text-center margin " @click="open_order_confirm(item)">购买{{
-              item.goods_name
-            }}
-          </button>
+          <button class="cu-btn lg bg-orange text-center margin " @click="open_order_confirm(item)">购买{{item.goods_name}}</button>
         </div>
       </view>
     </div>
@@ -109,7 +106,7 @@
                 <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">{{ item.price }} <text class="text-white text-sm">&yen;</text> </text>
               </view>
               <img src="https://img.shuimuai.com/web/btn_seedetil_2.png" class="check_detail" alt=""
                    @click="changeCardShow(item.goods_id)"
@@ -166,7 +163,7 @@
           <text class="text-sm text-gray">实付(元)&emsp;</text>
           <text class="mine_min">{{ selection_card.price * selection_card.discount }}</text>
         </view>
-        <button class="cu-btn bg-primary lg text-white recharge_button" @click="success_pay">立即充值</button>
+        <button class="cu-btn bg-primary lg text-white recharge_button" @click="success_pay" :disabled="btn_disabled">立即充值</button>
       </div>
     </van-popup>
 
@@ -180,8 +177,8 @@
         </view>
         <img src="https://img.shuimuai.com/web/sign_notimeJfish.png" class="err_img" alt="">
         <div class="button_group flex justify-around">
-          <button class="cu-btn bg-gray text-white lg" @click="cancel_recharge">取消支付</button>
-          <button class="cu-btn  bg-primary text-white lg" @click="repay">再次支付</button>
+          <button class="cu-btn bg-gray text-white lg" @click="close_err_pop">取消支付</button>
+          <button class="cu-btn  bg-primary text-white lg" @click="repay" :disabled="btn_disabled">再次支付</button>
         </div>
       </div>
     </van-popup>
@@ -237,7 +234,8 @@ export default {
       //支付信息
       payment_info: {},
       //订单编号
-      order_sn: ""
+      order_sn: "",
+      btn_disabled: false
     }
   },
   watch: {},
@@ -275,6 +273,7 @@ export default {
     },
     //再次付款
     repay() {
+      $this.btn_disabled = true
       let $payment = $this.payment_info
       wx.requestPayment({
         timeStamp: $payment.timeStamp,
@@ -292,9 +291,12 @@ export default {
           $this.open_success_window()
         },
         fail(res) {
-          console.log('fail', res)
+          $this.cancel_recharge()
           $this.close_order_confirm()
           $this.err_show = true
+        },
+        complete() {
+          $this.btn_disabled = false
         }
       })
     },
@@ -305,6 +307,8 @@ export default {
     },
     // 成功支付
     success_pay() {
+       $this.btn_disabled = true
+
       // 支付成功后得回调方法
       let $params = {
         goods_id: $this.selection_card.goods_id,
@@ -338,8 +342,12 @@ export default {
                 },
                 fail(res) {
                   console.log('fail', res)
+                  $this.cancel_recharge()
                   $this.close_order_confirm()
                   $this.err_show = true
+                },
+                complete() {
+                  $this.btn_disabled = false
                 }
               })
             },