浏览代码

合并前更新5/8

unknown 4 年之前
父节点
当前提交
dffe9e475a

+ 4 - 1
src/app.json

@@ -1,5 +1,6 @@
 {
   "pages": [
+
     "pages/index/main",
     "pages/start/main",
     "pages/none/main",
@@ -26,7 +27,9 @@
     "pages/agent/settlement_center/withdraw/detail/main",
     "pages/agent/settlement_center/withdraw/list/main",
     "pages/test/main",
-    "pages/competition/main"
+    "pages/competition/main",
+    "pages/payment/main"
+
   ],
   "window": {
     "backgroundTextStyle": "light",

+ 49 - 27
src/components/banner.vue

@@ -1,12 +1,29 @@
 <template>
   <div id="banner_container">
     <!--    <img src="https://img.shuimuai.com/mp/banners/banner1%402x.png" class="full_img main_banner" alt="">-->
-    <swiper class="screen-swiper round-dot full_img main_banner" :indicator-dots="true" :circular="true"
-            :autoplay="true" interval="5000" duration="500">
-      <swiper-item v-for="(item,index) in banners" :key="index" class="full_img main_banner">
-        <img :src="item.src" mode="aspectFill" class="full_img main_banner">
-        <button class="cu-btn bg-yellow text-white join_button" @click="to_none(item.url)">{{
-            item.button_text
+    <swiper
+      class="screen-swiper round-dot full_img main_banner"
+      :indicator-dots="true"
+      :circular="true"
+      :autoplay="true"
+      interval="5000"
+      duration="500"
+    >
+      <swiper-item
+        v-for="(item,index) in banners"
+        :key="index"
+        class="full_img main_banner"
+      >
+        <img
+          :src="item.src"
+          mode="aspectFill"
+          class="full_img main_banner"
+        >
+        <button
+          class="cu-btn bg-yellow text-white join_button"
+          @click="to_none(item.url)"
+        >{{
+          item.button_text
           }}
         </button>
       </swiper-item>
@@ -15,7 +32,7 @@
 </template>
 
 <script>
-import {getBannerList} from "../requests/user";
+import { getBannerList } from "../requests/user";
 
 var $this;
 export default {
@@ -26,42 +43,47 @@ export default {
         {
           id: 1,
           src: "https://img.shuimuai.com/mp/banners/banner1%402x.png",
-          url: '/pages/none/main',
-          button_text: '关于水母星球'
+          url: "/pages/none/main",
+          button_text: "关于水母星球",
         },
         {
           id: 2,
           src: "https://img.shuimuai.com/mp/banners/banner3%402x.png",
-          url: '/pages/competition/main',
-          button_text: '比赛详情'
-        }
-      ]
-    }
+          url: "/pages/competition/main",
+          button_text: "比赛详情",
+        },
+      ],
+    };
   },
   methods: {
     to_none($url) {
       mpvue.navigateTo({
-        url: $url
-      })
+        url: $url,
+      });
     },
     getBanners() {
       getBannerList().then((res) => {
-        let $res = res.data
-        let $activities = $res.data
-        let $new_act = $activities.pop()
-        console.log($new_act)
-        $this.banners[1].src = $new_act['img']?$new_act['img']:"https://img.shuimuai.com/mp/pkbanner4%402x.png"
-        $this.banners[1].url = '/pages/competition/main?activity_id=' + $new_act['activity_id']
-      })
-    }
+        let $res = res.data;
+        let $activities = $res.data;
+        let $new_act = $activities.pop();
+        // console.log("轮播图", $new_act);
+
+        $this.banners[1].src = $new_act["img"]
+          ? "https://img.shuimuai.com/" + $new_act["img"]
+          : "https://img.shuimuai.com/banner_activity_may_1.png";
+
+        $this.banners[1].url =
+          "/pages/competition/main?activity_id=" + $new_act["activity_id"];
+      });
+    },
   },
   mounted() {
-    $this.getBanners()
+    $this.getBanners();
   },
   created() {
     $this = this;
-  }
-}
+  },
+};
 </script>
 
 <style>

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

