Explorar el Código

删除冗余的components

萤火科技 hace 5 años
padre
commit
51e05c2d67
Se han modificado 61 ficheros con 0 adiciones y 1510 borrados
  1. 0 42
      components/actionsheet/index.js
  2. 0 6
      components/actionsheet/index.json
  3. 0 39
      components/actionsheet/index.wxml
  4. 0 86
      components/actionsheet/index.wxss
  5. 0 61
      components/btn/index.js
  6. 0 3
      components/btn/index.json
  7. 0 24
      components/btn/index.wxml
  8. 0 0
      components/btn/index.wxss
  9. 0 74
      components/btn/native-button-behaviors.js
  10. 0 3
      components/common/color.js
  11. 0 48
      components/common/component.js
  12. 0 1
      components/common/index.wxss
  13. 0 1
      components/common/style/clearfix.wxss
  14. 0 1
      components/common/style/ellipsis.wxss
  15. 0 1
      components/common/style/hairline.wxss
  16. 0 0
      components/common/style/mixins/clearfix.wxss
  17. 0 0
      components/common/style/mixins/ellipsis.wxss
  18. 0 0
      components/common/style/mixins/hairline.wxss
  19. 0 0
      components/common/style/var.wxss
  20. 0 14
      components/common/utils.js
  21. 0 26
      components/dialog/data.js
  22. 0 104
      components/dialog/dialog.js
  23. 0 148
      components/dialog/index.js
  24. 0 7
      components/dialog/index.json
  25. 0 18
      components/dialog/index.wxml
  26. 0 79
      components/dialog/index.wxss
  27. 0 17
      components/loading/index.js
  28. 0 3
      components/loading/index.json
  29. 0 16
      components/loading/index.wxml
  30. 0 0
      components/loading/index.wxss
  31. 0 22
      components/mixins/basic.js
  32. 0 18
      components/mixins/button.js
  33. 0 32
      components/mixins/iphonex.js
  34. 0 17
      components/mixins/link.js
  35. 0 47
      components/mixins/observer/behavior.js
  36. 0 27
      components/mixins/observer/index.js
  37. 0 22
      components/mixins/observer/props.js
  38. 0 25
      components/mixins/open-type.js
  39. 0 21
      components/mixins/touch.js
  40. 0 89
      components/mixins/transition.js
  41. 0 31
      components/pop-manager/index.js
  42. 0 3
      components/pop-manager/index.json
  43. 0 12
      components/pop-manager/index.wxml
  44. 0 1
      components/pop-manager/index.wxss
  45. 0 37
      components/popup/index.js
  46. 0 6
      components/popup/index.json
  47. 0 8
      components/popup/index.wxml
  48. 0 43
      components/switch/index.js
  49. 0 6
      components/switch/index.json
  50. 0 11
      components/switch/index.wxml
  51. 0 1
      components/switch/index.wxss
  52. 0 54
      components/toptips/index.js
  53. 0 3
      components/toptips/index.json
  54. 0 1
      components/toptips/index.wxml
  55. 0 1
      components/toptips/index.wxss
  56. 0 28
      components/toptips/toptips.js
  57. 0 5
      components/wxs/array.wxs
  58. 0 38
      components/wxs/bem.wxs
  59. 0 54
      components/wxs/memoize.wxs
  60. 0 13
      components/wxs/object.wxs
  61. 0 12
      components/wxs/utils.wxs

+ 0 - 42
components/actionsheet/index.js

@@ -1,42 +0,0 @@
-'use strict';
-
-Component({
-  externalClasses: ['mask-class', 'container-class'],
-  properties: {
-    actions: {
-      type: Array,
-      value: []
-    },
-    show: {
-      type: Boolean,
-      value: false
-    },
-    cancelWithMask: {
-      type: Boolean,
-      value: true
-    },
-    cancelText: {
-      type: String,
-      value: ''
-    }
-  },
-  methods: {
-    onMaskClick: function onMaskClick() {
-      if (this.data.cancelWithMask) {
-        this.cancelClick();
-      }
-    },
-    cancelClick: function cancelClick() {
-      this.triggerEvent('cancel');
-    },
-    handleBtnClick: function handleBtnClick(_ref) {
-      var _ref$currentTarget = _ref.currentTarget,
-          currentTarget = _ref$currentTarget === undefined ? {} : _ref$currentTarget;
-
-      var dataset = currentTarget.dataset || {};
-      var index = dataset.index;
-
-      this.triggerEvent('actionclick', { index: index });
-    }
-  }
-});

+ 0 - 6
components/actionsheet/index.json

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

+ 0 - 39
components/actionsheet/index.wxml

@@ -1,39 +0,0 @@
-<view class="zan-actionsheet {{ show ? 'zan-actionsheet--show' : '' }}">
-  <view
-    class="mask-class zan-actionsheet__mask"
-    bindtap="onMaskClick"
-  ></view>
-  <view class="container-class zan-actionsheet__container">
-    <!-- 选项按钮 -->
-    <zan-btn
-      wx:for="{{ actions }}"
-      wx:key="this"
-      bind:btnclick="handleBtnClick"
-      data-index="{{ index }}"
-      open-type="{{ item.openType }}"
-      custom-class="zan-actionsheet__btn"
-      loading="{{ item.loading }}"
-    >
-      <!-- 自定义组件控制 slot 样式有问题,故在 slot 容器上传入 loading 信息 -->
-      <view class="zan-actionsheet__btn-content {{ item.loading ? 'zan-actionsheet__btn--loading' : '' }}">
-        <view class="zan-actionsheet__name">{{ item.name }}</view>
-        <view
-          wx:if="{{ item.subname }}"
-          class="zan-actionsheet__subname">
-          {{ item.subname }}
-        </view>
-      </view>
-    </zan-btn>
-
-    <!-- 关闭按钮 -->
-    <view
-      wx:if="{{ cancelText }}"
-      class="zan-actionsheet__footer"
-    >
-      <zan-btn
-        custom-class="zan-actionsheet__btn"
-        catchtap="cancelClick"
-      >{{ cancelText }}</zan-btn>
-    </view>
-  </view>
-</view>

+ 0 - 86
components/actionsheet/index.wxss

