├── .babelrc ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .gitignore ├── .postcssrc.js ├── LICENSE ├── 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 ├── examples └── .gitkeep ├── index.html ├── index.js ├── package-lock.json ├── package.json ├── project.config.json ├── src ├── App.vue ├── assets │ └── style │ │ └── zanui.wxss ├── components │ ├── card.vue │ └── zan │ │ ├── actionsheet.vue │ │ ├── capsule.vue │ │ ├── dialog.vue │ │ ├── field.vue │ │ ├── loadmore.vue │ │ ├── noticebar.vue │ │ ├── select.vue │ │ ├── stepper.vue │ │ ├── steps.vue │ │ ├── switch.vue │ │ ├── tab.vue │ │ ├── tablist.vue │ │ ├── toast.vue │ │ └── toptips.vue ├── main.js ├── pages │ ├── counter │ │ ├── index.vue │ │ ├── main.js │ │ └── store.js │ ├── index │ │ ├── index.vue │ │ └── main.js │ ├── logs │ │ ├── index.vue │ │ └── main.js │ ├── zan_actionsheet │ │ ├── index.vue │ │ └── main.js │ ├── zan_badge │ │ ├── index.vue │ │ └── main.js │ ├── zan_btn │ │ ├── index.vue │ │ └── main.js │ ├── zan_capsule │ │ ├── index.vue │ │ └── main.js │ ├── zan_card │ │ ├── index.vue │ │ └── main.js │ ├── zan_cell │ │ ├── index.vue │ │ └── main.js │ ├── zan_dashboard │ │ ├── config.js │ │ ├── index.vue │ │ └── main.js │ ├── zan_dialog │ │ ├── index.vue │ │ └── main.js │ ├── zan_field │ │ ├── config.js │ │ ├── index.vue │ │ └── main.js │ ├── zan_helper │ │ ├── index.vue │ │ └── main.js │ ├── zan_icon │ │ ├── index.vue │ │ └── main.js │ ├── zan_layout │ │ ├── index.vue │ │ └── main.js │ ├── zan_loadmore │ │ ├── index.vue │ │ └── main.js │ ├── zan_noticebar │ │ ├── index.vue │ │ └── main.js │ ├── zan_panel │ │ ├── index.vue │ │ └── main.js │ ├── zan_popup │ │ ├── index.vue │ │ └── main.js │ ├── zan_select │ │ ├── index.vue │ │ └── main.js │ ├── zan_stepper │ │ ├── index.vue │ │ └── main.js │ ├── zan_steps │ │ ├── index.vue │ │ └── main.js │ ├── zan_switch │ │ ├── index.vue │ │ └── main.js │ ├── zan_tab │ │ ├── index.vue │ │ └── main.js │ ├── zan_tag │ │ ├── index.vue │ │ └── main.js │ ├── zan_toast │ │ ├── index.vue │ │ └── main.js │ └── zan_toptips │ │ ├── index.vue │ │ └── main.js └── utils │ ├── helper.js │ └── index.js ├── static └── .gitkeep └── yarn.lock /.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 | // to edit target browsers: use "browserslist" field in package.json 6 | "autoprefixer": {}, 7 | "postcss-mpvue-wxss": {} 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jeffrey Wang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # mpvue-zanui 2 | 3 | 使用 mpvue 重写 [zanui-weapp](https://github.com/youzan/zanui-weapp/),实现了其中所有组件。 4 | 5 | > Vant Weapp 是基于有赞 Zanui 组件库进行的品牌升级,对于仍在使用 Zanui 的用户,建议逐渐使用 Vant Weapp 替换原有的组件。 6 | > 7 | > Zanui 后续会进入维护状态,仓库地址为:https://github.com/youzan/zanui-weapp 8 | > Vant 在 mpvue 的使用方法可参照 https://github.com/Rychou/mpvue-vant 9 | 10 | 11 | ## 使用方法 12 | 13 | ### 运行小程序 demo 14 | 15 | ``` bash 16 | 1. git clone 17 | git clone https://github.com/samwang1027/mpvue-zanui.git 18 | 19 | 2. 安装依赖 20 | cd mpvue-zanui && npm install 21 | 22 | 3. 启动程序 23 | npm run dev 24 | 25 | 4. 预览 26 | 打开微信开发者工具,新建项目,将目录指向 /dist 即可 27 | ``` 28 | 29 | ### 引用组件 30 | 31 | 32 | 1. 安装 npm 包 33 | 34 | ``` 35 | npm install mpvue-zanui 36 | ``` 37 | 38 | 2. 在 `App.vue` 内通过 `@import '~mpvue-zanui/src/assets/style/zanui.wxss';` 的方式导入zanui样式 39 | 40 | 41 | ~~3. 调用方式在 `node_modules/mpvue-zanui/index.js` 中,如 `import {TopTips} from 'mpvue-zanui'`~~ 42 | 43 | 3. 由于需要等待 mpvue-loader 升级重构,暂时仅能直接引用 `import TopTips from 'mpvue-zanui/src/components/zan/toptips'` 44 | 45 | 4. 组件的详细使用方式通过阅读源码理解 46 | 47 | 48 | 49 | 50 | ## Bug 51 | 52 | - Field 输入框界面中,带圆角输入框因为 css 问题,placeholder 无法靠右 53 | 54 | 55 | ## todo 56 | - [ ] props 属性使用对象包装 57 | - [ ] props 中不注入 function,用 $emit 替换 58 | - [ ] CSS 全局引用改为分块引用 59 | -------------------------------------------------------------------------------- /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 | 9 | function resolve (dir) { 10 | return path.join(__dirname, '..', dir) 11 | } 12 | 13 | function getEntry (rootSrc, pattern) { 14 | var files = glob.sync(path.resolve(rootSrc, pattern)) 15 | return files.reduce((res, file) => { 16 | var info = path.parse(file) 17 | var key = info.dir.slice(rootSrc.length + 1) + '/' + info.name 18 | res[key] = path.resolve(file) 19 | return res 20 | }, {}) 21 | } 22 | 23 | const appEntry = { app: resolve('./src/main.js') } 24 | const pagesEntry = getEntry(resolve('./src'), 'pages/**/main.js') 25 | const entry = Object.assign({}, appEntry, pagesEntry) 26 | 27 | module.exports = { 28 | // 如果要自定义生成的 dist 目录里面的文件路径, 29 | // 可以将 entry 写成 {'toPath': 'fromPath'} 的形式, 30 | // toPath 为相对于 dist 的路径, 例:index/demo,则生成的文件地址为 dist/index/demo.js 31 | entry, 32 | target: require('mpvue-webpack-target'), 33 | output: { 34 | path: config.build.assetsRoot, 35 | filename: '[name].js', 36 | publicPath: process.env.NODE_ENV === 'production' 37 | ? config.build.assetsPublicPath 38 | : config.dev.assetsPublicPath 39 | }, 40 | resolve: { 41 | extensions: ['.js', '.vue', '.json'], 42 | alias: { 43 | 'vue': 'mpvue', 44 | '@': resolve('src') 45 | }, 46 | symlinks: false, 47 | aliasFields: ['mpvue', 'weapp', 'browser'], 48 | mainFields: ['browser', 'module', 'main'] 49 | }, 50 | module: { 51 | rules: [ 52 | { 53 | test: /\.(js|vue)$/, 54 | loader: 'eslint-loader', 55 | enforce: 'pre', 56 | include: [resolve('src'), resolve('test')], 57 | options: { 58 | formatter: require('eslint-friendly-formatter') 59 | } 60 | }, 61 | { 62 | test: /\.vue$/, 63 | loader: 'mpvue-loader', 64 | options: vueLoaderConfig 65 | }, 66 | { 67 | test: /\.js$/, 68 | include: [resolve('src'), resolve('test')], 69 | use: [ 70 | 'babel-loader', 71 | { 72 | loader: 'mpvue-loader', 73 | options: { 74 | checkMPEntry: true 75 | } 76 | }, 77 | ] 78 | }, 79 | { 80 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/, 81 | loader: 'url-loader', 82 | options: { 83 | limit: 10000, 84 | name: utils.assetsPath('img/[name].[ext]') 85 | } 86 | }, 87 | { 88 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, 89 | loader: 'url-loader', 90 | options: { 91 | limit: 10000, 92 | name: utils.assetsPath('media/[name].[ext]') 93 | } 94 | }, 95 | { 96 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, 97 | loader: 'url-loader', 98 | options: { 99 | limit: 10000, 100 | name: utils.assetsPath('fonts/[name].[ext]') 101 | } 102 | } 103 | ] 104 | }, 105 | plugins: [ 106 | new MpvuePlugin() 107 | ] 108 | } 109 | -------------------------------------------------------------------------------- /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('js/[name].[chunkhash].js'), 33 | // chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 34 | filename: utils.assetsPath('js/[name].js'), 35 | chunkFilename: utils.assetsPath('js/[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('css/[name].[contenthash].css') 46 | filename: utils.assetsPath('css/[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: '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: 'manifest', 68 | chunks: ['vendor'] 69 | }), 70 | // copy custom static assets 71 | new CopyWebpackPlugin([ 72 | { 73 | from: path.resolve(__dirname, '../static'), 74 | to: config.build.assetsSubDirectory, 75 | ignore: ['.*'] 76 | } 77 | ]), 78 | 79 | // https://github.com/glenjamin/webpack-hot-middleware#installation--usage 80 | // new webpack.HotModuleReplacementPlugin(), 81 | new webpack.NoEmitOnErrorsPlugin(), 82 | // https://github.com/ampedandwired/html-webpack-plugin 83 | // new HtmlWebpackPlugin({ 84 | // filename: 'index.html', 85 | // template: 'index.html', 86 | // inject: true 87 | // }), 88 | new FriendlyErrorsPlugin() 89 | ] 90 | }) 91 | -------------------------------------------------------------------------------- /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('js/[name].[chunkhash].js'), 26 | // chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') 27 | filename: utils.assetsPath('js/[name].js'), 28 | chunkFilename: utils.assetsPath('js/[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('css/[name].[contenthash].css') 41 | filename: utils.assetsPath('css/[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: '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: 'manifest', 85 | chunks: ['vendor'] 86 | }), 87 | // copy custom static assets 88 | new CopyWebpackPlugin([ 89 | { 90 | from: path.resolve(__dirname, '../static'), 91 | to: config.build.assetsSubDirectory, 92 | ignore: ['.*'] 93 | } 94 | ]) 95 | ] 96 | }) 97 | 98 | // if (config.build.productionGzip) { 99 | // var CompressionWebpackPlugin = require('compression-webpack-plugin') 100 | 101 | // webpackConfig.plugins.push( 102 | // new CompressionWebpackPlugin({ 103 | // asset: '[path].gz[query]', 104 | // algorithm: 'gzip', 105 | // test: new RegExp( 106 | // '\\.(' + 107 | // config.build.productionGzipExtensions.join('|') + 108 | // ')$' 109 | // ), 110 | // threshold: 10240, 111 | // minRatio: 0.8 112 | // }) 113 | // ) 114 | // } 115 | 116 | if (config.build.bundleAnalyzerReport) { 117 | var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin 118 | webpackConfig.plugins.push(new BundleAnalyzerPlugin()) 119 | } 120 | 121 | module.exports = webpackConfig 122 | -------------------------------------------------------------------------------- /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: 'static', 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: 'static', 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 | -------------------------------------------------------------------------------- /examples/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armyja/mpvue-zanui/a4bbefb2498fda45a0d0233d6292577839a04a09/examples/.gitkeep -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | mpvue-zanui 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | import Actionsheet from './src/components/zan/actionsheet' 2 | import Dialog from './src/components/zan/dialog' 3 | import Field from './src/components/zan/field' 4 | import NoticeBar from './src/components/zan/noticebar' 5 | import Select from './src/components/zan/select' 6 | import Stepper from './src/components/zan/stepper' 7 | import Switch from './src/components/zan/switch' 8 | import Tab from './src/components/zan/tab' 9 | import Toast from './src/components/zan/toast' 10 | import TopTips from './src/components/zan/toptips' 11 | import { getComponentByTag, extractComponentId } from './src/utils/helper' 12 | 13 | export { 14 | Actionsheet, 15 | Dialog, 16 | Field, 17 | NoticeBar, 18 | Select, 19 | Stepper, 20 | Switch, 21 | Tab, 22 | Toast, 23 | TopTips, 24 | getComponentByTag, 25 | extractComponentId 26 | } 27 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "mpvue-zanui", 3 | "version": "1.0.3", 4 | "description": "使用 mpvue 重写 zanui", 5 | "author": "Jeffrey Wang ", 6 | "scripts": { 7 | "dev": "node build/dev-server.js", 8 | "start": "node build/dev-server.js", 9 | "build": "node build/build.js", 10 | "lint": "eslint --ext .js,.vue src" 11 | }, 12 | "dependencies": { 13 | "mpvue": "^1.0.13", 14 | "vuex": "^2.3.1" 15 | }, 16 | "devDependencies": { 17 | "autoprefixer": "^7.1.2", 18 | "babel-core": "^6.26.3", 19 | "babel-eslint": "^7.1.1", 20 | "babel-loader": "^7.1.5", 21 | "babel-plugin-transform-runtime": "^6.22.0", 22 | "babel-preset-env": "^1.7.0", 23 | "babel-preset-stage-2": "^6.22.0", 24 | "babel-register": "^6.22.0", 25 | "chalk": "^2.4.1", 26 | "connect-history-api-fallback": "^1.3.0", 27 | "copy-webpack-plugin": "^4.5.2", 28 | "css-loader": "^0.28.11", 29 | "cssnano": "^3.10.0", 30 | "eslint": "^3.19.0", 31 | "eslint-config-standard": "^6.2.1", 32 | "eslint-friendly-formatter": "^3.0.0", 33 | "eslint-loader": "^1.7.1", 34 | "eslint-plugin-html": "^3.0.0", 35 | "eslint-plugin-promise": "^3.8.0", 36 | "eslint-plugin-standard": "^2.0.1", 37 | "eventsource-polyfill": "^0.9.6", 38 | "express": "^4.14.1", 39 | "extract-text-webpack-plugin": "^2.0.0", 40 | "file-loader": "^0.11.1", 41 | "friendly-errors-webpack-plugin": "^1.7.0", 42 | "html-webpack-plugin": "^2.28.0", 43 | "http-proxy-middleware": "^0.17.3", 44 | "mpvue-loader": "^1.0.13", 45 | "mpvue-template-compiler": "^1.0.13", 46 | "mpvue-webpack-target": "^1.0.1", 47 | "opn": "^5.3.0", 48 | "optimize-css-assets-webpack-plugin": "^2.0.0", 49 | "ora": "^1.2.0", 50 | "portfinder": "^1.0.16", 51 | "postcss-loader": "^2.1.6", 52 | "postcss-mpvue-wxss": "^1.0.0", 53 | "px2rpx-loader": "^0.1.10", 54 | "rimraf": "^2.6.0", 55 | "semver": "^5.3.0", 56 | "shelljs": "^0.7.6", 57 | "uglifyjs-webpack-plugin": "^1.2.7", 58 | "url-loader": "^0.5.8", 59 | "vue-style-loader": "^3.0.1", 60 | "webpack": "^2.6.1", 61 | "webpack-bundle-analyzer": "^2.13.1", 62 | "webpack-dev-middleware": "^1.10.0", 63 | "webpack-dev-middleware-hard-disk": "^1.12.1", 64 | "webpack-hot-middleware": "^2.22.3", 65 | "webpack-merge": "^4.1.4", 66 | "webpack-mpvue-asset-plugin": "^0.1.1" 67 | }, 68 | "engines": { 69 | "node": ">= 4.0.0", 70 | "npm": ">= 3.0.0" 71 | }, 72 | "browserslist": [ 73 | "> 1%", 74 | "last 2 versions", 75 | "not ie <= 8" 76 | ] 77 | } 78 | -------------------------------------------------------------------------------- /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": "touristappid", 13 | "projectname": "mpvue-zanui", 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 | } -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 65 | -------------------------------------------------------------------------------- /src/assets/style/zanui.wxss: -------------------------------------------------------------------------------- 1 | .zan-actionsheet{background-color:#f8f8f8}.zan-actionsheet__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-actionsheet__container{position:fixed;left:0;right:0;bottom:0;background:#f8f8f8;transform:translate3d(0,50%,0);transform-origin:center;transition:all .2s ease;z-index:11;opacity:0;visibility:hidden}.zan-actionsheet__btn.zan-btn{height:50px;line-height:50px;margin-bottom:0}.zan-actionsheet__btn.zan-btn::after{border-width:0;border-bottom-width:1px}.zan-actionsheet__btn.zan-btn:last-child::after{border-bottom-width:0}.zan-actionsheet__subname{margin-left:2px;font-size:12px;color:#666}.zan-actionsheet__footer{margin-top:10px}.zan-actionsheet__btn.zan-btn--loading .zan-actionsheet__subname{color:transparent}.zan-actionsheet--show .zan-actionsheet__container{opacity:1;transform:translate3d(0,0,0);visibility:visible}.zan-actionsheet--show .zan-actionsheet__mask{display:block}.zan-badge{position:relative}.zan-badge__count{position:absolute;top:-16px;right:0;height:1.6em;min-width:1.6em;line-height:1.6;padding:0 .4em;font-size:20px;border-radius:.8em;background:#f44;color:#fff;text-align:center;white-space:nowrap;transform:translateX(50%) scale(.5);transform-origin:center;z-index:10;box-shadow:0 0 0 2px #fff;box-sizing:border-box}.zan-btn{position:relative;color:#333;background-color:#fff;margin-bottom:10px;padding-left:15px;padding-right:15px;border-radius:2px;font-size:16px;line-height:45px;height:45px;box-sizing:border-box;text-decoration:none;text-align:center;vertical-align:middle}.zan-btn::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-btns{margin:15px}.zan-btn--primary{color:#fff;background-color:#4b0}.zan-btn--primary::after{border-color:#0a0}.zan-btn--warn{color:#fff;background-color:#f85}.zan-btn--warn::after{border-color:#f85}.zan-btn--danger{color:#fff;background-color:#f44}.zan-btn--danger::after{border-color:#e33}.zan-btn--small{display:inline-block;height:30px;line-height:30px;font-size:12px;margin-right:5px;margin-bottom:0}.zan-btn--mini{display:inline-block;line-height:21px;height:22px;font-size:10px;margin-right:5px;margin-bottom:0;padding-left:5px;padding-right:5px}.zan-btn--large{border-radius:0;margin-bottom:0;border:none;line-height:50px;height:50px}.zan-btn--plain.zan-btn{background-color:transparent}.zan-btn--plain.zan-btn--primary{color:#06bf04}.zan-btn--plain.zan-btn--warn{color:#f60}.zan-btn--plain.zan-btn--danger{color:#f44}.button-hover{opacity:.9}.zan-btn--loading{color:transparent;opacity:1}.zan-btn--loading::before{position:absolute;left:50%;top:50%;content:' ';width:16px;height:16px;margin-left:-8px;margin-top:-8px;border:3px solid #e5e5e5;border-color:#666 #e5e5e5 #e5e5e5 #e5e5e5;border-radius:8px;box-sizing:border-box;animation:btn-spin .6s linear;animation-iteration-count:infinite}.zan-btn--danger.zan-btn--loading::before,.zan-btn--primary.zan-btn--loading::before,.zan-btn--warn.zan-btn--loading::before{border-color:#fff rgba(0,0,0,.1) rgba(0,0,0,.1) rgba(0,0,0,.1)}@keyframes btn-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.zan-btn.zan-btn--disabled{color:#999!important;background:#f8f8f8!important;border-color:#e5e5e5!important;cursor:not-allowed!important;opacity:1!important}.zan-btn.zan-btn--disabled::after{border-color:#e5e5e5!important}.zan-btn--last-child,.zan-btn:last-child{margin-bottom:0;margin-right:0}.zan-capsule{display:inline-block;font-size:12px;vertical-align:middle;line-height:19px;transform:scale(.83)}.zan-capsule__left,.zan-capsule__right{display:inline-block;line-height:17px;height:19px;vertical-align:middle;box-sizing:border-box}.zan-capsule__left{padding:0 2px;color:#fff;background:#999;border-radius:2px 0 0 2px;border:1rpx solid #999}.zan-capsule__right{padding:0 5px;color:#999;border-radius:0 2px 2px 0;border:1rpx solid #999}.zan-capsule--danger .zan-capsule__left{color:#fff;background:#f24544;border-color:#f24544}.zan-capsule--danger .zan-capsule__right{color:#f24544;border-color:#f24544}.zan-card{margin-left:0;width:auto;padding:5px 15px;overflow:hidden;position:relative;font-size:14px}.zan-card__thumb{width:90px;height:90px;float:left;position:relative;margin-left:auto;margin-right:auto;overflow:hidden;background-size:cover}.zan-card__img{position:absolute;top:0;left:0;right:0;bottom:0;width:auto;height:auto;max-width:100%;max-height:100%}.zan-card__detail{margin-left:100px;width:auto;position:relative}.zan-card__detail-row{overflow:hidden;line-height:20px;min-height:20px;margin-bottom:3px}.zan-card__right-col{float:right}.zan-card__left-col{margin-right:80px}.zan-cell{position:relative;padding:12px 15px;display:flex;align-items:center;line-height:1.4;font-size:14px}.zan-cell::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px;left:15px;right:0}.zan-cell__icon{margin-right:5px}.zan-cell__bd{flex:1}.zan-cell__text{line-height:24px;font-size:14px}.zan-cell__desc{line-height:1.2;font-size:12px;color:#666}.zan-cell__ft{position:relative;text-align:right;color:#666}.zan-cell__no-pading{padding:0}.zan-cell__no-pading .zan-cell__bd_padding{padding:12px 0 12px 15px}.zan-cell__no-pading .zan-cell__bd_padding .zan-form__input{height:26px}.zan-cell__no-pading .zan-cell__ft_padding{padding:12px 15px 12px 0}.zan-cell--last-child::after,.zan-cell:last-child::after{display:none}.zan-cell--access .zan-cell__ft{padding-right:13px}.zan-cell--access .zan-cell__ft::after{position:absolute;top:50%;right:2px;content:" ";display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-cell--switch{padding-top:6px;padding-bottom:6px}.zan-col{float:left;box-sizing:border-box;width:0}.zan-col-1{width:4.16667%}.zan-col-offset-1{margin-left:4.16667%}.zan-col-2{width:8.33333%}.zan-col-offset-2{margin-left:8.33333%}.zan-col-3{width:12.5%}.zan-col-offset-3{margin-left:12.5%}.zan-col-4{width:16.66667%}.zan-col-offset-4{margin-left:16.66667%}.zan-col-5{width:20.83333%}.zan-col-offset-5{margin-left:20.83333%}.zan-col-6{width:25%}.zan-col-offset-6{margin-left:25%}.zan-col-7{width:29.16667%}.zan-col-offset-7{margin-left:29.16667%}.zan-col-8{width:33.33333%}.zan-col-offset-8{margin-left:33.33333%}.zan-col-9{width:37.5%}.zan-col-offset-9{margin-left:37.5%}.zan-col-10{width:41.66667%}.zan-col-offset-10{margin-left:41.66667%}.zan-col-11{width:45.83333%}.zan-col-offset-11{margin-left:45.83333%}.zan-col-12{width:50%}.zan-col-offset-12{margin-left:50%}.zan-col-13{width:54.16667%}.zan-col-offset-13{margin-left:54.16667%}.zan-col-14{width:58.33333%}.zan-col-offset-14{margin-left:58.33333%}.zan-col-15{width:62.5%}.zan-col-offset-15{margin-left:62.5%}.zan-col-16{width:66.66667%}.zan-col-offset-16{margin-left:66.66667%}.zan-col-17{width:70.83333%}.zan-col-offset-17{margin-left:70.83333%}.zan-col-18{width:75%}.zan-col-offset-18{margin-left:75%}.zan-col-19{width:79.16667%}.zan-col-offset-19{margin-left:79.16667%}.zan-col-20{width:83.33333%}.zan-col-offset-20{margin-left:83.33333%}.zan-col-21{width:87.5%}.zan-col-offset-21{margin-left:87.5%}.zan-col-22{width:91.66667%}.zan-col-offset-22{margin-left:91.66667%}.zan-col-23{width:95.83333%}.zan-col-offset-23{margin-left:95.83333%}.zan-col-24{width:100%}.zan-col-offset-24{margin-left:100%}.zan-c-red{color:#f44!important}.zan-c-gray{color:#c9c9c9!important}.zan-c-gray-dark{color:#999!important}.zan-c-gray-darker{color:#666!important}.zan-c-black{color:#333!important}.zan-c-blue{color:#38f!important}.zan-c-green{color:#06bf04!important}.zan-dialog--container{position:fixed;top:45%;left:50%;width:80%;height:0;font-size:16px;overflow:hidden;transition:all .2s linear;border-radius:4px;background-color:#fff;transform:translate3d(-50%,-50%,0);color:#333;opacity:0}.zan-dialog--mask{position:fixed;width:100%;height:100%;top:0;left:0;background-color:rgba(0,0,0,.6);transition:.3s;display:none}.zan-dialog__header{padding:15px 0 0;text-align:center}.zan-dialog__content{position:relative;padding:15px 20px;line-height:1.5;min-height:40px}.zan-dialog__content::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-bottom-width:1px}.zan-dialog__content--title{color:#999;font-size:14px}.zan-dialog__footer{overflow:hidden}.zan-dialog__button{line-height:50px;height:50px;padding:0 5px;border-radius:0;margin-bottom:0}.zan-dialog__button::after{border-width:0;border-radius:0}.zan-dialog--show .zan-dialog--container{opacity:1;height:auto}.zan-dialog--show .zan-dialog--mask{display:block}.zan-dialog__footer--horizon{display:flex}.zan-dialog__footer--horizon .zan-dialog__button{flex:1}.zan-dialog__footer--horizon .zan-dialog__button::after{border-right-width:1px}.zan-dialog__footer--horizon .zan-dialog__button:last-child::after{border-right-width:0}.zan-dialog__footer--vertical .zan-dialog__button{flex:1}.zan-dialog__footer--vertical .zan-dialog__button::after{border-bottom-width:1px}.zan-dialog__footer--vertical .zan-dialog__button:last-child::after{border-bottom-width:0}.zan-field{padding:7px 15px;color:#333}.zan-field--wrapped{margin:0 15px;background-color:#fff}.zan-field--wrapped::after{left:0;border-width:1px;border-radius:4px}.zan-field.zan-field--wrapped::after{display:block}.zan-field--wrapped+.zan-field--wrapped{margin-top:10px}.zan-field--error{color:#f40}.zan-field--wrapped.zan-field--error::after{border-color:#f40}.zan-field__title{color:#333;min-width:65px;padding-right:10px}.zan-field__input{flex:1;line-height:1.6;padding:4px 0;min-height:22px;height:auto;font-size:14px}.zan-field__placeholder{font-size:14px}.zan-field__input--right{text-align:right}.zan-pull-left{float:left}.zan-pull-right{float:right}.zan-center{text-align:center}.zan-right{text-align:right}.zan-text-deleted{text-decoration:line-through}.zan-font-8{font-size:8px}.zan-font-10{font-size:10px}.zan-font-12{font-size:12px}.zan-font-14{font-size:14px}.zan-font-16{font-size:16px}.zan-font-18{font-size:18px}.zan-font-20{font-size:20px}.zan-font-22{font-size:22px}.zan-font-24{font-size:22px}.zan-font-30{font-size:30px}.zan-font-bold{font-weight:700}.zan-arrow{position:absolute;right:15px;top:50%;display:inline-block;height:6px;width:6px;border-width:2px 2px 0 0;border-color:#c8c8c8;border-style:solid;transform:translateY(-50%) matrix(.71,.71,-.71,.71,0,0)}.zan-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-wrap:normal}.zan-ellipsis--l2{max-height:40px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.zan-ellipsis--l3{max-height:60px;line-height:20px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}.zan-clearfix{zoom:1}.zan-clearfix::after{content:'';display:table;clear:both}.zan-hairline,.zan-hairline--bottom,.zan-hairline--left,.zan-hairline--right,.zan-hairline--surround,.zan-hairline--top,.zan-hairline--top-bottom{position:relative}.zan-hairline--bottom::after,.zan-hairline--left::after,.zan-hairline--right::after,.zan-hairline--surround::after,.zan-hairline--top-bottom::after,.zan-hairline--top::after,.zan-hairline::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5}.zan-hairline--top::after{border-top-width:1px}.zan-hairline--left::after{border-left-width:1px}.zan-hairline--right::after{border-right-width:1px}.zan-hairline--bottom::after{border-bottom-width:1px}.zan-hairline--top-bottom::after{border-width:1px 0}.zan-hairline--surround::after{border-width:1px}@font-face{font-family:zanui-weapp-icon;src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot);src:url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.eot?#iefix) format('embedded-opentype'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff2) format('woff2'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.woff) format('woff'),url(https://b.yzcdn.cn/zanui-weapp/zanui-weapp-icon-4381aded05.ttf) format('truetype')}.zan-icon{display:inline-block}.zan-icon::before{font-family:zanui-weapp-icon!important;font-style:normal;font-weight:400;speak:none;display:inline-block;text-decoration:inherit;width:1em;text-align:center;font-variant:normal;text-transform:none;line-height:1em;-webkit-font-smoothing:antialiased}.zan-icon-qr-invalid:before{content:'\e800'}.zan-icon-qr:before{content:'\e801'}.zan-icon-exchange:before{content:'\e802'}.zan-icon-close:before{content:'\e803'}.zan-icon-location:before{content:'\e804'}.zan-icon-upgrade:before{content:'\e805'}.zan-icon-check:before{content:'\e806'}.zan-icon-checked:before{content:'\e807'}.zan-icon-like-o:before{content:'\e808'}.zan-icon-like:before{content:'\e809'}.zan-icon-chat:before{content:'\e80a'}.zan-icon-shop:before{content:'\e80b'}.zan-icon-photograph:before{content:'\e80c'}.zan-icon-add:before{content:'\e80d'}.zan-icon-add2:before{content:'\e80e'}.zan-icon-photo:before{content:'\e80f'}.zan-icon-logistics:before{content:'\e810'}.zan-icon-edit:before{content:'\e811'}.zan-icon-passed:before{content:'\e812'}.zan-icon-cart:before{content:'\e813'}.zan-icon-shopping-cart:before{content:'\e814'}.zan-icon-arrow:before{content:'\e815'}.zan-icon-gift:before{content:'\e816'}.zan-icon-search:before{content:'\e817'}.zan-icon-clear:before{content:'\e818'}.zan-icon-success:before{content:'\e819'}.zan-icon-fail:before{content:'\e81a'}.zan-icon-contact:before{content:'\e81b'}.zan-icon-wechat:before{content:'\e81c'}.zan-icon-alipay:before{content:'\e81d'}.zan-icon-password-view:before{content:'\e81e'}.zan-icon-password-not-view:before{content:'\e81f'}.zan-icon-wap-nav:before{content:'\e820'}.zan-icon-wap-home:before{content:'\e821'}.zan-icon-ecard-pay:before{content:'\e822'}.zan-icon-balance-pay:before{content:'\e823'}.zan-icon-peer-pay:before{content:'\e824'}.zan-icon-credit-pay:before{content:'\e825'}.zan-icon-debit-pay:before{content:'\e826'}.zan-icon-other-pay:before{content:'\e827'}.zan-icon-browsing-history:before{content:'\e828'}.zan-icon-goods-collect:before{content:'\e829'}.zan-icon-shop-collect:before{content:'\e82a'}.zan-icon-receive-gift:before{content:'\e82b'}.zan-icon-send-gift:before{content:'\e82c'}.zan-icon-setting:before{content:'\e82d'}.zan-icon-points:before{content:'\e82e'}.zan-icon-coupon:before{content:'\e82f'}.zan-icon-free-postage:before{content:'\e830'}.zan-icon-discount:before{content:'\e831'}.zan-icon-birthday-privilege:before{content:'\e832'}.zan-icon-member-day-privilege:before{content:'\e833'}.zan-icon-balance-details:before{content:'\e834'}.zan-icon-cash-back-record:before{content:'\e835'}.zan-icon-points-mall:before{content:'\e836'}.zan-icon-exchange-record:before{content:'\e837'}.zan-icon-pending-payment:before{content:'\e838'}.zan-icon-pending-orders:before{content:'\e839'}.zan-icon-pending-deliver:before{content:'\e83a'}.zan-icon-pending-evaluate:before{content:'\e83b'}.zan-icon-gift-card-pay:before{content:'\e83c'}.zan-icon-cash-on-deliver:before{content:'\e83d'}.zan-icon-underway:before{content:'\e83e'}.zan-icon-point-gift:before{content:'\e83f'}.zan-icon-after-sale:before{content:'\e840'}.zan-icon-edit-data:before{content:'\e841'}.zan-icon-question:before{content:'\e842'}.zan-icon-delete:before{content:'\e843'}.zan-icon-records:before{content:'\e844'}.zan-icon-description:before{content:'\e845'}.zan-icon-card:before{content:'\e846'}.zan-icon-gift-card:before{content:'\e847'}.zan-icon-clock:before{content:'\e848'}.zan-icon-gold-coin:before{content:'\e849'}.zan-icon-completed:before{content:'\e84a'}.zan-icon-value-card:before{content:'\e84b'}.zan-icon-certificate:before{content:'\e84c'}.zan-icon-tosend:before{content:'\e84d'}.zan-icon-sign:before{content:'\e84e'}.zan-icon-home:before{content:'\e84f'}.zan-icon-phone:before{content:'\e850'}.zan-icon-add-o:before{content:'\e851'}.zan-icon-play:before{content:'\e852'}.zan-icon-pause:before{content:'\e853'}.zan-icon-stop:before{content:'\e854'}.zan-icon-hot:before{content:'\e855'}.zan-icon-new:before{content:'\e856'}.zan-icon-new-arrival:before{content:'\e857'}.zan-icon-hot-sale:before{content:'\e858'}.zan-loadmore{position:relative;width:65%;margin:21px auto;line-height:20px;font-size:14px;text-align:center;vertical-align:middle}.zan-loading{width:20px;height:20px;display:inline-block;vertical-align:middle;animation:weuiLoading 1s steps(12,end) infinite;background:transparent url(data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iciIgd2lkdGg9JzEyMHB4JyBoZWlnaHQ9JzEyMHB4JyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj4KICAgIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiBmaWxsPSJub25lIiBjbGFzcz0iYmsiPjwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjRTlFOUU5JwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoMCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICA8L3JlY3Q+CiAgICA8cmVjdCB4PSc0Ni41JyB5PSc0MCcgd2lkdGg9JzcnIGhlaWdodD0nMjAnIHJ4PSc1JyByeT0nNScgZmlsbD0nIzk4OTY5NycKICAgICAgICAgIHRyYW5zZm9ybT0ncm90YXRlKDMwIDUwIDUwKSB0cmFuc2xhdGUoMCAtMzApJz4KICAgICAgICAgICAgICAgICByZXBlYXRDb3VudD0naW5kZWZpbml0ZScvPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyM5Qjk5OUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSg2MCA1MCA1MCkgdHJhbnNsYXRlKDAgLTMwKSc+CiAgICAgICAgICAgICAgICAgcmVwZWF0Q291bnQ9J2luZGVmaW5pdGUnLz4KICAgIDwvcmVjdD4KICAgIDxyZWN0IHg9JzQ2LjUnIHk9JzQwJyB3aWR0aD0nNycgaGVpZ2h0PScyMCcgcng9JzUnIHJ5PSc1JyBmaWxsPScjQTNBMUEyJwogICAgICAgICAgdHJhbnNmb3JtPSdyb3RhdGUoOTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNBQkE5QUEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxMjAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCMkIyQjInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxNTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNCQUI4QjknCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgxODAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDMkMwQzEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyMTAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNDQkNCQ0InCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEMkQyRDInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgyNzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNEQURBREEnCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMDAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0PgogICAgPHJlY3QgeD0nNDYuNScgeT0nNDAnIHdpZHRoPSc3JyBoZWlnaHQ9JzIwJyByeD0nNScgcnk9JzUnIGZpbGw9JyNFMkUyRTInCiAgICAgICAgICB0cmFuc2Zvcm09J3JvdGF0ZSgzMzAgNTAgNTApIHRyYW5zbGF0ZSgwIC0zMCknPgogICAgPC9yZWN0Pgo8L3N2Zz4=) no-repeat;-webkit-background-size:100%;background-size:100%}.zan-loadmore .zan-loading{margin-right:4px}.zan-loadmore__tips{display:inline-block;vertical-align:middle;height:20px;line-height:20px}.zan-loadmore--nodata,.zan-loadmore--nomore{color:#999}.zan-loadmore--nodata::after,.zan-loadmore--nomore::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px}.zan-loadmore--nodata{margin-top:120px}.zan-loadmore--nodata .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore--nomore .zan-loadmore__tips{position:relative;top:-11px;background:#f9f9f9;padding:0 6px;z-index:1}.zan-loadmore__dot{position:absolute;left:50%;top:10px;margin-left:-2px;margin-top:-2px;content:" ";width:4px;height:4px;border-radius:50%;background-color:#e5e5e5;display:inline-block;vertical-align:middle}.zan-noticebar{color:#f60;padding:9px 10px;font-size:12px;line-height:1.5;background-color:#fff7cc}.zan-panel{position:relative;background:#fff;margin-top:10px;overflow:hidden}.zan-panel::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-top-width:1px;border-bottom-width:1px}.zan-panel-title{font-size:14px;line-height:1;color:#999;padding:20px 15px 0 15px}.zan-panel--without-margin-top{margin-top:0}.zan-panel--without-border::after{border:0 none}.zan-popup{visibility:hidden}.zan-popup--show{visibility:visible}.zan-popup__mask{position:fixed;top:0;left:0;right:0;bottom:0;z-index:10;background:rgba(0,0,0,.7);display:none}.zan-popup__container{position:fixed;left:50%;top:50%;background:#fff;transform:translate3d(-50%,-50%,0);transform-origin:center;transition:all .4s ease;z-index:11;opacity:0}.zan-popup--show .zan-popup__container{opacity:1}.zan-popup--show .zan-popup__mask{display:block}.zan-popup--left .zan-popup__container{left:0;top:auto;transform:translate3d(-100%,0,0)}.zan-popup--show.zan-popup--left .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--right .zan-popup__container{right:0;top:auto;left:auto;transform:translate3d(100%,0,0)}.zan-popup--show.zan-popup--right .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--bottom .zan-popup__container{top:auto;left:auto;bottom:0;transform:translate3d(0,100%,0)}.zan-popup--show.zan-popup--bottom .zan-popup__container{transform:translate3d(0,0,0)}.zan-popup--top .zan-popup__container{top:0;left:auto;transform:translate3d(0,-100%,0)}.zan-popup--show.zan-popup--top .zan-popup__container{transform:translate3d(0,0,0)}.zan-row:after{content:"";display:table;clear:both}.zan-select__list .zan-select__radio{display:none}.zan-stepper{color:#666}.zan-stepper view{display:inline-block;line-height:20px;padding:5px 0;text-align:center;min-width:40px;box-sizing:border-box;vertical-align:middle;font-size:12px;border:1rpx solid #999}.zan-stepper .zan-stepper__minus{border-right:none;border-radius:2px 0 0 2px}.zan-stepper .zan-stepper__text{border:1rpx solid #999;display:inline-block;text-align:center;vertical-align:middle;height:30px;width:40px;min-height:auto;font-size:12px;line-height:30px}.zan-stepper .zan-stepper__plus{border-left:none;border-radius:0 2px 2px 0}.zan-stepper .zan-stepper--disabled{background:#f8f8f8;color:#bbb;border-color:#e8e8e8}.zan-stepper--small view{min-width:36px;line-height:18px}.zan-stepper--small .zan-stepper__text{width:36px;line-height:28px;height:28px}.zan-steps--steps.zan-steps--5 .zan-steps__step{width:25%}.zan-steps--steps.zan-steps--4 .zan-steps__step{width:33%}.zan-steps--steps.zan-steps--3 .zan-steps__step{width:50%}.zan-steps--steps .zan-steps__step{position:relative;float:left;padding-bottom:25px;color:#b1b1b1}.zan-steps--steps .zan-steps__title{transform:translateX(-50%);font-size:10px;text-align:center}.zan-steps--steps .zan-steps__icons{position:absolute;top:30px;left:-10px;padding:0 8px;background-color:#fff;z-index:10}.zan-steps--steps .zan-steps__circle{display:block;position:relative;width:5px;height:5px;background-color:#e5e5e5;border-radius:50%}.zan-steps--steps .zan-steps__line{position:absolute;left:0;top:32px;width:100%;height:1px;background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--done{color:#333}.zan-steps--steps .zan-steps__step--done .zan-steps__line{background-color:#06bf04}.zan-steps--steps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--steps .zan-steps__step--cur .zan-steps__icons{top:25px;left:-14px}.zan-steps--steps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background-image:url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px}.zan-steps--steps .zan-steps__step--cur .zan-steps__line{background-color:#e5e5e5}.zan-steps--steps .zan-steps__step--first-child .zan-steps__title{margin-left:0;transform:none;text-align:left}.zan-steps--steps .zan-steps__step--first-child .zan-steps__icons{left:-7px}.zan-steps--steps .zan-steps__step--last-child{position:absolute;right:0;top:0;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__title{transform:none;text-align:right}.zan-steps--steps .zan-steps__step--last-child .zan-steps__icons{left:auto;right:-6px}.zan-steps--steps .zan-steps__step--last-child .zan-steps__line{display:none}.zan-steps--steps .zan-steps__step--db-title{min-height:29px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__line{top:45px}.zan-steps--steps .zan-steps__step--db-title .zan-steps__icons{top:43px}.zan-steps--steps .zan-steps__step--db-title.zan-steps__step--cur .zan-steps__icons{top:39px}.zan-steps--vsteps{color:#999;font-size:14px}.zan-steps--vsteps .zan-steps__step{position:relative;padding:15px 0}.zan-steps--vsteps .zan-steps__step--done{color:#4b0}.zan-steps--vsteps .zan-steps__line{position:absolute;top:0;bottom:0;left:7px;width:1px;background-color:#e5e5e5}.zan-steps--vsteps .zan-steps__title{display:inline-block;line-height:20px;padding-left:27px}.zan-steps--vsteps .zan-steps__title--desc{padding-left:3px}.zan-steps--vsteps .zan-steps__icons{position:absolute;left:7px;top:50%;transform:translate(-50%,-50%);z-index:2;padding:3px 0;background-color:#fff}.zan-steps--vsteps .zan-steps__circle{width:5px;height:5px;background-color:#cacaca;border-radius:10px}.zan-steps--vsteps .zan-steps__step--done .zan-steps__circle{width:5px;height:5px;background-color:#09bb07}.zan-steps--vsteps .zan-steps__step--cur .zan-steps__circle{width:13px;height:13px;background:transparent url(https://b.yzcdn.cn/v2/image/wap/success_small@2x.png);background-size:13px 13px;border-radius:0}.zan-steps--vsteps .zan-steps__icon--active{width:13px;height:13px}.zan-steps--vsteps .zan-steps__step--first-child .zan-steps__title::before{content:'';position:absolute;top:0;bottom:50%;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps--vsteps .zan-steps__step--last-child .zan-steps__title::after{content:'';position:absolute;top:50%;bottom:0;left:7px;width:1px;background-color:#fff;z-index:1}.zan-steps{position:relative}.zan-switch{position:relative;display:inline-block;width:52px;height:32px;vertical-align:middle;box-sizing:border-box;border-radius:16px;background:#44db5e;border:1px solid #44db5e}.zan-switch__circle{position:absolute;top:0;left:0;width:30px;height:30px;display:inline-block;background:#fff;border-radius:15px;box-sizing:border-box;box-shadow:0 0 0 1px rgba(0,0,0,.1),0 3px 1px 0 rgba(0,0,0,.05),0 2px 2px 0 rgba(0,0,0,.1),0 3px 3px 0 rgba(0,0,0,.05);transition:transform .35s cubic-bezier(.45,1,.4,1);z-index:2}.zan-switch__bg{position:absolute;top:-1px;left:-1px;width:52px;height:32px;background:#fff;border-radius:26px;display:inline-block;border:1px solid #e5e5e5;box-sizing:border-box;transition:transform .35s cubic-bezier(.45,1,.4,1);transform:scale(0);transform-origin:36px 16px}.zan-switch--on .zan-switch__circle{transform:translateX(20px)}.zan-switch--off .zan-switch__bg{transform:scale(1)}.zan-swtich--disabled{opacity:.4}.zan-switch__loading{position:absolute;left:7px;top:7px;width:16px;height:16px;background:url(https://img.yzcdn.cn/public_files/2017/02/24/9acec77d91106cd15b8107c4633d9155.png) no-repeat;background-size:16px 16px;animation:zan-switch-loading .8s infinite linear}@keyframes zan-switch-loading{from{transform:rotate(0)}to{transform:rotate(360deg)}}.zan-tab{height:45px}.zan-tab__bd{width:750rpx;display:flex;flex-direction:row;border-bottom:1rpx solid #e5e5e5;background:#fff}.zan-tab__bd--fixed{position:fixed;top:0;z-index:2}.zan-tab__item{flex:1;display:inline-block;padding:0 10px;line-height:0;box-sizing:border-box;overflow:hidden;text-align:center}.zan-tab__title{display:inline-block;max-width:100%;height:44px;line-height:44px;overflow:hidden;text-overflow:ellipsis;box-sizing:border-box;word-break:keep-all;font-size:14px;color:#666}.zan-tab__item--selected .zan-tab__title{color:#f44;border-bottom:2px solid #f44}.zan-tab__bd--scroll{display:block;white-space:nowrap}.zan-tab__bd--scroll .zan-tab__item{min-width:80px}.zan-tag{display:inline-block;position:relative;box-sizing:border-box;line-height:16px;padding:0 5px;border-radius:2px;font-size:11px;background:#c9c9c9;text-align:center;color:#fff}.zan-tag::after{content:'';position:absolute;top:0;left:0;width:200%;height:200%;transform:scale(.5);transform-origin:0 0;pointer-events:none;box-sizing:border-box;border:0 solid #e5e5e5;border-width:1px;border-radius:4px}.zan-tag--plain{color:#c9c9c9;background:#fff}.zan-tag--primary{color:#fff;background-color:#4b0}.zan-tag--primary::after{border-color:#4b0}.zan-tag--primary.zan-tag--plain{color:#4b0;background:#fff}.zan-tag--danger{color:#fff;background:#f44}.zan-tag--danger::after{border-color:#f44}.zan-tag--danger.zan-tag--plain{color:#f44;background:#fff}.zan-tag--warn{color:#fff;background:#f85}.zan-tag--warn::after{border-color:#f85}.zan-tag--warn.zan-tag--plain{color:#f85;background:#fff}.zan-tag--disabled{color:#999!important;background:#e5e5e5}.zan-tag--disabled::after{border-color:#ccc}.zan-toast{position:fixed;top:35%;left:50%;transform:translate3d(-50%,-50%,0);background:rgba(0,0,0,.7);color:#fff;font-size:14px;line-height:1.5em;margin:0 auto;box-sizing:border-box;padding:10px 18px;text-align:center;border-radius:4px;z-index:100}.zan-toast--notitle{padding:18px}.zan-toast__icon{width:40px;height:40px;line-height:40px;margin:0 auto;padding:12px 15px;font-size:38px;text-align:center}.zan-toast__icon-loading{line-height:0}.zan-toast__icon-loading .zan-loading{width:40px;height:40px}.zan-toast__icon-image{background-size:40px;background-position:center;background-repeat:no-repeat}.zan-toptips{display:block;position:fixed;-webkit-transform:translateZ(0) translateY(-100%);width:100%;min-height:32px;top:0;line-height:2.3;font-size:14px;text-align:center;color:#fff;background-color:#e64340;z-index:110;opacity:0;transition:all .4s ease}.zan-toptips--show{-webkit-transform:translateZ(0) translateY(0);opacity:1} -------------------------------------------------------------------------------- /src/components/card.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 15 | 20 | -------------------------------------------------------------------------------- /src/components/zan/actionsheet.vue: -------------------------------------------------------------------------------- 1 | 42 | 43 | 130 | 131 | 134 | -------------------------------------------------------------------------------- /src/components/zan/capsule.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 39 | 40 | 43 | -------------------------------------------------------------------------------- /src/components/zan/dialog.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 158 | 159 | 162 | -------------------------------------------------------------------------------- /src/components/zan/field.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 101 | 102 | 105 | -------------------------------------------------------------------------------- /src/components/zan/loadmore.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 31 | 32 | 34 | -------------------------------------------------------------------------------- /src/components/zan/noticebar.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 94 | 95 | 98 | -------------------------------------------------------------------------------- /src/components/zan/select.vue: -------------------------------------------------------------------------------- 1 | 23 | 24 | 80 | 81 | 84 | -------------------------------------------------------------------------------- /src/components/zan/stepper.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 113 | 114 | 117 | -------------------------------------------------------------------------------- /src/components/zan/steps.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 34 | 35 | 43 | -------------------------------------------------------------------------------- /src/components/zan/switch.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 20 | 60 | -------------------------------------------------------------------------------- /src/components/zan/tab.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 22 | 49 | 50 | 53 | -------------------------------------------------------------------------------- /src/components/zan/tablist.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 32 | 33 | 36 | -------------------------------------------------------------------------------- /src/components/zan/toast.vue: -------------------------------------------------------------------------------- 1 | 32 | 33 | 106 | 107 | 110 | -------------------------------------------------------------------------------- /src/components/zan/toptips.vue: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 55 | 56 | 59 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App' 3 | 4 | Vue.config.productionTip = false 5 | App.mpType = 'app' 6 | 7 | const app = new Vue(App) 8 | app.$mount() 9 | 10 | export default { 11 | // 这个字段走 app.json 12 | config: { 13 | pages: ['pages/logs/main', 'pages/index/main', '^pages/zan_dashboard/main'], // 页面前带有 ^ 符号的,会被编译成首页,其他页面可以选填,我们会自动把 webpack entry 里面的入口页面加进去 14 | window: { 15 | backgroundTextStyle: 'dark', 16 | navigationBarBackgroundColor: '#FAFAFA', 17 | navigationBarTitleText: 'ZanUI-WeApp', 18 | navigationBarTextStyle: 'black', 19 | backgroundColor: '#f9f9f9' 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/pages/counter/index.vue: -------------------------------------------------------------------------------- 1 | 12 | 13 | 34 | 48 | -------------------------------------------------------------------------------- /src/pages/counter/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/counter/store.js: -------------------------------------------------------------------------------- 1 | // https://vuex.vuejs.org/zh-cn/intro.html 2 | // make sure to call Vue.use(Vuex) if using a module system 3 | import Vue from 'vue' 4 | import Vuex from 'vuex' 5 | 6 | Vue.use(Vuex) 7 | 8 | const store = new Vuex.Store({ 9 | state: { 10 | count: 0 11 | }, 12 | mutations: { 13 | increment: (state) => { 14 | const obj = state 15 | obj.count += 1 16 | }, 17 | decrement: (state) => { 18 | const obj = state 19 | obj.count -= 1 20 | } 21 | } 22 | }) 23 | 24 | export default store 25 | -------------------------------------------------------------------------------- /src/pages/index/index.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 68 | 69 | 98 | -------------------------------------------------------------------------------- /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/logs/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 32 | 33 | 44 | -------------------------------------------------------------------------------- /src/pages/logs/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: '查看启动日志' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_actionsheet/index.vue: -------------------------------------------------------------------------------- 1 | 20 | 21 | 82 | 84 | 86 | -------------------------------------------------------------------------------- /src/pages/zan_actionsheet/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Actionsheet 行动按钮' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_badge/index.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 38 | 40 | 58 | -------------------------------------------------------------------------------- /src/pages/zan_badge/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Badge 徽章' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_btn/index.vue: -------------------------------------------------------------------------------- 1 | 59 | 60 | 80 | 81 | 86 | -------------------------------------------------------------------------------- /src/pages/zan_btn/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | // 这个字段走 app.json 9 | config: { 10 | navigationBarTitleText: 'Button 按钮' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/pages/zan_capsule/index.vue: -------------------------------------------------------------------------------- 1 | 22 | 23 | 50 | 52 | 57 | -------------------------------------------------------------------------------- /src/pages/zan_capsule/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Capsule 胶囊' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_card/index.vue: -------------------------------------------------------------------------------- 1 | 39 | 40 | 50 | 52 | 54 | -------------------------------------------------------------------------------- /src/pages/zan_card/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Card 卡片' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_cell/index.vue: -------------------------------------------------------------------------------- 1 | 122 | 123 | 147 | 149 | 151 | -------------------------------------------------------------------------------- /src/pages/zan_cell/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Cell 单元格' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_dashboard/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | 3 | base: { 4 | title: '基础组件', 5 | content: [{ 6 | name: 'Badge 徽章', 7 | path: '/pages/zan_badge/main' 8 | }, { 9 | name: 'Button 按钮', 10 | path: '/pages/zan_btn/main' 11 | }, { 12 | name: 'Capsule 胶囊', 13 | path: '/pages/zan_capsule/main' 14 | }, { 15 | name: 'Card 卡片', 16 | path: '/pages/zan_card/main' 17 | }, { 18 | name: 'Cell 单元格', 19 | path: '/pages/zan_cell/main' 20 | }, { 21 | name: 'Helper 基础样式', 22 | path: '/pages/zan_helper/main' 23 | }, { 24 | name: 'Icon 图标', 25 | path: '/pages/zan_icon/main' 26 | }, { 27 | name: 'Layout 布局', 28 | path: '/pages/zan_layout/main' 29 | }, { 30 | name: 'Loadmore 加载', 31 | path: '/pages/zan_loadmore/main' 32 | }, { 33 | name: 'Noticebar 通告栏', 34 | path: '/pages/zan_noticebar/main' 35 | }, { 36 | name: 'Panel 面板', 37 | path: '/pages/zan_panel/main' 38 | }, { 39 | name: 'Popup 弹出层', 40 | path: '/pages/zan_popup/main' 41 | }, { 42 | name: 'Select 选择', 43 | path: '/pages/zan_select/main' 44 | }, { 45 | name: 'Stepper 计数器', 46 | path: '/pages/zan_stepper/main' 47 | }, { 48 | name: 'Steps 步骤条', 49 | path: '/pages/zan_steps/main' 50 | }, { 51 | name: 'Switch 开关', 52 | path: '/pages/zan_switch/main' 53 | }, { 54 | name: 'Tab 标签', 55 | path: '/pages/zan_tab/main' 56 | }, { 57 | name: 'Tag 标记', 58 | path: '/pages/zan_tag/main' 59 | }] 60 | }, 61 | form: { 62 | title: '表单', 63 | content: [{ 64 | name: 'Field 输入框', 65 | path: '/pages/zan_field/main' 66 | }] 67 | }, 68 | action: { 69 | title: '操作反馈', 70 | content: [{ 71 | name: 'Actionsheet 行动按钮', 72 | path: '/pages/zan_actionsheet/main' 73 | }, { 74 | name: 'Dialog 弹出框', 75 | path: '/pages/zan_dialog/main' 76 | }, { 77 | name: 'Toast 轻提示', 78 | path: '/pages/zan_toast/main' 79 | }, { 80 | name: 'TopTips 顶部提示', 81 | path: '/pages/zan_toptips/main' 82 | }] 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/pages/zan_dashboard/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 29 | 30 | 38 | -------------------------------------------------------------------------------- /src/pages/zan_dashboard/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | 'navigationBarBackgroundColor': '#FAFAFA', 10 | 'navigationBarTitleText': 'ZanUI-WeApp' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/pages/zan_dialog/index.vue: -------------------------------------------------------------------------------- 1 | 15 | 106 | 108 | -------------------------------------------------------------------------------- /src/pages/zan_dialog/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Dialog 弹出框' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_field/config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 基础类型输入框配置 3 | base: { 4 | asdname: { 5 | focus: true, 6 | title: '收货人', 7 | placeholder: '名字', 8 | componentId: 'name' 9 | }, 10 | tel: { 11 | error: true, 12 | title: '联系电话', 13 | inputType: 'number', 14 | placeholder: '请输入手机号', 15 | componentId: 'tel' 16 | }, 17 | address: { 18 | title: '详细地址', 19 | type: 'textarea', 20 | placeholder: '请输入详细地址', 21 | componentId: 'address' 22 | } 23 | }, 24 | // 无标题输入框 25 | notitle: { 26 | placeholder: '请输入收货人姓名', 27 | componentId: 'notitle' 28 | }, 29 | // 圆角输入框 30 | radius: { 31 | totalPrice: { 32 | right: true, 33 | mode: 'wrapped', 34 | title: '消费总额', 35 | inputType: 'number', 36 | placeholder: '询问收银员后输入', 37 | componentId: 'totalPrice' 38 | }, 39 | excludePrice: { 40 | right: true, 41 | error: true, 42 | mode: 'wrapped', 43 | title: '不参与优惠金额', 44 | inputType: 'number', 45 | placeholder: '询问收银员后输入', 46 | componentId: 'excludePrice' 47 | }, 48 | notitle: { 49 | mode: 'wrapped', 50 | inputType: 'number', 51 | placeholder: '请输入消费金额', 52 | componentId: 'notile-radius' 53 | } 54 | }, 55 | // Form 中使用输入框 56 | form: { 57 | name1: { 58 | placeholder: '请输入收货人姓名', 59 | componentId: 'form:test:name' 60 | }, 61 | tel: { 62 | name: 'tel', 63 | inputType: 'tel', 64 | placeholder: '请输入收货人手机号码', 65 | componentId: 'form:test:tel' 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/pages/zan_field/index.vue: -------------------------------------------------------------------------------- 1 | 125 | 126 | 273 | 292 | -------------------------------------------------------------------------------- /src/pages/zan_field/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Field 输入框' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_helper/index.vue: -------------------------------------------------------------------------------- 1 | 80 | 81 | 91 | 93 | -------------------------------------------------------------------------------- /src/pages/zan_helper/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Helper 基础样式' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_icon/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 118 | 134 | -------------------------------------------------------------------------------- /src/pages/zan_icon/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Icon 图标' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_layout/index.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 45 | 58 | -------------------------------------------------------------------------------- /src/pages/zan_layout/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Layout 布局' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_loadmore/index.vue: -------------------------------------------------------------------------------- 1 | 11 | 12 | 23 | 25 | -------------------------------------------------------------------------------- /src/pages/zan_loadmore/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Loadmore 加载' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_noticebar/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 63 | 65 | -------------------------------------------------------------------------------- /src/pages/zan_noticebar/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Noticebar 通告栏' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_panel/index.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | 36 | 38 | -------------------------------------------------------------------------------- /src/pages/zan_panel/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Panel 面板' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_popup/index.vue: -------------------------------------------------------------------------------- 1 | 77 | 78 | 112 | 144 | -------------------------------------------------------------------------------- /src/pages/zan_popup/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Popup 弹出层' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_select/index.vue: -------------------------------------------------------------------------------- 1 | 38 | 39 | 83 | 85 | -------------------------------------------------------------------------------- /src/pages/zan_select/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Select 选择' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_stepper/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 55 | 57 | -------------------------------------------------------------------------------- /src/pages/zan_stepper/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Stepper 计数器' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_steps/index.vue: -------------------------------------------------------------------------------- 1 | 73 | 74 | 151 | 154 | -------------------------------------------------------------------------------- /src/pages/zan_steps/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Steps 步骤条' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_switch/index.vue: -------------------------------------------------------------------------------- 1 | 25 | 26 | 66 | 74 | -------------------------------------------------------------------------------- /src/pages/zan_switch/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Switch 开关' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_tab/index.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 105 | 108 | -------------------------------------------------------------------------------- /src/pages/zan_tab/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Tab 标签' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_tag/index.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 38 | 43 | -------------------------------------------------------------------------------- /src/pages/zan_tag/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Tag 标记' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_toast/index.vue: -------------------------------------------------------------------------------- 1 | 35 | 36 | 88 | 90 | -------------------------------------------------------------------------------- /src/pages/zan_toast/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Tag 标记' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/zan_toptips/index.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 36 | 39 | -------------------------------------------------------------------------------- /src/pages/zan_toptips/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './index' 3 | 4 | const app = new Vue(App) 5 | app.$mount() 6 | 7 | export default { 8 | config: { 9 | navigationBarTitleText: 'Toptips 顶部提示' 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/utils/helper.js: -------------------------------------------------------------------------------- 1 | // 从事件对象中解析得到 componentId 2 | // 需要在元素上声明 data-component-id 3 | export const getComponentByTag = (parent, tag) => { 4 | for (let c of parent.$children) { 5 | if (c.$options._componentTag === tag) { 6 | return c 7 | } 8 | } 9 | } 10 | 11 | export const extractComponentId = (event = {}) => { 12 | const { dataset: { componentId } } = event.currentTarget || {} 13 | return componentId 14 | } 15 | 16 | /* 17 | 注:默认合并所有生命周期函数 18 | 配置合并指定的生命周期 or 忽略指定字段 19 | const extend = extendCreator({ 20 | life: ['onLoad', 'onPullDownRefresh'], 21 | exclude: ['binder'] 22 | }); 23 | 24 | Page(extend({}, { 25 | onLoad() {}, 26 | ... 27 | })); 28 | */ 29 | 30 | const LIFE_CYCLE = ['onLoad', 'onReady', 'onShow', 'onHide', 'onUnload', 'onPullDownRefresh', 'onReachBottom', 'onShareAppMessage', 'onPageScroll'] 31 | 32 | const extendCreator = (config = {}) => { 33 | const { 34 | life = LIFE_CYCLE, 35 | exclude = [] 36 | } = config 37 | 38 | const excludeList = exclude.concat(LIFE_CYCLE.map(getFuncArrayName)) 39 | 40 | if (!Array.isArray(life) || !Array.isArray(exclude)) throw new Error('Invalid Extend Config') 41 | let lifeCycleList = life.filter(item => LIFE_CYCLE.indexOf(item) >= 0) 42 | return function extend (target, ...objList) { 43 | objList.forEach((source) => { 44 | if (source) { 45 | let keys = Object.keys(source) 46 | keys.forEach((key) => { 47 | let value = source[key] 48 | if (excludeList.indexOf(key) >= 0) return 49 | if (lifeCycleList.indexOf(key) >= 0 && typeof value === 'function') { 50 | let funcArrayName = getFuncArrayName(key) 51 | if (!target[funcArrayName]) { 52 | target[funcArrayName] = [] 53 | if (target[key]) { 54 | target[funcArrayName].push(target[key]) 55 | } 56 | target[key] = function (...rest) { 57 | target[funcArrayName].forEach(func => func.apply(this, rest)) 58 | } 59 | } 60 | 61 | if (source[funcArrayName]) { 62 | // 经过生命周期合并的组件直接整合函数列表 63 | target[funcArrayName].push(...source[funcArrayName]) 64 | } else { 65 | // 添加生命周期函数进入函数列表 66 | target[funcArrayName].push(value) 67 | } 68 | } else { 69 | target[key] = value 70 | } 71 | }) 72 | } 73 | }) 74 | return target 75 | } 76 | } 77 | 78 | const getFuncArrayName = name => `__$${name}` 79 | 80 | export default { 81 | extractComponentId, 82 | extend: Object.assign, 83 | extendCreator 84 | } 85 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /static/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armyja/mpvue-zanui/a4bbefb2498fda45a0d0233d6292577839a04a09/static/.gitkeep --------------------------------------------------------------------------------