ソースを参照

修改代理商的时间控件

yerong 4 年 前
コミット
5628099631

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit ec9d2b7bec76f1f325146379aaf12f2e686664f2
+Subproject commit fd2eab9532dd71d0b8d18f5088235e8a87c21276

+ 27 - 6
src/pages/agent/customer/index.vue

@@ -75,6 +75,8 @@
       type="range"
       @close="do_calendar_close"
       @confirm="do_calendar_confirm"
+      :min-date="min_date"
+      :max-date="max_date"
     ></van-calendar>
 
 
@@ -99,15 +101,21 @@ export default {
         },
         {
           id: 2,
-          name: "今日"
+          name: "今日",
+          start_time: Math.round(new Date(new Date(new Date().toLocaleDateString()).getTime()).getTime() / 1000),
+          end_time: Math.round(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime() / 1000)
         },
         {
           id: 3,
-          name: "昨日"
+          name: "昨日",
+          start_time: Math.round(new Date(new Date(new Date().toLocaleDateString()).getTime() - 24 * 60 * 60 * 1000).getTime() / 1000),
+          end_time: Math.round(new Date(new Date(new Date().toLocaleDateString()).getTime() - 1000).getTime() / 1000)
         },
         {
           id: 4,
-          name: "近七日"
+          name: "近七日",
+          start_time: Math.round(new Date(new Date(new Date().toLocaleDateString()).getTime() - 7 * 24 * 60 * 60 * 1000).getTime() / 1000),
+          end_time: Math.round(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime() / 1000)
         }
       ],
       // 筛选选中项