@@ -1,86 +0,0 @@
-.zan-actionsheet {
-  background-color: #f8f8f8;
-}
-
-.zan-actionsheet__mask {
-  position: fixed;
-  top: 0;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  z-index: 10;
-  background: rgba(0, 0, 0, 0.7);
-  display: none;
-}
-
-.zan-actionsheet__container {
-  position: fixed;
-  left: 0;
-  right: 0;
-  bottom: 0;
-  background: #f8f8f8;
-  -webkit-transform: translate3d(0, 50%, 0);
-  transform: translate3d(0, 50%, 0);
-  -webkit-transform-origin: center;
-  transform-origin: center;
-  -webkit-transition: all 0.2s ease;
-  transition: all 0.2s ease;
-  z-index: 11;
-  opacity: 0;
-  visibility: hidden;
-}
-
-.zan-actionsheet__btn {
-  margin-bottom: 0 !important;
-}
-
-.zan-actionsheet__footer .zan-actionsheet__btn {
-  background: #fff;
-}
-
-.zan-actionsheet__btn-content {
-  display: -webkit-box;
-  display: flex;
-  -webkit-box-orient: horizontal;
-  -webkit-box-direction: normal;
-  flex-direction: row;
-  -webkit-box-pack: center;
-  justify-content: center;
-}
-
-.zan-actionsheet__subname {
-  color: #999;
-}
-
-.zan-actionsheet__name, .zan-actionsheet__subname {
-  height: 45px;
-  line-height: 45px;
-}
-
-.zan-actionsheet__btn.zan-btn:last-child::after {
-  border-bottom-width: 0;
-}
-
-.zan-actionsheet__subname {
-  margin-left: 2px;
-  font-size: 12px;
-}
-
-.zan-actionsheet__footer {
-  margin-top: 10px;
-}
-
-.zan-actionsheet__btn--loading .zan-actionsheet__subname {
-  color: transparent;
-}
-
-.zan-actionsheet--show .zan-actionsheet__container {
-  opacity: 1;
-  -webkit-transform: translate3d(0, 0, 0);
-  transform: translate3d(0, 0, 0);
-  visibility: visible;
-}
-
-.zan-actionsheet--show .zan-actionsheet__mask {
-  display: block;
-}

+ 0 - 61
components/btn/index.js

@@ -1,61 +0,0 @@
-'use strict';
-
-var nativeButtonBehavior = require('./native-button-behaviors');
-
-Component({
-  externalClasses: ['custom-class', 'theme-class'],
-  behaviors: [nativeButtonBehavior],
-  relations: {
-    '../btn-group/index': {
-      type: 'parent',
-      linked: function linked() {
-        this.setData({ inGroup: true });
-      },
-      unlinked: function unlinked() {
-        this.setData({ inGroup: false });
-      }
-    }
-  },
-  properties: {
-    type: {
-      type: String,
-      value: ''
-    },
-    size: {
-      type: String,
-      value: ''
-    },
-    plain: {
-      type: Boolean,
-      value: false
-    },
-    disabled: {
-      type: Boolean,
-      value: false
-    },
-    loading: {
-      type: Boolean,
-      value: false
-    }
-  },
-
-  data: {
-    inGroup: false,
-    isLast: false
-  },
-
-  methods: {
-    handleTap: function handleTap() {
-      if (this.data.disabled) {
-        this.triggerEvent('disabledclick');
-        return;
-      }
-      this.triggerEvent('btnclick');
-    },
-    switchLastButtonStatus: function switchLastButtonStatus() {
-      var isLast = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
-
-      this.setData({ isLast: isLast });
-    }
-  }
-});

+ 0 - 3
components/btn/index.json

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

+ 0 - 24
components/btn/index.wxml

@@ -1,24 +0,0 @@
-<button
-  class="custom-class theme-class zan-btn {{ inGroup ? 'zan-btn--group' : '' }} {{ isLast ? 'zan-btn--last' : '' }} {{size ? 'zan-btn--'+size : ''}} {{size === 'mini' ? 'zan-btn--plain' : ''}} {{plain ? 'zan-btn--plain' : ''}} {{type ? 'zan-btn--'+type : ''}} {{loading ? 'zan-btn--loading' : ''}} {{disabled ? 'zan-btn--disabled' : ''}}"
-  disabled="{{ disabled }}"
-  hover-class="button-hover"
-  open-type="{{ openType }}"
-  app-parameter="{{ appParameter }}"
-  hover-stop-propagation="{{ hoverStopPropagation }}"
-  hover-start-time="{{ hoverStartTime }}"
-  hover-stay-time="{{ hoverStayTime }}"
-  lang="{{ lang }}"
-  session-from="{{ sessionFrom }}"
-  send-message-title="{{ sendMessageTitle }}"
-  send-message-path="{{ sendMessagePath }}"
-  send-message-img="{{ sendMessageImg }}"
-  show-message-card="{{ showMessageCard }}"
-  bindtap="handleTap"
-  bindcontact="bindcontact"
-  bindgetuserinfo="bindgetuserinfo"
-  bindgetphonenumber="bindgetphonenumber"
-  binderror="binderror"
-  bindopensetting="bindopensetting"
->
-  <slot></slot>
-</button>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
components/btn/index.wxss


+ 0 - 74
components/btn/native-button-behaviors.js

@@ -1,74 +0,0 @@
-'use strict';
-
-module.exports = Behavior({
-  properties: {
-    loading: Boolean,
-    // 在自定义组件中,无法与外界的 form 组件联动,暂时不开放
-    // formType: String,
-    openType: String,
-    appParameter: String,
-    // 暂时不开放,直接传入无法设置样式
-    // hoverClass: {
-    //   type: String,
-    //   value: 'button-hover'
-    // },
-    hoverStopPropagation: Boolean,
-    hoverStartTime: {
-      type: Number,
-      value: 20
-    },
-    hoverStayTime: {
-      type: Number,
-      value: 70
-    },
-    lang: {
-      type: String,
-      value: 'en'
-    },
-    sessionFrom: {
-      type: String,
-      value: ''
-    },
-    sendMessageTitle: String,
-    sendMessagePath: String,
-    sendMessageImg: String,
-    showMessageCard: String
-  },
-  methods: {
-    bindgetuserinfo: function bindgetuserinfo() {
-      var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
-          _ref$detail = _ref.detail,
-          detail = _ref$detail === undefined ? {} : _ref$detail;
-
-      this.triggerEvent('getuserinfo', detail);
-    },
-    bindcontact: function bindcontact() {
-      var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
-          _ref2$detail = _ref2.detail,
-          detail = _ref2$detail === undefined ? {} : _ref2$detail;
-
-      this.triggerEvent('contact', detail);
-    },
-    bindgetphonenumber: function bindgetphonenumber() {
-      var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
-          _ref3$detail = _ref3.detail,
-          detail = _ref3$detail === undefined ? {} : _ref3$detail;
-
-      this.triggerEvent('getphonenumber', detail);
-    },
-    bindopensetting: function bindopensetting() {
-      var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
-          _ref4$detail = _ref4.detail,
-          detail = _ref4$detail === undefined ? {} : _ref4$detail;
-
-      this.triggerEvent('opensetting', detail);
-    },
-    binderror: function binderror() {
-      var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
-          _ref5$detail = _ref5.detail,
-          detail = _ref5$detail === undefined ? {} : _ref5$detail;
-
-      this.triggerEvent('error', detail);
-    }
-  }
-});