@@ -339,7 +339,12 @@ export default {
     },
     //打开蓝牙搜索
     onBluetoothDeviceFound() {
-      console.log("打开蓝牙搜索");
+      console.log(
+        "打开蓝牙搜索 device_status",
+        $this.device_status,
+        "是否有id _deviceId",
+        $this._deviceId
+      );
       try {
         // 5秒后判断 这5秒在搜索设备,搜索到就赋值给_deviceId
         setTimeout(() => {
@@ -347,6 +352,10 @@ export default {
             wx.stopBluetoothDevicesDiscovery();
             $this.change_device_status(0);
             Toast.fail("未连接到设备");
+          } else if ($this.device_status == 1) {
+            wx.stopBluetoothDevicesDiscovery();
+            $this.change_device_status(0);
+            Toast.fail("设备未连接到");
           }
         }, 5000);
         wx.onBluetoothDeviceFound((res) => {
@@ -363,6 +372,8 @@ export default {
               game_store.setters.setDeviceId(device.deviceId);
               $this._deviceId = device.deviceId;
 
+              console.log("蓝牙搜索状态 device_status", $this.device_status);
+
               $this.createBLEConnection();
             }
           });
@@ -373,6 +384,12 @@ export default {
     },
     // 停止蓝牙搜索
     stopBluetoothDevicesDiscovery() {
+      console.log(
+        "脑环被占用的情况下我能获取到吗?",
+        $this.device_status,
+        "是否有id _deviceId",
+        $this._deviceId
+      );
       wx.stopBluetoothDevicesDiscovery();
     },
     //连接低功耗蓝牙设备。

+ 25 - 14
src/components/device/unconnect.vue

@@ -1,42 +1,53 @@
 <template>
   <div>
     <van-row>
-      <van-col span="11" class="text-gray text-sm left" offset="1">
+      <van-col
+        span="11"
+        class="text-gray text-sm left"
+        offset="1"
+      >
         <view>1.打开手机蓝牙和位置信息</view>
         <view>2.长按头环侧面按钮启动头环</view>
         <view>3.点击扫码开始连接</view>
       </van-col>
 
-      <van-col span="8" offset="2">
-        <img src="https://img.shuimuai.com/lanyashuimu.png" class="connect_img"/>
+      <van-col
+        span="8"
+        offset="2"
+      >
+        <img
+          src="https://img.shuimuai.com/lanyashuimu.png"
+          class="connect_img"
+        />
       </van-col>
     </van-row>
-    <button class="cu-btn lg cu-btn-primary text-white text-center scan_button margin-tb" @click="open_scan">扫码连接智脑环
+    <button
+      class="cu-btn lg cu-btn-primary text-white text-center scan_button margin-tb"
+      @click="open_scan"
+    >扫码连接智脑环
     </button>
-    <van-toast id="van-toast"/>
+    <van-toast id="van-toast" />
 
   </div>
 </template>
 
 <script>
-
-var $this
+var $this;
 export default {
   name: "unconnect",
   data() {
-    return {}
+    return {};
   },
   methods: {
     open_scan() {
-      this.$emit('open_scan')
-    }
+      this.$emit("open_scan");
+    },
   },
   created() {
-    $this = this
+    $this = this;
   },
-  onShow() {
-  }
-}
+  onShow() {},
+};
 </script>
 
 <style scoped>

+ 98 - 45
src/pages/agent/index/index.vue

@@ -6,12 +6,20 @@
       <van-row>
 
         <div class="userinfo padding-tb-sm">
-          <van-col span="3" offset="2">
-            <view class="cu-avatar lg"
-                  :style="'background-image:url('+userinfo.portrait+');'"></view>
+          <van-col
+            span="3"
+            offset="2"
+          >
+            <view
+              class="cu-avatar lg"
+              :style="'background-image:url('+userinfo.portrait+');'"
+            ></view>
           </van-col>
 
-          <van-col span="6" offset="1">
+          <van-col
+            span="6"
+            offset="1"
+          >
             <view class="label">
               <view class="text-bold">
                 <text class="text-white text-lg">{{ userinfo.user_name }}</text>
@@ -22,12 +30,14 @@
             </view>
           </van-col>
 
-
         </div>
       </van-row>
 
       <!--      收益模块-->
-      <div class="profit_container text-center" @click="to_income">
+      <div
+        class="profit_container text-center"
+        @click="to_income"
+      >
         <view>
           <text class="text-normal padding">累计收益(元)</text>
         </view>
@@ -42,11 +52,14 @@
         </view>
       </div>
 
-
       <!--      订单、客户、邀请卡粗图-->
       <div class="profit_detail_contaienr text-center padding-top-lg">
         <van-row gutter="40">
-          <van-col span="6" offset="3" @click="to_extend_order">
+          <van-col
+            span="6"
+            offset="3"
+            @click="to_extend_order"
+          >
             <view>
               <text class="text-xxl text-white">{{ agent_info.order_count }}</text>
             </view>
@@ -54,7 +67,10 @@
               <text class="text-normal text-sm">累计订单</text>
             </view>
           </van-col>
-          <van-col span="6" @click="to_customer">
+          <van-col
+            span="6"
+            @click="to_customer"
+          >
             <view>
               <text class="text-xxl text-white">{{ agent_info.user_count }}</text>
             </view>
@@ -62,7 +78,10 @@
               <text class="text-normal text-sm">累计客户</text>
             </view>
           </van-col>
-          <van-col span="6" @click="to_agent_invite_card">
+          <van-col
+            span="6"
+            @click="to_agent_invite_card"
+          >
             <view>
               <text class="text-xxl text-white">{{ agent_info.invite_count }}</text>
             </view>
@@ -75,39 +94,74 @@
       </div>
     </div>
 
-
     <!--      提现金额-->
-    <div class="withdraw_container flex justify-between align-center padding-lr" @click="to_agent_cal_center">
+    <div
+      class="withdraw_container flex justify-between align-center padding-lr"
+      @click="to_agent_cal_center"
+    >
       <text class="text-white">可提现金额(元)</text>
       <text class="text-white withdraw_money">{{ agent_info.user_balance }}</text>
     </div>
 
     <!--      菜单列表-->
     <div class="menu">
-      <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
+        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?tab=2">
-        <van-icon name="notes-o" slot="icon" color="#4B3AB0" class="margin-lr-sm" size="20px"></van-icon>
+      <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?tab=2">
-        <van-icon name="contact" slot="icon" color="#4B3AB0" class="margin-lr-sm" size="20px"></van-icon>
+      <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>
 
     </div>
-    <van-toast id="van-toast"/>
+    <van-toast id="van-toast" />
 
   </div>
 </template>
 
 <script>
-import {agentDetail, agentIncomeDetail} from "../../../requests/agent";
-import utils from '@/utils/index'
-import Toast from '../../../../static/vant/toast/toast'
+import { agentDetail, agentIncomeDetail } from "../../../requests/agent";
+import utils from "@/utils/index";
+import Toast from "../../../../static/vant/toast/toast";
 