@@ -126,6 +134,7 @@ export default {
       filter_date: "",
       //最小日期应该为用户使用的第一个月开始
       min_date: false,
+      max_date: false,
       //客户类型
       customer_types: [
         {
@@ -150,6 +159,11 @@ export default {
     change_filter($id) {
       $this.filter_date = ""
       $this.filter_action = $id
+      $this.filter_list.forEach(($val, $index) => {
+        if ($val['id'] == $id) {
+          $this.get_user_list($this.customer_type_action - 1, $val['start_time'], $val['end_time'])
+        }
+      })
     },
     //  自定义筛选时间
     show_datetime_picker() {
@@ -169,7 +183,8 @@ export default {
       let [start, end] = $event.mp.detail;
       $this.filter_date = $this.formatDate(start) + '-' + $this.formatDate(end)
       $this.start_time = Math.round(new Date(start).getTime() / 1000)
-      $this.end_time = Math.round(new Date(end).getTime() / 1000)
+      $this.end_time = Math.round(new Date(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()).getTime() / 1000)
+      $this.get_user_list($this.customer_type_action - 1, $this.start_time, $this.end_time)
       $this.calendar_show = false
     },
     //  切换客户类型筛选
@@ -178,11 +193,15 @@ export default {
       //根据类型获取用户列表
       $this.get_user_list($id - 1)
     },
-    get_user_list($type) {
+    get_user_list($type, $start_time, $end_time) {
       let $params = {}
       if ($type) {
         $params['type'] = $type
       }
+      if ($start_time && $end_time) {
+        $params['start_time'] = $start_time
+        $params['end_time'] = $end_time
+      }
       agentUserList($params).then((res) => {
         let $data = res.data;
         $this.user_list = $data.data
@@ -191,7 +210,9 @@ export default {
     }
   },
   mounted() {
-    $this.min_date = new Date(2020, 1, 1).getTime()
+    $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, $this.min_date, $this.max_date)
   },
   created() {
     $this = this

+ 3 - 2
src/pages/agent/extend/detail/index.vue

@@ -7,7 +7,7 @@
     <van-cell title="卖家等级" value="一级消费" :border="false"></van-cell>
 
     <van-row class="">
-      <van-col span="10">
+      <van-col span="14">
         <van-cell title="佣金收益" :value="order.invite_rebater" :border="false" custom-class="not_show"></van-cell>
         <van-cell title="结算状态"  :border="false">
           <text v-if="order.provide_status == 1">收益到余额</text>
@@ -15,7 +15,7 @@
           <text v-if="order.provide_status == 3">收益到冻结余额</text>
         </van-cell>
       </van-col>
-      <van-col span="10" offset="4">
+      <van-col span="10">
         <van-cell title="佣金收益" :value="order.rebater" :border="false"></van-cell>
         <van-cell title="订单总价" :value="order.price" :border="false"></van-cell>
       </van-col>
@@ -59,6 +59,7 @@ export default {
   },
   onLoad($options) {
     let $order_sn = $options.sn
+    $this.get_order($order_sn)
   }
 }
 </script>

+ 11 - 5
src/pages/agent/extend/orders/index.vue

@@ -74,6 +74,8 @@
       type="range"
       @close="do_calendar_close"
       @confirm="do_calendar_confirm"
+      :min-date="min_date"
+      :max-date="max_date"
     ></van-calendar>
 
 
@@ -124,6 +126,8 @@ export default {
       filter_date: "",
       //最小日期应该为用户使用的第一个月开始
       min_date: false,
+      max_date: false,
+
     }
   },
   methods: {
@@ -131,7 +135,7 @@ export default {
     change_filter($id) {
       $this.filter_date = ""
       $this.filter_action = $id
-      $this.filter_date.forEach(($val, $index) => {
+      $this.filter_list.forEach(($val, $index) => {
         if ($val['id'] == $id) {
           $this.get_order_list($val['start_time'], $val['end_time'])
         }
@@ -155,7 +159,7 @@ export default {
       let [start, end] = $event.mp.detail;
       $this.filter_date = $this.formatDate(start) + '-' + $this.formatDate(end)
       $this.start_time = Math.round(new Date(start).getTime() / 1000)
-      $this.end_time = Math.round(new Date(end).getTime() / 1000)
+      $this.end_time = Math.round(new Date(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()).getTime() / 1000)
       $this.get_order_list($this.start_time, $this.end_time)
       $this.calendar_show = false
     },
@@ -186,7 +190,8 @@ export default {
   },
   mounted() {
     $this.get_order_list()
-    $this.min_date = new Date(2020, 1, 1).getTime()
+    $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
@@ -195,10 +200,11 @@ export default {
 </script>
 
 <style scoped>
-.text-normal{
+.text-normal {
   color: #6A6A6A;
 }
-.profit_container{
+
+.profit_container {
   margin: 30px 0px;
 }
 </style>

+ 10 - 5
src/pages/agent/income_cal/index.vue

@@ -71,6 +71,8 @@
       type="range"
       @close="do_calendar_close"
       @confirm="do_calendar_confirm"
+      :min-date="min_date"
+      :max-date="max_date"
     ></van-calendar>
 
 
@@ -126,6 +128,7 @@ export default {
       filter_date: "",
       //最小日期应该为用户使用的第一个月开始
       min_date: false,
+      max_date: false,
     }
   },
   methods: {
@@ -133,7 +136,7 @@ export default {
     change_filter($id) {
       $this.filter_date = ""
       $this.filter_action = $id
-      $this.filter_date.forEach(($val, $index) => {
+      $this.filter_list.forEach(($val, $index) => {
         if ($val['id'] == $id) {
           $this.get_income_list($val['start_time'], $val['end_time'])
         }
@@ -157,7 +160,7 @@ export default {
       let [start, end] = $event.mp.detail;
       $this.filter_date = $this.formatDate(start) + '-' + $this.formatDate(end)
       $this.start_time = Math.round(new Date(start).getTime() / 1000)
-      $this.end_time = Math.round(new Date(end).getTime() / 1000)
+      $this.end_time = Math.round(new Date(new Date(new Date(new Date().toLocaleDateString()).getTime() + 24 * 60 * 60 * 1000 - 1).getTime()).getTime() / 1000)
       $this.get_income_list($this.start_time, $this.end_time)
       $this.calendar_show = false
     },
@@ -181,7 +184,8 @@ export default {
     }
   },
   mounted() {
-    $this.min_date = new Date(2020, 1, 1).getTime()
+    $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)
   },
@@ -192,10 +196,11 @@ export default {
 </script>
 
 <style scoped>
-.text-normal{
+.text-normal {
   color: #6A6A6A;
 }
-.profit_container{
+
+.profit_container {
   margin: 30px 0px;
 }
 </style>

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

@@ -105,10 +105,10 @@ export default {
     },
     //跳转页面
     to_page($page) {
-      if ($page == 'agent/index'){
-        Toast.fail("暂未开通")
-        return false
-      }
+      // if ($page == 'agent/index'){
+      //   Toast.fail("暂未开通")
+      //   return false
+      // }
       if (!this.is_login) {
         Toast.fail("请先登录")
         return false

+ 25 - 31
src/pages/start/index.vue

@@ -116,24 +116,24 @@
     </div>
 
     <!--    窗口弹出-->
-    <van-popup :show="pop_show" @close="close_pop" round :close-on-click-overlay="false"
-               overlay
-               z-index="99">
-      <div class="err_container flex flex-direction align-center justify-around">
-        <view>
-          <text class="title">
-            本次游玩时间已到
-          </text>
-        </view>
-        <view>
-          <text class="sub-title">
-            您的{{ mode_item.name }}消费已用完
-          </text>
-        </view>
-        <img src="https://img.shuimuai.com/web/sign_notimeJfish.png" class="err_img" alt="">
-        <button class="cu-btn lg bg-primary text-white" @click="game_finished">查看报告</button>
-      </div>
-    </van-popup>
+    <!--    <van-popup :show="pop_show" @close="close_pop" round :close-on-click-overlay="false"-->
+    <!--               overlay-->
+    <!--               z-index="99">-->
+    <!--      <div class="err_container flex flex-direction align-center justify-around">-->
+    <!--        <view>-->
+    <!--          <text class="title">-->
+    <!--            本次游玩时间已到-->
+    <!--          </text>-->
+    <!--        </view>-->
+    <!--        <view>-->
+    <!--          <text class="sub-title">-->
+    <!--            您的{{ mode_item.name }}消费已用完-->
+    <!--          </text>-->
+    <!--        </view>-->
+    <!--        <img src="https://img.shuimuai.com/web/sign_notimeJfish.png" class="err_img" alt="">-->
+    <!--        <button class="cu-btn lg bg-primary text-white" @click="game_finished">查看报告</button>-->
+    <!--      </div>-->
+    <!--    </van-popup>-->
     <van-toast id="van-toast"/>
     <van-dialog id="van-dialog"/>
   </div>
@@ -195,7 +195,6 @@ export default {
 
       timeData: {},
       mode_item: {},
-      pop_show: false,
       elc_power: 100,
       // 折线图
       echarts,
@@ -273,13 +272,8 @@ export default {
         $this.to_report()
       }, 800)
     },
-    //  关闭弹窗
-    close_pop() {
-      $this.pop_show = false
-    },
     // 时间到
     time_out() {
-      // $this.pop_show = true
       $this.game_finished()
     },
     to_report() {
@@ -344,11 +338,13 @@ export default {
           $this.elc_power = $power
           //电量低于20就提示 电量不足
           if ($power < 20 && $power > 0) {
-            Dialog.alert({
-              message: '脑环电量不足',
-            }).then(() => {
-              $this.game_finished()
-            });
+            wx.showModal({
+              content: "脑环电量不足",
+              showCancel: false,
+              success() {
+                $this.game_finished()
+              }
+            })
           }
         }
         bluetooth.sendControl($this._deviceId, $this._serviceId, $this._characteristicId)
@@ -447,7 +443,6 @@ export default {
     } else {
       //  筛选 玩具id
       $this.toy_hex = game_store.getters.getToyHex()
-      // bluetooth.sendConnect($this.toy_hex, $this._deviceId, $this._serviceId, $this._characteristicId)
 
       //筛选模式
       $this.mode = game_store.getters.getMode()
@@ -501,7 +496,6 @@ export default {
       wx.offBLECharacteristicValueChange()
       //存储时间
       game_store.setters.setPlayTime($this.played_time)
-      this.pop_show = false
       //设置未结束游戏
       $this.is_end = false
     }

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

@@ -4,6 +4,7 @@
     "van-col": "../../static/vant/col/index",
     "van-toast": "../../static/vant/toast/index",
     "van-popup": "../../static/vant/popup/index",
-    "van-count-down": "../../static/vant/count-down/index"
+    "van-count-down": "../../static/vant/count-down/index",
+    "van-dialog": "../../static/vant/dialog/index"
   }
 }