├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .gitignore
├── .postcssrc.js
├── README.md
├── build
├── build.js
├── check-versions.js
├── dev-client.js
├── dev-server.js
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
└── webpack.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── index.html
├── package-lock.json
├── package.json
├── project.config.json
├── src
├── App.vue
├── app.json
├── components
│ ├── Carousel.vue
│ ├── FloatButton.vue
│ ├── Grids.vue
│ └── Null.vue
├── main.js
├── pages
│ ├── articles
│ │ ├── article
│ │ │ ├── index.vue
│ │ │ ├── main.js
│ │ │ └── main.json
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── main.json
│ ├── index
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── main.json
│ └── user
│ │ ├── Grids.vue
│ │ ├── UserInfo.vue
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── main.json
├── store
│ └── index.js
└── utils
│ ├── index.js
│ └── wxp.js
└── static
├── .gitkeep
├── functions
└── user
│ ├── index.js
│ ├── package-lock.json
│ └── package.json
├── iconfont
├── iconfont.css
├── iconfont.eot
├── iconfont.js
├── iconfont.svg
├── iconfont.ttf
└── iconfont.woff
├── icons
├── home-selected.png
├── home.png
└── null.png
├── img
├── 10.png
├── 11.png
├── 12.svg
├── 13.png
├── 14.png
├── 15.png
├── 16.png
├── 17.png
├── 17.svg
├── 18.png
├── 18.svg
├── 19.png
├── 20.png
├── 21.png
├── 22.png
├── 23.png
├── 24.png
├── 25.png
├── 3.png
├── 4.png
├── 4.svg
├── 5.png
├── 6.png
├── 7.png
├── 8.png
├── 9.png
├── cat.png
└── code.jpg
├── vant
├── action-sheet
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── area
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── badge-group
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── badge
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── button
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── card
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── cell-group
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── cell
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── checkbox-group
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── checkbox
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── col
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── common
│ ├── class-names.js
│ ├── component.js
│ ├── create.js
│ ├── index.wxss
│ ├── style
│ │ ├── clearfix.wxss
│ │ ├── ellipsis.wxss
│ │ ├── hairline.wxss
│ │ ├── mixins
│ │ │ ├── border-retina.wxss
│ │ │ ├── clearfix.wxss
│ │ │ ├── ellipsis.wxss
│ │ │ └── hairline.wxss
│ │ └── var.wxss
│ └── utils.js
├── dialog
│ ├── dialog.js
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── field
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── icon
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── loading
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── mixins
│ ├── basic.js
│ ├── button.js
│ ├── observer
│ │ ├── behavior.js
│ │ ├── index.js
│ │ └── props.js
│ ├── open-type.js
│ ├── touch.js
│ └── transition.js
├── nav-bar
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── notice-bar
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── notify
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ └── notify.js
├── overlay
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── panel
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── popup
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── progress
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── radio-group
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── radio
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── row
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── search
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── slider
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── stepper
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── steps
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── submit-bar
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── switch-cell
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── switch
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── tab
│ ├── index.js
│ ├── index.json
│ └── index.wxml
├── tabbar-item
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── tabbar
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── tabs
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── tag
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── toast
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ └── toast.js
├── transition
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
└── tree-select
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
└── wux
└── circle
├── index.js
├── index.json
├── index.wxml
└── index.wxss
/.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 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.eslintignore:
--------------------------------------------------------------------------------
1 | build/*.js
2 | config/*.js
3 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // http://eslint.org/docs/user-guide/configuring
2 |
3 | module.exports = {
4 | root: true,
5 | parser: 'babel-eslint',
6 | parserOptions: {
7 | sourceType: 'module'
8 | },
9 | env: {
10 | browser: false,
11 | node: true,
12 | es6: true
13 | },
14 | // https://github.com/standard/standard/blob/master/docs/RULES-en.md
15 | extends: 'standard',
16 | // required to lint *.vue files
17 | plugins: [
18 | 'html'
19 | ],
20 | // add your custom rules here
21 | 'rules': {
22 | // allow paren-less arrow functions
23 | 'arrow-parens': 0,
24 | // allow async-await
25 | 'generator-star-spacing': 0,
26 | // allow debugger during development
27 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
28 | },
29 | globals: {
30 | App: true,
31 | Page: true,
32 | wx: true,
33 | getApp: true,
34 | getPage: true,
35 | requirePlugin: true
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-mpvue-wxss": {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | require('./check-versions')()
2 |
3 | process.env.NODE_ENV = 'production'
4 |
5 | var ora = require('ora')
6 | var rm = require('rimraf')
7 | var path = require('path')
8 | var chalk = require('chalk')
9 | var webpack = require('webpack')
10 | var config = require('../config')
11 | var webpackConfig = require('./webpack.prod.conf')
12 |
13 | var spinner = ora('building for production...')
14 | spinner.start()
15 |
16 | rm(path.join(config.build.assetsRoot, '*'), err => {
17 | if (err) throw err
18 | webpack(webpackConfig, function (err, stats) {
19 | spinner.stop()
20 | if (err) throw err
21 | process.stdout.write(stats.toString({
22 | colors: true,
23 | modules: false,
24 | children: false,
25 | chunks: false,
26 | chunkModules: false
27 | }) + '\n\n')
28 |
29 | if (stats.hasErrors()) {
30 | console.log(chalk.red(' Build failed with errors.\n'))
31 | process.exit(1)
32 | }
33 |
34 | console.log(chalk.cyan(' Build complete.\n'))
35 | console.log(chalk.yellow(
36 | ' Tip: built files are meant to be served over an HTTP server.\n' +
37 | ' Opening index.html over file:// won\'t work.\n'
38 | ))
39 | })
40 | })
41 |
--------------------------------------------------------------------------------
/build/check-versions.js:
--------------------------------------------------------------------------------
1 | var chalk = require('chalk')
2 | var semver = require('semver')
3 | var packageConfig = require('../package.json')
4 | var shell = require('shelljs')
5 | function exec (cmd) {
6 | return require('child_process').execSync(cmd).toString().trim()
7 | }
8 |
9 | var versionRequirements = [
10 | {
11 | name: 'node',
12 | currentVersion: semver.clean(process.version),
13 | versionRequirement: packageConfig.engines.node
14 | }
15 | ]
16 |
17 | if (shell.which('npm')) {
18 | versionRequirements.push({
19 | name: 'npm',
20 | currentVersion: exec('npm --version'),
21 | versionRequirement: packageConfig.engines.npm
22 | })
23 | }
24 |
25 | module.exports = function () {
26 | var warnings = []
27 | for (var i = 0; i < versionRequirements.length; i++) {
28 | var mod = versionRequirements[i]
29 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) {
30 | warnings.push(mod.name + ': ' +
31 | chalk.red(mod.currentVersion) + ' should be ' +
32 | chalk.green(mod.versionRequirement)
33 | )
34 | }
35 | }
36 |
37 | if (warnings.length) {
38 | console.log('')
39 | console.log(chalk.yellow('To use this template, you must update following to modules:'))
40 | console.log()
41 | for (var i = 0; i < warnings.length; i++) {
42 | var warning = warnings[i]
43 | console.log(' ' + warning)
44 | }
45 | console.log()
46 | process.exit(1)
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/build/dev-client.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | require('eventsource-polyfill')
3 | var hotClient = require('webpack-hot-middleware/client?noInfo=true&reload=true')
4 |
5 | hotClient.subscribe(function (event) {
6 | if (event.action === 'reload') {
7 | window.location.reload()
8 | }
9 | })
10 |
--------------------------------------------------------------------------------
/build/dev-server.js:
--------------------------------------------------------------------------------
1 | require('./check-versions')()
2 |
3 | var config = require('../config')
4 | if (!process.env.NODE_ENV) {
5 | process.env.NODE_ENV = JSON.parse(config.dev.env.NODE_ENV)
6 | }
7 |
8 | // var opn = require('opn')
9 | var path = require('path')
10 | var express = require('express')
11 | var webpack = require('webpack')
12 | var proxyMiddleware = require('http-proxy-middleware')
13 | var portfinder = require('portfinder')
14 | var webpackConfig = require('./webpack.dev.conf')
15 |
16 | // default port where dev server listens for incoming traffic
17 | var port = process.env.PORT || config.dev.port
18 | // automatically open browser, if not set will be false
19 | var autoOpenBrowser = !!config.dev.autoOpenBrowser
20 | // Define HTTP proxies to your custom API backend
21 | // https://github.com/chimurai/http-proxy-middleware
22 | var proxyTable = config.dev.proxyTable
23 |
24 | var app = express()
25 | var compiler = webpack(webpackConfig)
26 |
27 | // var devMiddleware = require('webpack-dev-middleware')(compiler, {
28 | // publicPath: webpackConfig.output.publicPath,
29 | // quiet: true
30 | // })
31 |
32 | // var hotMiddleware = require('webpack-hot-middleware')(compiler, {
33 | // log: false,
34 | // heartbeat: 2000
35 | // })
36 | // force page reload when html-webpack-plugin template changes
37 | // compiler.plugin('compilation', function (compilation) {
38 | // compilation.plugin('html-webpack-plugin-after-emit', function (data, cb) {
39 | // hotMiddleware.publish({ action: 'reload' })
40 | // cb()
41 | // })
42 | // })
43 |
44 | // proxy api requests
45 | Object.keys(proxyTable).forEach(function (context) {
46 | var options = proxyTable[context]
47 | if (typeof options === 'string') {
48 | options = { target: options }
49 | }
50 | app.use(proxyMiddleware(options.filter || context, options))
51 | })
52 |
53 | // handle fallback for HTML5 history API
54 | app.use(require('connect-history-api-fallback')())
55 |
56 | // serve webpack bundle output
57 | // app.use(devMiddleware)
58 |
59 | // enable hot-reload and state-preserving
60 | // compilation error display
61 | // app.use(hotMiddleware)
62 |
63 | // serve pure static assets
64 | var staticPath = path.posix.join(config.dev.assetsPublicPath, config.dev.assetsSubDirectory)
65 | app.use(staticPath, express.static('./static'))
66 |
67 | // var uri = 'http://localhost:' + port
68 |
69 | var _resolve
70 | var readyPromise = new Promise(resolve => {
71 | _resolve = resolve
72 | })
73 |
74 | // console.log('> Starting dev server...')
75 | // devMiddleware.waitUntilValid(() => {
76 | // console.log('> Listening at ' + uri + '\n')
77 | // // when env is testing, don't need open it
78 | // if (autoOpenBrowser && process.env.NODE_ENV !== 'testing') {
79 | // opn(uri)
80 | // }
81 | // _resolve()
82 | // })
83 |
84 | module.exports = new Promise((resolve, reject) => {
85 | portfinder.basePort = port
86 | portfinder.getPortPromise()
87 | .then(newPort => {
88 | if (port !== newPort) {
89 | console.log(`${port}端口被占用,开启新端口${newPort}`)
90 | }
91 | var server = app.listen(newPort, 'localhost')
92 | // for 小程序的文件保存机制
93 | require('webpack-dev-middleware-hard-disk')(compiler, {
94 | publicPath: webpackConfig.output.publicPath,
95 | quiet: true
96 | })
97 | resolve({
98 | ready: readyPromise,
99 | close: () => {
100 | server.close()
101 | }
102 | })
103 | }).catch(error => {
104 | console.log('没有找到空闲端口,请打开任务管理器杀死进程端口再试', error)
105 | })
106 | })
107 |
--------------------------------------------------------------------------------
/build/utils.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var config = require('../config')
3 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
4 |
5 | exports.assetsPath = function (_path) {
6 | var assetsSubDirectory = process.env.NODE_ENV === 'production'
7 | ? config.build.assetsSubDirectory
8 | : config.dev.assetsSubDirectory
9 | return path.posix.join(assetsSubDirectory, _path)
10 | }
11 |
12 | exports.cssLoaders = function (options) {
13 | options = options || {}
14 |
15 | var cssLoader = {
16 | loader: 'css-loader',
17 | options: {
18 | minimize: process.env.NODE_ENV === 'production',
19 | sourceMap: options.sourceMap
20 | }
21 | }
22 |
23 | var postcssLoader = {
24 | loader: 'postcss-loader',
25 | options: {
26 | sourceMap: true
27 | }
28 | }
29 |
30 | var px2rpxLoader = {
31 | loader: 'px2rpx-loader',
32 | options: {
33 | baseDpr: 1,
34 | rpxUnit: 0.5
35 | }
36 | }
37 |
38 | // generate loader string to be used with extract text plugin
39 | function generateLoaders (loader, loaderOptions) {
40 | var loaders = [cssLoader, px2rpxLoader, postcssLoader]
41 | if (loader) {
42 | loaders.push({
43 | loader: loader + '-loader',
44 | options: Object.assign({}, loaderOptions, {
45 | sourceMap: options.sourceMap
46 | })
47 | })
48 | }
49 |
50 | // Extract CSS when that option is specified
51 | // (which is the case during production build)
52 | if (options.extract) {
53 | return ExtractTextPlugin.extract({
54 | use: loaders,
55 | fallback: 'vue-style-loader'
56 | })
57 | } else {
58 | return ['vue-style-loader'].concat(loaders)
59 | }
60 | }
61 |
62 | // https://vue-loader.vuejs.org/en/configurations/extract-css.html
63 | return {
64 | css: generateLoaders(),
65 | wxss: generateLoaders(),
66 | postcss: generateLoaders(),
67 | less: generateLoaders('less'),
68 | sass: generateLoaders('sass', { indentedSyntax: true }),
69 | scss: generateLoaders('sass'),
70 | stylus: generateLoaders('stylus'),
71 | styl: generateLoaders('stylus')
72 | }
73 | }
74 |
75 | // Generate loaders for standalone style files (outside of .vue)
76 | exports.styleLoaders = function (options) {
77 | var output = []
78 | var loaders = exports.cssLoaders(options)
79 | for (var extension in loaders) {
80 | var loader = loaders[extension]
81 | output.push({
82 | test: new RegExp('\\.' + extension + '$'),
83 | use: loader
84 | })
85 | }
86 | return output
87 | }
88 |
--------------------------------------------------------------------------------
/build/vue-loader.conf.js:
--------------------------------------------------------------------------------
1 | var utils = require('./utils')
2 | var config = require('../config')
3 | // var isProduction = process.env.NODE_ENV === 'production'
4 | // for mp
5 | var isProduction = true
6 |
7 | module.exports = {
8 | loaders: utils.cssLoaders({
9 | sourceMap: isProduction
10 | ? config.build.productionSourceMap
11 | : config.dev.cssSourceMap,
12 | extract: isProduction
13 | }),
14 | transformToRequire: {
15 | video: 'src',
16 | source: 'src',
17 | img: 'src',
18 | image: 'xlink:href'
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/build/webpack.base.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var fs = require('fs')
3 | var utils = require('./utils')
4 | var config = require('../config')
5 | var vueLoaderConfig = require('./vue-loader.conf')
6 | var MpvuePlugin = require('webpack-mpvue-asset-plugin')
7 | var glob = require('glob')
8 | var CopyWebpackPlugin = require('copy-webpack-plugin')
9 | var relative = require('relative')
10 |
11 | function resolve (dir) {
12 | return path.join(__dirname, '..', dir)
13 | }
14 |
15 | function getEntry (rootSrc) {
16 | var map = {};
17 | glob.sync(rootSrc + '/pages/**/main.js')
18 | .forEach(file => {
19 | var key = relative(rootSrc, file).replace('.js', '');
20 | map[key] = file;
21 | })
22 | return map;
23 | }
24 |
25 | const appEntry = { app: resolve('./src/main.js') }
26 | const pagesEntry = getEntry(resolve('./src'), 'pages/**/main.js')
27 | const entry = Object.assign({}, appEntry, pagesEntry)
28 |
29 | module.exports = {
30 | // 如果要自定义生成的 dist 目录里面的文件路径,
31 | // 可以将 entry 写成 {'toPath': 'fromPath'} 的形式,
32 | // toPath 为相对于 dist 的路径, 例:index/demo,则生成的文件地址为 dist/index/demo.js
33 | entry,
34 | target: require('mpvue-webpack-target'),
35 | output: {
36 | path: config.build.assetsRoot,
37 | filename: '[name].js',
38 | publicPath: process.env.NODE_ENV === 'production'
39 | ? config.build.assetsPublicPath
40 | : config.dev.assetsPublicPath
41 | },
42 | resolve: {
43 | extensions: ['.js', '.vue', '.json'],
44 | alias: {
45 | 'vue': 'mpvue',
46 | '@': resolve('src')
47 | },
48 | symlinks: false,
49 | aliasFields: ['mpvue', 'weapp', 'browser'],
50 | mainFields: ['browser', 'module', 'main']
51 | },
52 | module: {
53 | rules: [
54 | {
55 | test: /\.(js|vue)$/,
56 | loader: 'eslint-loader',
57 | enforce: 'pre',
58 | include: [resolve('src'), resolve('test')],
59 | options: {
60 | formatter: require('eslint-friendly-formatter')
61 | }
62 | },
63 | {
64 | test: /\.vue$/,
65 | loader: 'mpvue-loader',
66 | options: vueLoaderConfig
67 | },
68 | {
69 | test: /\.js$/,
70 | include: [resolve('src'), resolve('test')],
71 | use: [
72 | 'babel-loader',
73 | {
74 | loader: 'mpvue-loader',
75 | options: {
76 | checkMPEntry: true
77 | }
78 | },
79 | ]
80 | },
81 | {
82 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
83 | loader: 'url-loader',
84 | options: {
85 | limit: 10000,
86 | name: utils.assetsPath('img/[name].[ext]')
87 | }
88 | },
89 | {
90 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
91 | loader: 'url-loader',
92 | options: {
93 | limit: 10000,
94 | name: utils.assetsPath('media/[name].[ext]')
95 | }
96 | },
97 | {
98 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
99 | loader: 'url-loader',
100 | options: {
101 | limit: 10000,
102 | name: utils.assetsPath('fonts/[name].[ext]')
103 | }
104 | }
105 | ]
106 | },
107 | plugins: [
108 | new MpvuePlugin(),
109 | new CopyWebpackPlugin([{
110 | from: '**/*.json',
111 | to: ''
112 | }], {
113 | context: 'src/'
114 | }),
115 | new CopyWebpackPlugin([
116 | {
117 | from: path.resolve(__dirname, '../static'),
118 | to: path.resolve(__dirname, '../dist/static'),
119 | ignore: ['.*']
120 | }
121 | ])
122 | ]
123 | }
124 |
--------------------------------------------------------------------------------
/build/webpack.dev.conf.js:
--------------------------------------------------------------------------------
1 | var utils = require('./utils')
2 | var webpack = require('webpack')
3 | var config = require('../config')
4 | var merge = require('webpack-merge')
5 | var baseWebpackConfig = require('./webpack.base.conf')
6 | // var HtmlWebpackPlugin = require('html-webpack-plugin')
7 | var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
8 |
9 | // copy from ./webpack.prod.conf.js
10 | var path = require('path')
11 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
12 | var CopyWebpackPlugin = require('copy-webpack-plugin')
13 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
14 |
15 | // add hot-reload related code to entry chunks
16 | // Object.keys(baseWebpackConfig.entry).forEach(function (name) {
17 | // baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
18 | // })
19 |
20 | module.exports = merge(baseWebpackConfig, {
21 | module: {
22 | rules: utils.styleLoaders({
23 | sourceMap: config.dev.cssSourceMap,
24 | extract: true
25 | })
26 | },
27 | // cheap-module-eval-source-map is faster for development
28 | // devtool: '#cheap-module-eval-source-map',
29 | devtool: '#source-map',
30 | output: {
31 | path: config.build.assetsRoot,
32 | // filename: utils.assetsPath('[name].[chunkhash].js'),
33 | // chunkFilename: utils.assetsPath('[id].[chunkhash].js')
34 | filename: utils.assetsPath('[name].js'),
35 | chunkFilename: utils.assetsPath('[id].js')
36 | },
37 | plugins: [
38 | new webpack.DefinePlugin({
39 | 'process.env': config.dev.env
40 | }),
41 |
42 | // copy from ./webpack.prod.conf.js
43 | // extract css into its own file
44 | new ExtractTextPlugin({
45 | // filename: utils.assetsPath('[name].[contenthash].css')
46 | filename: utils.assetsPath('[name].wxss')
47 | }),
48 | // Compress extracted CSS. We are using this plugin so that possible
49 | // duplicated CSS from different components can be deduped.
50 | new OptimizeCSSPlugin({
51 | cssProcessorOptions: {
52 | safe: true
53 | }
54 | }),
55 | new webpack.optimize.CommonsChunkPlugin({
56 | name: 'common/vendor',
57 | minChunks: function (module, count) {
58 | // any required modules inside node_modules are extracted to vendor
59 | return (
60 | module.resource &&
61 | /\.js$/.test(module.resource) &&
62 | module.resource.indexOf('node_modules') >= 0
63 | ) || count > 1
64 | }
65 | }),
66 | new webpack.optimize.CommonsChunkPlugin({
67 | name: 'common/manifest',
68 | chunks: ['common/vendor']
69 | }),
70 |
71 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
72 | // new webpack.HotModuleReplacementPlugin(),
73 | new webpack.NoEmitOnErrorsPlugin(),
74 | // https://github.com/ampedandwired/html-webpack-plugin
75 | // new HtmlWebpackPlugin({
76 | // filename: 'index.html',
77 | // template: 'index.html',
78 | // inject: true
79 | // }),
80 | new FriendlyErrorsPlugin()
81 | ]
82 | })
83 |
--------------------------------------------------------------------------------
/build/webpack.prod.conf.js:
--------------------------------------------------------------------------------
1 | var path = require('path')
2 | var utils = require('./utils')
3 | var webpack = require('webpack')
4 | var config = require('../config')
5 | var merge = require('webpack-merge')
6 | var baseWebpackConfig = require('./webpack.base.conf')
7 | var UglifyJsPlugin = require('uglifyjs-webpack-plugin')
8 | var CopyWebpackPlugin = require('copy-webpack-plugin')
9 | // var HtmlWebpackPlugin = require('html-webpack-plugin')
10 | var ExtractTextPlugin = require('extract-text-webpack-plugin')
11 | var OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin')
12 |
13 | var env = config.build.env
14 |
15 | var webpackConfig = merge(baseWebpackConfig, {
16 | module: {
17 | rules: utils.styleLoaders({
18 | sourceMap: config.build.productionSourceMap,
19 | extract: true
20 | })
21 | },
22 | devtool: config.build.productionSourceMap ? '#source-map' : false,
23 | output: {
24 | path: config.build.assetsRoot,
25 | // filename: utils.assetsPath('[name].[chunkhash].js'),
26 | // chunkFilename: utils.assetsPath('[id].[chunkhash].js')
27 | filename: utils.assetsPath('[name].js'),
28 | chunkFilename: utils.assetsPath('[id].js')
29 | },
30 | plugins: [
31 | // http://vuejs.github.io/vue-loader/en/workflow/production.html
32 | new webpack.DefinePlugin({
33 | 'process.env': env
34 | }),
35 | new UglifyJsPlugin({
36 | sourceMap: true
37 | }),
38 | // extract css into its own file
39 | new ExtractTextPlugin({
40 | // filename: utils.assetsPath('[name].[contenthash].css')
41 | filename: utils.assetsPath('[name].wxss')
42 | }),
43 | // Compress extracted CSS. We are using this plugin so that possible
44 | // duplicated CSS from different components can be deduped.
45 | new OptimizeCSSPlugin({
46 | cssProcessorOptions: {
47 | safe: true
48 | }
49 | }),
50 | // generate dist index.html with correct asset hash for caching.
51 | // you can customize output by editing /index.html
52 | // see https://github.com/ampedandwired/html-webpack-plugin
53 | // new HtmlWebpackPlugin({
54 | // filename: config.build.index,
55 | // template: 'index.html',
56 | // inject: true,
57 | // minify: {
58 | // removeComments: true,
59 | // collapseWhitespace: true,
60 | // removeAttributeQuotes: true
61 | // // more options:
62 | // // https://github.com/kangax/html-minifier#options-quick-reference
63 | // },
64 | // // necessary to consistently work with multiple chunks via CommonsChunkPlugin
65 | // chunksSortMode: 'dependency'
66 | // }),
67 | // keep module.id stable when vender modules does not change
68 | new webpack.HashedModuleIdsPlugin(),
69 | // split vendor js into its own file
70 | new webpack.optimize.CommonsChunkPlugin({
71 | name: 'common/vendor',
72 | minChunks: function (module, count) {
73 | // any required modules inside node_modules are extracted to vendor
74 | return (
75 | module.resource &&
76 | /\.js$/.test(module.resource) &&
77 | module.resource.indexOf('node_modules') >= 0
78 | ) || count > 1
79 | }
80 | }),
81 | // extract webpack runtime and module manifest to its own file in order to
82 | // prevent vendor hash from being updated whenever app bundle is updated
83 | new webpack.optimize.CommonsChunkPlugin({
84 | name: 'common/manifest',
85 | chunks: ['common/vendor']
86 | })
87 | ]
88 | })
89 |
90 | // if (config.build.productionGzip) {
91 | // var CompressionWebpackPlugin = require('compression-webpack-plugin')
92 |
93 | // webpackConfig.plugins.push(
94 | // new CompressionWebpackPlugin({
95 | // asset: '[path].gz[query]',
96 | // algorithm: 'gzip',
97 | // test: new RegExp(
98 | // '\\.(' +
99 | // config.build.productionGzipExtensions.join('|') +
100 | // ')$'
101 | // ),
102 | // threshold: 10240,
103 | // minRatio: 0.8
104 | // })
105 | // )
106 | // }
107 |
108 | if (config.build.bundleAnalyzerReport) {
109 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
110 | webpackConfig.plugins.push(new BundleAnalyzerPlugin())
111 | }
112 |
113 | module.exports = webpackConfig
114 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/config/prod.env.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | NODE_ENV: '"production"'
3 | }
4 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | cat-helper
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cat-helper",
3 | "version": "1.0.0",
4 | "description": "meow helper",
5 | "author": "xxxsimons <974393900@qq.com>",
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 | "lint": "eslint --ext .js,.vue src"
12 | },
13 | "dependencies": {
14 | "mpvue": "^1.0.11",
15 | "node-sass": "^4.9.3",
16 | "sass-loader": "^7.1.0",
17 | "vuex": "^3.0.1"
18 | },
19 | "devDependencies": {
20 | "mpvue-loader": "^1.1.2",
21 | "mpvue-webpack-target": "^1.0.0",
22 | "mpvue-template-compiler": "^1.0.11",
23 | "portfinder": "^1.0.13",
24 | "postcss-mpvue-wxss": "^1.0.0",
25 | "prettier": "~1.12.1",
26 | "px2rpx-loader": "^0.1.10",
27 | "babel-core": "^6.22.1",
28 | "glob": "^7.1.2",
29 | "webpack-mpvue-asset-plugin": "^0.1.1",
30 | "relative": "^3.0.2",
31 | "babel-eslint": "^8.2.3",
32 | "babel-loader": "^7.1.1",
33 | "babel-plugin-transform-runtime": "^6.22.0",
34 | "babel-preset-env": "^1.3.2",
35 | "babel-preset-stage-2": "^6.22.0",
36 | "babel-register": "^6.22.0",
37 | "chalk": "^2.4.0",
38 | "connect-history-api-fallback": "^1.3.0",
39 | "copy-webpack-plugin": "^4.5.1",
40 | "css-loader": "^0.28.11",
41 | "cssnano": "^3.10.0",
42 | "eslint": "^4.19.1",
43 | "eslint-friendly-formatter": "^4.0.1",
44 | "eslint-loader": "^2.0.0",
45 | "eslint-plugin-import": "^2.11.0",
46 | "eslint-plugin-node": "^6.0.1",
47 | "eslint-plugin-html": "^4.0.3",
48 | "eslint-config-standard": "^11.0.0",
49 | "eslint-plugin-promise": "^3.4.0",
50 | "eslint-plugin-standard": "^3.0.1",
51 | "eventsource-polyfill": "^0.9.6",
52 | "express": "^4.16.3",
53 | "extract-text-webpack-plugin": "^3.0.2",
54 | "file-loader": "^1.1.11",
55 | "friendly-errors-webpack-plugin": "^1.7.0",
56 | "html-webpack-plugin": "^3.2.0",
57 | "http-proxy-middleware": "^0.18.0",
58 | "webpack-bundle-analyzer": "^2.2.1",
59 | "semver": "^5.3.0",
60 | "shelljs": "^0.8.1",
61 | "uglifyjs-webpack-plugin": "^1.2.5",
62 | "optimize-css-assets-webpack-plugin": "^3.2.0",
63 | "ora": "^2.0.0",
64 | "rimraf": "^2.6.0",
65 | "url-loader": "^1.0.1",
66 | "vue-style-loader": "^4.1.0",
67 | "webpack": "^3.11.0",
68 | "webpack-dev-middleware-hard-disk": "^1.12.0",
69 | "webpack-merge": "^4.1.0",
70 | "postcss-loader": "^2.1.4"
71 | },
72 | "engines": {
73 | "node": ">= 4.0.0",
74 | "npm": ">= 3.0.0"
75 | },
76 | "browserslist": [
77 | "> 1%",
78 | "last 2 versions",
79 | "not ie <= 8"
80 | ]
81 | }
82 |
--------------------------------------------------------------------------------
/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": "wx83ea6bbe10612161",
13 | "projectname": "cat-helper",
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 |
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
21 |
22 |
47 |
--------------------------------------------------------------------------------
/src/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/main",
4 | "pages/articles/main",
5 | "pages/articles/article/main",
6 | "pages/user/main"
7 | ],
8 | "window": {
9 | "backgroundTextStyle": "light",
10 | "navigationBarBackgroundColor": "#f59aaa",
11 | "navigationBarTitleText": "猫叫助手",
12 | "navigationBarTextStyle": "light"
13 | },
14 | "tabBar": {
15 | "list": [
16 | {
17 | "pagePath": "pages/index/main",
18 | "iconPath": "static/icons/home.png",
19 | "selectedIconPath": "static/icons/home-selected.png",
20 | "text": "猫叫"
21 | },
22 | {
23 | "pagePath": "pages/articles/main",
24 | "iconPath": "static/icons/home.png",
25 | "selectedIconPath": "static/icons/home-selected.png",
26 | "text": "养猫小知识"
27 | },
28 | {
29 | "pagePath": "pages/user/main",
30 | "iconPath": "static/icons/home.png",
31 | "selectedIconPath": "static/icons/home-selected.png",
32 | "text": "我"
33 | }
34 | ],
35 | "selectedColor": "#f59aaa",
36 | "borderStyle":"white"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/components/Carousel.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
8 |
10 |
11 |
17 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
55 |
56 |
67 |
--------------------------------------------------------------------------------
/src/components/Grids.vue:
--------------------------------------------------------------------------------
1 | /**
2 | 栅格组件
3 | 使用方式:
4 | 传入栅格数组,格式如下
5 | grids: [
6 | { icon: 'icon-plus', name: '测试', path: { path: '/pages/client/home/main', isTab: true },openType:'' },
7 | ]
8 | */
9 |
10 |
11 |
12 |
22 |
23 |
24 |
25 |
26 |
60 |
61 |
104 |
--------------------------------------------------------------------------------
/src/components/Null.vue:
--------------------------------------------------------------------------------
1 | /**
2 | Null组件 当页面没有数据时使用
3 | */
4 |
5 |
6 |
8 |
11 |
![]()
13 |
{{title}}
14 |
{{content}}
15 |
16 |
17 |
18 |
37 |
38 |
58 |
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 | import WXP from '@/utils/wxp'
4 | import store from '@/store/index'
5 | import '../static/iconfont/iconfont.css'
6 |
7 | Vue.config.productionTip = false
8 | App.mpType = 'app'
9 |
10 | wx.cloud.init({
11 | traceUser: true
12 | })
13 |
14 | Vue.prototype.WXP = WXP
15 | Vue.prototype.$store = store
16 | Vue.prototype.db = wx.cloud.database({
17 | env: 'meow-helper-1b5609'
18 | })
19 |
20 | const app = new Vue(App)
21 | app.$mount()
22 |
--------------------------------------------------------------------------------
/src/pages/articles/article/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
{{item}}
4 |
5 |
6 |
7 | {{content.title}}
8 |
9 |
{{item}}
10 |
11 |
12 |
13 |
14 |
40 |
41 |
95 |
--------------------------------------------------------------------------------
/src/pages/articles/article/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 |
--------------------------------------------------------------------------------
/src/pages/articles/article/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 | }
--------------------------------------------------------------------------------
/src/pages/articles/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
47 |
48 |
50 |
--------------------------------------------------------------------------------
/src/pages/articles/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 |
--------------------------------------------------------------------------------
/src/pages/articles/main.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents":{
3 | "van-cell-group": "/static/vant/cell-group/index",
4 | "van-cell": "/static/vant/cell/index",
5 | "van-transition": "/static/vant/transition/index"
6 | },
7 | "navigationBarTitleText": "养猫小知识"
8 | }
--------------------------------------------------------------------------------
/src/pages/index/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 |
--------------------------------------------------------------------------------
/src/pages/index/main.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents":{
3 | "van-cell-group": "/static/vant/cell-group/index",
4 | "van-cell": "/static/vant/cell/index",
5 | "van-notice-bar": "/static/vant/notice-bar/index",
6 | "van-icon": "/static/vant/icon/index",
7 | "van-transition": "/static/vant/transition/index",
8 | "wux-circle": "/static/wux/circle/index"
9 | },
10 | "navigationBarTitleText": "猫叫助手"
11 | }
--------------------------------------------------------------------------------
/src/pages/user/Grids.vue:
--------------------------------------------------------------------------------
1 | /**
2 | 栅格组件
3 | 使用方式:
4 | 传入栅格数组,格式如下
5 | grids: [
6 | { icon: 'icon-plus', name: '测试', path: { path: '/pages/client/home/main', isTab: true },openType:'' },
7 | ]
8 | */
9 |
10 |
11 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
54 |
55 |
98 |
--------------------------------------------------------------------------------
/src/pages/user/UserInfo.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
20 |
21 |
22 |
66 |
67 |
113 |
--------------------------------------------------------------------------------
/src/pages/user/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
43 |
44 |
63 |
--------------------------------------------------------------------------------
/src/pages/user/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 |
--------------------------------------------------------------------------------
/src/pages/user/main.json:
--------------------------------------------------------------------------------
1 | {
2 | "usingComponents": {
3 | "van-button": "/static/vant/button/index",
4 | "van-cell": "/static/vant/cell/index",
5 | "van-cell-group": "/static/vant/cell-group/index",
6 | "van-slider": "/static/vant/slider/index"
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vuex from 'vuex'
2 | import Vue from 'vue'
3 |
4 | Vue.use(Vuex)
5 |
6 | const store = new Vuex.Store({
7 | state: {
8 | openId: '',
9 | authUserInfo: false
10 | },
11 | getters: {
12 | isLogin: (state) => {
13 | return state.authUserInfo && !!state.openId
14 | }
15 | },
16 | mutations: {
17 | updateOpenId (state, openId) {
18 | state.openId = openId
19 | },
20 | updateAuthUserInfo (state, authUserInfo) {
21 | state.authUserInfo = authUserInfo
22 | }
23 | }
24 | })
25 |
26 | export default store
27 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/src/utils/wxp.js:
--------------------------------------------------------------------------------
1 | function f (func, obj) {
2 | return new Promise((resolve, reject) => {
3 | func({
4 | ...obj,
5 | success: resolve,
6 | fail: reject
7 | })
8 | })
9 | }
10 |
11 | var WX = {}
12 |
13 | for (let key in wx) {
14 | WX[key] = obj => f(wx[key], obj)
15 | }
16 |
17 | export default WX
18 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/.gitkeep
--------------------------------------------------------------------------------
/static/functions/user/index.js:
--------------------------------------------------------------------------------
1 | // 云函数入口文件
2 | const cloud = require('wx-server-sdk')
3 |
4 | cloud.init()
5 |
6 | // 云函数入口函数
7 | exports.main = async (event, context) => {
8 | return event.userInfo
9 | }
10 |
--------------------------------------------------------------------------------
/static/functions/user/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "user",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "wx-server-sdk": "latest"
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/static/iconfont/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/iconfont/iconfont.eot
--------------------------------------------------------------------------------
/static/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/static/iconfont/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/iconfont/iconfont.woff
--------------------------------------------------------------------------------
/static/icons/home-selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/icons/home-selected.png
--------------------------------------------------------------------------------
/static/icons/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/icons/home.png
--------------------------------------------------------------------------------
/static/icons/null.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/icons/null.png
--------------------------------------------------------------------------------
/static/img/13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/13.png
--------------------------------------------------------------------------------
/static/img/14.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/14.png
--------------------------------------------------------------------------------
/static/img/15.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/15.png
--------------------------------------------------------------------------------
/static/img/16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/16.png
--------------------------------------------------------------------------------
/static/img/17.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/17.png
--------------------------------------------------------------------------------
/static/img/18.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/18.png
--------------------------------------------------------------------------------
/static/img/19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/19.png
--------------------------------------------------------------------------------
/static/img/20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/20.png
--------------------------------------------------------------------------------
/static/img/21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/21.png
--------------------------------------------------------------------------------
/static/img/22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/22.png
--------------------------------------------------------------------------------
/static/img/23.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/23.png
--------------------------------------------------------------------------------
/static/img/24.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/24.png
--------------------------------------------------------------------------------
/static/img/25.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/25.png
--------------------------------------------------------------------------------
/static/img/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/3.png
--------------------------------------------------------------------------------
/static/img/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/4.png
--------------------------------------------------------------------------------
/static/img/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/5.png
--------------------------------------------------------------------------------
/static/img/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/6.png
--------------------------------------------------------------------------------
/static/img/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/7.png
--------------------------------------------------------------------------------
/static/img/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/8.png
--------------------------------------------------------------------------------
/static/img/9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/9.png
--------------------------------------------------------------------------------
/static/img/cat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/cat.png
--------------------------------------------------------------------------------
/static/img/code.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/img/code.jpg
--------------------------------------------------------------------------------
/static/vant/action-sheet/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | show: Boolean,
5 | title: String,
6 | cancelText: String,
7 | zIndex: {
8 | type: Number,
9 | value: 100
10 | },
11 | actions: {
12 | type: Array,
13 | value: []
14 | },
15 | overlay: {
16 | type: Boolean,
17 | value: true
18 | },
19 | closeOnClickOverlay: {
20 | type: Boolean,
21 | value: true
22 | }
23 | },
24 | methods: {
25 | onSelect: function onSelect(event) {
26 | var index = event.currentTarget.dataset.index;
27 | var item = this.data.actions[index];
28 |
29 | if (item && !item.disabled && !item.loading) {
30 | this.$emit('select', item);
31 | }
32 | },
33 | onCancel: function onCancel() {
34 | this.$emit('cancel');
35 | },
36 | onClose: function onClose() {
37 | this.$emit('close');
38 | }
39 | }
40 | });
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/static/vant/action-sheet/index.wxml:
--------------------------------------------------------------------------------
1 |
10 |
14 |
15 |
29 |
30 |
35 | {{ cancelText }}
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/static/vant/action-sheet/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-action-sheet{color:#333;max-height:90%;overflow-y:auto;-webkit-overflow-scrolling:touch;background-color:#f8f8f8}.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/area/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-loading": "../loading/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/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/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:40px;font-size:16px;line-height:40px}.van-picker__cancel,.van-picker__confirm{padding:0 15px;color:#38f}.van-picker__cancel:active,.van-picker__confirm:active{background-color:#e8e8e8}.van-picker__title{max-width:50%;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{color:#000}.van-picker-column__item--disabled{opacity:.3}
--------------------------------------------------------------------------------
/static/vant/badge-group/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'badge',
5 | type: 'descendant',
6 | linked: function linked(target) {
7 | this.badges.push(target);
8 | this.setActive();
9 | },
10 | unlinked: function unlinked(target) {
11 | this.badges = this.badges.filter(function (item) {
12 | return item !== target;
13 | });
14 | this.setActive();
15 | }
16 | },
17 | props: {
18 | active: {
19 | type: Number,
20 | value: 0
21 | }
22 | },
23 | watch: {
24 | active: 'setActive'
25 | },
26 | beforeCreate: function beforeCreate() {
27 | this.badges = [];
28 | this.currentActive = -1;
29 | },
30 | methods: {
31 | setActive: function setActive(badge) {
32 | var active = this.data.active;
33 | var badges = this.badges;
34 |
35 | if (badge) {
36 | active = badges.indexOf(badge);
37 | }
38 |
39 | if (active === this.currentActive) {
40 | return;
41 | }
42 |
43 | if (this.currentActive !== -1 && badges[this.currentActive]) {
44 | this.$emit('change', active);
45 | badges[this.currentActive].setActive(false);
46 | }
47 |
48 | if (badges[active]) {
49 | badges[active].setActive(true);
50 | this.currentActive = active;
51 | }
52 | }
53 | }
54 | });
--------------------------------------------------------------------------------
/static/vant/badge-group/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/badge-group/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/vant/badge-group/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-badge-group{width:85px}
--------------------------------------------------------------------------------
/static/vant/badge/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | type: 'ancestor',
5 | name: 'badge-group'
6 | },
7 | props: {
8 | info: Number,
9 | title: String
10 | },
11 | methods: {
12 | onClick: function onClick() {
13 | var group = this.getRelationNodes('../badge-group/index')[0];
14 |
15 | if (group) {
16 | group.setActive(this);
17 | }
18 | },
19 | setActive: function setActive(active) {
20 | this.setData({
21 | active: active
22 | });
23 | }
24 | }
25 | });
--------------------------------------------------------------------------------
/static/vant/badge/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/badge/index.wxml:
--------------------------------------------------------------------------------
1 |
2 | {{ info }}
3 | {{ title }}
4 |
5 |
--------------------------------------------------------------------------------
/static/vant/badge/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-badge{display:block;overflow:hidden;font-size:14px;line-height:1.4;-webkit-user-select:none;user-select:none;color:#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/button/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | import { button } from '../mixins/button';
3 | import { openType } from '../mixins/open-type';
4 | VantComponent({
5 | mixins: [button, openType],
6 | props: {
7 | plain: Boolean,
8 | block: Boolean,
9 | square: Boolean,
10 | loading: Boolean,
11 | disabled: Boolean,
12 | type: {
13 | type: String,
14 | value: 'default'
15 | },
16 | size: {
17 | type: String,
18 | value: 'normal'
19 | }
20 | },
21 | computed: {
22 | classes: function classes() {
23 | var _this$data = this.data,
24 | type = _this$data.type,
25 | size = _this$data.size,
26 | plain = _this$data.plain,
27 | disabled = _this$data.disabled,
28 | loading = _this$data.loading,
29 | square = _this$data.square,
30 | block = _this$data.block;
31 | return this.classNames("van-button--" + type, "van-button--" + size, {
32 | 'van-button--block': block,
33 | 'van-button--plain': plain,
34 | 'van-button--square': square,
35 | 'van-button--loading': loading,
36 | 'van-button--disabled': disabled,
37 | 'van-button--unclickable': disabled || loading
38 | });
39 | }
40 | },
41 | methods: {
42 | onClick: function onClick() {
43 | if (!this.data.disabled && !this.data.loading) {
44 | this.$emit('click');
45 | }
46 | }
47 | }
48 | });
--------------------------------------------------------------------------------
/static/vant/button/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-loading": "../loading/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/static/vant/button/index.wxml:
--------------------------------------------------------------------------------
1 |
32 |
--------------------------------------------------------------------------------
/static/vant/button/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-button{position:relative;padding:0;display:inline-block;height:44px;line-height:42px;border-radius:3px;box-sizing:border-box;font-size:16px;text-align:center;vertical-align:middle;-webkit-appearance:none;-webkit-text-size-adjust:100%}.van-button::after{content:" ";position:absolute;top:50%;left:50%;opacity:0;width:100%;height:100%;border:inherit;border-color:#000;background-color:#000;border-radius:inherit;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%)}.van-button:active::after{opacity:.3}.van-button--unclickable::after{display:none}.van-button--default{color:#333;background-color:#fff;border:1px solid #eee}.van-button--primary{color:#fff;background-color:#4b0;border:1px solid #4b0}.van-button--danger{color:#fff;background-color:#f44;border:1px solid #f44}.van-button--warning{color:#fff;background-color:#f85;border:1px solid #f85}.van-button--plain{background-color:#fff}.van-button--plain.van-button--primary{color:#4b0}.van-button--plain.van-button--danger{color:#f44}.van-button--plain.van-button--warning{color:#f85}.van-button--large{width:100%;height:50px;line-height:48px}.van-button--normal{padding:0 15px;font-size:14px}.van-button--small{height:30px;padding:0 8px;min-width:60px;font-size:12px;line-height:28px}.van-button--mini{display:inline-block;width:50px;height:22px;line-height:20px;font-size:10px}.van-button--mini+.van-button--mini{margin-left:5px}.van-button--block{width:100%;display:block}.van-button--square{border-radius:0}.van-button--disabled{color:#999;background-color:#e8e8e8;border:1px solid #eee}
--------------------------------------------------------------------------------
/static/vant/card/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | classes: ['thumb-class', 'title-class', 'price-class', 'desc-class', 'num-class'],
4 | props: {
5 | num: String,
6 | desc: String,
7 | thumb: String,
8 | title: String,
9 | price: String,
10 | centered: Boolean,
11 | currency: {
12 | type: String,
13 | value: '¥'
14 | }
15 | }
16 | });
--------------------------------------------------------------------------------
/static/vant/card/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/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 |
22 |
23 |
--------------------------------------------------------------------------------
/static/vant/card/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.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-align-items:center;align-items: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-flex;display:flex}.van-card__content{width:100%}.van-card__content--center{height:90px;-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}.van-card__desc{color:#666;font-size:12px;max-height:20px}.van-card__num,.van-card__price{-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}
--------------------------------------------------------------------------------
/static/vant/cell-group/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | border: {
5 | type: Boolean,
6 | value: true
7 | }
8 | }
9 | });
--------------------------------------------------------------------------------
/static/vant/cell-group/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/vant/cell-group/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/vant/cell-group/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';
--------------------------------------------------------------------------------
/static/vant/cell/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | classes: ['title-class', 'label-class', 'value-class'],
4 | props: {
5 | title: null,
6 | value: null,
7 | url: String,
8 | icon: String,
9 | label: String,
10 | center: Boolean,
11 | isLink: Boolean,
12 | required: Boolean,
13 | clickable: Boolean,
14 | titleWidth: String,
15 | customStyle: String,
16 | linkType: {
17 | type: String,
18 | value: 'navigateTo'
19 | },
20 | border: {
21 | type: Boolean,
22 | value: true
23 | }
24 | },
25 | computed: {
26 | cellClass: function cellClass() {
27 | var data = this.data;
28 | return this.classNames('custom-class', 'van-cell', {
29 | 'van-hairline': data.border,
30 | 'van-cell--center': data.center,
31 | 'van-cell--required': data.required,
32 | 'van-cell--clickable': data.isLink || data.clickable
33 | });
34 | },
35 | titleStyle: function titleStyle() {
36 | var titleWidth = this.data.titleWidth;
37 | return titleWidth ? "max-width: " + titleWidth + ";min-width: " + titleWidth : '';
38 | }
39 | },
40 | methods: {
41 | onClick: function onClick() {
42 | var url = this.data.url;
43 |
44 | if (url) {
45 | wx[this.data.linkType]({
46 | url: url
47 | });
48 | }
49 |
50 | this.$emit('click');
51 | }
52 | }
53 | });
--------------------------------------------------------------------------------
/static/vant/cell/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/static/vant/cell/index.wxml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
12 |
13 |
17 |
18 | {{ title }}
19 | {{ label }}
20 |
21 |
22 |
23 |
24 |
25 | {{ value }}
26 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/static/vant/cell/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-cell{width:100%;display:-webkit-flex;display:flex;padding:10px 15px;box-sizing:border-box;line-height:24px;position:relative;background-color:#fff;color:#333;font-size:14px}.van-cell::after{left:15px;right:0;-webkit-transform:scaleY(.5);transform:scaleY(.5);border-bottom-width:1px}.van-cell-group{background-color:#fff}.van-cell__label{font-size:12px;line-height:1.2;color:#666}.van-cell__title,.van-cell__value{-webkit-flex:1;flex:1}.van-cell__title:empty,.van-cell__value:empty{display:none}.van-cell__value{overflow:hidden;text-align:right;vertical-align:middle}.van-cell__left-icon{font-size:16px;line-height:24px;margin-right:5px;vertical-align:middle}.van-cell__right-icon{color:#999;font-size:12px;line-height:24px;margin-left:5px}.van-cell--clickable:active{background-color:#e8e8e8}.van-cell--required{overflow:visible}.van-cell--required::before{content:'*';position:absolute;left:7px;font-size:14px;color:#f44}.van-cell--center{-webkit-align-items:center;align-items:center}
--------------------------------------------------------------------------------
/static/vant/checkbox-group/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'checkbox',
5 | type: 'descendant',
6 | linked: function linked(target) {
7 | var _this$data = this.data,
8 | value = _this$data.value,
9 | disabled = _this$data.disabled;
10 | target.setData({
11 | value: value.indexOf(target.data.name) !== -1,
12 | disabled: disabled || target.data.disabled
13 | });
14 | }
15 | },
16 | props: {
17 | value: Array,
18 | disabled: Boolean,
19 | max: Number
20 | },
21 | watch: {
22 | value: function value(_value) {
23 | var children = this.getRelationNodes('../checkbox/index');
24 | children.forEach(function (child) {
25 | child.setData({
26 | value: _value.indexOf(child.data.name) !== -1
27 | });
28 | });
29 | },
30 | disabled: function disabled(_disabled) {
31 | var children = this.getRelationNodes('../checkbox/index');
32 | children.forEach(function (child) {
33 | child.setData({
34 | disabled: _disabled || child.data.disabled
35 | });
36 | });
37 | }
38 | }
39 | });
--------------------------------------------------------------------------------
/static/vant/checkbox-group/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/checkbox-group/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/vant/checkbox-group/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';
--------------------------------------------------------------------------------
/static/vant/checkbox/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'checkbox-group',
5 | type: 'ancestor'
6 | },
7 | classes: ['icon-class', 'label-class'],
8 | props: {
9 | name: null,
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 | });
--------------------------------------------------------------------------------
/static/vant/checkbox/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/checkbox/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/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/col/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'row',
5 | type: 'ancestor'
6 | },
7 | props: {
8 | span: Number,
9 | offset: Number
10 | },
11 | data: {
12 | style: ''
13 | },
14 | computed: {
15 | classes: function classes() {
16 | var _this$data = this.data,
17 | span = _this$data.span,
18 | offset = _this$data.offset;
19 | return this.classNames('custom-class', 'van-col', {
20 | ["van-col--" + span]: span,
21 | ["van-col--offset-" + offset]: offset
22 | });
23 | }
24 | },
25 | methods: {
26 | setGutter: function setGutter(gutter) {
27 | var padding = gutter / 2 + "px";
28 | var style = gutter ? "padding-left: " + padding + "; padding-right: " + padding + ";" : '';
29 |
30 | if (style !== this.data.style) {
31 | this.setData({
32 | style: style
33 | });
34 | }
35 | }
36 | }
37 | });
--------------------------------------------------------------------------------
/static/vant/col/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/col/index.wxml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/static/vant/col/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-col{float:left;box-sizing:border-box}.van-col--1{width:4.16666667%}.van-col--offset-1{margin-left:4.16666667%}.van-col--2{width:8.33333333%}.van-col--offset-2{margin-left:8.33333333%}.van-col--3{width:12.5%}.van-col--offset-3{margin-left:12.5%}.van-col--4{width:16.66666667%}.van-col--offset-4{margin-left:16.66666667%}.van-col--5{width:20.83333333%}.van-col--offset-5{margin-left:20.83333333%}.van-col--6{width:25%}.van-col--offset-6{margin-left:25%}.van-col--7{width:29.16666667%}.van-col--offset-7{margin-left:29.16666667%}.van-col--8{width:33.33333333%}.van-col--offset-8{margin-left:33.33333333%}.van-col--9{width:37.5%}.van-col--offset-9{margin-left:37.5%}.van-col--10{width:41.66666667%}.van-col--offset-10{margin-left:41.66666667%}.van-col--11{width:45.83333333%}.van-col--offset-11{margin-left:45.83333333%}.van-col--12{width:50%}.van-col--offset-12{margin-left:50%}.van-col--13{width:54.16666667%}.van-col--offset-13{margin-left:54.16666667%}.van-col--14{width:58.33333333%}.van-col--offset-14{margin-left:58.33333333%}.van-col--15{width:62.5%}.van-col--offset-15{margin-left:62.5%}.van-col--16{width:66.66666667%}.van-col--offset-16{margin-left:66.66666667%}.van-col--17{width:70.83333333%}.van-col--offset-17{margin-left:70.83333333%}.van-col--18{width:75%}.van-col--offset-18{margin-left:75%}.van-col--19{width:79.16666667%}.van-col--offset-19{margin-left:79.16666667%}.van-col--20{width:83.33333333%}.van-col--offset-20{margin-left:83.33333333%}.van-col--21{width:87.5%}.van-col--offset-21{margin-left:87.5%}.van-col--22{width:91.66666667%}.van-col--offset-22{margin-left:91.66666667%}.van-col--23{width:95.83333333%}.van-col--offset-23{margin-left:95.83333333%}.van-col--24{width:100%}.van-col--offset-24{margin-left:100%}
--------------------------------------------------------------------------------
/static/vant/common/class-names.js:
--------------------------------------------------------------------------------
1 | var hasOwn = {}.hasOwnProperty;
2 | export function classNames() {
3 | var classes = [];
4 |
5 | for (var i = 0; i < arguments.length; i++) {
6 | var arg = arguments[i];
7 | if (!arg) continue;
8 | var argType = typeof arg;
9 |
10 | if (argType === 'string' || argType === 'number') {
11 | classes.push(arg);
12 | } else if (Array.isArray(arg) && arg.length) {
13 | var inner = classNames.apply(null, arg);
14 |
15 | if (inner) {
16 | classes.push(inner);
17 | }
18 | } else if (argType === 'object') {
19 | for (var key in arg) {
20 | if (hasOwn.call(arg, key) && arg[key]) {
21 | classes.push(key);
22 | }
23 | }
24 | }
25 | }
26 |
27 | return classes.join(' ');
28 | }
29 | ;
--------------------------------------------------------------------------------
/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 | var options = {};
14 | mapKeys(vantOptions, options, {
15 | data: 'data',
16 | props: 'properties',
17 | mixins: 'behaviors',
18 | methods: 'methods',
19 | beforeCreate: 'created',
20 | created: 'attached',
21 | mounted: 'ready',
22 | relations: 'relations',
23 | destroyed: 'detached',
24 | classes: 'externalClasses'
25 | });
26 | var relation = vantOptions.relation;
27 |
28 | if (relation) {
29 | options.relations = Object.assign(options.relations || {}, {
30 | ["../" + relation.name + "/index"]: relation
31 | });
32 | } // add default externalClasses
33 |
34 |
35 | options.externalClasses = options.externalClasses || [];
36 | options.externalClasses.push('custom-class'); // add default behaviors
37 |
38 | options.behaviors = options.behaviors || [];
39 | options.behaviors.push(basic); // map field to form-field behavior
40 |
41 | if (vantOptions.field) {
42 | options.behaviors.push('wx://form-field');
43 | } // add default options
44 |
45 |
46 | options.options = {
47 | multipleSlots: true,
48 | addGlobalClass: true
49 | };
50 | observe(vantOptions, options);
51 | Component(options);
52 | }
53 |
54 | export { VantComponent };
--------------------------------------------------------------------------------
/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/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}.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3}.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:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;border:0 solid #eee}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}
--------------------------------------------------------------------------------
/static/vant/common/style/clearfix.wxss:
--------------------------------------------------------------------------------
1 | .van-clearfix::after{content:'';display:table;clear:both}
--------------------------------------------------------------------------------
/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}.van-multi-ellipsis--l3{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3}
--------------------------------------------------------------------------------
/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:-50%;left:-50%;right:-50%;bottom:-50%;-webkit-transform:scale(.5);transform:scale(.5);pointer-events:none;box-sizing:border-box;-webkit-transform-origin:center;transform-origin:center;border:0 solid #eee}.van-hairline--top::after{border-top-width:1px}.van-hairline--left::after{border-left-width:1px}.van-hairline--right::after{border-right-width:1px}.van-hairline--bottom::after{border-bottom-width:1px}.van-hairline--top-bottom::after{border-width:1px 0}.van-hairline--surround::after{border-width:1px}
--------------------------------------------------------------------------------
/static/vant/common/style/mixins/border-retina.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/vant/common/style/mixins/border-retina.wxss
--------------------------------------------------------------------------------
/static/vant/common/style/mixins/clearfix.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/vant/common/style/mixins/clearfix.wxss
--------------------------------------------------------------------------------
/static/vant/common/style/mixins/ellipsis.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/vant/common/style/mixins/ellipsis.wxss
--------------------------------------------------------------------------------
/static/vant/common/style/mixins/hairline.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/vant/common/style/mixins/hairline.wxss
--------------------------------------------------------------------------------
/static/vant/common/style/var.wxss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Rychou/mpvue-cloud/eb4fa249e5935508d3e10552b0157d97787b73af/static/vant/common/style/var.wxss
--------------------------------------------------------------------------------
/static/vant/common/utils.js:
--------------------------------------------------------------------------------
1 | function isDef(value) {
2 | return value !== undefined && value !== null;
3 | }
4 |
5 | function isObj(x) {
6 | var type = typeof x;
7 | return x !== null && (type === 'object' || type === 'function');
8 | }
9 |
10 | export { isObj, isDef };
--------------------------------------------------------------------------------
/static/vant/dialog/dialog.js:
--------------------------------------------------------------------------------
1 | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2 |
3 | var queue = [];
4 |
5 | var Dialog = function Dialog(options) {
6 | return new Promise(function (resolve, reject) {
7 | var pages = getCurrentPages();
8 | var ctx = pages[pages.length - 1];
9 | var dialog = ctx.selectComponent(options.selector);
10 | delete options.selector;
11 |
12 | if (dialog) {
13 | dialog.setData(_extends({
14 | onCancel: reject,
15 | onConfirm: resolve
16 | }, options));
17 | queue.push(dialog);
18 | }
19 | });
20 | };
21 |
22 | Dialog.defaultOptions = {
23 | show: true,
24 | title: '',
25 | message: '',
26 | zIndex: 100,
27 | overlay: true,
28 | asyncClose: false,
29 | selector: '#van-dialog',
30 | confirmButtonText: '确认',
31 | cancelButtonText: '取消',
32 | showConfirmButton: true,
33 | showCancelButton: false,
34 | closeOnClickOverlay: false,
35 | confirmButtonOpenType: ''
36 | };
37 |
38 | Dialog.alert = function (options) {
39 | return Dialog(_extends({}, Dialog.currentOptions, options));
40 | };
41 |
42 | Dialog.confirm = function (options) {
43 | return Dialog(_extends({}, Dialog.currentOptions, {
44 | showCancelButton: true
45 | }, options));
46 | };
47 |
48 | Dialog.close = function () {
49 | queue.forEach(function (dialog) {
50 | dialog.close();
51 | });
52 | queue = [];
53 | };
54 |
55 | Dialog.setDefaultOptions = function (options) {
56 | Object.assign(Dialog.currentOptions, options);
57 | };
58 |
59 | Dialog.resetDefaultOptions = function () {
60 | Dialog.currentOptions = _extends({}, Dialog.defaultOptions);
61 | };
62 |
63 | Dialog.resetDefaultOptions();
64 | export default Dialog;
--------------------------------------------------------------------------------
/static/vant/dialog/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | import { openType } from '../mixins/open-type';
3 | VantComponent({
4 | mixins: [openType],
5 | props: {
6 | show: Boolean,
7 | title: String,
8 | message: String,
9 | useSlot: Boolean,
10 | asyncClose: Boolean,
11 | showCancelButton: Boolean,
12 | confirmButtonOpenType: String,
13 | zIndex: {
14 | type: Number,
15 | value: 100
16 | },
17 | confirmButtonText: {
18 | type: String,
19 | value: '确认'
20 | },
21 | cancelButtonText: {
22 | type: String,
23 | value: '取消'
24 | },
25 | showConfirmButton: {
26 | type: Boolean,
27 | value: true
28 | },
29 | overlay: {
30 | type: Boolean,
31 | value: true
32 | },
33 | closeOnClickOverlay: {
34 | type: Boolean,
35 | value: false
36 | }
37 | },
38 | data: {
39 | loading: {
40 | confirm: false,
41 | cancel: false
42 | }
43 | },
44 | watch: {
45 | show: function show(_show) {
46 | if (!_show) {
47 | this.setData({
48 | loading: {
49 | confirm: false,
50 | cancel: false
51 | }
52 | });
53 | }
54 | }
55 | },
56 | methods: {
57 | onConfirm: function onConfirm() {
58 | this.handleAction('confirm');
59 | },
60 | onCancel: function onCancel() {
61 | this.handleAction('cancel');
62 | },
63 | onClickOverlay: function onClickOverlay() {
64 | this.onClose('overlay');
65 | },
66 | handleAction: function handleAction(action) {
67 | if (this.data.asyncClose) {
68 | this.setData({
69 | ["loading." + action]: true
70 | });
71 | }
72 |
73 | this.onClose(action);
74 | },
75 | close: function close() {
76 | this.setData({
77 | show: false
78 | });
79 | },
80 | onClose: function onClose(action) {
81 | if (!this.data.asyncClose) {
82 | this.close();
83 | }
84 |
85 | this.$emit('close', action);
86 | this.$emit(action);
87 | var callback = this.data[action === 'confirm' ? 'onConfirm' : 'onCancel'];
88 |
89 | if (callback) {
90 | callback(this);
91 | }
92 | }
93 | }
94 | });
--------------------------------------------------------------------------------
/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/dialog/index.wxml:
--------------------------------------------------------------------------------
1 |
10 |
13 |
14 |
15 |
16 | {{ message }}
17 |
18 |
19 |
50 |
51 |
--------------------------------------------------------------------------------
/static/vant/dialog/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-dialog{width:85%;font-size:16px;overflow:hidden;border-radius:4px;background-color:#fff}.van-dialog__header{padding:15px 0 0;text-align:center}.van-dialog__header--isolated{padding:25px 0}.van-dialog__message{padding:20px;line-height:1.5}.van-dialog__message--has-title{color:#666;font-size:14px}.van-dialog__footer{display:-webkit-flex;display:flex;overflow:hidden;-webkit-user-select:none;user-select:none}.van-dialog__button{-webkit-flex:1;flex:1}.van-dialog__cancel,.van-dialog__confirm{border:0!important}.van-dialog__confirm,.van-dialog__confirm:active{color:#f44!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/field/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | field: true,
4 | classes: ['input-class'],
5 | props: {
6 | icon: String,
7 | label: String,
8 | error: Boolean,
9 | focus: Boolean,
10 | center: Boolean,
11 | isLink: Boolean,
12 | leftIcon: String,
13 | disabled: Boolean,
14 | autosize: Boolean,
15 | readonly: Boolean,
16 | required: Boolean,
17 | iconClass: String,
18 | clearable: Boolean,
19 | inputAlign: String,
20 | customClass: String,
21 | confirmType: String,
22 | errorMessage: String,
23 | placeholder: String,
24 | customStyle: String,
25 | useIconSlot: Boolean,
26 | useButtonSlot: Boolean,
27 | placeholderClass: String,
28 | cursorSpacing: {
29 | type: Number,
30 | value: 50
31 | },
32 | maxlength: {
33 | type: Number,
34 | value: -1
35 | },
36 | type: {
37 | type: String,
38 | value: 'text'
39 | },
40 | border: {
41 | type: Boolean,
42 | value: true
43 | },
44 | titleWidth: {
45 | type: String,
46 | value: '90px'
47 | }
48 | },
49 | data: {
50 | showClear: false
51 | },
52 | computed: {
53 | inputClass: function inputClass() {
54 | var data = this.data;
55 | return this.classNames('input-class', 'van-field__input', {
56 | 'van-field--error': data.error,
57 | 'van-field__textarea': data.type === 'textarea',
58 | 'van-field__input--disabled': data.disabled,
59 | ["van-field--" + data.inputAlign]: data.inputAlign
60 | });
61 | }
62 | },
63 | beforeCreate: function beforeCreate() {
64 | this.focused = false;
65 | },
66 | methods: {
67 | onInput: function onInput(event) {
68 | var _ref = event.detail || {},
69 | _ref$value = _ref.value,
70 | value = _ref$value === void 0 ? '' : _ref$value;
71 |
72 | this.$emit('input', value);
73 | this.$emit('change', value);
74 | this.setData({
75 | value: value,
76 | showClear: this.getShowClear(value)
77 | });
78 | },
79 | onFocus: function onFocus() {
80 | this.$emit('focus');
81 | this.focused = true;
82 | this.setData({
83 | showClear: this.getShowClear()
84 | });
85 | },
86 | onBlur: function onBlur() {
87 | this.focused = false;
88 | this.$emit('blur');
89 | this.setData({
90 | showClear: this.getShowClear()
91 | });
92 | },
93 | onClickIcon: function onClickIcon() {
94 | this.$emit('click-icon');
95 | },
96 | getShowClear: function getShowClear(value) {
97 | value = value === undefined ? this.data.value : value;
98 | return this.data.clearable && this.focused && value && !this.data.readonly;
99 | },
100 | onClear: function onClear() {
101 | this.setData({
102 | value: '',
103 | showClear: this.getShowClear('')
104 | });
105 | this.$emit('input', '');
106 | this.$emit('change', '');
107 | },
108 | onConfirm: function onConfirm() {
109 | this.$emit('confirm', this.data.value);
110 | }
111 | }
112 | });
--------------------------------------------------------------------------------
/static/vant/field/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-cell": "../cell/index",
5 | "van-icon": "../icon/index"
6 | }
7 | }
--------------------------------------------------------------------------------
/static/vant/field/index.wxml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
31 |
49 |
56 |
57 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | {{ errorMessage }}
70 |
71 |
72 |
--------------------------------------------------------------------------------
/static/vant/field/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{min-height:24px}.van-field__input{border:0;margin:0;padding:0;width:100%;height:24px;resize:none;display:block;text-align:left;min-height:24px;line-height:inherit;box-sizing:border-box;background-color:transparent}.van-field__input--disabled{opacity:1;color:#666;background-color:transparent}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__clear-root{height:24px}.van-field__button,.van-field__clear,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear,.van-field__icon-container{padding:0 10px;line-height:inherit;margin-right:-10px;vertical-align:middle}.van-field__clear{color:#c9c9c9}.van-field__icon-container{color:#999}.van-field__icon{display:block;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}
--------------------------------------------------------------------------------
/static/vant/icon/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | info: null,
5 | name: String,
6 | size: String,
7 | color: String,
8 | classPrefix: {
9 | type: String,
10 | value: 'van-icon'
11 | }
12 | },
13 | methods: {
14 | onClick: function onClick() {
15 | this.$emit('click');
16 | }
17 | }
18 | });
--------------------------------------------------------------------------------
/static/vant/icon/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/icon/index.wxml:
--------------------------------------------------------------------------------
1 |
6 | {{ info }}
7 |
8 |
--------------------------------------------------------------------------------
/static/vant/icon/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';@font-face{font-style:normal;font-weight:400;font-family:vant-icon;src:url(https://img.yzcdn.cn/vant/vant-icon-76f274.ttf) format('truetype')}.van-icon{position:relative;display:inline-block;font:normal normal normal 14px/1 vant-icon;font-size:inherit;text-rendering:auto}.van-icon__info{color:#fff;left:100%;top:-.5em;font-size:.5em;padding:0 .3em;text-align:center;min-width:1.2em;line-height:1.2;position:absolute;border-radius:.6em;box-sizing:border-box;background-color:#f44;-webkit-transform:translateX(-50%);transform:translateX(-50%);font-family:PingFang SC,Helvetica Neue,Arial,sans-serif}.van-icon::before{display:inline-block}.van-icon-add-o::before{content:"\F000"}.van-icon-add::before{content:"\F001"}.van-icon-add2::before{content:"\F002"}.van-icon-after-sale::before{content:"\F003"}.van-icon-aim::before{content:"\F004"}.van-icon-alipay::before{content:"\F005"}.van-icon-arrow-left::before{content:"\F006"}.van-icon-arrow::before{content:"\F007"}.van-icon-balance-pay::before{content:"\F008"}.van-icon-browsing-history::before{content:"\F009"}.van-icon-card::before{content:"\F00A"}.van-icon-cart::before{content:"\F00B"}.van-icon-cash-back-record::before{content:"\F00C"}.van-icon-cash-on-deliver::before{content:"\F00D"}.van-icon-certificate::before{content:"\F00E"}.van-icon-chat::before{content:"\F00F"}.van-icon-check::before{content:"\F010"}.van-icon-checked::before{content:"\F011"}.van-icon-clear::before{content:"\F012"}.van-icon-clock::before{content:"\F013"}.van-icon-close::before{content:"\F014"}.van-icon-completed::before{content:"\F015"}.van-icon-contact::before{content:"\F016"}.van-icon-coupon::before{content:"\F017"}.van-icon-credit-pay::before{content:"\F018"}.van-icon-debit-pay::before{content:"\F019"}.van-icon-delete::before{content:"\F01A"}.van-icon-description::before{content:"\F01B"}.van-icon-discount::before{content:"\F01C"}.van-icon-ecard-pay::before{content:"\F01D"}.van-icon-edit-data::before{content:"\F01E"}.van-icon-edit::before{content:"\F01F"}.van-icon-exchange-record::before{content:"\F020"}.van-icon-exchange::before{content:"\F021"}.van-icon-fail::before{content:"\F022"}.van-icon-free-postage::before{content:"\F023"}.van-icon-gift-card-pay::before{content:"\F024"}.van-icon-gift-card::before{content:"\F025"}.van-icon-gift::before{content:"\F026"}.van-icon-gold-coin::before{content:"\F027"}.van-icon-goods-collect::before{content:"\F028"}.van-icon-home::before{content:"\F029"}.van-icon-hot-sale::before{content:"\F02A"}.van-icon-hot::before{content:"\F02B"}.van-icon-idcard::before{content:"\F02C"}.van-icon-info-o::before{content:"\F02D"}.van-icon-like-o::before{content:"\F02E"}.van-icon-like::before{content:"\F02F"}.van-icon-location::before{content:"\F030"}.van-icon-logistics::before{content:"\F031"}.van-icon-more-o::before{content:"\F032"}.van-icon-more::before{content:"\F033"}.van-icon-new-arrival::before{content:"\F034"}.van-icon-new::before{content:"\F035"}.van-icon-other-pay::before{content:"\F036"}.van-icon-passed::before{content:"\F037"}.van-icon-password-not-view::before{content:"\F038"}.van-icon-password-view::before{content:"\F039"}.van-icon-pause::before{content:"\F03A"}.van-icon-peer-pay::before{content:"\F03B"}.van-icon-pending-deliver::before{content:"\F03C"}.van-icon-pending-evaluate::before{content:"\F03D"}.van-icon-pending-orders::before{content:"\F03E"}.van-icon-pending-payment::before{content:"\F03F"}.van-icon-phone::before{content:"\F040"}.van-icon-photo::before{content:"\F041"}.van-icon-photograph::before{content:"\F042"}.van-icon-play::before{content:"\F043"}.van-icon-point-gift::before{content:"\F044"}.van-icon-points-mall::before{content:"\F045"}.van-icon-points::before{content:"\F046"}.van-icon-qr-invalid::before{content:"\F047"}.van-icon-qr::before{content:"\F048"}.van-icon-question::before{content:"\F049"}.van-icon-receive-gift::before{content:"\F04A"}.van-icon-records::before{content:"\F04B"}.van-icon-search::before{content:"\F04C"}.van-icon-send-gift::before{content:"\F04D"}.van-icon-setting::before{content:"\F04E"}.van-icon-share::before{content:"\F04F"}.van-icon-shop-collect::before{content:"\F050"}.van-icon-shop::before{content:"\F051"}.van-icon-shopping-cart::before{content:"\F052"}.van-icon-sign::before{content:"\F053"}.van-icon-stop::before{content:"\F054"}.van-icon-success::before{content:"\F055"}.van-icon-tosend::before{content:"\F056"}.van-icon-underway::before{content:"\F057"}.van-icon-upgrade::before{content:"\F058"}.van-icon-value-card::before{content:"\F059"}.van-icon-wap-home::before{content:"\F05A"}.van-icon-wap-nav::before{content:"\F05B"}.van-icon-warn::before{content:"\F05C"}.van-icon-wechat::before{content:"\F05D"}
--------------------------------------------------------------------------------
/static/vant/loading/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | size: {
5 | type: String,
6 | value: '30px'
7 | },
8 | type: {
9 | type: String,
10 | value: 'circular'
11 | },
12 | color: {
13 | type: String,
14 | value: '#c9c9c9'
15 | }
16 | }
17 | });
--------------------------------------------------------------------------------
/static/vant/loading/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/vant/loading/index.wxml:
--------------------------------------------------------------------------------
1 |
5 |
9 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/static/vant/loading/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-loading{z-index:0;font-size:0;line-height:0;position:relative;display:inline-block;vertical-align:middle}.van-loading__spinner{z-index:-1;width:100%;height:100%;position:relative;display:inline-block;box-sizing:border-box;-webkit-animation:van-rotate .8s linear infinite;animation:van-rotate .8s linear infinite}.van-loading__spinner--spinner{-webkit-animation-timing-function:steps(12);animation-timing-function:steps(12)}.van-loading__spinner--circular{border:1px solid;border-radius:100%;border-color:currentColor;border-top-color:transparent}.van-loading__dot{top:0;left:0;width:100%;height:100%;position:absolute}.van-loading__dot::before{width:2px;height:25%;content:' ';display:block;margin:0 auto;border-radius:40%;background-color:currentColor}.van-loading__dot:nth-of-type(1){opacity:1;-webkit-transform:rotate(30deg);transform:rotate(30deg)}.van-loading__dot:nth-of-type(2){opacity:.9375;-webkit-transform:rotate(60deg);transform:rotate(60deg)}.van-loading__dot:nth-of-type(3){opacity:.875;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.van-loading__dot:nth-of-type(4){opacity:.8125;-webkit-transform:rotate(120deg);transform:rotate(120deg)}.van-loading__dot:nth-of-type(5){opacity:.75;-webkit-transform:rotate(150deg);transform:rotate(150deg)}.van-loading__dot:nth-of-type(6){opacity:.6875;-webkit-transform:rotate(180deg);transform:rotate(180deg)}.van-loading__dot:nth-of-type(7){opacity:.625;-webkit-transform:rotate(210deg);transform:rotate(210deg)}.van-loading__dot:nth-of-type(8){opacity:.5625;-webkit-transform:rotate(240deg);transform:rotate(240deg)}.van-loading__dot:nth-of-type(9){opacity:.5;-webkit-transform:rotate(270deg);transform:rotate(270deg)}.van-loading__dot:nth-of-type(10){opacity:.4375;-webkit-transform:rotate(300deg);transform:rotate(300deg)}.van-loading__dot:nth-of-type(11){opacity:.375;-webkit-transform:rotate(330deg);transform:rotate(330deg)}.van-loading__dot:nth-of-type(12){opacity:.3125;-webkit-transform:rotate(360deg);transform:rotate(360deg)}@-webkit-keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes van-rotate{from{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}
--------------------------------------------------------------------------------
/static/vant/mixins/basic.js:
--------------------------------------------------------------------------------
1 | import { classNames } from '../common/class-names';
2 | export var basic = Behavior({
3 | methods: {
4 | classNames: classNames,
5 | $emit: function $emit() {
6 | this.triggerEvent.apply(this, arguments);
7 | },
8 | getRect: function getRect(selector, all) {
9 | var _this = this;
10 |
11 | return new Promise(function (resolve) {
12 | wx.createSelectorQuery().in(_this)[all ? 'selectAll' : 'select'](selector).boundingClientRect(function (rect) {
13 | if (all && Array.isArray(rect) && rect.length) {
14 | resolve(rect);
15 | }
16 |
17 | if (!all && rect) {
18 | resolve(rect);
19 | }
20 | }).exec();
21 | });
22 | }
23 | }
24 | });
--------------------------------------------------------------------------------
/static/vant/mixins/button.js:
--------------------------------------------------------------------------------
1 | export var button = Behavior({
2 | properties: {
3 | id: String,
4 | appParameter: String,
5 | sendMessageTitle: String,
6 | sendMessagePath: String,
7 | sendMessageImg: String,
8 | showMessageCard: String,
9 | hoverStopPropagation: Boolean,
10 | hoverStartTime: {
11 | type: Number,
12 | value: 20
13 | },
14 | hoverStayTime: {
15 | type: Number,
16 | value: 70
17 | },
18 | lang: {
19 | type: String,
20 | value: 'en'
21 | },
22 | sessionFrom: {
23 | type: String,
24 | value: ''
25 | }
26 | }
27 | });
--------------------------------------------------------------------------------
/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/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/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/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/mixins/touch.js:
--------------------------------------------------------------------------------
1 | export var touch = Behavior({
2 | methods: {
3 | touchStart: function touchStart(event) {
4 | this.direction = '';
5 | this.deltaX = 0;
6 | this.deltaY = 0;
7 | this.offsetX = 0;
8 | this.offsetY = 0;
9 | this.startX = event.touches[0].clientX;
10 | this.startY = event.touches[0].clientY;
11 | },
12 | touchMove: function touchMove(event) {
13 | var touch = event.touches[0];
14 | this.deltaX = touch.clientX - this.startX;
15 | this.deltaY = touch.clientY - this.startY;
16 | this.offsetX = Math.abs(this.deltaX);
17 | this.offsetY = Math.abs(this.deltaY);
18 | this.direction = this.offsetX > this.offsetY ? 'horizontal' : this.offsetX < this.offsetY ? 'vertical' : '';
19 | }
20 | }
21 | });
--------------------------------------------------------------------------------
/static/vant/mixins/transition.js:
--------------------------------------------------------------------------------
1 | export var transition = function transition(showDefaultValue) {
2 | return Behavior({
3 | properties: {
4 | customStyle: String,
5 | show: {
6 | type: Boolean,
7 | value: showDefaultValue,
8 | observer: 'observeShow'
9 | },
10 | duration: {
11 | type: Number,
12 | value: 300
13 | }
14 | },
15 | data: {
16 | type: '',
17 | inited: false,
18 | display: false
19 | },
20 | attached: function attached() {
21 | if (this.data.show) {
22 | this.show();
23 | }
24 | },
25 | methods: {
26 | observeShow: function observeShow(value) {
27 | if (value) {
28 | this.show();
29 | } else {
30 | this.setData({
31 | type: 'leave'
32 | });
33 | }
34 | },
35 | show: function show() {
36 | this.setData({
37 | inited: true,
38 | display: true,
39 | type: 'enter'
40 | });
41 | },
42 | onAnimationEnd: function onAnimationEnd() {
43 | if (!this.data.show) {
44 | this.setData({
45 | display: false
46 | });
47 | }
48 | }
49 | }
50 | });
51 | };
--------------------------------------------------------------------------------
/static/vant/nav-bar/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | classes: ['title-class'],
4 | props: {
5 | title: String,
6 | leftText: String,
7 | rightText: String,
8 | leftArrow: Boolean,
9 | fixed: Boolean,
10 | zIndex: {
11 | type: Number,
12 | value: 1
13 | }
14 | },
15 | methods: {
16 | onClickLeft: function onClickLeft() {
17 | this.$emit('click-left');
18 | },
19 | onClickRight: function onClickRight() {
20 | this.$emit('click-right');
21 | }
22 | }
23 | });
--------------------------------------------------------------------------------
/static/vant/nav-bar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/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/nav-bar/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-nav-bar{height:46px;position:relative;-webkit-user-select:none;user-select:none;text-align:center;line-height:46px;background-color:#fff}.van-nav-bar__arrow{color:#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/notice-bar/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | var FONT_COLOR = '#f60';
3 | var BG_COLOR = '#fff7cc';
4 | VantComponent({
5 | props: {
6 | text: {
7 | type: String,
8 | value: ''
9 | },
10 | mode: {
11 | type: String,
12 | value: ''
13 | },
14 | url: {
15 | type: String,
16 | value: ''
17 | },
18 | openType: {
19 | type: String,
20 | value: 'navigate'
21 | },
22 | delay: {
23 | type: Number,
24 | value: 0
25 | },
26 | speed: {
27 | type: Number,
28 | value: 50
29 | },
30 | scrollable: {
31 | type: Boolean,
32 | value: true
33 | },
34 | leftIcon: {
35 | type: String,
36 | value: ''
37 | },
38 | color: {
39 | type: String,
40 | value: FONT_COLOR
41 | },
42 | backgroundColor: {
43 | type: String,
44 | value: BG_COLOR
45 | }
46 | },
47 | data: {
48 | show: true,
49 | hasRightIcon: false,
50 | width: undefined,
51 | wrapWidth: undefined,
52 | elapse: undefined,
53 | animation: null,
54 | resetAnimation: null,
55 | timer: null
56 | },
57 | watch: {
58 | text: function text() {
59 | this.setData({}, this.init);
60 | }
61 | },
62 | created: function created() {
63 | if (this.data.mode) {
64 | this.setData({
65 | hasRightIcon: true
66 | });
67 | }
68 | },
69 | destroyed: function destroyed() {
70 | var timer = this.data.timer;
71 | timer && clearTimeout(timer);
72 | },
73 | methods: {
74 | init: function init() {
75 | var _this = this;
76 |
77 | this.getRect('.van-notice-bar__content').then(function (rect) {
78 | if (!rect || !rect.width) {
79 | return;
80 | }
81 |
82 | _this.setData({
83 | width: rect.width
84 | });
85 |
86 | _this.getRect('.van-notice-bar__content-wrap').then(function (rect) {
87 | if (!rect || !rect.width) {
88 | return;
89 | }
90 |
91 | var wrapWidth = rect.width;
92 | var _this$data = _this.data,
93 | width = _this$data.width,
94 | speed = _this$data.speed,
95 | scrollable = _this$data.scrollable,
96 | delay = _this$data.delay;
97 |
98 | if (scrollable && wrapWidth < width) {
99 | var elapse = width / speed * 1000;
100 | var animation = wx.createAnimation({
101 | duration: elapse,
102 | timeingFunction: 'linear',
103 | delay: delay
104 | });
105 | var resetAnimation = wx.createAnimation({
106 | duration: 0,
107 | timeingFunction: 'linear'
108 | });
109 |
110 | _this.setData({
111 | elapse: elapse,
112 | wrapWidth: wrapWidth,
113 | animation: animation,
114 | resetAnimation: resetAnimation
115 | }, function () {
116 | _this.scroll();
117 | });
118 | }
119 | });
120 | });
121 | },
122 | scroll: function scroll() {
123 | var _this2 = this;
124 |
125 | var _this$data2 = this.data,
126 | animation = _this$data2.animation,
127 | resetAnimation = _this$data2.resetAnimation,
128 | wrapWidth = _this$data2.wrapWidth,
129 | elapse = _this$data2.elapse,
130 | speed = _this$data2.speed;
131 | resetAnimation.translateX(wrapWidth).step();
132 | var animationData = animation.translateX(-(elapse * speed) / 1000).step();
133 | this.setData({
134 | animationData: resetAnimation.export()
135 | });
136 | setTimeout(function () {
137 | _this2.setData({
138 | animationData: animationData.export()
139 | });
140 | }, 100);
141 | var timer = setTimeout(function () {
142 | _this2.scroll();
143 | }, elapse);
144 | this.setData({
145 | timer: timer
146 | });
147 | },
148 | onClickIcon: function onClickIcon() {
149 | var timer = this.data.timer;
150 | timer && clearTimeout(timer);
151 | this.setData({
152 | show: false,
153 | timer: null
154 | });
155 | },
156 | onClick: function onClick(event) {
157 | this.$emit('click', event);
158 | }
159 | }
160 | });
--------------------------------------------------------------------------------
/static/vant/notice-bar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
--------------------------------------------------------------------------------
/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/notice-bar/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-notice-bar{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-flex:1;flex:1;height:18px;overflow:hidden}.van-notice-bar__content{position:absolute;white-space:nowrap}
--------------------------------------------------------------------------------
/static/vant/notify/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | text: String,
5 | color: {
6 | type: String,
7 | value: '#fff'
8 | },
9 | backgroundColor: {
10 | type: String,
11 | value: '#e64340'
12 | },
13 | duration: {
14 | type: Number,
15 | value: 3000
16 | }
17 | },
18 | methods: {
19 | show: function show() {
20 | var _this = this;
21 |
22 | var duration = this.data.duration;
23 | clearTimeout(this.timer);
24 | this.setData({
25 | show: true
26 | });
27 |
28 | if (duration > 0 && duration !== Infinity) {
29 | this.timer = setTimeout(function () {
30 | _this.hide();
31 | }, duration);
32 | }
33 | },
34 | hide: function hide() {
35 | clearTimeout(this.timer);
36 | this.setData({
37 | show: false
38 | });
39 | }
40 | }
41 | });
--------------------------------------------------------------------------------
/static/vant/notify/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-transition": "../transition/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/notify/index.wxml:
--------------------------------------------------------------------------------
1 |
7 | {{ text }}
8 |
9 |
--------------------------------------------------------------------------------
/static/vant/notify/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.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/notify/notify.js:
--------------------------------------------------------------------------------
1 | import { isObj } from '../common/utils';
2 | var defaultOptions = {
3 | selector: '#van-notify',
4 | duration: 3000
5 | };
6 |
7 | function parseOptions(text) {
8 | return isObj(text) ? text : {
9 | text: text
10 | };
11 | }
12 |
13 | export default function Notify(options) {
14 | if (options === void 0) {
15 | options = {};
16 | }
17 |
18 | var pages = getCurrentPages();
19 | var ctx = pages[pages.length - 1];
20 | options = Object.assign({}, defaultOptions, parseOptions(options));
21 | var el = ctx.selectComponent(options.selector);
22 | delete options.selector;
23 |
24 | if (el) {
25 | el.setData(options);
26 | el.show();
27 | }
28 | }
--------------------------------------------------------------------------------
/static/vant/overlay/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | show: Boolean,
5 | mask: Boolean,
6 | customStyle: String,
7 | zIndex: {
8 | type: Number,
9 | value: 1
10 | }
11 | },
12 | methods: {
13 | onClick: function onClick() {
14 | this.$emit('click');
15 | },
16 | // for prevent touchmove
17 | noop: function noop() {}
18 | }
19 | });
--------------------------------------------------------------------------------
/static/vant/overlay/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-transition": "../transition/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/overlay/index.wxml:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/static/vant/overlay/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-overlay{position:fixed;top:0;left:0;right:0;bottom:0}
--------------------------------------------------------------------------------
/static/vant/panel/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | classes: ['footer-class'],
4 | props: {
5 | desc: String,
6 | title: String,
7 | status: String,
8 | headerClass: String,
9 | useFooterSlot: Boolean
10 | }
11 | });
--------------------------------------------------------------------------------
/static/vant/panel/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-cell": "../cell/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/panel/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
--------------------------------------------------------------------------------
/static/vant/panel/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-panel{background:#fff}.van-panel__header-value{color:#f44}.van-panel__footer{padding:10px 15px}
--------------------------------------------------------------------------------
/static/vant/popup/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | import { transition } from '../mixins/transition';
3 | VantComponent({
4 | mixins: [transition(false)],
5 | props: {
6 | transition: String,
7 | customStyle: String,
8 | overlayStyle: String,
9 | zIndex: {
10 | type: Number,
11 | value: 100
12 | },
13 | overlay: {
14 | type: Boolean,
15 | value: true
16 | },
17 | closeOnClickOverlay: {
18 | type: Boolean,
19 | value: true
20 | },
21 | position: {
22 | type: String,
23 | value: 'center'
24 | }
25 | },
26 | methods: {
27 | onClickOverlay: function onClickOverlay() {
28 | this.$emit('click-overlay');
29 |
30 | if (this.data.closeOnClickOverlay) {
31 | this.$emit('close');
32 | }
33 | }
34 | }
35 | });
--------------------------------------------------------------------------------
/static/vant/popup/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-overlay": "../overlay/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/popup/index.wxml:
--------------------------------------------------------------------------------
1 |
8 |
16 |
--------------------------------------------------------------------------------
/static/vant/popup/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-popup{top:50%;left:50%;position:fixed;max-height:100%;overflow-y:auto;box-sizing:border-box;background-color:#fff;-webkit-overflow-scrolling:touch;-webkit-animation:ease both;animation:ease both}.van-popup--center{-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.van-popup--top{width:100%;top:0;right:auto;bottom:auto;left:50%}.van-popup--right{top:50%;right:0;bottom:auto;left:auto}.van-popup--bottom{width:100%;top:auto;bottom:0;right:auto;left:50%}.van-popup--left{top:50%;right:auto;bottom:auto;left:0}@-webkit-keyframes van-center-enter{from{opacity:0}}@keyframes van-center-enter{from{opacity:0}}@-webkit-keyframes van-center-leave{to{opacity:0}}@keyframes van-center-leave{to{opacity:0}}@-webkit-keyframes van-scale-enter{from{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7)}}@keyframes van-scale-enter{from{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7)}}@-webkit-keyframes van-scale-leave{to{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7)}}@keyframes van-scale-leave{to{opacity:0;-webkit-transform:translate3d(-50%,-50%,0) scale(.7);transform:translate3d(-50%,-50%,0) scale(.7)}}@-webkit-keyframes van-bottom-enter{from{-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}to{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}}@keyframes van-bottom-enter{from{-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}to{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}}@-webkit-keyframes van-bottom-leave{from{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}to{-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}}@keyframes van-bottom-leave{from{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}to{-webkit-transform:translate3d(-50%,100%,0);transform:translate3d(-50%,100%,0)}}@-webkit-keyframes van-top-enter{from{-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}to{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}}@keyframes van-top-enter{from{-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}to{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}}@-webkit-keyframes van-top-leave{from{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}to{-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}}@keyframes van-top-leave{from{-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}to{-webkit-transform:translate3d(-50%,-100%,0);transform:translate3d(-50%,-100%,0)}}@-webkit-keyframes van-left-enter{from{-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}to{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}}@keyframes van-left-enter{from{-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}to{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}}@-webkit-keyframes van-left-leave{from{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}to{-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}}@keyframes van-left-leave{from{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}to{-webkit-transform:translate3d(-100%,-50%,0);transform:translate3d(-100%,-50%,0)}}@-webkit-keyframes van-right-enter{from{-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}to{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}}@keyframes van-right-enter{from{-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}to{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}}@-webkit-keyframes van-right-leave{from{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}to{-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}}@keyframes van-right-leave{from{-webkit-transform:translate3d(0,-50%,0);transform:translate3d(0,-50%,0)}to{-webkit-transform:translate3d(100%,-50%,0);transform:translate3d(100%,-50%,0)}}
--------------------------------------------------------------------------------
/static/vant/progress/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | inactive: Boolean,
5 | percentage: Number,
6 | pivotText: String,
7 | pivotColor: String,
8 | showPivot: {
9 | type: Boolean,
10 | value: true
11 | },
12 | color: {
13 | type: String,
14 | value: '#38f'
15 | },
16 | textColor: {
17 | type: String,
18 | value: '#fff'
19 | }
20 | },
21 | data: {
22 | pivotWidth: 0,
23 | progressWidth: 0
24 | },
25 | watch: {
26 | pivotText: 'getWidth',
27 | showPivot: 'getWidth'
28 | },
29 | computed: {
30 | portionStyle: function portionStyle() {
31 | var width = (this.data.progressWidth - this.data.pivotWidth) * this.data.percentage / 100 + 'px';
32 | var background = this.getCurrentColor();
33 | return "width: " + width + "; background: " + background + "; ";
34 | },
35 | pivotStyle: function pivotStyle() {
36 | var color = this.data.textColor;
37 | var background = this.data.pivotColor || this.getCurrentColor();
38 | return "color: " + color + "; background: " + background;
39 | },
40 | text: function text() {
41 | return this.data.pivotText || this.data.percentage + '%';
42 | }
43 | },
44 | mounted: function mounted() {
45 | this.getWidth();
46 | },
47 | methods: {
48 | getCurrentColor: function getCurrentColor() {
49 | return this.data.inactive ? '#cacaca' : this.data.color;
50 | },
51 | getWidth: function getWidth() {
52 | var _this = this;
53 |
54 | this.getRect('.van-progress').then(function (rect) {
55 | _this.setData({
56 | progressWidth: rect.width
57 | });
58 | });
59 | this.getRect('.van-progress__pivot').then(function (rect) {
60 | _this.setData({
61 | pivotWidth: rect.width || 0
62 | });
63 | });
64 | }
65 | }
66 | });
--------------------------------------------------------------------------------
/static/vant/progress/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/progress/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 | {{ text }}
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/static/vant/progress/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-progress{height:4px;position:relative;border-radius:4px;background:#e5e5e5}.van-progress__portion{left:0;height:100%;position:absolute;border-radius:inherit}.van-progress__portion--with-pivot{border-top-right-radius:0;border-bottom-right-radius:0}.van-progress__pivot{top:50%;right:0;min-width:2em;padding:0 5px;font-size:10px;position:absolute;line-height:1.6;text-align:center;border-radius:1em;word-break:keep-all;box-sizing:border-box;background-color:#e5e5e5;-webkit-transform:translate(100%,-50%);transform:translate(100%,-50%)}
--------------------------------------------------------------------------------
/static/vant/radio-group/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'radio',
5 | type: 'descendant',
6 | linked: function linked(target) {
7 | var _this$data = this.data,
8 | value = _this$data.value,
9 | disabled = _this$data.disabled;
10 | target.setData({
11 | value: value,
12 | disabled: disabled || target.data.disabled
13 | });
14 | }
15 | },
16 | props: {
17 | value: null,
18 | disabled: Boolean
19 | },
20 | watch: {
21 | value: function value(_value) {
22 | var children = this.getRelationNodes('../radio/index');
23 | children.forEach(function (child) {
24 | child.setData({
25 | value: _value
26 | });
27 | });
28 | },
29 | disabled: function disabled(_disabled) {
30 | var children = this.getRelationNodes('../radio/index');
31 | children.forEach(function (child) {
32 | child.setData({
33 | disabled: _disabled || child.data.disabled
34 | });
35 | });
36 | }
37 | }
38 | });
--------------------------------------------------------------------------------
/static/vant/radio-group/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/radio-group/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/vant/radio-group/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';
--------------------------------------------------------------------------------
/static/vant/radio/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'radio-group',
5 | type: 'ancestor'
6 | },
7 | classes: ['icon-class', 'label-class'],
8 | props: {
9 | name: null,
10 | value: null,
11 | disabled: Boolean,
12 | labelDisabled: Boolean,
13 | labelPosition: String
14 | },
15 | computed: {
16 | iconClass: function iconClass() {
17 | var _this$data = this.data,
18 | disabled = _this$data.disabled,
19 | name = _this$data.name,
20 | value = _this$data.value;
21 | return this.classNames('van-radio__icon', {
22 | 'van-radio__icon--disabled': disabled,
23 | 'van-radio__icon--checked': !disabled && name === value,
24 | 'van-radio__icon--check': !disabled && name !== value
25 | });
26 | }
27 | },
28 | methods: {
29 | emitChange: function emitChange(value) {
30 | var instance = this.getRelationNodes('../radio-group/index')[0] || this;
31 | instance.$emit('input', value);
32 | instance.$emit('change', value);
33 | },
34 | onChange: function onChange(event) {
35 | this.emitChange(event.detail.value);
36 | },
37 | onClickLabel: function onClickLabel() {
38 | if (!this.data.disabled && !this.data.labelDisabled) {
39 | this.emitChange(this.data.name);
40 | }
41 | }
42 | }
43 | });
--------------------------------------------------------------------------------
/static/vant/radio/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/radio/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/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/row/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'col',
5 | type: 'descendant',
6 | linked: function linked(target) {
7 | if (this.data.gutter) {
8 | target.setGutter(this.data.gutter);
9 | }
10 | }
11 | },
12 | props: {
13 | gutter: Number
14 | },
15 | watch: {
16 | gutter: 'setGutter'
17 | },
18 | mounted: function mounted() {
19 | if (this.data.gutter) {
20 | this.setGutter();
21 | }
22 | },
23 | methods: {
24 | setGutter: function setGutter() {
25 | var _this = this;
26 |
27 | var gutter = this.data.gutter;
28 | var margin = "-" + Number(gutter) / 2 + "px";
29 | var style = gutter ? "margin-right: " + margin + "; margin-left: " + margin + ";" : '';
30 | this.setData({
31 | style: style
32 | });
33 | this.getRelationNodes('../col/index').forEach(function (col) {
34 | col.setGutter(_this.data.gutter);
35 | });
36 | }
37 | }
38 | });
--------------------------------------------------------------------------------
/static/vant/row/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/row/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/static/vant/row/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-row::after{content:"";display:table;clear:both}
--------------------------------------------------------------------------------
/static/vant/search/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | field: true,
4 | classes: ['cancel-class'],
5 | props: {
6 | focus: Boolean,
7 | disabled: Boolean,
8 | readonly: Boolean,
9 | showAction: Boolean,
10 | useActionSlot: Boolean,
11 | placeholder: String,
12 | background: {
13 | type: String,
14 | value: '#f2f2f2'
15 | },
16 | maxlength: {
17 | type: Number,
18 | value: -1
19 | }
20 | },
21 | methods: {
22 | onChange: function onChange(event) {
23 | this.setData({
24 | value: event.detail
25 | });
26 | this.$emit('change', event.detail);
27 | },
28 | onCancel: function onCancel() {
29 | this.setData({
30 | value: ''
31 | });
32 | this.$emit('cancel');
33 | this.$emit('change', '');
34 | },
35 | onSearch: function onSearch() {
36 | this.$emit('search', this.data.value);
37 | },
38 | onFocus: function onFocus() {
39 | this.$emit('focus');
40 | },
41 | onBlur: function onBlur() {
42 | this.$emit('blur');
43 | }
44 | }
45 | });
--------------------------------------------------------------------------------
/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/search/index.wxml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
24 |
25 |
26 |
27 | 取消
28 |
29 |
30 |
--------------------------------------------------------------------------------
/static/vant/search/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-search{display:-webkit-flex;display:flex;padding:7px 15px;-webkit-align-items:center;align-items:center;box-sizing:border-box}.van-search__field{-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/slider/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | import { touch } from '../mixins/touch';
3 | VantComponent({
4 | mixins: [touch],
5 | props: {
6 | disabled: Boolean,
7 | max: {
8 | type: Number,
9 | value: 100
10 | },
11 | min: {
12 | type: Number,
13 | value: 0
14 | },
15 | step: {
16 | type: Number,
17 | value: 1
18 | },
19 | value: {
20 | type: Number,
21 | value: 0
22 | },
23 | barHeight: {
24 | type: String,
25 | value: '2px'
26 | }
27 | },
28 | created: function created() {
29 | this.updateValue(this.data.value);
30 | },
31 | methods: {
32 | onTouchStart: function onTouchStart(event) {
33 | if (this.data.disabled) return;
34 | this.touchStart(event);
35 | this.startValue = this.format(this.data.value);
36 | },
37 | onTouchMove: function onTouchMove(event) {
38 | var _this = this;
39 |
40 | if (this.data.disabled) return;
41 | this.touchMove(event);
42 | this.getRect('.van-slider').then(function (rect) {
43 | var diff = _this.deltaX / rect.width * 100;
44 |
45 | _this.updateValue(_this.startValue + diff);
46 | });
47 | },
48 | onTouchEnd: function onTouchEnd() {
49 | if (this.data.disabled) return;
50 | this.updateValue(this.data.value, true);
51 | },
52 | onClick: function onClick(event) {
53 | var _this2 = this;
54 |
55 | if (this.data.disabled) return;
56 | this.getRect(function (rect) {
57 | var value = (event.detail.x - rect.left) / rect.width * 100;
58 |
59 | _this2.updateValue(value, true);
60 | });
61 | },
62 | updateValue: function updateValue(value, end) {
63 | value = this.format(value);
64 | this.setData({
65 | value: value,
66 | barStyle: "width: " + value + "%; height: " + this.data.barHeight + ";"
67 | });
68 |
69 | if (end) {
70 | this.$emit('change', value);
71 | }
72 | },
73 | format: function format(value) {
74 | var _this$data = this.data,
75 | max = _this$data.max,
76 | min = _this$data.min,
77 | step = _this$data.step;
78 | return Math.round(Math.max(min, Math.min(value, max)) / step) * step;
79 | }
80 | }
81 | });
--------------------------------------------------------------------------------
/static/vant/slider/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/slider/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/static/vant/slider/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-slider{position:relative;border-radius:999px;background-color:#e5e5e5}.van-slider__bar{position:relative;border-radius:inherit;background-color:#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}
--------------------------------------------------------------------------------
/static/vant/stepper/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component'; // Note that the bitwise operators and shift operators operate on 32-bit ints
2 | // so in that case, the max safe integer is 2^31-1, or 2147483647
3 |
4 | var MAX = 2147483647;
5 | VantComponent({
6 | field: true,
7 | classes: ['input-class', 'plus-class', 'minus-class'],
8 | props: {
9 | integer: Boolean,
10 | disabled: Boolean,
11 | disableInput: Boolean,
12 | min: {
13 | type: null,
14 | value: 1
15 | },
16 | max: {
17 | type: null,
18 | value: MAX
19 | },
20 | step: {
21 | type: null,
22 | value: 1
23 | }
24 | },
25 | created: function created() {
26 | this.setData({
27 | value: this.range(this.data.value)
28 | });
29 | },
30 | methods: {
31 | // limit value range
32 | range: function range(value) {
33 | return Math.max(Math.min(this.data.max, value), this.data.min);
34 | },
35 | onInput: function onInput(event) {
36 | var _ref = event.detail || {},
37 | _ref$value = _ref.value,
38 | value = _ref$value === void 0 ? '' : _ref$value;
39 |
40 | this.triggerInput(value);
41 | },
42 | onChange: function onChange(type) {
43 | if (this[type + "Disabled"]) {
44 | this.$emit('overlimit', type);
45 | return;
46 | }
47 |
48 | var diff = type === 'minus' ? -this.data.step : +this.data.step;
49 | var value = Math.round((this.data.value + diff) * 100) / 100;
50 | this.triggerInput(this.range(value));
51 | this.$emit(type);
52 | },
53 | onBlur: function onBlur(event) {
54 | var value = this.range(this.data.value);
55 | this.triggerInput(value);
56 | this.$emit('blur', event);
57 | },
58 | onMinus: function onMinus() {
59 | this.onChange('minus');
60 | },
61 | onPlus: function onPlus() {
62 | this.onChange('plus');
63 | },
64 | triggerInput: function triggerInput(value) {
65 | this.setData({
66 | value: value
67 | });
68 | this.$emit('change', value);
69 | }
70 | }
71 | });
--------------------------------------------------------------------------------
/static/vant/stepper/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/vant/stepper/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/static/vant/stepper/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-stepper{font-size:0}.van-stepper__input,.van-stepper__minus,.van-stepper__plus{display:inline-block;vertical-align:middle;background-color:#fff}.van-stepper__minus,.van-stepper__plus{width:40px;height:30px;box-sizing:border-box;border:1px solid #eee;position:relative;padding:5px}.van-stepper__minus::before,.van-stepper__plus::before{width:9px;height:1px}.van-stepper__minus::after,.van-stepper__plus::after{width:1px;height:9px}.van-stepper__minus::after,.van-stepper__minus::before,.van-stepper__plus::after,.van-stepper__plus::before{content:'';position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;background-color:#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 #eee;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/steps/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | icon: String,
5 | steps: Array,
6 | active: Number,
7 | direction: {
8 | type: String,
9 | value: 'horizontal'
10 | },
11 | activeColor: {
12 | type: String,
13 | value: '#06bf04'
14 | }
15 | },
16 | watch: {
17 | steps: 'formatSteps',
18 | active: 'formatSteps'
19 | },
20 | created: function created() {
21 | this.formatSteps();
22 | },
23 | methods: {
24 | formatSteps: function formatSteps() {
25 | var _this = this;
26 |
27 | var steps = this.data.steps;
28 | steps.forEach(function (step, index) {
29 | step.status = _this.getStatus(index);
30 | });
31 | this.setData({
32 | steps: steps
33 | });
34 | },
35 | getStatus: function getStatus(index) {
36 | var active = this.data.active;
37 |
38 | if (index < active) {
39 | return 'finish';
40 | } else if (index === active) {
41 | return 'process';
42 | }
43 |
44 | return '';
45 | }
46 | }
47 | });
--------------------------------------------------------------------------------
/static/vant/steps/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/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/steps/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-steps{overflow:hidden;background-color:#fff}.van-steps--horizontal{position:relative;display:-webkit-flex;display:flex;overflow:hidden;padding:10px 10px 15px}.van-steps--vertical{padding:0 0 0 35px}.van-step{position:relative;-webkit-flex:1;flex:1;font-size:14px;color:#999}.van-step--finish{color:#333}.van-step__circle{width:5px;height:5px;background-color:#999;border-radius:50%}.van-step--horizontal{padding-bottom:14px}.van-step--horizontal:first-child .van-step__title{-webkit-transform:none;transform:none}.van-step--horizontal:first-child .van-step__circle-container{padding:0 8px 0 0;-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}.van-step--horizontal:last-child{position:absolute;right:10px;width:auto}.van-step--horizontal:last-child .van-step__title{-webkit-transform:none;transform:none;text-align:right}.van-step--horizontal:last-child .van-step__circle-container{right:0;padding:0 0 0 8px;-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}.van-step--horizontal .van-step__circle-container{position:absolute;bottom:6px;z-index:1;padding:0 8px;background-color:#fff;-webkit-transform:translate3d(-50%,50%,0);transform:translate3d(-50%,50%,0)}.van-step--horizontal .van-step__title{display:inline-block;font-size:12px;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.van-step--horizontal .van-step__line{position:absolute;left:0;right:0;bottom:6px;height:1px;background-color:#eee;-webkit-transform:translate3d(0,50%,0);transform:translate3d(0,50%,0)}.van-step--horizontal.van-step--process{color:#333}.van-step--horizontal.van-step--process .van-step__active{display:block;font-size:12px;color:#06bf04;line-height:1}.van-step--vertical{font-size:14px;line-height:18px;padding:10px 10px 10px 0}.van-step--vertical:not(:last-child)::after{border-bottom-width:1px}.van-step--vertical:first-child::before{content:'';position:absolute;width:1px;height:20px;background-color:#fff;top:0;left:-15px;z-index:1}.van-step--vertical .van-step__active,.van-step--vertical .van-step__circle,.van-step--vertical .van-step__line{position:absolute;top:19px;left:-14px;z-index:2;-webkit-transform:translate3d(-50%,-50%,0);transform:translate3d(-50%,-50%,0)}.van-step--vertical .van-step__active{font-size:12px;line-height:1}.van-step--vertical .van-step__line{z-index:1;width:1px;height:100%;background-color:#eee;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}
--------------------------------------------------------------------------------
/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/submit-bar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-button": "../button/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/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/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;background-color:#fff7cc;color:#f85;font-size:12px;line-height:18px}.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}
--------------------------------------------------------------------------------
/static/vant/switch-cell/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | field: true,
4 | props: {
5 | title: String,
6 | border: Boolean,
7 | checked: Boolean,
8 | loading: Boolean,
9 | disabled: Boolean,
10 | size: {
11 | type: String,
12 | value: '26px'
13 | }
14 | },
15 | watch: {
16 | checked: function checked(value) {
17 | this.setData({
18 | value: value
19 | });
20 | }
21 | },
22 | created: function created() {
23 | this.setData({
24 | value: this.data.checked
25 | });
26 | },
27 | methods: {
28 | onChange: function onChange(event) {
29 | this.$emit('change', event.detail);
30 | }
31 | }
32 | });
--------------------------------------------------------------------------------
/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/switch-cell/index.wxml:
--------------------------------------------------------------------------------
1 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/static/vant/switch-cell/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-switch-cell{padding-top:8px;padding-bottom:8px}.van-switch-cell__switch{vertical-align:middle}
--------------------------------------------------------------------------------
/static/vant/switch/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | field: true,
4 | classes: ['node-class'],
5 | props: {
6 | checked: Boolean,
7 | loading: Boolean,
8 | disabled: Boolean,
9 | size: {
10 | type: String,
11 | value: '30px'
12 | }
13 | },
14 | watch: {
15 | checked: function checked(value) {
16 | this.setData({
17 | value: value
18 | });
19 | }
20 | },
21 | created: function created() {
22 | this.setData({
23 | value: this.data.checked
24 | });
25 | },
26 | methods: {
27 | onClick: function onClick() {
28 | if (!this.data.disabled && !this.data.loading) {
29 | var checked = !this.data.checked;
30 | this.$emit('input', checked);
31 | this.$emit('change', checked);
32 | }
33 | }
34 | }
35 | });
--------------------------------------------------------------------------------
/static/vant/switch/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-loading": "../loading/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/switch/index.wxml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/static/vant/switch/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.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;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/tab/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'tabs',
5 | type: 'ancestor'
6 | },
7 | props: {
8 | title: String,
9 | disabled: Boolean
10 | },
11 | data: {
12 | inited: false,
13 | active: false
14 | },
15 | watch: {
16 | disabled: function disabled() {
17 | var parent = this.getRelationNodes('../tabs/index')[0];
18 |
19 | if (parent) {
20 | parent.updateTabs();
21 | }
22 | },
23 | title: function title() {
24 | var parent = this.getRelationNodes('../tabs/index')[0];
25 |
26 | if (parent) {
27 | parent.setLine();
28 | parent.updateTabs();
29 | }
30 | }
31 | }
32 | });
--------------------------------------------------------------------------------
/static/vant/tab/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/vant/tab/index.wxml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/static/vant/tabbar-item/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | info: null,
5 | icon: String,
6 | dot: Boolean
7 | },
8 | relation: {
9 | name: 'tabbar',
10 | type: 'ancestor'
11 | },
12 | data: {
13 | active: false,
14 | count: 0
15 | },
16 | methods: {
17 | onClick: function onClick() {
18 | var parent = this.getRelationNodes('../tabbar/index')[0];
19 |
20 | if (parent) {
21 | parent.onChange(this);
22 | }
23 |
24 | this.$emit('click');
25 | },
26 | setActive: function setActive(data) {
27 | var _this$data = this.data,
28 | active = _this$data.active,
29 | count = _this$data.count;
30 |
31 | if (active !== data.active || count !== data.count) {
32 | this.setData(data);
33 | }
34 | }
35 | }
36 | });
--------------------------------------------------------------------------------
/static/vant/tabbar-item/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/static/vant/tabbar-item/index.wxml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/static/vant/tabbar-item/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-tabbar-item{float:left;color:#666;height:100%;display:-webkit-flex;display:flex;line-height:1;font-size:12px;-webkit-align-items:center;align-items:center;-webkit-flex-direction:column;flex-direction:column;-webkit-justify-content:center;justify-content:center}.van-tabbar-item__icon{font-size:18px;margin-bottom:5px;position:relative}.van-tabbar-item__icon .van-icon{display:block}.van-tabbar-item__icon--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/tabbar/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | relation: {
4 | name: 'tabbar-item',
5 | type: 'descendant',
6 | linked: function linked(target) {
7 | var _this = this;
8 |
9 | this.data.items.push(target);
10 | setTimeout(function () {
11 | _this.setActiveItem();
12 | });
13 | },
14 | unlinked: function unlinked(target) {
15 | var _this2 = this;
16 |
17 | this.data.items = this.data.items.filter(function (item) {
18 | return item !== target;
19 | });
20 | setTimeout(function () {
21 | _this2.setActiveItem();
22 | });
23 | }
24 | },
25 | props: {
26 | active: Number,
27 | fixed: {
28 | type: Boolean,
29 | value: true
30 | },
31 | zIndex: {
32 | type: Number,
33 | value: 1
34 | }
35 | },
36 | data: {
37 | items: [],
38 | currentActive: -1
39 | },
40 | watch: {
41 | active: function active(_active) {
42 | this.setData({
43 | currentActive: _active
44 | });
45 | this.setActiveItem();
46 | }
47 | },
48 | created: function created() {
49 | this.setData({
50 | currentActive: this.data.active
51 | });
52 | },
53 | methods: {
54 | setActiveItem: function setActiveItem() {
55 | var _this3 = this;
56 |
57 | this.data.items.forEach(function (item, index) {
58 | item.setActive({
59 | active: index === _this3.data.currentActive,
60 | count: _this3.data.items.length
61 | });
62 | });
63 | },
64 | onChange: function onChange(child) {
65 | var active = this.data.items.indexOf(child);
66 |
67 | if (active !== this.data.currentActive && active !== -1) {
68 | this.$emit('change', active);
69 | this.setData({
70 | currentActive: active
71 | });
72 | this.setActiveItem();
73 | }
74 | }
75 | }
76 | });
--------------------------------------------------------------------------------
/static/vant/tabbar/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
4 |
--------------------------------------------------------------------------------
/static/vant/tabbar/index.wxml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/static/vant/tabbar/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-tabbar{width:100%;height:50px;background-color:#fff}.van-tabbar--fixed{left:0;bottom:0;position:fixed}
--------------------------------------------------------------------------------
/static/vant/tabs/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/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/tabs/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-tabs{position:relative;-webkit-tap-highlight-color:transparent}.van-tabs__wrap{top:0;left:0;right:0;z-index:99;position:absolute}.van-tabs__wrap--page-top{position:fixed}.van-tabs__wrap--content-bottom{top:auto;bottom:0}.van-tabs__wrap--scrollable .van-tab{-webkit-flex:0 0 22%;flex:0 0 22%}.van-tabs__nav{display:-webkit-flex;display:flex;-webkit-user-select:none;user-select:none;position:relative;background-color:#fff}.van-tabs__nav--line{height:100%}.van-tabs__nav--card{margin:0 15px;border-radius:2px;box-sizing:border-box;border:1px solid #f44;height:30px}.van-tabs__nav--card .van-tab{color:#f44;border-right:1px solid #f44;line-height:28px}.van-tabs__nav--card .van-tab:last-child{border-right:none}.van-tabs__nav--card .van-tab.van-tab--active{color:#fff;background-color:#f44}.van-tabs__line{z-index:1;left:0;bottom:0;height:2px;position:absolute;background-color:#f44}.van-tabs--line{padding-top:44px}.van-tabs--line .van-tabs__wrap{height:44px}.van-tabs--card{padding-top:30px}.van-tabs--card .van-tabs__wrap{height:30px}.van-tab{-webkit-flex:1;flex:1;cursor:pointer;padding:0 5px;font-size:14px;position:relative;color:#333;line-height:44px;text-align:center;box-sizing:border-box;background-color:#fff;min-width:0}.van-tab span{display:block}.van-tab--active{color:#f44}.van-tab--disabled{color:#c9c9c9}
--------------------------------------------------------------------------------
/static/vant/tag/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | type: String,
5 | mark: Boolean,
6 | plain: Boolean
7 | }
8 | });
--------------------------------------------------------------------------------
/static/vant/tag/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/vant/tag/index.wxml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/static/vant/tag/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.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/toast/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | VantComponent({
3 | props: {
4 | show: Boolean,
5 | mask: Boolean,
6 | message: String,
7 | forbidClick: Boolean,
8 | zIndex: {
9 | type: Number,
10 | value: 1000
11 | },
12 | type: {
13 | type: String,
14 | value: 'text'
15 | },
16 | loadingType: {
17 | type: String,
18 | value: 'circular'
19 | },
20 | position: {
21 | type: String,
22 | value: 'middle'
23 | }
24 | },
25 | methods: {
26 | clear: function clear() {
27 | this.setData({
28 | show: false
29 | });
30 | },
31 | // for prevent touchmove
32 | noop: function noop() {}
33 | }
34 | });
--------------------------------------------------------------------------------
/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/toast/index.wxml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
15 |
16 | {{ message }}
17 |
18 |
19 |
20 |
26 |
27 | {{ message }}
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/static/vant/toast/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-toast{display:-webkit-flex;display:flex;color:#fff;font-size:12px;line-height:1.2;border-radius:5px;word-break:break-all;-webkit-align-items:center;align-items:center;-webkit-justify-content:center;justify-content:center;-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%;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/toast/toast.js:
--------------------------------------------------------------------------------
1 | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2 |
3 | import { isObj } from '../common/utils';
4 | var defaultOptions = {
5 | type: 'text',
6 | mask: false,
7 | message: '',
8 | show: true,
9 | zIndex: 1000,
10 | duration: 3000,
11 | position: 'middle',
12 | forbidClick: false,
13 | loadingType: 'circular',
14 | selector: '#van-toast'
15 | };
16 | var queue = [];
17 |
18 | var currentOptions = _extends({}, defaultOptions);
19 |
20 | function parseOptions(message) {
21 | return isObj(message) ? message : {
22 | message: message
23 | };
24 | }
25 |
26 | var Toast = function Toast(options) {
27 | if (options === void 0) {
28 | options = {};
29 | }
30 |
31 | options = _extends({}, currentOptions, parseOptions(options));
32 | var pages = getCurrentPages();
33 | var ctx = pages[pages.length - 1];
34 | var toast = ctx.selectComponent(options.selector);
35 | delete options.selector;
36 | queue.push(toast);
37 | toast.setData(options);
38 | clearTimeout(toast.timer);
39 |
40 | if (options.duration > 0) {
41 | toast.timer = setTimeout(function () {
42 | toast.clear();
43 | queue = queue.filter(function (item) {
44 | return item !== toast;
45 | });
46 | }, options.duration);
47 | }
48 |
49 | return toast;
50 | };
51 |
52 | var createMethod = function createMethod(type) {
53 | return function (options) {
54 | return Toast(_extends({
55 | type: type
56 | }, parseOptions(options)));
57 | };
58 | };
59 |
60 | ['loading', 'success', 'fail'].forEach(function (method) {
61 | Toast[method] = createMethod(method);
62 | });
63 |
64 | Toast.clear = function () {
65 | queue.forEach(function (toast) {
66 | toast.clear();
67 | });
68 | queue = [];
69 | };
70 |
71 | Toast.setDefaultOptions = function (options) {
72 | Object.assign(currentOptions, options);
73 | };
74 |
75 | Toast.resetDefaultOptions = function () {
76 | currentOptions = _extends({}, defaultOptions);
77 | };
78 |
79 | export default Toast;
--------------------------------------------------------------------------------
/static/vant/transition/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | import { transition } from '../mixins/transition';
3 | VantComponent({
4 | mixins: [transition(true)],
5 | props: {
6 | name: {
7 | type: String,
8 | value: 'fade'
9 | }
10 | }
11 | });
--------------------------------------------------------------------------------
/static/vant/transition/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/vant/transition/index.wxml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/static/vant/transition/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.van-transition{-webkit-animation:ease both;animation:ease both}@-webkit-keyframes van-fade-enter{from{opacity:0}to{opacity:1}}@keyframes van-fade-enter{from{opacity:0}to{opacity:1}}@-webkit-keyframes van-fade-leave{from{opacity:1}to{opacity:0}}@keyframes van-fade-leave{from{opacity:1}to{opacity:0}}@-webkit-keyframes van-fade-up-enter{from{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-fade-up-enter{from{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-up-leave{to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-fade-up-leave{to{opacity:0;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-up-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-up-enter{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-slide-up-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes van-slide-up-leave{to{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes van-fade-down-enter{from{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes van-fade-down-enter{from{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@-webkit-keyframes van-fade-down-leave{to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes van-fade-down-leave{to{opacity:0;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@-webkit-keyframes van-slide-down-enter{from{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes van-slide-down-enter{from{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@-webkit-keyframes van-slide-down-leave{to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes van-slide-down-leave{to{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@-webkit-keyframes van-fade-left-enter{from{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes van-fade-left-enter{from{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@-webkit-keyframes van-fade-left-leave{to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes van-fade-left-leave{to{opacity:0;-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@-webkit-keyframes van-slide-left-enter{from{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes van-slide-left-enter{from{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@-webkit-keyframes van-slide-left-leave{to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@keyframes van-slide-left-leave{to{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0)}}@-webkit-keyframes van-fade-right-enter{from{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes van-fade-right-enter{from{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@-webkit-keyframes van-fade-right-leave{to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes van-fade-right-leave{to{opacity:0;-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@-webkit-keyframes van-slide-right-enter{from{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes van-slide-right-enter{from{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@-webkit-keyframes van-slide-right-leave{to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}@keyframes van-slide-right-leave{to{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0)}}
--------------------------------------------------------------------------------
/static/vant/tree-select/index.js:
--------------------------------------------------------------------------------
1 | import { VantComponent } from '../common/component';
2 | var ITEM_HEIGHT = 44;
3 | VantComponent({
4 | props: {
5 | items: Array,
6 | mainActiveIndex: {
7 | type: Number,
8 | value: 0
9 | },
10 | activeId: {
11 | type: Number,
12 | value: 0
13 | },
14 | maxHeight: {
15 | type: Number,
16 | value: 300
17 | }
18 | },
19 | data: {
20 | subItems: [],
21 | mainHeight: 0,
22 | itemHeight: 0
23 | },
24 | watch: {
25 | items: function items() {
26 | this.updateSubItems();
27 | this.updateMainHeight();
28 | },
29 | maxHeight: function maxHeight() {
30 | this.updateItemHeight();
31 | this.updateMainHeight();
32 | },
33 | mainActiveIndex: 'updateSubItems'
34 | },
35 | methods: {
36 | // 当一个子项被选择时
37 | onSelectItem: function onSelectItem(event) {
38 | this.$emit('click-item', event.currentTarget.dataset.item);
39 | },
40 | // 当一个导航被点击时
41 | onClickNav: function onClickNav(event) {
42 | var index = event.currentTarget.dataset.index;
43 | this.$emit('click-nav', {
44 | index: index
45 | });
46 | },
47 | // 更新子项列表
48 | updateSubItems: function updateSubItems() {
49 | var selectedItem = this.data.items[this.data.mainActiveIndex] || {};
50 | this.setData({
51 | subItems: selectedItem.children || []
52 | });
53 | this.updateItemHeight();
54 | },
55 | // 更新组件整体高度,根据最大高度和当前组件需要展示的高度来决定
56 | updateMainHeight: function updateMainHeight() {
57 | var maxHeight = Math.max(this.data.items.length * ITEM_HEIGHT, this.data.subItems.length * ITEM_HEIGHT);
58 | this.setData({
59 | mainHeight: Math.min(maxHeight, this.data.maxHeight)
60 | });
61 | },
62 | // 更新子项列表高度,根据可展示的最大高度和当前子项列表的高度决定
63 | updateItemHeight: function updateItemHeight() {
64 | this.setData({
65 | itemHeight: Math.min(this.data.subItems.length * ITEM_HEIGHT, this.data.maxHeight)
66 | });
67 | }
68 | }
69 | });
--------------------------------------------------------------------------------
/static/vant/tree-select/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true,
3 | "usingComponents": {
4 | "van-icon": "../icon/index"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/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/tree-select/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/index.wxss';.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/wux/circle/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "component": true
3 | }
--------------------------------------------------------------------------------
/static/wux/circle/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/static/wux/circle/index.wxss:
--------------------------------------------------------------------------------
1 | .wux-circle {
2 | display: inline-block;
3 | position: relative;
4 | }
5 | .wux-circle__inner {
6 | width: 100%;
7 | text-align: center;
8 | position: absolute;
9 | left: 0;
10 | top: 50%;
11 | -webkit-transform: translate3d(0, -50%, 0);
12 | transform: translate3d(0, -50%, 0);
13 | line-height: 1;
14 | }
15 |
--------------------------------------------------------------------------------