+ 0 - 3
components/common/color.js

@@ -1,3 +0,0 @@
-export const RED = '#f44';
-export const BLUE = '#1989fa';
-export const GREEN = '#07c160';

+ 0 - 48
components/common/component.js

@@ -1,48 +0,0 @@
-import { basic } from '../mixins/basic';
-import { observe } from '../mixins/observer/index';
-function mapKeys(source, target, map) {
-    Object.keys(map).forEach(key => {
-        if (source[key]) {
-            target[map[key]] = source[key];
-        }
-    });
-}
-function VantComponent(vantOptions = {}) {
-    const options = {};
-    mapKeys(vantOptions, options, {
-        data: 'data',
-        props: 'properties',
-        mixins: 'behaviors',
-        methods: 'methods',
-        beforeCreate: 'created',
-        created: 'attached',
-        mounted: 'ready',
-        relations: 'relations',
-        destroyed: 'detached',
-        classes: 'externalClasses'
-    });
-    const { relation } = vantOptions;
-    if (relation) {
-        options.relations = Object.assign(options.relations || {}, {
-            [`../${relation.name}/index`]: relation
-        });
-    }
-    // add default externalClasses
-    options.externalClasses = options.externalClasses || [];
-    options.externalClasses.push('custom-class');
-    // add default behaviors
-    options.behaviors = options.behaviors || [];
-    options.behaviors.push(basic);
-    // map field to form-field behavior
-    if (vantOptions.field) {
-        options.behaviors.push('wx://form-field');
-    }
-    // add default options
-    options.options = {
-        multipleSlots: true,
-        addGlobalClass: true
-    };
-    observe(vantOptions, options);
-    Component(options);
-}
-export { VantComponent };

+ 0 - 1
components/common/index.wxss

@@ -1 +0,0 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.van-clearfix::after{content:'';display:table;clear:both}.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);border:0 solid #eee}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}

+ 0 - 1
components/common/style/clearfix.wxss

@@ -1 +0,0 @@
-.van-clearfix::after{content:'';display:table;clear:both}

+ 0 - 1
components/common/style/ellipsis.wxss

@@ -1 +0,0 @@
-.van-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-multi-ellipsis--l2{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}

+ 0 - 1
components/common/style/hairline.wxss

@@ -1 +0,0 @@
-.van-hairline,.van-hairline--bottom,.van-hairline--left,.van-hairline--right,.van-hairline--surround,.van-hairline--top,.van-hairline--top-bottom{position:relative}.van-hairline--bottom::after,.van-hairline--left::after,.van-hairline--right::after,.van-hairline--surround::after,.van-hairline--top-bottom::after,.van-hairline--top::after,.van-hairline::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);border:0 solid #eee}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}

+ 0 - 0
components/common/style/mixins/clearfix.wxss


+ 0 - 0
components/common/style/mixins/ellipsis.wxss


+ 0 - 0
components/common/style/mixins/hairline.wxss


+ 0 - 0
components/common/style/var.wxss


+ 0 - 14
components/common/utils.js

@@ -1,14 +0,0 @@
-function isDef(value) {
-    return value !== undefined && value !== null;
-}
-function isObj(x) {
-    const type = typeof x;
-    return x !== null && (type === 'object' || type === 'function');
-}
-function isNumber(value) {
-    return /^\d+$/.test(value);
-}
-function range(num, min, max) {
-    return Math.min(Math.max(num, min), max);
-}
-export { isObj, isDef, isNumber, range };

+ 0 - 26
components/dialog/data.js

@@ -1,26 +0,0 @@
-'use strict';
-
-module.exports = {
-  // 标题
-  title: '',
-  // 内容
-  message: ' ',
-  // 选择节点
-  selector: '#zan-dialog',
-  // 按钮是否展示为纵向
-  buttonsShowVertical: false,
-  // 是否展示确定
-  showConfirmButton: true,
-  // 确认按钮文案
-  confirmButtonText: '确定',
-  // 确认按钮颜色
-  confirmButtonColor: '#3CC51F',
-  // 是否展示取消
-  showCancelButton: false,
-  // 取消按钮文案
-  cancelButtonText: '取消',
-  // 取消按钮颜色
-  cancelButtonColor: '#333',
-  // 点击按钮自动关闭 dialog
-  autoClose: true
-};

+ 0 - 104
components/dialog/dialog.js

@@ -1,104 +0,0 @@
-'use strict';
-
-var defaultData = require('./data');
-
-function getDialogCtx(_ref) {
-  var selector = _ref.selector,
-      pageCtx = _ref.pageCtx;
-
-  var ctx = pageCtx;
-  if (!ctx) {
-    var pages = getCurrentPages();
-    ctx = pages[pages.length - 1];
-  }
-  return ctx.selectComponent(selector);
-}
-
-function getParsedOptions() {
-  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
-  return Object.assign({
-    // 自定义 btn 列表
-    // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色 }
-    buttons: []
-  }, defaultData, options);
-}
-
-// options 使用参数
-// pageCtx 页面 page 上下文
-function Dialog(options, pageCtx) {
-  var parsedOptions = getParsedOptions(options);
-
-  var dialogCtx = getDialogCtx({
-    selector: parsedOptions.selector,
-    pageCtx: pageCtx
-  });
-
-  if (!dialogCtx) {
-    console.error('无法找到对应的dialog组件,请于页面中注册并在 wxml 中声明 dialog 自定义组件');
-    return Promise.reject({ type: 'component error' });
-  }
-
-  // 处理默认按钮的展示
-  // 纵向排布确认按钮在上方
-  var _parsedOptions$button = parsedOptions.buttons,
-      buttons = _parsedOptions$button === undefined ? [] : _parsedOptions$button;
-
-  var showCustomBtns = false;
-  if (buttons.length === 0) {
-    if (parsedOptions.showConfirmButton) {
-      buttons.push({
-        type: 'confirm',
-        text: parsedOptions.confirmButtonText,
-        color: parsedOptions.confirmButtonColor
-      });
-    }
-
-    if (parsedOptions.showCancelButton) {
-      var cancelButton = {
-        type: 'cancel',
-        text: parsedOptions.cancelButtonText,
-        color: parsedOptions.cancelButtonColor
-      };
-      if (parsedOptions.buttonsShowVertical) {
-        buttons.push(cancelButton);
-      } else {
-        buttons.unshift(cancelButton);
-      }
-    }
-  } else {
-    showCustomBtns = true;
-  }
-
-  return new Promise(function (resolve, reject) {
-    dialogCtx.setData(Object.assign({}, parsedOptions, {
-      buttons: buttons,
-      showCustomBtns: showCustomBtns,
-      key: '' + new Date().getTime(),
-      show: true,
-      promiseFunc: { resolve: resolve, reject: reject },
-      openTypePromiseFunc: null
-    }));
-  });
-}
-
-Dialog.close = function (options, pageCtx) {
-  var parsedOptions = getParsedOptions(options);
-
-  var dialogCtx = getDialogCtx({
-    selector: parsedOptions.selector,
-    pageCtx: pageCtx
-  });
-
-  if (!dialogCtx) {
-    return;
-  }
-
-  dialogCtx.setData({
-    show: false,
-    promiseFunc: null,
-    openTypePromiseFunc: null
-  });
-};
-
-module.exports = Dialog;

