├── .babelrc ├── .gitignore ├── README.md ├── build ├── createBaseConfig.js ├── util.js ├── webpack.config.alipay.js ├── webpack.config.swan.js └── webpack.config.wechat.js ├── gh_7e7d7ece0a69_258.jpg ├── package.json ├── src ├── App.vue ├── app.js ├── components │ └── wrap.vue ├── pages │ ├── actionsheet │ │ ├── index.js │ │ └── index.vue │ ├── area │ │ ├── index.js │ │ └── index.vue │ ├── button │ │ ├── index.js │ │ └── index.vue │ ├── card │ │ ├── index.js │ │ └── index.vue │ ├── cell │ │ ├── index.js │ │ └── index.vue │ ├── checkbox │ │ ├── index.js │ │ └── index.vue │ ├── collapse │ │ ├── index.js │ │ └── index.vue │ ├── datetimepicker │ │ ├── index.js │ │ └── index.vue │ ├── dialog │ │ ├── index.js │ │ └── index.vue │ ├── field │ │ ├── index.js │ │ └── index.vue │ ├── goods-action │ │ ├── index.js │ │ └── index.vue │ ├── icon │ │ ├── config.js │ │ ├── index.js │ │ └── index.vue │ ├── index │ │ ├── index.js │ │ └── index.vue │ ├── layout │ │ ├── index.js │ │ └── index.vue │ ├── loading │ │ ├── index.js │ │ └── index.vue │ ├── noticebar │ │ ├── index.js │ │ └── index.vue │ ├── notify │ │ ├── index.js │ │ └── index.vue │ ├── panel │ │ ├── index.js │ │ └── index.vue │ ├── popup │ │ ├── index.js │ │ └── index.vue │ ├── progress │ │ ├── index.js │ │ └── index.vue │ ├── radio │ │ ├── index.js │ │ └── index.vue │ ├── rate │ │ ├── index.js │ │ └── index.vue │ ├── search │ │ ├── index.js │ │ └── index.vue │ ├── slider │ │ ├── index.js │ │ └── index.vue │ ├── stepper │ │ ├── index.js │ │ └── index.vue │ ├── steps │ │ ├── index.js │ │ └── index.vue │ ├── submit-bar │ │ ├── index.js │ │ └── index.vue │ ├── swipecell │ │ ├── index.js │ │ └── index.vue │ ├── switch │ │ ├── index.js │ │ └── index.vue │ ├── tag │ │ ├── index.js │ │ └── index.vue │ ├── toast │ │ ├── index.js │ │ └── index.vue │ ├── transition │ │ ├── index.js │ │ └── index.vue │ └── treeselect │ │ ├── config.js │ │ ├── index.js │ │ └── index.vue └── static │ ├── imgs │ ├── home.png │ ├── home_on.png │ ├── mine.png │ └── mine_on.png │ └── vant │ ├── action-sheet │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── area │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── badge-group │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── badge │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── button │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── card │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── cell-group │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── cell │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── checkbox-group │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── checkbox │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── col │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── collapse-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── collapse │ ├── index.js │ ├── index.json │ └── index.wxml │ ├── common │ ├── class-names.js │ ├── color.js │ ├── component.js │ ├── index.wxss │ ├── style │ │ ├── clearfix.wxss │ │ ├── ellipsis.wxss │ │ ├── hairline.wxss │ │ ├── mixins │ │ │ ├── clearfix.wxss │ │ │ ├── ellipsis.wxss │ │ │ └── hairline.wxss │ │ └── var.wxss │ ├── utils.js │ └── utils.wxs │ ├── datetime-picker │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── dialog │ ├── dialog.js │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── field │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── goods-action-button │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── goods-action-icon │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── goods-action │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── icon │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── loading │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── mixins │ ├── basic.js │ ├── button.js │ ├── link.js │ ├── observer │ │ ├── behavior.js │ │ ├── index.js │ │ └── props.js │ ├── open-type.js │ ├── touch.js │ └── transition.js │ ├── nav-bar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── notice-bar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── notify │ ├── index.js │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── notify.js │ ├── overlay │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── panel │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── popup │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── progress │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── radio-group │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── radio │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── rate │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── row │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── search │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── slider │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── stepper │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── steps │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── submit-bar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── swipe-cell │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── switch-cell │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── switch │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── tab │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── tabbar-item │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── tabbar │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── tabs │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── tag │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ ├── toast │ ├── index.js │ ├── index.json │ ├── index.wxml │ ├── index.wxss │ └── toast.js │ ├── transition │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss │ └── tree-select │ ├── index.js │ ├── index.json │ ├── index.wxml │ └── index.wxss └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "targets": { 5 | "browsers": ["last 2 versions", "safari >= 7"] 6 | }, 7 | "debug": false 8 | }] 9 | , "stage-0" 10 | ], 11 | "plugins": [ 12 | ["transform-runtime", { 13 | "helpers": false, 14 | "polyfill": false, 15 | "regenerator": true 16 | }] 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .DS_Store 3 | .idea 4 | dist-wechat 5 | *.swp 6 | *.log 7 | .vscode 8 | package-lock.json 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # megalo-vant 2 | 3 | ## 描述 4 | 5 | `megalo(0.5.4)` 结合 `vant` 组件库的代码例子,所有组件都可以用,只支持微信小程序。 6 | 7 | ## 运行 8 | 9 | ```bash 10 | git clone https://github.com/zlxbuzz/megalo-vant 11 | 12 | cd megalo-vant && yarn 13 | 14 | npm run dev #然后打开开发者工具定义目录为dist-wechat即可 15 | 16 | npm run build 17 | 18 | ``` 19 | 20 | ## 一些细节 21 | 22 | 1. 组件 slot 暂时不能多层嵌套,所以尽量只用一层。 2.组件的属性用 `vue`开发形式来绑定。 23 | 比如 24 | 25 | ```bash 26 | 33 | 38 | {{ cancelText }} 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/static/vant/action-sheet/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-action-sheet{max-height:90%!important;color:#333}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;font-size:16px;line-height:50px;text-align:center;background-color:#fff}.van-action-sheet__cancel:active,.van-action-sheet__item:active{background-color:#e8e8e8}.van-action-sheet__cancel{height:60px}.van-action-sheet__cancel::before{display:block;content:' ';height:10px;background-color:#f8f8f8}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled:active{background-color:#fff}.van-action-sheet__subname{margin-left:5px;font-size:12px;color:#7d7e80}.van-action-sheet__header{font-size:16px;font-weight:500;line-height:44px;text-align:center}.van-action-sheet__close{position:absolute!important;top:0;right:0;padding:0 15px;font-size:18px!important;line-height:inherit!important;color:#999} -------------------------------------------------------------------------------- /src/static/vant/area/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/area/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 取消 4 | {{ title }} 5 | 确定 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 26 | {{ item.name }} 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/static/vant/area/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-picker{-webkit-text-size-adjust:100%;position:relative;overflow:hidden;background-color:#fff;-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;height:44px;line-height:44px}.van-picker__cancel,.van-picker__confirm{color:#1989fa;padding:0 15px;font-size:14px}.van-picker__cancel:active,.van-picker__confirm:active{background-color:#e8e8e8}.van-picker__title{max-width:50%;font-size:16px;font-weight:500;text-align:center}.van-picker__columns{position:relative}.van-picker__loading{display:-webkit-flex;display:flex;z-index:4;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;background-color:rgba(255,255,255,.9)}.van-picker-column{-webkit-flex:1;flex:1;overflow:hidden;font-size:16px;text-align:center}.van-picker-column__item{padding:0 5px;color:#999}.van-picker-column__item--selected{font-weight:500;color:#333}.van-picker-column__item--disabled{opacity:.3} -------------------------------------------------------------------------------- /src/static/vant/badge-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { isNumber } from '../common/utils'; 3 | VantComponent({ 4 | relation: { 5 | name: 'badge', 6 | type: 'descendant', 7 | linked: function linked(target) { 8 | this.badges.push(target); 9 | this.setActive(); 10 | }, 11 | unlinked: function unlinked(target) { 12 | this.badges = this.badges.filter(function (item) { 13 | return item !== target; 14 | }); 15 | this.setActive(); 16 | } 17 | }, 18 | props: { 19 | active: { 20 | type: Number, 21 | value: 0 22 | } 23 | }, 24 | watch: { 25 | active: 'setActive' 26 | }, 27 | beforeCreate: function beforeCreate() { 28 | this.badges = []; 29 | this.currentActive = -1; 30 | }, 31 | methods: { 32 | setActive: function setActive(badge) { 33 | var active = this.data.active; 34 | var badges = this.badges; 35 | 36 | if (badge && !isNumber(badge)) { 37 | active = badges.indexOf(badge); 38 | } 39 | 40 | if (active === this.currentActive) { 41 | return; 42 | } 43 | 44 | if (this.currentActive !== -1 && badges[this.currentActive]) { 45 | this.$emit('change', active); 46 | badges[this.currentActive].setActive(false); 47 | } 48 | 49 | if (badges[active]) { 50 | badges[active].setActive(true); 51 | this.currentActive = active; 52 | } 53 | } 54 | } 55 | }); -------------------------------------------------------------------------------- /src/static/vant/badge-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/badge-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/static/vant/badge-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-badge-group{width:85px} -------------------------------------------------------------------------------- /src/static/vant/badge/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | type: 'ancestor', 5 | name: 'badge-group' 6 | }, 7 | props: { 8 | info: Number, 9 | title: String 10 | }, 11 | methods: { 12 | onClick: function onClick() { 13 | var group = this.getRelationNodes('../badge-group/index')[0]; 14 | 15 | if (group) { 16 | group.setActive(this); 17 | } 18 | }, 19 | setActive: function setActive(active) { 20 | this.set({ 21 | active: active 22 | }); 23 | } 24 | } 25 | }); -------------------------------------------------------------------------------- /src/static/vant/badge/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/badge/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{ info }} 3 | {{ title }} 4 | 5 | -------------------------------------------------------------------------------- /src/static/vant/badge/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-badge{display:block;overflow:hidden;font-size:14px;line-height:1.4;-webkit-user-select:none;user-select:none;color:#7d7e80;word-break:break-all;box-sizing:border-box;padding:20px 12px 20px 9px;background-color:#f8f8f8;border-left:3px solid transparent}.van-badge:active{background-color:#e8e8e8}.van-badge::after{border-bottom-width:1px}.van-badge--active{font-weight:700;color:#333;border-color:#f44}.van-badge--active::after{border-right-width:1px}.van-badge--active,.van-badge--active:active{background-color:#fff}.van-badge__info{position:absolute;top:4px;right:2px;color:#fff;font-size:12px;font-weight:500;-webkit-transform:scale(.8);transform:scale(.8);text-align:center;box-sizing:border-box;padding:0 6px;min-width:18px;line-height:18px;border-radius:9px;background-color:#f44} -------------------------------------------------------------------------------- /src/static/vant/button/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from "../common/component"; 2 | import { button } from "../mixins/button"; 3 | import { openType } from "../mixins/open-type"; 4 | VantComponent({ 5 | classes: ["loading-class"], 6 | mixins: [button, openType], 7 | props: { 8 | plain: Boolean, 9 | block: Boolean, 10 | round: Boolean, 11 | square: Boolean, 12 | loading: Boolean, 13 | disabled: Boolean, 14 | type: { 15 | type: String, 16 | value: "default" 17 | }, 18 | size: { 19 | type: String, 20 | value: "normal" 21 | } 22 | }, 23 | computed: { 24 | classes: function classes() { 25 | var _this$data = this.data, 26 | type = _this$data.type, 27 | size = _this$data.size, 28 | block = _this$data.block, 29 | plain = _this$data.plain, 30 | round = _this$data.round, 31 | square = _this$data.square, 32 | loading = _this$data.loading, 33 | disabled = _this$data.disabled; 34 | return this.classNames( 35 | "van-button", 36 | "van-button--" + type, 37 | "van-button--" + size, 38 | { 39 | "van-button--block": block, 40 | "van-button--round": round, 41 | "van-button--plain": plain, 42 | "van-button--square": square, 43 | "van-button--loading": loading, 44 | "van-button--disabled": disabled, 45 | "van-button--unclickable": disabled || loading 46 | } 47 | ); 48 | } 49 | }, 50 | methods: { 51 | onClick: function onClick() { 52 | if (!this.data.disabled && !this.data.loading) { 53 | this.$emit("click"); 54 | } 55 | } 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /src/static/vant/button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } -------------------------------------------------------------------------------- /src/static/vant/button/index.wxml: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /src/static/vant/button/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-button{position:relative;padding:0;display:inline-block;height:44px;line-height:42px;border-radius:2px;box-sizing:border-box;font-size:16px;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%}.van-button::after{content:" ";position:absolute;top:50%;left:50%;opacity:0;width:100%;height:100%;border:inherit;border-color:#000;background-color:#000;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-button:active::after{opacity:.15}.van-button--unclickable::after{display:none}.van-button--default{color:#333;background-color:#fff;border:1px solid #eee}.van-button--primary{color:#fff;background-color:#4b0;border:1px solid #4b0}.van-button--danger{color:#fff;background-color:#f44;border:1px solid #f44}.van-button--warning{color:#fff;background-color:#ff976a;border:1px solid #ff976a}.van-button--plain{background-color:#fff}.van-button--plain.van-button--primary{color:#4b0}.van-button--plain.van-button--danger{color:#f44}.van-button--plain.van-button--warning{color:#ff976a}.van-button--large{width:100%;height:50px;line-height:48px}.van-button--normal{padding:0 15px;font-size:14px}.van-button--small{height:30px;padding:0 8px;min-width:60px;font-size:12px;line-height:28px}.van-button--mini{display:inline-block;width:50px;height:22px;line-height:20px;font-size:10px}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{width:100%;display:block}.van-button--round{border-radius:10em}.van-button--square{border-radius:0}.van-button--disabled{opacity:.5} -------------------------------------------------------------------------------- /src/static/vant/card/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | classes: ['num-class', 'desc-class', 'thumb-class', 'title-class', 'price-class', 'origin-price-class'], 5 | mixins: [link], 6 | props: { 7 | tag: String, 8 | num: String, 9 | desc: String, 10 | thumb: String, 11 | title: String, 12 | price: String, 13 | centered: Boolean, 14 | lazyLoad: Boolean, 15 | thumbLink: String, 16 | originPrice: String, 17 | thumbMode: { 18 | type: String, 19 | value: 'scaleToFill' 20 | }, 21 | currency: { 22 | type: String, 23 | value: '¥' 24 | } 25 | }, 26 | methods: { 27 | onClickThumb: function onClickThumb() { 28 | this.jumpLink('thumbLink'); 29 | } 30 | } 31 | }); -------------------------------------------------------------------------------- /src/static/vant/card/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-tag": "../tag/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/card/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 17 | {{ tag }} 18 | 19 | 20 | 21 | 22 | 23 | {{ title }} 24 | 25 | 26 | {{ desc }} 27 | 28 | 29 | 30 | 31 | 32 | {{ currency }} {{ price }} 33 | {{ currency }} {{ originPrice }} 34 | x {{ num }} 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/static/vant/card/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-card{box-sizing:border-box;position:relative;height:100px;font-size:12px;color:#333;padding:5px 15px 5px 115px;background:#fafafa}.van-card--center{-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{position:absolute;top:5px;left:15px;width:90px;height:90px}.van-card__img{width:100%;height:100%}.van-card,.van-card__content{display:-webkit-flex;display:flex}.van-card__content{width:100%}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px}.van-card__desc{max-height:20px;color:#7d7e80}.van-card__left{-webkit-flex:1;flex:1;min-width:0}.van-card__right{-webkit-flex:none;flex:none;padding-left:10px;line-height:20px;text-align:right}.van-card__origin-price{color:#7d7e80;text-decoration:line-through}.van-card__num{color:#7d7e80}.van-card__tag{position:absolute;top:2px;left:0}.van-card__footer{position:absolute;right:15px;bottom:5px}.van-card__footer .van-button{margin-left:5px} -------------------------------------------------------------------------------- /src/static/vant/cell-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | border: { 5 | type: Boolean, 6 | value: true 7 | } 8 | } 9 | }); -------------------------------------------------------------------------------- /src/static/vant/cell-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/cell-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/static/vant/cell-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /src/static/vant/cell/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | classes: ['title-class', 'label-class', 'value-class', 'right-icon-class'], 5 | mixins: [link], 6 | props: { 7 | title: null, 8 | value: null, 9 | icon: String, 10 | size: String, 11 | label: String, 12 | center: Boolean, 13 | isLink: Boolean, 14 | required: Boolean, 15 | clickable: Boolean, 16 | titleWidth: String, 17 | customStyle: String, 18 | arrowDirection: String, 19 | border: { 20 | type: Boolean, 21 | value: true 22 | } 23 | }, 24 | computed: { 25 | cellClass: function cellClass() { 26 | var data = this.data; 27 | return this.classNames('van-cell', { 28 | 'van-cell--center': data.center, 29 | 'van-cell--required': data.required, 30 | 'van-cell--borderless': !data.border, 31 | 'van-cell--clickable': data.isLink || data.clickable, 32 | ["van-cell--" + data.size]: data.size 33 | }); 34 | }, 35 | titleStyle: function titleStyle() { 36 | var titleWidth = this.data.titleWidth; 37 | return titleWidth ? "max-width: " + titleWidth + ";min-width: " + titleWidth : ''; 38 | } 39 | }, 40 | methods: { 41 | onClick: function onClick(event) { 42 | this.$emit('click', event.detail); 43 | this.jumpLink(); 44 | } 45 | } 46 | }); -------------------------------------------------------------------------------- /src/static/vant/cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } -------------------------------------------------------------------------------- /src/static/vant/cell/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 12 | 13 | 14 | 18 | 19 | {{ title }} 20 | {{ label }} 21 | 22 | 23 | 24 | 25 | 26 | {{ value }} 27 | 28 | 29 | 30 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/static/vant/cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{content:' ';position:absolute;pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;top:auto;left:15px;right:0;bottom:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom:1px solid #eee}.van-cell--borderless::after{display:none}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:18px;color:#7d7e80}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon-wrap,.van-cell__right-icon-wrap{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:24px;font-size:16px}.van-cell__left-icon-wrap{margin-right:5px}.van-cell__right-icon-wrap{margin-left:5px;color:#999}.van-cell__left-icon{line-height:24px;vertical-align:middle}.van-cell__right-icon{line-height:24px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}.van-cell--large{padding-top:12px;padding-bottom:12px}.van-cell--large .van-cell__title{font-size:16px} -------------------------------------------------------------------------------- /src/static/vant/checkbox-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'checkbox', 6 | type: 'descendant', 7 | linked: function linked(target) { 8 | var _this$data = this.data, 9 | value = _this$data.value, 10 | disabled = _this$data.disabled; 11 | target.set({ 12 | value: value.indexOf(target.data.name) !== -1, 13 | disabled: disabled || target.data.disabled 14 | }); 15 | } 16 | }, 17 | props: { 18 | value: Array, 19 | disabled: Boolean, 20 | max: Number 21 | }, 22 | watch: { 23 | value: function value(_value) { 24 | var children = this.getRelationNodes('../checkbox/index'); 25 | children.forEach(function (child) { 26 | child.set({ 27 | value: _value.indexOf(child.data.name) !== -1 28 | }); 29 | }); 30 | }, 31 | disabled: function disabled(_disabled) { 32 | var children = this.getRelationNodes('../checkbox/index'); 33 | children.forEach(function (child) { 34 | child.set({ 35 | disabled: _disabled || child.data.disabled 36 | }); 37 | }); 38 | } 39 | } 40 | }); -------------------------------------------------------------------------------- /src/static/vant/checkbox-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/checkbox-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/static/vant/checkbox-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /src/static/vant/checkbox/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/checkbox/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/static/vant/checkbox/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-checkbox{overflow:hidden;-webkit-user-select:none;user-select:none}.van-checkbox__icon-wrap,.van-checkbox__label{display:inline-block;line-height:20px;vertical-align:middle}.van-checkbox__icon{box-sizing:border-box;display:block;width:20px;height:20px;border:1px solid #e5e5e5;color:transparent;font-size:14px;text-align:center;transition:.2s}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{color:#fff;border-color:#1989fa;background-color:#1989fa}.van-checkbox__icon--disabled{border-color:#eee;background-color:currentColor;color:#f8f8f8}.van-checkbox__icon--disabled.van-checkbox__icon--checked{border-color:#eee;background-color:#eee}.van-checkbox__label{margin-left:10px}.van-checkbox__label--left{margin:0 10px 0 0;float:left}.van-checkbox__label:empty{margin:0} -------------------------------------------------------------------------------- /src/static/vant/col/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'row', 5 | type: 'ancestor' 6 | }, 7 | props: { 8 | span: Number, 9 | offset: Number 10 | }, 11 | data: { 12 | style: '' 13 | }, 14 | computed: { 15 | classes: function classes() { 16 | var _this$data = this.data, 17 | span = _this$data.span, 18 | offset = _this$data.offset; 19 | return this.classNames('van-col', { 20 | ["van-col--" + span]: span, 21 | ["van-col--offset-" + offset]: offset 22 | }); 23 | } 24 | }, 25 | methods: { 26 | setGutter: function setGutter(gutter) { 27 | var padding = gutter / 2 + "px"; 28 | var style = gutter ? "padding-left: " + padding + "; padding-right: " + padding + ";" : ''; 29 | 30 | if (style !== this.data.style) { 31 | this.set({ 32 | style: style 33 | }); 34 | } 35 | } 36 | } 37 | }); -------------------------------------------------------------------------------- /src/static/vant/col/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/col/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/static/vant/col/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} -------------------------------------------------------------------------------- /src/static/vant/collapse-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/collapse-item/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 14 | 18 | 22 | 23 | 27 | 28 | 32 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/static/vant/collapse-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-collapse-item__title .van-cell__right-icon{-webkit-transform:rotate(90deg);transform:rotate(90deg);transition:.3s}.van-collapse-item__title--expanded .van-cell__right-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.van-collapse-item__title--disabled .van-cell,.van-collapse-item__title--disabled .van-cell__right-icon{color:#c9c9c9!important}.van-collapse-item__title--disabled:active{background-color:#fff!important}.van-collapse-item__wrapper{overflow:hidden;will-change:max-height;transition:max-height .3s ease-in-out}.van-collapse-item__content{padding:15px;background-color:#fff} -------------------------------------------------------------------------------- /src/static/vant/collapse/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from "../common/component"; 2 | VantComponent({ 3 | relation: { 4 | name: "collapse-item", 5 | type: "descendant", 6 | linked: function linked(child) { 7 | this.set( 8 | { 9 | items: this.data.items.concat([child]) 10 | }, 11 | function() { 12 | child.updateExpanded(); 13 | } 14 | ); 15 | } 16 | }, 17 | props: { 18 | accordion: Boolean, 19 | value: null 20 | }, 21 | data: { 22 | items: [] 23 | }, 24 | watch: { 25 | value: function value() { 26 | this.data.items.forEach(function(child) { 27 | child.updateExpanded(); 28 | }); 29 | }, 30 | accordion: function accordion() { 31 | this.data.items.forEach(function(child) { 32 | child.updateExpanded(); 33 | }); 34 | } 35 | }, 36 | methods: { 37 | switch: function _switch(name, expanded) { 38 | var _this$data = this.data, 39 | accordion = _this$data.accordion, 40 | value = _this$data.value; 41 | 42 | if (!accordion) { 43 | name = expanded 44 | ? value.concat(name) 45 | : value.filter(function(activeName) { 46 | return activeName !== name; 47 | }); 48 | } else { 49 | name = expanded ? name : ""; 50 | } 51 | 52 | this.$emit("change", name); 53 | this.$emit("input", name); 54 | } 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /src/static/vant/collapse/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/collapse/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/static/vant/common/class-names.js: -------------------------------------------------------------------------------- 1 | var hasOwn = {}.hasOwnProperty; 2 | export function classNames() { 3 | var classes = []; 4 | 5 | for (var i = 0; i < arguments.length; i++) { 6 | var arg = arguments[i]; 7 | if (!arg) continue; 8 | var argType = typeof arg; 9 | 10 | if (argType === 'string' || argType === 'number') { 11 | classes.push(arg); 12 | } else if (Array.isArray(arg) && arg.length) { 13 | var inner = classNames.apply(null, arg); 14 | 15 | if (inner) { 16 | classes.push(inner); 17 | } 18 | } else if (argType === 'object') { 19 | for (var key in arg) { 20 | if (hasOwn.call(arg, key) && arg[key]) { 21 | classes.push(key); 22 | } 23 | } 24 | } 25 | } 26 | 27 | return classes.join(' '); 28 | } 29 | ; -------------------------------------------------------------------------------- /src/static/vant/common/color.js: -------------------------------------------------------------------------------- 1 | export var RED = '#f44'; 2 | export var BLUE = '#1989fa'; 3 | export var GREEN = '#4b0'; -------------------------------------------------------------------------------- /src/static/vant/common/component.js: -------------------------------------------------------------------------------- 1 | import { basic } from '../mixins/basic'; 2 | import { observe } from '../mixins/observer/index'; 3 | 4 | function mapKeys(source, target, map) { 5 | Object.keys(map).forEach(function (key) { 6 | if (source[key]) { 7 | target[map[key]] = source[key]; 8 | } 9 | }); 10 | } 11 | 12 | function VantComponent(vantOptions) { 13 | if (vantOptions === void 0) { 14 | vantOptions = {}; 15 | } 16 | 17 | var options = {}; 18 | mapKeys(vantOptions, options, { 19 | data: 'data', 20 | props: 'properties', 21 | mixins: 'behaviors', 22 | methods: 'methods', 23 | beforeCreate: 'created', 24 | created: 'attached', 25 | mounted: 'ready', 26 | relations: 'relations', 27 | destroyed: 'detached', 28 | classes: 'externalClasses' 29 | }); 30 | var _vantOptions = vantOptions, 31 | relation = _vantOptions.relation; 32 | 33 | if (relation) { 34 | options.relations = Object.assign(options.relations || {}, { 35 | ["../" + relation.name + "/index"]: relation 36 | }); 37 | } // add default externalClasses 38 | 39 | 40 | options.externalClasses = options.externalClasses || []; 41 | options.externalClasses.push('custom-class'); // add default behaviors 42 | 43 | options.behaviors = options.behaviors || []; 44 | options.behaviors.push(basic); // map field to form-field behavior 45 | 46 | if (vantOptions.field) { 47 | options.behaviors.push('wx://form-field'); 48 | } // add default options 49 | 50 | 51 | options.options = { 52 | multipleSlots: true, 53 | addGlobalClass: true 54 | }; 55 | observe(vantOptions, options); 56 | Component(options); 57 | } 58 | 59 | export { VantComponent }; -------------------------------------------------------------------------------- /src/static/vant/common/index.wxss: -------------------------------------------------------------------------------- 1 | .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} -------------------------------------------------------------------------------- /src/static/vant/common/style/clearfix.wxss: -------------------------------------------------------------------------------- 1 | .van-clearfix::after{content:'';display:table;clear:both} -------------------------------------------------------------------------------- /src/static/vant/common/style/ellipsis.wxss: -------------------------------------------------------------------------------- 1 | .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} -------------------------------------------------------------------------------- /src/static/vant/common/style/hairline.wxss: -------------------------------------------------------------------------------- 1 | .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} -------------------------------------------------------------------------------- /src/static/vant/common/style/mixins/clearfix.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlxbuzz/megalo-vant/dcc1fa1732bdd1b11738be8e2c6ea0f80850befc/src/static/vant/common/style/mixins/clearfix.wxss -------------------------------------------------------------------------------- /src/static/vant/common/style/mixins/ellipsis.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlxbuzz/megalo-vant/dcc1fa1732bdd1b11738be8e2c6ea0f80850befc/src/static/vant/common/style/mixins/ellipsis.wxss -------------------------------------------------------------------------------- /src/static/vant/common/style/mixins/hairline.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlxbuzz/megalo-vant/dcc1fa1732bdd1b11738be8e2c6ea0f80850befc/src/static/vant/common/style/mixins/hairline.wxss -------------------------------------------------------------------------------- /src/static/vant/common/style/var.wxss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zlxbuzz/megalo-vant/dcc1fa1732bdd1b11738be8e2c6ea0f80850befc/src/static/vant/common/style/var.wxss -------------------------------------------------------------------------------- /src/static/vant/common/utils.js: -------------------------------------------------------------------------------- 1 | function isDef(value) { 2 | return value !== undefined && value !== null; 3 | } 4 | 5 | function isObj(x) { 6 | var type = typeof x; 7 | return x !== null && (type === 'object' || type === 'function'); 8 | } 9 | 10 | function isNumber(value) { 11 | return /^\d+$/.test(value); 12 | } 13 | 14 | export { isObj, isDef, isNumber }; -------------------------------------------------------------------------------- /src/static/vant/common/utils.wxs: -------------------------------------------------------------------------------- 1 | function isSrc(url) { 2 | return url.indexOf('http') === 0 || url.indexOf('data:image') === 0; 3 | } 4 | 5 | module.exports.isSrc = isSrc; 6 | -------------------------------------------------------------------------------- /src/static/vant/datetime-picker/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/datetime-picker/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | {{ cancelButtonText }} 4 | {{ title }} 5 | {{ confirmButtonText }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 19 | 26 | {{ item }} 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/static/vant/datetime-picker/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-picker{-webkit-text-size-adjust:100%;position:relative;overflow:hidden;background-color:#fff;-webkit-user-select:none;user-select:none}.van-picker__toolbar{display:-webkit-flex;display:flex;-webkit-justify-content:space-between;justify-content:space-between;height:44px;line-height:44px}.van-picker__cancel,.van-picker__confirm{color:#1989fa;padding:0 15px;font-size:14px}.van-picker__cancel:active,.van-picker__confirm:active{background-color:#e8e8e8}.van-picker__title{max-width:50%;font-size:16px;font-weight:500;text-align:center}.van-picker__columns{position:relative}.van-picker__loading{display:-webkit-flex;display:flex;z-index:4;position:absolute;top:0;right:0;bottom:0;left:0;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;background-color:rgba(255,255,255,.9)}.van-picker-column{-webkit-flex:1;flex:1;overflow:hidden;font-size:16px;text-align:center}.van-picker-column__item{padding:0 5px;color:#999}.van-picker-column__item--selected{font-weight:500;color:#333}.van-picker-column__item--disabled{opacity:.3} -------------------------------------------------------------------------------- /src/static/vant/dialog/dialog.js: -------------------------------------------------------------------------------- 1 | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } 2 | 3 | var queue = []; 4 | 5 | function getContext() { 6 | var pages = getCurrentPages(); 7 | return pages[pages.length - 1]; 8 | } 9 | 10 | var Dialog = function Dialog(options) { 11 | options = _extends({}, Dialog.currentOptions, options); 12 | return new Promise(function (resolve, reject) { 13 | var context = options.context || getContext(); 14 | var dialog = context.selectComponent(options.selector); 15 | delete options.selector; 16 | 17 | if (dialog) { 18 | dialog.set(_extends({ 19 | onCancel: reject, 20 | onConfirm: resolve 21 | }, options)); 22 | queue.push(dialog); 23 | } else { 24 | console.warn('未找到 van-dialog 节点,请确认 selector 及 context 是否正确'); 25 | } 26 | }); 27 | }; 28 | 29 | Dialog.defaultOptions = { 30 | show: true, 31 | title: '', 32 | message: '', 33 | zIndex: 100, 34 | overlay: true, 35 | asyncClose: false, 36 | transition: 'scale', 37 | selector: '#van-dialog', 38 | confirmButtonText: '确认', 39 | cancelButtonText: '取消', 40 | showConfirmButton: true, 41 | showCancelButton: false, 42 | closeOnClickOverlay: false, 43 | confirmButtonOpenType: '' 44 | }; 45 | Dialog.alert = Dialog; 46 | 47 | Dialog.confirm = function (options) { 48 | return Dialog(_extends({ 49 | showCancelButton: true 50 | }, options)); 51 | }; 52 | 53 | Dialog.close = function () { 54 | queue.forEach(function (dialog) { 55 | dialog.close(); 56 | }); 57 | queue = []; 58 | }; 59 | 60 | Dialog.stopLoading = function () { 61 | queue.forEach(function (dialog) { 62 | dialog.stopLoading(); 63 | }); 64 | }; 65 | 66 | Dialog.setDefaultOptions = function (options) { 67 | Object.assign(Dialog.currentOptions, options); 68 | }; 69 | 70 | Dialog.resetDefaultOptions = function () { 71 | Dialog.currentOptions = _extends({}, Dialog.defaultOptions); 72 | }; 73 | 74 | Dialog.resetDefaultOptions(); 75 | export default Dialog; -------------------------------------------------------------------------------- /src/static/vant/dialog/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { openType } from '../mixins/open-type'; 3 | VantComponent({ 4 | mixins: [openType], 5 | props: { 6 | show: Boolean, 7 | title: String, 8 | message: String, 9 | useSlot: Boolean, 10 | asyncClose: Boolean, 11 | showCancelButton: Boolean, 12 | closeOnClickOverlay: Boolean, 13 | confirmButtonOpenType: String, 14 | zIndex: { 15 | type: Number, 16 | value: 100 17 | }, 18 | confirmButtonText: { 19 | type: String, 20 | value: '确认' 21 | }, 22 | cancelButtonText: { 23 | type: String, 24 | value: '取消' 25 | }, 26 | showConfirmButton: { 27 | type: Boolean, 28 | value: true 29 | }, 30 | overlay: { 31 | type: Boolean, 32 | value: true 33 | }, 34 | transition: { 35 | type: String, 36 | value: 'scale' 37 | } 38 | }, 39 | data: { 40 | loading: { 41 | confirm: false, 42 | cancel: false 43 | } 44 | }, 45 | watch: { 46 | show: function show(_show) { 47 | !_show && this.stopLoading(); 48 | } 49 | }, 50 | methods: { 51 | onConfirm: function onConfirm() { 52 | this.handleAction('confirm'); 53 | }, 54 | onCancel: function onCancel() { 55 | this.handleAction('cancel'); 56 | }, 57 | onClickOverlay: function onClickOverlay() { 58 | this.onClose('overlay'); 59 | }, 60 | handleAction: function handleAction(action) { 61 | if (this.data.asyncClose) { 62 | this.set({ 63 | ["loading." + action]: true 64 | }); 65 | } 66 | 67 | this.onClose(action); 68 | }, 69 | close: function close() { 70 | this.set({ 71 | show: false 72 | }); 73 | }, 74 | stopLoading: function stopLoading() { 75 | this.set({ 76 | loading: { 77 | confirm: false, 78 | cancel: false 79 | } 80 | }); 81 | }, 82 | onClose: function onClose(action) { 83 | if (!this.data.asyncClose) { 84 | this.close(); 85 | } 86 | 87 | this.$emit('close', action); 88 | this.$emit(action); 89 | var callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel']; 90 | 91 | if (callback) { 92 | callback(this); 93 | } 94 | } 95 | } 96 | }); -------------------------------------------------------------------------------- /src/static/vant/dialog/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "../popup/index", 5 | "van-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/static/vant/dialog/index.wxml: -------------------------------------------------------------------------------- 1 | 10 | 14 | {{ title }} 15 | 16 | 17 | 18 | 22 | {{ message }} 23 | 24 | 25 | 26 | 34 | {{ cancelButtonText }} 35 | 36 | 50 | {{ confirmButtonText }} 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/static/vant/dialog/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-dialog{width:85%;font-size:16px;overflow:hidden;border-radius:4px;background-color:#fff}.van-dialog__header{font-weight:500;padding-top:25px;text-align:center}.van-dialog__header--isolated{padding:25px 0}.van-dialog__message{padding:25px;font-size:14px;line-height:1.5;max-height:60vh;overflow-y:auto;-webkit-overflow-scrolling:touch}.van-dialog__message--has-title{padding-top:12px;color:#7d7e80}.van-dialog__footer{display:-webkit-flex;display:flex}.van-dialog__button{-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog__confirm,.van-dialog__confirm:active{color:#1989fa!important}.van-dialog-bounce-enter{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7)}.van-dialog-bounce-leave-active{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.9);transform:translate3d(-50%,-50%,0) scale(.9)} -------------------------------------------------------------------------------- /src/static/vant/field/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index", 5 | "van-icon": "../icon/index" 6 | } 7 | } -------------------------------------------------------------------------------- /src/static/vant/field/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{border:0;margin:0;padding:0;width:100%;height:24px;resize:none;display:block;text-align:left;min-height:24px;line-height:inherit;box-sizing:border-box;background-color:transparent}.van-field__input--disabled{opacity:1;color:#7d7e80;background-color:transparent}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__clear-root{height:24px}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__clear{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon{display:block!important}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left}.van-field--error{color:#f44} -------------------------------------------------------------------------------- /src/static/vant/goods-action-button/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { link } from '../mixins/link'; 3 | import { button } from '../mixins/button'; 4 | import { openType } from '../mixins/open-type'; 5 | VantComponent({ 6 | mixins: [link, button, openType], 7 | props: { 8 | text: String, 9 | loading: Boolean, 10 | disabled: Boolean, 11 | type: { 12 | type: String, 13 | value: 'danger' 14 | } 15 | }, 16 | methods: { 17 | onClick: function onClick(event) { 18 | this.$emit('click', event.detail); 19 | this.jumpLink(); 20 | } 21 | } 22 | }); -------------------------------------------------------------------------------- /src/static/vant/goods-action-button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/goods-action-button/index.wxml: -------------------------------------------------------------------------------- 1 | 24 | {{ text }} 25 | 26 | -------------------------------------------------------------------------------- /src/static/vant/goods-action-button/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1} -------------------------------------------------------------------------------- /src/static/vant/goods-action-icon/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { link } from '../mixins/link'; 3 | import { button } from '../mixins/button'; 4 | import { openType } from '../mixins/open-type'; 5 | VantComponent({ 6 | mixins: [link, button, openType], 7 | props: { 8 | text: String, 9 | info: String, 10 | icon: String 11 | }, 12 | methods: { 13 | onClick: function onClick(event) { 14 | this.$emit('click', event.detail); 15 | this.jumpLink(); 16 | } 17 | } 18 | }); -------------------------------------------------------------------------------- /src/static/vant/goods-action-icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/static/vant/goods-action-icon/index.wxml: -------------------------------------------------------------------------------- 1 | 23 | 24 | 30 | {{ text }} 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/static/vant/goods-action-icon/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action-icon{width:50px!important;border:none!important}.van-goods-action-icon__content{height:100%;display:-webkit-flex;display:flex;line-height:1;font-size:10px;color:#7d7e80;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center}.van-goods-action-icon__icon{margin-bottom:5px} -------------------------------------------------------------------------------- /src/static/vant/goods-action/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | safeAreaInsetBottom: { 5 | type: Boolean, 6 | value: true 7 | } 8 | }, 9 | computed: { 10 | rootClass: function rootClass() { 11 | var _this$data = this.data, 12 | safeAreaInsetBottom = _this$data.safeAreaInsetBottom, 13 | isIPhoneX = _this$data.isIPhoneX; 14 | return this.classNames('van-goods-action', 'custom-class', { 15 | ["van-goods-action--safe"]: isIPhoneX && safeAreaInsetBottom 16 | }); 17 | } 18 | } 19 | }); -------------------------------------------------------------------------------- /src/static/vant/goods-action/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/goods-action/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/static/vant/goods-action/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action{position:fixed;right:0;bottom:0;left:0;display:-webkit-flex;display:flex;background-color:#fff}.van-goods-action--safe{padding-bottom:34px} -------------------------------------------------------------------------------- /src/static/vant/icon/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | info: null, 5 | name: String, 6 | size: String, 7 | color: String, 8 | customStyle: String, 9 | classPrefix: { 10 | type: String, 11 | value: 'van-icon' 12 | } 13 | }, 14 | methods: { 15 | onClick: function onClick() { 16 | this.$emit('click'); 17 | } 18 | } 19 | }); -------------------------------------------------------------------------------- /src/static/vant/icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/icon/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 10 | {{ info }} 11 | 12 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/static/vant/loading/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | size: { 5 | type: String, 6 | value: '30px' 7 | }, 8 | type: { 9 | type: String, 10 | value: 'circular' 11 | }, 12 | color: { 13 | type: String, 14 | value: '#c9c9c9' 15 | } 16 | } 17 | }); -------------------------------------------------------------------------------- /src/static/vant/loading/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/loading/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/static/vant/loading/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-loading{z-index:0;font-size:0;line-height:0;position:relative;display:inline-block;vertical-align:middle}.van-loading__spinner{z-index:-1;width:100%;height:100%;position:relative;display:inline-block;box-sizing:border-box;-webkit-animation:van-rotate .8s linear infinite;animation:van-rotate .8s linear infinite}.van-loading__spinner--spinner{-webkit-animation-timing-function:steps(12);animation-timing-function:steps(12)}.van-loading__spinner--circular{border:1px solid;border-radius:100%;border-color:currentColor;border-top-color:transparent}.van-loading__dot{top:0;left:0;width:100%;height:100%;position:absolute}.van-loading__dot::before{width:2px;height:25%;content:' ';display:block;margin:0 auto;border-radius:40%;background-color:currentColor}.van-loading__dot:nth-of-type(1){opacity:1;-webkit-transform:rotate(30deg);transform:rotate(30deg)}.van-loading__dot:nth-of-type(2){opacity:.9375;-webkit-transform:rotate(60deg);transform:rotate(60deg)}.van-loading__dot:nth-of-type(3){opacity:.875;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-loading__dot:nth-of-type(4){opacity:.8125;-webkit-transform:rotate(120deg);transform:rotate(120deg)}.van-loading__dot:nth-of-type(5){opacity:.75;-webkit-transform:rotate(150deg);transform:rotate(150deg)}.van-loading__dot:nth-of-type(6){opacity:.6875;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-loading__dot:nth-of-type(7){opacity:.625;-webkit-transform:rotate(210deg);transform:rotate(210deg)}.van-loading__dot:nth-of-type(8){opacity:.5625;-webkit-transform:rotate(240deg);transform:rotate(240deg)}.van-loading__dot:nth-of-type(9){opacity:.5;-webkit-transform:rotate(270deg);transform:rotate(270deg)}.van-loading__dot:nth-of-type(10){opacity:.4375;-webkit-transform:rotate(300deg);transform:rotate(300deg)}.van-loading__dot:nth-of-type(11){opacity:.375;-webkit-transform:rotate(330deg);transform:rotate(330deg)}.van-loading__dot:nth-of-type(12){opacity:.3125;-webkit-transform:rotate(360deg);transform:rotate(360deg)}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}} -------------------------------------------------------------------------------- /src/static/vant/mixins/basic.js: -------------------------------------------------------------------------------- 1 | import { classNames } from '../common/class-names'; 2 | export var basic = Behavior({ 3 | created: function created() { 4 | var _this = this; 5 | 6 | wx.getSystemInfo({ 7 | success: function success(_ref) { 8 | var model = _ref.model, 9 | screenHeight = _ref.screenHeight; 10 | var isIphoneX = /iphone x/i.test(model); 11 | var isIphoneNew = /iPhone11/i.test(model) && screenHeight === 812; 12 | 13 | if (isIphoneX || isIphoneNew) { 14 | _this.set({ 15 | isIPhoneX: true 16 | }); 17 | } 18 | } 19 | }); 20 | }, 21 | methods: { 22 | classNames: classNames, 23 | $emit: function $emit() { 24 | this.triggerEvent.apply(this, arguments); 25 | }, 26 | getRect: function getRect(selector, all) { 27 | var _this2 = this; 28 | 29 | return new Promise(function (resolve) { 30 | wx.createSelectorQuery().in(_this2)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) { 31 | if (all && Array.isArray(rect) && rect.length) { 32 | resolve(rect); 33 | } 34 | 35 | if (!all && rect) { 36 | resolve(rect); 37 | } 38 | }).exec(); 39 | }); 40 | } 41 | } 42 | }); -------------------------------------------------------------------------------- /src/static/vant/mixins/button.js: -------------------------------------------------------------------------------- 1 | export var button = Behavior({ 2 | properties: { 3 | id: String, 4 | sessionFrom: String, 5 | appParameter: String, 6 | sendMessageImg: String, 7 | sendMessagePath: String, 8 | showMessageCard: String, 9 | sendMessageTitle: String, 10 | lang: { 11 | type: String, 12 | value: 'en' 13 | } 14 | } 15 | }); -------------------------------------------------------------------------------- /src/static/vant/mixins/link.js: -------------------------------------------------------------------------------- 1 | export var link = Behavior({ 2 | properties: { 3 | url: String, 4 | linkType: { 5 | type: String, 6 | value: 'navigateTo' 7 | } 8 | }, 9 | methods: { 10 | jumpLink: function jumpLink(urlKey) { 11 | if (urlKey === void 0) { 12 | urlKey = 'url'; 13 | } 14 | 15 | var url = this.data[urlKey]; 16 | 17 | if (url) { 18 | wx[this.data.linkType]({ 19 | url: url 20 | }); 21 | } 22 | } 23 | } 24 | }); -------------------------------------------------------------------------------- /src/static/vant/mixins/observer/behavior.js: -------------------------------------------------------------------------------- 1 | export var behavior = Behavior({ 2 | created: function created() { 3 | var _this = this; 4 | 5 | if (!this.$options) { 6 | return; 7 | } 8 | 9 | var cache = {}; 10 | 11 | var _this$$options = this.$options(), 12 | computed = _this$$options.computed; 13 | 14 | var keys = Object.keys(computed); 15 | 16 | this.calcComputed = function () { 17 | var needUpdate = {}; 18 | keys.forEach(function (key) { 19 | var value = computed[key].call(_this); 20 | 21 | if (cache[key] !== value) { 22 | cache[key] = needUpdate[key] = value; 23 | } 24 | }); 25 | return needUpdate; 26 | }; 27 | }, 28 | attached: function attached() { 29 | this.set(); 30 | }, 31 | methods: { 32 | // set data and set computed data 33 | set: function set(data, callback) { 34 | if (data) { 35 | this.setData(data, callback); 36 | } 37 | 38 | if (this.calcComputed) { 39 | this.setData(this.calcComputed()); 40 | } 41 | } 42 | } 43 | }); -------------------------------------------------------------------------------- /src/static/vant/mixins/observer/index.js: -------------------------------------------------------------------------------- 1 | import { behavior } from './behavior'; 2 | import { observeProps } from './props'; 3 | export function observe(vantOptions, options) { 4 | var watch = vantOptions.watch, 5 | computed = vantOptions.computed; 6 | options.behaviors.push(behavior); 7 | 8 | if (watch) { 9 | var props = options.properties || {}; 10 | Object.keys(watch).forEach(function (key) { 11 | if (key in props) { 12 | var prop = props[key]; 13 | 14 | if (prop === null || !('type' in prop)) { 15 | prop = { 16 | type: prop 17 | }; 18 | } 19 | 20 | prop.observer = watch[key]; 21 | props[key] = prop; 22 | } 23 | }); 24 | options.properties = props; 25 | } 26 | 27 | if (computed) { 28 | options.methods = options.methods || {}; 29 | 30 | options.methods.$options = function () { 31 | return vantOptions; 32 | }; 33 | 34 | if (options.properties) { 35 | observeProps(options.properties); 36 | } 37 | } 38 | } -------------------------------------------------------------------------------- /src/static/vant/mixins/observer/props.js: -------------------------------------------------------------------------------- 1 | export function observeProps(props) { 2 | if (!props) { 3 | return; 4 | } 5 | 6 | Object.keys(props).forEach(function (key) { 7 | var prop = props[key]; 8 | 9 | if (prop === null || !('type' in prop)) { 10 | prop = { 11 | type: prop 12 | }; 13 | } 14 | 15 | var _prop = prop, 16 | observer = _prop.observer; 17 | 18 | prop.observer = function () { 19 | if (observer) { 20 | if (typeof observer === 'string') { 21 | observer = this[observer]; 22 | } 23 | 24 | observer.apply(this, arguments); 25 | } 26 | 27 | this.set(); 28 | }; 29 | 30 | props[key] = prop; 31 | }); 32 | } -------------------------------------------------------------------------------- /src/static/vant/mixins/open-type.js: -------------------------------------------------------------------------------- 1 | export var openType = Behavior({ 2 | properties: { 3 | openType: String 4 | }, 5 | methods: { 6 | bindGetUserInfo: function bindGetUserInfo(event) { 7 | this.$emit('getuserinfo', event.detail); 8 | }, 9 | bindContact: function bindContact(event) { 10 | this.$emit('contact', event.detail); 11 | }, 12 | bindGetPhoneNumber: function bindGetPhoneNumber(event) { 13 | this.$emit('getphonenumber', event.detail); 14 | }, 15 | bindOpenSetting: function bindOpenSetting(event) { 16 | this.$emit('opensetting', event.detail); 17 | }, 18 | bindError: function bindError(event) { 19 | this.$emit('error', event.detail); 20 | } 21 | } 22 | }); -------------------------------------------------------------------------------- /src/static/vant/mixins/touch.js: -------------------------------------------------------------------------------- 1 | export var touch = Behavior({ 2 | methods: { 3 | touchStart: function touchStart(event) { 4 | this.direction = ''; 5 | this.deltaX = 0; 6 | this.deltaY = 0; 7 | this.offsetX = 0; 8 | this.offsetY = 0; 9 | this.startX = event.touches[0].clientX; 10 | this.startY = event.touches[0].clientY; 11 | }, 12 | touchMove: function touchMove(event) { 13 | var touch = event.touches[0]; 14 | this.deltaX = touch.clientX - this.startX; 15 | this.deltaY = touch.clientY - this.startY; 16 | this.offsetX = Math.abs(this.deltaX); 17 | this.offsetY = Math.abs(this.deltaY); 18 | this.direction = this.offsetX > this.offsetY ? 'horizontal' : this.offsetX < this.offsetY ? 'vertical' : ''; 19 | } 20 | } 21 | }); -------------------------------------------------------------------------------- /src/static/vant/mixins/transition.js: -------------------------------------------------------------------------------- 1 | export var transition = function transition(showDefaultValue) { 2 | return Behavior({ 3 | properties: { 4 | customStyle: String, 5 | show: { 6 | type: Boolean, 7 | value: showDefaultValue, 8 | observer: 'observeShow' 9 | }, 10 | duration: { 11 | type: Number, 12 | value: 300 13 | } 14 | }, 15 | data: { 16 | type: '', 17 | inited: false, 18 | display: false, 19 | supportAnimation: true 20 | }, 21 | attached: function attached() { 22 | if (this.data.show) { 23 | this.show(); 24 | } 25 | 26 | this.detectSupport(); 27 | }, 28 | methods: { 29 | detectSupport: function detectSupport() { 30 | var _this = this; 31 | 32 | wx.getSystemInfo({ 33 | success: function success(info) { 34 | if (info && info.system && info.system.indexOf('iOS 8') === 0) { 35 | _this.set({ 36 | supportAnimation: false 37 | }); 38 | } 39 | } 40 | }); 41 | }, 42 | observeShow: function observeShow(value) { 43 | if (value) { 44 | this.show(); 45 | } else { 46 | if (this.data.supportAnimation) { 47 | this.set({ 48 | type: 'leave' 49 | }); 50 | } else { 51 | this.set({ 52 | display: false 53 | }); 54 | } 55 | } 56 | }, 57 | show: function show() { 58 | this.set({ 59 | inited: true, 60 | display: true, 61 | type: 'enter' 62 | }); 63 | }, 64 | onAnimationEnd: function onAnimationEnd() { 65 | if (!this.data.show) { 66 | this.set({ 67 | display: false 68 | }); 69 | } 70 | } 71 | } 72 | }); 73 | }; -------------------------------------------------------------------------------- /src/static/vant/nav-bar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | classes: ['title-class'], 4 | props: { 5 | title: String, 6 | fixed: Boolean, 7 | leftText: String, 8 | rightText: String, 9 | leftArrow: Boolean, 10 | border: { 11 | type: Boolean, 12 | value: true 13 | }, 14 | zIndex: { 15 | type: Number, 16 | value: 1 17 | } 18 | }, 19 | methods: { 20 | onClickLeft: function onClickLeft() { 21 | this.$emit('click-left'); 22 | }, 23 | onClickRight: function onClickRight() { 24 | this.$emit('click-right'); 25 | } 26 | } 27 | }); -------------------------------------------------------------------------------- /src/static/vant/nav-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/nav-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 13 | {{ leftText }} 14 | 15 | 16 | 17 | 18 | {{ title }} 19 | 20 | 21 | 22 | {{ rightText }} 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/static/vant/nav-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-nav-bar{height:46px;position:relative;-webkit-user-select:none;user-select:none;text-align:center;line-height:46px;background-color:#fff}.van-nav-bar__arrow{color:#1989fa;vertical-align:middle}.van-nav-bar__arrow+.van-nav-bar__text{margin-left:-20px;padding-left:25px}.van-nav-bar--fixed{top:0;left:0;width:100%;position:fixed}.van-nav-bar__title{margin:0 auto;max-width:60%;font-size:16px;font-weight:500}.van-nav-bar__left,.van-nav-bar__right{bottom:0;font-size:14px;position:absolute}.van-nav-bar__left{left:15px}.van-nav-bar__right{right:15px}.van-nav-bar__text{color:#1989fa;margin:0 -15px;padding:0 15px;display:inline-block;vertical-align:middle}.van-nav-bar__text:active{background-color:#e8e8e8} -------------------------------------------------------------------------------- /src/static/vant/notice-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } -------------------------------------------------------------------------------- /src/static/vant/notice-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | {{ text }} 13 | 14 | 15 | 16 | 17 | 23 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/static/vant/notice-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-notice-bar{display:-webkit-flex;display:flex;height:40px;padding:0 15px;font-size:14px;line-height:24px;-webkit-align-items:center;align-items:center}.van-notice-bar--within-icon{position:relative;padding-right:40px}.van-notice-bar__left-icon{height:18px;min-width:20px;box-sizing:border-box}.van-notice-bar__left-icon>image{width:16px;height:16px}.van-notice-bar__right-icon{position:absolute;top:10px;right:15px;font-size:16px}.van-notice-bar__content-wrap{-webkit-flex:1;flex:1;height:24px;overflow:hidden;position:relative}.van-notice-bar__content{position:absolute;white-space:nowrap}.van-notice-bar__content.van-ellipsis{max-width:100%} -------------------------------------------------------------------------------- /src/static/vant/notify/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { RED } from '../common/color'; 3 | VantComponent({ 4 | props: { 5 | text: String, 6 | color: { 7 | type: String, 8 | value: '#fff' 9 | }, 10 | backgroundColor: { 11 | type: String, 12 | value: RED 13 | }, 14 | duration: { 15 | type: Number, 16 | value: 3000 17 | } 18 | }, 19 | methods: { 20 | show: function show() { 21 | var _this = this; 22 | 23 | var duration = this.data.duration; 24 | clearTimeout(this.timer); 25 | this.set({ 26 | show: true 27 | }); 28 | 29 | if (duration > 0 && duration !== Infinity) { 30 | this.timer = setTimeout(function () { 31 | _this.hide(); 32 | }, duration); 33 | } 34 | }, 35 | hide: function hide() { 36 | clearTimeout(this.timer); 37 | this.set({ 38 | show: false 39 | }); 40 | } 41 | } 42 | }); -------------------------------------------------------------------------------- /src/static/vant/notify/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/notify/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | {{ text }} 8 | 9 | -------------------------------------------------------------------------------- /src/static/vant/notify/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-notify{z-index:110;position:fixed;top:0;width:100%;text-align:center;box-sizing:border-box;padding:6px 15px;font-size:14px;line-height:20px} -------------------------------------------------------------------------------- /src/static/vant/notify/notify.js: -------------------------------------------------------------------------------- 1 | import { isObj } from '../common/utils'; 2 | var defaultOptions = { 3 | selector: '#van-notify', 4 | duration: 3000 5 | }; 6 | 7 | function parseOptions(text) { 8 | return isObj(text) ? text : { 9 | text: text 10 | }; 11 | } 12 | 13 | function getContext() { 14 | var pages = getCurrentPages(); 15 | return pages[pages.length - 1]; 16 | } 17 | 18 | export default function Notify(options) { 19 | if (options === void 0) { 20 | options = {}; 21 | } 22 | 23 | options = Object.assign({}, defaultOptions, parseOptions(options)); 24 | var context = options.context || getContext(); 25 | var notify = context.selectComponent(options.selector); 26 | delete options.selector; 27 | 28 | if (notify) { 29 | notify.set(options); 30 | notify.show(); 31 | } else { 32 | console.warn('未找到 van-notify 节点,请确认 selector 及 context 是否正确'); 33 | } 34 | } -------------------------------------------------------------------------------- /src/static/vant/overlay/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | show: Boolean, 5 | mask: Boolean, 6 | customStyle: String, 7 | zIndex: { 8 | type: Number, 9 | value: 1 10 | } 11 | }, 12 | methods: { 13 | onClick: function onClick() { 14 | this.$emit('click'); 15 | }, 16 | // for prevent touchmove 17 | noop: function noop() {} 18 | } 19 | }); -------------------------------------------------------------------------------- /src/static/vant/overlay/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/overlay/index.wxml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /src/static/vant/overlay/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-overlay{position:fixed;top:0;left:0;right:0;bottom:0} -------------------------------------------------------------------------------- /src/static/vant/panel/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | classes: ['header-class', 'footer-class'], 4 | props: { 5 | desc: String, 6 | title: String, 7 | status: String, 8 | useFooterSlot: Boolean 9 | } 10 | }); -------------------------------------------------------------------------------- /src/static/vant/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/static/vant/panel/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-panel{background:#fff}.van-panel__header-value{color:#f44}.van-panel__footer{padding:10px 15px} -------------------------------------------------------------------------------- /src/static/vant/popup/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { transition } from '../mixins/transition'; 3 | VantComponent({ 4 | mixins: [transition(false)], 5 | props: { 6 | transition: String, 7 | customStyle: String, 8 | overlayStyle: String, 9 | zIndex: { 10 | type: Number, 11 | value: 100 12 | }, 13 | overlay: { 14 | type: Boolean, 15 | value: true 16 | }, 17 | closeOnClickOverlay: { 18 | type: Boolean, 19 | value: true 20 | }, 21 | position: { 22 | type: String, 23 | value: 'center' 24 | }, 25 | safeAreaInsetBottom: { 26 | type: Boolean, 27 | value: true 28 | } 29 | }, 30 | computed: { 31 | popupClass: function popupClass() { 32 | var _this$data = this.data, 33 | position = _this$data.position, 34 | safeAreaInsetBottom = _this$data.safeAreaInsetBottom, 35 | isIPhoneX = _this$data.isIPhoneX; 36 | return this.classNames('custom-class', 'van-popup', { 37 | ["van-popup--" + position]: position, 38 | ["van-popup--safe"]: isIPhoneX && safeAreaInsetBottom && position === 'bottom' 39 | }); 40 | } 41 | }, 42 | methods: { 43 | onClickOverlay: function onClickOverlay() { 44 | this.$emit('click-overlay'); 45 | 46 | if (this.data.closeOnClickOverlay) { 47 | this.$emit('close'); 48 | } 49 | } 50 | } 51 | }); -------------------------------------------------------------------------------- /src/static/vant/popup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-overlay": "../overlay/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/popup/index.wxml: -------------------------------------------------------------------------------- 1 | 9 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/static/vant/progress/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { BLUE } from '../common/color'; 3 | VantComponent({ 4 | props: { 5 | inactive: Boolean, 6 | percentage: Number, 7 | pivotText: String, 8 | pivotColor: String, 9 | showPivot: { 10 | type: Boolean, 11 | value: true 12 | }, 13 | color: { 14 | type: String, 15 | value: BLUE 16 | }, 17 | textColor: { 18 | type: String, 19 | value: '#fff' 20 | } 21 | }, 22 | data: { 23 | pivotWidth: 0, 24 | progressWidth: 0 25 | }, 26 | watch: { 27 | pivotText: 'getWidth', 28 | showPivot: 'getWidth' 29 | }, 30 | computed: { 31 | portionStyle: function portionStyle() { 32 | var width = (this.data.progressWidth - this.data.pivotWidth) * this.data.percentage / 100 + 'px'; 33 | var background = this.getCurrentColor(); 34 | return "width: " + width + "; background: " + background + "; "; 35 | }, 36 | pivotStyle: function pivotStyle() { 37 | var color = this.data.textColor; 38 | var background = this.data.pivotColor || this.getCurrentColor(); 39 | return "color: " + color + "; background: " + background; 40 | }, 41 | text: function text() { 42 | return this.data.pivotText || this.data.percentage + '%'; 43 | } 44 | }, 45 | mounted: function mounted() { 46 | this.getWidth(); 47 | }, 48 | methods: { 49 | getCurrentColor: function getCurrentColor() { 50 | return this.data.inactive ? '#cacaca' : this.data.color; 51 | }, 52 | getWidth: function getWidth() { 53 | var _this = this; 54 | 55 | this.getRect('.van-progress').then(function (rect) { 56 | _this.set({ 57 | progressWidth: rect.width 58 | }); 59 | }); 60 | this.getRect('.van-progress__pivot').then(function (rect) { 61 | _this.set({ 62 | pivotWidth: rect.width || 0 63 | }); 64 | }); 65 | } 66 | } 67 | }); -------------------------------------------------------------------------------- /src/static/vant/progress/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/progress/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | {{ text }} 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/static/vant/progress/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-progress{height:4px;position:relative;border-radius:4px;background:#e5e5e5}.van-progress__portion{left:0;height:100%;position:absolute;border-radius:inherit}.van-progress__portion--with-pivot{border-top-right-radius:0;border-bottom-right-radius:0}.van-progress__pivot{top:50%;right:0;min-width:2em;padding:0 5px;font-size:10px;position:absolute;line-height:1.6;text-align:center;border-radius:1em;word-break:keep-all;box-sizing:border-box;background-color:#e5e5e5;-webkit-transform:translate(100%,-50%);transform:translate(100%,-50%)} -------------------------------------------------------------------------------- /src/static/vant/radio-group/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'radio', 6 | type: 'descendant', 7 | linked: function linked(target) { 8 | var _this$data = this.data, 9 | value = _this$data.value, 10 | disabled = _this$data.disabled; 11 | target.set({ 12 | value: value, 13 | disabled: disabled || target.data.disabled 14 | }); 15 | } 16 | }, 17 | props: { 18 | value: null, 19 | disabled: Boolean 20 | }, 21 | watch: { 22 | value: function value(_value) { 23 | var children = this.getRelationNodes('../radio/index'); 24 | children.forEach(function (child) { 25 | child.set({ 26 | value: _value 27 | }); 28 | }); 29 | }, 30 | disabled: function disabled(_disabled) { 31 | var children = this.getRelationNodes('../radio/index'); 32 | children.forEach(function (child) { 33 | child.set({ 34 | disabled: _disabled || child.data.disabled 35 | }); 36 | }); 37 | } 38 | } 39 | }); -------------------------------------------------------------------------------- /src/static/vant/radio-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/radio-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/static/vant/radio-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /src/static/vant/radio/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'radio-group', 6 | type: 'ancestor' 7 | }, 8 | classes: ['icon-class', 'label-class'], 9 | props: { 10 | name: null, 11 | value: null, 12 | disabled: Boolean, 13 | labelDisabled: Boolean, 14 | labelPosition: String, 15 | checkedColor: String 16 | }, 17 | computed: { 18 | iconClass: function iconClass() { 19 | var _this$data = this.data, 20 | disabled = _this$data.disabled, 21 | name = _this$data.name, 22 | value = _this$data.value; 23 | return this.classNames('van-radio__icon', { 24 | 'van-radio__icon--disabled': disabled, 25 | 'van-radio__icon--checked': !disabled && name === value, 26 | 'van-radio__icon--check': !disabled && name !== value 27 | }); 28 | } 29 | }, 30 | methods: { 31 | emitChange: function emitChange(value) { 32 | var instance = this.getRelationNodes('../radio-group/index')[0] || this; 33 | instance.$emit('input', value); 34 | instance.$emit('change', value); 35 | }, 36 | onChange: function onChange(event) { 37 | this.emitChange(event.detail.value); 38 | }, 39 | onClickLabel: function onClickLabel() { 40 | if (!this.data.disabled && !this.data.labelDisabled) { 41 | this.emitChange(this.data.name); 42 | } 43 | } 44 | } 45 | }); -------------------------------------------------------------------------------- /src/static/vant/radio/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/radio/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/static/vant/radio/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-radio{overflow:hidden;line-height:1;-webkit-user-select:none;user-select:none}.van-radio__input,.van-radio__label{display:inline-block;vertical-align:middle}.van-radio__input{position:relative;font-size:20px}.van-radio__control{z-index:1;position:absolute;top:0;left:0;width:100%;height:100%;margin:0;opacity:0}.van-radio__label{margin-left:10px;color:#333;font-size:16px;line-height:20px}.van-radio__label--left{margin:0 10px 0 0;float:left}.van-radio__label:empty{margin:0}.van-radio__icon{pointer-events:none;display:block;line-height:0}.van-radio__icon--disabled{color:#e5e5e5}.van-radio__icon--checked{color:#1989fa}.van-radio__icon--check{color:#999} -------------------------------------------------------------------------------- /src/static/vant/rate/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/rate/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 16 | 17 | -------------------------------------------------------------------------------- /src/static/vant/rate/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-rate{-webkit-user-select:none;user-select:none}.van-rate__item{width:1em;padding:0 2px;box-sizing:content-box} -------------------------------------------------------------------------------- /src/static/vant/row/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'col', 5 | type: 'descendant', 6 | linked: function linked(target) { 7 | if (this.data.gutter) { 8 | target.setGutter(this.data.gutter); 9 | } 10 | } 11 | }, 12 | props: { 13 | gutter: Number 14 | }, 15 | watch: { 16 | gutter: 'setGutter' 17 | }, 18 | mounted: function mounted() { 19 | if (this.data.gutter) { 20 | this.setGutter(); 21 | } 22 | }, 23 | methods: { 24 | setGutter: function setGutter() { 25 | var _this = this; 26 | 27 | var gutter = this.data.gutter; 28 | var margin = "-" + Number(gutter) / 2 + "px"; 29 | var style = gutter ? "margin-right: " + margin + "; margin-left: " + margin + ";" : ''; 30 | this.set({ 31 | style: style 32 | }); 33 | this.getRelationNodes('../col/index').forEach(function (col) { 34 | col.setGutter(_this.data.gutter); 35 | }); 36 | } 37 | } 38 | }); -------------------------------------------------------------------------------- /src/static/vant/row/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/row/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/static/vant/row/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-row::after{content:"";display:table;clear:both} -------------------------------------------------------------------------------- /src/static/vant/search/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | classes: ['field-class', 'input-class', 'cancel-class'], 5 | props: { 6 | focus: Boolean, 7 | error: Boolean, 8 | disabled: Boolean, 9 | readonly: Boolean, 10 | inputAlign: String, 11 | showAction: Boolean, 12 | useActionSlot: Boolean, 13 | placeholder: String, 14 | placeholderStyle: String, 15 | background: { 16 | type: String, 17 | value: '#f2f2f2' 18 | }, 19 | maxlength: { 20 | type: Number, 21 | value: -1 22 | } 23 | }, 24 | methods: { 25 | onChange: function onChange(event) { 26 | this.set({ 27 | value: event.detail 28 | }); 29 | this.$emit('change', event.detail); 30 | }, 31 | onCancel: function onCancel() { 32 | this.set({ 33 | value: '' 34 | }); 35 | this.$emit('cancel'); 36 | this.$emit('change', ''); 37 | }, 38 | onSearch: function onSearch() { 39 | this.$emit('search', this.data.value); 40 | }, 41 | onFocus: function onFocus() { 42 | this.$emit('focus'); 43 | }, 44 | onBlur: function onBlur() { 45 | this.$emit('blur'); 46 | }, 47 | onClear: function onClear() { 48 | this.$emit('clear'); 49 | } 50 | } 51 | }); -------------------------------------------------------------------------------- /src/static/vant/search/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-field": "../field/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/static/vant/search/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 29 | 30 | 31 | 取消 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/static/vant/search/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-search{display:-webkit-flex;display:flex;padding:7px 15px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search__field{overflow:hidden;border-radius:4px;-webkit-flex:1;flex:1}.van-search__field__left-icon{color:#999}.van-search--show-action{padding-right:0}.van-search input::-webkit-search-cancel-button,.van-search input::-webkit-search-decoration,.van-search input::-webkit-search-results-button,.van-search input::-webkit-search-results-decoration{display:none}.van-search__action{padding:0 10px;font-size:14px;line-height:30px;color:#7d7e80}.van-search__action:active{background-color:#e8e8e8} -------------------------------------------------------------------------------- /src/static/vant/slider/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { touch } from '../mixins/touch'; 3 | VantComponent({ 4 | mixins: [touch], 5 | props: { 6 | disabled: Boolean, 7 | max: { 8 | type: Number, 9 | value: 100 10 | }, 11 | min: { 12 | type: Number, 13 | value: 0 14 | }, 15 | step: { 16 | type: Number, 17 | value: 1 18 | }, 19 | value: { 20 | type: Number, 21 | value: 0 22 | }, 23 | barHeight: { 24 | type: String, 25 | value: '2px' 26 | } 27 | }, 28 | watch: { 29 | value: function value(_value) { 30 | this.updateValue(_value, false); 31 | } 32 | }, 33 | created: function created() { 34 | this.updateValue(this.data.value); 35 | }, 36 | methods: { 37 | onTouchStart: function onTouchStart(event) { 38 | if (this.data.disabled) return; 39 | this.touchStart(event); 40 | this.startValue = this.format(this.data.value); 41 | }, 42 | onTouchMove: function onTouchMove(event) { 43 | var _this = this; 44 | 45 | if (this.data.disabled) return; 46 | this.touchMove(event); 47 | this.getRect('.van-slider').then(function (rect) { 48 | var diff = _this.deltaX / rect.width * 100; 49 | 50 | _this.updateValue(_this.startValue + diff); 51 | }); 52 | }, 53 | onTouchEnd: function onTouchEnd() { 54 | if (this.data.disabled) return; 55 | this.updateValue(this.data.value, true); 56 | }, 57 | onClick: function onClick(event) { 58 | var _this2 = this; 59 | 60 | if (this.data.disabled) return; 61 | this.getRect(function (rect) { 62 | var value = (event.detail.x - rect.left) / rect.width * 100; 63 | 64 | _this2.updateValue(value, true); 65 | }); 66 | }, 67 | updateValue: function updateValue(value, end) { 68 | value = this.format(value); 69 | this.set({ 70 | value: value, 71 | barStyle: "width: " + value + "%; height: " + this.data.barHeight + ";" 72 | }); 73 | 74 | if (end) { 75 | this.$emit('change', value); 76 | } 77 | }, 78 | format: function format(value) { 79 | var _this$data = this.data, 80 | max = _this$data.max, 81 | min = _this$data.min, 82 | step = _this$data.step; 83 | return Math.round(Math.max(min, Math.min(value, max)) / step) * step; 84 | } 85 | } 86 | }); -------------------------------------------------------------------------------- /src/static/vant/slider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/slider/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/static/vant/slider/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#1989fa}.van-slider__button{position:absolute;top:50%;right:0;width:20px;height:20px;border-radius:50%;background-color:#fff;-webkit-transform:translate3d(50%,-50%,0);transform:translate3d(50%,-50%,0);box-shadow:0 1px 2px rgba(0,0,0,.5)}.van-slider__button::after{content:'';position:absolute;width:200%;height:200%;top:-50%;left:-50%}.van-slider--disabled{opacity:.3} -------------------------------------------------------------------------------- /src/static/vant/stepper/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/stepper/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /src/static/vant/stepper/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-stepper{font-size:0}.van-stepper__input,.van-stepper__minus,.van-stepper__plus{display:inline-block;vertical-align:middle;background-color:#fff}.van-stepper__minus,.van-stepper__plus{width:40px;height:30px;box-sizing:border-box;border:1px solid #eee;position:relative;padding:5px}.van-stepper__minus::before,.van-stepper__plus::before{width:9px;height:1px}.van-stepper__minus::after,.van-stepper__plus::after{width:1px;height:9px}.van-stepper__minus::after,.van-stepper__minus::before,.van-stepper__plus::after,.van-stepper__plus::before{content:'';position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;background-color:#7d7e80}.van-stepper__minus:active,.van-stepper__plus:active{background-color:#e8e8e8}.van-stepper__minus--disabled,.van-stepper__plus--disabled{background-color:#f8f8f8}.van-stepper__minus--disabled::after,.van-stepper__minus--disabled::before,.van-stepper__plus--disabled::after,.van-stepper__plus--disabled::before{background-color:#c9c9c9}.van-stepper__minus--disabled:active,.van-stepper__plus--disabled:active{background-color:#f8f8f8}.van-stepper__minus{border-radius:2px 0 0 2px}.van-stepper__minus::after{display:none}.van-stepper__plus{border-radius:0 2px 2px 0}.van-stepper__input{width:33px;height:26px;padding:1px;min-height:0;border:1px solid #eee;border-width:1px 0;border-radius:0;box-sizing:content-box;color:#7d7e80;font-size:14px;text-align:center;-webkit-appearance:none}.van-stepper__input--disabled{color:#c9c9c9;background-color:#f8f8f8} -------------------------------------------------------------------------------- /src/static/vant/steps/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { GREEN } from '../common/color'; 3 | VantComponent({ 4 | props: { 5 | icon: String, 6 | steps: Array, 7 | active: Number, 8 | direction: { 9 | type: String, 10 | value: 'horizontal' 11 | }, 12 | activeColor: { 13 | type: String, 14 | value: GREEN 15 | } 16 | }, 17 | watch: { 18 | steps: 'formatSteps', 19 | active: 'formatSteps' 20 | }, 21 | created: function created() { 22 | this.formatSteps(); 23 | }, 24 | methods: { 25 | formatSteps: function formatSteps() { 26 | var _this = this; 27 | 28 | var steps = this.data.steps; 29 | steps.forEach(function (step, index) { 30 | step.status = _this.getStatus(index); 31 | }); 32 | this.set({ 33 | steps: steps 34 | }); 35 | }, 36 | getStatus: function getStatus(index) { 37 | var active = this.data.active; 38 | 39 | if (index < active) { 40 | return 'finish'; 41 | } else if (index === active) { 42 | return 'process'; 43 | } 44 | 45 | return ''; 46 | } 47 | } 48 | }); -------------------------------------------------------------------------------- /src/static/vant/steps/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/steps/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | {{ item.text }} 11 | {{ item.desc }} 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/static/vant/submit-bar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | classes: ['bar-class', 'price-class', 'button-class'], 4 | props: { 5 | tip: null, 6 | type: Number, 7 | price: null, 8 | label: String, 9 | loading: Boolean, 10 | disabled: Boolean, 11 | buttonText: String, 12 | currency: { 13 | type: String, 14 | value: '¥' 15 | }, 16 | buttonType: { 17 | type: String, 18 | value: 'danger' 19 | }, 20 | safeAreaInsetBottom: { 21 | type: Boolean, 22 | value: true 23 | } 24 | }, 25 | computed: { 26 | hasPrice: function hasPrice() { 27 | return typeof this.data.price === 'number'; 28 | }, 29 | priceStr: function priceStr() { 30 | return (this.data.price / 100).toFixed(2); 31 | }, 32 | tipStr: function tipStr() { 33 | var tip = this.data.tip; 34 | return typeof tip === 'string' ? tip : ''; 35 | }, 36 | barClass: function barClass() { 37 | var _this$data = this.data, 38 | isIPhoneX = _this$data.isIPhoneX, 39 | safeAreaInsetBottom = _this$data.safeAreaInsetBottom; 40 | return this.classNames('van-submit-bar__bar', 'bar-class', { 41 | 'van-submit-bar__bar--safe': safeAreaInsetBottom && isIPhoneX 42 | }); 43 | } 44 | }, 45 | methods: { 46 | onSubmit: function onSubmit(event) { 47 | this.$emit('submit', event.detail); 48 | } 49 | } 50 | }); -------------------------------------------------------------------------------- /src/static/vant/submit-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/submit-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ tipStr }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | {{ label || '合计:' }} 13 | 14 | {{ currency }} {{ priceStr }} 15 | 16 | 17 | 18 | 28 | {{ loading ? '' : buttonText }} 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/static/vant/submit-bar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-submit-bar{z-index:100;position:fixed;bottom:0;left:0;width:100%;-webkit-user-select:none;user-select:none}.van-submit-bar__tip{padding:10px;color:#f56723;font-size:12px;line-height:18px;background-color:#fff7cc}.van-submit-bar__bar{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;height:50px;background-color:#fff;font-size:14px}.van-submit-bar__bar--safe{padding-bottom:34px}.van-submit-bar__text{-webkit-flex:1;flex:1;color:#333;font-weight:500;text-align:right}.van-submit-bar__price{color:#f44;font-size:18px;padding-right:12px}.van-submit-bar__currency{font-size:14px}.van-submit-bar__button button{width:110px} -------------------------------------------------------------------------------- /src/static/vant/swipe-cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/swipe-cell/index.wxml: -------------------------------------------------------------------------------- 1 | 10 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/static/vant/swipe-cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-swipe-cell{position:relative;overflow:hidden}.van-swipe-cell__left,.van-swipe-cell__right{position:absolute;top:0;height:100%}.van-swipe-cell__left{left:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}.van-swipe-cell__right{right:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)} -------------------------------------------------------------------------------- /src/static/vant/switch-cell/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | props: { 5 | title: String, 6 | border: Boolean, 7 | checked: Boolean, 8 | loading: Boolean, 9 | disabled: Boolean, 10 | size: { 11 | type: String, 12 | value: '26px' 13 | } 14 | }, 15 | watch: { 16 | checked: function checked(value) { 17 | this.set({ 18 | value: value 19 | }); 20 | } 21 | }, 22 | created: function created() { 23 | this.set({ 24 | value: this.data.checked 25 | }); 26 | }, 27 | methods: { 28 | onChange: function onChange(event) { 29 | this.$emit('change', event.detail); 30 | } 31 | } 32 | }); -------------------------------------------------------------------------------- /src/static/vant/switch-cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index", 5 | "van-switch": "../switch/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/static/vant/switch-cell/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /src/static/vant/switch-cell/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-switch-cell{padding-top:8px;padding-bottom:8px}.van-switch-cell__switch{vertical-align:middle} -------------------------------------------------------------------------------- /src/static/vant/switch/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | classes: ['node-class'], 5 | props: { 6 | checked: Boolean, 7 | loading: Boolean, 8 | disabled: Boolean, 9 | activeColor: String, 10 | inactiveColor: String, 11 | size: { 12 | type: String, 13 | value: '30px' 14 | } 15 | }, 16 | watch: { 17 | checked: function checked(value) { 18 | this.set({ 19 | value: value 20 | }); 21 | } 22 | }, 23 | computed: { 24 | classes: function classes() { 25 | return this.classNames('van-switch', { 26 | 'van-switch--on': this.data.checked, 27 | 'van-switch--disabled': this.data.disabled 28 | }); 29 | }, 30 | style: function style() { 31 | var backgroundColor = this.data.checked ? this.data.activeColor : this.data.inactiveColor; 32 | return "font-size: " + this.data.size + "; " + (backgroundColor ? "background-color: " + backgroundColor : ''); 33 | } 34 | }, 35 | created: function created() { 36 | this.set({ 37 | value: this.data.checked 38 | }); 39 | }, 40 | methods: { 41 | onClick: function onClick() { 42 | if (!this.data.disabled && !this.data.loading) { 43 | var checked = !this.data.checked; 44 | this.$emit('input', checked); 45 | this.$emit('change', checked); 46 | } 47 | } 48 | } 49 | }); -------------------------------------------------------------------------------- /src/static/vant/switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/switch/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/static/vant/switch/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-switch{height:1em;width:1.8em;display:inline-block;position:relative;border-radius:1em;box-sizing:content-box;border:1px solid rgba(0,0,0,.1);background-color:#fff;transition:background-color .3s}.van-switch__node{top:0;left:0;z-index:1;width:1em;height:1em;transition:.3s;position:absolute;border-radius:100%;background-color:#fff;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)}.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(.8em);transform:translateX(.8em)}.van-switch--disabled{opacity:.4} -------------------------------------------------------------------------------- /src/static/vant/tab/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'tabs', 5 | type: 'ancestor' 6 | }, 7 | props: { 8 | title: String, 9 | disabled: Boolean 10 | }, 11 | data: { 12 | inited: false, 13 | active: false, 14 | animated: false, 15 | width: null 16 | }, 17 | watch: { 18 | title: 'update', 19 | disabled: 'update' 20 | }, 21 | methods: { 22 | update: function update() { 23 | var parent = this.getRelationNodes('../tabs/index')[0]; 24 | 25 | if (parent) { 26 | parent.updateTabs(); 27 | } 28 | } 29 | } 30 | }); -------------------------------------------------------------------------------- /src/static/vant/tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/tab/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/static/vant/tab/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tab__pane{box-sizing:border-box}.van-tab__pane--float{float:left} -------------------------------------------------------------------------------- /src/static/vant/tabbar-item/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | info: null, 5 | icon: String, 6 | dot: Boolean 7 | }, 8 | relation: { 9 | name: 'tabbar', 10 | type: 'ancestor' 11 | }, 12 | data: { 13 | active: false 14 | }, 15 | methods: { 16 | onClick: function onClick() { 17 | var parent = this.getRelationNodes('../tabbar/index')[0]; 18 | 19 | if (parent) { 20 | parent.onChange(this); 21 | } 22 | 23 | this.$emit('click'); 24 | }, 25 | setActive: function setActive(active) { 26 | if (this.data.active !== active) { 27 | this.set({ 28 | active: active 29 | }); 30 | } 31 | } 32 | } 33 | }); -------------------------------------------------------------------------------- /src/static/vant/tabbar-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/tabbar-item/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 14 | 15 | {{ info }} 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/static/vant/tabbar-item/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1}.van-tabbar-item{color:#7d7e80;height:100%;display:-webkit-flex;display:flex;line-height:1;font-size:12px;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center}.van-tabbar-item__icon{font-size:18px;margin-bottom:5px;position:relative}.van-tabbar-item__icon .van-icon{display:block}.van-tabbar-item__icon .van-icon__info{color:#fff;left:100%;top:-.5em;font-size:.6em;padding:0 .25em;text-align:center;min-width:1.4em;line-height:1.4;position:absolute;border-radius:.6em;box-sizing:border-box;background-color:#f44;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif}.van-tabbar-item__icon--dot::after{top:0;right:-8px;width:8px;height:8px;content:' ';position:absolute;border-radius:100%;background-color:#f44}.van-tabbar-item__icon image{width:50px;height:18px}.van-tabbar-item--active{color:#1989fa} -------------------------------------------------------------------------------- /src/static/vant/tabbar/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | relation: { 4 | name: 'tabbar-item', 5 | type: 'descendant', 6 | linked: function linked(target) { 7 | var _this = this; 8 | 9 | this.data.items.push(target); 10 | setTimeout(function () { 11 | _this.setActiveItem(); 12 | }); 13 | }, 14 | unlinked: function unlinked(target) { 15 | var _this2 = this; 16 | 17 | this.data.items = this.data.items.filter(function (item) { 18 | return item !== target; 19 | }); 20 | setTimeout(function () { 21 | _this2.setActiveItem(); 22 | }); 23 | } 24 | }, 25 | props: { 26 | active: Number, 27 | fixed: { 28 | type: Boolean, 29 | value: true 30 | }, 31 | zIndex: { 32 | type: Number, 33 | value: 1 34 | }, 35 | safeAreaInsetBottom: { 36 | type: Boolean, 37 | value: true 38 | } 39 | }, 40 | data: { 41 | items: [], 42 | currentActive: -1 43 | }, 44 | computed: { 45 | tabbarClass: function tabbarClass() { 46 | var _this$data = this.data, 47 | fixed = _this$data.fixed, 48 | isIPhoneX = _this$data.isIPhoneX, 49 | safeAreaInsetBottom = _this$data.safeAreaInsetBottom; 50 | return this.classNames('custom-class', 'van-tabbar', 'van-hairline--top-bottom', { 51 | 'van-tabbar--fixed': fixed, 52 | 'van-tabbar--safe': isIPhoneX && safeAreaInsetBottom 53 | }); 54 | } 55 | }, 56 | watch: { 57 | active: function active(_active) { 58 | this.set({ 59 | currentActive: _active 60 | }); 61 | this.setActiveItem(); 62 | } 63 | }, 64 | created: function created() { 65 | this.set({ 66 | currentActive: this.data.active 67 | }); 68 | }, 69 | methods: { 70 | setActiveItem: function setActiveItem() { 71 | var _this3 = this; 72 | 73 | this.data.items.forEach(function (item, index) { 74 | item.setActive(index === _this3.data.currentActive); 75 | }); 76 | }, 77 | onChange: function onChange(child) { 78 | var active = this.data.items.indexOf(child); 79 | 80 | if (active !== this.data.currentActive && active !== -1) { 81 | this.$emit('change', active); 82 | this.set({ 83 | currentActive: active 84 | }); 85 | this.setActiveItem(); 86 | } 87 | } 88 | } 89 | }); -------------------------------------------------------------------------------- /src/static/vant/tabbar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /src/static/vant/tabbar/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/static/vant/tabbar/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tabbar{display:-webkit-flex;display:flex;width:100%;height:50px;background-color:#fff}.van-tabbar--fixed{position:fixed;bottom:0;left:0}.van-tabbar--safe{padding-bottom:34px} -------------------------------------------------------------------------------- /src/static/vant/tabs/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/tabs/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | 20 | 21 | {{ item.title }} 22 | 23 | 24 | 25 | 26 | 27 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/static/vant/tabs/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__scroll--card{border:1px solid #f44;border-radius:2px}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:30px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44;border-radius:2px}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px;margin:0 15px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tabs__content{overflow:hidden}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#7d7e80;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab span{display:block}.van-tab--active{font-weight:500;color:#333}.van-tab--disabled{color:#c9c9c9} -------------------------------------------------------------------------------- /src/static/vant/tag/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { RED, BLUE, GREEN } from '../common/color'; 3 | var DEFAULT_COLOR = '#999'; 4 | var COLOR_MAP = { 5 | danger: RED, 6 | primary: BLUE, 7 | success: GREEN 8 | }; 9 | VantComponent({ 10 | props: { 11 | size: String, 12 | type: String, 13 | mark: Boolean, 14 | color: String, 15 | plain: Boolean, 16 | round: Boolean 17 | }, 18 | computed: { 19 | classes: function classes() { 20 | var data = this.data; 21 | return this.classNames('van-tag', { 22 | 'van-tag--mark': data.mark, 23 | 'van-tag--plain': data.plain, 24 | 'van-tag--round': data.round, 25 | ["van-tag--" + data.size]: data.size, 26 | 'van-hairline--surround': data.plain 27 | }); 28 | }, 29 | style: function style() { 30 | var color = this.data.color || COLOR_MAP[this.data.type] || DEFAULT_COLOR; 31 | var key = this.data.plain ? 'color' : 'background-color'; 32 | return key + ": " + color; 33 | } 34 | } 35 | }); -------------------------------------------------------------------------------- /src/static/vant/tag/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/tag/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/static/vant/tag/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tag{color:#fff;font-size:10px;padding:.2em .5em;line-height:normal;border-radius:.2em;display:inline-block}.van-tag::after{border-color:currentColor;border-radius:.4em}.van-tag--mark{padding-right:.6em;border-radius:0 .8em .8em 0}.van-tag--mark::after{border-radius:0 1.6em 1.6em 0}.van-tag--round{border-radius:.8em}.van-tag--round::after{border-radius:1.6em}.van-tag--medium{font-size:12px}.van-tag--large{font-size:14px} -------------------------------------------------------------------------------- /src/static/vant/toast/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | props: { 4 | show: Boolean, 5 | mask: Boolean, 6 | message: String, 7 | forbidClick: Boolean, 8 | zIndex: { 9 | type: Number, 10 | value: 1000 11 | }, 12 | type: { 13 | type: String, 14 | value: 'text' 15 | }, 16 | loadingType: { 17 | type: String, 18 | value: 'circular' 19 | }, 20 | position: { 21 | type: String, 22 | value: 'middle' 23 | } 24 | }, 25 | methods: { 26 | clear: function clear() { 27 | this.set({ 28 | show: false 29 | }); 30 | }, 31 | // for prevent touchmove 32 | noop: function noop() {} 33 | } 34 | }); -------------------------------------------------------------------------------- /src/static/vant/toast/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-loading": "../loading/index", 6 | "van-overlay": "../overlay/index", 7 | "van-transition": "../transition/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/static/vant/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 16 | 17 | {{ message }} 18 | 19 | 20 | 21 | 27 | 28 | {{ message }} 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/static/vant/toast/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:14px;line-height:20px;border-radius:4px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center;box-sizing:content-box;background-color:rgba(0,0,0,.7)}.van-toast__container{position:fixed;top:50%;left:50%;max-width:70%;width:-webkit-fit-content;width:fit-content;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{padding:8px 12px;min-width:96px}.van-toast--icon{width:90px;padding:15px;min-height:90px}.van-toast--icon .van-toast__icon{font-size:50px}.van-toast--icon .van-toast__text{padding-top:5px}.van-toast__loading{margin:10px 0}.van-toast--top{-webkit-transform:translate(0,-30vh);transform:translate(0,-30vh)}.van-toast--bottom{-webkit-transform:translate(0,30vh);transform:translate(0,30vh)} -------------------------------------------------------------------------------- /src/static/vant/transition/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | import { transition } from '../mixins/transition'; 3 | VantComponent({ 4 | mixins: [transition(true)], 5 | props: { 6 | name: { 7 | type: String, 8 | value: 'fade' 9 | } 10 | } 11 | }); -------------------------------------------------------------------------------- /src/static/vant/transition/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /src/static/vant/transition/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/static/vant/tree-select/index.js: -------------------------------------------------------------------------------- 1 | import {VantComponent} from '../common/component'; 2 | var ITEM_HEIGHT = 44; 3 | VantComponent({ 4 | props: { 5 | items: Array, 6 | mainActiveIndex: { 7 | type: Number, 8 | value: 0, 9 | }, 10 | activeId: { 11 | type: Number, 12 | value: 0, 13 | }, 14 | maxHeight: { 15 | type: Number, 16 | value: 300, 17 | }, 18 | }, 19 | data: { 20 | subItems: [], 21 | mainHeight: 0, 22 | itemHeight: 0, 23 | }, 24 | watch: { 25 | items: function items() { 26 | this.updateSubItems(); 27 | this.updateMainHeight(); 28 | }, 29 | maxHeight: function maxHeight() { 30 | this.updateItemHeight(); 31 | this.updateMainHeight(); 32 | }, 33 | mainActiveIndex: 'updateSubItems', 34 | }, 35 | methods: { 36 | // 当一个子项被选择时 37 | onSelectItem: function onSelectItem(event) { 38 | var item = event.currentTarget.dataset.item; 39 | 40 | if (!item.disabled) { 41 | //megalo 42 | // this.$emit('click-item', item); 43 | this.$emit('clickItem', item); 44 | } 45 | }, 46 | // 当一个导航被点击时 47 | onClickNav: function onClickNav(event) { 48 | var index = event.currentTarget.dataset.index; 49 | //megalo 50 | // this.$emit('click-nav', { 51 | // index: index, 52 | // }); 53 | this.$emit('clickNav', { 54 | index: index, 55 | }); 56 | }, 57 | // 更新子项列表 58 | updateSubItems: function updateSubItems() { 59 | var selectedItem = this.data.items[this.data.mainActiveIndex] || {}; 60 | this.set({ 61 | subItems: selectedItem.children || [], 62 | }); 63 | this.updateItemHeight(); 64 | }, 65 | // 更新组件整体高度,根据最大高度和当前组件需要展示的高度来决定 66 | updateMainHeight: function updateMainHeight() { 67 | var maxHeight = Math.max( 68 | this.data.items.length * ITEM_HEIGHT, 69 | this.data.subItems.length * ITEM_HEIGHT, 70 | ); 71 | this.set({ 72 | mainHeight: Math.min(maxHeight, this.data.maxHeight), 73 | }); 74 | }, 75 | // 更新子项列表高度,根据可展示的最大高度和当前子项列表的高度决定 76 | updateItemHeight: function updateItemHeight() { 77 | this.set({ 78 | itemHeight: Math.min( 79 | this.data.subItems.length * ITEM_HEIGHT, 80 | this.data.maxHeight, 81 | ), 82 | }); 83 | }, 84 | }, 85 | }); 86 | -------------------------------------------------------------------------------- /src/static/vant/tree-select/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/static/vant/tree-select/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | {{ item.text }} 14 | 15 | 16 | 21 | 28 | {{ item.text }} 29 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/static/vant/tree-select/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-tree-select{-webkit-user-select:none;user-select:none;position:relative;font-size:16px}.van-tree-select__nav{width:35%;position:absolute;left:0;top:0;bottom:0;background-color:#fff}.van-tree-select__nitem{line-height:44px;padding:0 15px;background-color:#fff}.van-tree-select__nitem--active,.van-tree-select__nitem:active{background-color:#f8f8f8}.van-tree-select__nitem--active{font-weight:500}.van-tree-select__content{width:65%;padding:0 15px;margin-left:35%;box-sizing:border-box}.van-tree-select__item{position:relative;line-height:44px;padding-left:5px;padding-right:18px}.van-tree-select__item--active,.van-tree-select__item:active{color:#f44}.van-tree-select__item--disabled,.van-tree-select__item--disabled:active{color:#c9c9c9}.van-tree-select__selected{float:right;position:absolute;right:0;top:0;bottom:0;line-height:inherit} --------------------------------------------------------------------------------