chaooo 1 рік тому
батько
коміт
77562c01fb
82 змінених файлів з 47 додано та 2209 видалено
  1. 4 44
      src/App.vue
  2. 2 1
      src/app.json
  3. 4 4
      src/pages/games/start/index.vue
  4. 3 3
      src/pages/index/index.vue
  5. 1 1
      src/pages/user/edit/confirm_phone_first/index.vue
  6. 1 1
      src/pages/user/edit/index.vue
  7. 0 235
      static/vant/area/index.js
  8. 0 6
      static/vant/area/index.json
  9. 0 20
      static/vant/area/index.wxml
  10. 0 8
      static/vant/area/index.wxs
  11. 0 1
      static/vant/area/index.wxss
  12. 0 67
      static/vant/calendar/calendar.wxml
  13. 0 1
      static/vant/calendar/components/header/index.d.ts
  14. 0 34
      static/vant/calendar/components/header/index.js
  15. 0 3
      static/vant/calendar/components/header/index.json
  16. 0 16
      static/vant/calendar/components/header/index.wxml
  17. 0 1
      static/vant/calendar/components/header/index.wxss
  18. 0 1
      static/vant/calendar/components/month/index.d.ts
  19. 0 163
      static/vant/calendar/components/month/index.js
  20. 0 3
      static/vant/calendar/components/month/index.json
  21. 0 39
      static/vant/calendar/components/month/index.wxml
  22. 0 71
      static/vant/calendar/components/month/index.wxs
  23. 0 0
      static/vant/calendar/components/month/index.wxss
  24. 0 1
      static/vant/calendar/index.d.ts
  25. 0 343
      static/vant/calendar/index.js
  26. 0 10
      static/vant/calendar/index.json
  27. 0 25
      static/vant/calendar/index.wxml
  28. 0 37
      static/vant/calendar/index.wxs
  29. 0 1
      static/vant/calendar/index.wxss
  30. 0 18
      static/vant/calendar/utils.d.ts
  31. 0 83
      static/vant/calendar/utils.js
  32. 0 25
      static/vant/calendar/utils.wxs
  33. 0 1
      static/vant/checkbox-group/index.d.ts
  34. 0 36
      static/vant/checkbox-group/index.js
  35. 0 3
      static/vant/checkbox-group/index.json
  36. 0 5
      static/vant/checkbox-group/index.wxml
  37. 0 1
      static/vant/checkbox-group/index.wxss
  38. 0 1
      static/vant/checkbox/index.d.ts
  39. 0 75
      static/vant/checkbox/index.js
  40. 0 6
      static/vant/checkbox/index.json
  41. 0 31
      static/vant/checkbox/index.wxml
  42. 0 20
      static/vant/checkbox/index.wxs
  43. 0 1
      static/vant/checkbox/index.wxss
  44. 0 1
      static/vant/config-provider/index.d.ts
  45. 0 9
      static/vant/config-provider/index.js
  46. 0 3
      static/vant/config-provider/index.json
  47. 0 5
      static/vant/config-provider/index.wxml
  48. 0 29
      static/vant/config-provider/index.wxs
  49. 0 43
      static/vant/definitions/index.d.ts
  50. 0 1
      static/vant/definitions/index.js
  51. 0 132
      static/vant/definitions/weapp.d.ts
  52. 0 1
      static/vant/definitions/weapp.js
  53. 8 0
      static/vant/field/types.d.ts
  54. 0 0
      static/vant/field/types.js
  55. 0 1
      static/vant/index-anchor/index.d.ts
  56. 0 25
      static/vant/index-anchor/index.js
  57. 0 3
      static/vant/index-anchor/index.json
  58. 0 14
      static/vant/index-anchor/index.wxml
  59. 0 1
      static/vant/index-anchor/index.wxss
  60. 10 0
      static/vant/overlay/overlay.wxml
  61. 14 0
      static/vant/popup/popup.wxml
  62. 0 1
      static/vant/radio-group/index.d.ts
  63. 0 22
      static/vant/radio-group/index.js
  64. 0 3
      static/vant/radio-group/index.json
  65. 0 5
      static/vant/radio-group/index.wxml
  66. 0 1
      static/vant/radio-group/index.wxss
  67. 0 1
      static/vant/radio/index.d.ts
  68. 0 66
      static/vant/radio/index.js
  69. 0 6
      static/vant/radio/index.json
  70. 0 30
      static/vant/radio/index.wxml
  71. 0 33
      static/vant/radio/index.wxs
  72. 0 1
      static/vant/radio/index.wxss
  73. 0 1
      static/vant/stepper/index.d.ts
  74. 0 191
      static/vant/stepper/index.js
  75. 0 3
      static/vant/stepper/index.json
  76. 0 37
      static/vant/stepper/index.wxml
  77. 0 0
      static/vant/stepper/index.wxss
  78. 0 1
      static/vant/steps/index.d.ts
  79. 0 33
      static/vant/steps/index.js
  80. 0 6
      static/vant/steps/index.json
  81. 0 54
      static/vant/steps/index.wxml
  82. 0 0
      static/vant/steps/index.wxss

+ 4 - 44
src/App.vue

@@ -7,52 +7,12 @@ export default {
   },
   //外发
   onShow(options){
-      let query = options.query.other
+      //let query = options.query.other
       // console.log('进入小程序了',options)
-      // 有无参数
-      if(query){
-        console.log('外发给你')
-        wx.setStorageSync("is_out", true);
-      }else{
-        wx.setStorageSync("is_out", false);
-      }
-      // 判断是啥券
-      if(query == 1){
-        console.log("外发其它券")
-        wx.setStorageSync("is_other_first", true);
-      }else{
-        wx.setStorageSync("is_other_first", false);
-      }
   },
   onHide(){
-     wx.removeStorageSync("is_out");
-     wx.removeStorageSync("is_other_first");
-     wx.removeStorageSync("is_other");
   },
   created() {
-
-    // 调用API从本地缓存中获取数据
-    /*
-     * 平台 api 差异的处理方式:  api 方法统一挂载到 mpvue 名称空间, 平台判断通过 mpvuePlatform 特征字符串
-     * 微信:mpvue === wx, mpvuePlatform === 'wx'
-     * 头条:mpvue === tt, mpvuePlatform === 'tt'
-     * 百度:mpvue === swan, mpvuePlatform === 'swan'
-     * 支付宝(蚂蚁):mpvue === my, mpvuePlatform === 'my'
-     */
-
-    // let logs
-    // if (mpvuePlatform === 'my') {
-    //   logs = mpvue.getStorageSync({key: 'logs'}).data || []
-    //   logs.unshift(Date.now())
-    //   mpvue.setStorageSync({
-    //     key: 'logs',
-    //     data: logs
-    //   })
-    // } else {
-    //   logs = mpvue.getStorageSync('logs') || []
-    //   logs.unshift(Date.now())
-    //   mpvue.setStorageSync('logs', logs)
-    // }
   },
   log() {
     console.log(`log at:${Date.now()}`)
@@ -105,8 +65,8 @@ export default {
   -moz-transition: width 2s;
   -webkit-transition: width 2s;
   -o-transition: width 2s;
-  margin: 0px;
-  padding: 0px;
-  font-family: MicrosoftYaHei-Bold;
+  margin: 0;
+  padding: 0;
+  font-family: MicrosoftYaHei-Bold,serif;
 }
 </style>

+ 2 - 1
src/app.json

@@ -22,5 +22,6 @@
     "navigationBarBackgroundColor": "#4B3AB0",
     "navigationBarTitleText": "水母星球",
     "navigationBarTextStyle": "white"
-  }
+  },
+  "lazyCodeLoading": "requiredComponents"
 }

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

@@ -172,7 +172,7 @@ import util from "../../../utils";
 import game_store from "@/store/game";
 import Toast from "../../../../static/vant/toast/toast";
 import {gameAddLine, gameEnd} from "../../../requests/game";
-import mpvueEcharts from "mpvue-echarts";
+// import mpvueEcharts from "mpvue-echarts";
 import echarts from "../../../../static/echarts.min";
 import {LogInDb} from "@/requests/log";
 import WechatLog from '@/utils/wechat_log'