+ 0 - 148
components/dialog/index.js

@@ -1,148 +0,0 @@
-'use strict';
-
-var _f = function _f() {};
-var needResponseOpenTypes = ['getUserInfo', 'getPhoneNumber', 'openSetting'];
-
-Component({
-  properties: {},
-
-  data: {
-    // 标题
-    title: '',
-    // 自定义 btn 列表
-    // { type: 按钮类型,回调时以此作为区分依据,text: 按钮文案, color: 按钮文字颜色, openType: 微信开放能力 }
-    buttons: [],
-    // 内容
-    message: ' ',
-    // 选择节点
-    selector: '#zan-dialog',
-    // 是否允许滚动
-    isScroll: false,
-    // 按钮是否展示为纵向
-    buttonsShowVertical: false,
-    // 是否展示确定
-    showConfirmButton: true,
-    // 确认按钮文案
-    confirmButtonText: '确定',
-    // 确认按钮颜色
-    confirmButtonColor: '#3CC51F',
-    // 是否展示取消
-    showCancelButton: false,
-    // 取消按钮文案
-    cancelButtonText: '取消',
-    // 取消按钮颜色
-    cancelButtonColor: '#333',
-    key: '',
-    autoClose: true,
-    show: false,
-    showCustomBtns: false,
-    promiseFunc: {},
-    openTypePromiseFunc: {}
-  },
-
-  methods: {
-    handleButtonClick: function handleButtonClick(e) {
-      var _this = this;
-
-      var _e$currentTarget = e.currentTarget,
-        currentTarget = _e$currentTarget === undefined ? {} : _e$currentTarget;
-      var _currentTarget$datase = currentTarget.dataset,
-        dataset = _currentTarget$datase === undefined ? {} : _currentTarget$datase;
-
-      // 获取当次弹出框的信息
-
-      var _ref = this.data.promiseFunc || {},
-        _ref$resolve = _ref.resolve,
-        resolve = _ref$resolve === undefined ? _f : _ref$resolve,
-        _ref$reject = _ref.reject,
-        reject = _ref$reject === undefined ? _f : _ref$reject;
-
-      // 重置展示
-
-
-      if (this.data.autoClose) {
-        this.setData({
-          show: false
-        });
-      }
-
-      // 自定义按钮,全部 resolve 形式返回,根据 type 区分点击按钮
-      if (this.data.showCustomBtns) {
-        var isNeedOpenDataButton = needResponseOpenTypes.indexOf(dataset.openType) > -1;
-        var resolveData = {
-          type: dataset.type
-        };
-        // 如果需要 openData,就额外返回一个 promise,用于后续 open 数据返回
-        if (isNeedOpenDataButton) {
-          resolveData.openDataPromise = new Promise(function(resolve, reject) {
-            _this.setData({
-              openTypePromiseFunc: {
-                resolve: resolve,
-                reject: reject
-              }
-            });
-          });
-          resolveData.hasOpenDataPromise = true;
-        }
-        resolve(resolveData);
-        return;
-      }
-
-      // 默认按钮,确认为 resolve,取消为 reject
-      if (dataset.type === 'confirm') {
-        resolve({
-          type: 'confirm'
-        });
-      } else {
-        reject({
-          type: 'cancel'
-        });
-      }
-
-      this.setData({
-        promiseFunc: {}
-      });
-    },
-
-
-    // 以下为处理微信按钮开放能力的逻辑
-    handleUserInfoResponse: function handleUserInfoResponse(_ref2) {
-      var detail = _ref2.detail;
-
-      this.__handleOpenDataResponse({
-        type: detail.errMsg === 'getUserInfo:ok' ? 'resolve' : 'reject',
-        data: detail
-      });
-    },
-    handlePhoneResponse: function handlePhoneResponse(_ref3) {
-      var detail = _ref3.detail;
-
-      this.__handleOpenDataResponse({
-        type: detail.errMsg === 'getPhoneNumber:ok' ? 'resolve' : 'reject',
-        data: detail
-      });
-    },
-    handleOpenSettingResponse: function handleOpenSettingResponse(_ref4) {
-      var detail = _ref4.detail;
-
-      this.__handleOpenDataResponse({
-        type: detail.errMsg === 'openSetting:ok' ? 'resolve' : 'reject',
-        data: detail
-      });
-    },
-    __handleOpenDataResponse: function __handleOpenDataResponse(_ref5) {
-      var _ref5$type = _ref5.type,
-        type = _ref5$type === undefined ? 'resolve' : _ref5$type,
-        _ref5$data = _ref5.data,
-        data = _ref5$data === undefined ? {} : _ref5$data;
-
-      var promiseFuncs = this.data.openTypePromiseFunc || {};
-      var responseFunc = promiseFuncs[type] || _f;
-
-      responseFunc(data);
-      this.setData({
-        openTypePromiseFunc: null
-      });
-    }
-  }
-});

+ 0 - 7
components/dialog/index.json