-var $this
+var $this;
 export default {
   name: "agent_index_container",
   filter: {},
@@ -119,31 +173,31 @@ export default {
       //代理商详情
       agent_info: {},
       //代理商收益详情
-      income_info: {}
-    }
+      income_info: {},
+    };
   },
   methods: {
     //跳转收益中心
     to_income() {
       mpvue.navigateTo({
-        url: "/pages/agent/income_cal/main?tab=1"
-      })
+        url: "/pages/agent/income_cal/main?tab=1",
+      });
     },
     //  跳转推广订单
     to_extend_order() {
       mpvue.navigateTo({
-        url: "/pages/agent/extend/orders/main?tab=1"
-      })
+        url: "/pages/agent/extend/orders/main?tab=1",
+      });
     },
     //  跳转推广客户
     to_customer() {
       mpvue.navigateTo({
-        url: "/pages/agent/customer/main?tab=1"
-      })
+        url: "/pages/agent/customer/main?tab=1",
+      });
     },
     //  跳转代理商结算中心
     to_agent_cal_center() {
-      Toast.fail('暂未开通,请联系客服')
+      Toast.fail("暂未开通,请联系客服");
       // mpvue.navigateTo({
       //   url: "/pages/agent/settlement_center/index/main"
       // })
@@ -151,32 +205,32 @@ export default {
     //  邀请卡库存
     to_agent_invite_card() {
       mpvue.navigateTo({
-        url: "/pages/agent/invite_card_inventory/main"
-      })
+        url: "/pages/agent/invite_card_inventory/main",
+      });
     },
     //获取代理商详情
     get_agent_detail() {
       agentDetail().then((res) => {
         let $data = res.data;
         $this.agent_info = $data.data;
-      })
+      });
       agentIncomeDetail().then((res) => {
         let $data = res.data;
         $this.income_info = $data.data;
-      })
-    }
+      });
+    },
   },
   mounted() {
-    $this.get_agent_detail()
-    $this.userinfo = wx.getStorageSync('userinfo')
+    $this.get_agent_detail();
+    $this.userinfo = wx.getStorageSync("userinfo");
   },
   onShow() {
-    $this.get_agent_detail()
+    $this.get_agent_detail();
   },
   created() {
-    $this = this
-  }
-}
+    $this = this;
+  },
+};
 </script>
 
 <style scoped>
@@ -189,13 +243,12 @@ export default {
 }
 
 .text-normal {
-  color: #97B2DE;
+  color: #97b2de;
 }
 
 .profit_detail_contaienr {
 }
 
-
 .withdraw_container {
   background-image: url("https://img.shuimuai.com/web/frame_dailishang_tixian.png");
   background-position: center;

+ 27 - 12
src/pages/competition/index.vue

@@ -74,6 +74,7 @@
         > -->
         <!--分享按钮-->
         <van-image
+          class="complete_btns_fixed_img"
           src="https://img.shuimuai.com/share_btn@2x.png"
           @click="show_share_window"
           width="160px"
@@ -86,6 +87,7 @@
         > -->
         <!--参与按钮-->
         <van-image
+          class="complete_btns_fixed_img"
           src="https://img.shuimuai.com/join_btn@2x.png"
           @click="to_info"
           width="160px"
@@ -93,6 +95,7 @@
           v-if="joined == false"
         ></van-image>
         <van-image
+          class="complete_btns_fixed_img"
           src="https://img.shuimuai.com/rank@2x.png"
           alt=""
           @click="to_rank"
@@ -150,7 +153,7 @@
             <van-row>
               <van-col span="8">
                 <img
-                  src="https://img.shuimuai.com/yu_sai_rank@2x.png"
+                  src="https://img.shuimuai.com/yu_sai_rank_may.png"
                   alt=""
                   class="rank_card"
                   @click="changeRankAction(1)"
@@ -164,7 +167,7 @@
               </van-col>
               <van-col span="8">
                 <img
-                  src="https://img.shuimuai.com/raise_rank@2x.png"
+                  src="https://img.shuimuai.com/raise_rank_may.png"
                   alt=""
                   class="rank_card"
                   @click="changeRankAction(2)"
@@ -178,7 +181,7 @@
               </van-col>
               <van-col span="8">
                 <img
-                  src="https://img.shuimuai.com/final_rank@2x.png"
+                  src="https://img.shuimuai.com/final_rank_may.png"
                   alt=""
                   class="rank_card"
                   @click="changeRankAction(3)"
@@ -696,7 +699,7 @@
       <!--   扫码关注我们模块   -->
       <div class="qrcode_container">
         <img
-          src="https://img.shuimuai.com/code@2x.png"
+          src="https://img.shuimuai.com/code_bottom.png"
           alt=""
           class="qrcode_container_img"
         >
@@ -760,10 +763,12 @@ export default {
       },
       icon_show: false,
       // 是否悬浮
-      is_fixed: false,
+      // is_fixed: false,
+      is_fixed: true,
       scroll_id: "",
     };
   },
