├── .babelrc
├── .editorconfig
├── .gitignore
├── .postcssrc.js
├── README.md
├── build
├── build.js
├── check-versions.js
├── dev-client.js
├── dev-server.js
├── utils.js
├── vue-loader.conf.js
├── webpack.base.conf.js
├── webpack.dev.conf.js
└── webpack.prod.conf.js
├── config
├── dev.env.js
├── index.js
└── prod.env.js
├── images
├── goods.png
└── goods1.jpg
├── index.html
├── package.json
├── project.config.json
├── src
├── App.vue
├── api
│ └── config.js
├── components
│ └── card.vue
├── iconfont
│ ├── iconfont.css
│ ├── iconfont.eot
│ ├── iconfont.svg
│ ├── iconfont.ttf
│ └── iconfont.woff
├── main.js
├── minxins
│ └── index.js
├── pages
│ ├── addaddress
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── address
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── addressSelect
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── branddetail
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── brandlist
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── cart
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── category
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── categorylist
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── collectlist
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── counter
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── store.js
│ ├── feedback
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── goods
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── index
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── login
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── logs
│ │ ├── index.vue
│ │ └── main.js
│ ├── mappage
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── my
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── newgoods
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── order
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── practice
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── search
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ ├── topic
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
│ └── topicdetail
│ │ ├── index.vue
│ │ ├── main.js
│ │ └── style.scss
├── store
│ └── index.js
└── utils
│ ├── amap-wx.js
│ └── index.js
└── static
├── .gitkeep
├── 1.png
├── 2.png
├── 3.png
├── 4.png
├── 5.png
├── 6.png
└── images
├── address-bg-bd.png
├── address_right.png
├── bgnew.png
├── bgtopic.png
├── checkbox.png
├── clear_input.png
├── close.png
├── del-address.png
├── detail_back.png
├── detail_kefu.png
├── edit.png
├── gif.png
├── go.png
├── ic_menu_choice_nor.png
├── ic_menu_choice_pressed.png
├── ic_menu_me_nor.png
├── ic_menu_me_pressed.png
├── ic_menu_shoping_nor.png
├── ic_menu_shoping_pressed.png
├── ic_menu_sort_nor.png
├── ic_menu_sort_pressed.png
├── ic_menu_topic_nor.png
├── ic_menu_topic_pressed.png
├── icon_close.png
├── icon_collect.png
├── icon_collect_checked.png
├── icon_error.png
├── icon_go_more.png
├── logo.png
├── logo1.png
├── logo1_02.gif
├── marker.png
├── new.png
├── right.png
├── rightbig.png
├── rightnew.png
├── righttopic.png
├── search.png
├── top.png
└── wxpay.png
/.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 |
--------------------------------------------------------------------------------
/.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 | package-lock.json
15 |
--------------------------------------------------------------------------------
/.postcssrc.js:
--------------------------------------------------------------------------------
1 | // https://github.com/michael-ciniawsky/postcss-load-config
2 |
3 | module.exports = {
4 | "plugins": {
5 | "postcss-mpvue-wxss": {}
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # mpvue 仿网易严选
2 |
3 | ## 如何开启项目?
4 | ```javascript
5 | git clone https://github.com/heyushuo/mpvue-shop.git
6 |
7 | npm install //推荐使用cnpm进行安装,百度淘宝镜像
8 | //开启项目
9 | npm run dev
10 |
11 | //最后通过微信开发者工具打开项目,就可以运行项目了
12 | ```
13 | **2019年10月18日**:建议本地自己搭建后台非常简单(搭建后台进行了简化),方便自己调试, 小程序后端 [点击进入小程序服务端源码地址](https://github.com/heyushuo/mpvue-shop-node)
14 |
15 | **2019年8月26日**:由于域名和证书到期了,以前下载项目的接口请求不到了,需要把请求的域名换成ip加端口
16 | ```javascript
17 | //在utils文件下的index.js里,把host换成ip加端口
18 |
19 | const host = "https://www.heyuhsuo.xyz";
20 | // 换成下边的
21 | const host = "http://118.25.222.68:5757/heyushuo";
22 | ```
23 | **2019 年 2 月 15 日**:最近有人下载项目安装依赖后无法运行代码,因为 mpvue 跟新导致的,需要进行版本锁定,如下修改 package.json 文件.删除**node_modules**,重新安装依赖
24 |
25 | ```javascript
26 | "mpvue": "1.0.18",
27 | "mpvue-template-compiler": "1.0.18",
28 | ```
29 |
30 | **2018 年 10 月 26 日 :** 在 src 目录下新增了**minxins 文件夹**,这里主要为了解决跳转同一个页面数据数据没有初始化问题,全局添加混合组件,不需要再每个页面 onload 的时候进行初始化数据了
31 | //在 main.js 里引入此混合组件
32 | //全局处理重复页面跳转详情初始化,和详情跳详情返回的 bug
33 | import MyPlugin from './minxins'
34 | Vue.use(MyPlugin)
35 |
36 | **2018 年 9 月 13 日 :** 新增了**VUEX**的引入,在 store 问价夹里并且在首页的城市获取,和自己选择城市的页面中使用了 VUEX,**大家可以参考 mpvue 中如何引入和使用 vuex 的**
37 |
38 | **2018 年 9 月 6 日 :** 在首页顶部新增搜索以及引入高德地图 api
39 |
40 | **1.用户同意获取授权和用户不同意获取授权两种情况**
41 |
42 | 
43 | 
44 |
45 | **2018 年 9 月 5 日 :** 在商品详情页面新增商品转发功能(分享功能)
46 |
47 | 
48 |
49 | **2018 年 8 月 30 日 :** 好多人反映登录无法登录,因为这个需要自己配置后台才可以,为了可以让大家体验登录后的一些操作,在这里我**添加了默认用户,大家可以体验其他功能!**
50 | 这里可能会遇到问题:**大家都是使用的这一个账号,添加购物车,收藏还有一些收货地址之类的可能会显示很多人添加的,我会定期删除线上默认用户的这些信息,** **抓紧 clone 最新的代码体验**
51 |
52 | # 大家也可以自己默认账户信息
53 |
54 | 大家也可以在App.vue设置自己的默认账户信息(这样就不会和大家冲突了)
55 | openId修改为一个唯一的值就行
56 |
57 | var userInfo = {"openId":"oQmbb4sNZdxaUQZ0sfYgvtOP2S7c","nickName":"何玉硕","gender":1,"language":"zh_CN","city":"Changping","province":"Beijing","country":"China","avatarUrl":"https://wx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTIbWFEIJj8IpGeHM7dGic1aTFZALjWcMm9ltWfFiaQfVRYticWBfgGfzXWMt2EkJWiaicPtftHAlWxUibxQ/132","watermark":{"timestamp":1535513485,"appid":"wx601ce71bde7b9add"}};
58 | var openId = userInfo.openId;
59 | wx.setStorageSync("userInfo", userInfo);
60 | wx.setStorageSync("openId", openId);
61 |
62 | # 前言
63 |
64 | 一直打算自己写接口,写一个上线的小程序,数据方面总是无从下手,无意中发现一个网友爬取的网易严选商城的一些数据大概一共有 20 张左右的表,算是相当详细了(对其中部分表的字段和部分数据进行了修改,)平时写项目大部分用的 vue,所以直接选择了 mpvue 开发,后端一开始打算用 php 但是学了半个月感觉需要学的东西太多,短时间里写不出这个线上小程序,最后决定用 node 来开发提供接口。
65 |
66 | ## 此项目仅供学习参考
67 |
68 | # 技术站
69 |
70 | 前端:小程序、mpvue、async、await
71 |
72 | 后端:Node、koa2、mysql、knex.js 操作数据库,可视化工具使用的 Navicat
73 |
74 | ## 运行方法
75 |
76 | npm install 下载依赖
77 | npm run dev 运行项目
78 | 这里部分项目的接口都可以访问了,但是登录接口不可以,只有本地搭建一套才可以使用登录接口
79 | 因为你用的自己的Appi打开微信开发者工具,无法调用我这边的登录,我后台默认是自己的Appid
80 |
81 | # 目前上线状态
82 |
83 | 由于域名备案小程序暂时无法上线,但是**小程序的服务端已经上线,接口都是访问的线上接口**,你只需要把源码克隆到本地,**直接在微信开发者工具中,就能请求到数据,看到效果** ,备案通过后会把二维码添加进来
84 |
85 | # 喜欢的希望大家点个 star 鼓励一下,谢谢大家的支持!!!!
86 |
87 | # 商城主要实现的功能
88 |
89 | * 首页、专题、分类、购物车、我的
90 | * 小程序授权登陆获取用户信息
91 | * 首页包含品牌制造页、品牌制造详情页面、新品首发页面、人气推荐页面、各分类列表
92 | * 商品详情页面,包含常见问题、大家都在看商品列表、加入购物车、收藏商品、立即购买、下订单、选择收货地址
93 | * 搜索功能,包含历史记录、热门搜索、搜索后列表展示、模糊搜索提示
94 | * 商品列表部分包含综合、价格高低进行排序
95 | * 专题功能,包含专题详情、专题推荐列表
96 | * 分类,包含左边大分类和右边详细分类
97 | * 购物车,包含商品单选全选、左滑删除商品、下订单等功能
98 | * 地址管理,包含新建地址和导入微信地址,地址编辑、左滑删除、设置默认地址
99 | * 我的页,包含我的收藏、地址管理、意见反馈
100 |
101 | # 部分效果展示
102 |
103 | ### 1.首页展示和专题页效果
104 |
105 | 
106 | 
107 |
108 | ### 2、分类页面,分类子页面以及搜索功能、搜索列表、历史记录、模糊搜索提示
109 |
110 | 
111 | 
112 |
113 | ### 3、购物车功能添加购物车,单选多选,删除和商品收藏功能
114 |
115 | 
116 | 
117 |
118 | ### 4、地址管理
119 |
120 | 
121 |
122 | # 小程序后端送门 [点击进入小程序服务端地址](https://github.com/heyushuo/mpvue-shop-node)
123 |
124 | # 项目总结和遇到的一些问题 # [点击进入博客查看详情](https://juejin.im/post/5b6323baf265da0f5511533a)
125 |
126 | # 最后
127 |
128 | * 喜欢的记得点个 star,鼓励一下谢谢哈!!
129 | * 微信号 hys838723
130 | * qq 群号 647099996
131 |
--------------------------------------------------------------------------------
/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: /\.vue$/,
54 | loader: 'mpvue-loader',
55 | options: vueLoaderConfig
56 | },
57 | {
58 | test: /\.js$/,
59 | include: [resolve('src'), resolve('test')],
60 | use: [
61 | 'babel-loader',
62 | {
63 | loader: 'mpvue-loader',
64 | options: {
65 | checkMPEntry: true
66 | }
67 | },
68 | ]
69 | },
70 | {
71 | test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
72 | loader: 'url-loader',
73 | options: {
74 | limit: 10000,
75 | name: utils.assetsPath('img/[name].[ext]')
76 | }
77 | },
78 | {
79 | test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
80 | loader: 'url-loader',
81 | options: {
82 | limit: 10000,
83 | name: utils.assetsPath('media/[name]].[ext]')
84 | }
85 | },
86 | {
87 | test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
88 | loader: 'url-loader',
89 | options: {
90 | limit: 10000,
91 | name: utils.assetsPath('fonts/[name].[ext]')
92 | }
93 | }
94 | ]
95 | },
96 | plugins: [
97 | new MpvuePlugin()
98 | ]
99 | }
100 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/images/goods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/images/goods.png
--------------------------------------------------------------------------------
/images/goods1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/images/goods1.jpg
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | mpvue
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mpvue",
3 | "version": "1.0.0",
4 | "description": "A Mpvue project",
5 | "author": "heyushuo <1007561607@qq.com>",
6 | "private": true,
7 | "scripts": {
8 | "dev": "node build/dev-server.js",
9 | "start": "node build/dev-server.js",
10 | "build": "node build/build.js"
11 | },
12 | "dependencies": {
13 | "mpvue": "1.0.18",
14 | "mpvue-wxparse": "^0.6.4",
15 | "vuex": "^3.0.1",
16 | "wafer2-client-sdk": "^2.1.0"
17 | },
18 | "devDependencies": {
19 | "babel-core": "^6.22.1",
20 | "babel-loader": "^7.1.1",
21 | "babel-plugin-transform-runtime": "^6.22.0",
22 | "babel-preset-env": "^1.3.2",
23 | "babel-preset-stage-2": "^6.22.0",
24 | "babel-register": "^6.22.0",
25 | "chalk": "^2.4.0",
26 | "connect-history-api-fallback": "^1.3.0",
27 | "copy-webpack-plugin": "^4.5.1",
28 | "css-loader": "^0.28.11",
29 | "cssnano": "^3.10.0",
30 | "eventsource-polyfill": "^0.9.6",
31 | "express": "^4.16.3",
32 | "extract-text-webpack-plugin": "^3.0.2",
33 | "file-loader": "^1.1.11",
34 | "friendly-errors-webpack-plugin": "^1.7.0",
35 | "glob": "^7.1.2",
36 | "html-webpack-plugin": "^3.2.0",
37 | "http-proxy-middleware": "^0.18.0",
38 | "mpvue-loader": "1.0.13",
39 | "mpvue-template-compiler": "1.0.18",
40 | "mpvue-webpack-target": "^1.0.0",
41 | "node-sass": "^4.9.2",
42 | "optimize-css-assets-webpack-plugin": "^3.2.0",
43 | "ora": "^2.0.0",
44 | "portfinder": "^1.0.13",
45 | "postcss-loader": "^2.1.4",
46 | "postcss-mpvue-wxss": "^1.0.0",
47 | "prettier": "~1.12.1",
48 | "px2rpx-loader": "^0.1.10",
49 | "relative": "^3.0.2",
50 | "rimraf": "^2.6.0",
51 | "sass-loader": "^7.0.3",
52 | "semver": "^5.3.0",
53 | "shelljs": "^0.8.1",
54 | "uglifyjs-webpack-plugin": "^1.2.5",
55 | "url-loader": "^1.0.1",
56 | "vue-style-loader": "^4.1.0",
57 | "webpack": "^3.11.0",
58 | "webpack-bundle-analyzer": "^2.2.1",
59 | "webpack-dev-middleware-hard-disk": "^1.12.0",
60 | "webpack-merge": "^4.1.0",
61 | "webpack-mpvue-asset-plugin": "0.0.2"
62 | },
63 | "engines": {
64 | "node": ">= 4.0.0",
65 | "npm": ">= 3.0.0"
66 | },
67 | "browserslist": [
68 | "> 1%",
69 | "last 2 versions",
70 | "not ie <= 8"
71 | ]
72 | }
73 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": false,
5 | "es6": false,
6 | "postcss": true,
7 | "minified": true,
8 | "newFeature": true
9 | },
10 | "miniprogramRoot": "dist/",
11 | "qcloudRoot": "server/",
12 | "compileType": "miniprogram",
13 | "appid": "wx601ce71bde7b9add",
14 | "projectname": "mpvue-shop-ceshibanben",
15 | "libVersion": "2.2.4",
16 | "simulatorType": "wechat",
17 | "simulatorPluginLibVersion": {},
18 | "condition": {
19 | "search": {
20 | "current": -1,
21 | "list": []
22 | },
23 | "conversation": {
24 | "current": -1,
25 | "list": []
26 | },
27 | "game": {
28 | "currentL": -1,
29 | "list": []
30 | },
31 | "miniprogram": {
32 | "current": -1,
33 | "list": []
34 | }
35 | }
36 | }
--------------------------------------------------------------------------------
/src/App.vue:
--------------------------------------------------------------------------------
1 |
34 |
35 |
87 |
--------------------------------------------------------------------------------
/src/api/config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 请求数据的url
3 | */
4 | exports = {
5 | //首页数据
6 | indexData: '/home/index'
7 | }
8 |
--------------------------------------------------------------------------------
/src/components/card.vue:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
14 |
15 |
20 |
--------------------------------------------------------------------------------
/src/iconfont/iconfont.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: "iconfont";
3 | src: url('iconfont.eot?t=1533531541612');
4 | /* IE9*/
5 | src: url('iconfont.eot?t=1533531541612#iefix') format('embedded-opentype'), /* IE6-IE8 */
6 | url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAA1wAAsAAAAAE0wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZXQkqTY21hcAAAAYAAAAC0AAACTAWcDmVnbHlmAAACNAAACMUAAAvIwTXJDGhlYWQAAAr8AAAAMQAAADYSOTDUaGhlYQAACzAAAAAgAAAAJAfcA5tobXR4AAALUAAAAB0AAAAwL/j//WxvY2EAAAtwAAAAGgAAABoS+A8YbWF4cAAAC4wAAAAfAAAAIAEfAM5uYW1lAAALrAAAAUUAAAJtPlT+fXBvc3QAAAz0AAAAewAAAKU8as1aeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2Bk/s84gYGVgYOpk+kMAwNDP4RmfM1gxMjBwMDEwMrMgBUEpLmmMDgwVLxYyNzwv4EhhrmR4QpQmBEkBwA0uw1reJzFkrENg0AMRf8FciGQIhXKAJRpqRmBnoI5mCATZAFWSJWWZT5sQf5hmkjQJj69k/zPsi37ABwBROIuYsC94RDsJdUteoR00WM85N9wlZKgo2fOghVrNmw5jOXUz7Mi9l+2zCnj1gkvB2TqL1Vlj7OqnlQXzu9k+oG5/5X+tstyP1cvE92KWqQ3ND8wN0IMCyPsnJURdsvaCPtnYyDkaA3NHhyM8FfG0tA+MPUGkg8oYDvkeJxtVmuMG1cVvufeO3de9ozHM+OxvWt7/Zrxrr3r9XPUdnfd0ICSpqWlJTSJKpL9QxCP9KG2QbQlLVEhpRGh/YFEEeqDAE0i9Vf7A6mKSoUqhNSCFFIIP4hQi5AQ6b8+pMYO59pd2iBmxueec18+557vnHOJQsiVv7NXWJa4pEE6ZDu5lRAQTahYtADlqL9Cm+CXFT/wLBZVo7JaraywdQgqwst0h/0wEKqwwYIi9MrdYbRCIxj0N+h10M0UAHJz+dvT9fk0+xEY2aj42ORG+jz4peq8vbE82dkaed0FVzucSKdz6fRxTSiKRim3LfhmkNEV3RCTk4qd918pLdISJHJR/qa9yYW59Oax/qFCPdABHnkE3LkF61cjJ+/g91A+46ZzaiqpZfPJas2Dw++YWTdRCN8m+HC0tcUJaxGTBGSO3CItJWqGBEMSh4StQLQBcRECC6KeX3VDi6rBButmgiL4nk2FasHsK0APbYxx9gYb9MNoBSi5MLkoBJQvXICyEJOLF179SFE+enVKL+3bt9za0akqNyt+2Fhd8VyX634y8OYUK6ko6k1U54qS9wqhaxQK2V2sJTf41IaXP7e1FdI399LjkGlvbyYrqwXHsd1G1jLzWcuz5gwrsFDMZ8vzrqIHbq5VWPLCtWxhXtovfX0fO0o/IEnikZAskRU8gTJa5KDRZbTGiYKqCKOBi31lPA4H+8q+yMSBUvanL31hcu/qiNLRKny4ej28/YO7IKC/hGFjsndxADBYhFDxv3zvhMJjkwflj74Po/b4zvYIsKXLP3wCTPfQ+N5GDBA36I2LQ7hb/xqnJ7v3d6SOcGVy5Tvoo0dJjAKqgJogDaNrIJQwCxBoI9iAiKHKM2+5s1lhFGR6sx72lP7a9fc8eU/30YBRVW1oGgVOba2ha/SS8q325kub3R+rnxXHepsvHcgVM4XgrqN3b3srwXaxNlNuVPi6RYFRk1r65T4uNpilswf4tVzZKViNTZ5nAy52CBC3q9goO/Fg2ZUrEmD0fTIgD5HfoO5hxUa9MUxKUJXBch34VQu8TNDzZeSsAyqL0KkOejKMmhCvdoZ9CAf9eBh34mG/DZ0wmolo1TCM0FEBLsfX91ShdlS59ZZkAbpJ+jCSp6UuAroRl45gGA8HYRvCvmT7kWRx1w309zATeDJ2MYD9DO7kSdYLMrNNLaAvaoH68MNqxtb2x6Ztm/v3T6mdsfd/IsabKuRm+M0rCtcpT9gpgPr65d+uhdSxTU51poh8XigMB03boeEaW1uvA6TsxLWTg5ODRg3dkxSuAJhnjsPmAVBIcqA1g3XNKvoiKTwFYI47Dp8DUDyRZECr9CuqVNAO1AOo1C2A6IcjUqkjU/YW7NzU/MkvNC1tYW4p7i4IRVhpTUuZdiPI3qkod2aDhm2mZhNEYXdR+b8Tfga5luCeJTIlXW8VudNzeLGl68VAWB5XlnOU5pYVOSEoXjWhlJETRCsnsU0x/s6zV9kSqZFdU3S36QpUhE0tiqeuCsyh3REEmQ3axswC6A/0hSoqbYl9gZ4dxEPkpVfx6+JgCcOB/VqUvL9t6tWlqn7goldK6tbJkKdqQTr12mvpxUqKhyctffSiyRoguMH+mEz+QdeBL1LzRc71dy31q9zlB1XrXZ3DJTfLyq+nfT/9epllw7r97EWvltUOHtRpUPMuPmvXzTOmdUnljB4S4hBXQFEu2cYZJUkrLPknVTuXZBWaJLo0mJ2i3ydVcj3ZRnaQnVhZvkD2kONo+TAeIExl5vFlcvUQgqr/cQ4ayHTaH0bTWPE9US1XwnWYxsqgP8Qig3UlqhYBg0YE/9NGH4fScAUQ2FXcyIJPhZ9srw6/JgzYTyyEa2HcK0hIGomEIeFboG/OhwC2bhp5x3UdXR33VF2ei67SN1X9uXmYk89Vzc8N2zZKKa65rpJtZrnrqdxumJZl3rFXDu2xMtaeKQMnhfO4/MN64QlHcCfjcJH+3qzjB47KU76zlKg1a4kHVV1XDyfqrXDGPjiXsu1SKnXXVpNKYfNt27cqJqpmxLGBapoVy7fXsBNukH93A0hxmv/Ps++ybZioAsRgg7QI6XUqQQhO2SkPyhXhO940iwwcJTOMXXmOKhOZOg76vUH1DADQM+Mv0aXxeSeXS9PTbnbyL81R3uM8lZJ08jtYmrx1+jSldP/4OXq+GaTHkRMABA7d/CfnGjyrpXSuTg5oztHmmeYUJqjXXzAuGsQmbXID4gOBgWjw42lCXwFWqUaYDKuY866BQWdQDaMOBg9sVWuG8zHP9VCQSJqugb8+c47DvpsfrTeQ4eeeYTybz0O0DG463i4oP3vixFnGzpY+c//qcC3eQAEaqtuJgZ+jv2dnT+x9auXYHep02vgYUDG/0FkyEuE3tuWPnGLs1JEjp+hbUMckn0bh89vazZXD20+c3bpnvMG+zprEx1NeJWtoEapYCSMmsT2YqY2aRsPBrHZ5gZvpxlddQKZGRNODYMP3kuWwnPyQQpDlbzz99BscM0e5wV4+duxl1vgwGSYXRrsBdo9mdHkdYH15SkFM/mEhVKBE6eK+Nq7E9Zu38cKO23ApbvDFHZO3cbj238Wj3Ytbi5ESDW15h/0Uc5aNN8QqiUgfo/k+8jheJ/CGMHD6w7iM1yPHE3XEUH0arLO+Asi+QRkNl9PwGuVY0Pu0wCohhiqN8KIlyxpmAkuWenzRmzHOkaVPjkwLHJIo42fU7rQeyooYSm8Ldt34qIwx+jDS8ZN01/hlevryBxL4TJddCv3zeBGuRRYDAqx9W8xaLdAYd+dTubLLgVcdT1cM18j6HcEMtxgubMvmWvPrxWaQ04w4P/DDsgYUC2W+7fY0JR94Dbft0nmwDHjBkDsakz2G1YEHmGUen3UcN63uvvG/LRPGUscJk/QTniaKKbXYrJkp3beVXNFOKJg7FCvdbFohlvflxlrZs4WxUGsPo7SvGHArY4kEVxyzsDhXVbhh1W4WhPwHFNTddwAAAHicY2BkYGAAYr4QhvXx/DZfGbhZGEDgeu+3qTD6/7//OiwMzI1ALgcDE0gUAD3EDFoAAAB4nGNgZGBgbvjfwBDDwvf/HwMDCwMDUAQF8AAAdyoEgHicY2FgYGB+ycDAwgDD//+x8P3/j+CjYgCa9gUiAAAAAAAAAAB2APYBSAGkArYDLAP2BEIEqgUQBeQAAHicY2BkYGDgYTjEwMkAAkxAzAWEDAz/wXwGAB1PAe4AeJxlj01OwzAQhV/6B6QSqqhgh+QFYgEo/RGrblhUavdddN+mTpsqiSPHrdQDcB6OwAk4AtyAO/BIJ5s2lsffvHljTwDc4Acejt8t95E9XDI7cg0XuBeuU38QbpBfhJto41W4Rf1N2MczpsJtdGF5g9e4YvaEd2EPHXwI13CNT+E69S/hBvlbuIk7/Aq30PHqwj7mXle4jUcv9sdWL5xeqeVBxaHJIpM5v4KZXu+Sha3S6pxrW8QmU4OgX0lTnWlb3VPs10PnIhVZk6oJqzpJjMqt2erQBRvn8lGvF4kehCblWGP+tsYCjnEFhSUOjDFCGGSIyujoO1Vm9K+xQ8Jee1Y9zed0WxTU/3OFAQL0z1xTurLSeTpPgT1fG1J1dCtuy56UNJFezUkSskJe1rZUQuoBNmVXjhF6XNGJPyhnSP8ACVpuyAAAAHicbYpBDoIwFAX7EAQLxssY71MV6IPmF2N+Unp6G906q8lkTGV+WPOfARUOqNHgiBYdTrDoMeBskC53J3P2mn2UOVFaFY63q6uzLrR7VK98qZPu7aM+ymu9umn8tmHnQieTk1VpQ9HEdZy0fzJ7zuUIbAI3ijEfduInswA=') format('woff'), url('iconfont.ttf?t=1533531541612') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/
7 | url('iconfont.svg?t=1533531541612#iconfont') format('svg');
8 | /* iOS 4.1- */
9 | }
10 |
11 | .iconfont {
12 | font-family: "iconfont" !important;
13 | font-size: 38rpx;
14 | font-style: normal;
15 | -webkit-font-smoothing: antialiased;
16 | -moz-osx-font-smoothing: grayscale;
17 | }
18 |
19 | .icon-bangzhuzhongxin:before {
20 | content: "\e606";
21 | }
22 |
23 | .icon-unie64a:before {
24 | content: "\e6c1";
25 | }
26 |
27 | .icon-zuji:before {
28 | content: "\e64f";
29 | }
30 |
31 | .icon-youhuiquan:before {
32 | content: "\e624";
33 | }
34 |
35 | .icon-shoucang:before {
36 | content: "\e65a";
37 | }
38 |
39 | .icon-huafeiquan:before {
40 | content: "\e735";
41 | }
42 |
43 | .icon-yijianfankui:before {
44 | content: "\e8a1";
45 | }
46 |
47 | .icon-lianxikefu:before {
48 | content: "\e65e";
49 | }
50 |
51 | .icon-dizhiguanli:before {
52 | content: "\e63f";
53 | }
54 |
55 | .icon-lipin:before {
56 | content: "\e616";
57 | }
58 |
--------------------------------------------------------------------------------
/src/iconfont/iconfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/src/iconfont/iconfont.eot
--------------------------------------------------------------------------------
/src/iconfont/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/src/iconfont/iconfont.ttf
--------------------------------------------------------------------------------
/src/iconfont/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/src/iconfont/iconfont.woff
--------------------------------------------------------------------------------
/src/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './App'
3 |
4 | //全局处理重复页面跳转详情初始化,和详情跳详情返回的bug
5 | import MyPlugin from './minxins'
6 | Vue.use(MyPlugin)
7 |
8 |
9 | //引入store
10 | import store from './store/index'
11 | //把store挂载到全局
12 | Vue.prototype.$store = store;
13 |
14 | Vue.config.productionTip = false
15 | App.mpType = 'app'
16 |
17 | const app = new Vue(App)
18 | app.$mount()
19 |
20 | export default {
21 | // 这个字段走 app.json
22 | config: {
23 | // 页面前带有 ^ 符号的,会被编译成首页,其他页面可以选填,我们会自动把 webpack entry 里面的入口页面加进去
24 | "pages": ["pages/feedback/main", "pages/order/main", "pages/cart/main", "pages/mappage/main", "pages/collectlist/main", "pages/addressSelect/main", "pages/addaddress/main", "pages/address/main", "^pages/index/main", "pages/search/main", "pages/my/main", "pages/login/main", "pages/category/main", "pages/categorylist/main", "pages/topic/main", "pages/goods/main", "pages/logs/main", "pages/branddetail/main", "pages/brandlist/main", "pages/newgoods/main", "pages/practice/main", "pages/topicdetail/main"],
25 | "window": {
26 | "backgroundTextStyle": "light",
27 | "navigationBarBackgroundColor": "#fff",
28 | "navigationBarTitleText": "科比",
29 | "navigationBarTextStyle": "black"
30 | },
31 | "tabBar": {
32 | "backgroundColor": "#fafafa",
33 | "borderStyle": "white",
34 | "selectedColor": "#b4282d",
35 | "color": "#666",
36 | "list": [{
37 | "pagePath": "pages/index/main",
38 | "iconPath": "static/images/ic_menu_choice_nor.png",
39 | "selectedIconPath": "static/images/ic_menu_choice_pressed.png",
40 | "text": "首页"
41 | },
42 | {
43 | "pagePath": "pages/topic/main",
44 | "iconPath": "static/images/ic_menu_topic_nor.png",
45 | "selectedIconPath": "static/images/ic_menu_topic_pressed.png",
46 | "text": "专题"
47 | },
48 | {
49 | "pagePath": "pages/category/main",
50 | "iconPath": "static/images/ic_menu_sort_nor.png",
51 | "selectedIconPath": "static/images/ic_menu_sort_pressed.png",
52 | "text": "分类"
53 | },
54 | {
55 | "pagePath": "pages/cart/main",
56 | "iconPath": "static/images/ic_menu_shoping_nor.png",
57 | "selectedIconPath": "static/images/ic_menu_shoping_pressed.png",
58 | "text": "购物车"
59 | },
60 | {
61 | "pagePath": "pages/my/main",
62 | "iconPath": "static/images/ic_menu_me_nor.png",
63 | "selectedIconPath": "static/images/ic_menu_me_pressed.png",
64 | "text": "我的"
65 | }
66 | ]
67 | },
68 | "permission": {
69 | "scope.userLocation": {
70 | "desc": "你的位置信息将用于小程序学习使用"
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/minxins/index.js:
--------------------------------------------------------------------------------
1 | const pageDatas = {}
2 | let MyPlugin = {};
3 | MyPlugin.install = function(Vue) {
4 | // 添加全局方法或属性
5 | Vue.prototype.$isPage = function isPage() {
6 | return this.$mp && this.$mp.mpType === 'page'
7 | }
8 | Vue.prototype.$pageId = function pageId() {
9 | return this.$isPage() ? this.$mp.page.__wxWebviewId__ : null
10 | }
11 | // 注入组件
12 | Vue.mixin({
13 | methods: {
14 | stashPageData() {
15 | // 备份route和当前数据
16 | return {
17 | data: {
18 | ...this.$data
19 | }
20 | }
21 | },
22 | restorePageData(oldData) {
23 | Object.assign(this.$data, oldData.data)
24 | }
25 | },
26 | onLoad() {
27 | if (this.$isPage()) {
28 | // 新进入页面 初始化数据
29 | Object.assign(this.$data, this.$options.data())
30 | }
31 | },
32 | onUnload() {
33 | if (this.$isPage()) {
34 | // 退出页面,删除数据
35 | delete pageDatas[this.$pageId()]
36 | this.$needReloadPageData = true
37 | console.log(pageDatas);
38 | }
39 | },
40 | onHide() {
41 | if (this.$isPage()) {
42 | // 将要隐藏时,备份数据
43 | pageDatas[this.$pageId()] = this.stashPageData()
44 | console.log(pageDatas);
45 | }
46 | },
47 | onShow() {
48 | if (this.$isPage()) {
49 | // 如果是后退回来的,拿出历史数据来设置data
50 | if (this.$needReloadPageData) {
51 | const oldData = pageDatas[this.$pageId()]
52 | if (oldData) {
53 | this.restorePageData(oldData)
54 | }
55 | this.$needReloadPageData = false
56 | }
57 | }
58 | }
59 | })
60 | }
61 | export default MyPlugin
--------------------------------------------------------------------------------
/src/pages/addaddress/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
22 |
23 |
24 |
25 |
26 |
27 |
30 |
31 |
一键导入微信>
32 |
33 |
34 | 保存
35 |
36 |
37 |
38 |
39 |
144 |
145 |
148 |
--------------------------------------------------------------------------------
/src/pages/addaddress/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/addaddress/style.scss:
--------------------------------------------------------------------------------
1 | .addaddress {
2 | position: absolute;
3 | width: 100%;
4 | height: 100%;
5 | background: #fff;
6 | .item {
7 | width: 690rpx;
8 | height: 70rpx;
9 | line-height: 70rpx;
10 | margin: 0 auto;
11 | padding: 10rpx 0;
12 | border-bottom: 1rpx solid #f4f4f4;
13 | input {
14 | width: 100%;
15 | height: 100%;
16 | }
17 | }
18 | .itemend {
19 | margin-top: 40rpx;
20 | display: flex;
21 | justify-content: space-between;
22 | border: none;
23 | div:nth-child(2) {
24 | color: green;
25 | }
26 | }
27 | .bottom {
28 | position: absolute;
29 | bottom: 0;
30 | left: 0;
31 | right: 0;
32 | text-align: center;
33 | height: 100rpx;
34 | line-height: 100rpx;
35 | background: #B4282D;
36 | color: #fff;
37 | font-size: 32rpx;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/src/pages/address/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
{{item.name}}
11 |
12 | 默认
13 |
14 |
15 |
16 |
{{item.mobile}}
17 |
{{item.address+item.address_detail}}
18 |
19 |
20 |
21 |
22 |
27 |
28 |
29 |
30 |
31 |
34 |
35 |
36 |
37 |
+新建地址
38 |
一键导入微信地址
39 |
40 |
41 |
42 |
43 |
236 |
237 |
240 |
--------------------------------------------------------------------------------
/src/pages/address/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/address/style.scss:
--------------------------------------------------------------------------------
1 | .address {
2 | height: 100%;
3 | display: flex;
4 | flex-direction: column;
5 | background: #fff;
6 | padding-bottom: 110rpx;
7 | box-sizing: border-box; // overflow-x: hidden;
8 | // overflow-y: scroll;
9 | // -webkit-overflow-scrolling: touch;
10 | .addcont {
11 | height: 100%; // padding-bottom: 110rpx;
12 | // box-sizing: border-box;
13 | // overflow-x: hidden;
14 | // overflow-y: scroll;
15 | // -webkit-overflow-scrolling: touch;
16 | .item {
17 | padding: 0 20rpx;
18 | .list {
19 | position: relative;
20 | padding: 30rpx 0;
21 | border-bottom: 1rpx solid #d9d9d9;
22 | .delete {
23 | position: absolute;
24 | width: 100rpx;
25 | top: 0;
26 | right: -120rpx;
27 | text-align: center;
28 | height: 100%;
29 | line-height: 100%;
30 | background: #b4282d;
31 | color: #fff;
32 | transition: all 200ms ease;
33 | display: flex;
34 | align-items: center;
35 | justify-content: center;
36 | div {
37 | color: #fff;
38 | }
39 | }
40 | }
41 | }
42 | }
43 | .addresslist {
44 | width: 100%;
45 | position: relative;
46 | transition: all 300ms ease;
47 | display: flex;
48 | justify-content: space-between;
49 | align-items: center;
50 | div:nth-child(1) {
51 | width: 100rpx;
52 | text-align: center;
53 | overflow: hidden;
54 | text-overflow: ellipsis;
55 | white-space: nowrap;
56 | align-self: flex-start;
57 | .moren {
58 | width: 60rpx;
59 | height: 30rpx;
60 | border: 1rpx solid #b4282d;
61 | text-align: center;
62 | line-height: 30rpx;
63 | color: #b4282d;
64 | margin: 10rpx auto 0 auto;
65 | }
66 | }
67 | .info {
68 | padding: 0 20rpx;
69 | flex: 1; // p:nth-child(1) {}
70 | p:nth-child(2) {
71 | margin-top: 5rpx;
72 | color: #666;
73 | overflow: hidden;
74 | text-overflow: ellipsis;
75 | display: -webkit-box;
76 | -webkit-line-clamp: 2;
77 | -webkit-box-orient: vertical;
78 | }
79 | }
80 | div:nth-child(3) {
81 | width: 50rpx;
82 | height: 50rpx;
83 | margin: 0 20rpx;
84 | background: url('../../../static/images/edit.png') no-repeat;
85 | background-size: 100% 100%;
86 | }
87 | }
88 | .center {
89 | width: 248rpx;
90 | height: 248rpx;
91 | position: absolute;
92 | top: 50%;
93 | left: 50%;
94 | transform: translate3d(-50%, -80%, 0);
95 | background: url('http://yanxuan-static.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png') no-repeat;
96 | background-size: 100% 100%;
97 | p {
98 | position: absolute;
99 | bottom: -20rpx;
100 | left: 0;
101 | right: 0;
102 | text-align: center;
103 | }
104 | }
105 | .bottom {
106 | position: fixed;
107 | bottom: 0;
108 | left: 0;
109 | right: 0;
110 | padding: 30rpx 30rpx;
111 | display: flex;
112 | justify-content: space-between;
113 | background: #fff;
114 | div {
115 | width: 330rpx;
116 | height: 70rpx;
117 | line-height: 70rpx;
118 | text-align: center;
119 | border: 1rpx solid #B4282D;
120 | color: #B4282D;
121 | }
122 | div:nth-child(2) {
123 | border: 1rpx solid green;
124 | color: green;
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/pages/addressSelect/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
{{item.name}}
11 |
12 | 默认
13 |
14 |
15 |
16 |
{{item.mobile}}
17 |
{{item.address+item.address_detail}}
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
+新建地址
33 |
一键导入微信地址
34 |
35 |
36 |
37 |
38 |
98 |
99 |
102 |
--------------------------------------------------------------------------------
/src/pages/addressSelect/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/addressSelect/style.scss:
--------------------------------------------------------------------------------
1 | .address {
2 | height: 100%;
3 | display: flex;
4 | flex-direction: column;
5 | background: #fff;
6 | padding-bottom: 110rpx;
7 | box-sizing: border-box; // overflow-x: hidden;
8 | // overflow-y: scroll;
9 | // -webkit-overflow-scrolling: touch;
10 | .addcont {
11 | height: 100%; // padding-bottom: 110rpx;
12 | // box-sizing: border-box;
13 | // overflow-x: hidden;
14 | // overflow-y: scroll;
15 | // -webkit-overflow-scrolling: touch;
16 | .item {
17 | padding: 0 20rpx;
18 | .list {
19 | position: relative;
20 | padding: 30rpx 0;
21 | border-bottom: 1rpx solid #d9d9d9;
22 | .delete {
23 | position: absolute;
24 | width: 100rpx;
25 | top: 0;
26 | right: -120rpx;
27 | text-align: center;
28 | height: 100%;
29 | line-height: 100%;
30 | background: #b4282d;
31 | color: #fff;
32 | transition: all 200ms ease;
33 | display: flex;
34 | align-items: center;
35 | justify-content: center;
36 | div {
37 | color: #fff;
38 | }
39 | }
40 | }
41 | }
42 | }
43 | .addresslist {
44 | width: 100%;
45 | position: relative;
46 | transition: all 300ms ease;
47 | display: flex;
48 | justify-content: space-between;
49 | align-items: center;
50 | div:nth-child(1) {
51 | width: 100rpx;
52 | text-align: center;
53 | overflow: hidden;
54 | text-overflow: ellipsis;
55 | white-space: nowrap;
56 | align-self: flex-start;
57 | .moren {
58 | width: 60rpx;
59 | height: 30rpx;
60 | border: 1rpx solid #b4282d;
61 | text-align: center;
62 | line-height: 30rpx;
63 | color: #b4282d;
64 | margin: 10rpx auto 0 auto;
65 | }
66 | }
67 | .info {
68 | padding: 0 20rpx;
69 | flex: 1; // p:nth-child(1) {}
70 | p:nth-child(2) {
71 | margin-top: 5rpx;
72 | color: #666;
73 | overflow: hidden;
74 | text-overflow: ellipsis;
75 | display: -webkit-box;
76 | -webkit-line-clamp: 2;
77 | -webkit-box-orient: vertical;
78 | }
79 | }
80 | div:nth-child(3) {
81 | width: 50rpx;
82 | height: 50rpx;
83 | margin: 0 20rpx;
84 | background: url('../../../static/images/edit.png') no-repeat;
85 | background-size: 100% 100%;
86 | }
87 | }
88 | .center {
89 | width: 248rpx;
90 | height: 248rpx;
91 | position: absolute;
92 | top: 50%;
93 | left: 50%;
94 | transform: translate3d(-50%, -80%, 0);
95 | background: url('http://yanxuan-static.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/noAddress-26d570cefa.png') no-repeat;
96 | background-size: 100% 100%;
97 | p {
98 | position: absolute;
99 | bottom: -20rpx;
100 | left: 0;
101 | right: 0;
102 | text-align: center;
103 | }
104 | }
105 | .bottom {
106 | position: fixed;
107 | bottom: 0;
108 | left: 0;
109 | right: 0;
110 | padding: 30rpx 30rpx;
111 | display: flex;
112 | justify-content: space-between;
113 | background: #fff;
114 | div {
115 | width: 330rpx;
116 | height: 70rpx;
117 | line-height: 70rpx;
118 | text-align: center;
119 | border: 1rpx solid #B4282D;
120 | color: #B4282D;
121 | }
122 | div:nth-child(2) {
123 | border: 1rpx solid green;
124 | color: green;
125 | }
126 | }
127 | }
128 |
--------------------------------------------------------------------------------
/src/pages/branddetail/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |

5 |
6 | MUJI制造商
7 |
8 |
9 |
10 | 严选精选了MUJI制造商和生产原料, 用几乎零利润的价格,剔除品牌溢价, 让用户享受原品牌的品质生活。
11 |
12 |
13 |
14 |
![]()
15 |
{{item.name}}
16 |
¥{{item.retail_price}}
17 |
18 |
19 |
20 | 数据库暂无数据...
21 |
22 |
23 |
24 |
25 |
51 |
--------------------------------------------------------------------------------
/src/pages/branddetail/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 | export default {}
7 |
--------------------------------------------------------------------------------
/src/pages/branddetail/style.scss:
--------------------------------------------------------------------------------
1 | .branddetail {
2 | .banner {
3 | width: 100%;
4 | height: 290rpx;
5 | position: relative;
6 | img {
7 | width: 100%;
8 | height: 100%;
9 | }
10 | .info {
11 | text-align: center;
12 | position: absolute;
13 | top: 50%;
14 | left: 50%;
15 | transform: translate3d(-50%, -50%, 0);
16 | span {
17 | font-size: 38rpx;
18 | color: #fff;
19 | border-bottom: 5rpx solid #fff;
20 | padding: 5rpx;
21 | }
22 | }
23 | }
24 | .info-desc {
25 | background: #fff;
26 | padding: 42rpx 32rpx;
27 | font-size: 30rpx;
28 | color: #666;
29 | text-align: center;
30 | }
31 | .sortlist {
32 | margin-top: 20rpx;
33 | display: flex;
34 | justify-content: space-between;
35 | flex-wrap: wrap;
36 | .item {
37 | width: 372.5rpx;
38 | margin-bottom: 5rpx;
39 | text-align: center;
40 | background: #fff;
41 | padding: 15rpx 0;
42 | img {
43 | display: block;
44 | width: 302rpx;
45 | height: 302rpx;
46 | margin: 0 auto;
47 | }
48 | .name {
49 | margin: 15rpx 0 22rpx 0;
50 | text-align: center;
51 | padding: 0 20rpx;
52 | font-size: 24rpx;
53 | }
54 | .price {
55 | text-align: center;
56 | font-size: 30rpx;
57 | color: #b4282d;
58 | }
59 | }
60 | }
61 | .none {
62 | text-align: center;
63 | color: #999;
64 | font-size: 32rpx;
65 | margin-top: 200rpx;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/pages/brandlist/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
![]()
5 |
6 | {{item.name}}
7 | |
8 | {{item.floor_price}}元起
9 |
10 |
11 |
12 |
13 |
14 |
59 |
--------------------------------------------------------------------------------
/src/pages/brandlist/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 | enablePullDownRefresh: true
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/pages/brandlist/style.scss:
--------------------------------------------------------------------------------
1 | .brand {
2 | .list {
3 | width: 750rpx;
4 | height: 416rpx;
5 | position: relative;
6 | margin-bottom: 4rpx;
7 | img {
8 | width: 100%;
9 | height: 100%;
10 | }
11 | .info {
12 | text-align: center;
13 | position: absolute;
14 | top: 50%;
15 | left: 50%;
16 | transform: translate3d(-50%, -50%, 0);
17 | span {
18 | color: #fff;
19 | font-size: 35rpx;
20 | font-weight: bold;
21 | }
22 | span:nth-child(2) {
23 | padding: 0 5rpx;
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/pages/cart/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
30天无忧退货
5 |
48小时快速退款
6 |
满88元免邮费
7 |
8 |
9 |
10 |
12 |
13 |
14 |
15 |
16 |
![]()
17 |
18 |
19 |
{{item.goods_name}}
20 |
¥{{item.retail_price}}
21 |
22 |
23 |
24 |
25 | x{{item.number}}
26 |
27 |
28 |
29 |
30 |
35 |
36 |
37 |
38 |
39 |

40 |
41 |
42 |
43 | 全选({{isCheckedNumber}})
44 |
45 |
46 |
47 | ¥{{allPrise}}
48 |
49 |
下单
50 |
51 |
52 |
53 |
54 |
55 |
279 |
283 |
--------------------------------------------------------------------------------
/src/pages/cart/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/cart/style.scss:
--------------------------------------------------------------------------------
1 | .cart {
2 | overflow-x: hidden;
3 | .top {
4 | display: flex;
5 | justify-content: space-between;
6 | padding: 30rpx 20rpx;
7 | div {
8 | background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png) 0 center no-repeat;
9 | background-size: 10rpx;
10 | padding-left: 15rpx;
11 | display: flex;
12 | align-items: center;
13 | font-size: 25rpx;
14 | color: #666;
15 | }
16 | }
17 | .cartlist {
18 | background: #fff;
19 | margin-bottom: 110rpx;
20 | .item {
21 | padding: 20rpx 0;
22 | border-bottom: 1rpx solid #f4f4f4;
23 | height: 166rpx;
24 | position: relative;
25 | .con {
26 | display: flex;
27 | align-items: center;
28 | justify-content: space-between;
29 | transition: all 300ms ease;
30 | .left {
31 | display: flex;
32 | align-items: center;
33 | width: 80%;
34 | .icon {
35 | height: 125rpx;
36 | width: 34rpx;
37 | background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat center center;
38 | background-size: 34rpx 34rpx;
39 | margin: 0 20rpx;
40 | }
41 | .icon.active {
42 | background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat center center;
43 | background-size: 34rpx 34rpx;
44 | }
45 | .img {
46 | height: 125rpx;
47 | width: 125rpx;
48 | display: block;
49 | background: #f4f4f4;
50 | img {
51 | width: 100%;
52 | height: 100%;
53 | }
54 | }
55 | .info {
56 | width: 50%;
57 | padding: 20rpx;
58 | p {
59 | line-height: 40rpx;
60 | }
61 | }
62 | }
63 | .right {
64 | padding-right: 50rpx;
65 | }
66 | }
67 | .delete {
68 | position: absolute;
69 | width: 100rpx;
70 | top: 0;
71 | right: -100rpx;
72 | text-align: center;
73 | height: 100%;
74 | background: #b4282d;
75 | color: #fff;
76 | transition: all 200ms ease;
77 | display: flex;
78 | align-items: center;
79 | justify-content: center;
80 | div {
81 | color: #fff;
82 | }
83 | }
84 | }
85 | }
86 | .fixed {
87 | position: fixed;
88 | bottom: 0;
89 | left: 0;
90 | height: 100rpx;
91 | line-height: 100rpx;
92 | width: 100%;
93 | background: #fff;
94 | display: flex;
95 | justify-content: space-between;
96 | align-items: center;
97 | .left {
98 | display: flex;
99 | align-items: center;
100 | background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-0e09baa37e.png) no-repeat;
101 | background-size: 34rpx 34rpx;
102 | background-position: 20rpx;
103 | padding-left: 70rpx;
104 | }
105 | .active {
106 | background: url(http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/checkbox-checked-822e54472a.png) no-repeat;
107 | background-size: 34rpx 34rpx;
108 | background-position: 20rpx;
109 | }
110 | .right {
111 | display: flex;
112 | div:nth-child(1) {
113 | color: #b4282d;
114 | padding-right: 40rpx;
115 | }
116 | div:nth-child(2) {
117 | width: 200rpx;
118 | height: 100rpx;
119 | text-align: center;
120 | line-height: 100rpx;
121 | font-size: 29rpx;
122 | background: #b4282d;
123 | color: #fff;
124 | }
125 | }
126 | }
127 | .nogoods {
128 | margin-top: 200rpx;
129 | img {
130 | margin: 0 auto;
131 | display: block;
132 | width: 258rpx;
133 | height: 258rpx;
134 | }
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/src/pages/category/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 商品搜索,共239款好物
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{item.name}}
14 |
15 |
16 |
17 |
18 |
![]()
19 |
20 |
21 | —
22 | {{detailData.name}}分类
23 | —
24 |
25 |
26 |
27 |
![]()
28 |
{{item.name}}
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
81 |
84 |
--------------------------------------------------------------------------------
/src/pages/category/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 | export default {}
7 |
--------------------------------------------------------------------------------
/src/pages/category/style.scss:
--------------------------------------------------------------------------------
1 | .category {
2 | width: 100%;
3 | height: 100%;
4 | display: flex;
5 | flex-direction: column;
6 |
7 | .search {
8 | height: 88rpx;
9 | // width: 100%;
10 | padding: 0 30rpx;
11 | background: #fff;
12 | display: flex;
13 | align-items: center;
14 | border-bottom: 1rpx solid #ededed;
15 |
16 | .ser {
17 | width: 690rpx;
18 | height: 56rpx;
19 | background: #ededed;
20 | border-radius: 8rpx;
21 | display: flex;
22 | align-items: center;
23 | justify-content: center;
24 |
25 | span {
26 | display: inline-block;
27 | }
28 |
29 | .icon {
30 | background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/search2-2fb94833aa.png') center no-repeat;
31 | background-size: 100%;
32 | width: 28rpx;
33 | height: 28rpx;
34 | margin-right: 10rpx;
35 | }
36 | }
37 | }
38 |
39 | .content {
40 | flex: 1;
41 | background: #fff;
42 | display: flex;
43 |
44 | .left {
45 | width: 162rpx;
46 | height: 100%;
47 | text-align: center;
48 |
49 | .iconText {
50 | text-align: center;
51 | line-height: 90rpx;
52 | width: 162rpx;
53 | height: 90rpx;
54 | color: #333;
55 | font-size: 28rpx;
56 | border-left: 6rpx solid #fff;
57 | }
58 |
59 | .active {
60 | color: #ab2b2b;
61 | font-size: 36rpx;
62 | border-left: 6rpx solid #ab2b2b;
63 | }
64 | }
65 |
66 | .right {
67 | flex: 1;
68 | border-left: 1rpx solid #fafafa;
69 | flex: 1;
70 | height: 100%;
71 | padding: 0 30rpx 0 30rpx;
72 |
73 | .banner {
74 | width: 100%;
75 | height: 222rpx;
76 | margin-top: 20rpx;
77 |
78 | img {
79 | width: 100%;
80 | height: 100%;
81 | }
82 | }
83 |
84 | .title {
85 | text-align: center;
86 | padding: 50rpx 0;
87 |
88 | span:nth-child(2) {
89 | font-size: 24rpx;
90 | color: #333;
91 | padding: 0 10rpx;
92 | }
93 |
94 | span:nth-child(2n + 1) {
95 | color: #999;
96 | }
97 | }
98 |
99 | .bottom {
100 | display: flex; // justify-content: space-between;
101 | flex-wrap: wrap;
102 |
103 | .item {
104 | width: 33.33%;
105 | text-align: center;
106 | margin-bottom: 20rpx;
107 |
108 | img {
109 | height: 144rpx;
110 | width: 144rpx;
111 | display: block;
112 | margin: 0 auto;
113 | }
114 | }
115 | }
116 | }
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/src/pages/categorylist/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{item.name}}
6 |
7 |
8 |
9 |
{{currentNav.name}}
10 |
{{currentNav.front_desc}}
11 |
12 |
13 |
14 |
![]()
15 |
{{item.name}}
16 |
¥{{item.retail_price}}
17 |
18 |
19 |
20 | 数据库暂无数据...
21 |
22 |
23 |
24 |
25 |
95 |
98 |
--------------------------------------------------------------------------------
/src/pages/categorylist/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 | export default {}
7 |
--------------------------------------------------------------------------------
/src/pages/categorylist/style.scss:
--------------------------------------------------------------------------------
1 | .categoryList {
2 | width: 100%;
3 | .head {
4 | width: 100%;
5 | height: 84rpx;
6 | line-height: 84rpx;
7 | background: #fff;
8 | white-space: nowrap;
9 | div {
10 | display: inline-block;
11 | padding: 0 20rpx;
12 | margin-left: 20rpx;
13 | }
14 | .active {
15 | color: #ab2b2b;
16 | height: 100%;
17 | border-bottom: 2px solid #ab2b2b;
18 | box-sizing: border-box;
19 | }
20 | }
21 | .info {
22 | text-align: center;
23 | background: #fff;
24 | padding: 30rpx;
25 | margin-top: 20rpx;
26 | margin-bottom: 5rpx;
27 | p:nth-child(1) {
28 | margin-bottom: 18rpx;
29 | font-size: 30rpx;
30 | color: #333;
31 | }
32 | p:nth-child(2) {
33 | display: block;
34 | height: 24rpx;
35 | font-size: 24rpx;
36 | color: #999;
37 | }
38 | }
39 | .list {
40 | width: 100%;
41 | display: flex;
42 | justify-content: space-between;
43 | flex-wrap: wrap;
44 | .item {
45 | width: 372.5rpx;
46 | margin-bottom: 5rpx;
47 | text-align: center;
48 | background: #fff;
49 | padding: 15rpx 0;
50 | img {
51 | display: block;
52 | width: 302rpx;
53 | height: 302rpx;
54 | margin: 0 auto;
55 | }
56 | .name {
57 | margin: 15rpx 0 22rpx 0;
58 | text-align: center;
59 | padding: 0 20rpx;
60 | font-size: 24rpx;
61 | }
62 | .price {
63 | text-align: center;
64 | font-size: 30rpx;
65 | color: #b4282d;
66 | }
67 | }
68 | }
69 | .none {
70 | text-align: center;
71 | margin-top: 100rpx;
72 | color: #999;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/src/pages/collectlist/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 我的收藏
5 |
6 |
7 |
8 |
![]()
9 |
{{subitem.name}}
10 |
¥{{subitem.retail_price}}
11 |
12 |
13 |
14 |
15 |
16 |
55 |
59 |
--------------------------------------------------------------------------------
/src/pages/collectlist/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/collectlist/style.scss:
--------------------------------------------------------------------------------
1 | .collection {
2 | .title {
3 | padding: 20px 0;
4 | text-align: center;
5 | background: #fff;
6 | margin-bottom: 5rpx;
7 | font-size: 36rpx;
8 | font-weight: bold;
9 | }
10 | .sublist {
11 | display: flex;
12 | flex-wrap: wrap;
13 | justify-content: space-between;
14 | width: 730rpx;
15 | margin: 0 auto;
16 | div {
17 | width: 360rpx;
18 | background: #fff;
19 | margin-bottom: 10rpx;
20 | padding-bottom: 10rpx;
21 | img {
22 | display: block;
23 | width: 302rpx;
24 | height: 302rpx;
25 | margin: 0 auto;
26 | }
27 | p {
28 | margin-bottom: 5rpx;
29 | text-indent: 1em;
30 | }
31 | p:nth-child(2) {
32 | overflow: hidden;
33 | text-overflow: ellipsis;
34 | white-space: nowrap;
35 | width: 98%;
36 | }
37 | p:nth-child(3) {
38 | color: #9c3232;
39 | }
40 | }
41 | .last {
42 | display: block;
43 | width: 302rpx;
44 | height: 302rpx;
45 | margin: 0 auto;
46 | display: flex;
47 | flex-direction: column;
48 | align-items: center;
49 | justify-content: center;
50 | flex-wrap: wrap;
51 | p {
52 | height: 33rpx;
53 | width: 100%;
54 | line-height: 33rpx;
55 | color: #333;
56 | font-size: 33rpx;
57 | text-align: center;
58 | }
59 | .icon {
60 | display: inline-block;
61 | width: 70rpx;
62 | height: 70rpx;
63 | background: url('../../../static/images/rightbig.png') no-repeat;
64 | background-size: 100% 100%;
65 | margin-top: 60rpx;
66 | }
67 | }
68 | div:nth-child(2n) {
69 | margin-left: 10rpx;
70 | }
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/pages/counter/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
Vuex counter:{{ count }}
4 |
5 |
6 |
7 |
8 |
9 |
去往首页
10 |
11 |
12 |
13 |
42 |
43 |
56 |
--------------------------------------------------------------------------------
/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 | export default {
7 | config: {
8 | navigationBarTitleText: 'Count页面',
9 | }
10 | }
--------------------------------------------------------------------------------
/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/feedback/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 意见与反馈
5 |
6 |
7 |
8 | {{content.length}}/150
9 |
10 |
11 |
14 |
15 |
16 |
17 | 提交
18 |
19 |
20 |
21 |
22 |
73 |
77 |
--------------------------------------------------------------------------------
/src/pages/feedback/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/feedback/style.scss:
--------------------------------------------------------------------------------
1 | .feedback {
2 | height: 100%;
3 | background: #fff;
4 | padding: 0 20rpx;
5 | .title {
6 | padding: 20rpx 0;
7 | border-bottom: 1rpx solid #d9d9d9;
8 | }
9 | .cont {
10 | position: relative;
11 | border-bottom: 1rpx solid #d9d9d9;
12 | .text {
13 | height: 300rpx;
14 | padding: 20rpx;
15 | }
16 | span {
17 | position: absolute;
18 | right: 20rpx;
19 | bottom: 20rpx;
20 | }
21 | }
22 | .connect {
23 | height: 100rpx;
24 | line-height: 100rpx;
25 | display: flex;
26 | border-bottom: 1rpx solid #d9d9d9;
27 | label {
28 | width: 150rpx;
29 | height: 100%;
30 | display: inline-block;
31 | }
32 | input {
33 | flex: 1;
34 | display: inline-block;
35 | height: 100%;
36 | }
37 | }
38 | .bottom {
39 | text-align: center;
40 | width: 95%;
41 | height: 100rpx;
42 | border-radius: 10rpx;
43 | line-height: 100rpx;
44 | background: #B4282D;
45 | color: #fff;
46 | font-size: 32rpx;
47 | margin: 100rpx auto 0 auto;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/src/pages/goods/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
30天无忧退货
15 |
48小时快速退款
16 |
满88元免邮费
17 |
18 |
19 |
20 |
{{info.name}}
21 |
{{info.goods_brief}}
22 |
¥{{info.retail_price}}
23 |
26 |
27 |
28 |
32 |
36 |
37 |
38 |
39 | 商品参数
40 |
41 |
42 |
{{item.name}}
43 |
{{item.value}}
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
56 |
57 |
58 |
59 |
60 | {{item.question}}
61 |
62 |
63 | {{item.answer}}
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
大家都在看
75 |
76 |
77 |
78 |
79 |
![]()
80 |
{{subitem.name}}
81 |
¥{{subitem.retail_price}}
82 |
83 |
84 |
85 |
86 |
87 |
88 |
94 |
95 |
96 |
97 | {{allnumber}}
98 |
99 |

100 |
101 |
102 |
立即购买
103 |
加入购物车
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
![]()
114 |
115 |
116 |
117 |
价格¥{{info.retail_price}}
118 |
请选择数量
119 |
120 |
121 |
122 | X
123 |
124 |
125 |
126 |
数量
127 |
128 |
-
129 |
130 |
+
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
311 |
315 |
--------------------------------------------------------------------------------
/src/pages/goods/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 | export default {
7 | config: {
8 | "navigationBarTitleText": "商品详情"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/pages/goods/style.scss:
--------------------------------------------------------------------------------
1 | .goods {
2 | overflow: hidden;
3 |
4 | .swiper {
5 | width: 750rpx;
6 | height: 750rpx;
7 | position: relative;
8 |
9 | .swiper-container {
10 | width: 750rpx;
11 | height: 750rpx;
12 |
13 | image {
14 | width: 750rpx;
15 | height: 750rpx;
16 | }
17 | }
18 |
19 | .share {
20 | position: absolute;
21 | border-radius: 40rpx 0 0 40rpx;
22 | width: 150rpx;
23 | height: 65rpx;
24 | line-height: 65rpx;
25 | text-align: center;
26 | right: 0;
27 | top: 50rpx;
28 | background: #e0a354;
29 | color: #fff;
30 | font-size: 24rpx;
31 | }
32 | }
33 |
34 | .swiper-b {
35 | width: 710rpx;
36 | height: 73rpx;
37 | margin: 0 auto;
38 | background: #f4f4f4; // padding: 0 31.25rpx;
39 | display: flex;
40 | align-items: center;
41 | justify-content: space-between;
42 |
43 | div {
44 | background: url('http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/servicePolicyRed-518d32d74b.png') 0 center no-repeat;
45 | background-size: 10rpx;
46 | padding-left: 15rpx;
47 | display: flex;
48 | align-items: center;
49 | font-size: 25rpx;
50 | color: #666;
51 | }
52 | }
53 |
54 | .goods-info {
55 | width: 750rpx;
56 | height: 306rpx;
57 | background: #fff;
58 | margin: 0 auto;
59 | border-bottom: 1rpx solid #f4f4f4;
60 |
61 | .c {
62 | height: 100%;
63 |
64 | p {
65 | display: block;
66 | text-align: center;
67 | }
68 |
69 | p:nth-child(1) {
70 | font-size: 41rpx;
71 | padding: 20rpx;
72 | }
73 |
74 | p:nth-child(2) {
75 | margin-bottom: 25rpx;
76 | font-size: 24rpx;
77 | color: #999;
78 | }
79 |
80 | p:nth-child(3) {
81 | margin-top: 10rpx;
82 | font-size: 35rpx;
83 | color: #b4282d;
84 | }
85 |
86 | .brand {
87 | margin-top: 25rpx;
88 | text-align: center;
89 |
90 | p {
91 | display: inline-block;
92 | color: #b1a279;
93 | font-size: 20rpx;
94 | padding: 5rpx 30rpx;
95 | border: 1rpx solid #b1a279;
96 | }
97 | }
98 | }
99 | }
100 |
101 | .section-nav {
102 | height: 108rpx;
103 | background: #fff;
104 | margin-bottom: 20rpx;
105 | padding: 0 20rpx;
106 | display: flex;
107 | justify-content: space-between;
108 | align-items: center;
109 |
110 | div:nth-child(2) {
111 | width: 52rpx;
112 | height: 52rpx;
113 | background: url('../../../static/images/address_right.png') no-repeat;
114 | background-size: 100% 100%;
115 | }
116 | }
117 |
118 | .attribute {
119 | padding: 20rpx 30rpx;
120 | background: #fff;
121 | margin-bottom: 20rpx;
122 |
123 | .head {
124 | font-size: 38rpx;
125 | padding: 20rpx 0;
126 | }
127 |
128 | .item {
129 | display: flex;
130 | background: #f7f7f7;
131 | padding: 20rpx 0;
132 | margin: 20rpx;
133 |
134 | div:nth-child(1) {
135 | width: 134rpx;
136 | font-size: 25rpx;
137 | color: #999;
138 | }
139 |
140 | div:nth-child(2) {
141 | flex: 1;
142 | overflow: hidden;
143 | text-overflow: ellipsis;
144 | white-space: nowrap;
145 | }
146 | }
147 | }
148 |
149 | .common-problem {
150 | margin-bottom: 110rpx;
151 |
152 | .h {
153 | padding: 35rpx 0;
154 | background: #fff;
155 | text-align: center;
156 | display: flex;
157 | align-items: center;
158 | justify-content: center;
159 |
160 | .line {
161 | display: inline-block;
162 | height: 1rpx;
163 | width: 100rpx;
164 | background: #ccc;
165 | }
166 |
167 | .title {
168 | padding: 0 25rpx;
169 | background: #fff;
170 | }
171 | }
172 |
173 | .b {
174 | padding: 0rpx 30rpx;
175 | background: #fff;
176 |
177 | .item {
178 | padding-bottom: 25rpx;
179 |
180 | .question-box {
181 | display: flex;
182 |
183 | .spot {
184 | height: 8rpx;
185 | width: 8rpx;
186 | background: #b4282d;
187 | border-radius: 50%;
188 | margin-top: 11rpx;
189 | }
190 |
191 | .question {
192 | line-height: 30rpx;
193 | padding-left: 8rpx;
194 | display: block;
195 | font-size: 26rpx;
196 | padding-bottom: 15rpx;
197 | color: #303030;
198 | }
199 | }
200 |
201 | .answer {
202 | line-height: 40rpx;
203 | padding-left: 16rpx;
204 | font-size: 26rpx;
205 | color: #787878;
206 | }
207 | }
208 | }
209 |
210 | .sublist {
211 | display: flex;
212 | flex-wrap: wrap;
213 | justify-content: space-between;
214 | width: 730rpx;
215 | margin: 0 auto;
216 |
217 | div {
218 | width: 360rpx;
219 | background: #fff;
220 | margin-bottom: 10rpx;
221 | padding-bottom: 10rpx;
222 |
223 | img {
224 | display: block;
225 | width: 302rpx;
226 | height: 302rpx;
227 | margin: 0 auto;
228 | }
229 |
230 | p {
231 | margin-bottom: 5rpx;
232 | text-indent: 1em;
233 | }
234 |
235 | p:nth-child(2) {
236 | overflow: hidden;
237 | text-overflow: ellipsis;
238 | white-space: nowrap;
239 | width: 98%;
240 | }
241 |
242 | p:nth-child(3) {
243 | color: #9c3232;
244 | }
245 | }
246 |
247 | .last {
248 | display: block;
249 | width: 302rpx;
250 | height: 302rpx;
251 | margin: 0 auto;
252 | display: flex;
253 | flex-direction: column;
254 | align-items: center;
255 | justify-content: center;
256 | flex-wrap: wrap;
257 |
258 | p {
259 | height: 33rpx;
260 | width: 100%;
261 | line-height: 33rpx;
262 | color: #333;
263 | font-size: 33rpx;
264 | text-align: center;
265 | }
266 |
267 | .icon {
268 | display: inline-block;
269 | width: 70rpx;
270 | height: 70rpx;
271 | background: url('../../../static/images/rightbig.png') no-repeat;
272 | background-size: 100% 100%;
273 | margin-top: 60rpx;
274 | }
275 | }
276 |
277 | div:nth-child(2n) {
278 | margin-left: 10rpx;
279 | }
280 | }
281 | }
282 |
283 | .pop {
284 | position: fixed;
285 | top: 0;
286 | left: 0;
287 | width: 100%;
288 | height: 100%;
289 | background: rgba(0, 0, 0, 0.5);
290 | }
291 |
292 | .attr-pop {
293 | position: fixed;
294 | width: 100%;
295 | height: 500rpx;
296 | bottom: -500rpx;
297 | transition: all 400ms ease;
298 | box-sizing: border-box;
299 | padding: 30rpx;
300 | background: #fff;
301 |
302 | .top {
303 | display: flex;
304 | margin-bottom: 35rpx;
305 | position: relative;
306 |
307 | .close {
308 | position: absolute;
309 | right: 0;
310 | top: 0px;
311 | font-size: 30rpx;
312 | color: #999;
313 | }
314 |
315 | .left {
316 | height: 177rpx;
317 | width: 177rpx;
318 | margin-right: 30rpx;
319 |
320 | img {
321 | float: left;
322 | height: 177rpx;
323 | width: 177rpx;
324 | }
325 | }
326 |
327 | .right {
328 | flex: 1;
329 | display: flex;
330 | align-items: flex-end;
331 |
332 | p {
333 | width: 100%;
334 | line-height: 45rpx;
335 | }
336 |
337 | p:nth-child(1) {
338 | color: #b4282d;
339 | }
340 | }
341 | }
342 |
343 | .b {
344 | .count {
345 | width: 322rpx;
346 | height: 71rpx;
347 | line-height: 71rpx;
348 | display: flex;
349 | border: 1rpx solid #ccc;
350 | margin-top: 20rpx;
351 |
352 | div {
353 | width: 90rpx;
354 | text-align: center;
355 | }
356 |
357 | input {
358 | flex: 1;
359 | height: 100%;
360 | text-align: center;
361 | border-left: 1rpx solid #ccc;
362 | border-right: 1rpx solid #ccc;
363 | }
364 | }
365 | }
366 | }
367 |
368 | .fadeup {
369 | transform: translateY(-500rpx); // transition: all 0.4s ease;
370 | }
371 |
372 | .bottom-fixed {
373 | position: fixed;
374 | bottom: 0;
375 | left: 0;
376 | right: 0;
377 | width: 750rpx;
378 | height: 100rpx;
379 | display: flex;
380 | background: #fff;
381 | z-index: 10;
382 |
383 | div:nth-child(1) {
384 | height: 100rpx;
385 | width: 162rpx;
386 | border: 1rpx solid #f4f4f4;
387 | display: flex;
388 | align-items: center;
389 | justify-content: center;
390 |
391 | .collect {
392 | display: block;
393 | height: 44rpx;
394 | width: 44rpx;
395 | background: url('../../../static/images/icon_collect.png') no-repeat;
396 | background-size: 100% 100%;
397 | }
398 |
399 | .collect.active {
400 | display: block;
401 | height: 44rpx;
402 | width: 44rpx;
403 | background: url('../../../static/images/icon_collect_checked.png') no-repeat;
404 | background-size: 100% 100%;
405 | }
406 | }
407 |
408 | div:nth-child(2) {
409 | height: 100rpx;
410 | width: 162rpx;
411 | border: 1rpx solid #f4f4f4;
412 | display: flex;
413 | align-items: center;
414 | justify-content: center;
415 |
416 | .car {
417 | position: relative;
418 | height: 60rpx;
419 | width: 60rpx;
420 |
421 | span {
422 | height: 28rpx;
423 | width: 28rpx;
424 | z-index: 10;
425 | position: absolute;
426 | top: 0;
427 | right: 0;
428 | background: #b4282d;
429 | text-align: center;
430 | font-size: 18rpx;
431 | color: #fff;
432 | line-height: 28rpx;
433 | border-radius: 50%;
434 | }
435 |
436 | img {
437 | display: block;
438 | height: 44rpx;
439 | width: 44rpx;
440 | position: absolute;
441 | top: 10rpx;
442 | left: 0;
443 | }
444 | }
445 | }
446 |
447 | div:nth-child(3) {
448 | height: 100rpx;
449 | line-height: 96rpx;
450 | flex: 1;
451 | text-align: center;
452 | color: #333;
453 | border-top: 1rpx solid #f4f4f4;
454 | border-bottom: 1rpx solid #f4f4f4;
455 | }
456 |
457 | div:nth-child(4) {
458 | border: 1rpx solid #b4282d;
459 | background: #b4282d;
460 | float: left;
461 | height: 100rpx;
462 | line-height: 96rpx;
463 | flex: 1;
464 | text-align: center;
465 | color: #fff;
466 | }
467 | }
468 | }
469 |
--------------------------------------------------------------------------------
/src/pages/index/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
{{cityName}}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
![]()
22 |
{{item.name}}
23 |
24 |
25 |
26 |
27 | 品牌制造商直供
28 |
29 |
30 |
31 |
32 |
{{item.name}}
33 |
{{item.floor_price}}元起
34 |
35 |
![]()
36 |
37 |
38 |
39 |
40 |
46 |
47 |
48 |
49 | -
50 |
51 | {{item.name}}
52 | {{item.goods_brief}}
53 | ¥{{item.retail_price}}
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
人气推荐
63 | 好物精选
64 |
查看全部
65 |
66 |
67 |
68 |
69 |
70 | -
71 |
72 | {{item.name}}
73 | {{item.goods_brief}}
74 | ¥{{item.retail_price}}
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 | 专题精选
83 |
84 |
85 |
86 |
87 |
88 | -
89 |
90 |
91 |
92 |
{{item.title}}
93 |
{{item.subtitle}}
94 |
95 |
96 | {{item.price_info}}元起
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
{{item.name}}好物
107 |
108 |
109 |
![]()
110 |
{{subitem.name}}
111 |
¥{{subitem.retail_price}}
112 |
113 |
114 |
115 |
{{item.name}}好物
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
256 |
257 |
260 |
--------------------------------------------------------------------------------
/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 | export default {}
7 |
--------------------------------------------------------------------------------
/src/pages/index/style.scss:
--------------------------------------------------------------------------------
1 | .index {
2 | width: 100%;
3 | overflow: hidden;
4 | position: relative;
5 |
6 | .search {
7 | width: 100%;
8 | box-sizing: border-box;
9 | padding: 0 25rpx 0 10rpx;
10 | position: fixed;
11 | top: 0;
12 | z-index: 99;
13 | height: 80rpx;
14 | display: flex;
15 | align-items: center;
16 | background: #fff;
17 |
18 | div:nth-child(1) {
19 | width: 115rpx;
20 | text-align: center;
21 | overflow: hidden;
22 | white-space: nowrap;
23 | text-overflow: ellipsis;
24 | font-size: 20rpx;
25 | padding-right: 15rpx;
26 | }
27 |
28 | div:nth-child(2) {
29 | flex: 1;
30 | position: relative;
31 |
32 | input {
33 | width: 100%;
34 | height: 56rpx;
35 | border-radius: 8rpx;
36 | background: #ededed;
37 | box-sizing: border-box;
38 | padding-left: 40rpx;
39 | }
40 |
41 | .icon {
42 | position: absolute;
43 | top: 15rpx;
44 | left: 10rpx;
45 | background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/search2-2fb94833aa.png') center no-repeat;
46 | background-size: 100%;
47 | width: 28rpx;
48 | height: 28rpx;
49 | margin-right: 10rpx;
50 | }
51 | }
52 | }
53 |
54 | .swiper {
55 | width: 100%;
56 | height: 417rpx;
57 | margin-top: 80rpx;
58 |
59 | .swiper-container {
60 | width: 100%;
61 | height: 100%;
62 |
63 | .swiper-item {
64 | width: 100%;
65 | height: 100%;
66 |
67 | .slide-image {
68 | width: 100%;
69 | height: 100%;
70 | }
71 | }
72 | }
73 | }
74 |
75 | .channel {
76 | display: flex;
77 | padding: 20rpx 0;
78 | background: #ffffff;
79 |
80 | div {
81 | width: 25%;
82 | text-align: center;
83 |
84 | img {
85 | height: 58rpx;
86 | width: 58rpx;
87 | display: inline-block;
88 | }
89 | }
90 | }
91 |
92 | .brand {
93 | width: 100%;
94 | margin-top: 20rpx;
95 | background: #ffffff;
96 |
97 | .head {
98 | text-align: center;
99 | padding: 40rpx 0;
100 | }
101 |
102 | .content {
103 | width: 730rpx;
104 | margin: 0 auto;
105 | display: flex;
106 | justify-content: space-between;
107 | flex-wrap: wrap;
108 |
109 | div {
110 | width: 360rpx;
111 | height: 235rpx;
112 | margin-bottom: 10rpx;
113 | position: relative;
114 |
115 | div {
116 | position: absolute;
117 | top: 0;
118 | left: 0;
119 | padding: 10rpx;
120 |
121 | p:nth-child(2) {
122 | font-size: 24rpx;
123 | }
124 | }
125 |
126 | img {
127 | width: 100%;
128 | height: 100%;
129 | }
130 | }
131 | }
132 | }
133 |
134 | .newgoods {
135 | .newgoods-top {
136 | margin-top: 20rpx;
137 | height: 260rpx;
138 | width: 100%;
139 | background: url('../../../static/images/bgnew.png') no-repeat;
140 | background-size: 100% 100%;
141 | text-align: center;
142 | display: flex;
143 | align-items: center;
144 | justify-content: center;
145 |
146 | .top {
147 | p {
148 | color: #8c9bae;
149 | font-size: 32rpx;
150 | }
151 |
152 | p:nth-child(2) {
153 | width: 180rpx;
154 | height: 50rpx;
155 | line-height: 50rpx;
156 | margin: 27rpx auto 0 auto;
157 | font-size: 22rpx;
158 | background: #d8e4f0;
159 | }
160 | }
161 | }
162 |
163 | .list {
164 | margin-top: 20rpx;
165 | background: #fff;
166 | padding-bottom: 10rpx;
167 |
168 | ul {
169 | .scroll-view {
170 | width: 100%; // height: 470rpx; // display: flex;
171 | // flex-wrap: nowrap;
172 | white-space: nowrap;
173 |
174 | li {
175 | width: 280rpx;
176 | height: 416rpx;
177 | margin: 5rpx 0 5rpx 25rpx;
178 | display: inline-block;
179 |
180 | img {
181 | width: 280rpx;
182 | height: 280rpx;
183 | }
184 |
185 | p:nth-child(2) {
186 | font-size: 30rpx;
187 | font-weight: bold;
188 | }
189 |
190 | p:nth-child(3) {
191 | color: #8a8a8a;
192 | font-size: 24rpx;
193 | }
194 |
195 | p:nth-child(4) {
196 | color: #9c3232;
197 | font-size: 24rpx;
198 | }
199 |
200 | p {
201 | width: 94%;
202 | overflow: hidden;
203 | white-space: nowrap;
204 | text-overflow: ellipsis;
205 | margin-top: 8rpx;
206 | text-indent: 1em;
207 | }
208 | }
209 |
210 | li:nth-child(n+2) {
211 | border-left: 1rpx solid #f4f4f4;
212 | }
213 | }
214 | }
215 | }
216 | }
217 |
218 | .hotgoods {
219 | .newgoods-top {
220 | background: url('../../../static/images/bgtopic.png') no-repeat;
221 | background-size: 100% 100%;
222 |
223 | .top {
224 | p {
225 | color: #b1a279;
226 | font-size: 32rpx;
227 | vertical-align: middle;
228 | }
229 |
230 | p:nth-child(1) {
231 | span {
232 | width: 4rpx;
233 | height: 4rpx;
234 | font-size: 14rpx;
235 | display: inline-block;
236 | vertical-align: middle;
237 | background: #b1a279;
238 | }
239 | }
240 |
241 | p:nth-child(2) {
242 | background: #f4e9cb;
243 | }
244 | }
245 | }
246 | }
247 |
248 | .topicList {
249 | margin-top: 20rpx;
250 | background: #fff;
251 |
252 | .topicList-top {
253 | text-align: center;
254 | padding: 36rpx;
255 | vertical-align: middle;
256 |
257 | .icon {
258 | display: inline-block;
259 | width: 32rpx;
260 | height: 32rpx;
261 | margin-left: 5rpx;
262 | background: url('../../../static//images/right.png') no-repeat;
263 | background-size: 100% 100%;
264 | vertical-align: middle;
265 | }
266 | }
267 |
268 | .list {
269 | .scroll-view {
270 | white-space: nowrap;
271 |
272 | li {
273 | display: inline-block;
274 | width: 575rpx;
275 | margin-left: 25rpx;
276 |
277 | img {
278 | display: block;
279 | width: 575rpx;
280 | height: 325rpx;
281 | border-radius: 10rpx;
282 | }
283 |
284 | .btom {
285 | display: flex;
286 | justify-content: space-between;
287 | margin-bottom: 42rpx;
288 | width: 100%;
289 |
290 | div:nth-child(1) {
291 | width: 90%;
292 |
293 | p {
294 | margin-top: 8rpx;
295 | }
296 |
297 | p:nth-child(1) {
298 | font-size: 30rpx;
299 | font-weight: bold;
300 | }
301 |
302 | p:nth-child(2) {
303 | width: 90%;
304 | color: #8a8a8a;
305 | font-size: 24rpx;
306 | overflow: hidden;
307 | text-overflow: ellipsis;
308 | white-space: nowrap;
309 | }
310 | }
311 |
312 | div:nth-child(2) {
313 | margin-top: 8rpx;
314 | color: #9c3232;
315 | font-size: 24rpx;
316 | }
317 | }
318 | }
319 |
320 | li:last-child {
321 | margin-right: 25rpx;
322 | }
323 | }
324 | }
325 | }
326 |
327 | .newcategory {
328 | margin-top: 20rpx;
329 | padding: 0 10rpx 25rpx 10rpx;
330 |
331 | .head {
332 | padding: 25rpx 0;
333 | text-align: center;
334 | }
335 |
336 | .sublist {
337 | display: flex;
338 | flex-wrap: wrap;
339 | justify-content: space-between;
340 | width: 730rpx;
341 | margin: 0 auto;
342 |
343 | div {
344 | width: 360rpx;
345 | background: #fff;
346 | margin-bottom: 10rpx;
347 | padding-bottom: 10rpx;
348 |
349 | img {
350 | display: block;
351 | width: 302rpx;
352 | height: 302rpx;
353 | margin: 0 auto;
354 | }
355 |
356 | p {
357 | margin-bottom: 5rpx;
358 | text-indent: 1em;
359 | }
360 |
361 | p:nth-child(2) {
362 | overflow: hidden;
363 | text-overflow: ellipsis;
364 | white-space: nowrap;
365 | width: 98%;
366 | }
367 |
368 | p:nth-child(3) {
369 | color: #9c3232;
370 | }
371 | }
372 |
373 | .last {
374 | display: block;
375 | width: 302rpx;
376 | height: 302rpx;
377 | margin: 0 auto;
378 | display: flex;
379 | flex-direction: column;
380 | align-items: center;
381 | justify-content: center;
382 | flex-wrap: wrap;
383 |
384 | p {
385 | height: 33rpx;
386 | width: 100%;
387 | line-height: 33rpx;
388 | color: #333;
389 | font-size: 33rpx;
390 | text-align: center;
391 | }
392 |
393 | .icon {
394 | display: inline-block;
395 | width: 70rpx;
396 | height: 70rpx;
397 | background: url('../../../static/images/rightbig.png') no-repeat;
398 | background-size: 100% 100%;
399 | margin-top: 60rpx;
400 | }
401 | }
402 |
403 | div:nth-child(2n) {
404 | margin-left: 10rpx;
405 | }
406 | }
407 | }
408 | }
409 |
--------------------------------------------------------------------------------
/src/pages/login/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
72 |
76 |
--------------------------------------------------------------------------------
/src/pages/login/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/login/style.scss:
--------------------------------------------------------------------------------
1 | .login {
2 | width: 100%;
3 | height: 100%;
4 | background: #fff;
5 | box-sizing: border-box;
6 | padding-top: 1rpx;
7 | .logo {
8 | width: 230rpx;
9 | height: 80rpx;
10 | background: url('../../../static/images/logo1.png') no-repeat;
11 | background-size: 100% 100%;
12 | margin: 200rpx auto 0 auto;
13 | }
14 | .login-btn {
15 | text-align: center;
16 | background: #b4a078;
17 | width: 90%;
18 | height: 80rpx;
19 | line-height: 80rpx;
20 | color: #fff;
21 | font-size: 28rpx;
22 | margin-top: 300rpx;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/pages/logs/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
9 |
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/mappage/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.name}}
9 |
10 |
11 |
12 |
13 |
14 | 显示当前位置:
15 |
16 |
17 |
18 |
19 |
20 |
21 |
101 |
104 |
--------------------------------------------------------------------------------
/src/pages/mappage/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/mappage/style.scss:
--------------------------------------------------------------------------------
1 | .mappage {
2 | height: 100%;
3 | background: #fff;
4 | position: relative;
5 |
6 | .section {
7 | height: 30px;
8 | width: 100%;
9 |
10 | input {
11 | width: 90%;
12 | margin: 0 auto;
13 | border: 1px solid #c3c3c3;
14 | height: 30px;
15 | border-radius: 3px;
16 | padding: 0 5px;
17 | }
18 | }
19 |
20 | .result {
21 | width: 40%;
22 | // margin: 0 auto;
23 | padding: 20rpx 0 20rpx 30rpx;
24 | }
25 |
26 | .map_container {
27 | position: absolute;
28 | bottom: 0;
29 | left: 0;
30 | right: 0;
31 |
32 | .title {
33 | font-size: 34rpx;
34 | font-weight: bold;
35 | padding: 20rpx;
36 | }
37 |
38 | .map {
39 | width: 100%;
40 | height: 500rpx;
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/pages/my/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
![]()
5 |
6 |
{{userInfo.nickName}}
7 |
点击登录
8 |
微信用户
9 |
10 |
11 |
12 |
13 |
14 | {{item.title}}
15 |
16 |
17 |
18 |
19 |
20 |
108 |
112 |
--------------------------------------------------------------------------------
/src/pages/my/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/my/style.scss:
--------------------------------------------------------------------------------
1 | .my {
2 | .myinfo {
3 | width: 100%;
4 | height: 280rpx;
5 | display: flex;
6 | align-items: center;
7 | background: #333;
8 | padding: 0 30rpx;
9 | box-sizing: border-box;
10 | img {
11 | height: 148rpx;
12 | width: 148rpx;
13 | border-radius: 50%
14 | }
15 | div {
16 | margin-left: 30rpx;
17 | p {
18 | color: #fff;
19 | font-size: 30rpx;
20 | margin-bottom: 10rpx
21 | }
22 | p:nth-child(2) {
23 | font-size: 28rpx;
24 | }
25 | }
26 | }
27 | .iconlist {
28 | display: flex;
29 | align-items: center;
30 | background: #fff;
31 | flex-wrap: wrap;
32 | div {
33 | width: 33.33%;
34 | padding: 50rpx 0;
35 | text-align: center;
36 | border-right: 1rpx solid rgba(0, 0, 0, .15);
37 | border-bottom: 1rpx solid rgba(0, 0, 0, .15);
38 | box-sizing: border-box;
39 | span {
40 | display: block;
41 | }
42 | span:nth-child(1) {
43 | margin-bottom: 10rpx;
44 | }
45 | }
46 | div:nth-child(3n+3) {
47 | border-right: none;
48 | }
49 | div:nth-last-child(1) {
50 | border-bottom: none;
51 | }
52 | div:nth-last-child(2) {
53 | border-bottom: none;
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/pages/newgoods/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |

5 |
6 |
7 |
综合
8 |
价格
9 |
分类
10 |
11 |
12 |
13 |
![]()
14 |
{{item.name}}
15 |
¥{{item.retail_price}}
16 |
17 |
18 |
19 |
20 |
21 |
68 |
--------------------------------------------------------------------------------
/src/pages/newgoods/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 | export default {}
7 |
--------------------------------------------------------------------------------
/src/pages/newgoods/style.scss:
--------------------------------------------------------------------------------
1 | .newgoods {
2 | .banner {
3 | width: 100%;
4 | height: 278rpx;
5 | img {
6 | width: 100%;
7 | height: 100%;
8 | }
9 | }
10 | .sortnav {
11 | display: flex;
12 | background: #fff;
13 | width: 100%;
14 | height: 78rpx;
15 | line-height: 78rpx;
16 | div {
17 | width: 250rpx;
18 | height: 100%;
19 | text-align: center;
20 | }
21 | .active {
22 | color: #b4282d;
23 | }
24 | .price {
25 | background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 165rpx center no-repeat;
26 | background-size: 15rpx 21rpx;
27 | }
28 | .active.desc {
29 | background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 165rpx center no-repeat;
30 | background-size: 15rpx 21rpx;
31 | }
32 | .active.asc {
33 | background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 165rpx center no-repeat;
34 | background-size: 15rpx 21rpx;
35 | }
36 | }
37 | .sortlist {
38 | margin-top: 20rpx;
39 | display: flex;
40 | justify-content: space-between;
41 | flex-wrap: wrap;
42 | .item {
43 | width: 372.5rpx;
44 | margin-bottom: 5rpx;
45 | text-align: center;
46 | background: #fff;
47 | padding: 15rpx 0;
48 | img {
49 | display: block;
50 | width: 302rpx;
51 | height: 302rpx;
52 | margin: 0 auto;
53 | }
54 | .name {
55 | margin: 15rpx 0 22rpx 0;
56 | text-align: center;
57 | padding: 0 20rpx;
58 | font-size: 24rpx;
59 | }
60 | .price {
61 | text-align: center;
62 | font-size: 30rpx;
63 | color: #b4282d;
64 | }
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/pages/order/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
{{address.name}}
9 |
10 | 默认
11 |
12 |
13 |
14 |
{{address.mobile}}
15 |
{{address.address+address.address_detail}}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 请选择收货地址
24 |
25 |
26 |
27 |
商品合计
28 |
¥{{allprice}}
29 |
30 |
34 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
![]()
45 |
46 |
47 |
{{item.goods_name}}
48 |
¥{{item.retail_price}}
49 |
50 |
51 |
52 |
53 | x{{item.number}}
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | 实付 : ¥{{allprice}}
62 |
63 |
64 | 支付
65 |
66 |
67 |
68 |
69 |
70 |
136 |
140 |
--------------------------------------------------------------------------------
/src/pages/order/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/order/style.scss:
--------------------------------------------------------------------------------
1 | .order {
2 | overflow-x: hidden;
3 | .seladdress {
4 | width: 100%;
5 | min-height: 166rpx;
6 | background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png') 0 0 repeat-x #fff;
7 | background-size: 62rpx 10rpx;
8 | margin-bottom: 20rpx;
9 | padding-top: 10rpx;
10 | text-align: center;
11 | line-height: 166rpx;
12 | }
13 | .address {
14 | background: url('http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-bg-bd30f2bfeb.png') 0 0 repeat-x #fff;
15 | padding: 50rpx 0 30rpx 0;
16 | margin-bottom: 20rpx;
17 | .item {
18 | padding: 0 20rpx;
19 | .addresslist {
20 | width: 100%;
21 | position: relative;
22 | transition: all 300ms ease;
23 | display: flex;
24 | justify-content: space-between;
25 | align-items: center;
26 | div:nth-child(1) {
27 | width: 100rpx;
28 | text-align: center;
29 | overflow: hidden;
30 | text-overflow: ellipsis;
31 | white-space: nowrap;
32 | align-self: flex-start;
33 | .moren {
34 | width: 60rpx;
35 | height: 30rpx;
36 | border: 1rpx solid #b4282d;
37 | text-align: center;
38 | line-height: 30rpx;
39 | color: #b4282d;
40 | margin: 10rpx auto 0 auto;
41 | }
42 | }
43 | .info {
44 | padding: 0 20rpx;
45 | flex: 1; // p:nth-child(1) {}
46 | p:nth-child(2) {
47 | margin-top: 5rpx;
48 | color: #666;
49 | overflow: hidden;
50 | text-overflow: ellipsis;
51 | display: -webkit-box;
52 | -webkit-line-clamp: 2;
53 | -webkit-box-orient: vertical;
54 | }
55 | }
56 | div:nth-child(3) {
57 | width: 50rpx;
58 | height: 50rpx;
59 | margin: 0 20rpx;
60 | background: url('http://yanxuan-static.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/address-right-596d39df1e.png') no-repeat;
61 | background-size: 100% 100%;
62 | }
63 | }
64 | }
65 | }
66 | .orderbox {
67 | padding: 0 30rpx;
68 | background: #ffffff;
69 | .item {
70 | padding: 30rpx 0;
71 | display: flex;
72 | justify-content: space-between;
73 | border-bottom: 1rpx solid #d9d9d9;
74 | }
75 | .item:last-child {
76 | border: none;
77 | }
78 | }
79 | .cartlist {
80 | background: #fff;
81 | margin-bottom: 110rpx;
82 | margin-top: 20rpx;
83 | .item {
84 | padding: 20rpx 0;
85 | border-bottom: 1rpx solid #f4f4f4; // height: 166rpx;
86 | position: relative;
87 | .con {
88 | display: flex;
89 | align-items: center;
90 | justify-content: space-between;
91 | transition: all 300ms ease;
92 | .left {
93 | display: flex;
94 | align-items: center;
95 | width: 80%;
96 | .img {
97 | height: 125rpx;
98 | width: 125rpx;
99 | display: block;
100 | background: #f4f4f4;
101 | margin-left: 20rpx;
102 | img {
103 | width: 100%;
104 | height: 100%;
105 | }
106 | }
107 | .info {
108 | width: 50%;
109 | padding: 20rpx;
110 | p {
111 | line-height: 40rpx;
112 | }
113 | }
114 | }
115 | .right {
116 | padding-right: 50rpx;
117 | }
118 | }
119 | }
120 | }
121 | .bottom {
122 | position: fixed;
123 | bottom: 0;
124 | height: 100rpx;
125 | width: 100%;
126 | display: flex;
127 | background: #fff;
128 | font-size: 32repx;
129 | div:nth-child(1) {
130 | flex: 1;
131 | line-height: 100rpx;
132 | padding-left: 20rpx
133 | }
134 | div:nth-child(2) {
135 | width: 200rpx;
136 | height: 100rpx;
137 | text-align: center;
138 | line-height: 100rpx;
139 | font-size: 29rpx;
140 | background: #b4282d;
141 | color: #fff;
142 | }
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/src/pages/practice/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
![]()
6 |
7 |
8 |
9 |
10 |
11 |
16 |
17 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
图片api相关1
30 |
31 |
32 |
33 |
34 |
35 |
36 |
![]()
37 |
38 |
39 |
弹窗相关
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
164 |
165 |
168 |
--------------------------------------------------------------------------------
/src/pages/practice/main.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue'
2 | import App from './index'
3 |
4 | const app = new Vue(App)
5 | app.$mount()
6 | export default {
7 | config: {
8 | navigationBarTitleText: 'heyushuo',
9 | }
10 | }
--------------------------------------------------------------------------------
/src/pages/practice/style.scss:
--------------------------------------------------------------------------------
1 | .picture{
2 | width: 100%;
3 | margin-bottom: 30rpx;
4 | h3{
5 | color: red;
6 | text-align: left;
7 | text-indent: 1em;
8 | border-bottom: 1rpx solid #999;
9 | padding: 15rpx 0;
10 | }
11 | .btn{
12 | display: flex;
13 | margin-top: 10rpx;
14 | }
15 | }
16 | .userinfo {
17 | display: flex;
18 | flex-direction: column;
19 | align-items: center;
20 | }
21 |
22 | .userinfo-avatar {
23 | width: 128rpx;
24 | height: 128rpx;
25 | margin: 20rpx;
26 | border-radius: 50%;
27 | }
28 |
29 | .userinfo-nickname {
30 | color: #aaa;
31 | }
32 |
33 | .usermotto {
34 | margin-top: 150px;
35 | }
36 |
37 | .form-control {
38 | display: block;
39 | padding: 0 12px;
40 | margin-bottom: 5px;
41 | border: 1rpx solid #ccc;
42 | }
43 |
44 | .counter {
45 | display: inline-block;
46 | margin: 10px auto;
47 | padding: 5px 10px;
48 | color: blue;
49 | border: 1rpx solid blue;
50 | }
51 |
--------------------------------------------------------------------------------
/src/pages/search/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |

6 |
7 |
8 |

9 |
10 |
取消
11 |
12 |
13 |
14 | {{ item.name }}
15 |
16 |
17 | 数据库暂无此类商品...
18 |
19 |
20 |
21 |
22 |
历史记录
23 |
24 |
25 |
26 |
27 |
28 |
29 | {{item.keyword}}
30 |
31 |
32 |
33 |
34 |
37 |
38 |
39 | {{item.keyword}}
40 |
41 |
42 |
43 |
44 |
45 |
46 |
综合
47 |
价格
48 |
分类
49 |
50 |
51 |
52 |
![]()
53 |
{{item.name}}
54 |
¥{{item.retail_price}}
55 |
56 |
57 |
58 |
59 |
60 |
61 |
170 |
173 |
--------------------------------------------------------------------------------
/src/pages/search/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/search/style.scss:
--------------------------------------------------------------------------------
1 | .search {
2 | height: 100%;
3 | position: relative;
4 | .head {
5 | height: 91rpx;
6 | display: flex;
7 | padding: 0 32rpx;
8 | align-items: center;
9 | justify-content: space-between;
10 | background: #fff;
11 | border-bottom: 1rpx solid rgba(0, 0, 0, 0.15);
12 | div:nth-child(1) {
13 | height: 59rpx;
14 | display: flex;
15 | align-items: center;
16 | background: #f4f4f4;
17 | img {
18 | display: inline-block;
19 | width: 31rpx;
20 | height: 31rpx;
21 | padding: 0 20rpx;
22 | }
23 | input {
24 | display: inline-block;
25 | width: 480rpx;
26 | height: 59rpx;
27 | margin-left: 10rpx;
28 | }
29 | .del {
30 | width: 53rpx;
31 | height: 53rpx;
32 | padding: 0;
33 | }
34 | }
35 | div:nth-child(2) {
36 | flex: 1;
37 | text-align: center;
38 | }
39 | }
40 | .searchtips {
41 | position: absolute;
42 | width: 100%;
43 | top: 91rpx;
44 | left: 0;
45 | bottom: 0;
46 | box-sizing: border-box;
47 | padding: 0 32rpx;
48 | z-index: 9;
49 | background: #fff;
50 | overflow-y: scroll;
51 | -webkit-overflow-scrolling: touch;
52 | div {
53 | padding: 20rpx 0;
54 | }
55 | .nogoods {
56 | text-align: center;
57 | margin-top: 300rpx;
58 | }
59 | }
60 | .goodsList {
61 | position: absolute;
62 | width: 100%;
63 | top: 91rpx;
64 | left: 0;
65 | bottom: 0;
66 | background: #fff;
67 | box-sizing: border-box; // padding: 0 32rpx;
68 | z-index: 9;
69 | overflow-y: scroll;
70 | -webkit-overflow-scrolling: touch;
71 | .sortnav {
72 | display: flex;
73 | width: 100%;
74 | height: 78rpx;
75 | line-height: 78rpx;
76 | background: #fff;
77 | border-bottom: 1rpx solid #d9d9d9;
78 | div {
79 | width: 250rpx;
80 | height: 100%;
81 | text-align: center;
82 | }
83 | .active {
84 | color: #b4282d;
85 | }
86 | .price {
87 | background: url(//yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/no-3127092a69.png) 165rpx center no-repeat;
88 | background-size: 15rpx 21rpx;
89 | }
90 | .active.desc {
91 | background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/down-95e035f3e5.png) 165rpx center no-repeat;
92 | background-size: 15rpx 21rpx;
93 | }
94 | .active.asc {
95 | background: url(http://yanxuan.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/up-636b92c0a5.png) 165rpx center no-repeat;
96 | background-size: 15rpx 21rpx;
97 | }
98 | }
99 | .sortlist {
100 | display: flex;
101 | justify-content: space-between;
102 | flex-wrap: wrap;
103 | .item {
104 | box-sizing: border-box;
105 | width: 50%;
106 | text-align: center;
107 | background: #fff;
108 | padding: 15rpx 0;
109 | border-bottom: 1rpx solid #d9d9d9;
110 | border-right: 1rpx solid #d9d9d9;
111 | img {
112 | display: block;
113 | width: 302rpx;
114 | height: 302rpx;
115 | margin: 0 auto;
116 | }
117 | .name {
118 | margin: 15rpx 0 22rpx 0;
119 | text-align: center;
120 | padding: 0 20rpx;
121 | font-size: 24rpx;
122 | }
123 | .price {
124 | text-align: center;
125 | font-size: 30rpx;
126 | color: #b4282d;
127 | }
128 | }
129 | .item.active:nth-last-child(1) {
130 | border-bottom: none;
131 | }
132 | .item.active:nth-last-child(2) {
133 | border-bottom: none;
134 | }
135 | .item.none:last-child {
136 | border-bottom: none;
137 | }
138 | }
139 | }
140 | .history {
141 | background: #fff;
142 | padding: 32rpx;
143 | .t {
144 | display: flex;
145 | justify-content: space-between;
146 | align-items: center;
147 | margin-bottom: 30rpx;
148 | div:nth-child(2) {
149 | width: 55rpx;
150 | height: 55rpx;
151 | background: url("http://nos.netease.com/mailpub/hxm/yanxuan-wap/p/20150730/style/img/icon-normal/del1-93f0a4add4.png") no-repeat;
152 | background-size: 100% 100%;
153 | }
154 | }
155 | .cont {
156 | display: flex;
157 | flex-wrap: wrap;
158 | div {
159 | padding: 10rpx 10rpx;
160 | border: 1rpx solid #999;
161 | margin: 0 30rpx 20rpx 0;
162 | }
163 | .active {
164 | border: 1rpx solid #b4282d;
165 | color: #b4282d;
166 | }
167 | }
168 | }
169 | .hotsearch {
170 | margin-top: 20rpx;
171 | }
172 | }
--------------------------------------------------------------------------------
/src/pages/topic/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
![]()
7 |
8 |
9 |
{{item.title}}
10 |
{{item.subtitle}}
11 |
{{item.price_info}}元起
12 |
13 |
14 |
15 |
16 |
17 |
18 |
67 |
70 |
--------------------------------------------------------------------------------
/src/pages/topic/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 | enablePullDownRefresh: true
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/pages/topic/style.scss:
--------------------------------------------------------------------------------
1 | .topic {
2 | .list {
3 | li {
4 | background: #fff;
5 | text-align: center;
6 | padding-bottom: 20rpx;
7 | margin-bottom: 20rpx;
8 | .t-img {
9 | width: 100%;
10 | height: 415rpx;
11 | img {
12 | width: 100%;
13 | height: 100%;
14 | }
15 | }
16 | .info {
17 | p:nth-child(1) {
18 | color: #333;
19 | font-size: 35rpx;
20 | margin-top: 30rpx;
21 | }
22 | p:nth-child(2) {
23 | color: #999;
24 | font-size: 24rpx;
25 | margin-top: 16rpx;
26 | padding: 0 20rpx;
27 | }
28 | p:nth-child(3) {
29 | color: #b4282d;
30 | font-size: 27rpx;
31 | margin-top: 20rpx;
32 | }
33 | }
34 | }
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/pages/topicdetail/index.vue:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
专题推荐
10 |
11 |
![]()
12 |
{{item.title}}
13 |
14 |
15 |
16 |
17 |
18 |
49 |
53 |
--------------------------------------------------------------------------------
/src/pages/topicdetail/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/topicdetail/style.scss:
--------------------------------------------------------------------------------
1 | .topicdetail {
2 | .list {
3 | width: 690rpx;
4 | height: auto;
5 | margin: 0 30rpx;
6 | .title {
7 | text-align: center;
8 | background: #f4f4f4;
9 | font-size: 30rpx;
10 | color: #999;
11 | padding: 30rpx 0;
12 | }
13 | .item {
14 | width: 100%;
15 | padding: 24rpx 24rpx 30rpx 24rpx;
16 | margin-bottom: 30rpx;
17 | background: #fff;
18 | box-sizing: border-box;
19 | img {
20 | height: 278rpx;
21 | width: 642rpx;
22 | display: block;
23 | }
24 | p {
25 | display: block;
26 | margin-top: 30rpx;
27 | font-size: 28rpx;
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/src/store/index.js:
--------------------------------------------------------------------------------
1 | import Vue from 'vue';
2 | import Vuex from 'vuex'
3 |
4 | Vue.use(Vuex)
5 |
6 | const store = new Vuex.Store({
7 | state: {
8 | cityName: "定位中.."
9 | },
10 | mutations: {
11 | /**
12 | * 在main.js例引入
13 | * import store from './store/index'
14 | * 把store挂载到全局
15 | * Vue.prototype.$store = store;
16 | */
17 |
18 | /**
19 | * 这里设置一个统一的方法,大部分用的vuex都是简单的改变一些状态,不需要写过多的mutations
20 | * 使用方法 例:
21 | * this.$store.update({"cityName":"北京"})
22 | *
23 | * config需要传入对象
24 | * @param {*} state
25 | * @param {*Object} config
26 | */
27 | update(state, config) {
28 | Object.keys(config).map((item, key) => {
29 | state[item] = config[item]
30 | })
31 | }
32 | }
33 | })
34 |
35 | export default store;
36 |
--------------------------------------------------------------------------------
/src/utils/amap-wx.js:
--------------------------------------------------------------------------------
1 | function AMapWX(a){this.key=a.key,this.requestConfig={key:a.key,s:"rsx",platform:"WXJS",appname:a.key,sdkversion:"1.2.0",logversion:"2.0"}}AMapWX.prototype.getWxLocation=function(a,b){wx.getLocation({type:"gcj02",success:function(a){var c=a.longitude+","+a.latitude;wx.setStorage({key:"userLocation",data:c}),b(c)},fail:function(c){wx.getStorage({key:"userLocation",success:function(a){a.data&&b(a.data)}}),a.fail({errCode:"0",errMsg:c.errMsg||""})}})},AMapWX.prototype.getRegeo=function(a){function c(c){var d=b.requestConfig;wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:b.key,location:c,extensions:"all",s:d.s,platform:d.platform,appname:b.key,sdkversion:d.sdkversion,logversion:d.logversion},method:"GET",header:{"content-type":"application/json"},success:function(b){var d,e,f,g,h,i,j,k,l;b.data.status&&"1"==b.data.status?(d=b.data.regeocode,e=d.addressComponent,f=[],g="",d&&d.roads[0]&&d.roads[0].name&&(g=d.roads[0].name+"附近"),h=c.split(",")[0],i=c.split(",")[1],d.pois&&d.pois[0]&&(g=d.pois[0].name+"附近",j=d.pois[0].location,j&&(h=parseFloat(j.split(",")[0]),i=parseFloat(j.split(",")[1]))),e.provice&&f.push(e.provice),e.city&&f.push(e.city),e.district&&f.push(e.district),e.streetNumber&&e.streetNumber.street&&e.streetNumber.number?(f.push(e.streetNumber.street),f.push(e.streetNumber.number)):(k="",d&&d.roads[0]&&d.roads[0].name&&(k=d.roads[0].name),f.push(k)),f=f.join(""),l=[{iconPath:a.iconPath,width:a.iconWidth,height:a.iconHeight,name:f,desc:g,longitude:h,latitude:i,id:0,regeocodeData:d}],a.success(l)):a.fail({errCode:b.data.infocode,errMsg:b.data.info})},fail:function(b){a.fail({errCode:"0",errMsg:b.errMsg||""})}})}var b=this;a.location?c(a.location):b.getWxLocation(a,function(a){c(a)})},AMapWX.prototype.getWeather=function(a){function d(d){var e="base";a.type&&"forecast"==a.type&&(e="all"),wx.request({url:"https://restapi.amap.com/v3/weather/weatherInfo",data:{key:b.key,city:d,extensions:e,s:c.s,platform:c.platform,appname:b.key,sdkversion:c.sdkversion,logversion:c.logversion},method:"GET",header:{"content-type":"application/json"},success:function(b){function c(a){var b={city:{text:"城市",data:a.city},weather:{text:"天气",data:a.weather},temperature:{text:"温度",data:a.temperature},winddirection:{text:"风向",data:a.winddirection+"风"},windpower:{text:"风力",data:a.windpower+"级"},humidity:{text:"湿度",data:a.humidity+"%"}};return b}var d,e;b.data.status&&"1"==b.data.status?b.data.lives?(d=b.data.lives,d&&d.length>0&&(d=d[0],e=c(d),e["liveData"]=d,a.success(e))):b.data.forecasts&&b.data.forecasts[0]&&a.success({forecast:b.data.forecasts[0]}):a.fail({errCode:b.data.infocode,errMsg:b.data.info})},fail:function(b){a.fail({errCode:"0",errMsg:b.errMsg||""})}})}function e(e){wx.request({url:"https://restapi.amap.com/v3/geocode/regeo",data:{key:b.key,location:e,extensions:"all",s:c.s,platform:c.platform,appname:b.key,sdkversion:c.sdkversion,logversion:c.logversion},method:"GET",header:{"content-type":"application/json"},success:function(b){var c,e;b.data.status&&"1"==b.data.status?(e=b.data.regeocode,e.addressComponent?c=e.addressComponent.adcode:e.aois&&e.aois.length>0&&(c=e.aois[0].adcode),d(c)):a.fail({errCode:b.data.infocode,errMsg:b.data.info})},fail:function(b){a.fail({errCode:"0",errMsg:b.errMsg||""})}})}var b=this,c=b.requestConfig;a.city?d(a.city):b.getWxLocation(a,function(a){e(a)})},AMapWX.prototype.getPoiAround=function(a){function d(d){var e={key:b.key,location:d,s:c.s,platform:c.platform,appname:b.key,sdkversion:c.sdkversion,logversion:c.logversion};a.querytypes&&(e["types"]=a.querytypes),a.querykeywords&&(e["keywords"]=a.querykeywords),wx.request({url:"https://restapi.amap.com/v3/place/around",data:e,method:"GET",header:{"content-type":"application/json"},success:function(b){var c,d,e,f;if(b.data.status&&"1"==b.data.status){if(b=b.data,b&&b.pois){for(c=[],d=0;d {
31 | wx.request({
32 | url: host + url, //仅为示例,并非真实的接口地址
33 | method: method,
34 | data: data,
35 | header: {
36 | "content-type": "application/json" // 默认值
37 | },
38 | success: function(res) {
39 | wx.hideLoading();
40 | resolve(res.data);
41 | },
42 | fail: function(error) {
43 | wx.hideLoading();
44 | reject(false);
45 | },
46 | complete: function() {
47 | wx.hideLoading();
48 | }
49 | });
50 | });
51 | }
52 | export function get(url, data) {
53 | return request(url, "GET", data);
54 | }
55 | export function post(url, data) {
56 | return request(url, "POST", data);
57 | }
58 |
59 | //-------------------------------------------------------------------------请求的封装
60 |
61 | //----------------------------------------------用户是否登录 未登录跳转到登录页面 -------------------------
62 |
63 | export function toLogin() {
64 | const userInfo = wx.getStorageSync("userInfo");
65 | if (!userInfo) {
66 | wx.navigateTo({
67 | url: "/pages/login/main"
68 | });
69 | } else {
70 | return true;
71 | }
72 | }
73 |
74 | export function login() {
75 | const userInfo = wx.getStorageSync("userInfo");
76 | if (userInfo) {
77 | return userInfo;
78 | }
79 | }
80 |
81 | //----------------------------------------------用户是否登录 未登录跳转到登录页面 -------------------------
82 |
83 | export function getStorageOpenid() {
84 | const openId = wx.getStorageSync("openId");
85 | if (openId) {
86 | return openId;
87 | } else {
88 | return "";
89 | }
90 | }
91 |
92 | export function getOpenid() {
93 | // wx.login({
94 | // success: res => {
95 | // if (res.code) {
96 | // //发起网络请求
97 | // wx.request({
98 | // url: 'https://api.weixin.qq.com/sns/jscode2session',
99 | // data: {
100 | // "appid": "wx601ce71bde7b9add",
101 | // "secret": "abed5421d88eb8236e933c6e42d5c14e",
102 | // "js_code": res.code,
103 | // "grant_type": "authorization_code"
104 | // },
105 | // success: function (data) {
106 | // var openid = data.data.openid;
107 | // wx.setStorageSync("openid", openid);
108 | // }
109 | // })
110 | // } else {
111 | // console.log('登录失败!' + res.errMsg)
112 | // }
113 | // },
114 | // fail: () => {},
115 | // complete: () => {}
116 | // });
117 | }
118 |
--------------------------------------------------------------------------------
/static/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/.gitkeep
--------------------------------------------------------------------------------
/static/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/1.png
--------------------------------------------------------------------------------
/static/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/2.png
--------------------------------------------------------------------------------
/static/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/3.png
--------------------------------------------------------------------------------
/static/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/4.png
--------------------------------------------------------------------------------
/static/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/5.png
--------------------------------------------------------------------------------
/static/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/6.png
--------------------------------------------------------------------------------
/static/images/address-bg-bd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/address-bg-bd.png
--------------------------------------------------------------------------------
/static/images/address_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/address_right.png
--------------------------------------------------------------------------------
/static/images/bgnew.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/bgnew.png
--------------------------------------------------------------------------------
/static/images/bgtopic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/bgtopic.png
--------------------------------------------------------------------------------
/static/images/checkbox.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/checkbox.png
--------------------------------------------------------------------------------
/static/images/clear_input.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/clear_input.png
--------------------------------------------------------------------------------
/static/images/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/close.png
--------------------------------------------------------------------------------
/static/images/del-address.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/del-address.png
--------------------------------------------------------------------------------
/static/images/detail_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/detail_back.png
--------------------------------------------------------------------------------
/static/images/detail_kefu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/detail_kefu.png
--------------------------------------------------------------------------------
/static/images/edit.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/edit.png
--------------------------------------------------------------------------------
/static/images/gif.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/gif.png
--------------------------------------------------------------------------------
/static/images/go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/go.png
--------------------------------------------------------------------------------
/static/images/ic_menu_choice_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_choice_nor.png
--------------------------------------------------------------------------------
/static/images/ic_menu_choice_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_choice_pressed.png
--------------------------------------------------------------------------------
/static/images/ic_menu_me_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_me_nor.png
--------------------------------------------------------------------------------
/static/images/ic_menu_me_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_me_pressed.png
--------------------------------------------------------------------------------
/static/images/ic_menu_shoping_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_shoping_nor.png
--------------------------------------------------------------------------------
/static/images/ic_menu_shoping_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_shoping_pressed.png
--------------------------------------------------------------------------------
/static/images/ic_menu_sort_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_sort_nor.png
--------------------------------------------------------------------------------
/static/images/ic_menu_sort_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_sort_pressed.png
--------------------------------------------------------------------------------
/static/images/ic_menu_topic_nor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_topic_nor.png
--------------------------------------------------------------------------------
/static/images/ic_menu_topic_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/ic_menu_topic_pressed.png
--------------------------------------------------------------------------------
/static/images/icon_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/icon_close.png
--------------------------------------------------------------------------------
/static/images/icon_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/icon_collect.png
--------------------------------------------------------------------------------
/static/images/icon_collect_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/icon_collect_checked.png
--------------------------------------------------------------------------------
/static/images/icon_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/icon_error.png
--------------------------------------------------------------------------------
/static/images/icon_go_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/icon_go_more.png
--------------------------------------------------------------------------------
/static/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/logo.png
--------------------------------------------------------------------------------
/static/images/logo1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/logo1.png
--------------------------------------------------------------------------------
/static/images/logo1_02.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/logo1_02.gif
--------------------------------------------------------------------------------
/static/images/marker.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/marker.png
--------------------------------------------------------------------------------
/static/images/new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/new.png
--------------------------------------------------------------------------------
/static/images/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/right.png
--------------------------------------------------------------------------------
/static/images/rightbig.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/rightbig.png
--------------------------------------------------------------------------------
/static/images/rightnew.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/rightnew.png
--------------------------------------------------------------------------------
/static/images/righttopic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/righttopic.png
--------------------------------------------------------------------------------
/static/images/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/search.png
--------------------------------------------------------------------------------
/static/images/top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/top.png
--------------------------------------------------------------------------------
/static/images/wxpay.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/heyushuo/mpvue-shop/984a0bb9b9d46922930df0553af1dd5fcfaace09/static/images/wxpay.png
--------------------------------------------------------------------------------