@@ -1,7 +0,0 @@
-{
-  "component": true,
-  "usingComponents": {
-    "pop-manager": "../pop-manager/index",
-    "zan-button": "../btn/index"
-  } 
-}

+ 0 - 18
components/dialog/index.wxml

@@ -1,18 +0,0 @@
-<pop-manager show="{{ show }}" type="center">
-  <view class="zan-dialog--container">
-    <view wx:if="{{ title }}" class="zan-dialog__header">{{ title }}</view>
-    <view class="zan-dialog__content {{ title ? 'zan-dialog__content--title' : '' }}">
-      <scroll-view class="zan-dialog__content--scroll" scroll-y="{{ isScroll }}">
-        <text>{{ message }}</text>
-      </scroll-view>
-    </view>
-    <view class="zan-dialog__footer {{ buttonsShowVertical ? 'zan-dialog__footer--vertical' : 'zan-dialog__footer--horizon' }}">
-      <block wx:for="{{ buttons }}" wx:key="this">
-        <zan-button class="zan-dialog__button" custom-class="{{ index === 0 ? 'zan-dialog__button-inside--first' : 'zan-dialog__button-inside' }}" data-type="{{ item.type }}" data-open-type="{{ item.openType }}" open-type="{{ item.openType }}" bind:btnclick="handleButtonClick"
-          bind:getuserinfo="handleUserInfoResponse" bind:getphonenumber="handlePhoneResponse" bind:opensetting="handleOpenSettingResponse">
-          <view style="color: {{ item.color || '#333' }}">{{ item.text }}</view>
-        </zan-button>
-      </block>
-    </view>
-  </view>
-</pop-manager>

+ 0 - 79
components/dialog/index.wxss

@@ -1,79 +0,0 @@
-.zan-dialog--container {
-  width: 80vw;
-  font-size: 16px;
-  overflow: hidden;
-  border-radius: 4px;
-  background-color: #fff;
-  color: #333;
-}
-
-.zan-dialog__header {
-  padding: 15px 0 0;
-  text-align: center;
-}
-
-.zan-dialog__content {
-  position: relative;
-  padding: 15px 20px;
-  line-height: 1.5;
-  min-height: 40px;
-}
-
-.zan-dialog__content::after {
-  content: '';
-  position: absolute;
-  top: 0;
-  left: 0;
-  width: 200%;
-  height: 200%;
-  -webkit-transform: scale(0.5);
-  transform: scale(0.5);
-  -webkit-transform-origin: 0 0;
-  transform-origin: 0 0;
-  pointer-events: none;
-  box-sizing: border-box;
-  border: 0 solid #e5e5e5;
-  border-bottom-width: 1px;
-}
-
-.zan-dialog__content--title {
-  color: #999;
-  font-size: 14px;
-}
-
-.zan-dialog__content--scroll {
-  max-height: 70vh;
-}
-
-.zan-dialog__footer {
-  overflow: hidden;
-}
-
-.zan-dialog__button {
-  -webkit-box-flex: 1;
-  flex: 1;
-}
-
-.zan-dialog__button-inside, .zan-dialog__button-inside--first {
-  margin-bottom: 0;
-  line-height: 50px;
-  height: 50px;
-}
-
-.zan-dialog__button-inside--first::after, .zan-dialog__button-inside::after {
-  border-width: 0;
-  border-radius: 0;
-}
-
-.zan-dialog__footer--horizon {
-  display: -webkit-box;
-  display: flex;
-}
-
-.zan-dialog__footer--horizon .zan-dialog__button-inside::after {
-  border-left-width: 1px;
-}
-
-.zan-dialog__footer--vertical .zan-dialog__button-inside::after {
-  border-top-width: 1px;
-}

+ 0 - 17
components/loading/index.js

@@ -1,17 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-    props: {
-        size: {
-            type: String,
-            value: '30px'
-        },
-        type: {
-            type: String,
-            value: 'circular'
-        },
-        color: {
-            type: String,
-            value: '#c9c9c9'
-        }
-    }
-});

+ 0 - 3
components/loading/index.json

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

+ 0 - 16
components/loading/index.wxml

@@ -1,16 +0,0 @@
-<view
-  class="van-loading custom-class"
-  style="width: {{ size }}; height: {{ size }}"
->
-  <view
-    class="van-loading__spinner van-loading__spinner--{{ type }}"
-    style="color: {{ color }};"
-  >
-    <view
-      wx:if="{{ type === 'spinner' }}"
-      wx:for="item in 12"
-      wx:key="index"
-      class="van-loading__dot"
-    />
-  </view>
-</view>

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
components/loading/index.wxss


+ 0 - 22
components/mixins/basic.js

@@ -1,22 +0,0 @@
-export const basic = Behavior({
-    methods: {
-        $emit() {
-            this.triggerEvent.apply(this, arguments);
-        },
-        getRect(selector, all) {
-            return new Promise(resolve => {
-                wx.createSelectorQuery()
-                    .in(this)[all ? 'selectAll' : 'select'](selector)
-                    .boundingClientRect(rect => {
-                    if (all && Array.isArray(rect) && rect.length) {
-                        resolve(rect);
-                    }
-                    if (!all && rect) {
-                        resolve(rect);
-                    }
-                })
-                    .exec();
-            });
-        }
-    }
-});

+ 0 - 18
components/mixins/button.js

@@ -1,18 +0,0 @@
-export const button = Behavior({
-    externalClasses: ['hover-class'],
-    properties: {
-        id: String,
-        lang: {
-            type: String,
-            value: 'en'
-        },
-        businessId: Number,
-        sessionFrom: String,
-        sendMessageTitle: String,
-        sendMessagePath: String,
-        sendMessageImg: String,
-        showMessageCard: Boolean,
-        appParameter: String,
-        ariaLabel: String
-    }
-});

+ 0 - 32
components/mixins/iphonex.js

@@ -1,32 +0,0 @@
-let isIPhoneX = null;
-function getIsIPhoneX() {
-    return new Promise((resolve, reject) => {
-        if (isIPhoneX !== null) {
-            resolve(isIPhoneX);
-        }
-        else {
-            wx.getSystemInfo({
-                success: ({ model, screenHeight }) => {
-                    const iphoneX = /iphone x/i.test(model);
-                    const iphoneNew = /iPhone11/i.test(model) && screenHeight === 812;
-                    isIPhoneX = iphoneX || iphoneNew;
-                    resolve(isIPhoneX);
-                },
-                fail: reject
-            });
-        }
-    });
-}
-export const iphonex = Behavior({
-    properties: {
-        safeAreaInsetBottom: {
-            type: Boolean,
-            value: true
-        }
-    },
-    created() {
-        getIsIPhoneX().then(isIPhoneX => {
-            this.set({ isIPhoneX });
-        });
-    }
-});