+  // 监听
   watch: {
     rank_action($new, $old) {
       if ($new == 2) {
@@ -940,7 +945,7 @@ export default {
     //监听滚动
     onListenScroll(event) {
       let $scrollTop = event.mp.detail.scrollTop;
-      $this.is_fixed = $scrollTop > 400;
+      $this.is_fixed = $scrollTop > -1;
       $this.scroll_id = "";
     },
   },
@@ -994,10 +999,13 @@ page {
 }
 
 .index_container {
-  background: url("https://img.shuimuai.com//mp/pk/background_3%402x.png");
+  /* background: url("https://img.shuimuai.com//mp/pk/background_3%402x.png"); */
+  background: url("https://img.shuimuai.com/mppkbackground_May_5.png");
+
   background-size: 100% 100%;
   background-position: center;
-  height: 2487px;
+  /* height: 2487px; */
+  height: 2695px;
   width: 100%;
 }
 
@@ -1015,7 +1023,7 @@ page {
 
 .complete_btns {
   position: absolute;
-  top: 580px;
+  top: 650px;
   display: flex;
   width: 100%;
   justify-content: space-around;
@@ -1028,6 +1036,13 @@ page {
   display: flex;
   width: 100%;
   justify-content: space-around;
+  height: 80px;
+  align-items: center;
+  background: url(https://img.shuimuai.com/complete_bg.png);
+  background-size: 100% 100%;
+}
+.complete_btns_fixed_img {
+  margin-top: 7px;
 }
 
 .share_info {
@@ -1061,7 +1076,7 @@ page {
   width: 294px;
   height: 49px;
   position: absolute;
-  top: 323px;
+  top: 408px;
   left: 41px;
 }
 
@@ -1092,7 +1107,7 @@ page {
 }
 
 .count_down_container .count_down_time:nth-child(4) {
-  left: 135px;
+  left: 145px;
   top: 15px;
   bottom: 16px;
 }
@@ -1467,7 +1482,7 @@ page {
 
 .diy_container .qrcode_container_img {
   width: 352px;
-  height: 194px;
+  height: 228px;
 }
 
 .not_show {

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

@@ -191,7 +191,8 @@ export default {
   onHide() {},
   onLoad($option) {
     if (process.env.NODE_ENV == "development") {
-      wx.setStorageSync("token", "7MZYqpAWOdw8WDxsgUV5QkQnKfrU5L_7");
+      // wx.setStorageSync("token", "7MZYqpAWOdw8WDxsgUV5QkQnKfrU5L_7");
+      wx.setStorageSync("token", "PADD7JOgYHsv_cU_mJvv2pdAoxrGVIFu");
     }
 
     console.log(
@@ -226,6 +227,9 @@ export default {
       user_store.setters.set_token($token);
       user_store.setters.set_login(true);
       this.is_login = user_store.getters.get_login_status();
+      wx.navigateTo({
+        url: "/pages/payment/main",
+      });
     }
   },
   created() {

+ 51 - 0
src/pages/payment/index.vue

@@ -0,0 +1,51 @@
+<template>
+  <div id="payment_container">
+    <form action="">
+      <view class="cu-form-group">
+        <view class="title">支付金额</view>
+        <input v-model="amount" placeholder="输入支付金额" type="digit"></input>
+      </view>
+    </form>
+    <button class="cu-btn round bg-green text-center lg margin-tb-lg" style="width: 100%;"
+            @click="makePay"
+    >支付
+    </button>
+  </div>
+</template>
+
+<script type="text/javascript">
+import {testPay} from "../../requests/orders";
+
+export default {
+  name: "PaymentContainer",
+  data() {
+    return {
+      amount: ""
+    }
+  },
+  methods: {
+    makePay() {
+      console.log(this.amount)
+      testPay(this.amount).then((res) => {
+        let $res = res.data;
+        let $payment = $res.data;
+        wx.requestPayment({
+          timeStamp: $payment.timeStamp,
+          nonceStr: $payment.nonceStr,
+          package: $payment.package,
+          signType: $payment.signType,
+          paySign: $payment.sign,
+          success(res) {
+            //支付成功
+            console.log('success', res)
+
+          },
+        })
+      })
+    }
+  },
+  mounted() {
+
+  }
+}
+</script>

+ 12 - 0
src/pages/payment/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()

+ 4 - 0
src/pages/payment/main.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {
+  }
+}

+ 39 - 266
src/pages/report/index.vue

@@ -24,150 +24,33 @@
       </view>
       <view class="down">
         <view>{{ record.att_average }}</view>
-        <view>专注力得分</view>
+        <view>专注力均值</view>
       </view>
     </view>
-
-    <!--    训练时长和训练设备-->
-    <view class="po1 padding-lr margin-top-xl">
-      <van-row>
-        <van-col span="11">
-          <view>
-            <text>训练时长</text>
-            <text class="text-bold text-xl"> &nbsp; {{ record.play_time }}</text>
-          </view>
-        </van-col>
-
-        <van-col
-          span="11"
-          offset="2"
-        >
-          <view>
-            <text>训练设备</text>
-            <text class="text-bold text-xl">&nbsp; {{ record.name }}</text>
-          </view>
-        </van-col>
-      </van-row>
-    </view>
-    <view>
-      <van-divider
-        contentPosition="left"
-        borderColor="#E98F36"
-      >
-        <van-image
-          src="https://img.shuimuai.com/line.png"
-          alt=""
-          width="40"
-          height="40"
-        ></van-image>
-      </van-divider>
-    </view>
-
-    <!--    专注力维持区间、受干扰次数,专注力最大爆发值、专注力启动时长-->
-    <view class="margin-tb">
-      <van-row>
-        <van-col span="16">
-          <van-row>
-            <van-col span="12">
-              <view class="detail">
-                <view>
-                  <view>{{ record.scope_diff }}</view>
-                  <view>专注力维持区间</view>
-                </view>
-              </view>
-            </van-col>
-            <van-col span="12">
-              <view class="detail">
-                <view>
-                  <view>{{ record.interfere }}</view>
-                  <view>受干扰次数</view>
-                </view>
-              </view>
-
-            </van-col>
-          </van-row>
-
-          <van-row>
-            <van-col span="12">
-              <view class="detail">
-                <view>
-                  <view>{{ record.burst }}</view>
-                  <view>专注力最大爆发值</view>
-                </view>
-              </view>
-
-            </van-col>
-            <van-col span="12">
-              <view class="detail">
-                <view>
-                  <view>{{ record.start }}</view>
-                  <view>专注力启动时长</view>
-                </view>
-              </view>
-            </van-col>
-          </van-row>
-        </van-col>
-        <van-col span="5">
-          <view class="text-center">
-            <view class="hight_pie_chart">
-              <mpvue-echarts
-                :echarts="echarts"
-                :onInit="hight_att_charts"
-                canvasId="demo-canvas1"
-              />
-            </view>
-            <view class="detail">
-              <view>
-                <view>{{ record.height_absorbed }}%</view>
-                <view>高专注力占比</view>
-              </view>
-            </view>
-          </view>
-        </van-col>
-      </van-row>
-    </view>
-
     <view class="bar">
       <view>
         <view class="line"></view>
-        <view class="title">专注力要素分析</view>
+        <view class="title">数据详情</view>
       </view>
     </view>
-
-    <view class="radar_chart">
-      <mpvue-echarts
-        :echarts="echarts"
-        :onInit="radar_charts"
-        canvasId="demo-canvas2"
-      />
-    </view>
-
-    <view class="">
-      <view class="bar">
-        <view>
-          <view class="line"></view>
-          <view class="title">报告分析</view>
-        </view>
+    <view class="detail">
+      <view>
+        <view>{{ record.att_max }}</view>
+        <view>专注力最高分</view>
+        <!-- <view>{{ record.interfere }} </view>
+        <view>被干扰次数</view> -->
       </view>
-      <view class="conclution">{{ record.content }}</view>
-      <!-- <view class="conclution">{{ record.content2 }}</view> -->
-
-      <view class="bar">
-        <view>
-          <view class="line"></view>
-          <view class="title">训练建议</view>
-        </view>
+      <view>
+        <view>{{ record.scope_diff }}</view>
+        <view>专注力广度</view>
       </view>
-      <view class="conclution">{{ record.advise }}</view>
     </view>
-
     <view class="bar">
       <view>
         <view class="line"></view>
-        <view class="title">专注力数值曲线</view>
+        <view class="title">基本脑波</view>
       </view>
     </view>
-
     <view class="chart">
       <mpvue-echarts
         :echarts="echarts"
@@ -193,34 +76,27 @@
         ></van-tab>
       </van-tabs>
     </view>
-
-    <view class="cu-bar bg-white">
-      <view class="action">
-        <text class="cuIcon-titles text-primary"></text>
-        <text class="">专注力数值累计比例</text>
+    <view class="conclution"> <text class="conclution_title">分析</text>: {{ record.content }}</view>
+    <view class="conclution"> <text class="conclution_title">建议</text>: {{ record.advise }}</view>
+    <view class="bar">
+      <view>
+        <view class="line"></view>
+        <view class="title">核销详情</view>
       </view>
     </view>
-    <view class="chart">
-      <mpvue-echarts
-        :echarts="echarts"
-        :onInit="pie_charts"
-        canvasId="demo-canvas-1"
-      />
+    <view class="sheet">
+      <view class="left">
+        <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>专注力训练时长: {{ record.play_time }}</view>
+      </view>
     </view>
-
-    <!--    <view class="sheet">-->
-    <!--      <view class="left">-->
-    <!--        <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>专注力训练时长: {{ record.play_time }}</view>-->
-    <!--      </view>-->
-    <!--    </view>-->
     <van-toast id="van-toast" />
 
   </div>
@@ -229,18 +105,12 @@
 <script>
 import mpvueEcharts from "mpvue-echarts";
 import echarts from "../../../static/echarts.min";
-import util, {
-  filterPieData,
-  formatSeconds,
-  getHightPieChartOption,
-  getPieChartsOption,
-  getRadarChartOption,
-} from "../../utils/index";
+import util, { formatSeconds } from "../../utils/index";
 import { gameDetail, gameLineChart } from "../../requests/game";
 import game_store from "../../store/game";
 import Toast from "../../../static/vant/toast/toast";
 
-var att_charts, hight_att_pie_charts, radar_charts, $pie_charts, $this;
+var att_charts, $this;
 
 // 大脑图表初始化
 function initAttChart(canvas, width, height) {
@@ -257,50 +127,6 @@ function initAttChart(canvas, width, height) {
   return att_charts; // 返回 chart 后可以自动绑定触摸操作
 }
 
-// 大脑图表初始化
-function initHightPieChart(canvas, width, height) {
-  hight_att_pie_charts = echarts.init(canvas, null, {
-    width: width,
-    height: height,
-  });
-  canvas.setChart(hight_att_pie_charts);
-
-  var option = getHightPieChartOption(0, 0); // ECharts 配置项  
-
-  hight_att_pie_charts.setOption(option);
-
-  return hight_att_pie_charts; // 返回 chart 后可以自动绑定触摸操作
-}
-
-// 大脑图表初始化
-function initRadarChart(canvas, width, height) {
-  radar_charts = echarts.init(canvas, null, {
-    width: width,
-    height: height,
-  });
-  canvas.setChart(radar_charts);
-
-  var option = getRadarChartOption(0); // ECharts 配置项
-
-  radar_charts.setOption(option);
-
-  return radar_charts; // 返回 chart 后可以自动绑定触摸操作
-}
-
-function initPieChart(canvas, width, height) {
-  $pie_charts = echarts.init(canvas, null, {
-    width: width,
-    height: height,
-  });
-  canvas.setChart($pie_charts);
-
-  var option = getPieChartsOption(); // ECharts 配置项
-
-  $pie_charts.setOption(option);
-
-  return $pie_charts; // 返回 chart 后可以自动绑定触摸操作
-}
-
 export default {
   name: "index_container",
   components: {
@@ -311,10 +137,6 @@ export default {
       // 0:未选择 1:时间 2:次数
       // 折线图
       attCharts: initAttChart,
-      hight_att_charts: initHightPieChart,
-      radar_charts: initRadarChart,
-      pie_charts: initPieChart,
-
       echarts,
       record: {},
       userinfo: {},
@@ -340,35 +162,10 @@ export default {
       setTimeout(() => {
         gameDetail($record_id).then(
           (res) => {
+            console.log("get_game_detail", res);
             Toast.clear();
             let $res = res.data;
             $this.record = $res.data;
-            console.log("成绩记录参数", $this.record);
-            $this.record.play_time = formatSeconds($this.record.play_time);
-            $this.record.height_absorbed = Math.ceil(
-              $this.record.height / $this.record.total * 100
-            );
-            let $options = getHightPieChartOption(
-              $this.record.height,
-              $this.record.total
-            );
-            hight_att_pie_charts.setOption($options);
-
-            //设置雷达图
-            $options = getRadarChartOption([
-              $this.record.att_average, //平均
-              $this.record.att_scope,   //广度
-              $this.record.att_burst,   //爆发
-              $this.record.att_interfere, //抗干扰
-              $this.record.att_start,  //启动
-              $this.record.att_height,  // 高专注占比
-            ]);
-            radar_charts.setOption($options);
-
-            let $pie_data = filterPieData($this.record.level);
-            let $pie_option = getPieChartsOption($pie_data);
-            $pie_charts.setOption($pie_option);
-
             //5分钟阶段
             let $five_min = 5 * 60;
             $this.is_cut = $this.record.play_time > $five_min;
@@ -378,6 +175,7 @@ export default {
                 $this.record.play_time / $five_min
               );
             }
+            $this.record.play_time = formatSeconds($this.record.play_time);
           },
           (err) => {
             Toast.fail("错误代码:" + res.code + ",联系客服");
@@ -418,7 +216,7 @@ export default {
               $option = util.getLineOption($line_data, [0]);
             }
             att_charts.setOption($option);
-          }, 800);
+          }, 1000);
         },
         (err) => {
           Toast.fail("错误代码:" + res.code + ",联系客服");
@@ -443,6 +241,7 @@ export default {
     wx.removeStorageSync("played_time");
     $this.get_report($this.record_id);
     $this.get_game_line($this.record_id);
+    console.log("进来时候获取到的信息", $this.record);
   },
   created() {
     $this = this;
@@ -564,9 +363,9 @@ image.boy {
 .detail {
   width: 100%;
   height: 102px;
-  /*display: flex;*/
-  /*align-items: center;*/
-  /*justify-content: space-around;*/
+  display: flex;
+  align-items: center;
+  justify-content: space-around;
 }
 
 .detail view {
@@ -608,7 +407,6 @@ image.boy {
   color: #6c6c6c;
   box-sizing: border-box;
 }
-
 .conclution_title {
   font-weight: 600;
   color: #000;
@@ -642,26 +440,6 @@ image.boy {
   box-shadow: 0px 6px 11px #dadada;
 }
 
-/*雷达图*/
-.radar_chart {
-  margin: 0 auto;
-  width: 360px;
-  height: 293px;
-  background: #f3f3f3;
-  opacity: 0.6;
-  border-radius: 10px;
-  box-shadow: 0px 6px 11px #dadada;
-}
-
-.hight_pie_chart {
-  margin: 0 auto;
-  width: 100px;
-  height: 100px;
-  background: #f3f3f3;
-  /*border-radius: 10px;*/
-  /*box-shadow: 0px 6px 11px #dadada;*/
-}
-
 /* 核销详情 */
 .sheet {
   color: #6d6d6d;
@@ -683,9 +461,4 @@ image.boy {
 .sheet .left {
   width: 195px;
 }
-
-.content_card {
-  border-radius: 10px;
-  box-shadow: 0px 6px 11px #dadada;
-}
 </style>

+ 266 - 39
src/pages/report/index.vue.bak → src/pages/report/index.vue.bakk

@@ -24,33 +24,150 @@
       </view>
       <view class="down">
         <view>{{ record.att_average }}</view>
-        <view>专注力均值</view>
+        <view>专注力得分</view>
       </view>
     </view>
+
+    <!--    训练时长和训练设备  -->
+    <view class="po1 padding-lr margin-top-xl">
+      <van-row>
+        <van-col span="11">
+          <view>
+            <text>训练时长</text>
+            <text class="text-bold text-xl"> &nbsp; {{ record.play_time }}</text>
+          </view>
+        </van-col>
+
+        <van-col
+          span="11"
+          offset="2"
+        >
+          <view>
+            <text>训练设备</text>
+            <text class="text-bold text-xl">&nbsp; {{ record.name }}</text>
+          </view>
+        </van-col>
+      </van-row>
+    </view>
+    <view>
+      <van-divider
+        contentPosition="left"
+        borderColor="#E98F36"
+      >
+        <van-image
+          src="https://img.shuimuai.com/line.png"
+          alt=""
+          width="40"
+          height="40"
+        ></van-image>
+      </van-divider>
+    </view>
+
+    <!--    专注力维持区间、受干扰次数,专注力最大爆发值、专注力启动时长-->
+    <view class="margin-tb">
+      <van-row>
+        <van-col span="16">
+          <van-row>
+            <van-col span="12">
+              <view class="detail">
+                <view>
+                  <view>{{ record.scope_diff }}</view>
+                  <view>专注力维持区间</view>
+                </view>
+              </view>
+            </van-col>
+            <van-col span="12">
+              <view class="detail">
+                <view>
+                  <view>{{ record.interfere }}</view>
+                  <view>受干扰次数</view>
+                </view>
+              </view>
+
+            </van-col>
+          </van-row>
+
+          <van-row>
+            <van-col span="12">
+              <view class="detail">
+                <view>
+                  <view>{{ record.burst }}</view>
+                  <view>专注力最大爆发值</view>
+                </view>
+              </view>
+
+            </van-col>
+            <van-col span="12">
+              <view class="detail">
+                <view>
+                  <view>{{ record.start }}</view>
+                  <view>专注力启动时长</view>
+                </view>
+              </view>
+            </van-col>
+          </van-row>
+        </van-col>
+        <van-col span="5">
+          <view class="text-center">
+            <view class="hight_pie_chart">
+              <mpvue-echarts
+                :echarts="echarts"
+                :onInit="hight_att_charts"
+                canvasId="demo-canvas1"
+              />
+            </view>
+            <view class="detail">
+              <view>
+                <view>{{ record.height_absorbed }}%</view>
+                <view>高专注力占比</view>
+              </view>
+            </view>
+          </view>
+        </van-col>
+      </van-row>
+    </view>
+
     <view class="bar">
       <view>
         <view class="line"></view>
-        <view class="title">数据详情</view>
+        <view class="title">专注力要素分析</view>
       </view>
     </view>
-    <view class="detail">
-      <view>
-        <view>{{ record.att_max }}</view>
-        <view>专注力最高分</view>
-        <!-- <view>{{ record.interfere }} </view>
-        <view>被干扰次数</view> -->
+
+    <view class="radar_chart">
+      <mpvue-echarts
+        :echarts="echarts"
+        :onInit="radar_charts"
+        canvasId="demo-canvas2"
+      />
+    </view>
+
+    <view class="">
+      <view class="bar">
+        <view>
+          <view class="line"></view>
+          <view class="title">报告分析</view>
+        </view>
       </view>
-      <view>
-        <view>{{ record.scope_diff }}</view>
-        <view>专注力广度</view>
+      <view class="conclution">{{ record.content }}</view>
+      <!-- <view class="conclution">{{ record.content2 }}</view> -->
+
+      <view class="bar">
+        <view>
+          <view class="line"></view>
+          <view class="title">训练建议</view>
+        </view>
       </view>
+      <view class="conclution">{{ record.advise }}</view>
     </view>
+
     <view class="bar">
       <view>
         <view class="line"></view>
-        <view class="title">基本脑波</view>
+        <view class="title">专注力数值曲线</view>
       </view>
     </view>
+
     <view class="chart">
       <mpvue-echarts
         :echarts="echarts"
@@ -76,27 +193,34 @@
         ></van-tab>
       </van-tabs>
     </view>
-    <view class="conclution"> <text class="conclution_title">分析</text>: {{ record.content }}</view>
-    <view class="conclution"> <text class="conclution_title">建议</text>: {{ record.advise }}</view>
-    <view class="bar">
-      <view>
-        <view class="line"></view>
-        <view class="title">核销详情</view>
+
+    <view class="cu-bar bg-white">
+      <view class="action">
+        <text class="cuIcon-titles text-primary"></text>
+        <text class="">专注力数值累计比例</text>
       </view>
     </view>
-    <view class="sheet">
-      <view class="left">
-        <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>专注力训练时长: {{ record.play_time }}</view>
-      </view>
+    <view class="chart">
+      <mpvue-echarts
+        :echarts="echarts"
+        :onInit="pie_charts"
+        canvasId="demo-canvas-1"
+      />
     </view>
+
+    <!--    <view class="sheet">-->
+    <!--      <view class="left">-->
+    <!--        <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>专注力训练时长: {{ record.play_time }}</view>-->
+    <!--      </view>-->
+    <!--    </view>-->
     <van-toast id="van-toast" />
 
   </div>
@@ -105,12 +229,18 @@
 <script>
 import mpvueEcharts from "mpvue-echarts";
 import echarts from "../../../static/echarts.min";
-import util, { formatSeconds } from "../../utils/index";
+import util, {
+  filterPieData,
+  formatSeconds,
+  getHightPieChartOption,
+  getPieChartsOption,
+  getRadarChartOption,
+} from "../../utils/index";
 import { gameDetail, gameLineChart } from "../../requests/game";
 import game_store from "../../store/game";
 import Toast from "../../../static/vant/toast/toast";
 
-var att_charts, $this;
+var att_charts, hight_att_pie_charts, radar_charts, $pie_charts, $this;
 
 // 大脑图表初始化
 function initAttChart(canvas, width, height) {
@@ -127,6 +257,50 @@ function initAttChart(canvas, width, height) {
   return att_charts; // 返回 chart 后可以自动绑定触摸操作
 }
 
+// 大脑图表初始化
+function initHightPieChart(canvas, width, height) {
+  hight_att_pie_charts = echarts.init(canvas, null, {
+    width: width,
+    height: height,
+  });
+  canvas.setChart(hight_att_pie_charts);
+
+  var option = getHightPieChartOption(0, 0); // ECharts 配置项
+
+  hight_att_pie_charts.setOption(option);
+
+  return hight_att_pie_charts; // 返回 chart 后可以自动绑定触摸操作
+}
+
+// 大脑图表初始化
+function initRadarChart(canvas, width, height) {
+  radar_charts = echarts.init(canvas, null, {
+    width: width,
+    height: height,
+  });
+  canvas.setChart(radar_charts);
+
+  var option = getRadarChartOption(0); // ECharts 配置项
+
+  radar_charts.setOption(option);
+
+  return radar_charts; // 返回 chart 后可以自动绑定触摸操作
+}
+
+function initPieChart(canvas, width, height) {
+  $pie_charts = echarts.init(canvas, null, {
+    width: width,
+    height: height,
+  });
+  canvas.setChart($pie_charts);
+
+  var option = getPieChartsOption(); // ECharts 配置项
+
+  $pie_charts.setOption(option);
+
+  return $pie_charts; // 返回 chart 后可以自动绑定触摸操作
+}
+
 export default {
   name: "index_container",
   components: {
@@ -137,6 +311,10 @@ export default {
       // 0:未选择 1:时间 2:次数
       // 折线图
       attCharts: initAttChart,
+      hight_att_charts: initHightPieChart,
+      radar_charts: initRadarChart,
+      pie_charts: initPieChart,
+
       echarts,
       record: {},
       userinfo: {},
@@ -162,10 +340,35 @@ export default {
       setTimeout(() => {
         gameDetail($record_id).then(
           (res) => {
-            console.log("get_game_detail", res);
             Toast.clear();
             let $res = res.data;
             $this.record = $res.data;
+            console.log("成绩记录参数", $this.record);
+            $this.record.play_time = formatSeconds($this.record.play_time);
+            $this.record.height_absorbed = Math.ceil(
+              $this.record.height / $this.record.total * 100
+            );
+            let $options = getHightPieChartOption(
+              $this.record.height,
+              $this.record.total
+            );
+            hight_att_pie_charts.setOption($options);
+
+            //设置雷达图
+            $options = getRadarChartOption([
+              $this.record.att_average, //平均
+              $this.record.att_scope, //广度
+              $this.record.att_burst, //爆发
+              $this.record.att_interfere, //抗干扰
+              $this.record.att_start, //启动
+              $this.record.att_height, // 高专注占比
+            ]);
+            radar_charts.setOption($options);
+
+            let $pie_data = filterPieData($this.record.level);
+            let $pie_option = getPieChartsOption($pie_data);
+            $pie_charts.setOption($pie_option);
+
             //5分钟阶段
             let $five_min = 5 * 60;
             $this.is_cut = $this.record.play_time > $five_min;
@@ -175,7 +378,6 @@ export default {
                 $this.record.play_time / $five_min
               );
             }
-            $this.record.play_time = formatSeconds($this.record.play_time);
           },
           (err) => {
             Toast.fail("错误代码:" + res.code + ",联系客服");
@@ -216,7 +418,7 @@ export default {
               $option = util.getLineOption($line_data, [0]);
             }
             att_charts.setOption($option);
-          }, 1000);
+          }, 800);
         },
         (err) => {
           Toast.fail("错误代码:" + res.code + ",联系客服");
@@ -241,7 +443,6 @@ export default {
     wx.removeStorageSync("played_time");
     $this.get_report($this.record_id);
     $this.get_game_line($this.record_id);
-    console.log("进来时候获取到的信息", $this.record);
   },
   created() {
     $this = this;
@@ -363,9 +564,9 @@ image.boy {
 .detail {
   width: 100%;
   height: 102px;
-  display: flex;
-  align-items: center;
-  justify-content: space-around;
+  /*display: flex;*/
+  /*align-items: center;*/
+  /*justify-content: space-around;*/
 }
 
 .detail view {
@@ -407,6 +608,7 @@ image.boy {
   color: #6c6c6c;
   box-sizing: border-box;
 }
+
 .conclution_title {
   font-weight: 600;
   color: #000;
@@ -440,6 +642,26 @@ image.boy {
   box-shadow: 0px 6px 11px #dadada;
 }
 
+/*雷达图*/
+.radar_chart {
+  margin: 0 auto;
+  width: 360px;
+  height: 293px;
+  background: #f3f3f3;
+  opacity: 0.6;
+  border-radius: 10px;
+  box-shadow: 0px 6px 11px #dadada;
+}
+
+.hight_pie_chart {
+  margin: 0 auto;
+  width: 100px;
+  height: 100px;
+  background: #f3f3f3;
+  /*border-radius: 10px;*/
+  /*box-shadow: 0px 6px 11px #dadada;*/
+}
+
 /* 核销详情 */
 .sheet {
   color: #6d6d6d;
@@ -461,4 +683,9 @@ image.boy {
 .sheet .left {
   width: 195px;
 }
+
+.content_card {
+  border-radius: 10px;
+  box-shadow: 0px 6px 11px #dadada;
+}
 </style>

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

@@ -8,7 +8,7 @@
           offset="2"
         >
           <view class="text-sm">
-            <text class="title">游玩时间</text>
+            <text class="title">本次游玩时间</text>
           </view>
           <view class="text-lg   padding-top">
             <text class="count_down_text">{{ played_time_text }}</text>
@@ -81,7 +81,7 @@
             <text class="text-default">设备电量</text>
           </div>
         </van-col>
-        <van-col span="2">
+        <!-- <van-col span="2">
           <div class="flex flex-direction align-center justify-center">
             <view>
               <text>-{{ rssi }}dbm</text>
@@ -90,7 +90,7 @@
               <text class="text-default">信号强度</text>
             </view>
           </div>
-        </van-col>
+        </van-col> -->
       </van-row>
     </div>
 

+ 4 - 2
src/requests/orders.js

@@ -32,7 +32,9 @@ export function deleteOrder($sn) {
 }
 
 //支付订单
-export function testPay($params) {
-  $params['access_token'] = wx.getStorageSync('token')
+export function testPay($fee) {
+  let $params = {};
+  $params['total_fee'] = $fee;
+  $params['access_token'] = wx.getStorageSync('token')?wx.getStorageSync('token'):11
   return fly.post('order/test-pay', $params)
 }