@@ -211,9 +211,9 @@ function initMedChart(canvas, width, height) {
 var $timeout;
 export default {
   name: "StartGames",
-  components: {
-    mpvueEcharts,
-  },
+  // components: {
+  //   mpvueEcharts,
+  // },
   data() {
     return {
       // 折线图

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

@@ -53,9 +53,9 @@ export default {
     }
   },
   onLoad() {
-    // if (process.env.NODE_ENV == "development") {
-    //   wx.setStorageSync('token', "WxN3rgbWyVpjyBhi4uT6mZmwajZ3dFlm");
-    // }
+    if (process.env.NODE_ENV == "development") {
+      wx.setStorageSync('token', "WxN3rgbWyVpjyBhi4uT6mZmwajZ3dFlm");
+    }
     //  判断存储是否登录
     let $token = wx.getStorageSync("token");
     if ($token) {

+ 1 - 1
src/pages/user/edit/confirm_phone_first/index.vue

@@ -101,7 +101,7 @@ export default {
       userCheckCode($params).then((res) => {
         Toast.clear()
         let $data = res.data
-        if ($data.code == 0) {
+        if ($data.code === 0) {
           Toast.success({
             message: $data.errmsg,
             onClose() {

+ 1 - 1
src/pages/user/edit/index.vue

@@ -60,7 +60,7 @@
 </template>
 
 <script>
-import {userChangeBirthday, userChangeSex, userDetail} from "../../../requests/user";
+import {userChangeBirthday, userChangeSex} from "../../../requests/user";
 import Toast from "../../../../static/vant/toast/toast";
 import {formatBirthday} from '../../../utils/index'
 import {reload_userinfo} from "../../../utils/user";

+ 0 - 235
static/vant/area/index.js

@@ -1,235 +0,0 @@
-import { VantComponent } from '../common/component';
-import { pickerProps } from '../picker/shared';
-import { requestAnimationFrame } from '../common/utils';
-const EMPTY_CODE = '000000';
-VantComponent({
-  classes: ['active-class', 'toolbar-class', 'column-class'],
-  props: Object.assign(Object.assign({}, pickerProps), {
-    value: {
-      type: String,
-      observer(value) {
-        this.code = value;
-        this.setValues();
-      },
-    },
-    areaList: {
-      type: Object,
-      value: {},
-      observer: 'setValues',
-    },
-    columnsNum: {
-      type: null,
-      value: 3,
-    },
-    columnsPlaceholder: {
-      type: Array,
-      observer(val) {
-        this.setData({
-          typeToColumnsPlaceholder: {
-            province: val[0] || '',
-            city: val[1] || '',
-            county: val[2] || '',
-          },
-        });
-      },
-    },
-  }),
-  data: {
-    columns: [{ values: [] }, { values: [] }, { values: [] }],
-    typeToColumnsPlaceholder: {},
-  },
-  mounted() {
-    requestAnimationFrame(() => {
-      this.setValues();
-    });
-  },
-  methods: {
-    getPicker() {
-      if (this.picker == null) {
-        this.picker = this.selectComponent('.van-area__picker');
-      }
-      return this.picker;
-    },
-    onCancel(event) {
-      this.emit('cancel', event.detail);
-    },
-    onConfirm(event) {
-      const { index } = event.detail;
-      let { value } = event.detail;
-      value = this.parseValues(value);
-      this.emit('confirm', { value, index });
-    },
-    emit(type, detail) {
-      detail.values = detail.value;
-      delete detail.value;
-      this.$emit(type, detail);
-    },
-    parseValues(values) {
-      const { columnsPlaceholder } = this.data;
-      return values.map((value, index) => {
-        if (
-          value &&
-          (!value.code || value.name === columnsPlaceholder[index])
-        ) {
-          return Object.assign(Object.assign({}, value), {
-            code: '',
-            name: '',
-          });
-        }
-        return value;
-      });
-    },
-    onChange(event) {
-      var _a;
-      const { index, picker, value } = event.detail;
-      this.code = value[index].code;
-      (_a = this.setValues()) === null || _a === void 0
-        ? void 0
-        : _a.then(() => {
-            this.$emit('change', {
-              picker,
-              values: this.parseValues(picker.getValues()),
-              index,
-            });
-          });
-    },
-    getConfig(type) {
-      const { areaList } = this.data;
-      return (areaList && areaList[`${type}_list`]) || {};
-    },
-    getList(type, code) {
-      if (type !== 'province' && !code) {
-        return [];
-      }
-      const { typeToColumnsPlaceholder } = this.data;
-      const list = this.getConfig(type);
-      let result = Object.keys(list).map((code) => ({
-        code,
-        name: list[code],
-      }));
-      if (code != null) {
-        // oversea code
-        if (code[0] === '9' && type === 'city') {
-          code = '9';
-        }
-        result = result.filter((item) => item.code.indexOf(code) === 0);
-      }
-      if (typeToColumnsPlaceholder[type] && result.length) {
-        // set columns placeholder
-        const codeFill =
-          type === 'province'
-            ? ''
-            : type === 'city'
-            ? EMPTY_CODE.slice(2, 4)
-            : EMPTY_CODE.slice(4, 6);
-        result.unshift({
-          code: `${code}${codeFill}`,
-          name: typeToColumnsPlaceholder[type],
-        });
-      }
-      return result;
-    },
-    getIndex(type, code) {
-      let compareNum = type === 'province' ? 2 : type === 'city' ? 4 : 6;
-      const list = this.getList(type, code.slice(0, compareNum - 2));
-      // oversea code
-      if (code[0] === '9' && type === 'province') {
-        compareNum = 1;
-      }
-      code = code.slice(0, compareNum);
-      for (let i = 0; i < list.length; i++) {
-        if (list[i].code.slice(0, compareNum) === code) {
-          return i;
-        }
-      }
-      return 0;
-    },
-    setValues() {
-      const picker = this.getPicker();
-      if (!picker) {
-        return;
-      }
-      let code = this.code || this.getDefaultCode();
-      const provinceList = this.getList('province');
-      const cityList = this.getList('city', code.slice(0, 2));
-      const stack = [];
-      const indexes = [];
-      const { columnsNum } = this.data;
-      if (columnsNum >= 1) {
-        stack.push(picker.setColumnValues(0, provinceList, false));
-        indexes.push(this.getIndex('province', code));
-      }
-      if (columnsNum >= 2) {
-        stack.push(picker.setColumnValues(1, cityList, false));
-        indexes.push(this.getIndex('city', code));
-        if (cityList.length && code.slice(2, 4) === '00') {
-          [{ code }] = cityList;
-        }
-      }
-      if (columnsNum === 3) {
-        stack.push(
-          picker.setColumnValues(
-            2,
-            this.getList('county', code.slice(0, 4)),
-            false
-          )
-        );
-        indexes.push(this.getIndex('county', code));
-      }
-      return Promise.all(stack)
-        .catch(() => {})
-        .then(() => picker.setIndexes(indexes))
-        .catch(() => {});
-    },
-    getDefaultCode() {
-      const { columnsPlaceholder } = this.data;
-      if (columnsPlaceholder.length) {
-        return EMPTY_CODE;
-      }
-      const countyCodes = Object.keys(this.getConfig('county'));
-      if (countyCodes[0]) {
-        return countyCodes[0];
-      }
-      const cityCodes = Object.keys(this.getConfig('city'));
-      if (cityCodes[0]) {
-        return cityCodes[0];
-      }
-      return '';
-    },
-    getValues() {
-      const picker = this.getPicker();
-      if (!picker) {
-        return [];
-      }
-      return this.parseValues(picker.getValues().filter((value) => !!value));
-    },
-    getDetail() {
-      const values = this.getValues();
-      const area = {
-        code: '',
-        country: '',
-        province: '',
-        city: '',
-        county: '',
-      };
-      if (!values.length) {
-        return area;
-      }
-      const names = values.map((item) => item.name);
-      area.code = values[values.length - 1].code;
-      if (area.code[0] === '9') {
-        area.country = names[1] || '';
-        area.province = names[2] || '';
-      } else {
-        area.province = names[0] || '';
-        area.city = names[1] || '';
-        area.county = names[2] || '';
-      }
-      return area;
-    },
-    reset(code) {
-      this.code = code || '';
-      return this.setValues();
-    },
-  },
-});

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

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

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

@@ -1,20 +0,0 @@
-<wxs src="./index.wxs" module="computed" />
-
-<van-picker
-  class="van-area__picker"
-  active-class="active-class"
-  toolbar-class="toolbar-class"
-  column-class="column-class"
-  show-toolbar
-  value-key="name"
-  title="{{ title }}"
-  loading="{{ loading }}"
-  columns="{{ computed.displayColumns(columns, columnsNum) }}"
-  item-height="{{ itemHeight }}"
-  visible-item-count="{{ visibleItemCount }}"
-  cancel-button-text="{{ cancelButtonText }}"
-  confirm-button-text="{{ confirmButtonText }}"
-  bind:change="onChange"
-  bind:confirm="onConfirm"
-  bind:cancel="onCancel"
-/>

+ 0 - 8
static/vant/area/index.wxs

@@ -1,8 +0,0 @@
-/* eslint-disable */
-function displayColumns(columns, columnsNum) {
-  return columns.slice(0, +columnsNum);
-}
-
-module.exports = {
-  displayColumns: displayColumns,
-};

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

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

+ 0 - 67
static/vant/calendar/calendar.wxml

@@ -1,67 +0,0 @@
-<view class="van-calendar">
-  <header
-    title="{{ title }}"
-    showTitle="{{ showTitle }}"
-    subtitle="{{ subtitle }}"
-    showSubtitle="{{ showSubtitle }}"
-    firstDayOfWeek="{{ firstDayOfWeek }}"
-  >
-    <slot name="title" slot="title"></slot>
-  </header>
-
-  <scroll-view
-    class="van-calendar__body"
-    scroll-y
-    scroll-into-view="{{ scrollIntoView }}"
-  >
-    <month
-      wx:for="{{ computed.getMonths(minDate, maxDate) }}"
-      wx:key="index"
-      id="month{{ index }}"
-      class="month"
-      data-date="{{ item }}"
-      date="{{ item }}"
-      type="{{ type }}"
-      color="{{ color }}"
-      minDate="{{ minDate }}"
-      maxDate="{{ maxDate }}"
-      showMark="{{ showMark }}"
-      formatter="{{ formatter }}"
-      rowHeight="{{ rowHeight }}"
-      currentDate="{{ currentDate }}"
-      showSubtitle="{{ showSubtitle }}"
-      allowSameDay="{{ allowSameDay }}"
-      showMonthTitle="{{ index !== 0 || !showSubtitle }}"
-      firstDayOfWeek="{{ firstDayOfWeek }}"
-      bind:click="onClickDay"
-    />
-  </scroll-view>
-
-  <view
-    class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
-  >
-    <slot name="footer"></slot>
-  </view>
-
-  <view
-    class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
-  >
-    <van-button
-      wx:if="{{ showConfirm }}"
-      round
-      block
-      type="danger"
-      color="{{ color }}"
-      custom-class="van-calendar__confirm"
-      disabled="{{ computed.getButtonDisabled(type, currentDate) }}"
-      nativeType="text"
-      bind:click="onConfirm"
-    >
-      {{
-        computed.getButtonDisabled(type, currentDate)
-          ? confirmDisabledText
-          : confirmText
-      }}
-    </van-button>
-  </view>
-</view>

+ 0 - 1
static/vant/calendar/components/header/index.d.ts

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

+ 0 - 34
static/vant/calendar/components/header/index.js

@@ -1,34 +0,0 @@
-import { VantComponent } from '../../../common/component';
-VantComponent({
-  props: {
-    title: {
-      type: String,
-      value: '日期选择',
-    },
-    subtitle: String,
-    showTitle: Boolean,
-    showSubtitle: Boolean,
-    firstDayOfWeek: {
-      type: Number,
-      observer: 'initWeekDay',
-    },
-  },
-  data: {
-    weekdays: [],
-  },
-  created() {
-    this.initWeekDay();
-  },
-  methods: {
-    initWeekDay() {
-      const defaultWeeks = ['日', '一', '二', '三', '四', '五', '六'];
-      const firstDayOfWeek = this.data.firstDayOfWeek || 0;
-      this.setData({
-        weekdays: [
-          ...defaultWeeks.slice(firstDayOfWeek, 7),
-          ...defaultWeeks.slice(0, firstDayOfWeek),
-        ],
-      });
-    },
-  },
-});

+ 0 - 3
static/vant/calendar/components/header/index.json

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

+ 0 - 16
static/vant/calendar/components/header/index.wxml

@@ -1,16 +0,0 @@
-<view class="van-calendar__header">
-  <block wx:if="{{ showTitle }}">
-    <view class="van-calendar__header-title"><slot name="title"></slot></view>
-    <view class="van-calendar__header-title">{{ title }}</view>
-  </block>
-
-  <view wx:if="{{ showSubtitle }}" class="van-calendar__header-subtitle">
-    {{ subtitle }}
-  </view>
-
-  <view class="van-calendar__weekdays">
-    <view wx:for="{{ weekdays }}" wx:key="index" class="van-calendar__weekday">
-      {{ item }}
-    </view>
-  </view>
-</view>

+ 0 - 1
static/vant/calendar/components/header/index.wxss

@@ -1 +0,0 @@
-@import '../../../common/index.wxss';.van-calendar__header{-webkit-flex-shrink:0;flex-shrink:0;box-shadow:0 2px 10px rgba(125,126,128,.16);box-shadow:var(--calendar-header-box-shadow,0 2px 10px rgba(125,126,128,.16))}.van-calendar__header-subtitle,.van-calendar__header-title{text-align:center;height:44px;height:var(--calendar-header-title-height,44px);font-weight:500;font-weight:var(--font-weight-bold,500);line-height:44px;line-height:var(--calendar-header-title-height,44px)}.van-calendar__header-title+.van-calendar__header-title,.van-calendar__header-title:empty{display:none}.van-calendar__header-title:empty+.van-calendar__header-title{display:block!important}.van-calendar__weekdays{display:-webkit-flex;display:flex}.van-calendar__weekday{-webkit-flex:1;flex:1;text-align:center;font-size:12px;font-size:var(--calendar-weekdays-font-size,12px);line-height:30px;line-height:var(--calendar-weekdays-height,30px)}

+ 0 - 1
static/vant/calendar/components/month/index.d.ts

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

+ 0 - 163
static/vant/calendar/components/month/index.js

@@ -1,163 +0,0 @@
-import { VantComponent } from '../../../common/component';
-import {
-  getMonthEndDay,
-  compareDay,
-  getPrevDay,
-  getNextDay,
-} from '../../utils';
-VantComponent({
-  props: {
-    date: {
-      type: null,
-      observer: 'setDays',
-    },
-    type: {
-      type: String,
-      observer: 'setDays',
-    },
-    color: String,
-    minDate: {
-      type: null,
-      observer: 'setDays',
-    },
-    maxDate: {
-      type: null,
-      observer: 'setDays',
-    },
-    showMark: Boolean,
-    rowHeight: null,
-    formatter: {
-      type: null,
-      observer: 'setDays',
-    },
-    currentDate: {
-      type: null,
-      observer: 'setDays',
-    },
-    firstDayOfWeek: {
-      type: Number,
-      observer: 'setDays',
-    },
-    allowSameDay: Boolean,
-    showSubtitle: Boolean,
-    showMonthTitle: Boolean,
-  },
-  data: {
-    visible: true,
-    days: [],
-  },
-  methods: {
-    onClick(event) {
-      const { index } = event.currentTarget.dataset;
-      const item = this.data.days[index];
-      if (item.type !== 'disabled') {
-        this.$emit('click', item);
-      }
-    },
-    setDays() {
-      const days = [];
-      const startDate = new Date(this.data.date);
-      const year = startDate.getFullYear();
-      const month = startDate.getMonth();
-      const totalDay = getMonthEndDay(
-        startDate.getFullYear(),
-        startDate.getMonth() + 1
-      );
-      for (let day = 1; day <= totalDay; day++) {
-        const date = new Date(year, month, day);
-        const type = this.getDayType(date);
-        let config = {
-          date,
-          type,
-          text: day,
-          bottomInfo: this.getBottomInfo(type),
-        };
-        if (this.data.formatter) {
-          config = this.data.formatter(config);
-        }
-        days.push(config);
-      }
-      this.setData({ days });
-    },
-    getMultipleDayType(day) {
-      const { currentDate } = this.data;
-      if (!Array.isArray(currentDate)) {
-        return '';
-      }
-      const isSelected = (date) =>
-        currentDate.some((item) => compareDay(item, date) === 0);
-      if (isSelected(day)) {
-        const prevDay = getPrevDay(day);
-        const nextDay = getNextDay(day);
-        const prevSelected = isSelected(prevDay);
-        const nextSelected = isSelected(nextDay);
-        if (prevSelected && nextSelected) {
-          return 'multiple-middle';
-        }
-        if (prevSelected) {
-          return 'end';
-        }
-        return nextSelected ? 'start' : 'multiple-selected';
-      }
-      return '';
-    },
-    getRangeDayType(day) {
-      const { currentDate, allowSameDay } = this.data;
-      if (!Array.isArray(currentDate)) {
-        return '';
-      }
-      const [startDay, endDay] = currentDate;
-      if (!startDay) {
-        return '';
-      }
-      const compareToStart = compareDay(day, startDay);
-      if (!endDay) {
-        return compareToStart === 0 ? 'start' : '';
-      }
-      const compareToEnd = compareDay(day, endDay);
-      if (compareToStart === 0 && compareToEnd === 0 && allowSameDay) {
-        return 'start-end';
-      }
-      if (compareToStart === 0) {
-        return 'start';
-      }
-      if (compareToEnd === 0) {
-        return 'end';
-      }
-      if (compareToStart > 0 && compareToEnd < 0) {
-        return 'middle';
-      }
-      return '';
-    },
-    getDayType(day) {
-      const { type, minDate, maxDate, currentDate } = this.data;
-      if (compareDay(day, minDate) < 0 || compareDay(day, maxDate) > 0) {
-        return 'disabled';
-      }
-      if (type === 'single') {
-        return compareDay(day, currentDate) === 0 ? 'selected' : '';
-      }
-      if (type === 'multiple') {
-        return this.getMultipleDayType(day);
-      }
-      /* istanbul ignore else */
-      if (type === 'range') {
-        return this.getRangeDayType(day);
-      }
-      return '';
-    },
-    getBottomInfo(type) {
-      if (this.data.type === 'range') {
-        if (type === 'start') {
-          return '开始';
-        }
-        if (type === 'end') {
-          return '结束';
-        }
-        if (type === 'start-end') {
-          return '开始/结束';
-        }
-      }
-    },
-  },
-});

+ 0 - 3
static/vant/calendar/components/month/index.json

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

+ 0 - 39
static/vant/calendar/components/month/index.wxml

@@ -1,39 +0,0 @@
-<wxs src="./index.wxs" module="computed"></wxs>
-<wxs src="../../../wxs/utils.wxs" module="utils" />
-
-<view class="van-calendar__month" style="{{ computed.getMonthStyle(visible, date, rowHeight) }}">
-  <view wx:if="{{ showMonthTitle }}" class="van-calendar__month-title">
-    {{ computed.formatMonthTitle(date) }}
-  </view>
-
-  <view wx:if="{{ visible }}" class="van-calendar__days">
-    <view wx:if="{{ showMark }}" class="van-calendar__month-mark">
-      {{ computed.getMark(date) }}
-    </view>
-
-    <view
-      wx:for="{{ days }}"
-      wx:key="index"
-      style="{{ computed.getDayStyle(item.type, index, date, rowHeight, color, firstDayOfWeek) }}"
-      class="{{ utils.bem('calendar__day', [item.type]) }} {{ item.className }}"
-      data-index="{{ index }}"
-      bindtap="onClick"
-    >
-      <view wx:if="{{ item.type === 'selected' }}" class="van-calendar__selected-day" style="background: {{ color }}">
-        <view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
-        {{ item.text }}
-        <view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
-          {{ item.bottomInfo }}
-        </view>
-      </view>
-
-      <view wx:else>
-        <view wx:if="{{ item.topInfo }}" class="van-calendar__top-info">{{ item.topInfo }}</view>
-        {{ item.text }}
-        <view wx:if="{{ item.bottomInfo }}" class="van-calendar__bottom-info">
-          {{ item.bottomInfo }}
-        </view>
-      </view>
-    </view>
-  </view>
-</view>

+ 0 - 71
static/vant/calendar/components/month/index.wxs

@@ -1,71 +0,0 @@
-/* eslint-disable */
-var utils = require('../../utils.wxs');
-
-function getMark(date) {
-  return getDate(date).getMonth() + 1;
-}
-
-var ROW_HEIGHT = 64;
-
-function getDayStyle(type, index, date, rowHeight, color, firstDayOfWeek) {
-  var style = [];
-  var current = getDate(date).getDay() || 7;
-  var offset = current < firstDayOfWeek ? (7 - firstDayOfWeek + current) :
-               current === 7 && firstDayOfWeek === 0 ? 0 :
-               (current - firstDayOfWeek);
-
-  if (index === 0) {
-    style.push(['margin-left', (100 * offset) / 7 + '%']);
-  }
-
-  if (rowHeight !== ROW_HEIGHT) {
-    style.push(['height', rowHeight + 'px']);
-  }
-
-  if (color) {
-    if (
-      type === 'start' ||
-      type === 'end' ||
-      type === 'start-end' ||
-      type === 'multiple-selected' ||
-      type === 'multiple-middle'
-    ) {
-      style.push(['background', color]);
-    } else if (type === 'middle') {
-      style.push(['color', color]);
-    }
-  }
-
-  return style
-    .map(function(item) {
-      return item.join(':');
-    })
-    .join(';');
-}
-
-function formatMonthTitle(date) {
-  date = getDate(date);
-  return date.getFullYear() + '年' + (date.getMonth() + 1) + '月';
-}
-
-function getMonthStyle(visible, date, rowHeight) {
-  if (!visible) {
-    date = getDate(date);
-
-    var totalDay = utils.getMonthEndDay(
-      date.getFullYear(),
-      date.getMonth() + 1
-    );
-    var offset = getDate(date).getDay();
-    var padding = Math.ceil((totalDay + offset) / 7) * rowHeight;
-
-    return 'padding-bottom:' + padding + 'px';
-  }
-}
-
-module.exports = {
-  getMark: getMark,
-  getDayStyle: getDayStyle,
-  formatMonthTitle: formatMonthTitle,
-  getMonthStyle: getMonthStyle
-};

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
static/vant/calendar/components/month/index.wxss


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

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

+ 0 - 343
static/vant/calendar/index.js

@@ -1,343 +0,0 @@
-import { VantComponent } from '../common/component';
-import {
-  ROW_HEIGHT,
-  getPrevDay,
-  getNextDay,
-  getToday,
-  compareDay,
-  copyDates,
-  calcDateNum,
-  formatMonthTitle,
-  compareMonth,
-  getMonths,
-  getDayByOffset,
-} from './utils';
-import Toast from '../toast/toast';
-import { requestAnimationFrame } from '../common/utils';
-const initialMinDate = getToday().getTime();
-const initialMaxDate = (() => {
-  const now = getToday();
-  return new Date(
-    now.getFullYear(),
-    now.getMonth() + 6,
-    now.getDate()
-  ).getTime();
-})();
-VantComponent({
-  props: {
-    title: {
-      type: String,
-      value: '日期选择',
-    },
-    color: String,
-    show: {
-      type: Boolean,
-      observer(val) {
-        if (val) {
-          this.initRect();
-          this.scrollIntoView();
-        }
-      },
-    },
-    formatter: null,
-    confirmText: {
-      type: String,
-      value: '确定',
-    },
-    rangePrompt: String,
-    showRangePrompt: {
-      type: Boolean,
-      value: true,
-    },
-    defaultDate: {
-      type: null,
-      observer(val) {
-        this.setData({ currentDate: val });
-        this.scrollIntoView();
-      },
-    },
-    allowSameDay: Boolean,
-    confirmDisabledText: String,
-    type: {
-      type: String,
-      value: 'single',
-      observer: 'reset',
-    },
-    minDate: {
-      type: null,
-      value: initialMinDate,
-    },
-    maxDate: {
-      type: null,
-      value: initialMaxDate,
-    },
-    position: {
-      type: String,
-      value: 'bottom',
-    },
-    rowHeight: {
-      type: null,
-      value: ROW_HEIGHT,
-    },
-    round: {
-      type: Boolean,
-      value: true,
-    },
-    poppable: {
-      type: Boolean,
-      value: true,
-    },
-    showMark: {
-      type: Boolean,
-      value: true,
-    },
-    showTitle: {
-      type: Boolean,
-      value: true,
-    },
-    showConfirm: {
-      type: Boolean,
-      value: true,
-    },
-    showSubtitle: {
-      type: Boolean,
-      value: true,
-    },
-    safeAreaInsetBottom: {
-      type: Boolean,
-      value: true,
-    },
-    closeOnClickOverlay: {
-      type: Boolean,
-      value: true,
-    },
-    maxRange: {
-      type: null,
-      value: null,
-    },
-    firstDayOfWeek: {
-      type: Number,
-      value: 0,
-    },
-  },
-  data: {
-    subtitle: '',
-    currentDate: null,
-    scrollIntoView: '',
-  },
-  created() {
-    this.setData({
-      currentDate: this.getInitialDate(),
-    });
-  },
-  mounted() {
-    if (this.data.show || !this.data.poppable) {
-      this.initRect();
-      this.scrollIntoView();
-    }
-  },
-  methods: {
-    reset() {
-      this.setData({ currentDate: this.getInitialDate() });
-      this.scrollIntoView();
-    },
-    initRect() {
-      if (this.contentObserver != null) {
-        this.contentObserver.disconnect();
-      }
-      const contentObserver = this.createIntersectionObserver({
-        thresholds: [0, 0.1, 0.9, 1],
-        observeAll: true,
-      });
-      this.contentObserver = contentObserver;
-      contentObserver.relativeTo('.van-calendar__body');
-      contentObserver.observe('.month', (res) => {
-        if (res.boundingClientRect.top <= res.relativeRect.top) {
-          // @ts-ignore
-          this.setData({ subtitle: formatMonthTitle(res.dataset.date) });
-        }
-      });
-    },
-    limitDateRange(date, minDate = null, maxDate = null) {
-      minDate = minDate || this.data.minDate;
-      maxDate = maxDate || this.data.maxDate;
-      if (compareDay(date, minDate) === -1) {
-        return minDate;
-      }
-      if (compareDay(date, maxDate) === 1) {
-        return maxDate;
-      }
-      return date;
-    },
-    getInitialDate(defaultDate = null) {
-      const { type, minDate, maxDate } = this.data;
-      const now = getToday().getTime();
-      if (type === 'range') {
-        if (!Array.isArray(defaultDate)) {
-          defaultDate = [];
-        }
-        const [startDay, endDay] = defaultDate || [];
-        const start = this.limitDateRange(
-          startDay || now,
-          minDate,
-          getPrevDay(maxDate).getTime()
-        );
-        const end = this.limitDateRange(
-          endDay || now,
-          getNextDay(minDate).getTime()
-        );
-        return [start, end];
-      }
-      if (type === 'multiple') {
-        if (Array.isArray(defaultDate)) {
-          return defaultDate.map((date) => this.limitDateRange(date));
-        }
-        return [this.limitDateRange(now)];
-      }
-      if (!defaultDate || Array.isArray(defaultDate)) {
-        defaultDate = now;
-      }
-      return this.limitDateRange(defaultDate);
-    },
-    scrollIntoView() {
-      requestAnimationFrame(() => {
-        const {
-          currentDate,
-          type,
-          show,
-          poppable,
-          minDate,
-          maxDate,
-        } = this.data;
-        // @ts-ignore
-        const targetDate = type === 'single' ? currentDate : currentDate[0];
-        const displayed = show || !poppable;
-        if (!targetDate || !displayed) {
-          return;
-        }
-        const months = getMonths(minDate, maxDate);
-        months.some((month, index) => {
-          if (compareMonth(month, targetDate) === 0) {
-            this.setData({ scrollIntoView: `month${index}` });
-            return true;
-          }
-          return false;
-        });
-      });
-    },
-    onOpen() {
-      this.$emit('open');
-    },
-    onOpened() {
-      this.$emit('opened');
-    },
-    onClose() {
-      this.$emit('close');
-    },
-    onClosed() {
-      this.$emit('closed');
-    },
-    onClickDay(event) {
-      const { date } = event.detail;
-      const { type, currentDate, allowSameDay } = this.data;
-      if (type === 'range') {
-        // @ts-ignore
-        const [startDay, endDay] = currentDate;
-        if (startDay && !endDay) {
-          const compareToStart = compareDay(date, startDay);
-          if (compareToStart === 1) {
-            this.select([startDay, date], true);
-          } else if (compareToStart === -1) {
-            this.select([date, null]);
-          } else if (allowSameDay) {
-            this.select([date, date]);
-          }
-        } else {
-          this.select([date, null]);
-        }
-      } else if (type === 'multiple') {
-        let selectedIndex;
-        // @ts-ignore
-        const selected = currentDate.some((dateItem, index) => {
-          const equal = compareDay(dateItem, date) === 0;
-          if (equal) {
-            selectedIndex = index;
-          }
-          return equal;
-        });
-        if (selected) {
-          // @ts-ignore
-          const cancelDate = currentDate.splice(selectedIndex, 1);
-          this.setData({ currentDate });
-          this.unselect(cancelDate);
-        } else {
-          // @ts-ignore
-          this.select([...currentDate, date]);
-        }
-      } else {
-        this.select(date, true);
-      }
-    },
-    unselect(dateArray) {
-      const date = dateArray[0];
-      if (date) {
-        this.$emit('unselect', copyDates(date));
-      }
-    },
-    select(date, complete) {
-      if (complete && this.data.type === 'range') {
-        const valid = this.checkRange(date);
-        if (!valid) {
-          // auto selected to max range if showConfirm
-          if (this.data.showConfirm) {
-            this.emit([
-              date[0],
-              getDayByOffset(date[0], this.data.maxRange - 1),
-            ]);
-          } else {
-            this.emit(date);
-          }
-          return;
-        }
-      }
-      this.emit(date);
-      if (complete && !this.data.showConfirm) {
-        this.onConfirm();
-      }
-    },
-    emit(date) {
-      const getTime = (date) => (date instanceof Date ? date.getTime() : date);
-      this.setData({
-        currentDate: Array.isArray(date) ? date.map(getTime) : getTime(date),
-      });
-      this.$emit('select', copyDates(date));
-    },
-    checkRange(date) {
-      const { maxRange, rangePrompt, showRangePrompt } = this.data;
-      if (maxRange && calcDateNum(date) > maxRange) {
-        if (showRangePrompt) {
-          Toast({
-            duration: 0,
-            context: this,
-            message: rangePrompt || `选择天数不能超过 ${maxRange} 天`,
-          });
-        }
-        this.$emit('over-range');
-        return false;
-      }
-      return true;
-    },
-    onConfirm() {
-      if (
-        this.data.type === 'range' &&
-        !this.checkRange(this.data.currentDate)
-      ) {
-        return;
-      }
-      wx.nextTick(() => {
-        // @ts-ignore
-        this.$emit('confirm', copyDates(this.data.currentDate));
-      });
-    },
-  },
-});

+ 0 - 10
static/vant/calendar/index.json

@@ -1,10 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "header": "./components/header/index",
-    "month": "./components/month/index",
-    "van-button": "../button/index",
-    "van-popup": "../popup/index",
-    "van-toast": "../toast/index"
-  }
-}

+ 0 - 25
static/vant/calendar/index.wxml

@@ -1,25 +0,0 @@
-<wxs src="./index.wxs" module="computed" />
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<import src="./calendar.wxml" />
-
-<van-popup
-  wx:if="{{ poppable }}"
-  custom-class="van-calendar__popup--{{ position }}"
-  close-icon-class="van-calendar__close-icon"
-  show="{{ show }}"
-  round="{{ round }}"
-  position="{{ position }}"
-  closeable="{{ showTitle || showSubtitle }}"
-  close-on-click-overlay="{{ closeOnClickOverlay }}"
-  bind:enter="onOpen"
-  bind:close="onClose"
-  bind:after-enter="onOpened"
-  bind:after-leave="onClosed"
->
-  <include src="calendar.wxml" />
-</van-popup>
-
-<include wx:else src="calendar.wxml" />
-
-<van-toast id="van-toast" />

+ 0 - 37
static/vant/calendar/index.wxs

@@ -1,37 +0,0 @@
-/* eslint-disable */
-var utils = require('./utils.wxs');
-
-function getMonths(minDate, maxDate) {
-  var months = [];
-  var cursor = getDate(minDate);
-
-  cursor.setDate(1);
-
-  do {
-    months.push(cursor.getTime());
-    cursor.setMonth(cursor.getMonth() + 1);
-  } while (utils.compareMonth(cursor, getDate(maxDate)) !== 1);
-
-  return months;
-}
-
-function getButtonDisabled(type, currentDate) {
-  if (currentDate == null) {
-    return true;
-  }
-
-  if (type === 'range') {
-    return !currentDate[0] || !currentDate[1];
-  }
-
-  if (type === 'multiple') {
-    return !currentDate.length;
-  }
-
-  return !currentDate;
-}
-
-module.exports = {
-  getMonths: getMonths,
-  getButtonDisabled: getButtonDisabled
-};

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

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-calendar{display:-webkit-flex;display:flex;-webkit-flex-direction:column;flex-direction:column;height:100%;height:var(--calendar-height,100%);background-color:#fff;background-color:var(--calendar-background-color,#fff)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:80%;height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-flex:1;flex:1;overflow:auto;-webkit-overflow-scrolling:touch}.van-calendar__footer{-webkit-flex-shrink:0;flex-shrink:0;padding:0 16px;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:36px!important;height:var(--calendar-confirm-button-height,36px)!important;margin:7px 0!important;margin:var(--calendar-confirm-button-margin,7px 0)!important;line-height:34px!important;line-height:var(--calendar-confirm-button-line-height,34px)!important}

+ 0 - 18
static/vant/calendar/utils.d.ts

@@ -1,18 +0,0 @@
-export declare const ROW_HEIGHT = 64;
-export declare function formatMonthTitle(date: Date): string;
-export declare function compareMonth(
-  date1: Date | number,
-  date2: Date | number
-): 1 | -1 | 0;
-export declare function compareDay(
-  day1: Date | number,
-  day2: Date | number
-): 1 | -1 | 0;
-export declare function getDayByOffset(date: Date, offset: number): Date;
-export declare function getPrevDay(date: Date): Date;
-export declare function getNextDay(date: Date): Date;
-export declare function getToday(): Date;
-export declare function calcDateNum(date: [Date, Date]): number;
-export declare function copyDates(dates: Date | Date[]): Date | Date[];
-export declare function getMonthEndDay(year: number, month: number): number;
-export declare function getMonths(minDate: number, maxDate: number): number[];

+ 0 - 83
static/vant/calendar/utils.js

@@ -1,83 +0,0 @@
-export const ROW_HEIGHT = 64;
-export function formatMonthTitle(date) {
-  if (!(date instanceof Date)) {
-    date = new Date(date);
-  }
-  return `${date.getFullYear()}年${date.getMonth() + 1}月`;
-}
-export function compareMonth(date1, date2) {
-  if (!(date1 instanceof Date)) {
-    date1 = new Date(date1);
-  }
-  if (!(date2 instanceof Date)) {
-    date2 = new Date(date2);
-  }
-  const year1 = date1.getFullYear();
-  const year2 = date2.getFullYear();
-  const month1 = date1.getMonth();
-  const month2 = date2.getMonth();
-  if (year1 === year2) {
-    return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
-  }
-  return year1 > year2 ? 1 : -1;
-}
-export function compareDay(day1, day2) {
-  if (!(day1 instanceof Date)) {
-    day1 = new Date(day1);
-  }
-  if (!(day2 instanceof Date)) {
-    day2 = new Date(day2);
-  }
-  const compareMonthResult = compareMonth(day1, day2);
-  if (compareMonthResult === 0) {
-    const date1 = day1.getDate();
-    const date2 = day2.getDate();
-    return date1 === date2 ? 0 : date1 > date2 ? 1 : -1;
-  }
-  return compareMonthResult;
-}
-export function getDayByOffset(date, offset) {
-  date = new Date(date);
-  date.setDate(date.getDate() + offset);
-  return date;
-}
-export function getPrevDay(date) {
-  return getDayByOffset(date, -1);
-}
-export function getNextDay(date) {
-  return getDayByOffset(date, 1);
-}
-export function getToday() {
-  const today = new Date();
-  today.setHours(0, 0, 0, 0);
-  return today;
-}
-export function calcDateNum(date) {
-  const day1 = new Date(date[0]).getTime();
-  const day2 = new Date(date[1]).getTime();
-  return (day2 - day1) / (1000 * 60 * 60 * 24) + 1;
-}
-export function copyDates(dates) {
-  if (Array.isArray(dates)) {
-    return dates.map((date) => {
-      if (date === null) {
-        return date;
-      }
-      return new Date(date);
-    });
-  }
-  return new Date(dates);
-}
-export function getMonthEndDay(year, month) {
-  return 32 - new Date(year, month - 1, 32).getDate();
-}
-export function getMonths(minDate, maxDate) {
-  const months = [];
-  const cursor = new Date(minDate);
-  cursor.setDate(1);
-  do {
-    months.push(cursor.getTime());
-    cursor.setMonth(cursor.getMonth() + 1);
-  } while (compareMonth(cursor, maxDate) !== 1);
-  return months;
-}

+ 0 - 25
static/vant/calendar/utils.wxs

@@ -1,25 +0,0 @@
-/* eslint-disable */
-function getMonthEndDay(year, month) {
-  return 32 -  getDate(year, month - 1, 32).getDate();
-}
-
-function compareMonth(date1, date2) {
-  date1 = getDate(date1);
-  date2 = getDate(date2);
-
-  var year1 = date1.getFullYear();
-  var year2 = date2.getFullYear();
-  var month1 = date1.getMonth();
-  var month2 = date2.getMonth();
-
-  if (year1 === year2) {
-    return month1 === month2 ? 0 : month1 > month2 ? 1 : -1;
-  }
-
-  return year1 > year2 ? 1 : -1;
-}
-
-module.exports = {
-  getMonthEndDay: getMonthEndDay,
-  compareMonth: compareMonth
-};

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

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

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

@@ -1,36 +0,0 @@
-import { useChildren } from '../common/relation';
-import { VantComponent } from '../common/component';
-VantComponent({
-  field: true,
-  relation: useChildren('checkbox', function (target) {
-    this.updateChild(target);
-  }),
-  props: {
-    max: Number,
-    value: {
-      type: Array,
-      observer: 'updateChildren',
-    },
-    disabled: {
-      type: Boolean,
-      observer: 'updateChildren',
-    },
-    direction: {
-      type: String,
-      value: 'vertical',
-    },
-  },
-  methods: {
-    updateChildren() {
-      this.children.forEach((child) => this.updateChild(child));
-    },
-    updateChild(child) {
-      const { value, disabled, direction } = this.data;
-      child.setData({
-        value: value.indexOf(child.data.name) !== -1,
-        parentDisabled: disabled,
-        direction,
-      });
-    },
-  },
-});

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

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

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

@@ -1,5 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="{{ utils.bem('checkbox-group', [{ horizontal: direction === 'horizontal' }]) }}">
-  <slot />
-</view>

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

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-checkbox-group--horizontal{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}

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

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

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

@@ -1,75 +0,0 @@
-import { useParent } from '../common/relation';
-import { VantComponent } from '../common/component';
-function emit(target, value) {
-  target.$emit('input', value);
-  target.$emit('change', value);
-}
-VantComponent({
-  field: true,
-  relation: useParent('checkbox-group'),
-  classes: ['icon-class', 'label-class'],
-  props: {
-    value: Boolean,
-    disabled: Boolean,
-    useIconSlot: Boolean,
-    checkedColor: String,
-    labelPosition: {
-      type: String,
-      value: 'right',
-    },
-    labelDisabled: Boolean,
-    shape: {
-      type: String,
-      value: 'round',
-    },
-    iconSize: {
-      type: null,
-      value: 20,
-    },
-  },
-  data: {
-    parentDisabled: false,
-    direction: 'vertical',
-  },
-  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 - 31
static/vant/checkbox/index.wxml

@@ -1,31 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-<wxs src="./index.wxs" module="computed" />
-
-<view class="{{ utils.bem('checkbox', [{ horizontal: direction === 'horizontal' }]) }} custom-class">
-  <view
-    wx:if="{{ labelPosition === 'left' }}"
-    class="label-class {{ utils.bem('checkbox__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
-    bindtap="onClickLabel"
-  >
-    <slot />
-  </view>
-  <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
-    wx:if="{{ labelPosition === 'right' }}"
-    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 style = require('../wxs/style.wxs');
-var addUnit = require('../wxs/add-unit.wxs');
-
-function iconStyle(checkedColor, value, disabled, parentDisabled, iconSize) {
-  var styles = {
-    'font-size': addUnit(iconSize),
-  };
-
-  if (checkedColor && value && !disabled && !parentDisabled) {
-    styles['border-color'] = checkedColor;
-    styles['background-color'] = checkedColor;
-  }
-
-  return style(styles);
-}
-
-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--horizontal{margin-right:12px}.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/config-provider/index.d.ts

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

+ 0 - 9
static/vant/config-provider/index.js

@@ -1,9 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-  props: {
-    themeVars: {
-      type: Object,
-      value: {},
-    },
-  },
-});

+ 0 - 3
static/vant/config-provider/index.json

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

+ 0 - 5
static/vant/config-provider/index.wxml

@@ -1,5 +0,0 @@
-<wxs src="./index.wxs" module="computed" />
-
-<view class="van-config-provider" style="{{ computed.mapThemeVarsToCSSVars(themeVars) }}">
-  <slot />
-</view>

+ 0 - 29
static/vant/config-provider/index.wxs

@@ -1,29 +0,0 @@
-/* eslint-disable */
-var object = require('../wxs/object.wxs');
-var style = require('../wxs/style.wxs');
-
-function kebabCase(word) {
-  var newWord = word
-    .replace(getRegExp("[A-Z]", 'g'), function (i) {
-      return '-' + i;
-    })
-    .toLowerCase()
-    .replace(getRegExp("^-"), '');
-
-  return newWord;
-}
-
-function mapThemeVarsToCSSVars(themeVars) {
-  var cssVars = {};
-  object.keys(themeVars).forEach(function (key) {
-    var cssVarsKey = '--' + kebabCase(key);
-    cssVars[cssVarsKey] = themeVars[key];
-  });
-
-  return style(cssVars);
-}
-
-module.exports = {
-  kebabCase: kebabCase,
-  mapThemeVarsToCSSVars: mapThemeVarsToCSSVars,
-};

+ 0 - 43
static/vant/definitions/index.d.ts

@@ -1,43 +0,0 @@
-/// <reference types="miniprogram-api-typings" />
-interface VantComponentInstance {
-  parent: WechatMiniprogram.Component.TrivialInstance;
-  children: WechatMiniprogram.Component.TrivialInstance[];
-  index: number;
-  $emit: (
-    name: string,
-    detail?: unknown,
-    options?: WechatMiniprogram.Component.TriggerEventOption
-  ) => void;
-}
-export declare type VantComponentOptions<
-  Data extends WechatMiniprogram.Component.DataOption,
-  Props extends WechatMiniprogram.Component.PropertyOption,
-  Methods extends WechatMiniprogram.Component.MethodOption
-> = {
-  data?: Data;
-  field?: boolean;
-  classes?: string[];
-  mixins?: string[];
-  props?: Props;
-  relation?: {
-    relations: Record<string, WechatMiniprogram.Component.RelationOption>;
-    mixin: string;
-  };
-  methods?: Methods;
-  beforeCreate?: () => void;
-  created?: () => void;
-  mounted?: () => void;
-  destroyed?: () => void;
-} & ThisType<
-  VantComponentInstance &
-    WechatMiniprogram.Component.Instance<
-      Data & {
-        name: string;
-        value: any;
-      } & Record<string, any>,
-      Props,
-      Methods
-    > &
-    Record<string, any>
->;
-export {};

+ 0 - 1
static/vant/definitions/index.js

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

+ 0 - 132
static/vant/definitions/weapp.d.ts

@@ -1,132 +0,0 @@
-/// <reference types="wechat-miniprogram" />
-export declare namespace Weapp {
-  export interface FormField {
-    data: {
-      name: string;
-      value: any;
-    };
-  }
-  interface Target {
-    id: string;
-    tagName: string;
-    dataset: {
-      [key: string]: any;
-    };
-  }
-  export interface Event {
-    /**
-     * 代表事件的类型。
-     */
-    type: string;
-    /**
-     * 页面打开到触发事件所经过的毫秒数。
-     */
-    timeStamp: number;
-    /**
-     * 触发事件的源组件。
-     */
-    target: Target;
-    /**
-     * 事件绑定的当前组件。
-     */
-    currentTarget: Target;
-    /**
-     * 额外的信息
-     */
-    detail: any;
-  }
-  interface Touch {
-    /**
-     * 触摸点的标识符
-     */
-    identifier: number;
-    /**
-     * 距离文档左上角的距离,文档的左上角为原点 ,横向为X轴,纵向为Y轴
-     */
-    pageX: number;
-    /**
-     * 距离文档左上角的距离,文档的左上角为原点 ,横向为X轴,纵向为Y轴
-     */
-    pageY: number;
-    /**
-     * 距离页面可显示区域(屏幕除去导航条)左上角距离,横向为X轴,纵向为Y轴
-     */
-    clientX: number;
-    /**
-     * 距离页面可显示区域(屏幕除去导航条)左上角距离,横向为X轴,纵向为Y轴
-     */
-    clientY: number;
-  }
-  export interface TouchEvent extends Event {
-    touches: Array<Touch>;
-    changedTouches: Array<Touch>;
-  }
-  /**
-   * relation定义,miniprogram-api-typings缺少this定义
-   */
-  export interface RelationOption<Instance> {
-    /** 目标组件的相对关系 */
-    type: 'parent' | 'child' | 'ancestor' | 'descendant';
-    /** 关系生命周期函数,当关系被建立在页面节点树中时触发,触发时机在组件attached生命周期之后 */
-    linked?(
-      this: Instance,
-      target: WechatMiniprogram.Component.TrivialInstance
-    ): void;
-    /** 关系生命周期函数,当关系在页面节点树中发生改变时触发,触发时机在组件moved生命周期之后 */
-    linkChanged?(
-      this: Instance,
-      target: WechatMiniprogram.Component.TrivialInstance
-    ): void;
-    /** 关系生命周期函数,当关系脱离页面节点树时触发,触发时机在组件detached生命周期之后 */
-    unlinked?(
-      this: Instance,
-      target: WechatMiniprogram.Component.TrivialInstance
-    ): void;
-    /** 如果这一项被设置,则它表示关联的目标节点所应具有的behavior,所有拥有这一behavior的组件节点都会被关联 */
-    target?: string;
-  }
-  /**
-   * obverser定义,miniprogram-api-typings缺少this定义
-   */
-  type Observer<Instance, T> = (
-    this: Instance,
-    newVal: T,
-    oldVal: T,
-    changedPath: Array<string | number>
-  ) => void;
-  /**
-   * methods定义,miniprogram-api-typings缺少this定义
-   */
-  export interface MethodOption<Instance> {
-    [name: string]: (this: Instance, ...args: any[]) => any;
-  }
-  export interface ComputedOption<Instance> {
-    [name: string]: (this: Instance) => any;
-  }
-  type PropertyType =
-    | StringConstructor
-    | NumberConstructor
-    | BooleanConstructor
-    | ArrayConstructor
-    | ObjectConstructor
-    | FunctionConstructor
-    | null;
-  export interface PropertyOption {
-    [name: string]:
-      | PropertyType
-      | PropertyType[]
-      | {
-          /** 属性类型 */
-          type: PropertyType | PropertyType[];
-          /** 属性初始值 */
-          value?: any;
-          /** 属性值被更改时的响应函数 */
-          observer?:
-            | string
-            | Observer<WechatMiniprogram.Component.TrivialInstance, any>;
-          /** 属性的类型(可以指定多个) */
-          optionalTypes?: PropertyType[];
-        };
-  }
-  export {};
-}

+ 0 - 1
static/vant/definitions/weapp.js

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

+ 8 - 0
static/vant/field/types.d.ts

@@ -0,0 +1,8 @@
+export interface InputDetails {
+    /** 输入框内容 */
+    value: string;
+    /** 光标位置 */
+    cursor?: number;
+    /** keyCode 为键值 (目前工具还不支持返回keyCode参数) `2.1.0` 起支持 */
+    keyCode?: number;
+}

+ 0 - 0
static/vant/area/index.d.ts → static/vant/field/types.js


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

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

+ 0 - 25
static/vant/index-anchor/index.js

@@ -1,25 +0,0 @@
-import { getRect } from '../common/utils';
-import { VantComponent } from '../common/component';
-import { useParent } from '../common/relation';
-VantComponent({
-  relation: useParent('index-bar'),
-  props: {
-    useSlot: Boolean,
-    index: null,
-  },
-  data: {
-    active: false,
-    wrapperStyle: '',
-    anchorStyle: '',
-  },
-  methods: {
-    scrollIntoView(scrollTop) {
-      getRect(this, '.van-index-anchor-wrapper').then((rect) => {
-        wx.pageScrollTo({
-          duration: 0,
-          scrollTop: scrollTop + rect.top - this.parent.data.stickyOffsetTop,
-        });
-      });
-    },
-  },
-});

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

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

+ 0 - 14
static/vant/index-anchor/index.wxml

@@ -1,14 +0,0 @@
-<view
-  class="van-index-anchor-wrapper"
-  style="{{ wrapperStyle }}"
->
-  <view
-    class="van-index-anchor {{ active ? 'van-index-anchor--active van-hairline--bottom' : '' }}"
-    style="{{ anchorStyle }}"
-  >
-    <slot wx:if="{{ useSlot }}"/>
-    <block wx:else>
-      <text>{{ index }}</text>
-    </block>
-  </view>
-</view>

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

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-index-anchor{padding:0 16px;padding:var(--index-anchor-padding,0 16px);color:#323233;color:var(--index-anchor-text-color,#323233);font-weight:500;font-weight:var(--index-anchor-font-weight,500);font-size:14px;font-size:var(--index-anchor-font-size,14px);line-height:32px;line-height:var(--index-anchor-line-height,32px);background-color:initial;background-color:var(--index-anchor-background-color,transparent)}.van-index-anchor--active{right:0;left:0;color:#07c160;color:var(--index-anchor-active-text-color,#07c160);background-color:#fff;background-color:var(--index-anchor-active-background-color,#fff)}

+ 10 - 0
static/vant/overlay/overlay.wxml

@@ -0,0 +1,10 @@
+<van-transition
+  show="{{ show }}"
+  custom-class="van-overlay custom-class"
+  custom-style="z-index: {{ zIndex }}; {{ customStyle }}"
+  duration="{{ duration }}"
+  bind:tap="onClick"
+  catch:touchmove="{{ lockScroll ? 'noop' : ''}}"
+>
+  <slot></slot>
+</van-transition>

+ 14 - 0
static/vant/popup/popup.wxml

@@ -0,0 +1,14 @@
+<view
+  wx:if="{{ inited }}"
+  class="custom-class {{ classes }} {{ utils.bem('popup', [position, { round, safe: safeAreaInsetBottom, safeTop: safeAreaInsetTop, safeTabBar: safeAreaTabBar }]) }}"
+  style="{{ computed.popupStyle({ zIndex, currentDuration, display, customStyle }) }}"
+  bind:transitionend="onTransitionEnd"
+>
+  <slot />
+  <van-icon
+    wx:if="{{ closeable }}"
+    name="{{ closeIcon }}"
+    class="close-icon-class van-popup__close-icon van-popup__close-icon--{{ closeIconPosition }}"
+    bind:tap="onClickCloseIcon"
+  />
+</view>

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

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

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

@@ -1,22 +0,0 @@
-import { VantComponent } from '../common/component';
-import { useChildren } from '../common/relation';
-VantComponent({
-  field: true,
-  relation: useChildren('radio'),
-  props: {
-    value: {
-      type: null,
-      observer: 'updateChildren',
-    },
-    direction: String,
-    disabled: {
-      type: Boolean,
-      observer: 'updateChildren',
-    },
-  },
-  methods: {
-    updateChildren() {
-      this.children.forEach((child) => child.updateFromParent());
-    },
-  },
-});

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

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

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

@@ -1,5 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="{{ utils.bem('radio-group', [direction]) }}">
-  <slot></slot>
-</view>

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

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-radio-group--horizontal{display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap}

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

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

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

@@ -1,66 +0,0 @@
-import { canIUseModel } from '../common/version';
-import { VantComponent } from '../common/component';
-import { useParent } from '../common/relation';
-VantComponent({
-  field: true,
-  relation: useParent('radio-group', function () {
-    this.updateFromParent();
-  }),
-  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,
-    },
-  },
-  data: {
-    direction: '',
-    parentDisabled: false,
-  },
-  methods: {
-    updateFromParent() {
-      if (!this.parent) {
-        return;
-      }
-      const { value, disabled: parentDisabled, direction } = this.parent.data;
-      this.setData({
-        value,
-        direction,
-        parentDisabled,
-      });
-    },
-    emitChange(value) {
-      const instance = this.parent || this;
-      instance.$emit('input', value);
-      instance.$emit('change', value);
-      if (canIUseModel()) {
-        instance.setData({ value });
-      }
-    },
-    onChange() {
-      if (!this.data.disabled && !this.data.parentDisabled) {
-        this.emitChange(this.data.name);
-      }
-    },
-    onClickLabel() {
-      const { disabled, parentDisabled, labelDisabled, name } = this.data;
-      if (!(disabled || parentDisabled) && !labelDisabled) {
-        this.emitChange(name);
-      }
-    },
-  },
-});

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

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

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

@@ -1,30 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-<wxs src="./index.wxs" module="computed" />
-
-<view class="{{ utils.bem('radio', [direction]) }} custom-class">
-  <view
-    wx:if="{{ labelPosition === 'left' }}"
-    class="{{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }} label-class"
-    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: disabled || parentDisabled, checked: value === name }]) }}"
-      style="{{ computed.iconStyle({ iconSize, checkedColor, disabled, parentDisabled, value, name }) }}"
-      custom-class="icon-class"
-      custom-style="{{ computed.iconCustomStyle({ iconSize }) }}"
-    />
-  </view>
-  <view
-    wx:if="{{ labelPosition === 'right' }}"
-    class="label-class {{ utils.bem('radio__label', [labelPosition, { disabled: disabled || parentDisabled }]) }}"
-    bindtap="onClickLabel"
-  >
-    <slot />
-  </view>
-</view>

+ 0 - 33
static/vant/radio/index.wxs

@@ -1,33 +0,0 @@
-/* eslint-disable */
-var style = require('../wxs/style.wxs');
-var addUnit = require('../wxs/add-unit.wxs');
-
-function iconStyle(data) {
-  var styles = {
-    'font-size': addUnit(data.iconSize),
-  };
-
-  if (
-    data.checkedColor &&
-    !(data.disabled || data.parentDisabled) &&
-    data.value === data.name
-  ) {
-    styles['border-color'] = data.checkedColor;
-    styles['background-color'] = data.checkedColor;
-  }
-
-  return style(styles);
-}
-
-function iconCustomStyle(data) {
-  return style({
-    'line-height': addUnit(data.iconSize),
-    'font-size': '.8em',
-    display: 'block',
-  });
-}
-
-module.exports = {
-  iconStyle: iconStyle,
-  iconCustomStyle: iconCustomStyle,
-};

+ 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--horizontal{margin-right:12px;margin-right:var(--padding-sm,12px)}.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/stepper/index.d.ts

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

+ 0 - 191
static/vant/stepper/index.js

@@ -1,191 +0,0 @@
-import { VantComponent } from '../common/component';
-import { isDef } from '../common/utils';
-const LONG_PRESS_START_TIME = 600;
-const LONG_PRESS_INTERVAL = 200;
-// add num and avoid float number
-function add(num1, num2) {
-  const cardinal = Math.pow(10, 10);
-  return Math.round((num1 + num2) * cardinal) / cardinal;
-}
-function equal(value1, value2) {
-  return String(value1) === String(value2);
-}
-VantComponent({
-  field: true,
-  classes: ['input-class', 'plus-class', 'minus-class'],
-  props: {
-    value: {
-      type: null,
-      observer(value) {
-        if (!equal(value, this.data.currentValue)) {
-          this.setData({ currentValue: this.format(value) });
-        }
-      },
-    },
-    integer: {
-      type: Boolean,
-      observer: 'check',
-    },
-    disabled: Boolean,
-    inputWidth: null,
-    buttonSize: null,
-    asyncChange: Boolean,
-    disableInput: Boolean,
-    decimalLength: {
-      type: Number,
-      value: null,
-      observer: 'check',
-    },
-    min: {
-      type: null,
-      value: 1,
-      observer: 'check',
-    },
-    max: {
-      type: null,
-      value: Number.MAX_SAFE_INTEGER,
-      observer: 'check',
-    },
-    step: {
-      type: null,
-      value: 1,
-    },
-    showPlus: {
-      type: Boolean,
-      value: true,
-    },
-    showMinus: {
-      type: Boolean,
-      value: true,
-    },
-    disablePlus: Boolean,
-    disableMinus: Boolean,
-    longPress: {
-      type: Boolean,
-      value: true,
-    },
-  },
-  data: {
-    currentValue: '',
-  },
-  created() {
-    this.setData({
-      currentValue: this.format(this.data.value),
-    });
-  },
-  methods: {
-    check() {
-      const val = this.format(this.data.currentValue);
-      if (!equal(val, this.data.currentValue)) {
-        this.setData({ currentValue: val });
-      }
-    },
-    isDisabled(type) {
-      if (type === 'plus') {
-        return (
-          this.data.disabled ||
-          this.data.disablePlus ||
-          this.data.currentValue >= this.data.max
-        );
-      }
-      return (
-        this.data.disabled ||
-        this.data.disableMinus ||
-        this.data.currentValue <= this.data.min
-      );
-    },
-    onFocus(event) {
-      this.$emit('focus', event.detail);
-    },
-    onBlur(event) {
-      const value = this.format(event.detail.value);
-      this.emitChange(value);
-      this.$emit(
-        'blur',
-        Object.assign(Object.assign({}, event.detail), { value })
-      );
-    },
-    // filter illegal characters
-    filter(value) {
-      value = String(value).replace(/[^0-9.-]/g, '');
-      if (this.data.integer && value.indexOf('.') !== -1) {
-        value = value.split('.')[0];
-      }
-      return value;
-    },
-    // limit value range
-    format(value) {
-      value = this.filter(value);
-      // format range
-      value = value === '' ? 0 : +value;
-      value = Math.max(Math.min(this.data.max, value), this.data.min);
-      // format decimal
-      if (isDef(this.data.decimalLength)) {
-        value = value.toFixed(this.data.decimalLength);
-      }
-      return value;
-    },
-    onInput(event) {
-      const { value = '' } = event.detail || {};
-      // allow input to be empty
-      if (value === '') {
-        return;
-      }
-      let formatted = this.filter(value);
-      // limit max decimal length
-      if (isDef(this.data.decimalLength) && formatted.indexOf('.') !== -1) {
-        const pair = formatted.split('.');
-        formatted = `${pair[0]}.${pair[1].slice(0, this.data.decimalLength)}`;
-      }
-      this.emitChange(formatted);
-    },
-    emitChange(value) {
-      if (!this.data.asyncChange) {
-        this.setData({ currentValue: value });
-      }
-      this.$emit('change', value);
-    },
-    onChange() {
-      const { type } = this;
-      if (this.isDisabled(type)) {
-        this.$emit('overlimit', type);
-        return;
-      }
-      const diff = type === 'minus' ? -this.data.step : +this.data.step;
-      const value = this.format(add(+this.data.currentValue, diff));
-      this.emitChange(value);
-      this.$emit(type);
-    },
-    longPressStep() {
-      this.longPressTimer = setTimeout(() => {
-        this.onChange();
-        this.longPressStep();
-      }, LONG_PRESS_INTERVAL);
-    },
-    onTap(event) {
-      const { type } = event.currentTarget.dataset;
-      this.type = type;
-      this.onChange();
-    },
-    onTouchStart(event) {
-      if (!this.data.longPress) {
-        return;
-      }
-      clearTimeout(this.longPressTimer);
-      const { type } = event.currentTarget.dataset;
-      this.type = type;
-      this.isLongPress = false;
-      this.longPressTimer = setTimeout(() => {
-        this.isLongPress = true;
-        this.onChange();
-        this.longPressStep();
-      }, LONG_PRESS_START_TIME);
-    },
-    onTouchEnd() {
-      if (!this.data.longPress) {
-        return;
-      }
-      clearTimeout(this.longPressTimer);
-    },
-  },
-});

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

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

+ 0 - 37
static/vant/stepper/index.wxml

@@ -1,37 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="van-stepper custom-class">
-  <view
-    wx:if="{{ showMinus }}"
-    data-type="minus"
-    style="width: {{ utils.addUnit(buttonSize) }}; height: {{ utils.addUnit(buttonSize) }}"
-    class="minus-class {{ utils.bem('stepper__minus', { disabled: disabled || disableMinus || currentValue <= min }) }}"
-    hover-class="van-stepper__minus--hover"
-    hover-stay-time="70"
-    bind:tap="onTap"
-    bind:touchstart="onTouchStart"
-    bind:touchend="onTouchEnd"
-  />
-  <input
-    type="{{ integer ? 'number' : 'digit' }}"
-    class="input-class {{ utils.bem('stepper__input', { disabled: disabled || disableInput }) }}"
-    style="width: {{ utils.addUnit(inputWidth) }}; height: {{ utils.addUnit(buttonSize) }}"
-    value="{{ currentValue }}"
-    focus="{{ focus }}"
-    disabled="{{ disabled || disableInput }}"
-    bindinput="onInput"
-    bind:focus="onFocus"
-    bind:blur="onBlur"
-  />
-  <view
-    wx:if="{{ showPlus }}"
-    data-type="plus"
-    style="width: {{ utils.addUnit(buttonSize) }}; height: {{ utils.addUnit(buttonSize) }}"
-    class="plus-class {{ utils.bem('stepper__plus', { disabled: disabled || disablePlus || currentValue >= max }) }}"
-    hover-class="van-stepper__plus--hover"
-    hover-stay-time="70"
-    bind:tap="onTap"
-    bind:touchstart="onTouchStart"
-    bind:touchend="onTouchEnd"
-  />
-</view>

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
static/vant/stepper/index.wxss


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

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

+ 0 - 33
static/vant/steps/index.js

@@ -1,33 +0,0 @@
-import { VantComponent } from '../common/component';
-import { GREEN, GRAY_DARK } from '../common/color';
-VantComponent({
-  classes: ['desc-class'],
-  props: {
-    icon: String,
-    steps: Array,
-    active: Number,
-    direction: {
-      type: String,
-      value: 'horizontal',
-    },
-    activeColor: {
-      type: String,
-      value: GREEN,
-    },
-    inactiveColor: {
-      type: String,
-      value: GRAY_DARK,
-    },
-    activeIcon: {
-      type: String,
-      value: 'checked',
-    },
-    inactiveIcon: String,
-  },
-  methods: {
-    onClick(event) {
-      const { index } = event.currentTarget.dataset;
-      this.$emit('click-step', index);
-    },
-  },
-});

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

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

+ 0 - 54
static/vant/steps/index.wxml

@@ -1,54 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view class="custom-class {{ utils.bem('steps', [direction]) }}">
-  <view class="van-step__wrapper">
-    <view
-      wx:for="{{ steps }}"
-      wx:key="index"
-      bindtap="onClick"
-      data-index="{{ index }}"
-      class="{{ utils.bem('step', [direction, status(index, active)]) }} van-hairline"
-      style="{{ status(index, active) === 'inactive' ? 'color: ' + inactiveColor: '' }}"
-    >
-      <view class="van-step__title" style="{{ index === active ? 'color: ' + activeColor : '' }}">
-        <view>{{ item.text }}</view>
-        <view class="desc-class">{{ item.desc }}</view>
-      </view>
-      <view class="van-step__circle-container">
-        <block wx:if="{{ index !== active }}">
-          <van-icon
-            wx:if="{{ item.inactiveIcon || inactiveIcon }}"
-            color="{{ status(index, active) === 'inactive' ? inactiveColor: activeColor }}"
-            name="{{ item.inactiveIcon || inactiveIcon }}"
-            custom-class="van-step__icon"
-          />
-          <view
-            wx:else
-            class="van-step__circle"
-            style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}"
-          />
-        </block>
-
-        <van-icon wx:else name="{{ item.activeIcon || activeIcon }}" color="{{ activeColor }}" custom-class="van-step__icon" />
-      </view>
-      <view
-        wx:if="{{ index !== steps.length - 1 }}"
-        class="van-step__line" style="{{ 'background-color: ' + (index < active ? activeColor : inactiveColor) }}"
-      />
-    </view>
-  </view>
-</view>
-
-<wxs module="status">
-function get(index, active) {
-  if (index < active) {
-    return 'finish';
-  } else if (index === active) {
-    return 'process';
-  }
-
-  return 'inactive';
-}
-
-module.exports = get;
-</wxs>

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
static/vant/steps/index.wxss


Деякі файли не було показано, через те що забагато файлів було змінено