+ 0 - 17
components/mixins/link.js

@@ -1,17 +0,0 @@
-export const link = Behavior({
-    properties: {
-        url: String,
-        linkType: {
-            type: String,
-            value: 'navigateTo'
-        }
-    },
-    methods: {
-        jumpLink(urlKey = 'url') {
-            const url = this.data[urlKey];
-            if (url) {
-                wx[this.data.linkType]({ url });
-            }
-        }
-    }
-});

+ 0 - 47
components/mixins/observer/behavior.js

@@ -1,47 +0,0 @@
-function setAsync(context, data) {
-    return new Promise(resolve => {
-        context.setData(data, resolve);
-    });
-}
-;
-export const behavior = Behavior({
-    created() {
-        if (!this.$options) {
-            return;
-        }
-        const cache = {};
-        const { computed } = this.$options();
-        const keys = Object.keys(computed);
-        this.calcComputed = () => {
-            const needUpdate = {};
-            keys.forEach(key => {
-                const value = computed[key].call(this);
-                if (cache[key] !== value) {
-                    cache[key] = needUpdate[key] = value;
-                }
-            });
-            return needUpdate;
-        };
-    },
-    attached() {
-        this.set();
-    },
-    methods: {
-        // set data and set computed data
-        set(data, callback) {
-            const stack = [];
-            if (data) {
-                stack.push(setAsync(this, data));
-            }
-            if (this.calcComputed) {
-                stack.push(setAsync(this, this.calcComputed()));
-            }
-            return Promise.all(stack).then(res => {
-                if (callback && typeof callback === 'function') {
-                    callback.call(this);
-                }
-                return res;
-            });
-        }
-    }
-});

+ 0 - 27
components/mixins/observer/index.js

@@ -1,27 +0,0 @@
-import { behavior } from './behavior';
-import { observeProps } from './props';
-export function observe(vantOptions, options) {
-    const { watch, computed } = vantOptions;
-    options.behaviors.push(behavior);
-    if (watch) {
-        const props = options.properties || {};
-        Object.keys(watch).forEach(key => {
-            if (key in props) {
-                let prop = props[key];
-                if (prop === null || !('type' in prop)) {
-                    prop = { type: prop };
-                }
-                prop.observer = watch[key];
-                props[key] = prop;
-            }
-        });
-        options.properties = props;
-    }
-    if (computed) {
-        options.methods = options.methods || {};
-        options.methods.$options = () => vantOptions;
-        if (options.properties) {
-            observeProps(options.properties);
-        }
-    }
-}

+ 0 - 22
components/mixins/observer/props.js

@@ -1,22 +0,0 @@
-export function observeProps(props) {
-    if (!props) {
-        return;
-    }
-    Object.keys(props).forEach(key => {
-        let prop = props[key];
-        if (prop === null || !('type' in prop)) {
-            prop = { type: prop };
-        }
-        let { observer } = prop;
-        prop.observer = function () {
-            if (observer) {
-                if (typeof observer === 'string') {
-                    observer = this[observer];
-                }
-                observer.apply(this, arguments);
-            }
-            this.set();
-        };
-        props[key] = prop;
-    });
-}

+ 0 - 25
components/mixins/open-type.js

@@ -1,25 +0,0 @@
-export const openType = Behavior({
-    properties: {
-        openType: String
-    },
-    methods: {
-        bindGetUserInfo(event) {
-            this.$emit('getuserinfo', event.detail);
-        },
-        bindContact(event) {
-            this.$emit('contact', event.detail);
-        },
-        bindGetPhoneNumber(event) {
-            this.$emit('getphonenumber', event.detail);
-        },
-        bindError(event) {
-            this.$emit('error', event.detail);
-        },
-        bindLaunchApp(event) {
-            this.$emit('launchapp', event.detail);
-        },
-        bindOpenSetting(event) {
-            this.$emit('opensetting', event.detail);
-        },
-    }
-});

+ 0 - 21
components/mixins/touch.js

@@ -1,21 +0,0 @@
-export const touch = Behavior({
-    methods: {
-        touchStart(event) {
-            this.direction = '';
-            this.deltaX = 0;
-            this.deltaY = 0;
-            this.offsetX = 0;
-            this.offsetY = 0;
-            this.startX = event.touches[0].clientX;
-            this.startY = event.touches[0].clientY;
-        },
-        touchMove(event) {
-            const touch = event.touches[0];
-            this.deltaX = touch.clientX - this.startX;
-            this.deltaY = touch.clientY - this.startY;
-            this.offsetX = Math.abs(this.deltaX);
-            this.offsetY = Math.abs(this.deltaY);
-            this.direction = this.offsetX > this.offsetY ? 'horizontal' : this.offsetX < this.offsetY ? 'vertical' : '';
-        }
-    }
-});

+ 0 - 89
components/mixins/transition.js

@@ -1,89 +0,0 @@
-import { isObj } from '../common/utils';
-const getClassNames = (name) => ({
-    enter: `van-${name}-enter van-${name}-enter-active enter-class enter-active-class`,
-    'enter-to': `van-${name}-enter-to van-${name}-enter-active enter-to-class enter-active-class`,
-    leave: `van-${name}-leave van-${name}-leave-active leave-class leave-active-class`,
-    'leave-to': `van-${name}-leave-to van-${name}-leave-active leave-to-class leave-active-class`
-});
-const requestAnimationFrame = (cb) => setTimeout(cb, 1000 / 60);
-export const transition = function (showDefaultValue) {
-    return Behavior({
-        properties: {
-            customStyle: String,
-            show: {
-                type: Boolean,
-                value: showDefaultValue,
-                observer: 'observeShow'
-            },
-            duration: {
-                type: [Number, Object],
-                value: 300,
-                observer: 'observeDuration'
-            },
-            name: {
-                type: String,
-                value: 'fade',
-                observer: 'updateClasses'
-            }
-        },
-        data: {
-            type: '',
-            inited: false,
-            display: false,
-            classNames: getClassNames('fade')
-        },
-        attached() {
-            if (this.data.show) {
-                this.show();
-            }
-        },
-        methods: {
-            observeShow(value) {
-                if (value) {
-                    this.show();
-                }
-                else {
-                    this.leave();
-                }
-            },
-            updateClasses(name) {
-                this.set({
-                    classNames: getClassNames(name)
-                });
-            },
-            show() {
-                const { classNames, duration } = this.data;
-                this.set({
-                    inited: true,
-                    display: true,
-                    classes: classNames.enter,
-                    currentDuration: isObj(duration) ? duration.enter : duration
-                }).then(() => {
-                    requestAnimationFrame(() => {
-                        this.set({
-                            classes: classNames['enter-to']
-                        });
-                    });
-                });
-            },
-            leave() {
-                const { classNames, duration } = this.data;
-                this.set({
-                    classes: classNames.leave,
-                    currentDuration: isObj(duration) ? duration.leave : duration
-                }).then(() => {
-                    requestAnimationFrame(() => {
-                        this.set({
-                            classes: classNames['leave-to']
-                        });
-                    });
-                });
-            },
-            onTransitionEnd() {
-                if (!this.data.show) {
-                    this.set({ display: false });
-                }
-            }
-        }
-    });
-};

