├── static ├── vant │ ├── common │ │ ├── style │ │ │ ├── var.wxss │ │ │ ├── mixins │ │ │ │ ├── clearfix.wxss │ │ │ │ ├── ellipsis.wxss │ │ │ │ ├── hairline.wxss │ │ │ │ └── border-retina.wxss │ │ │ ├── clearfix.wxss │ │ │ ├── ellipsis.wxss │ │ │ └── hairline.wxss │ │ ├── utils.js │ │ ├── class-names.js │ │ ├── create.js │ │ ├── index.wxss │ │ └── component.js │ ├── tab │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.js │ ├── tabs │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── tag │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── card │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── col │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── icon │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── loading │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── row │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js │ ├── stepper │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── badge │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── cell-group │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── checkbox-group │ │ ├── index.wxss │ │ ├── index.wxml │ │ ├── index.json │ │ └── index.js │ ├── progress │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── radio-group │ │ ├── index.wxss │ │ ├── index.wxml │ │ ├── index.json │ │ └── index.js │ ├── slider │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── tabbar │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js │ ├── transition │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── badge-group │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── goods-action │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── overlay │ │ ├── index.wxss │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.js │ ├── goods-action-button │ │ ├── index.wxss │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.js │ ├── cell │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── switch-cell │ │ ├── index.wxss │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.js │ ├── button │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── nav-bar │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxss │ │ └── index.wxml │ ├── notice-bar │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js │ ├── panel │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── radio │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── steps │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── area │ │ ├── index.json │ │ ├── index.wxss │ │ └── index.wxml │ ├── checkbox │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── popup │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.js │ │ └── index.wxss │ ├── switch │ │ ├── index.json │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── tabbar-item │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── tree-select │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js │ ├── submit-bar │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js │ ├── notify │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ ├── notify.js │ │ └── index.js │ ├── field │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.wxml │ │ └── index.js │ ├── search │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.js │ │ └── index.wxml │ ├── dialog │ │ ├── index.json │ │ ├── dialog.js │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── index.js │ ├── goods-action-icon │ │ ├── index.json │ │ ├── index.wxss │ │ ├── index.js │ │ └── index.wxml │ ├── action-sheet │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ └── index.wxss │ ├── toast │ │ ├── index.json │ │ ├── index.js │ │ ├── index.wxml │ │ ├── index.wxss │ │ └── toast.js │ └── mixins │ │ ├── basic.js │ │ ├── link.js │ │ ├── observer │ │ ├── props.js │ │ ├── index.js │ │ └── behavior.js │ │ ├── open-type.js │ │ ├── touch.js │ │ ├── transition.js │ │ └── button.js ├── common │ └── style.css └── icon │ ├── block.png │ ├── home.png │ ├── user.png │ ├── block-hover.png │ ├── home-hover.png │ ├── user-hover.png │ └── iconfont.css ├── config ├── prod.env.js ├── dev.env.js └── index.js ├── src ├── pages │ ├── index │ │ ├── arrow.png │ │ ├── main.js │ │ ├── main.json │ │ ├── mock.js │ │ └── index.vue │ ├── recommend │ │ ├── main.json │ │ ├── main.js │ │ ├── mock.js │ │ └── index.vue │ ├── address │ │ ├── main.js │ │ ├── main.json │ │ └── index.vue │ ├── detail │ │ ├── main.js │ │ ├── main.json │ │ └── mock.js │ ├── login │ │ ├── main.js │ │ └── main.json │ ├── logup │ │ ├── main.js │ │ └── main.json │ ├── order │ │ ├── main.js │ │ ├── main.json │ │ ├── mock.JS │ │ └── index.vue │ ├── user │ │ ├── main.js │ │ ├── main.json │ │ └── mock.js │ ├── addressLists │ │ ├── main.js │ │ ├── main.json │ │ └── index.vue │ └── addressNew │ │ ├── main.js │ │ ├── main.json │ │ └── index.vue ├── App.vue ├── main.js ├── utils │ └── index.js ├── components │ ├── star.vue │ └── card-list.vue └── app.json ├── .postcssrc.js ├── .editorconfig ├── .gitignore ├── index.html ├── .babelrc ├── README.md ├── project.config.json └── package.json /static/vant/common/style/var.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/vant/common/style/mixins/clearfix.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/vant/common/style/mixins/ellipsis.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/vant/common/style/mixins/hairline.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/vant/common/style/mixins/border-retina.wxss: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/vant/tab/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/vant/tabs/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/vant/tag/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/vant/card/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/col/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/icon/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/loading/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/vant/row/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/stepper/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/common/style.css: -------------------------------------------------------------------------------- 1 | page { 2 | background-color: #f0f2f5; 3 | } -------------------------------------------------------------------------------- /static/vant/badge/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/cell-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/vant/checkbox-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /static/vant/progress/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/radio-group/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss'; -------------------------------------------------------------------------------- /static/vant/slider/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/tabbar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/transition/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } -------------------------------------------------------------------------------- /static/vant/badge-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/goods-action/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true 3 | } 4 | -------------------------------------------------------------------------------- /config/prod.env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | NODE_ENV: '"production"' 3 | } 4 | -------------------------------------------------------------------------------- /static/vant/row/index.wxss: -------------------------------------------------------------------------------- 1 | .van-row::after{content:"";display:table;clear:both} -------------------------------------------------------------------------------- /static/vant/overlay/index.wxss: -------------------------------------------------------------------------------- 1 | .van-overlay{position:fixed;top:0;left:0;right:0;bottom:0} -------------------------------------------------------------------------------- /static/vant/radio-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/icon/block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/static/icon/block.png -------------------------------------------------------------------------------- /static/icon/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/static/icon/home.png -------------------------------------------------------------------------------- /static/icon/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/static/icon/user.png -------------------------------------------------------------------------------- /static/vant/checkbox-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/vant/common/style/clearfix.wxss: -------------------------------------------------------------------------------- 1 | .van-clearfix::after{content:'';display:table;clear:both} -------------------------------------------------------------------------------- /static/vant/goods-action-button/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';:host{-webkit-flex:1;flex:1} -------------------------------------------------------------------------------- /src/pages/index/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/src/pages/index/arrow.png -------------------------------------------------------------------------------- /static/icon/block-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/static/icon/block-hover.png -------------------------------------------------------------------------------- /static/icon/home-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/static/icon/home-hover.png -------------------------------------------------------------------------------- /static/icon/user-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Wizard67/weapp-o2o/HEAD/static/icon/user-hover.png -------------------------------------------------------------------------------- /static/vant/goods-action/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent(); -------------------------------------------------------------------------------- /static/vant/goods-action/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/vant/row/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/vant/cell/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } -------------------------------------------------------------------------------- /static/vant/switch-cell/index.wxss: -------------------------------------------------------------------------------- 1 | .van-switch-cell{padding-top:8px;padding-bottom:8px}.van-switch-cell__switch{vertical-align:middle} -------------------------------------------------------------------------------- /static/vant/badge-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/vant/button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } -------------------------------------------------------------------------------- /static/vant/nav-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/notice-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } -------------------------------------------------------------------------------- /static/vant/panel/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/radio/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/steps/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/tabbar/index.wxss: -------------------------------------------------------------------------------- 1 | .van-tabbar{width:100%;height:50px;background-color:#fff}.van-tabbar--fixed{left:0;bottom:0;position:fixed} -------------------------------------------------------------------------------- /static/vant/area/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/checkbox/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/popup/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-overlay": "../overlay/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/radio-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/switch/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-loading": "../loading/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/tabbar-item/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/tree-select/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 12 | -------------------------------------------------------------------------------- /static/vant/checkbox-group/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/submit-bar/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/notify/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/overlay/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-transition": "../transition/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/cell-group/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /static/vant/goods-action-button/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-button": "../button/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/goods-action/index.wxss: -------------------------------------------------------------------------------- 1 | @import '../common/index.wxss';.van-goods-action{left:0;right:0;bottom:0;display:-webkit-flex;display:flex;position:fixed} -------------------------------------------------------------------------------- /src/pages/recommend/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-tab": "/static/vant/tab/index", 4 | "van-tabs": "/static/vant/tabs/index" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /static/vant/field/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-cell": "../cell/index", 5 | "van-icon": "../icon/index" 6 | } 7 | } -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-mpvue-wxss": {} 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /src/pages/address/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/detail/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/index/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/login/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/logup/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/order/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/user/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/icon/iconfont.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /static/vant/search/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-field": "../field/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /static/vant/tab/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /config/dev.env.js: -------------------------------------------------------------------------------- 1 | var merge = require('webpack-merge') 2 | var prodEnv = require('./prod.env') 3 | 4 | module.exports = merge(prodEnv, { 5 | NODE_ENV: '"development"' 6 | }) 7 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | 4 | Vue.config.productionTip = false 5 | App.mpType = 'app' 6 | 7 | const app = new Vue(App) 8 | app.$mount() 9 | -------------------------------------------------------------------------------- /src/pages/addressLists/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/addressNew/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /src/pages/recommend/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | import '../../../static/common/style.css' 4 | 5 | const app = new Vue(App) 6 | app.$mount() 7 | -------------------------------------------------------------------------------- /static/vant/dialog/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-popup": "../popup/index", 5 | "van-button": "../button/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /static/vant/goods-action-button/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | {{ text }} 8 | 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /static/vant/notify/index.wxss: -------------------------------------------------------------------------------- 1 | .van-notify{top:0;width:100%;z-index:110;color:#fff;position:fixed;min-height:32px;line-height:2.3;font-size:14px;text-align:center;background-color:#e64340} -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /static/vant/tag/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | type: String, 6 | mark: Boolean, 7 | plain: Boolean 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /static/vant/cell-group/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | border: { 6 | type: Boolean, 7 | value: true 8 | } 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /static/vant/col/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Editor directories and files 9 | .idea 10 | *.suo 11 | *.ntvs* 12 | *.njsproj 13 | *.sln 14 | -------------------------------------------------------------------------------- /src/pages/user/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell-group": "/static/vant/cell-group/index", 4 | "van-cell": "/static/vant/cell/index", 5 | "van-icon": "/static/vant/icon/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /static/vant/action-sheet/index.json: -------------------------------------------------------------------------------- 1 | { 2 | "component": true, 3 | "usingComponents": { 4 | "van-icon": "../icon/index", 5 | "van-popup": "../popup/index", 6 | "van-loading": "../loading/index" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/pages/addressLists/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-panel": "/static/vant/panel/index", 4 | "van-button": "/static/vant/button/index", 5 | "van-switch": "/static/vant/switch/index" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /static/vant/tabbar/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /static/vant/notify/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | {{ text }} 8 | 9 | -------------------------------------------------------------------------------- /static/vant/tag/index.wxml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/pages/index/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-button": "/static/vant/button/index", 4 | "van-card": "/static/vant/card/index" 5 | }, 6 | "enablePullDownRefresh": true, 7 | "navigationBarTitleText": "首页" 8 | } 9 | -------------------------------------------------------------------------------- /static/vant/badge/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | {{ info }} 3 | {{ title }} 4 | 5 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | weapp-o2o 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /static/vant/overlay/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /src/pages/user/mock.js: -------------------------------------------------------------------------------- 1 | export const mockUserData = { 2 | uid: '1', 3 | name: '王五主流', 4 | avatar: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 5 | hasCertification: true, 6 | registTime: '2018-08-28', 7 | address: '万达广场', 8 | } -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /static/vant/panel/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | classes: ['footer-class'], 5 | 6 | props: { 7 | desc: String, 8 | title: String, 9 | status: String, 10 | headerClass: String, 11 | useFooterSlot: Boolean 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /static/vant/common/utils.js: -------------------------------------------------------------------------------- 1 | function isDef(value) { 2 | return value !== undefined && value !== null; 3 | } 4 | 5 | function isObj(x) { 6 | const type = typeof x; 7 | return x !== null && (type === 'object' || type === 'function'); 8 | } 9 | 10 | export { 11 | isObj, 12 | isDef 13 | }; 14 | -------------------------------------------------------------------------------- /static/vant/transition/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | import { transition } from '../mixins/transition'; 3 | 4 | create({ 5 | mixins: [transition(true)], 6 | 7 | props: { 8 | name: { 9 | type: String, 10 | value: 'fade' 11 | } 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /static/vant/icon/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | {{ info }} 7 | 8 | -------------------------------------------------------------------------------- /src/pages/logup/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-row": "/static/vant/row/index", 4 | "van-col": "/static/vant/col/index", 5 | "van-cell-group": "/static/vant/cell-group/index", 6 | "van-field": "/static/vant/field/index", 7 | "van-button": "/static/vant/button/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/pages/address/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-tab": "/static/vant/tab/index", 4 | "van-tabs": "/static/vant/tabs/index", 5 | "van-cell-group": "/static/vant/cell-group/index", 6 | "van-field": "/static/vant/field/index", 7 | "van-button": "/static/vant/button/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /static/vant/transition/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/pages/addressNew/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell-group": "/static/vant/cell-group/index", 4 | "van-cell": "/static/vant/cell/index", 5 | "van-field": "/static/vant/field/index", 6 | "van-button": "/static/vant/button/index", 7 | "van-switch": "/static/vant/switch/index" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /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} -------------------------------------------------------------------------------- /static/vant/loading/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | size: { 6 | type: String, 7 | value: '30px' 8 | }, 9 | type: { 10 | type: String, 11 | value: 'circular' 12 | }, 13 | color: { 14 | type: String, 15 | value: '#c9c9c9' 16 | } 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /static/vant/overlay/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | show: Boolean, 6 | mask: Boolean, 7 | customStyle: String, 8 | zIndex: { 9 | type: Number, 10 | value: 1 11 | } 12 | }, 13 | 14 | methods: { 15 | onClick() { 16 | this.$emit('click'); 17 | } 18 | } 19 | }); 20 | -------------------------------------------------------------------------------- /src/pages/order/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell-group": "/static/vant/cell-group/index", 4 | "van-cell": "/static/vant/cell/index", 5 | "van-submit-bar": "/static/vant/submit-bar/index", 6 | "van-button": "/static/vant/button/index", 7 | "van-card": "/static/vant/card/index", 8 | "van-stepper": "/static/vant/stepper/index" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/pages/detail/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-cell-group": "/static/vant/cell-group/index", 4 | "van-cell": "/static/vant/cell/index", 5 | "van-submit-bar": "/static/vant/submit-bar/index", 6 | "van-button": "/static/vant/button/index", 7 | "van-popup": "/static/vant/popup/index", 8 | "van-stepper": "/static/vant/stepper/index" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /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:#666;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center}.van-goods-action-icon__icon{margin-bottom:5px} -------------------------------------------------------------------------------- /static/vant/icon/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | info: null, 6 | name: String, 7 | size: String, 8 | color: String, 9 | classPrefix: { 10 | type: String, 11 | value: 'van-icon' 12 | } 13 | }, 14 | 15 | methods: { 16 | onClick() { 17 | this.$emit('click'); 18 | } 19 | } 20 | }); 21 | -------------------------------------------------------------------------------- /static/vant/switch/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | ["env", { 4 | "modules": false, 5 | "targets": { 6 | "browsers": ["> 1%", "last 2 versions", "not ie <= 8"] 7 | } 8 | }], 9 | "stage-2" 10 | ], 11 | "plugins": ["transform-runtime"], 12 | "env": { 13 | "test": { 14 | "presets": ["env", "stage-2"], 15 | "plugins": ["istanbul"] 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /static/vant/switch-cell/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /src/pages/login/main.json: -------------------------------------------------------------------------------- 1 | { 2 | "usingComponents": { 3 | "van-row": "/static/vant/row/index", 4 | "van-col": "/static/vant/col/index", 5 | "van-tab": "/static/vant/tab/index", 6 | "van-tabs": "/static/vant/tabs/index", 7 | "van-cell-group": "/static/vant/cell-group/index", 8 | "van-field": "/static/vant/field/index", 9 | "van-button": "/static/vant/button/index" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /static/vant/goods-action-icon/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | mixins: [link], 5 | props: { 6 | text: String, 7 | info: String, 8 | icon: String 9 | }, 10 | methods: { 11 | onClick: function onClick(event) { 12 | this.$emit('click', event.detail); 13 | this.jumpLink(); 14 | } 15 | } 16 | }); -------------------------------------------------------------------------------- /static/vant/goods-action-icon/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 13 | {{ text }} 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/vant/progress/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | {{ text }} 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /static/vant/slider/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /static/vant/loading/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 9 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /static/vant/goods-action-button/index.js: -------------------------------------------------------------------------------- 1 | import { link } from '../mixins/link'; 2 | import { VantComponent } from '../common/component'; 3 | VantComponent({ 4 | mixins: [link], 5 | props: { 6 | text: String, 7 | type: { 8 | type: String, 9 | value: 'danger' 10 | } 11 | }, 12 | methods: { 13 | onClick: function onClick(event) { 14 | this.$emit('click', event.detail); 15 | this.jumpLink(); 16 | } 17 | } 18 | }); -------------------------------------------------------------------------------- /static/vant/card/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | classes: [ 5 | 'thumb-class', 6 | 'title-class', 7 | 'price-class', 8 | 'desc-class', 9 | 'num-class' 10 | ], 11 | 12 | props: { 13 | num: String, 14 | desc: String, 15 | thumb: String, 16 | title: String, 17 | price: String, 18 | centered: Boolean, 19 | currency: { 20 | type: String, 21 | value: '¥' 22 | } 23 | } 24 | }); 25 | -------------------------------------------------------------------------------- /static/vant/popup/index.wxml: -------------------------------------------------------------------------------- 1 | 7 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /static/vant/col/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | relations: { 5 | '../row/index': { 6 | type: 'ancestor' 7 | } 8 | }, 9 | 10 | props: { 11 | span: Number, 12 | offset: Number 13 | }, 14 | 15 | methods: { 16 | setGutter(gutter) { 17 | const padding = `${gutter / 2}px`; 18 | const style = gutter ? `padding-left: ${padding}; padding-right: ${padding};` : ''; 19 | this.setData({ style }); 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /static/vant/mixins/basic.js: -------------------------------------------------------------------------------- 1 | export const basic = Behavior({ 2 | methods: { 3 | $emit() { 4 | this.triggerEvent.apply(this, arguments); 5 | }, 6 | 7 | getRect(selector, all) { 8 | return new Promise((resolve, reject) => { 9 | wx.createSelectorQuery() 10 | .in(this)[all ? 'selectAll' : 'select'](selector) 11 | .boundingClientRect(rect => { 12 | rect && resolve(rect); 13 | }) 14 | .exec(); 15 | }); 16 | } 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /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 | }); -------------------------------------------------------------------------------- /static/vant/slider/index.wxss: -------------------------------------------------------------------------------- 1 | .van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#38f}.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/pages/order/mock.JS: -------------------------------------------------------------------------------- 1 | export const mockcommonAddressData = { 2 | uid: '1', 3 | name: '张三', 4 | phone: '15960123456', 5 | address: '北京市丰台区大红门街道珠江骏景北区65号楼1120室' 6 | } 7 | 8 | export const mockOrderData = { 9 | id: '1', 10 | sponsor: '王五', 11 | thumbnail: 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 12 | title: '山东水蜜桃1.2kg200g以上/个山东水蜜桃1.2kg200g以上/个', 13 | desc: '山东水蜜桃1.2kg200g以上/个山东水蜜桃1.2kg200g以上/个', 14 | price: '2680', 15 | number: 2, 16 | value: 5360, 17 | transport: '快递免邮' 18 | } -------------------------------------------------------------------------------- /static/vant/nav-bar/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | classes: ['title-class'], 5 | 6 | props: { 7 | title: String, 8 | leftText: String, 9 | rightText: String, 10 | leftArrow: Boolean, 11 | fixed: Boolean, 12 | zIndex: { 13 | type: Number, 14 | value: 1 15 | } 16 | }, 17 | 18 | methods: { 19 | onClickLeft() { 20 | this.$emit('click-left'); 21 | }, 22 | 23 | onClickRight() { 24 | this.$emit('click-right'); 25 | } 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /static/vant/checkbox/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /static/vant/progress/index.wxss: -------------------------------------------------------------------------------- 1 | .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%)} -------------------------------------------------------------------------------- /static/vant/tab/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | disabled: Boolean, 6 | title: { 7 | type: String, 8 | observer() { 9 | const parent = this.getRelationNodes('../tabs/index')[0]; 10 | if (parent) { 11 | parent.setLine(); 12 | } 13 | } 14 | } 15 | }, 16 | 17 | relations: { 18 | '../tabs/index': { 19 | type: 'ancestor' 20 | } 21 | }, 22 | 23 | data: { 24 | inited: false, 25 | active: false 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /static/vant/badge/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | relations: { 5 | '../badge-group/index': { 6 | type: 'ancestor' 7 | } 8 | }, 9 | 10 | props: { 11 | info: Number, 12 | title: String 13 | }, 14 | 15 | methods: { 16 | onClick() { 17 | const group = this.getRelationNodes('../badge-group/index')[0]; 18 | if (group) { 19 | group.setActive(this); 20 | } 21 | }, 22 | 23 | setActive(active) { 24 | this.setData({ active }); 25 | } 26 | } 27 | }); 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # weapp-o2o 2 | 3 | > a weapp project baseds on mpvue and vant-weapp 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | npm install 10 | 11 | # serve with hot reload at localhost:8080 12 | npm run dev 13 | 14 | # build for production with minification 15 | npm run build 16 | 17 | # build for production and view the bundle analyzer report 18 | npm run build --report 19 | ``` 20 | 21 | For detailed explanation on how things work, checkout the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). 22 | -------------------------------------------------------------------------------- /static/vant/toast/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | show: Boolean, 6 | mask: Boolean, 7 | message: String, 8 | forbidClick: Boolean, 9 | type: { 10 | type: String, 11 | value: 'text' 12 | }, 13 | loadingType: { 14 | type: String, 15 | value: 'circular' 16 | }, 17 | position: { 18 | type: String, 19 | value: 'middle' 20 | } 21 | }, 22 | 23 | methods: { 24 | clear() { 25 | this.setData({ 26 | show: false 27 | }); 28 | } 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /static/vant/tabbar-item/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | info: null, 6 | icon: String, 7 | dot: Boolean 8 | }, 9 | 10 | relations: { 11 | '../tabbar/index': { 12 | type: 'ancestor' 13 | } 14 | }, 15 | 16 | data: { 17 | active: false, 18 | count: 0 19 | }, 20 | 21 | methods: { 22 | onClick() { 23 | const parent = this.getRelationNodes('../tabbar/index')[0]; 24 | if (parent) { 25 | parent.onChange(this); 26 | } 27 | this.$emit('click'); 28 | } 29 | } 30 | }); 31 | -------------------------------------------------------------------------------- /src/pages/detail/mock.js: -------------------------------------------------------------------------------- 1 | export const mockDetailData = { 2 | id: '1', 3 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 4 | thumbnail: 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 5 | title: '山东水蜜桃1.2kg200g以上/个山东水蜜桃1.2kg200g以上/个', 6 | price: '2680', 7 | count: '5', 8 | views: '10000', 9 | limitDate: '2018-08-31 12:00:00', 10 | 11 | sponsor: '王五', 12 | pictures: [ 13 | 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', 14 | 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg' 15 | ] 16 | } -------------------------------------------------------------------------------- /static/vant/panel/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /static/vant/notice-bar/index.wxss: -------------------------------------------------------------------------------- 1 | .van-notice-bar{display:-webkit-box;display:-webkit-flex;display:flex;padding:9px 10px;font-size:12px;line-height:1.5}.van-notice-bar--within-icon{position:relative;padding-right:30px}.van-notice-bar__left-icon{height:18px;min-width:20px;padding-top:1px;box-sizing:border-box}.van-notice-bar__left-icon>image{width:16px;height:16px}.van-notice-bar__right-icon{position:absolute;top:10px;right:10px;font-size:15px;line-height:1}.van-notice-bar__content-wrap{position:relative;-webkit-box-flex:1;-webkit-flex:1;flex:1;height:18px;overflow:hidden}.van-notice-bar__content{position:absolute;white-space:nowrap} -------------------------------------------------------------------------------- /static/vant/radio/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /static/vant/tabbar-item/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/utils/index.js: -------------------------------------------------------------------------------- 1 | function formatNumber (n) { 2 | const str = n.toString() 3 | return str[1] ? str : `0${str}` 4 | } 5 | 6 | export function formatTime (date) { 7 | const year = date.getFullYear() 8 | const month = date.getMonth() + 1 9 | const day = date.getDate() 10 | 11 | const hour = date.getHours() 12 | const minute = date.getMinutes() 13 | const second = date.getSeconds() 14 | 15 | const t1 = [year, month, day].map(formatNumber).join('/') 16 | const t2 = [hour, minute, second].map(formatNumber).join(':') 17 | 18 | return `${t1} ${t2}` 19 | } 20 | 21 | export default { 22 | formatNumber, 23 | formatTime 24 | } 25 | -------------------------------------------------------------------------------- /static/vant/notify/notify.js: -------------------------------------------------------------------------------- 1 | import { isObj } from '../common/utils'; 2 | 3 | const defaultOptions = { 4 | selector: '#van-notify', 5 | duration: 3000 6 | }; 7 | 8 | function parseOptions(text) { 9 | return isObj(text) ? text : { text }; 10 | } 11 | 12 | export default function Notify(options = {}) { 13 | const pages = getCurrentPages(); 14 | const ctx = pages[pages.length - 1]; 15 | 16 | options = Object.assign({}, defaultOptions, parseOptions(options)); 17 | 18 | const el = ctx.selectComponent(options.selector); 19 | delete options.selector; 20 | 21 | if (el) { 22 | el.setData(options); 23 | el.show(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /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__text{-webkit-flex:1;flex:1;color:#333;font-weight:500;text-align:right}.van-submit-bar__price{padding-right:12px;color:#f44}.van-submit-bar__button button{width:110px}.van-submit-bar__button--disabled button{border:none!important} -------------------------------------------------------------------------------- /project.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "项目配置文件。", 3 | "setting": { 4 | "urlCheck": true, 5 | "es6": false, 6 | "postcss": true, 7 | "minified": true, 8 | "newFeature": true 9 | }, 10 | "miniprogramRoot": "./dist/", 11 | "compileType": "miniprogram", 12 | "appid": "wxb5b98cd6c8619147", 13 | "projectname": "weapp-o2o", 14 | "condition": { 15 | "search": { 16 | "current": -1, 17 | "list": [] 18 | }, 19 | "conversation": { 20 | "current": -1, 21 | "list": [] 22 | }, 23 | "game": { 24 | "currentL": -1, 25 | "list": [] 26 | }, 27 | "miniprogram": { 28 | "current": -1, 29 | "list": [] 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /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__icon{pointer-events:none;display:block;line-height:0}.van-radio__icon--disabled{color:#e5e5e5}.van-radio__icon--checked{color:#06bf04}.van-radio__icon--check{color:#999} -------------------------------------------------------------------------------- /static/vant/switch-cell/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | field: true, 5 | 6 | props: { 7 | title: String, 8 | border: Boolean, 9 | loading: Boolean, 10 | disabled: Boolean, 11 | checked: { 12 | type: Boolean, 13 | observer(value) { 14 | this.setData({ value }); 15 | } 16 | }, 17 | size: { 18 | type: String, 19 | value: '26px' 20 | } 21 | }, 22 | 23 | attached() { 24 | this.setData({ value: this.data.checked }); 25 | }, 26 | 27 | methods: { 28 | onChange(event) { 29 | this.$emit('change', event.detail); 30 | } 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /static/vant/switch/index.wxss: -------------------------------------------------------------------------------- 1 | .van-switch{height:1em;width:1.6em;display:inline-block;position:relative;background:#fff;box-sizing:content-box;border:1px solid rgba(0,0,0,.1);border-radius:1em}.van-switch__node{top:0;left:0;z-index:1;width:1em;height:1em;-webkit-transition:.3s;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%;width:50%;height:50%;position:absolute}.van-switch--on{background-color:#44db5e}.van-switch--on .van-switch__node{-webkit-transform:translateX(.6em);transform:translateX(.6em)}.van-switch--disabled{opacity:.4} -------------------------------------------------------------------------------- /static/vant/search/index.wxss: -------------------------------------------------------------------------------- 1 | .van-search{display:-webkit-box;display:-webkit-flex;display:flex;padding:7px 15px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search__field{-webkit-box-flex:1;-webkit-flex:1;flex:1;border-radius:4px}.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:#666}.van-search__action:active{background-color:#e8e8e8} -------------------------------------------------------------------------------- /static/vant/popup/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | import { transition } from '../mixins/transition'; 3 | 4 | create({ 5 | mixins: [transition(false)], 6 | 7 | props: { 8 | overlayStyle: String, 9 | overlay: { 10 | type: Boolean, 11 | value: true 12 | }, 13 | closeOnClickOverlay: { 14 | type: Boolean, 15 | value: true 16 | }, 17 | position: { 18 | type: String, 19 | value: 'center' 20 | } 21 | }, 22 | 23 | methods: { 24 | onClickOverlay() { 25 | this.$emit('click-overlay'); 26 | 27 | if (this.data.closeOnClickOverlay) { 28 | this.$emit('close'); 29 | } 30 | } 31 | } 32 | }); 33 | -------------------------------------------------------------------------------- /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.setData(); 28 | }; 29 | 30 | props[key] = prop; 31 | }); 32 | } -------------------------------------------------------------------------------- /static/vant/stepper/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /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 | }); -------------------------------------------------------------------------------- /static/vant/nav-bar/index.wxss: -------------------------------------------------------------------------------- 1 | .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:#38f;vertical-align:middle;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.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}.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:#38f;margin:0 -15px;padding:0 15px;display:inline-block;vertical-align:middle}.van-nav-bar__text:active{background-color:#e8e8e8} -------------------------------------------------------------------------------- /static/vant/tabbar-item/index.wxss: -------------------------------------------------------------------------------- 1 | .van-tabbar-item{float:left;color:#666;height:100%;display:-webkit-box;display:-webkit-flex;display:flex;line-height:1;font-size:12px;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;-webkit-box-pack:center;-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--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:#38f} -------------------------------------------------------------------------------- /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 #aaa;color:transparent;font-size:12px;text-align:center}.van-checkbox__icon--round{border-radius:100%}.van-checkbox__icon--checked{border-color:#06bf04;background-color:#06bf04;color:#fff}.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} -------------------------------------------------------------------------------- /static/vant/mixins/touch.js: -------------------------------------------------------------------------------- 1 | export const touch = Behavior({ 2 | methods: { 3 | 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 | 13 | touchMove(event) { 14 | const touch = event.touches[0]; 15 | this.deltaX = touch.clientX - this.startX; 16 | this.deltaY = touch.clientY - this.startY; 17 | this.offsetX = Math.abs(this.deltaX); 18 | this.offsetY = Math.abs(this.deltaY); 19 | this.direction = this.offsetX > this.offsetY ? 'horizontal' : this.offsetX < this.offsetY ? 'vertical' : ''; 20 | } 21 | } 22 | }); 23 | -------------------------------------------------------------------------------- /static/vant/switch/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | field: true, 5 | 6 | classes: ['node-class'], 7 | 8 | props: { 9 | loading: Boolean, 10 | disabled: Boolean, 11 | checked: { 12 | type: Boolean, 13 | observer(value) { 14 | this.setData({ value }); 15 | } 16 | }, 17 | size: { 18 | type: String, 19 | value: '30px' 20 | } 21 | }, 22 | 23 | attached() { 24 | this.setData({ value: this.data.checked }); 25 | }, 26 | 27 | methods: { 28 | onClick() { 29 | if (!this.data.disabled && !this.data.loading) { 30 | const checked = !this.data.checked; 31 | this.$emit('input', checked); 32 | this.$emit('change', checked); 33 | } 34 | } 35 | } 36 | }); 37 | -------------------------------------------------------------------------------- /static/vant/common/class-names.js: -------------------------------------------------------------------------------- 1 | const hasOwn = {}.hasOwnProperty; 2 | 3 | export function classNames() { 4 | const classes = []; 5 | 6 | for (let i = 0; i < arguments.length; i++) { 7 | const arg = arguments[i]; 8 | if (!arg) continue; 9 | 10 | const argType = typeof arg; 11 | 12 | if (argType === 'string' || argType === 'number') { 13 | classes.push(arg); 14 | } else if (Array.isArray(arg) && arg.length) { 15 | const inner = classNames.apply(null, arg); 16 | if (inner) { 17 | classes.push(inner); 18 | } 19 | } else if (argType === 'object') { 20 | for (const key in arg) { 21 | if (hasOwn.call(arg, key) && arg[key]) { 22 | classes.push(key); 23 | } 24 | } 25 | } 26 | } 27 | 28 | return classes.join(' '); 29 | }; 30 | -------------------------------------------------------------------------------- /static/vant/action-sheet/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | show: Boolean, 6 | title: String, 7 | cancelText: String, 8 | actions: { 9 | type: Array, 10 | value: [] 11 | }, 12 | overlay: { 13 | type: Boolean, 14 | value: true 15 | }, 16 | closeOnClickOverlay: { 17 | type: Boolean, 18 | value: true 19 | } 20 | }, 21 | 22 | methods: { 23 | onSelect(event) { 24 | const { index } = event.currentTarget.dataset; 25 | const item = this.data.actions[index]; 26 | if (item && !item.disabled && !item.loading) { 27 | this.$emit('select', item); 28 | } 29 | }, 30 | 31 | onCancel() { 32 | this.$emit('cancel'); 33 | }, 34 | 35 | onClose() { 36 | this.$emit('close'); 37 | } 38 | } 39 | }); 40 | -------------------------------------------------------------------------------- /static/vant/cell-group/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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} -------------------------------------------------------------------------------- /static/vant/toast/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | 12 | {{ message }} 13 | 14 | 15 | 16 | 22 | 23 | {{ message }} 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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} -------------------------------------------------------------------------------- /static/vant/notify/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | text: String, 6 | color: { 7 | type: String, 8 | value: '#fff' 9 | }, 10 | backgroundColor: { 11 | type: String, 12 | value: '#e64340' 13 | }, 14 | duration: { 15 | type: Number, 16 | value: 3000 17 | } 18 | }, 19 | 20 | methods: { 21 | show() { 22 | const { duration } = this.data; 23 | 24 | clearTimeout(this.timer); 25 | this.setData({ 26 | show: true 27 | }); 28 | 29 | if (duration > 0 && duration !== Infinity) { 30 | this.timer = setTimeout(() => { 31 | this.hide(); 32 | }, duration); 33 | } 34 | }, 35 | 36 | hide() { 37 | clearTimeout(this.timer); 38 | this.setData({ 39 | show: false 40 | }); 41 | } 42 | } 43 | }); 44 | -------------------------------------------------------------------------------- /static/vant/badge-group/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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}.van-badge-group{width:85px} -------------------------------------------------------------------------------- /src/components/star.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 20 | 21 | 43 | -------------------------------------------------------------------------------- /static/vant/cell/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | classes: [ 5 | 'title-class', 6 | 'label-class', 7 | 'value-class', 8 | 'left-icon-class', 9 | 'right-icon-class' 10 | ], 11 | 12 | props: { 13 | title: null, 14 | value: null, 15 | url: String, 16 | icon: String, 17 | label: String, 18 | center: Boolean, 19 | isLink: Boolean, 20 | required: Boolean, 21 | clickable: Boolean, 22 | titleWidth: String, 23 | customStyle: String, 24 | arrowDirection: String, 25 | linkType: { 26 | type: String, 27 | value: 'navigateTo' 28 | }, 29 | border: { 30 | type: Boolean, 31 | value: true 32 | } 33 | }, 34 | 35 | methods: { 36 | onClick() { 37 | const { url } = this.data; 38 | if (url) { 39 | wx[this.data.linkType]({ url }); 40 | } 41 | this.$emit('click'); 42 | } 43 | } 44 | }); 45 | -------------------------------------------------------------------------------- /static/vant/nav-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 12 | {{ leftText }} 13 | 14 | 15 | 16 | 17 | {{ title }} 18 | 19 | 20 | 21 | {{ rightText }} 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /static/vant/row/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | relations: { 5 | '../col/index': { 6 | type: 'descendant', 7 | 8 | linked(target) { 9 | if (this.data.gutter) { 10 | target.setGutter(this.data.gutter); 11 | } 12 | } 13 | } 14 | }, 15 | 16 | props: { 17 | gutter: { 18 | type: Number, 19 | observer: 'setGutter' 20 | } 21 | }, 22 | 23 | ready() { 24 | if (this.data.gutter) { 25 | this.setGutter(); 26 | } 27 | }, 28 | 29 | methods: { 30 | setGutter() { 31 | const { gutter } = this.data; 32 | const margin = `-${Number(gutter) / 2}px`; 33 | const style = gutter ? `margin-right: ${margin}; margin-left: ${margin};` : ''; 34 | 35 | this.setData({ style }); 36 | this.getRelationNodes('../col/index').forEach((col) => { 37 | col.setGutter(this.data.gutter); 38 | }); 39 | } 40 | } 41 | }); 42 | -------------------------------------------------------------------------------- /static/vant/panel/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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}.van-panel{background:#fff}.van-panel__header-value{color:#f44}.van-panel__footer{padding:10px 15px} -------------------------------------------------------------------------------- /static/vant/submit-bar/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ tipStr }} 6 | 7 | 8 | 9 | 10 | 11 | 12 | {{ label || '合计:' }} 13 | {{ currency }} {{ priceStr }} 14 | 15 | 16 | 26 | {{ loading ? '' : buttonText }} 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /static/vant/search/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | field: true, 5 | 6 | classes: ['cancel-class'], 7 | 8 | props: { 9 | focus: Boolean, 10 | disabled: Boolean, 11 | readonly: Boolean, 12 | showAction: Boolean, 13 | useActionSlot: Boolean, 14 | placeholder: String, 15 | background: { 16 | type: String, 17 | value: '#f2f2f2' 18 | }, 19 | maxlength: { 20 | type: Number, 21 | value: -1 22 | } 23 | }, 24 | 25 | methods: { 26 | onChange(event) { 27 | this.$emit('change', event.detail); 28 | }, 29 | 30 | onCancel() { 31 | this.setData({ value: '' }); 32 | this.$emit('cancel'); 33 | this.$emit('change', ''); 34 | }, 35 | 36 | onSearch() { 37 | this.$emit('search', this.data.value); 38 | }, 39 | 40 | onFocus() { 41 | this.$emit('focus'); 42 | }, 43 | 44 | onBlur() { 45 | this.$emit('blur'); 46 | } 47 | } 48 | }); 49 | -------------------------------------------------------------------------------- /static/vant/common/create.js: -------------------------------------------------------------------------------- 1 | import { basic } from '../mixins/basic'; 2 | 3 | export function create(sfc) { 4 | // map props to properties 5 | if (sfc.props) { 6 | sfc.properties = sfc.props; 7 | delete sfc.props; 8 | } 9 | 10 | // map mixins to behaviors 11 | if (sfc.mixins) { 12 | sfc.behaviors = sfc.mixins; 13 | delete sfc.mixins; 14 | } 15 | 16 | // map classes to externalClasses 17 | sfc.externalClasses = sfc.classes || []; 18 | delete sfc.classes; 19 | 20 | // add default externalClasses 21 | sfc.externalClasses.push('custom-class'); 22 | 23 | // add default behaviors 24 | sfc.behaviors = sfc.behaviors || []; 25 | sfc.behaviors.push(basic); 26 | 27 | // add default options 28 | sfc.options = sfc.options || {}; 29 | sfc.options.multipleSlots = true; 30 | sfc.options.addGlobalClass = true; 31 | 32 | // map field to form-field behavior 33 | if (sfc.field) { 34 | sfc.behaviors.push('wx://form-field'); 35 | } 36 | 37 | Component(sfc); 38 | }; 39 | -------------------------------------------------------------------------------- /static/vant/steps/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | {{ item.text }} 10 | {{ item.desc }} 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /static/vant/toast/index.wxss: -------------------------------------------------------------------------------- 1 | .van-toast{display:-webkit-box;display:-webkit-flex;display:flex;color:#fff;font-size:12px;line-height:1.2;border-radius:5px;word-break:break-all;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;flex-direction:column;box-sizing:border-box;background-color:rgba(0,0,0,.7)}.van-toast__container{top:50%;left:50%;z-index:3001;position:fixed;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-toast--text{padding:12px;min-width:220px}.van-toast--icon{width:120px;min-height:120px;padding:15px}.van-toast--icon .van-toast__icon{height:1em;font-size:50px}.van-toast--icon .van-toast__text{font-size:14px;padding-top:10px}.van-toast__loading{margin:10px 0 5px}.van-toast--top{-webkit-transform:translate(0,-30vh);transform:translate(0,-30vh)}.van-toast--bottom{-webkit-transform:translate(0,30vh);transform:translate(0,30vh)} -------------------------------------------------------------------------------- /static/vant/tree-select/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}.tree-select{-webkit-user-select:none;user-select:none;position:relative;font-size:16px}.tree-select__nav{width:143px;position:absolute;left:0;top:0;bottom:0;overflow:scroll;background-color:#fff;-webkit-overflow-scrolling:touch}.tree-select__nitem{line-height:44px;padding:0 15px;background-color:#fff}.tree-select__nitem--active{background-color:#f8f8f8}.tree-select__content{padding:0 15px;margin-left:143px;overflow:scroll;-webkit-overflow-scrolling:touch}.tree-select__item{position:relative;line-height:44px;padding-left:5px;padding-right:18px}.tree-select__item--active{color:#f44}.tree-select__selected{float:right;position:absolute;right:0;top:0;bottom:0;line-height:inherit} -------------------------------------------------------------------------------- /static/vant/search/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 24 | 25 | 26 | 27 | 取消 28 | 29 | 30 | -------------------------------------------------------------------------------- /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: [String, Boolean], 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 | }, 21 | computed: { 22 | hasPrice: function hasPrice() { 23 | return typeof this.data.price === 'number'; 24 | }, 25 | priceStr: function priceStr() { 26 | return (this.data.price / 100).toFixed(2); 27 | }, 28 | tipStr: function tipStr() { 29 | var tip = this.data.tip; 30 | return typeof tip === 'string' ? tip : ''; 31 | } 32 | }, 33 | methods: { 34 | onSubmit: function onSubmit(event) { 35 | this.$emit('submit', event.detail); 36 | } 37 | } 38 | }); -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /static/vant/card/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | {{ title }} 9 | {{ currency }} {{ price }} 10 | 11 | 12 | 13 | {{ desc }} 14 | x {{ num }} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /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 | 7 | if (watch) { 8 | var props = options.properties || {}; 9 | Object.keys(watch).forEach(function (key) { 10 | if (key in props) { 11 | var prop = props[key]; 12 | 13 | if (prop === null || !('type' in prop)) { 14 | prop = { 15 | type: prop 16 | }; 17 | } 18 | 19 | prop.observer = watch[key]; 20 | props[key] = prop; 21 | } 22 | }); 23 | options.properties = props; 24 | } 25 | 26 | if (computed) { 27 | options.behaviors.push(behavior); 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 | } -------------------------------------------------------------------------------- /static/vant/button/index.wxml: -------------------------------------------------------------------------------- 1 | 31 | -------------------------------------------------------------------------------- /static/vant/steps/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | icon: String, 6 | steps: { 7 | type: Array, 8 | observer: 'formatSteps' 9 | }, 10 | active: { 11 | type: Number, 12 | observer: 'formatSteps' 13 | }, 14 | direction: { 15 | type: String, 16 | value: 'horizontal' 17 | }, 18 | activeColor: { 19 | type: String, 20 | value: '#06bf04' 21 | } 22 | }, 23 | 24 | attached() { 25 | this.formatSteps(); 26 | }, 27 | 28 | methods: { 29 | formatSteps() { 30 | const { steps } = this.data; 31 | steps.forEach((step, index) => { 32 | step.status = this.getStatus(index); 33 | }); 34 | this.setData({ steps }); 35 | }, 36 | 37 | getStatus(index) { 38 | const { active } = this.data; 39 | 40 | if (index < active) { 41 | return 'finish'; 42 | } else if (index === active) { 43 | return 'process'; 44 | } 45 | 46 | return ''; 47 | } 48 | } 49 | }); 50 | -------------------------------------------------------------------------------- /static/vant/tree-select/index.wxml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 13 | {{ item.text }} 14 | 15 | 16 | 20 | 27 | {{ item.text }} 28 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /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:#38f;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} -------------------------------------------------------------------------------- /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 | var setData = this.setData; 11 | 12 | var _this$$options = this.$options(), 13 | computed = _this$$options.computed; 14 | 15 | var keys = Object.keys(computed); 16 | 17 | var calcComputed = function calcComputed() { 18 | var needUpdate = {}; 19 | keys.forEach(function (key) { 20 | var value = computed[key].call(_this); 21 | 22 | if (cache[key] !== value) { 23 | cache[key] = needUpdate[key] = value; 24 | } 25 | }); 26 | return needUpdate; 27 | }; 28 | 29 | Object.defineProperty(this, 'setData', { 30 | writable: true 31 | }); 32 | 33 | this.setData = function (data, callback) { 34 | data && setData.call(_this, data, callback); 35 | setData.call(_this, calcComputed()); 36 | }; 37 | }, 38 | attached: function attached() { 39 | this.setData(); 40 | } 41 | }); -------------------------------------------------------------------------------- /static/vant/field/index.wxss: -------------------------------------------------------------------------------- 1 | .van-field__body{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__control{border:0;margin:0;padding:0;width:100%;resize:none;display:block;text-align:left;box-sizing:border-box;line-height:inherit;background-color:transparent}.van-field__control--disabled{opacity:1;color:#666;background-color:transparent}.van-field__control--center{text-align:center}.van-field__control--right{text-align:right}.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;font-size:16px;line-height:inherit}.van-field__button{padding-left:10px}.van-field__error-message{color:#f44;font-size:12px;text-align:left}.van-field--error{color:#f44}.van-field--label-center .van-cell__title{text-align:center}.van-field--label-right .van-cell__title{text-align:right} -------------------------------------------------------------------------------- /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.setData({ 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.setData({ 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.setData({ 34 | disabled: _disabled || child.data.disabled 35 | }); 36 | }); 37 | } 38 | } 39 | }); -------------------------------------------------------------------------------- /static/vant/mixins/transition.js: -------------------------------------------------------------------------------- 1 | export const transition = function(showDefaultValue) { 2 | return Behavior({ 3 | properties: { 4 | customStyle: String, 5 | show: { 6 | value: showDefaultValue, 7 | type: Boolean, 8 | observer(value) { 9 | if (value) { 10 | this.show(); 11 | } else { 12 | this.setData({ 13 | type: 'leave' 14 | }); 15 | } 16 | } 17 | }, 18 | duration: { 19 | type: Number, 20 | value: 300 21 | } 22 | }, 23 | 24 | data: { 25 | type: '', 26 | inited: false, 27 | display: false 28 | }, 29 | 30 | attached() { 31 | if (this.data.show) { 32 | this.show(); 33 | } 34 | }, 35 | 36 | methods: { 37 | show() { 38 | this.setData({ 39 | inited: true, 40 | display: true, 41 | type: 'enter' 42 | }); 43 | }, 44 | 45 | onAnimationEnd() { 46 | if (!this.data.show) { 47 | this.setData({ 48 | display: false 49 | }); 50 | } 51 | } 52 | } 53 | }); 54 | }; 55 | -------------------------------------------------------------------------------- /static/vant/cell/index.wxml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | {{ title }} 11 | {{ label }} 12 | 13 | 14 | 15 | 16 | {{ value }} 17 | 18 | 19 | 20 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /static/vant/mixins/button.js: -------------------------------------------------------------------------------- 1 | export const button = Behavior({ 2 | properties: { 3 | loading: Boolean, 4 | openType: String, 5 | appParameter: String, 6 | sendMessageTitle: String, 7 | sendMessagePath: String, 8 | sendMessageImg: String, 9 | showMessageCard: String, 10 | hoverStopPropagation: Boolean, 11 | hoverStartTime: { 12 | type: Number, 13 | value: 20 14 | }, 15 | hoverStayTime: { 16 | type: Number, 17 | value: 70 18 | }, 19 | lang: { 20 | type: String, 21 | value: 'en' 22 | }, 23 | sessionFrom: { 24 | type: String, 25 | value: '' 26 | } 27 | }, 28 | 29 | methods: { 30 | bindgetuserinfo(event = {}) { 31 | this.$emit('getuserinfo', event.detail); 32 | }, 33 | 34 | bindcontact(event = {}) { 35 | this.$emit('contact', event.detail); 36 | }, 37 | 38 | bindgetphonenumber(event = {}) { 39 | this.$emit('getphonenumber', event.detail); 40 | }, 41 | 42 | bindopensetting(event = {}) { 43 | this.$emit('opensetting', event.detail); 44 | }, 45 | 46 | binderror(event = {}) { 47 | this.$emit('error', event.detail); 48 | } 49 | } 50 | }); 51 | -------------------------------------------------------------------------------- /src/pages/addressNew/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 41 | 42 | 60 | -------------------------------------------------------------------------------- /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.setData({ 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.setData({ 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.setData({ 35 | disabled: _disabled || child.data.disabled 36 | }); 37 | }); 38 | } 39 | } 40 | }); -------------------------------------------------------------------------------- /src/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "pages": [ 3 | "pages/login/main", 4 | "pages/logup/main", 5 | "pages/address/main", 6 | "pages/index/main", 7 | "pages/recommend/main", 8 | "pages/user/main", 9 | "pages/detail/main", 10 | "pages/order/main", 11 | "pages/addressLists/main", 12 | "pages/addressNew/main" 13 | ], 14 | "window": { 15 | "backgroundColor": "#828282", 16 | "backgroundTextStyle": "light", 17 | "navigationBarBackgroundColor": "#fff", 18 | "navigationBarTitleText": "WeChat", 19 | "navigationBarTextStyle": "black" 20 | }, 21 | "tabBar": { 22 | "color": "#8a8a8a", 23 | "selectedColor": "#FB2525", 24 | "list": [{ 25 | "selectedIconPath": "static/icon/home-hover.png", 26 | "iconPath": "static/icon/home.png", 27 | "pagePath": "pages/index/main", 28 | "text": "首页" 29 | }, 30 | { 31 | "selectedIconPath": "static/icon/block-hover.png", 32 | "iconPath": "static/icon/block.png", 33 | "pagePath": "pages/recommend/main", 34 | "text": "推荐" 35 | }, 36 | { 37 | "selectedIconPath": "static/icon/user-hover.png", 38 | "iconPath": "static/icon/user.png", 39 | "pagePath": "pages/user/main", 40 | "text": "个人中心" 41 | }] 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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} -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /static/vant/badge-group/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | relations: { 5 | '../badge/index': { 6 | type: 'descendant', 7 | 8 | linked(target) { 9 | this.data.badges.push(target); 10 | this.setActive(); 11 | }, 12 | 13 | unlinked(target) { 14 | this.data.badges = this.data.badges.filter(item => item !== target); 15 | this.setActive(); 16 | } 17 | } 18 | }, 19 | 20 | props: { 21 | active: { 22 | type: Number, 23 | value: 0, 24 | observer: 'setActive' 25 | } 26 | }, 27 | 28 | data: { 29 | badges: [] 30 | }, 31 | 32 | attached() { 33 | this.currentActive = -1; 34 | }, 35 | 36 | methods: { 37 | setActive(badge) { 38 | let { active } = this.data; 39 | if (badge) { 40 | active = this.data.badges.indexOf(badge); 41 | } 42 | 43 | if (active === this.currentActive) { 44 | return; 45 | } 46 | 47 | if (this.currentActive !== -1) { 48 | this.$emit('change', active); 49 | } 50 | 51 | this.currentActive = active; 52 | this.data.badges.forEach((badge, index) => { 53 | badge.setActive(index === active); 54 | }); 55 | } 56 | } 57 | }); 58 | -------------------------------------------------------------------------------- /static/vant/card/index.wxss: -------------------------------------------------------------------------------- 1 | .van-card{color:#333;height:100px;font-size:16px;background:#fafafa;position:relative;box-sizing:border-box;padding:5px 15px 5px 115px}.van-card--center,.van-card__thumb{-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}.van-card__thumb{top:5px;left:15px;width:90px;height:90px;position:absolute}.van-card__img{border:none;max-width:100%;max-height:100%}.van-card,.van-card__row,.van-card__thumb{display:-webkit-box;display:-webkit-flex;display:flex}.van-card__content{width:100%}.van-card__content--center{height:90px;-webkit-box-align:center;-webkit-align-items:center;align-items:center}.van-card__desc,.van-card__title{line-height:20px;word-break:break-all}.van-card__title{max-height:40px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.van-card__desc{color:#666;font-size:12px;max-height:20px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.van-card__num,.van-card__price{-webkit-box-flex:1;-webkit-flex:1;flex:1;min-width:80px;line-height:20px;text-align:right}.van-card__price{font-size:14px}.van-card__num{color:#666;font-size:12px}.van-card__footer{right:15px;bottom:5px;position:absolute}.van-card__footer .van-button{margin-left:5px} -------------------------------------------------------------------------------- /src/pages/addressLists/index.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 44 | 45 | 63 | -------------------------------------------------------------------------------- /static/vant/tabs/index.wxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 18 | {{ item.data.title }} 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /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 | }, 16 | computed: { 17 | iconClass: function iconClass() { 18 | var _this$data = this.data, 19 | disabled = _this$data.disabled, 20 | name = _this$data.name, 21 | value = _this$data.value; 22 | return this.classNames('van-radio__icon', { 23 | 'van-radio__icon--disabled': disabled, 24 | 'van-radio__icon--checked': !disabled && name === value, 25 | 'van-radio__icon--check': !disabled && name !== value 26 | }); 27 | } 28 | }, 29 | methods: { 30 | emitChange: function emitChange(value) { 31 | var instance = this.getRelationNodes('../radio-group/index')[0] || this; 32 | instance.$emit('input', value); 33 | instance.$emit('change', value); 34 | }, 35 | onChange: function onChange(event) { 36 | this.emitChange(event.detail.value); 37 | }, 38 | onClickLabel: function onClickLabel() { 39 | if (!this.data.disabled && !this.data.labelDisabled) { 40 | this.emitChange(this.data.name); 41 | } 42 | } 43 | } 44 | }); -------------------------------------------------------------------------------- /src/pages/recommend/mock.js: -------------------------------------------------------------------------------- 1 | export const mockListData = [ 2 | { 3 | id: 1, 4 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 5 | title: '原膳泰翔二去金昌鱼340kg', 6 | star: 5, 7 | value: 32.90, 8 | sold: 5000, 9 | limitDate: '2018-08-24', 10 | address: '仓山万达广场5.9km' 11 | }, 12 | { 13 | id: 2, 14 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 15 | title: '原膳泰翔二去金昌鱼340kg', 16 | star: 5, 17 | value: 32.90, 18 | sold: 5000, 19 | limitDate: '2018-08-24', 20 | address: '仓山万达广场5.9km' 21 | }, 22 | { 23 | id: 3, 24 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 25 | title: '原膳泰翔二去金昌鱼340kg', 26 | star: 5, 27 | value: 32.90, 28 | sold: 5000, 29 | limitDate: '2018-08-24', 30 | address: '仓山万达广场5.9km' 31 | }, 32 | { 33 | id: 4, 34 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 35 | title: '原膳泰翔二去金昌鱼340kg', 36 | star: 5, 37 | value: 32.90, 38 | sold: 5000, 39 | limitDate: '2018-08-24', 40 | address: '仓山万达广场5.9km' 41 | }, 42 | { 43 | id: 5, 44 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 45 | title: '原膳泰翔二去金昌鱼340kg', 46 | star: 5, 47 | value: 32.90, 48 | sold: 5000, 49 | limitDate: '2018-08-24', 50 | address: '仓山万达广场5.9km' 51 | } 52 | ] -------------------------------------------------------------------------------- /static/vant/tag/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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}.van-tag{display:inline-block;padding:2px 5px;line-height:normal;border-radius:3px;font-size:10px;background:#c9c9c9;color:#fff}.van-tag::after{border-color:currentColor;border-radius:4px}.van-tag--mark{padding-right:7px;border-radius:0 8px 8px 0}.van-tag--mark::after{border-radius:0 16px 16px 0}.van-tag--success{background:#06bf04}.van-tag--success.van-tag--plain{color:#06bf04}.van-tag--danger{background:#f44}.van-tag--danger.van-tag--plain{color:#f44}.van-tag--primary{background:#38f}.van-tag--primary.van-tag--plain{color:#38f}.van-tag--plain{background:#fff;color:#c9c9c9} -------------------------------------------------------------------------------- /static/vant/stepper/index.wxss: -------------------------------------------------------------------------------- 1 | .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 #e5e5e5;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:#6c6c6c}.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;border:1px solid #e5e5e5;border-width:1px 0;border-radius:0;box-sizing:content-box;color:#666;font-size:14px;text-align:center;-webkit-appearance:none}.van-stepper__input--disabled{color:#c9c9c9;background-color:#f8f8f8} -------------------------------------------------------------------------------- /static/vant/button/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | import { classNames } from '../common/class-names'; 3 | import { button } from '../mixins/button'; 4 | 5 | const booleanProp = { 6 | type: Boolean, 7 | observer: 'setClasses' 8 | }; 9 | 10 | create({ 11 | mixins: [button], 12 | 13 | props: { 14 | type: { 15 | type: String, 16 | value: 'default', 17 | observer: 'setClasses' 18 | }, 19 | size: { 20 | type: String, 21 | value: 'normal', 22 | observer: 'setClasses' 23 | }, 24 | plain: booleanProp, 25 | block: booleanProp, 26 | square: booleanProp, 27 | loading: booleanProp, 28 | disabled: booleanProp 29 | }, 30 | 31 | attached() { 32 | this.setClasses(); 33 | }, 34 | 35 | methods: { 36 | onClick() { 37 | if (!this.data.disabled && !this.data.loading) { 38 | this.$emit('click'); 39 | } 40 | }, 41 | 42 | setClasses() { 43 | const { type, size, plain, disabled, loading, square, block } = this.data; 44 | this.setData({ 45 | classes: classNames(`van-button--${type}`, `van-button--${size}`, { 46 | 'van-button--block': block, 47 | 'van-button--plain': plain, 48 | 'van-button--square': square, 49 | 'van-button--loading': loading, 50 | 'van-button--disabled': disabled, 51 | 'van-button--unclickable': disabled || loading 52 | }) 53 | }); 54 | } 55 | } 56 | }); 57 | -------------------------------------------------------------------------------- /static/vant/action-sheet/index.wxml: -------------------------------------------------------------------------------- 1 | 9 | 10 | {{ title }} 11 | 12 | 13 | 14 | 28 | 29 | 34 | {{ cancelText }} 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /static/vant/dialog/dialog.js: -------------------------------------------------------------------------------- 1 | let queue = []; 2 | 3 | const Dialog = options => { 4 | return new Promise((resolve, reject) => { 5 | const pages = getCurrentPages(); 6 | const ctx = pages[pages.length - 1]; 7 | 8 | const dialog = ctx.selectComponent(options.selector); 9 | delete options.selector; 10 | 11 | if (dialog) { 12 | dialog.setData({ 13 | onCancel: reject, 14 | onConfirm: resolve, 15 | ...options 16 | }); 17 | queue.push(dialog); 18 | } 19 | }); 20 | }; 21 | 22 | Dialog.defaultOptions = { 23 | show: true, 24 | title: '', 25 | message: '', 26 | overlay: true, 27 | asyncClose: false, 28 | selector: '#van-dialog', 29 | confirmButtonText: '确认', 30 | cancelButtonText: '取消', 31 | showConfirmButton: true, 32 | showCancelButton: false, 33 | closeOnClickOverlay: false, 34 | confirmButtonOpenType: '' 35 | }; 36 | 37 | Dialog.alert = options => 38 | Dialog({ 39 | ...Dialog.currentOptions, 40 | ...options 41 | }); 42 | 43 | Dialog.confirm = options => 44 | Dialog({ 45 | ...Dialog.currentOptions, 46 | showCancelButton: true, 47 | ...options 48 | }); 49 | 50 | Dialog.close = () => { 51 | queue.forEach(dialog => { 52 | dialog.close(); 53 | }); 54 | queue = []; 55 | }; 56 | 57 | Dialog.setDefaultOptions = options => { 58 | Object.assign(Dialog.currentOptions, options); 59 | }; 60 | 61 | Dialog.resetDefaultOptions = () => { 62 | Dialog.currentOptions = { ...Dialog.defaultOptions }; 63 | }; 64 | 65 | Dialog.resetDefaultOptions(); 66 | 67 | export default Dialog; 68 | -------------------------------------------------------------------------------- /static/vant/tabbar/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | active: { 6 | type: Number, 7 | observer(active) { 8 | this.setData({ currentActive: active }); 9 | this.setActiveItem(); 10 | } 11 | }, 12 | fixed: { 13 | type: Boolean, 14 | value: true 15 | }, 16 | zIndex: { 17 | type: Number, 18 | value: 1 19 | } 20 | }, 21 | 22 | data: { 23 | items: [], 24 | currentActive: -1 25 | }, 26 | 27 | attached() { 28 | this.setData({ currentActive: this.data.active }); 29 | }, 30 | 31 | relations: { 32 | '../tabbar-item/index': { 33 | type: 'descendant', 34 | 35 | linked(target) { 36 | this.data.items.push(target); 37 | this.setActiveItem(); 38 | }, 39 | 40 | unlinked(target) { 41 | this.data.items = this.data.items.filter(item => item !== target); 42 | this.setActiveItem(); 43 | } 44 | } 45 | }, 46 | 47 | methods: { 48 | setActiveItem() { 49 | this.data.items.forEach((item, index) => { 50 | item.setData({ 51 | active: index === this.data.currentActive, 52 | count: this.data.items.length 53 | }); 54 | }); 55 | }, 56 | 57 | onChange(child) { 58 | const active = this.data.items.indexOf(child); 59 | if (active !== this.data.currentActive && active !== -1) { 60 | this.$emit('change', active); 61 | this.setData({ currentActive: active }); 62 | this.setActiveItem(); 63 | } 64 | } 65 | } 66 | }); 67 | -------------------------------------------------------------------------------- /config/index.js: -------------------------------------------------------------------------------- 1 | // see http://vuejs-templates.github.io/webpack for documentation. 2 | var path = require('path') 3 | 4 | module.exports = { 5 | build: { 6 | env: require('./prod.env'), 7 | index: path.resolve(__dirname, '../dist/index.html'), 8 | assetsRoot: path.resolve(__dirname, '../dist'), 9 | assetsSubDirectory: '', 10 | assetsPublicPath: '/', 11 | productionSourceMap: false, 12 | // Gzip off by default as many popular static hosts such as 13 | // Surge or Netlify already gzip all static assets for you. 14 | // Before setting to `true`, make sure to: 15 | // npm install --save-dev compression-webpack-plugin 16 | productionGzip: false, 17 | productionGzipExtensions: ['js', 'css'], 18 | // Run the build command with an extra argument to 19 | // View the bundle analyzer report after build finishes: 20 | // `npm run build --report` 21 | // Set to `true` or `false` to always turn it on or off 22 | bundleAnalyzerReport: process.env.npm_config_report 23 | }, 24 | dev: { 25 | env: require('./dev.env'), 26 | port: 8080, 27 | // 在小程序开发者工具中不需要自动打开浏览器 28 | autoOpenBrowser: false, 29 | assetsSubDirectory: '', 30 | assetsPublicPath: '/', 31 | proxyTable: {}, 32 | // CSS Sourcemaps off by default because relative paths are "buggy" 33 | // with this option, according to the CSS-Loader README 34 | // (https://github.com/webpack/css-loader#sourcemaps) 35 | // In our experience, they generally work as expected, 36 | // just be aware of this issue when enabling this option. 37 | cssSourceMap: false 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /static/vant/col/index.wxss: -------------------------------------------------------------------------------- 1 | .van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16667%}.van-col--offset-1{margin-left:4.16667%}.van-col--2{width:8.33333%}.van-col--offset-2{margin-left:8.33333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66667%}.van-col--offset-4{margin-left:16.66667%}.van-col--5{width:20.83333%}.van-col--offset-5{margin-left:20.83333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16667%}.van-col--offset-7{margin-left:29.16667%}.van-col--8{width:33.33333%}.van-col--offset-8{margin-left:33.33333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66667%}.van-col--offset-10{margin-left:41.66667%}.van-col--11{width:45.83333%}.van-col--offset-11{margin-left:45.83333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16667%}.van-col--offset-13{margin-left:54.16667%}.van-col--14{width:58.33333%}.van-col--offset-14{margin-left:58.33333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66667%}.van-col--offset-16{margin-left:66.66667%}.van-col--17{width:70.83333%}.van-col--offset-17{margin-left:70.83333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16667%}.van-col--offset-19{margin-left:79.16667%}.van-col--20{width:83.33333%}.van-col--offset-20{margin-left:83.33333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66667%}.van-col--offset-22{margin-left:91.66667%}.van-col--23{width:95.83333%}.van-col--offset-23{margin-left:95.83333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%} -------------------------------------------------------------------------------- /static/vant/dialog/index.wxml: -------------------------------------------------------------------------------- 1 | 8 | 9 | {{ title }} 10 | 11 | 12 | 13 | 14 | {{ message }} 15 | 16 | 17 | 18 | 19 | 25 | {{ cancelButtonText }} 26 | 27 | 28 | 32 | 39 | {{ confirmButtonText }} 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /static/vant/badge/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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}.van-badge{display:block;overflow:hidden;font-size:14px;line-height:1.4;-webkit-user-select:none;user-select:none;color:#666;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:2px;right:2px;color:#fff;font-size:10px;font-weight:400;-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} -------------------------------------------------------------------------------- /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 }; -------------------------------------------------------------------------------- /static/vant/toast/toast.js: -------------------------------------------------------------------------------- 1 | import { isObj } from '../common/utils'; 2 | 3 | const defaultOptions = { 4 | type: 'text', 5 | mask: false, 6 | message: '', 7 | show: true, 8 | duration: 3000, 9 | position: 'middle', 10 | forbidClick: false, 11 | loadingType: 'circular', 12 | selector: '#van-toast' 13 | }; 14 | 15 | let queue = []; 16 | let currentOptions = { ...defaultOptions }; 17 | 18 | function parseOptions(message) { 19 | return isObj(message) ? message : { message }; 20 | } 21 | 22 | function Toast(options = {}) { 23 | options = { 24 | ...currentOptions, 25 | ...parseOptions(options) 26 | }; 27 | 28 | const pages = getCurrentPages(); 29 | const ctx = pages[pages.length - 1]; 30 | 31 | const toast = ctx.selectComponent(options.selector); 32 | delete options.selector; 33 | 34 | queue.push(toast); 35 | toast.setData(options); 36 | clearTimeout(toast.timer); 37 | 38 | if (options.duration > 0) { 39 | toast.timer = setTimeout(() => { 40 | toast.clear(); 41 | queue = queue.filter(item => item !== toast); 42 | }, options.duration); 43 | } 44 | 45 | return toast; 46 | }; 47 | 48 | const createMethod = type => options => Toast({ 49 | type, ...parseOptions(options) 50 | }); 51 | 52 | ['loading', 'success', 'fail'].forEach(method => { 53 | Toast[method] = createMethod(method); 54 | }); 55 | 56 | Toast.clear = all => { 57 | queue.forEach(toast => { 58 | toast.clear(); 59 | }); 60 | queue = []; 61 | }; 62 | 63 | Toast.setDefaultOptions = options => { 64 | Object.assign(currentOptions, options); 65 | }; 66 | 67 | Toast.resetDefaultOptions = () => { 68 | currentOptions = { ...defaultOptions }; 69 | }; 70 | 71 | export default Toast; 72 | -------------------------------------------------------------------------------- /src/pages/index/mock.js: -------------------------------------------------------------------------------- 1 | export const mockBannerData = [ 2 | { url: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', id: 1 }, 3 | { url: 'http://img06.tooopen.com/images/20160818/tooopen_sy_175866434296.jpg', id: 2 }, 4 | { url: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', id: 3 } 5 | ] 6 | 7 | export const mockListData = [ 8 | { 9 | id: 1, 10 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 11 | title: '原膳泰翔二去金昌鱼340kg', 12 | star: 5, 13 | value: 32.90, 14 | sold: 5000, 15 | limitDate: '2018-08-24', 16 | address: '仓山万达广场5.9km' 17 | }, 18 | { 19 | id: 2, 20 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 21 | title: '原膳泰翔二去金昌鱼340kg', 22 | star: 5, 23 | value: 32.90, 24 | sold: 5000, 25 | limitDate: '2018-08-24', 26 | address: '仓山万达广场5.9km' 27 | }, 28 | { 29 | id: 3, 30 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 31 | title: '原膳泰翔二去金昌鱼340kg', 32 | star: 5, 33 | value: 32.90, 34 | sold: 5000, 35 | limitDate: '2018-08-24', 36 | address: '仓山万达广场5.9km' 37 | }, 38 | { 39 | id: 4, 40 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 41 | title: '原膳泰翔二去金昌鱼340kg', 42 | star: 5, 43 | value: 32.90, 44 | sold: 5000, 45 | limitDate: '2018-08-24', 46 | address: '仓山万达广场5.9km' 47 | }, 48 | { 49 | id: 5, 50 | cover: 'http://img02.tooopen.com/images/20150928/tooopen_sy_143912755726.jpg', 51 | title: '原膳泰翔二去金昌鱼340kg', 52 | star: 5, 53 | value: 32.90, 54 | sold: 5000, 55 | limitDate: '2018-08-24', 56 | address: '仓山万达广场5.9km' 57 | } 58 | ] -------------------------------------------------------------------------------- /static/vant/dialog/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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}.van-dialog{width:85%;font-size:16px;overflow:hidden;border-radius:4px;background-color:#fff}.van-dialog__header{padding:15px 0 0;text-align:center}.van-dialog__header--isolated{padding:25px 0}.van-dialog__message{line-height:1.5;padding:15px 20px}.van-dialog__message--has-title{color:#999;font-size:14px}.van-dialog__footer{display:-webkit-box;display:-webkit-flex;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__button{-webkit-box-flex:1;-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog__confirm,.van-dialog__confirm:active{color:#00c000!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)} -------------------------------------------------------------------------------- /static/vant/action-sheet/index.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;top:0;left:0;width:200%;height:200%;-webkit-transform:scale(.5);transform:scale(.5);-webkit-transform-origin:0 0;transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.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}.van-action-sheet{color:#333;max-height:90%;overflow-y:auto;-webkit-overflow-scrolling:touch;background-color:#f8f8f8}.van-action-sheet--withtitle{background-color:#fff}.van-action-sheet__cancel,.van-action-sheet__item{height:50px;line-height:50px;font-size:16px;text-align:center;background-color:#fff}.van-action-sheet__cancel:active,.van-action-sheet__item:active{background-color:#e8e8e8}.van-action-sheet__item--disabled{color:#c9c9c9}.van-action-sheet__item--disabled:active{background-color:#fff}.van-action-sheet__name,.van-action-sheet__subname{display:inline-block}.van-action-sheet__subname{font-size:12px;color:#666;margin-left:5px}.van-action-sheet__loading{display:inline-block}.van-action-sheet__cancel{margin-top:10px}.van-action-sheet__header{font-size:16px;line-height:44px;text-align:center}.van-action-sheet__close{top:0;right:0;padding:0 15px;font-size:18px!important;color:#999;position:absolute!important;line-height:inherit!important} -------------------------------------------------------------------------------- /static/vant/dialog/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | title: String, 6 | message: String, 7 | useSlot: Boolean, 8 | asyncClose: Boolean, 9 | showCancelButton: Boolean, 10 | confirmButtonOpenType: String, 11 | show: { 12 | type: Boolean, 13 | observer(show) { 14 | if (!show) { 15 | this.setData({ 16 | loading: { 17 | confirm: false, 18 | cancel: false 19 | } 20 | }); 21 | } 22 | } 23 | }, 24 | confirmButtonText: { 25 | type: String, 26 | value: '确认' 27 | }, 28 | cancelButtonText: { 29 | type: String, 30 | value: '取消' 31 | }, 32 | showConfirmButton: { 33 | type: Boolean, 34 | value: true 35 | }, 36 | overlay: { 37 | type: Boolean, 38 | value: true 39 | }, 40 | closeOnClickOverlay: { 41 | type: Boolean, 42 | value: false 43 | } 44 | }, 45 | 46 | data: { 47 | loading: { 48 | confirm: false, 49 | cancel: false 50 | } 51 | }, 52 | 53 | methods: { 54 | onConfirm() { 55 | this.handleAction('confirm'); 56 | }, 57 | 58 | onCancel() { 59 | this.handleAction('cancel'); 60 | }, 61 | 62 | onClickOverlay() { 63 | this.onClose('overlay'); 64 | }, 65 | 66 | handleAction(action) { 67 | if (this.data.asyncClose) { 68 | this.setData({ 69 | [`loading.${action}`]: true 70 | }); 71 | } 72 | 73 | this.onClose(action); 74 | }, 75 | 76 | onClose(action) { 77 | if (!this.data.asyncClose) { 78 | this.setData({ show: false }); 79 | } 80 | this.$emit('close', action); 81 | this.$emit(action); 82 | } 83 | } 84 | }); 85 | -------------------------------------------------------------------------------- /static/vant/tree-select/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | const ITEM_HEIGHT = 44; 4 | 5 | create({ 6 | props: { 7 | items: { 8 | type: Array, 9 | observer() { 10 | this.updateSubItems(); 11 | this.updateMainHeight(); 12 | } 13 | }, 14 | mainActiveIndex: { 15 | type: Number, 16 | value: 0, 17 | observer: 'updateSubItems' 18 | }, 19 | activeId: { 20 | type: Number, 21 | value: 0 22 | }, 23 | maxHeight: { 24 | type: Number, 25 | value: 300, 26 | observer() { 27 | this.updateItemHeight(); 28 | this.updateMainHeight(); 29 | } 30 | } 31 | }, 32 | 33 | data: { 34 | subItems: [], 35 | mainHeight: 0, 36 | itemHeight: 0 37 | }, 38 | 39 | methods: { 40 | // 当一个子项被选择时 41 | onSelectItem(event) { 42 | this.$emit('click-item', event.currentTarget.dataset.item); 43 | }, 44 | 45 | // 当一个导航被点击时 46 | onClickNav(event) { 47 | const { index } = event.currentTarget.dataset; 48 | this.$emit('click-nav', { index }); 49 | }, 50 | 51 | // 更新子项列表 52 | updateSubItems() { 53 | const selectedItem = this.data.items[this.data.mainActiveIndex] || {}; 54 | 55 | this.setData({ subItems: selectedItem.children || [] }); 56 | 57 | this.updateItemHeight(); 58 | }, 59 | 60 | // 更新组件整体高度,根据最大高度和当前组件需要展示的高度来决定 61 | updateMainHeight() { 62 | const maxHeight = Math.max(this.data.items.length * ITEM_HEIGHT, this.data.subItems.length * ITEM_HEIGHT); 63 | 64 | this.setData({ mainHeight: Math.min(maxHeight, this.data.maxHeight) }); 65 | }, 66 | 67 | // 更新子项列表高度,根据可展示的最大高度和当前子项列表的高度决定 68 | updateItemHeight() { 69 | this.setData({ itemHeight: Math.min(this.data.subItems.length * ITEM_HEIGHT, this.data.maxHeight) }); 70 | } 71 | } 72 | }); 73 | -------------------------------------------------------------------------------- /static/vant/stepper/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | // Note that the bitwise operators and shift operators operate on 32-bit ints 4 | // so in that case, the max safe integer is 2^31-1, or 2147483647 5 | const MAX = 2147483647; 6 | 7 | create({ 8 | field: true, 9 | 10 | classes: [ 11 | 'input-class', 12 | 'plus-class', 13 | 'minus-class' 14 | ], 15 | 16 | props: { 17 | integer: Boolean, 18 | disabled: Boolean, 19 | disableInput: Boolean, 20 | min: { 21 | type: null, 22 | value: 1 23 | }, 24 | max: { 25 | type: null, 26 | value: MAX 27 | }, 28 | step: { 29 | type: null, 30 | value: 1 31 | } 32 | }, 33 | 34 | attached() { 35 | this.setData({ 36 | value: this.range(this.data.value) 37 | }); 38 | }, 39 | 40 | methods: { 41 | // limit value range 42 | range(value) { 43 | return Math.max(Math.min(this.data.max, value), this.data.min); 44 | }, 45 | 46 | onInput(event) { 47 | const { value = '' } = event.detail || {}; 48 | this.triggerInput(value); 49 | }, 50 | 51 | onChange(type) { 52 | if (this[`${type}Disabled`]) { 53 | this.$emit('overlimit', type); 54 | return; 55 | } 56 | 57 | const diff = type === 'minus' ? -this.data.step : +this.data.step; 58 | const value = Math.round((this.data.value + diff) * 100) / 100; 59 | this.triggerInput(this.range(value)); 60 | this.$emit(type); 61 | }, 62 | 63 | onBlur(event) { 64 | const value = this.range(this.data.value); 65 | this.triggerInput(value); 66 | this.$emit('blur', event); 67 | }, 68 | 69 | onMinus() { 70 | this.onChange('minus'); 71 | }, 72 | 73 | onPlus() { 74 | this.onChange('plus'); 75 | }, 76 | 77 | triggerInput(value) { 78 | this.setData({ value }); 79 | this.$emit('change', value); 80 | } 81 | } 82 | }); 83 | -------------------------------------------------------------------------------- /static/vant/slider/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | import { touch } from '../mixins/touch'; 3 | 4 | create({ 5 | mixins: [touch], 6 | 7 | props: { 8 | disabled: Boolean, 9 | max: { 10 | type: Number, 11 | value: 100 12 | }, 13 | min: { 14 | type: Number, 15 | value: 0 16 | }, 17 | step: { 18 | type: Number, 19 | value: 1 20 | }, 21 | value: { 22 | type: Number, 23 | value: 0 24 | }, 25 | barHeight: { 26 | type: String, 27 | value: '2px' 28 | } 29 | }, 30 | 31 | attached() { 32 | this.updateValue(this.data.value); 33 | }, 34 | 35 | methods: { 36 | onTouchStart(event) { 37 | if (this.data.disabled) return; 38 | 39 | this.touchStart(event); 40 | this.startValue = this.format(this.data.value); 41 | }, 42 | 43 | onTouchMove(event) { 44 | if (this.data.disabled) return; 45 | 46 | this.touchMove(event); 47 | this.getRect('.van-slider').then(rect => { 48 | const diff = this.deltaX / rect.width * 100; 49 | this.updateValue(this.startValue + diff); 50 | }); 51 | }, 52 | 53 | onTouchEnd() { 54 | if (this.data.disabled) return; 55 | this.updateValue(this.data.value, true); 56 | }, 57 | 58 | onClick(event) { 59 | if (this.data.disabled) return; 60 | 61 | this.getRect(rect => { 62 | const value = (event.detail.x - rect.left) / rect.width * 100; 63 | this.updateValue(value, true); 64 | }); 65 | }, 66 | 67 | updateValue(value, end) { 68 | value = this.format(value); 69 | 70 | this.setData({ 71 | value, 72 | barStyle: `width: ${value}%; height: ${this.data.barHeight};` 73 | }); 74 | 75 | if (end) { 76 | this.$emit('change', value); 77 | } 78 | }, 79 | 80 | format(value) { 81 | const { max, min, step } = this.data; 82 | return Math.round(Math.max(min, Math.min(value, max)) / step) * step; 83 | } 84 | } 85 | }); 86 | -------------------------------------------------------------------------------- /static/vant/loading/index.wxss: -------------------------------------------------------------------------------- 1 | .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)}} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "weapp-o2o", 3 | "version": "1.0.0", 4 | "description": "a weapp project baseds on mpvue and vant-weapp", 5 | "author": "Wizard67 ", 6 | "private": true, 7 | "scripts": { 8 | "dev": "node build/dev-server.js", 9 | "start": "node build/dev-server.js", 10 | "build": "node build/build.js" 11 | }, 12 | "dependencies": { 13 | "@nn-yy/css-flex": "^1.3.0", 14 | "mpvue": "^1.0.13", 15 | "vuex": "^3.0.1" 16 | }, 17 | "devDependencies": { 18 | "babel-core": "^6.22.1", 19 | "babel-loader": "^7.1.1", 20 | "babel-plugin-transform-runtime": "^6.22.0", 21 | "babel-preset-env": "^1.3.2", 22 | "babel-preset-stage-2": "^6.22.0", 23 | "babel-register": "^6.22.0", 24 | "chalk": "^2.4.0", 25 | "connect-history-api-fallback": "^1.3.0", 26 | "copy-webpack-plugin": "^4.5.1", 27 | "css-loader": "^0.28.11", 28 | "cssnano": "^3.10.0", 29 | "eventsource-polyfill": "^0.9.6", 30 | "express": "^4.16.3", 31 | "extract-text-webpack-plugin": "^3.0.2", 32 | "file-loader": "^1.1.11", 33 | "friendly-errors-webpack-plugin": "^1.7.0", 34 | "glob": "^7.1.2", 35 | "html-webpack-plugin": "^3.2.0", 36 | "http-proxy-middleware": "^0.18.0", 37 | "mpvue-loader": "^1.1.2", 38 | "mpvue-template-compiler": "^1.0.11", 39 | "mpvue-webpack-target": "^1.0.0", 40 | "optimize-css-assets-webpack-plugin": "^3.2.0", 41 | "ora": "^2.0.0", 42 | "portfinder": "^1.0.13", 43 | "postcss-loader": "^2.1.4", 44 | "postcss-mpvue-wxss": "^1.0.0", 45 | "prettier": "~1.12.1", 46 | "px2rpx-loader": "^0.1.10", 47 | "relative": "^3.0.2", 48 | "rimraf": "^2.6.0", 49 | "semver": "^5.3.0", 50 | "shelljs": "^0.8.1", 51 | "uglifyjs-webpack-plugin": "^1.2.5", 52 | "url-loader": "^1.0.1", 53 | "vue-style-loader": "^4.1.0", 54 | "webpack": "^3.11.0", 55 | "webpack-bundle-analyzer": "^2.2.1", 56 | "webpack-dev-middleware-hard-disk": "^1.12.0", 57 | "webpack-merge": "^4.1.0", 58 | "webpack-mpvue-asset-plugin": "^0.1.1" 59 | }, 60 | "engines": { 61 | "node": ">= 4.0.0", 62 | "npm": ">= 3.0.0" 63 | }, 64 | "browserslist": [ 65 | "> 1%", 66 | "last 2 versions", 67 | "not ie <= 8" 68 | ] 69 | } 70 | -------------------------------------------------------------------------------- /static/vant/checkbox/index.js: -------------------------------------------------------------------------------- 1 | import { VantComponent } from '../common/component'; 2 | VantComponent({ 3 | field: true, 4 | relation: { 5 | name: 'checkbox-group', 6 | type: 'ancestor' 7 | }, 8 | classes: ['icon-class', 'label-class'], 9 | props: { 10 | value: null, 11 | disabled: Boolean, 12 | labelDisabled: Boolean, 13 | labelPosition: String, 14 | shape: { 15 | type: String, 16 | value: 'round' 17 | }, 18 | useIconSlot: Boolean 19 | }, 20 | computed: { 21 | iconClass: function iconClass() { 22 | var _this$data = this.data, 23 | disabled = _this$data.disabled, 24 | value = _this$data.value, 25 | shape = _this$data.shape; 26 | return this.classNames('van-checkbox__icon', "van-checkbox__icon--" + shape, { 27 | 'van-checkbox__icon--disabled': disabled, 28 | 'van-checkbox__icon--checked': value 29 | }); 30 | } 31 | }, 32 | methods: { 33 | emitChange: function emitChange(value) { 34 | var parent = this.getRelationNodes('../checkbox-group/index')[0]; 35 | 36 | if (parent) { 37 | var parentValue = parent.data.value.slice(); 38 | var name = this.data.name; 39 | 40 | if (value) { 41 | if (parent.data.max && parentValue.length >= parent.data.max) { 42 | return; 43 | } 44 | /* istanbul ignore else */ 45 | 46 | 47 | if (parentValue.indexOf(name) === -1) { 48 | parentValue.push(name); 49 | parent.$emit('input', parentValue); 50 | parent.$emit('change', parentValue); 51 | } 52 | } else { 53 | var index = parentValue.indexOf(name); 54 | /* istanbul ignore else */ 55 | 56 | if (index !== -1) { 57 | parentValue.splice(index, 1); 58 | parent.$emit('input', parentValue); 59 | parent.$emit('change', parentValue); 60 | } 61 | } 62 | } else { 63 | this.$emit('input', value); 64 | this.$emit('change', value); 65 | } 66 | }, 67 | toggle: function toggle() { 68 | if (!this.data.disabled) { 69 | this.emitChange(!this.data.value); 70 | } 71 | }, 72 | onClickLabel: function onClickLabel() { 73 | if (!this.data.disabled && !this.data.labelDisabled) { 74 | this.emitChange(!this.data.value); 75 | } 76 | } 77 | } 78 | }); -------------------------------------------------------------------------------- /src/components/card-list.vue: -------------------------------------------------------------------------------- 1 | 2 | mpvue 的 slot 机制存在问题,部分嵌套组件的使用方式只能折中处理。 3 | issues: https://github.com/Meituan-Dianping/mpvue/issues/427 4 | 5 | 6 | 23 | 24 | 53 | 54 | 111 | -------------------------------------------------------------------------------- /static/vant/button/index.wxss: -------------------------------------------------------------------------------- 1 | .van-button { 2 | position: relative; 3 | padding: 0; 4 | display: inline-block; 5 | height: 44px; 6 | line-height: 42px; 7 | border-radius: 3px; 8 | box-sizing: border-box; 9 | font-size: 16px; 10 | text-align: center; 11 | vertical-align: middle; 12 | -webkit-appearance: none; 13 | -webkit-text-size-adjust: 100% 14 | } 15 | 16 | .van-button::after { 17 | content: " "; 18 | position: absolute; 19 | top: 50%; 20 | left: 50%; 21 | opacity: 0; 22 | width: 100%; 23 | height: 100%; 24 | border: inherit; 25 | border-color: #000; 26 | background-color: #000; 27 | border-radius: inherit; 28 | -webkit-transform: translate(-50%, -50%); 29 | transform: translate(-50%, -50%) 30 | } 31 | 32 | .van-button:active::after { 33 | opacity: .3 34 | } 35 | 36 | .van-button--unclickable::after { 37 | display: none 38 | } 39 | 40 | .van-button--default { 41 | color: #333; 42 | background-color: #fff; 43 | border: 1px solid #e5e5e5 44 | } 45 | 46 | .van-button--primary { 47 | color: #fff; 48 | background-color: #4b0; 49 | border: 1px solid #4b0 50 | } 51 | 52 | .van-button--danger { 53 | color: #fff; 54 | background-color: #f44; 55 | border: 1px solid #f44 56 | } 57 | 58 | .van-button--warning { 59 | color: #fff; 60 | background-color: #f85; 61 | border: 1px solid #f85 62 | } 63 | 64 | .van-button--plain { 65 | background-color: #fff 66 | } 67 | 68 | .van-button--plain.van-button--primary { 69 | color: #4b0 70 | } 71 | 72 | .van-button--plain.van-button--danger { 73 | color: #f44 74 | } 75 | 76 | .van-button--plain.van-button--warning { 77 | color: #f85 78 | } 79 | 80 | .van-button--large { 81 | width: 100%; 82 | height: 50px; 83 | line-height: 48px 84 | } 85 | 86 | .van-button--normal { 87 | padding: 0 15px; 88 | font-size: 14px 89 | } 90 | 91 | .van-button--small { 92 | height: 30px; 93 | padding: 0 8px; 94 | min-width: 60px; 95 | font-size: 12px; 96 | line-height: 28px 97 | } 98 | 99 | .van-button--mini { 100 | display: inline-block; 101 | min-width: 50px; 102 | height: 2em; 103 | padding: 0 .5em; 104 | line-height: 2em; 105 | font-size: 10px 106 | } 107 | 108 | .van-button--mini+.van-button--mini { 109 | margin-left: 5px 110 | } 111 | 112 | .van-button--block { 113 | width: 100%; 114 | display: block 115 | } 116 | 117 | .van-button--square { 118 | border-radius: 0 119 | } 120 | 121 | .van-button--disabled { 122 | color: #999; 123 | background-color: #e8e8e8; 124 | border: 1px solid #e5e5e5 125 | } -------------------------------------------------------------------------------- /static/vant/progress/index.js: -------------------------------------------------------------------------------- 1 | import { create } from '../common/create'; 2 | 3 | create({ 4 | props: { 5 | inactive: { 6 | type: Boolean, 7 | observer() { 8 | this.setPivotStyle(); 9 | this.setPortionStyle(); 10 | } 11 | }, 12 | pivotColor: { 13 | type: String, 14 | observer: 'setPivotStyle' 15 | }, 16 | percentage: { 17 | type: Number, 18 | observer() { 19 | this.setText(); 20 | this.setPortionStyle(); 21 | } 22 | }, 23 | showPivot: { 24 | type: Boolean, 25 | value: true, 26 | observer: 'getWidth' 27 | }, 28 | pivotText: { 29 | type: String, 30 | observer() { 31 | this.setText(); 32 | this.getWidth(); 33 | } 34 | }, 35 | color: { 36 | type: String, 37 | value: '#38f', 38 | observer() { 39 | this.setPivotStyle(); 40 | this.setPortionStyle(); 41 | } 42 | }, 43 | textColor: { 44 | type: String, 45 | value: '#fff', 46 | observer: 'setPivotStyle' 47 | } 48 | }, 49 | 50 | data: { 51 | pivotWidth: 0, 52 | progressWidth: 0 53 | }, 54 | 55 | ready() { 56 | this.setText(); 57 | this.setPivotStyle(); 58 | this.getWidth(); 59 | }, 60 | 61 | methods: { 62 | getCurrentColor() { 63 | return this.data.inactive ? '#cacaca' : this.data.color; 64 | }, 65 | 66 | setText() { 67 | this.setData({ 68 | text: this.data.pivotText || this.data.percentage + '%' 69 | }); 70 | }, 71 | 72 | setPortionStyle() { 73 | const width = (this.data.progressWidth - this.data.pivotWidth) * this.data.percentage / 100 + 'px'; 74 | const background = this.getCurrentColor(); 75 | this.setData({ 76 | portionStyle: `width: ${width}; background: ${background}; ` 77 | }); 78 | }, 79 | 80 | setPivotStyle() { 81 | const color = this.data.textColor; 82 | const background = this.data.pivotColor || this.getCurrentColor(); 83 | this.setData({ 84 | pivotStyle: `color: ${color}; background: ${background}` 85 | }); 86 | }, 87 | 88 | getWidth() { 89 | this.getRect('.van-progress').then(rect => { 90 | this.setData({ 91 | progressWidth: rect.width 92 | }); 93 | this.setPortionStyle(); 94 | }); 95 | 96 | this.getRect('.van-progress__pivot').then(rect => { 97 | this.setData({ 98 | pivotWidth: rect.width || 0 99 | }); 100 | this.setPortionStyle(); 101 | }); 102 | } 103 | } 104 | }); 105 | -------------------------------------------------------------------------------- /static/icon/iconfont.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: 'iconfont'; /* project id 888351 */ 3 | src: url('//at.alicdn.com/t/font_888351_m1x50uxw2ql.eot'); 4 | src: url('//at.alicdn.com/t/font_888351_m1x50uxw2ql.eot?#iefix') format('embedded-opentype'), 5 | url('//at.alicdn.com/t/font_888351_m1x50uxw2ql.woff') format('woff'), 6 | url('//at.alicdn.com/t/font_888351_m1x50uxw2ql.ttf') format('truetype'), 7 | url('//at.alicdn.com/t/font_888351_m1x50uxw2ql.svg#iconfont') format('svg'); 8 | } 9 | 10 | .iconfont, 11 | .iconfont--main { 12 | font-family: "iconfont"; 13 | font-size: .16rem; 14 | font-style: normal; 15 | color: #8a8a8a; 16 | } 17 | 18 | .iconfont--main::before { 19 | color: #FB2525 !important; 20 | } 21 | 22 | .icon-wallet:before { 23 | content: "\f151"; 24 | font-size: 40rpx; 25 | color: #8a8a8a; 26 | } 27 | 28 | .icon-users:before { 29 | content: "\f13a"; 30 | font-size: 40rpx; 31 | color: #8a8a8a; 32 | } 33 | 34 | .icon-user-check:before { 35 | content: "\f12f"; 36 | font-size: 40rpx; 37 | color: #8a8a8a; 38 | } 39 | 40 | .icon-stream:before { 41 | content: "\f0e0"; 42 | font-size: 40rpx; 43 | color: #8a8a8a; 44 | } 45 | 46 | .icon-store:before { 47 | content: "\f0de"; 48 | font-size: 40rpx; 49 | color: #8a8a8a; 50 | } 51 | 52 | .icon-shopping-card:before { 53 | content: "\f0b6"; 54 | font-size: 40rpx; 55 | color: #8a8a8a; 56 | } 57 | 58 | .icon-share-alt:before { 59 | content: "\f0af"; 60 | font-size: 40rpx; 61 | color: #8a8a8a; 62 | } 63 | 64 | .icon-reply-all:before { 65 | content: "\f097"; 66 | font-size: 40rpx; 67 | color: #8a8a8a; 68 | } 69 | 70 | .icon-reply:before { 71 | content: "\f096"; 72 | font-size: 40rpx; 73 | color: #8a8a8a; 74 | } 75 | 76 | .icon-redo-alt:before { 77 | content: "\f094"; 78 | font-size: 40rpx; 79 | color: #8a8a8a; 80 | } 81 | 82 | .icon-marked-alt:before { 83 | content: "\f040"; 84 | font-size: 40rpx; 85 | color: #8a8a8a; 86 | } 87 | 88 | .icon-luggage-cart:before { 89 | content: "\f03d"; 90 | font-size: 40rpx; 91 | color: #8a8a8a; 92 | } 93 | 94 | .icon-inbox:before { 95 | content: "\f026"; 96 | font-size: 40rpx; 97 | color: #8a8a8a; 98 | } 99 | 100 | .icon-edit:before { 101 | content: "\efaa"; 102 | font-size: 40rpx; 103 | color: #8a8a8a; 104 | } 105 | 106 | .icon-cart-plus:before { 107 | content: "\ef62"; 108 | font-size: 40rpx; 109 | color: #8a8a8a; 110 | } 111 | 112 | .icon-box:before { 113 | content: "\ef4c"; 114 | font-size: 40rpx; 115 | color: #8a8a8a; 116 | } 117 | 118 | .icon-cog:before { 119 | content: "\ef7d"; 120 | font-size: 40rpx; 121 | color: #8a8a8a; 122 | } -------------------------------------------------------------------------------- /static/vant/field/index.wxml: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 |