├── .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 | 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 | 25 | 26 | 60 | 61 | 104 | -------------------------------------------------------------------------------- /src/components/Null.vue: -------------------------------------------------------------------------------- 1 | /** 2 | Null组件 当页面没有数据时使用 3 | */ 4 | 5 | 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 | 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 | 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 | 22 | 23 | 54 | 55 | 98 | -------------------------------------------------------------------------------- /src/pages/user/UserInfo.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 66 | 67 | 113 | -------------------------------------------------------------------------------- /src/pages/user/index.vue: -------------------------------------------------------------------------------- 1 | 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 | 11 | {{ title }} 12 | 13 | 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 | 20 | 21 | 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 | 11 | {{ title }} 12 | 13 | 14 | 15 | 16 | {{ message }} 17 | 18 | 19 | 20 | 21 | 27 | {{ cancelButtonText }} 28 | 29 | 30 | 34 | 46 | {{ confirmButtonText }} 47 | 48 | 49 | 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 |