+ 0 - 31
components/pop-manager/index.js

@@ -1,31 +0,0 @@
-'use strict';
-
-Component({
-  properties: {
-    show: {
-      type: Boolean,
-      value: false
-    },
-    // 是否有遮罩层
-    overlay: {
-      type: Boolean,
-      value: true
-    },
-    // 遮罩层是否会显示
-    showOverlay: {
-      type: Boolean,
-      value: true
-    },
-    // 内容从哪个方向出,可选 center top bottom left right
-    type: {
-      type: String,
-      value: 'center'
-    }
-  },
-
-  methods: {
-    handleMaskClick: function handleMaskClick() {
-      this.triggerEvent('clickmask', {});
-    }
-  }
-});

+ 0 - 3
components/pop-manager/index.json

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

+ 0 - 12
components/pop-manager/index.wxml

@@ -1,12 +0,0 @@
-<view
-  class="pop pop--{{ type }} {{ show ? 'pop--show' : '' }}"
->
-  <view 
-    wx:if="{{ overlay }}"
-    class="pop__mask {{ showOverlay ? '' : 'pop__mask--hide' }}"
-    bindtap="handleMaskClick"
-  ></view>
-  <view class="pop__container">
-    <slot></slot>
-  </view>
-</view>

+ 0 - 1
components/pop-manager/index.wxss

