Browse Source

修改了监测蓝牙,

yerong 4 years ago
parent
commit
d5816a8e38
100 changed files with 287 additions and 1791 deletions
  1. 14 1
      build/webpack.dev.conf.js
  2. 0 75
      dist/project.config.json
  3. 1 1
      dist/wx
  4. 0 1
      src/app.json
  5. 1 0
      src/components/banner.vue
  6. 0 19
      src/components/card.vue
  7. 1 1
      src/components/device/connected.vue
  8. 1 1
      src/components/device/device.vue
  9. 1 1
      src/components/device/toy/connecting.vue
  10. 0 85
      src/components/mycharts/mycharts.vue
  11. 0 2
      src/pages/bak/index_bak.vue
  12. 10 2
      src/pages/competition/index.vue
  13. 27 2
      src/pages/index/index.vue
  14. 0 64
      src/pages/only_pay/index.vue
  15. 0 12
      src/pages/only_pay/main.js
  16. 0 7
      src/pages/only_pay/main.json
  17. 0 1
      src/pages/report/index.vue
  18. 85 12
      src/pages/start/index.vue
  19. 15 1
      src/store/game.js
  20. 2 2
      src/utils/bluetooth.js
  21. 0 2
      src/utils/ext.js
  22. 90 0
      src/utils/game.js
  23. 39 37
      src/utils/index.js
  24. 0 54
      static/colorui/components/cu-custom.js
  25. 0 4
      static/colorui/components/cu-custom.json
  26. 0 69
      static/colorui/components/cu-custom.vue
  27. 0 16
      static/colorui/components/cu-custom.wxml
  28. 0 1
      static/colorui/components/cu-custom.wxss
  29. 0 0
      static/echarts.min.js
  30. 0 1
      static/vant/checkbox-group/index.d.ts
  31. 0 35
      static/vant/checkbox-group/index.js
  32. 0 3
      static/vant/checkbox-group/index.json
  33. 0 1
      static/vant/checkbox-group/index.wxml
  34. 0 1
      static/vant/checkbox-group/index.wxss
  35. 0 1
      static/vant/checkbox/index.d.ts
  36. 0 74
      static/vant/checkbox/index.js
  37. 0 6
      static/vant/checkbox/index.json
  38. 0 20
      static/vant/checkbox/index.wxml
  39. 0 20
      static/vant/checkbox/index.wxs
  40. 0 1
      static/vant/checkbox/index.wxss
  41. 0 1
      static/vant/collapse-item/index.d.ts
  42. 0 99
      static/vant/collapse-item/index.js
  43. 0 6
      static/vant/collapse-item/index.json
  44. 0 44
      static/vant/collapse-item/index.wxml
  45. 0 1
      static/vant/collapse-item/index.wxss
  46. 0 1
      static/vant/collapse/index.d.ts
  47. 0 47
      static/vant/collapse/index.js
  48. 0 3
      static/vant/collapse/index.json
  49. 0 3
      static/vant/collapse/index.wxml
  50. 0 1
      static/vant/collapse/index.wxss
  51. 0 1
      static/vant/dropdown-item/index.d.ts
  52. 0 109
      static/vant/dropdown-item/index.js
  53. 0 8
      static/vant/dropdown-item/index.json
  54. 0 48
      static/vant/dropdown-item/index.wxml
  55. 0 1
      static/vant/dropdown-item/index.wxss
  56. 0 1
      static/vant/dropdown-menu/index.d.ts
  57. 0 119
      static/vant/dropdown-menu/index.js
  58. 0 3
      static/vant/dropdown-menu/index.json
  59. 0 23
      static/vant/dropdown-menu/index.wxml
  60. 0 16
      static/vant/dropdown-menu/index.wxs
  61. 0 1
      static/vant/dropdown-menu/index.wxss
  62. 0 1
      static/vant/grid-item/index.d.ts
  63. 0 83
      static/vant/grid-item/index.js
  64. 0 6
      static/vant/grid-item/index.json
  65. 0 22
      static/vant/grid-item/index.wxml
  66. 0 1
      static/vant/grid-item/index.wxss
  67. 0 1
      static/vant/grid/index.d.ts
  68. 0 65
      static/vant/grid/index.js
  69. 0 3
      static/vant/grid/index.json
  70. 0 3
      static/vant/grid/index.wxml
  71. 0 1
      static/vant/grid/index.wxss
  72. 0 1
      static/vant/panel/index.d.ts
  73. 0 10
      static/vant/panel/index.js
  74. 0 6
      static/vant/panel/index.json
  75. 0 19
      static/vant/panel/index.wxml
  76. 0 1
      static/vant/panel/index.wxss
  77. 0 1
      static/vant/progress/index.d.ts
  78. 0 27
      static/vant/progress/index.js
  79. 0 3
      static/vant/progress/index.json
  80. 0 20
      static/vant/progress/index.wxml
  81. 0 5
      static/vant/progress/index.wxs
  82. 0 1
      static/vant/progress/index.wxss
  83. 0 1
      static/vant/radio-group/index.d.ts
  84. 0 34
      static/vant/radio-group/index.js
  85. 0 3
      static/vant/radio-group/index.json
  86. 0 1
      static/vant/radio-group/index.wxml
  87. 0 1
      static/vant/radio-group/index.wxss
  88. 0 1
      static/vant/radio/index.d.ts
  89. 0 48
      static/vant/radio/index.js
  90. 0 6
      static/vant/radio/index.json
  91. 0 29
      static/vant/radio/index.wxml
  92. 0 1
      static/vant/radio/index.wxss
  93. 0 1
      static/vant/rate/index.d.ts
  94. 0 87
      static/vant/rate/index.js
  95. 0 6
      static/vant/rate/index.json
  96. 0 34
      static/vant/rate/index.wxml
  97. 0 1
      static/vant/rate/index.wxss
  98. 0 1
      static/vant/search/index.d.ts
  99. 0 78
      static/vant/search/index.js
  100. 0 6
      static/vant/search/index.json

+ 14 - 1
build/webpack.dev.conf.js

@@ -64,9 +64,22 @@ module.exports = merge(baseWebpackConfig, {
         ) || count > 1
         ) || count > 1
       }
       }
     }),
     }),
+     new webpack.optimize.CommonsChunkPlugin({
+      name: 'common/webext',
+      chunks:['common/vendor'],
+      minChunks: function (module, count) {
+        // any required modules inside node_modules are extracted to vendor
+        return (
+          module.resource &&
+          /\.js$/.test(module.resource) &&
+          module.resource.indexOf('echarts') >= 0 &&
+          module.resource.indexOf('node_modules') === -1
+        )
+      }
+    }),
     new webpack.optimize.CommonsChunkPlugin({
     new webpack.optimize.CommonsChunkPlugin({
       name: 'common/manifest',
       name: 'common/manifest',
-      chunks: ['common/vendor']
+      chunks: ['common/webext']
     }),
     }),
     new MpvueVendorPlugin({
     new MpvueVendorPlugin({
       platform: process.env.PLATFORM
       platform: process.env.PLATFORM

+ 0 - 75
dist/project.config.json

@@ -1,75 +0,0 @@
-{
-  "description": "项目配置文件",
-  "packOptions": {
-    "ignore": []
-  },
-  "setting": {
-    "urlCheck": true,
-    "es6": true,
-    "enhance": false,
-    "postcss": true,
-    "preloadBackgroundData": false,
-    "minified": true,
-    "newFeature": false,
-    "coverView": true,
-    "nodeModules": false,
-    "autoAudits": false,
-    "showShadowRootInWxmlPanel": true,
-    "scopeDataCheck": false,
-    "uglifyFileName": false,
-    "checkInvalidKey": true,
-    "checkSiteMap": true,
-    "uploadWithSourceMap": true,
-    "compileHotReLoad": false,
-    "useMultiFrameRuntime": true,
-    "useApiHook": true,
-    "useApiHostProcess": true,
-    "babelSetting": {
-      "ignore": [],
-      "disablePlugins": [],
-      "outputPath": ""
-    },
-    "enableEngineNative": false,
-    "bundle": false,
-    "useIsolateContext": true,
-    "useCompilerModule": true,
-    "userConfirmedUseCompilerModuleSwitch": false,
-    "userConfirmedBundleSwitch": false,
-    "packNpmManually": false,
-    "packNpmRelationList": [],
-    "minifyWXSS": true
-  },
-  "compileType": "miniprogram",
-  "libVersion": "2.15.0",
-  "appid": "wx6ae2b756f0f6b9ec",
-  "projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%AE%A2%E6%88%B7%E7%AB%AF",
-  "debugOptions": {
-    "hidedInDevtools": []
-  },
-  "scripts": {},
-  "staticServerOptions": {
-    "baseURL": "",
-    "servePath": ""
-  },
-  "isGameTourist": false,
-  "condition": {
-    "search": {
-      "list": []
-    },
-    "conversation": {
-      "list": []
-    },
-    "game": {
-      "list": []
-    },
-    "plugin": {
-      "list": []
-    },
-    "gamePlugin": {
-      "list": []
-    },
-    "miniprogram": {
-      "list": []
-    }
-  }
-}

+ 1 - 1
dist/wx

@@ -1 +1 @@
-Subproject commit a3a7976b3f4a78678c81e7370e5cc33f68a8b529
+Subproject commit 2ec55f93a5637ee4081e4213dbfe34506761f7a1

+ 0 - 1
src/app.json

@@ -25,7 +25,6 @@
     "pages/agent/settlement_center/index/main",
     "pages/agent/settlement_center/index/main",
     "pages/agent/settlement_center/withdraw/detail/main",
     "pages/agent/settlement_center/withdraw/detail/main",
     "pages/agent/settlement_center/withdraw/list/main",
     "pages/agent/settlement_center/withdraw/list/main",
-    "pages/only_pay/main",
     "pages/test/main",
     "pages/test/main",
     "pages/competition/main"
     "pages/competition/main"
   ],
   ],

+ 1 - 0
src/components/banner.vue

@@ -50,6 +50,7 @@ export default {
         let $activities = $res.data
         let $activities = $res.data
         let $new_act = $activities.pop()
         let $new_act = $activities.pop()
         console.log($new_act)
         console.log($new_act)
+        $this.banners[1].src = $new_act['img']
         $this.banners[1].url = '/pages/competition/main?activity_id=' + $new_act['activity_id']
         $this.banners[1].url = '/pages/competition/main?activity_id=' + $new_act['activity_id']
       })
       })
     }
     }

+ 0 - 19
src/components/card.vue

@@ -1,19 +0,0 @@
-<template>
-  <div>
-    <p class="card">
-      {{text}}
-    </p>
-  </div>
-</template>
-
-<script>
-export default {
-  props: ['text']
-}
-</script>
-
-<style>
-.card {
-  padding: 10px;
-}
-</style>

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

@@ -22,7 +22,7 @@
           <img src="https://img.shuimuai.com/web/sign_red.png" class="sign_green" alt="" v-else>
           <img src="https://img.shuimuai.com/web/sign_red.png" class="sign_green" alt="" v-else>
           <img src="https://img.shuimuai.com/web/brain.png" alt="" class="device_brain">
           <img src="https://img.shuimuai.com/web/brain.png" alt="" class="device_brain">
           <view>
           <view>
-            <text class="text-gray device_text second_device_text"> 水母智脑环</text>
+            <text class="text-gray device_text second_device_text">水母智脑环({{device_power}}%)</text>
           </view>
           </view>
         </div>
         </div>
       </van-col>
       </van-col>

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

@@ -193,7 +193,7 @@ export default {
       toy_id: 0,
       toy_id: 0,
 
 
       // 电量
       // 电量
-      device_power: 100,
+      device_power: 0,
 
 
       //  开始游戏模块
       //  开始游戏模块
       start_show: false,
       start_show: false,

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

@@ -19,7 +19,7 @@
           <img src="https://img.shuimuai.com/web/sign_green.png" alt="" class="sign_green" v-if="device_bg == true">
           <img src="https://img.shuimuai.com/web/sign_green.png" alt="" class="sign_green" v-if="device_bg == true">
           <img src="https://img.shuimuai.com/web/sign_red.png" class="sign_green" alt="" v-else>
           <img src="https://img.shuimuai.com/web/sign_red.png" class="sign_green" alt="" v-else>
           <img src="https://img.shuimuai.com/web/brain.png" alt="" class="device_brain">
           <img src="https://img.shuimuai.com/web/brain.png" alt="" class="device_brain">
-          <text class="text-gray device_text second_device_text"> 已连接</text>
+          <text class="text-gray device_text second_device_text"> 已连接({{device_power}}%)</text>
         </div>
         </div>
       </van-col>
       </van-col>
       <van-col span="3" offset="1">
       <van-col span="3" offset="1">

+ 0 - 85
src/components/mycharts/mycharts.vue

@@ -1,85 +0,0 @@
-<template>
-  <view class="chart">
-    <mpvue-echarts :echarts="echarts" :onInit="attCharts" :canvasId="canvasId" v-if="category" />
-    <mpvue-echarts :echarts="echarts" :onInit="medCharts" :canvasId="canvasId" v-else />
-  </view>
-</template>
-
-<script>
-import mpvueEcharts from 'mpvue-echarts'
-import echarts from '../../../static/echarts.min';
-
-var att_charts,
-  med_charts,
-  $this
-
-// 大脑图表初始化
-function initAttChart(canvas, width, height) {
-  att_charts = echarts.init(canvas, null, {
-    width: width,
-    height: height
-  });
-  canvas.setChart(att_charts);
-
-  let option = {}; // ECharts 配置项
-
-  att_charts.setOption(option);
-  return att_charts; // 返回 chart 后可以自动绑定触摸操作
-}
-
-// 我的设备图表初始化
-function initMedChart(canvas, width, height) {
-  med_charts = echarts.init(canvas, null, {
-    width: width,
-    height: height
-  });
-  canvas.setChart(med_charts);
-
-  let option = {}; // ECharts 配置项
-
-  med_charts.setOption(option);
-  return med_charts; // 返回 chart 后可以自动绑定触摸操作
-}
-
-export default {
-  name: "mycharts",
-  props:['canvasId','category'],
-  components: {
-    mpvueEcharts
-  },
-  data() {
-    return {
-      // 折线图
-      echarts,
-      attCharts: initAttChart,
-      medCharts: initMedChart,
-    }
-  },
-  methods:{
-    setAttOption($options){
-      att_charts.setOption($options)
-    },
-    setMedOption($options){
-      med_charts.setOption($options)
-    }
-  },
-  created() {
-    $this = this
-  },
-  onLoad(){
-    $this.setAttOption({})
-    $this.setMedOption({})
-  }
-}
-</script>
-
-<style scoped>
-.chart {
-  width: 360px;
-  height: 193px;
-  background: #302D43;
-  opacity: 0.6;
-  border-radius: 10px;
-}
-
-</style>

+ 0 - 2
src/pages/bak/index_bak.vue

@@ -1,2 +0,0 @@
-<!--    公用按钮-->
-<button class="cu-btn lg cu-btn-primary text-white text-center" @click="open_scan">扫码连接脑环</button>

+ 10 - 2
src/pages/competition/index.vue

@@ -385,6 +385,7 @@ import {
 } from "../../requests/competition";
 } from "../../requests/competition";
 import Toast from '../../../static/vant/toast/toast';
 import Toast from '../../../static/vant/toast/toast';
 import {reload_userinfo} from "../../utils/user";
 import {reload_userinfo} from "../../utils/user";
+import {userDetail} from "../../requests/user";
 
 
 var $this;
 var $this;
 var $now = Math.round(new Date() / 1000);
 var $now = Math.round(new Date() / 1000);
@@ -493,7 +494,7 @@ export default {
     },
     },
     //时间产生变化时
     //时间产生变化时
     onTimeChange($e) {
     onTimeChange($e) {
-      let $datetime =  $this.timeData = $e.mp.detail
+      let $datetime = $this.timeData = $e.mp.detail
       for (let $key in $datetime) {
       for (let $key in $datetime) {
         if ($datetime[$key].toString().length == 1) {
         if ($datetime[$key].toString().length == 1) {
           $datetime[$key] = "0" + $datetime[$key]
           $datetime[$key] = "0" + $datetime[$key]
@@ -599,7 +600,14 @@ export default {
     }
     }
   },
   },
   mounted() {
   mounted() {
-    reload_userinfo($this)
+    userDetail().then((res) => {
+      let $data = res.data;
+      $this.userinfo = $data.data;
+      $this.userinfo['validity_time'] = formatTime($this.userinfo['validity_time'])
+      $this.userinfo['level_name'] = utils.get_level_name($this.userinfo['level'])
+      $this.userinfo['free_time'] = formatSeconds($this.userinfo['free_time'])
+      store.setters.set_userinfo($this.userinfo)
+    })
     let $userinfo = wx.getStorageSync('userinfo')
     let $userinfo = wx.getStorageSync('userinfo')
     //检查用户是否参与比赛了
     //检查用户是否参与比赛了
     checkJoined($this.activity_id, $userinfo.user_id).then((res) => {
     checkJoined($this.activity_id, $userinfo.user_id).then((res) => {

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

@@ -50,7 +50,7 @@
       </div>
       </div>
     </div>
     </div>
     <van-toast id="van-toast"/>
     <van-toast id="van-toast"/>
-
+    <van-dialog id="van-dialog"/>
     <!--     <button class="cu-btn lg cu-btn-primary text-white text-center margin-tb" @click="auth_msg">获取消息授权-->
     <!--     <button class="cu-btn lg cu-btn-primary text-white text-center margin-tb" @click="auth_msg">获取消息授权-->
     <!--    </button>-->
     <!--    </button>-->
   </div>
   </div>
@@ -63,9 +63,11 @@ import regist_container from '@/components/index/regist'
 import personal_container from "@/components/index/personal";
 import personal_container from "@/components/index/personal";
 import device_container from "@/components/device/device";
 import device_container from "@/components/device/device";
 import Toast from '../../../static/vant/toast/toast';
 import Toast from '../../../static/vant/toast/toast';
+import Dialog from '../../../static/vant/dialog/dialog'
 import {userDetail} from "../../requests/user";
 import {userDetail} from "../../requests/user";
 import user_store from "../../store/index"
 import user_store from "../../store/index"
-import {reload_userinfo} from "../../utils/user";
+import game_store from "../../store/game"
+import game_util, {post_data} from '../../utils/game'
 
 
 
 
 var $this
 var $this
@@ -156,6 +158,29 @@ export default {
     if (process.env.NODE_ENV == 'development') {
     if (process.env.NODE_ENV == 'development') {
       wx.setStorageSync('token', '7MZYqpAWOdw8WDxsgUV5QkQnKfrU5L_7')
       wx.setStorageSync('token', '7MZYqpAWOdw8WDxsgUV5QkQnKfrU5L_7')
     }
     }
+
+    console.log(game_store.getters.getGameAttMedDatas())
+    console.log(game_store.getters.getPlayedTime())
+    console.log(
+      "游戏状态:" + game_store.getters.getGameStatus(),
+
+      "游戏记录id:" + game_store.getters.getGameRecordId()
+    )
+    if (game_store.getters.getGameStatus() == 1) {
+      Dialog.confirm({
+        title: '系统提示',
+        message: '您上一个游戏尚未结束,是否继续?',
+      })
+        .then(() => {
+          Toast.success('是')
+        })
+        .catch(() => {
+          //添加数据,结束游戏
+          Toast.fail('否')
+          post_data(game_store.getters.getGameAttMedDatas())
+        });
+    }
+
     //  判断存储是否登录
     //  判断存储是否登录
     let $token = wx.getStorageSync('token')
     let $token = wx.getStorageSync('token')
     if ($token) {
     if ($token) {

+ 0 - 64
src/pages/only_pay/index.vue

@@ -1,64 +0,0 @@
-<template>
-  <div id="index_login_container" class="animation-slide-right">
-    <form action="">
-      <view class="cu-form-group">
-        <view class="title">金额</view>
-        <input placeholder="输入金额" name="input" v-model="price"></input>
-      </view>
-      <van-button @click="wx_pay" block class="padding">支付</van-button>
-    </form>    <van-toast id="van-toast"/>
-
-  </div>
-</template>
-<script>
-import {testPay} from "../../requests/orders";
-import Toast from '../../../static/vant/toast/toast';
-
-var $this
-export default {
-  name: 'scan_container',
-  data() {
-    return {
-      price: ""
-    }
-  },
-  methods: {
-    wx_pay() {
-      let $params = {
-        total_fee: $this.price
-      }
-      testPay($params).then((res) => {
-        let $res = res.data
-        let $payment = $res.data
-        $this.payment_info = $payment
-        wx.requestPayment({
-          timeStamp: $payment.timeStamp,
-          nonceStr: $payment.nonceStr,
-          package: $payment.package,
-          signType: $payment.signType,
-          paySign: $payment.sign,
-          success(res) {
-            //支付成功
-            console.log('success', res)
-            Toast.success("支付成功")
-          },
-          fail(res) {
-            console.log('fail', res)
-            Toast.fail('支付失败')
-          }
-        })
-      })
-    }
-  },
-  created() {
-    $this = this
-  }
-}
-</script>
-<style scoped>
-#index_login_container {
-  height: 812px;
-  background-color: #31295B;
-}
-
-</style>

+ 0 - 12
src/pages/only_pay/main.js

@@ -1,12 +0,0 @@
-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()

+ 0 - 7
src/pages/only_pay/main.json

@@ -1,7 +0,0 @@
-{
-  "usingComponents": {
-    "van-field": "../../../static/vant/field/index",
-    "van-button": "../../../static/vant/button/index",
-    "van-toast": "../../../static/vant/toast/index"
-  }
-}

+ 0 - 1
src/pages/report/index.vue

@@ -313,7 +313,6 @@ export default {
       })
       })
       setTimeout(() => {
       setTimeout(() => {
         gameDetail($record_id).then((res) => {
         gameDetail($record_id).then((res) => {
-            console.log('get_game_detail', res)
             Toast.clear()
             Toast.clear()
             let $res = res.data;
             let $res = res.data;
             $this.record = $res.data
             $this.record = $res.data

+ 85 - 12
src/pages/start/index.vue

@@ -81,7 +81,9 @@
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
-        <mycharts ref="att" :canvasId="'demo'" :category="true" v-if="game_status == 1"></mycharts>
+        <view class="chart">
+          <mpvue-echarts :echarts="echarts" :onInit="attCharts" canvasId="canvasId-demo1"/>
+        </view>
       </view>
       </view>
 
 
       <view class="chart_view_second margin-tb-xl">
       <view class="chart_view_second margin-tb-xl">
@@ -110,8 +112,9 @@
             </view>
             </view>
           </view>
           </view>
         </view>
         </view>
-
-        <mycharts ref="med" :canvasId="'demo1'" :category="false" v-if="game_status == 1"></mycharts>
+        <view class="chart">
+          <mpvue-echarts :echarts="echarts" :onInit="medCharts" canvasId="canvasId-demo2"/>
+        </view>
       </view>
       </view>
 
 
     </div>
     </div>
@@ -128,18 +131,52 @@ import game_store from "@/store/game";
 import Toast from '../../../static/vant/toast/toast';
 import Toast from '../../../static/vant/toast/toast';
 import Dialog from '../../../static/vant/dialog/dialog';
 import Dialog from '../../../static/vant/dialog/dialog';
 import {gameAddLine, gameEnd} from "../../requests/game";
 import {gameAddLine, gameEnd} from "../../requests/game";
-import mycharts from "../../components/mycharts/mycharts";
+import mpvueEcharts from 'mpvue-echarts'
+import echarts from '../../../static/echarts.min';
 
 
+var att_charts,
+  med_charts,
+  $this
 
 
-var $this
+// 大脑图表初始化
+function initAttChart(canvas, width, height) {
+  att_charts = echarts.init(canvas, null, {
+    width: width,
+    height: height
+  });
+  canvas.setChart(att_charts);
+
+  let option = {}; // ECharts 配置项
+
+  att_charts.setOption(option);
+  return att_charts; // 返回 chart 后可以自动绑定触摸操作
+}
+
+// 我的设备图表初始化
+function initMedChart(canvas, width, height) {
+  med_charts = echarts.init(canvas, null, {
+    width: width,
+    height: height
+  });
+  canvas.setChart(med_charts);
+
+  let option = {}; // ECharts 配置项
+
+  med_charts.setOption(option);
+  return med_charts; // 返回 chart 后可以自动绑定触摸操作
+}
 
 
 export default {
 export default {
   name: "index_container",
   name: "index_container",
   components: {
   components: {
-    mycharts
+    mpvueEcharts
   },
   },
   data() {
   data() {
     return {
     return {
+       // 折线图
+      echarts,
+      attCharts: initAttChart,
+      medCharts: initMedChart,
       // 使用类型 1次数 2时间 0未选择
       // 使用类型 1次数 2时间 0未选择
       mode: 0,
       mode: 0,
 
 
@@ -187,7 +224,7 @@ export default {
   methods: {
   methods: {
     //游戏结束方法
     //游戏结束方法
     game_finished() {
     game_finished() {
-      bluetooth.shutdownSendControl($this._deviceId, $this._serviceId, $this._characteristicId)
+      bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
       $this.$emit('closePop', true)
       $this.$emit('closePop', true)
       //取消监听低功耗蓝牙设备
       //取消监听低功耗蓝牙设备
       wx.offBLECharacteristicValueChange()
       wx.offBLECharacteristicValueChange()
@@ -195,6 +232,8 @@ export default {
       game_store.setters.setGameStatus(3)
       game_store.setters.setGameStatus(3)
       //游戏结束重置游戏时间
       //游戏结束重置游戏时间
       wx.removeStorageSync('play_time')
       wx.removeStorageSync('play_time')
+      //删除游戏专注数据
+      game_store.remover.rmGameAttMedDatas()
       //游戏结束重置游戏模式
       //游戏结束重置游戏模式
       game_store.setters.setMode(0)
       game_store.setters.setMode(0)
       //删除游戏得id
       //删除游戏得id
@@ -208,6 +247,9 @@ export default {
         mask: true,
         mask: true,
         message: "正在生成报告...",
         message: "正在生成报告...",
         duration: 0,
         duration: 0,
+        onClose() {
+          bluetooth.shutdownSendControl($this._deviceId, $this._serviceId, $this._characteristicId)
+        }
       })
       })
     },
     },
     to_report() {
     to_report() {
@@ -224,6 +266,26 @@ export default {
       wx.setKeepScreenOn({
       wx.setKeepScreenOn({
         keepScreenOn: true
         keepScreenOn: true
       })
       })
+      //打开内存警告
+      // wx.onMemoryWarning(() => {
+      //   console.log('内存告急警告')
+      //   game_store.setGameAttMedDatas({
+      //     att: $this.attList,
+      //     med: $this.medList
+      //   })
+      // })
+
+      // //初始化数据
+      // $this.played_time = null
+      // //设置未结束游戏
+      // $this.is_end = false
+      // $this.att_list = []
+      // $this.med_list = []
+      // $this.delta_list = []
+      // $this.alpha_list = []
+      // $this.theta_list = []
+      // $this.beta_list = []
+
       bluetooth.watchingDevice($this)
       bluetooth.watchingDevice($this)
       bluetooth.sendControl($this._deviceId, $this._serviceId, $this._characteristicId)
       bluetooth.sendControl($this._deviceId, $this._serviceId, $this._characteristicId)
     },
     },
@@ -303,7 +365,6 @@ export default {
         type: $this.mode,
         type: $this.mode,
         play_time: $this.play_time - Math.abs($this.played_time)
         play_time: $this.play_time - Math.abs($this.played_time)
       }
       }
-      console.log("结束游戏参数", $params)
       //
       //
       gameEnd($params).then((res) => {
       gameEnd($params).then((res) => {
         let $data = res.data
         let $data = res.data
@@ -319,7 +380,7 @@ export default {
       })
       })
     },
     },
     //  处理游戏中数据的方法
     //  处理游戏中数据的方法
-    do_datas($data) {
+    do_datas: function ($data) {
       $this.att_list.push($data['att'])
       $this.att_list.push($data['att'])
       $this.med_list.push($data['med'])
       $this.med_list.push($data['med'])
       $this.delta_list.push(Math.round($data['delta'] / 10000))
       $this.delta_list.push(Math.round($data['delta'] / 10000))
@@ -339,16 +400,21 @@ export default {
       $this.attList.push($data['att'])
       $this.attList.push($data['att'])
       $this.medList.push($data['med'])
       $this.medList.push($data['med'])
 
 
+      game_store.setters.setGameAttMedDatas({
+        attList: $this.attList,
+        medList: $this.medList
+      })
+
       //判断是否隐藏 隐藏则不绘画
       //判断是否隐藏 隐藏则不绘画
       let $hide_status = game_store.getters.getHideStatus()
       let $hide_status = game_store.getters.getHideStatus()
       if (!$hide_status) {
       if (!$hide_status) {
         //通过专注放松度 画图
         //通过专注放松度 画图
         let $option = util.getLineOption($this.att_list, $this.med_list)
         let $option = util.getLineOption($this.att_list, $this.med_list)
-        $this.$refs['att'].setAttOption($option)
+        att_charts.setOption($option)
 
 
         //通过基本脑波发送数据
         //通过基本脑波发送数据
         let $base_option = util.getBaseOption($this.delta_list, $this.theta_list, $this.alpha_list, $this.beta_list)
         let $base_option = util.getBaseOption($this.delta_list, $this.theta_list, $this.alpha_list, $this.beta_list)
-        $this.$refs['med'].setMedOption($base_option)
+        med_charts.setOption($base_option)
       }
       }
     },
     },
     //计算游玩时间
     //计算游玩时间
@@ -442,7 +508,6 @@ export default {
     console.log('小程序被销毁')
     console.log('小程序被销毁')
     if (!$this.is_end) {
     if (!$this.is_end) {
       //停止传输数据
       //停止传输数据
-      bluetooth.sendPause($this._deviceId, $this._serviceId, $this._characteristicId)
       bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
       bluetooth.sendEnd($this._deviceId, $this._serviceId, $this._characteristicId)
       wx.offBLECharacteristicValueChange()
       wx.offBLECharacteristicValueChange()
       //存储时间
       //存储时间
@@ -638,4 +703,12 @@ export default {
   color: #fff;
   color: #fff;
   line-height: 28px;
   line-height: 28px;
 }
 }
+
+.chart {
+  width: 360px;
+  height: 193px;
+  background: #302D43;
+  opacity: 0.6;
+  border-radius: 10px;
+}
 </style>
 </style>

+ 15 - 1
src/store/game.js

@@ -45,6 +45,10 @@ const setters = {
   //  记录推到后台得时间
   //  记录推到后台得时间
   setHideTime($param) {
   setHideTime($param) {
     wx.setStorageSync('hide_time', $param)
     wx.setStorageSync('hide_time', $param)
+  },
+  //记录游戏数据
+  setGameAttMedDatas($param) {
+    wx.setStorageSync('game_data', $param)
   }
   }
 }
 }
 
 
@@ -87,9 +91,19 @@ const getters = {
 //  获取一开始隐藏的时间
 //  获取一开始隐藏的时间
   getHideTime() {
   getHideTime() {
     return wx.getStorageSync('hide_time')
     return wx.getStorageSync('hide_time')
+  },
+  //记录游戏数据
+  getGameAttMedDatas() {
+    return wx.getStorageSync('game_data')
+  }
+}
+
+const remover = {
+  rmGameAttMedDatas() {
+    wx.removeStorageSync('game_data')
   }
   }
 }
 }
 
 
 export default {
 export default {
-  setters, getters
+  setters, getters, remover
 }
 }

+ 2 - 2
src/utils/bluetooth.js

@@ -204,7 +204,7 @@ export default {
     dataView.setUint8(3, "0x00");
     dataView.setUint8(3, "0x00");
     dataView.setUint8(4, "0x00");
     dataView.setUint8(4, "0x00");
     dataView.setUint8(5, "0x00");
     dataView.setUint8(5, "0x00");
-    dataView.setUint8(6, "0x00");
+    dataView.setUint8(6, "0x08");
     dataView.setUint8(7, $CheckSum);
     dataView.setUint8(7, $CheckSum);
     // 向低功耗蓝牙设备特征值中写入二进制数据
     // 向低功耗蓝牙设备特征值中写入二进制数据
 
 
@@ -621,7 +621,6 @@ export default {
       value: buffer,
       value: buffer,
       success: function (res) {
       success: function (res) {
         console.log("断开连接玩具指令成功");
         console.log("断开连接玩具指令成功");
-        that.sendEnd(deviceId, serviceId, Cid);
       },
       },
       fail: function (err) {
       fail: function (err) {
         console.log("发送连接玩具指令失败");
         console.log("发送连接玩具指令失败");
@@ -672,6 +671,7 @@ export default {
           if ($this.played_time > 0) {
           if ($this.played_time > 0) {
             //自定义定时器
             //自定义定时器
             $this.played_time -= 1;
             $this.played_time -= 1;
+            game_store.setters.setPlayedTime($this.played_time)
             $this.played_time_text = that.formatPlaySeconds($this.played_time);
             $this.played_time_text = that.formatPlaySeconds($this.played_time);
             $this.do_datas($data);
             $this.do_datas($data);
           }
           }

+ 0 - 2
src/utils/ext.js

@@ -1,2 +0,0 @@
-import Vue from 'vue'
-export default new Vue

+ 90 - 0
src/utils/game.js

@@ -0,0 +1,90 @@
+import game_store from '../store/game'
+import {gameAddLine, gameEnd} from "../requests/game";
+
+// 往后端推送一次定时数据
+export function post_data($big_data) {
+  var $this = this
+  //判断数据长度大于理想状态 需要对数组进行切割 逐个提交数据
+  let $len = 300
+  console.log($big_data.attList.length, '结束游戏提交的数据量')
+  if ($big_data.attList.length > $len) {
+    let $count = Math.ceil($big_data.attList.length / $len)
+
+    let index = 0
+    let inter = setInterval(() => {
+      if (index < $count) {
+        let $params = {
+          game_record_id: game_store.getters.getGameRecordId(),
+          //数据段长度大于65 多个提交
+          line: $big_data.attList.slice(index * $len, (index + 1) * $len),
+          line_med: $big_data.medList.slice(index * $len, (index + 1) * $len)
+        }
+        gameAddLine($params).then((res) => {
+          let $data = res.data
+          if ($data.code == 0) {
+            console.log('ok', $params['line'])
+          }
+        })
+      }
+      index++
+      if (index == $count) {
+        clearInterval(inter)
+        game_over()
+      }
+    }, 200)
+    return $count * 500
+  } else {
+    let $params = {
+      game_record_id: game_store.getters.getGameRecordId(),
+      //数据段长度小于65 单个提交
+      line: $big_data.attList,
+      line_med: $big_data.medList
+    }
+
+    if (!$params.line) {
+      return false
+    }
+    gameAddLine($params).then((res) => {
+      let $data = res.data
+      if ($data.code == 0) {
+      }
+      setTimeout(() => {
+        game_over()
+      }, 800)
+    })
+    return 800
+  }
+}
+
+//  结束游戏
+function game_over() {
+  let $params = {
+    game_record_id: game_store.getters.getGameRecordId(),
+    type: game_store.getters.getMode(),
+    play_time: game_store.getters.getPlayTime() - Math.abs(game_store.getters.getPlayedTime())
+  }
+  //
+  gameEnd($params).then((res) => {
+    let $data = res.data
+    to_report()
+  })
+}
+
+
+function to_report() {
+  mpvue.navigateTo({
+    url: "/pages/report/main?id=" + game_store.getters.getGameRecordId(),
+    success() {
+      //设置游戏状态为 停止游戏
+      game_store.setters.setGameStatus(3)
+      //游戏结束重置游戏时间
+      wx.removeStorageSync('play_time')
+      //删除游戏专注数据
+      game_store.remover.rmGameAttMedDatas()
+      //游戏结束重置游戏模式
+      game_store.setters.setMode(0)
+      //删除游戏得id
+      game_store.setters.removeToyHex()
+    }
+  })
+}

+ 39 - 37
src/utils/index.js

@@ -404,45 +404,46 @@ export function getRadarChartOption($params) {
 export function getPieChartsOption($pie_datas) {
 export function getPieChartsOption($pie_datas) {
   if ($pie_datas) {
   if ($pie_datas) {
     console.log($pie_datas)
     console.log($pie_datas)
-  }
-  let option = {
-    tooltip: {
-      trigger: 'item',
-      formatter: '{a} \r\n {b}: {c} ({d}%)'
-    },
-    legend: {
-      orient: 'vertical',
-      right: '10%',
-      top: '5%',
-      data: $pie_datas['legends']
-    },
-    series: [
-      {
-        name: '访问来源',
-        type: 'pie',
-        radius: ['40%', '70%'],
-        avoidLabelOverlap: false,
-        label: {
-          show: false,
-          position: 'center'
-        },
-        right: '40%',
-        emphasis: {
+    let option = {
+      tooltip: {
+        trigger: 'item',
+        formatter: '{a} \r\n {b}: {c} ({d}%)'
+      },
+      legend: {
+        orient: 'vertical',
+        right: '10%',
+        top: '5%',
+        data: $pie_datas['legends']
+      },
+      series: [
+        {
+          name: '访问来源',
+          type: 'pie',
+          radius: ['40%', '70%'],
+          avoidLabelOverlap: false,
           label: {
           label: {
-            show: true,
-            fontSize: '30',
-            fontWeight: 'bold'
-          }
-        },
-        labelLine: {
-          show: true
-        },
-        data: $pie_datas['datas']
-      }
-    ]
-  };
-  return option
+            show: false,
+            position: 'center'
+          },
+          right: '40%',
+          emphasis: {
+            label: {
+              show: true,
+              fontSize: '30',
+              fontWeight: 'bold'
+            }
+          },
+          labelLine: {
+            show: true
+          },
+          data: $pie_datas['datas']
+        }
+      ]
+    };
+    return option
+  }
 }
 }
+
 //过滤饼状数据
 //过滤饼状数据
 export function filterPieData(datas) {
 export function filterPieData(datas) {
   let $this = this
   let $this = this
@@ -479,6 +480,7 @@ export function filterPieData(datas) {
   })
   })
   return {datas, legends}
   return {datas, legends}
 }
 }
+
 export default {
 export default {
   formatNumber,
   formatNumber,
   formatTime,
   formatTime,

+ 0 - 54
static/colorui/components/cu-custom.js

@@ -1,54 +0,0 @@
-const app = getApp();
-Component({
-  /**
-   * 组件的一些选项
-   */
-  options: {
-    addGlobalClass: true,
-    multipleSlots: true
-  },
-  /**
-   * 组件的对外属性
-   */
-  properties: {
-    bgColor: {
-      type: String,
-      default: ''
-    }, 
-    isCustom: {
-      type: [Boolean, String],
-      default: false
-    },
-    isBack: {
-      type: [Boolean, String],
-      default: false
-    },
-    bgImage: {
-      type: String,
-      default: ''
-    },
-  },
-  /**
-   * 组件的初始数据
-   */
-  data: {
-    StatusBar: app.globalData.StatusBar,
-    CustomBar: app.globalData.CustomBar,
-    Custom: app.globalData.Custom
-  },
-  /**
-   * 组件的方法列表
-   */
-  methods: {
-    BackPage() {
-      wx.navigateBack({
-        delta: 1
-      });
-    },
-    toHome(){
-      wx.reLaunch({
-        url: '/pages/index/index',
-      })
-    }
-  }
-})

+ 0 - 4
static/colorui/components/cu-custom.json

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

+ 0 - 69
static/colorui/components/cu-custom.vue

@@ -1,69 +0,0 @@
-<template>
-	<view>
-		<view class="cu-custom" :style="[{height:CustomBar + 'px'}]">
-			<view class="cu-bar fixed" :style="style" :class="[bgImage!=''?'none-bg text-white bg-img':'',bgColor]">
-				<view class="action" @tap="BackPage" v-if="isBack">
-					<text class="cuIcon-back"></text>
-					<slot name="backText"></slot>
-				</view>
-				<view class="content" :style="[{top:StatusBar + 'px'}]">
-					<slot name="content"></slot>
-				</view>
-				<slot name="right"></slot>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				StatusBar: this.StatusBar,
-				CustomBar: this.CustomBar
-			};
-		},
-		name: 'cu-custom',
-		computed: {
-			style() {
-				var StatusBar= this.StatusBar;
-				var CustomBar= this.CustomBar;
-				var bgImage = this.bgImage;
-				var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
-				if (this.bgImage) {
-					style = `${style}background-image:url(${bgImage});`;
-				}
-				return style
-			}
-		},
-		props: {
-			bgColor: {
-				type: String,
-				default: ''
-			},
-			isBack: {
-				type: [Boolean, String],
-				default: false
-			},
-			bgImage: {
-				type: String,
-				default: ''
-			},
-		},
-		methods: {
-			BackPage() {
-				if (getCurrentPages().length < 2 && 'undefined' !== typeof __wxConfig) {
-					let url = '/' + __wxConfig.pages[0]
-					return uni.redirectTo({url})
-				}
-				uni.navigateBack({
-					delta: 1
-				});
-			}
-		}
-	}
-</script>
-
-<style>
-
-</style>

+ 0 - 16
static/colorui/components/cu-custom.wxml

@@ -1,16 +0,0 @@
-<view class="cu-custom" style="height:{{CustomBar}}px">
-  <view class="cu-bar fixed {{bgImage!=''?'none-bg text-white bg-img':''}} {{bgColor}}" style="height:{{CustomBar}}px;padding-top:{{StatusBar}}px;{{bgImage?'background-image:url(' + bgImage+')':''}}">
-    <view class="action" bindtap="BackPage" wx:if="{{isBack}}">
-      <text class="cuIcon-back"></text>
-      <slot name="backText"></slot>
-    </view>
-    <view class="action border-custom"  wx:if="{{isCustom}}" style="width:{{Custom.width}}px;height:{{Custom.height}}px;margin-left:calc(750rpx - {{Custom.right}}px)">
-      <text class="cuIcon-back" bindtap="BackPage"></text>
-      <text class="cuIcon-homefill" bindtap="toHome"></text>
-    </view>
-    <view class="content" style="top:{{StatusBar}}px">
-      <slot name="content"></slot>
-    </view>
-    <slot name="right"></slot>
-  </view>
-</view>

+ 0 - 1
static/colorui/components/cu-custom.wxss

@@ -1 +0,0 @@
-/* colorui/components/cu-custom.wxss */

File diff suppressed because it is too large
+ 0 - 0
static/echarts.min.js


+ 0 - 1
static/vant/checkbox-group/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 35
static/vant/checkbox-group/index.js

@@ -1,35 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  field: true,
-  relation: {
-    name: 'checkbox',
-    type: 'descendant',
-    current: 'checkbox-group',
-    linked(target) {
-      this.updateChild(target);
-    },
-  },
-  props: {
-    max: Number,
-    value: {
-      type: Array,
-      observer: 'updateChildren',
-    },
-    disabled: {
-      type: Boolean,
-      observer: 'updateChildren',
-    },
-  },
-  methods: {
-    updateChildren() {
-      (this.children || []).forEach((child) => this.updateChild(child));
-    },
-    updateChild(child) {
-      const { value, disabled } = this.data;
-      child.setData({
-        value: value.indexOf(child.data.name) !== -1,
-        parentDisabled: disabled,
-      });
-    },
-  },
-});

+ 0 - 3
static/vant/checkbox-group/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 1
static/vant/checkbox-group/index.wxml

@@ -1 +0,0 @@
-<slot />

+ 0 - 1
static/vant/checkbox-group/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';

+ 0 - 1
static/vant/checkbox/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 74
static/vant/checkbox/index.js

@@ -1,74 +0,0 @@
-import { VantComponent } from '../common/component';
-function emit(target, value) {
-  target.$emit('input', value);
-  target.$emit('change', value);
-}
-VantComponent({
-  field: true,
-  relation: {
-    name: 'checkbox-group',
-    type: 'ancestor',
-    current: 'checkbox',
-  },
-  classes: ['icon-class', 'label-class'],
-  props: {
-    value: Boolean,
-    disabled: Boolean,
-    useIconSlot: Boolean,
-    checkedColor: String,
-    labelPosition: String,
-    labelDisabled: Boolean,
-    shape: {
-      type: String,
-      value: 'round',
-    },
-    iconSize: {
-      type: null,
-      value: 20,
-    },
-  },
-  data: {
-    parentDisabled: false,
-  },
-  methods: {
-    emitChange(value) {
-      if (this.parent) {
-        this.setParentValue(this.parent, value);
-      } else {
-        emit(this, value);
-      }
-    },
-    toggle() {
-      const { parentDisabled, disabled, value } = this.data;
-      if (!disabled && !parentDisabled) {
-        this.emitChange(!value);
-      }
-    },
-    onClickLabel() {
-      const { labelDisabled, parentDisabled, disabled, value } = this.data;
-      if (!disabled && !labelDisabled && !parentDisabled) {
-        this.emitChange(!value);
-      }
-    },
-    setParentValue(parent, value) {
-      const parentValue = parent.data.value.slice();
-      const { name } = this.data;
-      const { max } = parent.data;
-      if (value) {
-        if (max && parentValue.length >= max) {
-          return;
-        }
-        if (parentValue.indexOf(name) === -1) {
-          parentValue.push(name);
-          emit(parent, parentValue);
-        }
-      } else {
-        const index = parentValue.indexOf(name);
-        if (index !== -1) {
-          parentValue.splice(index, 1);
-          emit(parent, parentValue);
-        }
-      }
-    },
-  },
-});

+ 0 - 6
static/vant/checkbox/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-icon": "../icon/index"
-  }
-}

+ 0 - 20
static/vant/checkbox/index.wxml

@@ -1,20 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-<wxs src="./index.wxs" module="computed" />
-
-<view class="van-checkbox custom-class">
-  <view class="van-checkbox__icon-wrap" bindtap="toggle">
-    <slot wx:if="{{ useIconSlot }}" name="icon" />
-    <van-icon
-      wx:else
-      name="success"
-      size="0.8em"
-      class="{{ utils.bem('checkbox__icon', [shape, { disabled: disabled || parentDisabled, checked: value }]) }}"
-      style="{{ computed.iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) }}"
-      custom-class="icon-class"
-      custom-style="line-height: 1.25em;"
-    />
-  </view>
-  <view class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}" bindtap="onClickLabel">
-    <slot />
-  </view>
-</view>

+ 0 - 20
static/vant/checkbox/index.wxs

@@ -1,20 +0,0 @@
-/* eslint-disable */
-var utils = require('../wxs/utils.wxs');
-
-function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) {
-  var styles = [['font-size', utils.addUnit(iconSize)]];
-  if (checkedColor && value && !disabled && !parentDisabled) {
-    styles.push(['border-color', checkedColor]);
-    styles.push(['background-color', checkedColor]);
-  }
-
-  return styles
-    .map(function(item) {
-      return item.join(':');
-    })
-    .join(';');
-}
-
-module.exports = {
-  iconStyle: iconStyle
-};

+ 0 - 1
static/vant/checkbox/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-checkbox{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{line-height:20px;line-height:var(--checkbox-size,20px)}.van-checkbox__icon-wrap{-webkit-flex:none;flex:none}.van-checkbox__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;font-size:20px;font-size:var(--checkbox-size,20px);border:1px solid #c8c9cc;border:1px solid var(--checkbox-border-color,#c8c9cc);transition-duration:.2s;transition-duration:var(--checkbox-transition-duration,.2s)}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--checkbox-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--checkbox-checked-icon-color,#1989fa)}.van-checkbox__icon--disabled{background-color:#ebedf0;background-color:var(--checkbox-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__icon--disabled.van-checkbox__icon--checked{color:#c8c9cc;color:var(--checkbox-disabled-icon-color,#c8c9cc)}.van-checkbox__label{word-wrap:break-word;margin-left:10px;margin-left:var(--checkbox-label-margin,10px);color:#323233;color:var(--checkbox-label-color,#323233)}.van-checkbox__label--left{float:left;margin:0 10px 0 0;margin:0 var(--checkbox-label-margin,10px) 0 0}.van-checkbox__label--disabled{color:#c8c9cc;color:var(--checkbox-disabled-label-color,#c8c9cc)}.van-checkbox__label:empty{margin:0}

+ 0 - 1
static/vant/collapse-item/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 99
static/vant/collapse-item/index.js

@@ -1,99 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  classes: ['title-class', 'content-class'],
-  relation: {
-    name: 'collapse',
-    type: 'ancestor',
-    current: 'collapse-item',
-  },
-  props: {
-    name: null,
-    title: null,
-    value: null,
-    icon: String,
-    label: String,
-    disabled: Boolean,
-    clickable: Boolean,
-    border: {
-      type: Boolean,
-      value: true,
-    },
-    isLink: {
-      type: Boolean,
-      value: true,
-    },
-  },
-  data: {
-    expanded: false,
-  },
-  created() {
-    this.animation = wx.createAnimation({
-      duration: 0,
-      timingFunction: 'ease-in-out',
-    });
-  },
-  mounted() {
-    this.updateExpanded();
-    this.inited = true;
-  },
-  methods: {
-    updateExpanded() {
-      if (!this.parent) {
-        return Promise.resolve();
-      }
-      const { value, accordion } = this.parent.data;
-      const { children = [] } = this.parent;
-      const { name } = this.data;
-      const index = children.indexOf(this);
-      const currentName = name == null ? index : name;
-      const expanded = accordion
-        ? value === currentName
-        : (value || []).some((name) => name === currentName);
-      if (expanded !== this.data.expanded) {
-        this.updateStyle(expanded);
-      }
-      this.setData({ index, expanded });
-    },
-    updateStyle(expanded) {
-      const { inited } = this;
-      this.getRect('.van-collapse-item__content')
-        .then((rect) => rect.height)
-        .then((height) => {
-          const { animation } = this;
-          if (expanded) {
-            if (height === 0) {
-              animation.height('auto').top(1).step();
-            } else {
-              animation
-                .height(height)
-                .top(1)
-                .step({
-                  duration: inited ? 300 : 1,
-                })
-                .height('auto')
-                .step();
-            }
-            this.setData({
-              animation: animation.export(),
-            });
-            return;
-          }
-          animation.height(height).top(0).step({ duration: 1 }).height(0).step({
-            duration: 300,
-          });
-          this.setData({
-            animation: animation.export(),
-          });
-        });
-    },
-    onClick() {
-      if (this.data.disabled) {
-        return;
-      }
-      const { name, expanded } = this.data;
-      const index = this.parent.children.indexOf(this);
-      const currentName = name == null ? index : name;
-      this.parent.switch(currentName, !expanded);
-    },
-  },
-});

+ 0 - 6
static/vant/collapse-item/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-cell": "../cell/index"
-  }
-}

+ 0 - 44
static/vant/collapse-item/index.wxml

@@ -1,44 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="van-collapse-item custom-class {{ index !== 0 ? 'van-hairline--top' : '' }}">
-  <van-cell
-    title="{{ title }}"
-    title-class="title-class"
-    icon="{{ icon }}"
-    value="{{ value }}"
-    label="{{ label }}"
-    is-link="{{ isLink }}"
-    clickable="{{ clickable }}"
-    border="{{ border && expanded }}"
-    class="{{ utils.bem('collapse-item__title', { disabled, expanded }) }}"
-    right-icon-class="van-cell__right-icon"
-    custom-class="van-cell"
-    hover-class="van-cell--hover"
-    bind:click="onClick"
-  >
-    <slot
-      name="title"
-      slot="title"
-    />
-    <slot
-      name="icon"
-      slot="icon"
-    />
-    <slot name="value" />
-    <slot
-      name="right-icon"
-      slot="right-icon"
-    />
-  </van-cell>
-  <view
-    class="{{ utils.bem('collapse-item__wrapper') }}"
-    style="height: 0;"
-    animation="{{ animation }}"
-  >
-    <view
-      class="van-collapse-item__content content-class"
-    >
-      <slot />
-    </view>
-  </view>
-</view>

+ 0 - 1
static/vant/collapse-item/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;transition:-webkit-transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s);transition:transform var(--collapse-item-transition-duration,.3s),-webkit-transform var(--collapse-item-transition-duration,.3s)}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c8c9cc!important;color:var(--collapse-item-title-disabled-color,#c8c9cc)!important}.van-collapse-item__title--disabled .van-cell--hover{background-color:#fff!important;background-color:var(--white,#fff)!important}.van-collapse-item__wrapper{overflow:hidden}.van-collapse-item__content{padding:15px;padding:var(--collapse-item-content-padding,15px);color:#969799;color:var(--collapse-item-content-text-color,#969799);font-size:13px;font-size:var(--collapse-item-content-font-size,13px);line-height:1.5;line-height:var(--collapse-item-content-line-height,1.5);background-color:#fff;background-color:var(--collapse-item-content-background-color,#fff)}

+ 0 - 1
static/vant/collapse/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 47
static/vant/collapse/index.js

@@ -1,47 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  relation: {
-    name: 'collapse-item',
-    type: 'descendant',
-    current: 'collapse',
-  },
-  props: {
-    value: {
-      type: null,
-      observer: 'updateExpanded',
-    },
-    accordion: {
-      type: Boolean,
-      observer: 'updateExpanded',
-    },
-    border: {
-      type: Boolean,
-      value: true,
-    },
-  },
-  methods: {
-    updateExpanded() {
-      this.children.forEach((child) => {
-        child.updateExpanded();
-      });
-    },
-    switch(name, expanded) {
-      const { accordion, value } = this.data;
-      const changeItem = name;
-      if (!accordion) {
-        name = expanded
-          ? (value || []).concat(name)
-          : (value || []).filter((activeName) => activeName !== name);
-      } else {
-        name = expanded ? name : '';
-      }
-      if (expanded) {
-        this.$emit('open', changeItem);
-      } else {
-        this.$emit('close', changeItem);
-      }
-      this.$emit('change', name);
-      this.$emit('input', name);
-    },
-  },
-});

+ 0 - 3
static/vant/collapse/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 3
static/vant/collapse/index.wxml

@@ -1,3 +0,0 @@
-<view class="custom-class van-collapse {{ border ? 'van-hairline--top-bottom' : '' }}">
-  <slot />
-</view>

+ 0 - 1
static/vant/collapse/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';

+ 0 - 1
static/vant/dropdown-item/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 109
static/vant/dropdown-item/index.js

@@ -1,109 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  field: true,
-  relation: {
-    name: 'dropdown-menu',
-    type: 'ancestor',
-    current: 'dropdown-item',
-    linked() {
-      this.updateDataFromParent();
-    },
-  },
-  props: {
-    value: {
-      type: null,
-      observer: 'rerender',
-    },
-    title: {
-      type: String,
-      observer: 'rerender',
-    },
-    disabled: Boolean,
-    titleClass: {
-      type: String,
-      observer: 'rerender',
-    },
-    options: {
-      type: Array,
-      value: [],
-      observer: 'rerender',
-    },
-    popupStyle: String,
-  },
-  data: {
-    transition: true,
-    showPopup: false,
-    showWrapper: false,
-    displayTitle: '',
-  },
-  methods: {
-    rerender() {
-      wx.nextTick(() => {
-        this.parent && this.parent.updateItemListData();
-      });
-    },
-    updateDataFromParent() {
-      if (this.parent) {
-        const {
-          overlay,
-          duration,
-          activeColor,
-          closeOnClickOverlay,
-          direction,
-        } = this.parent.data;
-        this.setData({
-          overlay,
-          duration,
-          activeColor,
-          closeOnClickOverlay,
-          direction,
-        });
-      }
-    },
-    onOpen() {
-      this.$emit('open');
-    },
-    onOpened() {
-      this.$emit('opened');
-    },
-    onClose() {
-      this.$emit('close');
-    },
-    onClosed() {
-      this.$emit('closed');
-      this.setData({ showWrapper: false });
-    },
-    onOptionTap(event) {
-      const { option } = event.currentTarget.dataset;
-      const { value } = option;
-      const shouldEmitChange = this.data.value !== value;
-      this.setData({ showPopup: false, value });
-      this.$emit('close');
-      this.rerender();
-      if (shouldEmitChange) {
-        this.$emit('change', value);
-      }
-    },
-    toggle(show, options = {}) {
-      const { showPopup } = this.data;
-      if (typeof show !== 'boolean') {
-        show = !showPopup;
-      }
-      if (show === showPopup) {
-        return;
-      }
-      this.setData({
-        transition: !options.immediate,
-        showPopup: show,
-      });
-      if (show) {
-        this.parent.getChildWrapperStyle().then((wrapperStyle) => {
-          this.setData({ wrapperStyle, showWrapper: true });
-          this.rerender();
-        });
-      } else {
-        this.rerender();
-      }
-    },
-  },
-});

+ 0 - 8
static/vant/dropdown-item/index.json

@@ -1,8 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-popup": "../popup/index",
-    "van-cell": "../cell/index",
-    "van-icon": "../icon/index"
-  }
-}

+ 0 - 48
static/vant/dropdown-item/index.wxml

@@ -1,48 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view
-  wx:if="{{ showWrapper }}"
-  class="{{ utils.bem('dropdown-item', direction) }}"
-  style="{{ wrapperStyle }}"
->
-  <van-popup
-    show="{{ showPopup }}"
-    custom-style="position: absolute;{{ popupStyle }}"
-    overlay-style="position: absolute;"
-    overlay="{{ overlay }}"
-    position="{{ direction === 'down' ? 'top' : 'bottom' }}"
-    duration="{{ transition ? duration : 0 }}"
-    close-on-click-overlay="{{ closeOnClickOverlay }}"
-    bind:enter="onOpen"
-    bind:leave="onClose"
-    bind:close="toggle"
-    bind:after-enter="onOpened"
-    bind:after-leave="onClosed"
-  >
-    <van-cell
-      wx:for="{{ options }}"
-      wx:key="value"
-      data-option="{{ item }}"
-      class="{{ utils.bem('dropdown-item__option', { active: item.value === value } ) }}"
-      clickable
-      icon="{{ item.icon }}"
-      bind:tap="onOptionTap"
-    >
-      <view
-        slot="title"
-        class="van-dropdown-item__title"
-        style="{{ item.value === value  ? 'color:' + activeColor : '' }}"
-      >
-        {{ item.text }}
-      </view>
-      <van-icon
-        wx:if="{{ item.value === value }}"
-        name="success"
-        class="van-dropdown-item__icon"
-        color="{{ activeColor }}"
-      />
-    </van-cell>
-
-    <slot />
-  </van-popup>
-</view>

+ 0 - 1
static/vant/dropdown-item/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#1989fa;color:var(--dropdown-menu-option-active-color,#1989fa)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit}

+ 0 - 1
static/vant/dropdown-menu/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 119
static/vant/dropdown-menu/index.js

@@ -1,119 +0,0 @@
-import { VantComponent } from '../common/component';
-import { addUnit } from '../common/utils';
-let ARRAY = [];
-VantComponent({
-  field: true,
-  relation: {
-    name: 'dropdown-item',
-    type: 'descendant',
-    current: 'dropdown-menu',
-    linked() {
-      this.updateItemListData();
-    },
-    unlinked() {
-      this.updateItemListData();
-    },
-  },
-  props: {
-    activeColor: {
-      type: String,
-      observer: 'updateChildrenData',
-    },
-    overlay: {
-      type: Boolean,
-      value: true,
-      observer: 'updateChildrenData',
-    },
-    zIndex: {
-      type: Number,
-      value: 10,
-    },
-    duration: {
-      type: Number,
-      value: 200,
-      observer: 'updateChildrenData',
-    },
-    direction: {
-      type: String,
-      value: 'down',
-      observer: 'updateChildrenData',
-    },
-    closeOnClickOverlay: {
-      type: Boolean,
-      value: true,
-      observer: 'updateChildrenData',
-    },
-    closeOnClickOutside: {
-      type: Boolean,
-      value: true,
-    },
-  },
-  data: {
-    itemListData: [],
-  },
-  beforeCreate() {
-    const { windowHeight } = wx.getSystemInfoSync();
-    this.windowHeight = windowHeight;
-    ARRAY.push(this);
-  },
-  destroyed() {
-    ARRAY = ARRAY.filter((item) => item !== this);
-  },
-  methods: {
-    updateItemListData() {
-      this.setData({
-        itemListData: this.children.map((child) => child.data),
-      });
-    },
-    updateChildrenData() {
-      this.children.forEach((child) => {
-        child.updateDataFromParent();
-      });
-    },
-    toggleItem(active) {
-      this.children.forEach((item, index) => {
-        const { showPopup } = item.data;
-        if (index === active) {
-          item.toggle();
-        } else if (showPopup) {
-          item.toggle(false, { immediate: true });
-        }
-      });
-    },
-    close() {
-      this.children.forEach((child) => {
-        child.toggle(false, { immediate: true });
-      });
-    },
-    getChildWrapperStyle() {
-      const { zIndex, direction } = this.data;
-      return this.getRect('.van-dropdown-menu').then((rect) => {
-        const { top = 0, bottom = 0 } = rect;
-        const offset = direction === 'down' ? bottom : this.windowHeight - top;
-        let wrapperStyle = `z-index: ${zIndex};`;
-        if (direction === 'down') {
-          wrapperStyle += `top: ${addUnit(offset)};`;
-        } else {
-          wrapperStyle += `bottom: ${addUnit(offset)};`;
-        }
-        return wrapperStyle;
-      });
-    },
-    onTitleTap(event) {
-      const { index } = event.currentTarget.dataset;
-      const child = this.children[index];
-      if (!child.data.disabled) {
-        ARRAY.forEach((menuItem) => {
-          if (
-            menuItem &&
-            menuItem.data.closeOnClickOutside &&
-            menuItem !== this
-          ) {
-            menuItem.close();
-          }
-        });
-        this.toggleItem(index);
-      }
-    },
-  },
-});

+ 0 - 3
static/vant/dropdown-menu/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 23
static/vant/dropdown-menu/index.wxml

@@ -1,23 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-<wxs src="./index.wxs" module="computed" />
-
-<view class="van-dropdown-menu van-dropdown-menu--top-bottom">
-  <view
-    wx:for="{{ itemListData }}"
-    wx:key="index"
-    data-index="{{ index }}"
-    class="{{ utils.bem('dropdown-menu__item', { disabled: item.disabled }) }}"
-    bind:tap="onTitleTap"
-  >
-    <view
-      class="{{ item.titleClass }} {{ utils.bem('dropdown-menu__title', { active: item.showPopup, down: item.showPopup === (direction === 'down') }) }}"
-      style="{{ item.showPopup ? 'color:' + activeColor : '' }}"
-    >
-      <view class="van-ellipsis">
-        {{ computed.displayTitle(item) }}
-      </view>
-    </view>
-  </view>
-
-  <slot />
-</view>

+ 0 - 16
static/vant/dropdown-menu/index.wxs

@@ -1,16 +0,0 @@
-/* eslint-disable */
-function displayTitle(item) {
-  if (item.title) {
-    return item.title;
-  }
-
-  var match = item.options.filter(function(option) {
-    return option.value === item.value;
-  });
-  var displayTitle = match.length ? match[0].text : '';
-  return displayTitle;
-}
-
-module.exports = {
-  displayTitle: displayTitle
-};

+ 0 - 1
static/vant/dropdown-menu/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-dropdown-menu{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;height:50px;height:var(--dropdown-menu-height,50px);background-color:#fff;background-color:var(--dropdown-menu-background-color,#fff)}.van-dropdown-menu__item{display:-webkit-flex;display:flex;-webkit-flex:1;flex:1;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;min-width:0}.van-dropdown-menu__item:active{opacity:.7}.van-dropdown-menu__item--disabled:active{opacity:1}.van-dropdown-menu__item--disabled .van-dropdown-menu__title{color:#969799;color:var(--dropdown-menu-title-disabled-text-color,#969799)}.van-dropdown-menu__title{position:relative;box-sizing:border-box;max-width:100%;padding:0 8px;padding:var(--dropdown-menu-title-padding,0 8px);color:#323233;color:var(--dropdown-menu-title-text-color,#323233);font-size:15px;font-size:var(--dropdown-menu-title-font-size,15px);line-height:18px;line-height:var(--dropdown-menu-title-line-height,18px)}.van-dropdown-menu__title:after{position:absolute;top:50%;right:-4px;margin-top:-5px;border-color:transparent transparent currentcolor currentcolor;border-style:solid;border-width:3px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);opacity:.8;content:""}.van-dropdown-menu__title--active{color:#1989fa;color:var(--dropdown-menu-title-active-text-color,#1989fa)}.van-dropdown-menu__title--down:after{margin-top:-1px;-webkit-transform:rotate(135deg);transform:rotate(135deg)}

+ 0 - 1
static/vant/grid-item/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 83
static/vant/grid-item/index.js

@@ -1,83 +0,0 @@
-import { link } from '../mixins/link';
-import { VantComponent } from '../common/component';
-import { addUnit } from '../common/utils';
-VantComponent({
-  relation: {
-    name: 'grid',
-    type: 'ancestor',
-    current: 'grid-item',
-  },
-  classes: ['content-class', 'icon-class', 'text-class'],
-  mixins: [link],
-  props: {
-    icon: String,
-    iconColor: String,
-    dot: Boolean,
-    info: null,
-    badge: null,
-    text: String,
-    useSlot: Boolean,
-  },
-  data: {
-    viewStyle: '',
-  },
-  mounted() {
-    this.updateStyle();
-  },
-  methods: {
-    updateStyle() {
-      if (!this.parent) {
-        return;
-      }
-      const { data, children } = this.parent;
-      const {
-        columnNum,
-        border,
-        square,
-        gutter,
-        clickable,
-        center,
-        direction,
-        iconSize,
-      } = data;
-      const width = `${100 / columnNum}%`;
-      const styleWrapper = [];
-      styleWrapper.push(`width: ${width}`);
-      if (square) {
-        styleWrapper.push(`padding-top: ${width}`);
-      }
-      if (gutter) {
-        const gutterValue = addUnit(gutter);
-        styleWrapper.push(`padding-right: ${gutterValue}`);
-        const index = children.indexOf(this);
-        if (index >= columnNum && !square) {
-          styleWrapper.push(`margin-top: ${gutterValue}`);
-        }
-      }
-      let contentStyle = '';
-      if (square && gutter) {
-        const gutterValue = addUnit(gutter);
-        contentStyle = `
-          right: ${gutterValue};
-          bottom: ${gutterValue};
-          height: auto;
-        `;
-      }
-      this.setData({
-        viewStyle: styleWrapper.join('; '),
-        contentStyle,
-        center,
-        border,
-        square,
-        gutter,
-        clickable,
-        direction,
-        iconSize,
-      });
-    },
-    onClick() {
-      this.$emit('click');
-      this.jumpLink();
-    },
-  },
-});

+ 0 - 6
static/vant/grid-item/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-icon": "../icon/index"
-  }
-}

+ 0 - 22
static/vant/grid-item/index.wxml

@@ -1,22 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="custom-class {{ utils.bem('grid-item', { square }) }}" style="{{ viewStyle }}" bindtap="onClick">
-  <view
-    class="content-class {{ utils.bem('grid-item__content', [direction, { center, square, clickable, surround: border && gutter }]) }} {{ border ? 'van-hairline--surround' : '' }}"
-    style="{{ contentStyle }}"
-  >
-    <block wx:if="{{ useSlot }}">
-      <slot />
-    </block>
-    <block wx:else>
-      <view class="van-grid-item__icon icon-class">
-        <van-icon wx:if="{{ icon }}" name="{{ icon }}" color="{{ iconColor }}" dot="{{ dot }}" info="{{ badge || info }}" size="{{ iconSize }}" />
-        <slot wx:else name="icon"></slot>
-      </view>
-      <view class="van-grid-item__text text-class">
-        <text wx:if="{{ text }}">{{ text }}</text>
-        <slot wx:else name="text"></slot>
-      </view>
-    </block>
-  </view>
-</view>

+ 0 - 1
static/vant/grid-item/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-grid-item{position:relative;float:left;box-sizing:border-box}.van-grid-item--square{height:0}.van-grid-item__content{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;height:100%;padding:16px 8px;padding:var(--grid-item-content-padding,16px 8px);background-color:#fff;background-color:var(--grid-item-content-background-color,#fff)}.van-grid-item__content:after{z-index:1;border-width:0 1px 1px 0;border-bottom-width:var(--border-width-base,1px);border-right-width:var(--border-width-base,1px);border-top-width:0}.van-grid-item__content--surround:after{border-width:1px;border-width:var(--border-width-base,1px)}.van-grid-item__content--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-grid-item__content--square{position:absolute;top:0;right:0;left:0}.van-grid-item__content--horizontal{-webkit-flex-direction:row;flex-direction:row}.van-grid-item__content--horizontal .van-grid-item__icon+.van-grid-item__text{margin-top:0;margin-left:8px}.van-grid-item__content--clickable:active{background-color:#f2f3f5;background-color:var(--grid-item-content-active-color,#f2f3f5)}.van-grid-item__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;font-size:26px;font-size:var(--grid-item-icon-size,26px);height:26px;height:var(--grid-item-icon-size,26px)}.van-grid-item__text{word-wrap:break-word;color:#646566;color:var(--grid-item-text-color,#646566);font-size:12px;font-size:var(--grid-item-text-font-size,12px)}.van-grid-item__icon+.van-grid-item__text{margin-top:8px}

+ 0 - 1
static/vant/grid/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 65
static/vant/grid/index.js

@@ -1,65 +0,0 @@
-import { VantComponent } from '../common/component';
-import { addUnit } from '../common/utils';
-VantComponent({
-  relation: {
-    name: 'grid-item',
-    type: 'descendant',
-    current: 'grid',
-  },
-  props: {
-    square: {
-      type: Boolean,
-      observer: 'updateChildren',
-    },
-    gutter: {
-      type: [Number, String],
-      value: 0,
-      observer: 'updateChildren',
-    },
-    clickable: {
-      type: Boolean,
-      observer: 'updateChildren',
-    },
-    columnNum: {
-      type: Number,
-      value: 4,
-      observer: 'updateChildren',
-    },
-    center: {
-      type: Boolean,
-      value: true,
-      observer: 'updateChildren',
-    },
-    border: {
-      type: Boolean,
-      value: true,
-      observer: 'updateChildren',
-    },
-    direction: {
-      type: String,
-      observer: 'updateChildren',
-    },
-    iconSize: {
-      type: String,
-      observer: 'updateChildren',
-    },
-  },
-  data: {
-    viewStyle: '',
-  },
-  created() {
-    const { gutter } = this.data;
-    if (gutter) {
-      this.setData({
-        viewStyle: `padding-left: ${addUnit(gutter)}`,
-      });
-    }
-  },
-  methods: {
-    updateChildren() {
-      this.children.forEach((child) => {
-        child.updateStyle();
-      });
-    },
-  },
-});

+ 0 - 3
static/vant/grid/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 3
static/vant/grid/index.wxml

@@ -1,3 +0,0 @@
-<view class="van-grid custom-class {{ border && !gutter ? 'van-hairline--top' : '' }}" style="{{ viewStyle }}">
-  <slot />
-</view>

+ 0 - 1
static/vant/grid/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-grid{position:relative;box-sizing:border-box;overflow:hidden}

+ 0 - 1
static/vant/panel/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 10
static/vant/panel/index.js

@@ -1,10 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  classes: ['header-class', 'footer-class'],
-  props: {
-    desc: String,
-    title: String,
-    status: String,
-    useFooterSlot: Boolean,
-  },
-});

+ 0 - 6
static/vant/panel/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-cell": "../cell/index"
-  }
-}

+ 0 - 19
static/vant/panel/index.wxml

@@ -1,19 +0,0 @@
-<view class="van-panel van-hairline--top-bottom custom-class">
-  <van-cell 
-    wx:if="{{ title || desc || status }}"
-    title="{{ title }}"
-    label="{{ desc }}"
-    value="{{ status }}"
-    custom-class="header-class"
-    value-class="van-panel__header-value"
-  />
-  <slot wx:else name="header" />
-
-  <view class="van-panel__content">
-    <slot />
-  </view>
-
-  <view wx:if="{{ useFooterSlot }}" class="van-panel__footer van-hairline--top footer-class">
-    <slot name="footer" />
-  </view>
-</view>

+ 0 - 1
static/vant/panel/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-panel{background:#fff;background:var(--panel-background-color,#fff)}.van-panel__header-value{color:#ee0a24;color:var(--panel-header-value-color,#ee0a24)}.van-panel__footer{padding:8px 16px;padding:var(--panel-footer-padding,8px 16px)}

+ 0 - 1
static/vant/progress/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 27
static/vant/progress/index.js

@@ -1,27 +0,0 @@
-import { VantComponent } from '../common/component';
-import { BLUE } from '../common/color';
-VantComponent({
-  props: {
-    inactive: Boolean,
-    percentage: Number,
-    pivotText: String,
-    pivotColor: String,
-    trackColor: String,
-    showPivot: {
-      type: Boolean,
-      value: true,
-    },
-    color: {
-      type: String,
-      value: BLUE,
-    },
-    textColor: {
-      type: String,
-      value: '#fff',
-    },
-    strokeWidth: {
-      type: null,
-      value: 4,
-    },
-  },
-});

+ 0 - 3
static/vant/progress/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 20
static/vant/progress/index.wxml

@@ -1,20 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-<wxs src="./index.wxs" module="getters" />
-
-<view
-  class="van-progress custom-class"
-  style="height: {{ utils.addUnit(strokeWidth) }}; {{ trackColor ? 'background: ' + trackColor : '' }}"
->
-  <view
-    class="van-progress__portion"
-    style="width: {{ percentage }}%; background: {{ inactive ? '#cacaca' : color }}"
-  >
-    <view
-      wx:if="{{ showPivot && getters.text(pivotText, percentage) }}"
-      style="color: {{ textColor }}; background: {{ pivotColor ? pivotColor : inactive ? '#cacaca' : color }}"
-      class="van-progress__pivot"
-    >
-      {{ getters.text(pivotText, percentage) }}
-    </view>
-  </view>
-</view>

+ 0 - 5
static/vant/progress/index.wxs

@@ -1,5 +0,0 @@
-module.exports = {
-  text: function(pivotText, percentage) {
-    return pivotText || percentage + '%';
-  }
-};

+ 0 - 1
static/vant/progress/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-progress{position:relative;height:4px;height:var(--progress-height,4px);border-radius:4px;border-radius:var(--progress-height,4px);background:#ebedf0;background:var(--progress-background-color,#ebedf0)}.van-progress__portion{position:absolute;left:0;height:100%;border-radius:inherit;background:#1989fa;background:var(--progress-color,#1989fa)}.van-progress__pivot{position:absolute;top:50%;right:0;box-sizing:border-box;min-width:2em;text-align:center;word-break:keep-all;border-radius:1em;-webkit-transform:translateY(-50%);transform:translateY(-50%);color:#fff;color:var(--progress-pivot-text-color,#fff);padding:0 5px;padding:var(--progress-pivot-padding,0 5px);font-size:10px;font-size:var(--progress-pivot-font-size,10px);line-height:1.6;line-height:var(--progress-pivot-line-height,1.6);background-color:#1989fa;background-color:var(--progress-pivot-background-color,#1989fa)}

+ 0 - 1
static/vant/radio-group/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 34
static/vant/radio-group/index.js

@@ -1,34 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  field: true,
-  relation: {
-    name: 'radio',
-    type: 'descendant',
-    current: 'radio-group',
-    linked(target) {
-      this.updateChild(target);
-    },
-  },
-  props: {
-    value: {
-      type: null,
-      observer: 'updateChildren',
-    },
-    disabled: {
-      type: Boolean,
-      observer: 'updateChildren',
-    },
-  },
-  methods: {
-    updateChildren() {
-      (this.children || []).forEach((child) => this.updateChild(child));
-    },
-    updateChild(child) {
-      const { value, disabled } = this.data;
-      child.setData({
-        value,
-        disabled: disabled || child.data.disabled,
-      });
-    },
-  },
-});

+ 0 - 3
static/vant/radio-group/index.json

@@ -1,3 +0,0 @@
-{
-  "component": true
-}

+ 0 - 1
static/vant/radio-group/index.wxml

@@ -1 +0,0 @@
-<slot />

+ 0 - 1
static/vant/radio-group/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';

+ 0 - 1
static/vant/radio/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 48
static/vant/radio/index.js

@@ -1,48 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  field: true,
-  relation: {
-    name: 'radio-group',
-    type: 'ancestor',
-    current: 'radio',
-  },
-  classes: ['icon-class', 'label-class'],
-  props: {
-    name: null,
-    value: null,
-    disabled: Boolean,
-    useIconSlot: Boolean,
-    checkedColor: String,
-    labelPosition: {
-      type: String,
-      value: 'right',
-    },
-    labelDisabled: Boolean,
-    shape: {
-      type: String,
-      value: 'round',
-    },
-    iconSize: {
-      type: null,
-      value: 20,
-    },
-  },
-  methods: {
-    emitChange(value) {
-      const instance = this.parent || this;
-      instance.$emit('input', value);
-      instance.$emit('change', value);
-    },
-    onChange() {
-      if (!this.data.disabled) {
-        this.emitChange(this.data.name);
-      }
-    },
-    onClickLabel() {
-      const { disabled, labelDisabled, name } = this.data;
-      if (!disabled && !labelDisabled) {
-        this.emitChange(name);
-      }
-    },
-  },
-});

+ 0 - 6
static/vant/radio/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-icon": "../icon/index"
-  }
-}

+ 0 - 29
static/vant/radio/index.wxml

@@ -1,29 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="van-radio custom-class">
-  <view
-    wx:if="{{ labelPosition === 'left' }}"
-    class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
-    bindtap="onClickLabel"
-  >
-    <slot />
-  </view>
-  <view class="van-radio__icon-wrap" style="font-size: {{ utils.addUnit(iconSize) }};" bindtap="onChange">
-    <slot wx:if="{{ useIconSlot }}" name="icon" />
-    <van-icon
-      wx:else
-      name="success"
-      class="{{ utils.bem('radio__icon', [shape, { disabled, checked: value === name }]) }}"
-      style="font-size: {{ utils.addUnit(iconSize) }};{{ checkedColor && !disabled && value === name ? 'border-color:' + checkedColor + '; background-color:' + checkedColor + ';' : '' }}"
-      custom-class="icon-class"
-      custom-style="line-height: {{ utils.addUnit(iconSize) }};font-size: .8em;display: block;"
-    />
-  </view>
-  <view
-    wx:if="{{ labelPosition === 'right' }}"
-    class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled }]) }}"
-    bindtap="onClickLabel"
-  >
-    <slot />
-  </view>
-</view>

+ 0 - 1
static/vant/radio/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-radio{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;overflow:hidden;-webkit-user-select:none;user-select:none}.van-radio__icon-wrap{-webkit-flex:none;flex:none}.van-radio__icon{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;width:1em;height:1em;color:transparent;text-align:center;transition-property:color,border-color,background-color;border:1px solid #c8c9cc;border:1px solid var(--radio-border-color,#c8c9cc);font-size:20px;font-size:var(--radio-size,20px);transition-duration:.2s;transition-duration:var(--radio-transition-duration,.2s)}.van-radio__icon--round{border-radius:100%}.van-radio__icon--checked{color:#fff;color:var(--white,#fff);background-color:#1989fa;background-color:var(--radio-checked-icon-color,#1989fa);border-color:#1989fa;border-color:var(--radio-checked-icon-color,#1989fa)}.van-radio__icon--disabled{background-color:#ebedf0;background-color:var(--radio-disabled-background-color,#ebedf0);border-color:#c8c9cc;border-color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__icon--disabled.van-radio__icon--checked{color:#c8c9cc;color:var(--radio-disabled-icon-color,#c8c9cc)}.van-radio__label{word-wrap:break-word;margin-left:10px;margin-left:var(--radio-label-margin,10px);color:#323233;color:var(--radio-label-color,#323233);line-height:20px;line-height:var(--radio-size,20px)}.van-radio__label--left{float:left;margin:0 10px 0 0;margin:0 var(--radio-label-margin,10px) 0 0}.van-radio__label--disabled{color:#c8c9cc;color:var(--radio-disabled-label-color,#c8c9cc)}.van-radio__label:empty{margin:0}

+ 0 - 1
static/vant/rate/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 87
static/vant/rate/index.js

@@ -1,87 +0,0 @@
-import { VantComponent } from '../common/component';
-import { canIUseModel } from '../common/version';
-VantComponent({
-  field: true,
-  classes: ['icon-class'],
-  props: {
-    value: {
-      type: Number,
-      observer(value) {
-        if (value !== this.data.innerValue) {
-          this.setData({ innerValue: value });
-        }
-      },
-    },
-    readonly: Boolean,
-    disabled: Boolean,
-    allowHalf: Boolean,
-    size: null,
-    icon: {
-      type: String,
-      value: 'star',
-    },
-    voidIcon: {
-      type: String,
-      value: 'star-o',
-    },
-    color: {
-      type: String,
-      value: '#ffd21e',
-    },
-    voidColor: {
-      type: String,
-      value: '#c7c7c7',
-    },
-    disabledColor: {
-      type: String,
-      value: '#bdbdbd',
-    },
-    count: {
-      type: Number,
-      value: 5,
-      observer(value) {
-        this.setData({ innerCountArray: Array.from({ length: value }) });
-      },
-    },
-    gutter: null,
-    touchable: {
-      type: Boolean,
-      value: true,
-    },
-  },
-  data: {
-    innerValue: 0,
-    innerCountArray: Array.from({ length: 5 }),
-  },
-  methods: {
-    onSelect(event) {
-      const { data } = this;
-      const { score } = event.currentTarget.dataset;
-      if (!data.disabled && !data.readonly) {
-        this.setData({ innerValue: score + 1 });
-        if (canIUseModel()) {
-          this.setData({ value: score + 1 });
-        }
-        wx.nextTick(() => {
-          this.$emit('input', score + 1);
-          this.$emit('change', score + 1);
-        });
-      }
-    },
-    onTouchMove(event) {
-      const { touchable } = this.data;
-      if (!touchable) return;
-      const { clientX } = event.touches[0];
-      this.getRect('.van-rate__icon', true).then((list) => {
-        const target = list
-          .sort((item) => item.right - item.left)
-          .find((item) => clientX >= item.left && clientX <= item.right);
-        if (target != null) {
-          this.onSelect(
-            Object.assign(Object.assign({}, event), { currentTarget: target })
-          );
-        }
-      });
-    },
-  },
-});

+ 0 - 6
static/vant/rate/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-icon": "../icon/index"
-  }
-}

+ 0 - 34
static/vant/rate/index.wxml

@@ -1,34 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view
-  class="van-rate custom-class"
-  bind:touchmove="onTouchMove"
->
-  <view
-    class="van-rate__item"
-    wx:for="{{ innerCountArray }}"
-    wx:key="index"
-    style="padding-right: {{ index !== count - 1 ? utils.addUnit(gutter) : '' }}"
-  >
-    <van-icon
-      name="{{ index + 1 <= innerValue ? icon : voidIcon }}"
-      class="van-rate__icon"
-      style="font-size: {{ utils.addUnit(size) }}"
-      custom-class="icon-class"
-      data-score="{{ index }}"
-      color="{{ disabled ? disabledColor : index + 1 <= innerValue ? color : voidColor }}"
-      bind:click="onSelect"
-    />
-
-    <van-icon
-      wx:if="{{ allowHalf }}"
-      name="{{ index + 0.5 <= innerValue ? icon : voidIcon }}"
-      class="{{ utils.bem('rate__icon', ['half']) }}"
-      style="font-size: {{ utils.addUnit(size) }}"
-      custom-class="icon-class"
-      data-score="{{ index - 0.5 }}"
-      color="{{ disabled ? disabledColor : index + 0.5 <= innerValue ? color : voidColor }}"
-      bind:click="onSelect"
-    />
-  </view>
-</view>

+ 0 - 1
static/vant/rate/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-rate{display:-webkit-inline-flex;display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{position:relative;padding:0 2px;padding:0 var(--rate-horizontal-padding,2px)}.van-rate__icon{display:block;height:1em;font-size:20px;font-size:var(--rate-icon-size,20px)}.van-rate__icon--half{position:absolute;top:0;width:.5em;overflow:hidden;left:2px;left:var(--rate-horizontal-padding,2px)}

+ 0 - 1
static/vant/search/index.d.ts

@@ -1 +0,0 @@
-export {};

+ 0 - 78
static/vant/search/index.js

@@ -1,78 +0,0 @@
-import { VantComponent } from '../common/component';
-import { canIUseModel } from '../common/version';
-VantComponent({
-  field: true,
-  classes: ['field-class', 'input-class', 'cancel-class'],
-  props: {
-    label: String,
-    focus: Boolean,
-    error: Boolean,
-    disabled: Boolean,
-    readonly: Boolean,
-    inputAlign: String,
-    showAction: Boolean,
-    useActionSlot: Boolean,
-    useLeftIconSlot: Boolean,
-    useRightIconSlot: Boolean,
-    leftIcon: {
-      type: String,
-      value: 'search',
-    },
-    rightIcon: String,
-    placeholder: String,
-    placeholderStyle: String,
-    actionText: {
-      type: String,
-      value: '取消',
-    },
-    background: {
-      type: String,
-      value: '#ffffff',
-    },
-    maxlength: {
-      type: Number,
-      value: -1,
-    },
-    shape: {
-      type: String,
-      value: 'square',
-    },
-    clearable: {
-      type: Boolean,
-      value: true,
-    },
-  },
-  methods: {
-    onChange(event) {
-      if (canIUseModel()) {
-        this.setData({ value: event.detail });
-      }
-      this.$emit('change', event.detail);
-    },
-    onCancel() {
-      /**
-       * 修复修改输入框值时,输入框失焦和赋值同时触发,赋值失效
-       * https://github.com/youzan/@vant/weapp/issues/1768
-       */
-      setTimeout(() => {
-        if (canIUseModel()) {
-          this.setData({ value: '' });
-        }
-        this.$emit('cancel');
-        this.$emit('change', '');
-      }, 200);
-    },
-    onSearch(event) {
-      this.$emit('search', event.detail);
-    },
-    onFocus(event) {
-      this.$emit('focus', event.detail);
-    },
-    onBlur(event) {
-      this.$emit('blur', event.detail);
-    },
-    onClear(event) {
-      this.$emit('clear', event.detail);
-    },
-  },
-});

+ 0 - 6
static/vant/search/index.json

@@ -1,6 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "van-field": "../field/index"
-  }
-}

Some files were not shown because too many files changed in this diff