@@ -1 +0,0 @@
-.pop{visibility:hidden}.pop--show{visibility:visible}.pop__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:14;background:rgba(0,0,0,.5);display:none}.pop__mask--hide{background:0 0}.pop__container{position:fixed;left:50%;top:50%;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0);-webkit-transform-origin:center;transform-origin:center;-webkit-transition:all .2s ease;transition:all .2s ease;z-index:15;opacity:0}.pop--show .pop__container{opacity:1}.pop--show .pop__mask{display:block}.pop--left .pop__container{left:0;top:50%;-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}.pop--show.pop--left .pop__container{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pop--right .pop__container{right:0;top:50%;left:auto;-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}.pop--show.pop--right .pop__container{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}.pop--bottom .pop__container{top:auto;left:50%;bottom:0;-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}.pop--show.pop--bottom .pop__container{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.pop--top .pop__container{top:0;left:50%;-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}.pop--show.pop--top .pop__container{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}

+ 0 - 37
components/popup/index.js

@@ -1,37 +0,0 @@
-'use strict';
-
-Component({
-  properties: {
-    show: {
-      type: Boolean,
-      value: false
-    },
-
-    overlay: {
-      type: Boolean,
-      value: true
-    },
-
-    closeOnClickOverlay: {
-      type: Boolean,
-      value: true
-    },
-
-    // 弹出方向
-    type: {
-      type: String,
-      value: 'center'
-    }
-  },
-
-  methods: {
-    handleMaskClick: function() {
-      this.triggerEvent('click-overlay', {});
-
-      if (!this.data.closeOnClickOverlay) {
-        return;
-      }
-      this.triggerEvent('close', {});
-    }
-  }
-});

+ 0 - 6
components/popup/index.json

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

+ 0 - 8
components/popup/index.wxml

@@ -1,8 +0,0 @@
-<pop-manager
-  show="{{ show }}"
-  type="{{ type }}"
-  show-overlay="{{ overlay }}"
-  bindclickmask="handleMaskClick"
->
-  <slot></slot>
-</pop-manager>

+ 0 - 43
components/switch/index.js

@@ -1,43 +0,0 @@
-import { VantComponent } from '../common/component';
-VantComponent({
-    field: true,
-    classes: ['node-class'],
-    props: {
-        checked: null,
-        loading: Boolean,
-        disabled: Boolean,
-        activeColor: String,
-        inactiveColor: String,
-        size: {
-            type: String,
-            value: '30px'
-        },
-        activeValue: {
-            type: null,
-            value: true
-        },
-        inactiveValue: {
-            type: null,
-            value: false
-        }
-    },
-    watch: {
-        checked(value) {
-            this.set({ value });
-        }
-    },
-    created() {
-        this.set({ value: this.data.checked });
-    },
-    methods: {
-        onClick() {
-            const { activeValue, inactiveValue } = this.data;
-            if (!this.data.disabled && !this.data.loading) {
-                const checked = this.data.checked === activeValue;
-                const value = checked ? inactiveValue : activeValue;
-                this.$emit('input', value);
-                this.$emit('change', value);
-            }
-        }
-    }
-});

+ 0 - 6
components/switch/index.json

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

+ 0 - 11
components/switch/index.wxml

@@ -1,11 +0,0 @@
-<wxs src="../wxs/utils.wxs" module="utils" />
-
-<view
-  class="custom-class {{ utils.bem('switch', { on: value === activeValue, disabled }) }}"
-  style="font-size: {{ size }}; {{ (checked ? activeColor : inactiveColor) ? 'background-color: ' + (checked ? activeColor : inactiveColor ) : '' }}"
-  bind:tap="onClick"
->
-  <view class="van-switch__node node-class">
-    <van-loading wx:if="{{ loading }}" size="50%" custom-class="van-switch__loading" />
-  </view>
-</view>

+ 0 - 1
components/switch/index.wxss

@@ -1 +0,0 @@
-@import '../common/index.wxss';.van-switch{display:inline-block;position:relative;width:2em;height:1em;border:1px solid rgba(0,0,0,.1);border-radius:1em;box-sizing:content-box;background-color:#fff;transition:background-color .3s}.van-switch__node{top:0;left:0;position:absolute;border-radius:100%;width:1em;height:1em;z-index:1;transition:.3s;box-shadow:0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);background-color:#fff}.van-switch__loading{top:25%;left:25%;position:absolute!important}.van-switch--on{background-color:#1989fa}.van-switch--on .van-switch__node{-webkit-transform:translateX(1em);transform:translateX(1em)}.van-switch--disabled{opacity:.4}

+ 0 - 54
components/toptips/index.js

@@ -1,54 +0,0 @@
-'use strict';
-
-var FONT_COLOR = '#fff';
-var BG_COLOR = '#e64340';
-
-Component({
-  properties: {
-    content: String,
-    color: {
-      type: String,
-      value: FONT_COLOR
-    },
-    backgroundColor: {
-      type: String,
-      value: BG_COLOR
-    },
-    isShow: {
-      type: Boolean,
-      value: false
-    },
-    duration: {
-      type: Number,
-      value: 3000
-    }
-  },
-
-  methods: {
-    show: function show() {
-      var _this = this;
-
-      var duration = this.data.duration;
-
-
-      this._timer && clearTimeout(this._timer);
-      this.setData({
-        isShow: true
-      });
-
-      if (duration > 0 && duration !== Infinity) {
-        this._timer = setTimeout(function () {
-          _this.hide();
-        }, duration);
-      }
-    },
-    hide: function hide() {
-      this._timer = clearTimeout(this._timer);
-
-      this.setData({
-        isShow: false,
-        backgroundColor: BG_COLOR
-      });
-    }
-  }
-});

+ 0 - 3
components/toptips/index.json

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

+ 0 - 1
components/toptips/index.wxml

@@ -1 +0,0 @@
-<view class="zan-toptips {{ isShow ? 'zan-toptips--show' : '' }}" style="background-color:{{ backgroundColor }}">{{ content }}</view>

+ 0 - 1
components/toptips/index.wxss

@@ -1 +0,0 @@
-.zan-toptips{display:block;position:fixed;-webkit-transform:translateZ(0) translateY(-100%);width:100%;min-height:32px;top:0;line-height:2.3;font-size:14px;text-align:center;color:#fff;background-color:#e64340;z-index:110;opacity:0;-webkit-transition:all .4s ease;transition:all .4s ease}.zan-toptips--show{-webkit-transform:translateZ(0) translateY(0);opacity:1}

+ 0 - 28
components/toptips/toptips.js

@@ -1,28 +0,0 @@
-'use strict';
-
-function Toptips() {
-  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
-
-  var pages = getCurrentPages();
-  var ctx = pages[pages.length - 1];
-  var defaultOptions = {
-    selector: '#zan-toptips',
-    duration: 3000
-  };
-
-  options = Object.assign(defaultOptions, parseParam(options));
-
-  var $toptips = ctx.selectComponent(options.selector);
-  delete options.selector;
-
-  $toptips.setData(Object.assign({}, options));
-  $toptips && $toptips.show();
-}
-
-function parseParam() {
-  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
-
-  return typeof params === 'object' ? params : { content: params };
-}
-
-module.exports = Toptips;

+ 0 - 5
components/wxs/array.wxs

@@ -1,5 +0,0 @@
-function isArray(array) {
-  return array && array.constructor === 'Array';
-}
-
-module.exports.isArray = isArray;

+ 0 - 38
components/wxs/bem.wxs

@@ -1,38 +0,0 @@
-var array = require('./array.wxs');
-var object = require('./object.wxs');
-var PREFIX = 'van-';
-
-function join(name, mods) {
-  name = PREFIX + name;
-  mods = mods.map(function(mod) {
-    return name + '--' + mod;
-  });
-  mods.unshift(name);
-  return mods.join(' ');
-}
-
-function traversing(mods, conf) {
-  if (!conf) {
-    return;
-  }
-
-  if (typeof conf === 'string' || typeof conf === 'number') {
-    mods.push(conf);
-  } else if (array.isArray(conf)) {
-    conf.forEach(function(item) {
-      traversing(mods, item);
-    });
-  } else if (typeof conf === 'object') {
-    object.keys(conf).forEach(function(key) {
-      conf[key] && mods.push(key);
-    });
-  }
-}
-
-function bem(name, conf) {
-  var mods = [];
-  traversing(mods, conf);
-  return join(name, mods);
-}
-
-module.exports.bem = bem;

+ 0 - 54
components/wxs/memoize.wxs

@@ -1,54 +0,0 @@
-/**
- * Simple memoize
- * wxs doesn't support fn.apply, so this memoize only support up to 2 args
- */
-
-function isPrimitive(value) {
-  var type = typeof value;
-  return (
-    type === 'boolean' ||
-    type === 'number' ||
-    type === 'string' ||
-    type === 'undefined' ||
-    value === null
-  );
-}
-
-// mock simple fn.call in wxs
-function call(fn, args) {
-  if (args.length === 2) {
-    return fn(args[0], args[1]);
-  }
-
-  if (args.length === 1) {
-    return fn(args[0]);
-  }
-
-  return fn();
-}
-
-function serializer(args) {
-  if (args.length === 1 && isPrimitive(args[0])) {
-    return args[0];
-  }
-  var obj = {};
-  for (var i = 0; i < args.length; i++) {
-    obj['key' + i] = args[i];
-  }
-  return JSON.stringify(obj);
-}
-
-function memoize(fn) {
-  var cache = {};
-
-  return function() {
-    var key = serializer(arguments);
-    if (cache[key] === undefined) {
-      cache[key] = call(fn, arguments);
-    }
-
-    return cache[key];
-  };
-}
-
-module.exports.memoize = memoize;

+ 0 - 13
components/wxs/object.wxs

@@ -1,13 +0,0 @@
-/* eslint-disable */
-var REGEXP = getRegExp('{|}|"', 'g');
-
-function keys(obj) {
-  return JSON.stringify(obj)
-    .replace(REGEXP, '')
-    .split(',')
-    .map(function(item) {
-      return item.split(':')[0];
-    });
-}
-
-module.exports.keys = keys;

+ 0 - 12
components/wxs/utils.wxs

@@ -1,12 +0,0 @@
-var bem = require('./bem.wxs').bem;
-var memoize = require('./memoize.wxs').memoize;
-
-function isSrc(url) {
-  return url.indexOf('http') === 0 || url.indexOf('data:image') === 0 || url.indexOf('//') === 0;
-}
-
-module.exports = {
-  bem: memoize(bem),
-  isSrc: isSrc,
-  memoize: memoize
-};

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio