├── pages
├── buy
│ ├── buy.json
│ ├── buy.js
│ ├── buy.wxml
│ └── buy.wxss
├── user
│ ├── myF
│ │ ├── myF.wxss
│ │ ├── myF.json
│ │ ├── myF.wxml
│ │ └── myF.js
│ ├── myCoupon
│ │ ├── myCoupon.wxss
│ │ ├── myCoupon.json
│ │ ├── myCoupon.wxml
│ │ └── myCoupon.js
│ ├── myorder
│ │ ├── myorder.json
│ │ ├── myorder.wxml
│ │ ├── myorder.wxss
│ │ └── myorder.js
│ ├── setting
│ │ ├── setting.json
│ │ ├── setting.wxml
│ │ ├── setting.js
│ │ └── setting.wxss
│ ├── user.json
│ ├── user.wxss
│ ├── user.js
│ └── user.wxml
├── logs
│ ├── logs.json
│ ├── logs.wxss
│ ├── logs.wxml
│ └── logs.js
├── index
│ ├── PC
│ │ ├── PC.json
│ │ ├── PC.wxml
│ │ ├── PC.wxss
│ │ └── PC.js
│ ├── TV
│ │ ├── Tv.json
│ │ ├── Tv.wxml
│ │ ├── Tv.wxss
│ │ └── Tv.js
│ ├── newGs
│ │ ├── newGs.json
│ │ ├── newGs.wxml
│ │ ├── newGs.wxss
│ │ └── newGs.js
│ ├── mbPhone
│ │ ├── mbPhone.json
│ │ ├── mbPhone.wxml
│ │ ├── mbPhone.wxss
│ │ └── mbPhone.js
│ ├── search
│ │ ├── search.json
│ │ ├── search.wxml
│ │ ├── search.wxss
│ │ └── search.js
│ ├── zhiNeng
│ │ ├── zhiNeng.json
│ │ ├── zhiNeng.wxml
│ │ ├── zhiNeng.wxss
│ │ └── zhiNeng.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.js
│ └── index.wxss
├── cart
│ ├── cart.json
│ ├── cart.wxml
│ ├── cart.js
│ └── cart.wxss
├── find
│ ├── find.json
│ ├── find.wxml
│ ├── find.js
│ └── find.wxss
└── category
│ ├── category.json
│ ├── category.wxml
│ ├── category.wxss
│ └── category.js
├── app.wxss
├── image
├── 11.png
├── 12.png
├── 21.png
├── 22.png
├── 31.png
├── 32.png
├── 41.png
├── 42.png
├── 43.png
├── 44.png
├── 51.png
├── 52.png
├── f.png
├── mi.jpg
├── appoint.png
├── bypage.png
├── coupon.png
├── indexLY.png
├── indexPC.png
├── indexTV.png
├── order.png
├── remote.png
├── search.png
├── setting.png
├── store.png
├── indexIPH.png
├── index-tiele1.jpg
├── index-tiele2.jpg
├── index-tiele3.jpg
└── indexNewGoods.png
├── utils
└── util.js
├── template
└── index-tem1.wxml
├── project.config.json
├── app.js
├── app.json
├── api
└── findGoods.js
└── weui.wxss
/pages/buy/buy.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | @import "./weui.wxss"
2 |
3 |
--------------------------------------------------------------------------------
/pages/user/myF/myF.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/myF/myF.wxss */
--------------------------------------------------------------------------------
/pages/logs/logs.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "查看启动日志"
3 | }
--------------------------------------------------------------------------------
/pages/index/PC/PC.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "电脑频道"
3 | }
--------------------------------------------------------------------------------
/pages/index/TV/Tv.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "电视频道"
3 | }
--------------------------------------------------------------------------------
/pages/user/myCoupon/myCoupon.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/myCoupon/myCoupon.wxss */
--------------------------------------------------------------------------------
/pages/user/myF/myF.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的F码"
3 | }
--------------------------------------------------------------------------------
/pages/index/newGs/newGs.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "新品频道"
3 | }
--------------------------------------------------------------------------------
/image/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/11.png
--------------------------------------------------------------------------------
/image/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/12.png
--------------------------------------------------------------------------------
/image/21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/21.png
--------------------------------------------------------------------------------
/image/22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/22.png
--------------------------------------------------------------------------------
/image/31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/31.png
--------------------------------------------------------------------------------
/image/32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/32.png
--------------------------------------------------------------------------------
/image/41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/41.png
--------------------------------------------------------------------------------
/image/42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/42.png
--------------------------------------------------------------------------------
/image/43.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/43.png
--------------------------------------------------------------------------------
/image/44.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/44.png
--------------------------------------------------------------------------------
/image/51.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/51.png
--------------------------------------------------------------------------------
/image/52.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/52.png
--------------------------------------------------------------------------------
/image/f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/f.png
--------------------------------------------------------------------------------
/image/mi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/mi.jpg
--------------------------------------------------------------------------------
/pages/index/mbPhone/mbPhone.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "手机频道"
3 | }
--------------------------------------------------------------------------------
/pages/index/search/search.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小米商城Lite"
3 | }
--------------------------------------------------------------------------------
/pages/index/zhiNeng/zhiNeng.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "智能频道"
3 | }
--------------------------------------------------------------------------------
/pages/user/myCoupon/myCoupon.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的优惠券"
3 | }
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的订单"
3 | }
--------------------------------------------------------------------------------
/pages/user/setting/setting.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "小米商城Lite"
3 | }
--------------------------------------------------------------------------------
/image/appoint.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/appoint.png
--------------------------------------------------------------------------------
/image/bypage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/bypage.png
--------------------------------------------------------------------------------
/image/coupon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/coupon.png
--------------------------------------------------------------------------------
/image/indexLY.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/indexLY.png
--------------------------------------------------------------------------------
/image/indexPC.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/indexPC.png
--------------------------------------------------------------------------------
/image/indexTV.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/indexTV.png
--------------------------------------------------------------------------------
/image/order.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/order.png
--------------------------------------------------------------------------------
/image/remote.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/remote.png
--------------------------------------------------------------------------------
/image/search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/search.png
--------------------------------------------------------------------------------
/image/setting.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/setting.png
--------------------------------------------------------------------------------
/image/store.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/store.png
--------------------------------------------------------------------------------
/image/indexIPH.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/indexIPH.png
--------------------------------------------------------------------------------
/image/index-tiele1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/index-tiele1.jpg
--------------------------------------------------------------------------------
/image/index-tiele2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/index-tiele2.jpg
--------------------------------------------------------------------------------
/image/index-tiele3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/index-tiele3.jpg
--------------------------------------------------------------------------------
/pages/user/myF/myF.wxml:
--------------------------------------------------------------------------------
1 |
2 | pages/user/myF/myF.wxml
3 |
--------------------------------------------------------------------------------
/image/indexNewGoods.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/HuanqingDeng/XCX-MiLite/HEAD/image/indexNewGoods.png
--------------------------------------------------------------------------------
/pages/user/myCoupon/myCoupon.wxml:
--------------------------------------------------------------------------------
1 |
2 | pages/user/myCoupon/myCoupon.wxml
3 |
--------------------------------------------------------------------------------
/pages/logs/logs.wxss:
--------------------------------------------------------------------------------
1 | .log-list {
2 | display: flex;
3 | flex-direction: column;
4 | padding: 40rpx;
5 | }
6 | .log-item {
7 | margin: 10rpx;
8 | }
9 |
--------------------------------------------------------------------------------
/pages/cart/cart.json:
--------------------------------------------------------------------------------
1 | {
2 | "backgroundTextStyle": "light",
3 | "navigationBarBackgroundColor": "#ffffff",
4 | "navigationBarTitleText": "购物车",
5 | "navigationBarTextStyle": "black"
6 | }
--------------------------------------------------------------------------------
/pages/find/find.json:
--------------------------------------------------------------------------------
1 | {
2 | "backgroundTextStyle": "light",
3 | "navigationBarBackgroundColor": "#FAFAFA",
4 | "navigationBarTitleText": "小米商城Lite",
5 | "navigationBarTextStyle": "black"
6 | }
--------------------------------------------------------------------------------
/pages/user/user.json:
--------------------------------------------------------------------------------
1 | {
2 | "backgroundTextStyle": "light",
3 | "navigationBarBackgroundColor": "#FAFAFA",
4 | "navigationBarTitleText": "小米商城Lite",
5 | "navigationBarTextStyle": "black"
6 | }
--------------------------------------------------------------------------------
/pages/category/category.json:
--------------------------------------------------------------------------------
1 | {
2 | "backgroundTextStyle": "light",
3 | "navigationBarBackgroundColor": "#FAFAFA",
4 | "navigationBarTitleText": "小米商城Lite",
5 | "navigationBarTextStyle": "black"
6 | }
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | "backgroundTextStyle": "light",
4 | "navigationBarBackgroundColor": "#FF4500",
5 | "navigationBarTitleText": "小米商城Lite",
6 | "navigationBarTextStyle": "white"
7 | }
--------------------------------------------------------------------------------
/pages/logs/logs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{index + 1}}. {{log}}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/pages/logs/logs.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | const util = require('../../utils/util.js')
3 |
4 | Page({
5 | data: {
6 | logs: []
7 | },
8 | onLoad: function () {
9 | this.setData({
10 | logs: (wx.getStorageSync('logs') || []).map(log => {
11 | return util.formatTime(new Date(log))
12 | })
13 | })
14 | }
15 | })
16 |
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 还没有在小程序下过单
8 |
9 |
10 | 到小米商城逛逛
11 |
12 |
13 |
--------------------------------------------------------------------------------
/pages/index/PC/PC.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/pages/index/TV/Tv.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/pages/index/newGs/newGs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/pages/index/mbPhone/mbPhone.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | const formatTime = date => {
2 | const year = date.getFullYear()
3 | const month = date.getMonth() + 1
4 | const day = date.getDate()
5 | const hour = date.getHours()
6 | const minute = date.getMinutes()
7 | const second = date.getSeconds()
8 |
9 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
10 | }
11 |
12 | const formatNumber = n => {
13 | n = n.toString()
14 | return n[1] ? n : '0' + n
15 | }
16 |
17 | module.exports = {
18 | formatTime: formatTime
19 | }
20 |
--------------------------------------------------------------------------------
/pages/index/zhiNeng/zhiNeng.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/template/index-tem1.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{item.title}}
7 | {{item.desc}}
8 | {{item.price}}元
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/pages/user/setting/setting.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 小米商城Lite
6 | v1.2.64
7 |
8 |
9 |
10 | 如何补够小米手机意外险
11 | 把小米商城Lite放到手机桌面
12 | 联系客服
13 |
14 |
15 |
16 | 小米商城
17 |
18 |
19 |
--------------------------------------------------------------------------------
/pages/user/user.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | overflow: hidden;
3 | position: fixed;
4 | width: 100%;
5 | height: 100%;
6 | background: rgb(235, 235, 235);
7 | }
8 | .weui-cells{
9 | z-index: 2000;
10 | }
11 | .weui-cell.head {
12 | padding: 8px 14px;
13 | }
14 | .weui-cell.head image {
15 | width: 134rpx;
16 | height: 134rpx;
17 | margin-right: 16px;
18 | margin-left: 0;
19 | }
20 | .name {
21 | margin-top: 2rpx;
22 | }
23 | .stu_id {
24 | font-size: 30rpx;
25 | margin-top: 8rpx;
26 | color: #999;
27 | }
28 |
29 | .weui-cell__hd {
30 | font-size: 0;
31 | }
32 | .weui-cell__hd image {
33 | width: 50rpx;
34 | height: 50rpx;
35 | margin-right: 18px;
36 | margin-left: 5px;
37 | vertical-align: middle;
38 | }
39 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": false,
8 | "es6": true,
9 | "postcss": true,
10 | "minified": true,
11 | "newFeature": true
12 | },
13 | "compileType": "miniprogram",
14 | "libVersion": "1.9.98",
15 | "appid": "wx4c2cf04cc85f4ef3",
16 | "projectname": "%E5%B0%8F%E7%B1%B3%E5%95%86%E5%9F%8E",
17 | "isGameTourist": false,
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 | }
--------------------------------------------------------------------------------
/pages/user/myF/myF.js:
--------------------------------------------------------------------------------
1 | // pages/user/myF/myF.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/user/setting/setting.js:
--------------------------------------------------------------------------------
1 | // pages/user/setting/setting.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/user/myCoupon/myCoupon.js:
--------------------------------------------------------------------------------
1 | // pages/user/myCoupon/myCoupon.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 |
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 |
16 | },
17 |
18 | /**
19 | * 生命周期函数--监听页面初次渲染完成
20 | */
21 | onReady: function () {
22 |
23 | },
24 |
25 | /**
26 | * 生命周期函数--监听页面显示
27 | */
28 | onShow: function () {
29 |
30 | },
31 |
32 | /**
33 | * 生命周期函数--监听页面隐藏
34 | */
35 | onHide: function () {
36 |
37 | },
38 |
39 | /**
40 | * 生命周期函数--监听页面卸载
41 | */
42 | onUnload: function () {
43 |
44 | },
45 |
46 | /**
47 | * 页面相关事件处理函数--监听用户下拉动作
48 | */
49 | onPullDownRefresh: function () {
50 |
51 | },
52 |
53 | /**
54 | * 页面上拉触底事件的处理函数
55 | */
56 | onReachBottom: function () {
57 |
58 | },
59 |
60 | /**
61 | * 用户点击右上角分享
62 | */
63 | onShareAppMessage: function () {
64 |
65 | }
66 | })
--------------------------------------------------------------------------------
/pages/find/find.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 新品预约
6 |
7 |
8 |
9 | 活动频道
10 |
11 |
12 |
13 | 线下门店
14 |
15 |
16 |
17 | 小米团购
18 |
19 |
20 |
21 |
22 |
23 | {{item.title}}
24 | {{item.detail}}
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | {{item.title}}
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | onLaunch: function () {
4 | // 展示本地存储能力
5 | var logs = wx.getStorageSync('logs') || []
6 | logs.unshift(Date.now())
7 | wx.setStorageSync('logs', logs)
8 |
9 | // 登录
10 | wx.login({
11 | success: res => {
12 | // 发送 res.code 到后台换取 openId, sessionKey, unionId
13 | }
14 | })
15 | // 获取用户信息
16 | wx.getSetting({
17 | success: res => {
18 | if (res.authSetting['scope.userInfo']) {
19 | // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
20 | wx.getUserInfo({
21 | success: res => {
22 | // 可以将 res 发送给后台解码出 unionId
23 | this.globalData.userInfo = res.userInfo
24 | // console.log(this.globalData.userInfo)
25 | // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
26 | // 所以此处加入 callback 以防止这种情况
27 | if (this.userInfoReadyCallback) {
28 | this.userInfoReadyCallback(res)
29 | }
30 | }
31 | })
32 | }
33 | }
34 | })
35 | },
36 | globalData: {
37 | userInfo:null,
38 | detail:[],
39 | tocartMsg:[]
40 | }
41 | })
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | width: 100%;
3 | height:1205rpx;
4 | background: rgb(241, 241, 241);
5 | overflow: hidden;
6 | }
7 | .null{
8 | margin-top: 100rpx;
9 |
10 | }
11 | .null .image image{
12 | width: 100rpx;
13 | height: 100rpx;
14 |
15 | }
16 | .null .image{
17 | width: 200rpx;
18 | height: 200rpx;
19 | background: rgb(201, 199, 199);
20 | border-radius: 50%;
21 | display: flex;
22 | justify-content: center;
23 | align-items: center;
24 | margin-left: auto;
25 | margin-right: auto;
26 | }
27 | .null .desc{
28 | width: 400rpx;
29 | height: 100rpx;
30 | line-height: 100rpx;
31 | text-align: center;
32 | /* background: rgb(219, 192, 192); */
33 | margin-left: auto;
34 | margin-right: auto;
35 | margin-top: 50rpx;
36 | }
37 | .null .btn {
38 | width: 580rpx;
39 | height: 100rpx;
40 | line-height: 100rpx;
41 | text-align: center;
42 | background: rgb(248, 98, 43);
43 | margin-left: auto;
44 | margin-right: auto;
45 | margin-top: 50rpx;
46 | border-radius: 4px;
47 | color: #ffffff;
48 | }
49 | .hidden{
50 | display: none;
51 | }
--------------------------------------------------------------------------------
/pages/category/category.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 | {{item.name}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{item.Ttitle}}
16 |
17 |
18 |
19 | {{item.desc1}}
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.js:
--------------------------------------------------------------------------------
1 | // pages/user/myorder/myorder.js
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | order:[],
9 | hid:false
10 | },
11 |
12 | /**
13 | * 生命周期函数--监听页面加载
14 | */
15 | onLoad: function (options) {
16 |
17 | },
18 | toIndex:function(){
19 | wx.switchTab({
20 | url: '../../index/index'
21 | })
22 | },
23 | /**
24 | * 生命周期函数--监听页面初次渲染完成
25 | */
26 | onReady: function () {
27 |
28 | },
29 |
30 | /**
31 | * 生命周期函数--监听页面显示
32 | */
33 | onShow: function () {
34 | if(this.data.order.length>0){
35 | this.setdata({
36 | hid:true
37 | })
38 | }
39 | },
40 |
41 | /**
42 | * 生命周期函数--监听页面隐藏
43 | */
44 | onHide: function () {
45 |
46 | },
47 |
48 | /**
49 | * 生命周期函数--监听页面卸载
50 | */
51 | onUnload: function () {
52 |
53 | },
54 |
55 | /**
56 | * 页面相关事件处理函数--监听用户下拉动作
57 | */
58 | onPullDownRefresh: function () {
59 |
60 | },
61 |
62 | /**
63 | * 页面上拉触底事件的处理函数
64 | */
65 | onReachBottom: function () {
66 |
67 | },
68 |
69 | /**
70 | * 用户点击右上角分享
71 | */
72 | onShareAppMessage: function () {
73 |
74 | }
75 | })
--------------------------------------------------------------------------------
/pages/index/search/search.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 搜索
9 |
10 |
11 | 手机
12 | 电视
13 | 电脑
14 | 智能
15 | 新品
16 |
17 |
18 |
19 |
20 |
21 | {{item.title}}
22 | {{item.desc}}
23 | {{item.price}}元
24 |
25 |
26 |
--------------------------------------------------------------------------------
/pages/find/find.js:
--------------------------------------------------------------------------------
1 | import goods from '../../api/findGoods'
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | goodds:[]
9 | },
10 |
11 | /**
12 | * 生命周期函数--监听页面加载
13 | */
14 | onLoad: function (options) {
15 | // let id=options.currentTarget.dataset.id;
16 |
17 | let goodds=[];
18 | // console.log(goods.length);
19 | for(let i=0;i
2 |
13 |
21 |
22 |
23 |
24 |
25 |
26 | 购物车还是空的
27 |
28 |
29 | 到小米商城逛逛
30 |
31 |
32 |
--------------------------------------------------------------------------------
/pages/index/mbPhone/mbPhone.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | background: rgb(235, 234, 234);
3 | box-sizing: border-box
4 | }
5 | .section{
6 | width: 100%;
7 | height: 400rpx;
8 | }
9 | .section image{
10 | width: 100%;
11 | height: 100%;
12 | }
13 | .goodsList{
14 | display: inline-block;
15 | margin-top: 20rpx;
16 | margin-bottom: 20rpx;
17 | box-sizing: border-box;
18 | }
19 | .goodsList .ListButton{
20 | display: inline-block;
21 | width: 100%;
22 | background: #fff;
23 | box-sizing: border-box;
24 | }
25 | .goodsList .ListButton image{
26 | width: 370rpx;
27 | height: 300rpx;
28 | margin-right: 5rpx;
29 | }
30 | .goodsList .block .imgbut{
31 | background: #fff;
32 | }
33 | .goodsList .block{
34 | display: block;
35 | width: 750rpx;
36 | height: 100rpx;
37 | }
38 | .goodsList .block image{
39 | display: block;
40 | width: 750rpx;
41 | height: 500rpx;
42 | }
43 | .goodsList .ListButton .title,.disc{
44 | /* display: flex; */
45 | display: block;
46 | /* font-size: 25rpx; */
47 | color: rgb(34, 34, 34);
48 | margin-top: 10rpx;
49 | padding-left: 40rpx;
50 | box-sizing: border-box;
51 | }
52 |
53 | .pric{
54 | display: inline-block;
55 | /* padding-left: 20rpx; */
56 | box-sizing: border-box
57 | }
58 | .title{
59 | font-size: 30rpx;
60 | color: #000;
61 | }
62 | .disc{
63 | font-size: 25rpx;
64 | color: rgb(109, 106, 106);
65 | }
66 | .pric{
67 | font-size: 30rpx;
68 | color: red;
69 | margin-left: 30rpx;
70 | }
71 |
--------------------------------------------------------------------------------
/pages/index/zhiNeng/zhiNeng.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | background: rgb(235, 234, 234);
3 | box-sizing: border-box
4 | }
5 | .section{
6 | width: 100%;
7 | height: 400rpx;
8 | }
9 | .section image{
10 | width: 100%;
11 | height: 100%;
12 | }
13 | .goodsList{
14 | display: inline-block;
15 | margin-top: 20rpx;
16 | margin-bottom: 20rpx;
17 | box-sizing: border-box;
18 | }
19 | .goodsList .ListButton{
20 | display: inline-block;
21 | width: 100%;
22 | background: #fff;
23 | box-sizing: border-box;
24 | }
25 | .goodsList .ListButton image{
26 | width: 370rpx;
27 | height: 300rpx;
28 | margin-right: 5rpx;
29 | }
30 | .goodsList .block{
31 | display: block;
32 | width: 750rpx;
33 | height: 100rpx;
34 | }
35 | .goodsList .block .imgbut{
36 | background: #fff;
37 | }
38 | .goodsList .block image{
39 | display: block;
40 | width: 750rpx;
41 | height: 500rpx;
42 | }
43 | .goodsList .ListButton .title,.disc{
44 | /* display: flex; */
45 | display: block;
46 | /* font-size: 25rpx; */
47 | color: rgb(34, 34, 34);
48 | margin-top: 10rpx;
49 | padding-left: 40rpx;
50 | box-sizing: border-box;
51 | }
52 |
53 | .pric{
54 | display: inline-block;
55 | /* padding-left: 20rpx; */
56 | box-sizing: border-box
57 | }
58 | .title{
59 | font-size: 30rpx;
60 | color: #000;
61 | }
62 | .disc{
63 | font-size: 25rpx;
64 | color: rgb(109, 106, 106);
65 | }
66 | .pric{
67 | font-size: 30rpx;
68 | color: red;
69 | margin-left: 30rpx;
70 | }
71 |
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | const app = getApp()
4 |
5 | Page({
6 | data: {
7 | slides: [
8 | { image: '../../image/index-tiele1.jpg' },
9 | { image: '../../image/index-tiele2.jpg' },
10 | { image: '../../image/index-tiele3.jpg' },
11 | ],
12 | navlist:[
13 | {image: '../../image/indexIPH.png',title:'手机',url:'./mbPhone/mbPhone'},
14 | {image: '../../image/indexTV.png',title:'电视',url:'./TV/Tv'},
15 | {image: '../../image/indexPC.png',title:'电脑',url:'./PC/PC'},
16 | {image: '../../image/indexLY.png',title:'智能',url:'./zhiNeng/zhiNeng'},
17 | {image: '../../image/indexNewGoods.png',title:'新品',url:'./newGs/newGs'}
18 | ],
19 | goodsList:[]
20 | },
21 | onLoad: function (options) {
22 | wx.request({
23 | url: 'https://www.easy-mock.com/mock/5b1677ed69f2393736205e51/indexgoodList',
24 | success: (res)=>{
25 | this.setData({
26 | goodsList:res.data.data
27 | })
28 | // console.log(this.data.detail)
29 | }
30 | })
31 | },
32 | toDetail:function(e){
33 | var index=e.currentTarget.dataset.index;
34 | // console.log(index)
35 | var detail=this.data.goodsList[index];
36 | // console.log(detail)
37 | app.globalData.detail=detail;
38 | console.log(app.globalData.detail)
39 | // this.setData({
40 | // detail:detail
41 | // })
42 | wx.navigateTo({
43 | url: '../buy/buy',
44 | })
45 | },
46 | search:function(e){
47 | wx.navigateTo({
48 | url: './search/search',
49 | })
50 | }
51 | })
52 |
53 |
--------------------------------------------------------------------------------
/pages/user/user.js:
--------------------------------------------------------------------------------
1 | // pages/user/user.js
2 | const app = getApp()
3 | // console.log(app.globalData.userInfo)
4 | // import userInfo from './../index/index'
5 | const us=
6 | Page({
7 |
8 | /**
9 | * 页面的初始数据
10 | */
11 | data: {
12 | userInfo:{
13 | name:'水风轻',
14 | image:'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83erjJF4xYccZPLcicGThSj22x8Ev8LBr8P34TtJLiaC2JyRCTF6zMawGeQWicxwOpA3FvbdTmpRWD6Hsg/132'
15 | }
16 | },
17 | // getUserInfo: function () {
18 | // var that = this
19 | // _getUserInfo();
20 | // function _getUserInfo() {
21 | // wx.getUserInfo({
22 | // success: function (res) {
23 | // that.setData({
24 | // userInfo: res.userInfo
25 | // })
26 | // console.log(res.userInfo)
27 | // // that.update()
28 | // }
29 | // })
30 | // }
31 | // },
32 |
33 | /**
34 | * 生命周期函数--监听页面加载
35 | */
36 | onLoad: function () {
37 | },
38 |
39 |
40 | /**
41 | * 生命周期函数--监听页面初次渲染完成
42 | */
43 | onReady: function () {
44 |
45 | },
46 |
47 | /**
48 | * 生命周期函数--监听页面显示
49 | */
50 | onShow: function () {
51 |
52 | },
53 |
54 | /**
55 | * 生命周期函数--监听页面隐藏
56 | */
57 | onHide: function () {
58 |
59 | },
60 |
61 | /**
62 | * 生命周期函数--监听页面卸载
63 | */
64 | onUnload: function () {
65 |
66 | },
67 |
68 | /**
69 | * 页面相关事件处理函数--监听用户下拉动作
70 | */
71 | onPullDownRefresh: function () {
72 |
73 | },
74 |
75 | /**
76 | * 页面上拉触底事件的处理函数
77 | */
78 | onReachBottom: function () {
79 |
80 | },
81 |
82 | /**
83 | * 用户点击右上角分享
84 | */
85 | onShareAppMessage: function () {
86 |
87 | }
88 | })
--------------------------------------------------------------------------------
/pages/buy/buy.js:
--------------------------------------------------------------------------------
1 | const app = getApp()
2 | Page({
3 |
4 | /**
5 | * 页面的初始数据
6 | */
7 | data: {
8 | goodds:[],
9 | toCartMsg:[],
10 | person:{
11 | "personImg":"https://i8.mifile.cn/b2c-mimall-media/130b5d1edf2b08c7d652c305a3b51ba8.jpg?w=1212&h=716",
12 | "nickname":"小花逛商城",
13 | "content":"AR太好玩了,分享到朋友圈很多人问怎么弄的,可惜评价没法传视频,米兔应该给我广告费。 卡片有120多张,一年级的朋友玩了一个多小时了。。很多知识点,英语发音貌似老外录的,很标准。 小米出品,必须精品!"
14 | }
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | // let id=options.currentTarget.dataset.id;
22 |
23 | this.setData({
24 | goodds:app.globalData.detail
25 | })
26 | // console.log(this.data.goodds)
27 | },
28 | tocart:function(){
29 | this.setData({
30 | toCartMsg:this.data.goodds
31 | })
32 | app.globalData.tocartMsg.push(this.data.toCartMsg);
33 | wx.showToast({
34 | title: '已加入购物车',
35 | icon: 'success',
36 | duration: 2000
37 | })
38 | },
39 | /**
40 | * 生命周期函数--监听页面初次渲染完成
41 | */
42 | onReady: function () {
43 |
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面显示
48 | */
49 | onShow: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面隐藏
55 | */
56 | onHide: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面卸载
62 | */
63 | onUnload: function () {
64 |
65 | },
66 |
67 | /**
68 | * 页面相关事件处理函数--监听用户下拉动作
69 | */
70 | onPullDownRefresh: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面上拉触底事件的处理函数
76 | */
77 | onReachBottom: function () {
78 |
79 | },
80 |
81 | /**
82 | * 用户点击右上角分享
83 | */
84 | onShareAppMessage: function () {
85 |
86 | }
87 | })
--------------------------------------------------------------------------------
/pages/index/search/search.wxss:
--------------------------------------------------------------------------------
1 | .weui-search-bar{
2 | background: #FF4500;
3 | border: 0;
4 | }
5 | .text{
6 | color: #fff;
7 | width: 100rpx;
8 | text-align:center;
9 | font-size: 25rpx;
10 | margin-top: auto;
11 | margin-bottom: auto;
12 |
13 | }
14 | .searChoose{
15 | display: inline-block;
16 | width: 100rpx;
17 | height: 40rpx;
18 | background: #fff;
19 | text-align: center;
20 | margin-left: 30rpx;
21 | margin-right: 20rpx;
22 | margin-top: 20rpx;
23 | font-size: 25rpx;
24 | color: rgb(36, 35, 35);
25 | border: 0.5px solid rgb(145, 143, 143);
26 | box-sizing: border-box;
27 | }
28 | .on{
29 | display:none;
30 | }
31 | .result{
32 | position: absolute;
33 | top: 100rpx;
34 | width: 100%;
35 | height: auto;
36 | /* background: rgb(138, 66, 66); */
37 | /* margin-left: 50rpx; */
38 | }
39 | .list{
40 | /* margin-top: 10rpx; */
41 | /* background: rgb(136, 115, 115); */
42 | width: 100%;
43 | height: 150rpx;
44 | border-bottom: 0.5px solid rgb(214, 211, 211);
45 | }
46 | .result image{
47 | margin-top: 15rpx;
48 | height: 120rpx;
49 | width: 120rpx;
50 | margin-left: 25rpx;
51 | box-sizing: border-box
52 | }
53 | .result text{
54 | display: block;
55 | }
56 | .result .title{
57 | position: relative;
58 | right: -190rpx;
59 | top: -138rpx;
60 | font-size: 30rpx;
61 | }
62 | .result .desc{
63 | position: relative;
64 | right:-190rpx;
65 | top: -135rpx;
66 | font-size: 25rpx;
67 | color:rgb(99, 96, 96)
68 | }
69 | .result .price{
70 | position: relative;
71 | right:-180rpx;
72 | top: -140rpx;
73 | color: red;
74 | font-size: 30rpx;
75 | }
--------------------------------------------------------------------------------
/pages/find/find.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | overflow: hidden;
3 | position: relative;
4 | width: 100%;
5 | height: 100%;
6 | background: rgb(235, 235, 235);
7 | }
8 | .page-hd{
9 | width: 100%;
10 | margin-bottom: 30rpx;
11 | border-bottom: 0.5px solid rgb(216, 212, 212);
12 | box-sizing: border-box;
13 | background: #fff;
14 | }
15 | .nav{
16 | display: inline-block;
17 | width: 25%;
18 | height: 2.5rem;
19 | border-right: 0.5px solid rgb(221, 219, 219);
20 | box-sizing: border-box
21 | }
22 | .page-hd .navright{
23 | border-right: 0 solid transparent;
24 | }
25 | .nav image{
26 | width:60rpx;
27 | height: 60rpx;
28 | margin: 0 auto;
29 | margin-left: 50%;
30 | transform: translateX(-50%)
31 | }
32 | .nav .title{
33 | display: block;
34 | text-align: center;
35 | font-size: 30rpx;
36 | color: rgba(0, 0, 0, 0.747)
37 | }
38 | .goods{
39 | width: 730rpx;
40 | margin-left: auto;
41 | margin-right: auto;
42 | border: 0.5px solid rgb(212, 210, 210);
43 | margin-bottom: 20rpx;
44 | border-radius: 7rpx;
45 | box-sizing: border-box;
46 | box-shadow:0 0 1px 1px rgb(201, 200, 200) ;
47 | z-index: 100;
48 | }
49 | .goods .goods-image{
50 | width: 100%;
51 | }
52 | .goods .des{
53 | width: 100%;
54 | height: 100rpx;
55 | display: flex;
56 | align-items: center;
57 | justify-content: center
58 | }
59 | .goods .des view{
60 | display: inline-block;
61 | font-size: 30rpx;
62 | color: rgba(0, 0, 0, 0.74);
63 |
64 | }
65 | .goods .des .goods-title{
66 | width: 60rpx;
67 | height: 30rpx;
68 | font-size: 20rpx;
69 | color: #fff;
70 | background: rgb(248, 58, 25);
71 | text-align: center;
72 | border-radius: 7rpx;
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/pages/index/TV/Tv.js:
--------------------------------------------------------------------------------
1 | // pages/index/newGs/newGs.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | slides: [
10 | { image: 'https://i1.mifile.cn/f/i/18/mitv4/smart-screen.jpg' },
11 | { image: 'https://i1.mifile.cn/f/i/18/mitv4/index_yinzhi1.jpg' },
12 | ],
13 | goodsList:[],
14 | detail:[]
15 | },
16 |
17 |
18 | /**
19 | * 生命周期函数--监听页面加载
20 | */
21 | onLoad: function (options) {
22 | wx.request({
23 | url: 'https://www.easy-mock.com/mock/5b12d0e40f30f86cb1418f60/indexTv',
24 | success: (res)=>{
25 | this.setData({
26 | goodsList:res.data.data
27 | })
28 | // console.log(this.data.detail)
29 | }
30 | })
31 | },
32 | toDetail:function(e){
33 | var index=e.currentTarget.dataset.index;
34 | // console.log(index)
35 | var detail=this.data.goodsList[index];
36 | // console.log(detail)
37 | app.globalData.detail=detail;
38 | console.log(app.globalData.detail)
39 | this.setData({
40 | detail:detail
41 | })
42 | wx.navigateTo({
43 | url: '../../buy/buy',
44 | })
45 | },
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面显示
55 | */
56 | onShow: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面卸载
69 | */
70 | onUnload: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 |
79 | },
80 |
81 | /**
82 | * 页面上拉触底事件的处理函数
83 | */
84 | onReachBottom: function () {
85 |
86 | },
87 |
88 | /**
89 | * 用户点击右上角分享
90 | */
91 | onShareAppMessage: function () {
92 |
93 | }
94 | })
--------------------------------------------------------------------------------
/pages/index/PC/PC.js:
--------------------------------------------------------------------------------
1 | // pages/index/newGs/newGs.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | slides: [
10 | { image: 'https://i1.mifile.cn/f/i/17/mibookpro/index/slider01.jpg',url:'' },
11 | { image: 'https://i1.mifile.cn/f/i/17/mibookpro/index/slider02.jpg',url:'' },
12 | ],
13 | goodsList:[],
14 | detail:[]
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | wx.request({
22 | url: 'https://www.easy-mock.com/mock/5b13579fe2546c72e6c64eb5/indexPC',
23 | success: (res)=>{
24 | this.setData({
25 | goodsList:res.data.data
26 | })
27 | // console.log(this.data.detail)
28 | }
29 | })
30 | },
31 | toDetail:function(e){
32 | var index=e.currentTarget.dataset.index;
33 | // console.log(index)
34 | var detail=this.data.goodsList[index];
35 | // console.log(detail)
36 | app.globalData.detail=detail;
37 | console.log(app.globalData.detail)
38 | this.setData({
39 | detail:detail
40 | })
41 | wx.navigateTo({
42 | url: '../../buy/buy',
43 | })
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面显示
55 | */
56 | onShow: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面卸载
69 | */
70 | onUnload: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 |
79 | },
80 |
81 | /**
82 | * 页面上拉触底事件的处理函数
83 | */
84 | onReachBottom: function () {
85 |
86 | },
87 |
88 | /**
89 | * 用户点击右上角分享
90 | */
91 | onShareAppMessage: function () {
92 |
93 | }
94 | })
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/cart/cart",
5 | "pages/category/category",
6 | "pages/index/search/search",
7 | "pages/buy/buy",
8 | "pages/index/mbPhone/mbPhone",
9 | "pages/index/newGs/newGs",
10 | "pages/find/find",
11 | "pages/user/setting/setting",
12 | "pages/user/user",
13 | "pages/logs/logs",
14 | "pages/user/myorder/myorder",
15 | "pages/user/myF/myF",
16 | "pages/user/myCoupon/myCoupon",
17 | "pages/index/TV/Tv",
18 | "pages/index/PC/PC",
19 | "pages/index/zhiNeng/zhiNeng"
20 |
21 | ],
22 | "window": {
23 | "backgroundTextStyle": "light",
24 | "navigationBarBackgroundColor": "#fff",
25 | "navigationBarTitleText": "WeChat",
26 | "navigationBarTextStyle": "black"
27 | },
28 | "tabBar": {
29 | "color": "#b7b7b7",
30 | "selectedColor": "#d81e06",
31 | "borderStyle": "#f5f5f5",
32 | "backgroundColor": "#f5f5f5",
33 | "list": [
34 | {
35 | "pagePath": "pages/index/index",
36 | "iconPath": "image/11.png",
37 | "selectedIconPath": "image/12.png",
38 | "text": "主页"
39 | },
40 | {
41 | "pagePath": "pages/category/category",
42 | "iconPath": "image/21.png",
43 | "selectedIconPath": "image/22.png",
44 | "text": "分类"
45 | },
46 | {
47 | "pagePath": "pages/find/find",
48 | "iconPath": "image/31.png",
49 | "selectedIconPath": "image/32.png",
50 | "text": "发现"
51 | },
52 | {
53 | "pagePath": "pages/cart/cart",
54 | "iconPath": "image/43.png",
55 | "selectedIconPath": "image/43.png",
56 | "text": "购物车"
57 | },
58 | {
59 | "pagePath": "pages/user/user",
60 | "iconPath": "image/51.png",
61 | "selectedIconPath": "image/52.png",
62 | "text": "我的"
63 | }
64 | ]
65 | }
66 | }
--------------------------------------------------------------------------------
/pages/index/mbPhone/mbPhone.js:
--------------------------------------------------------------------------------
1 | // pages/index/newGs/newGs.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | slides: [
10 | { image: 'https://i1.mifile.cn/f/i/2018/mi8/summary/index1.jpg' ,url:''},
11 | { image: 'https://i1.mifile.cn/f/i/2018/mix2s/summary/screen-1.png',url:'' },
12 | ],
13 | goodsList:[],
14 | detail:[]
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | wx.request({
22 | url: 'https://www.easy-mock.com/mock/5b135f4fe2546c72e6c64eca/indexMbPhone',
23 | success: (res)=>{
24 | this.setData({
25 | goodsList:res.data.data
26 | })
27 | // console.log(this.data.goodsList)
28 | }
29 | })
30 | },
31 | toDetail:function(e){
32 | var index=e.currentTarget.dataset.index;
33 | // console.log(index)
34 | var detail=this.data.goodsList[index];
35 | // console.log(detail)
36 | app.globalData.detail=detail;
37 | console.log(app.globalData.detail)
38 | this.setData({
39 | detail:detail
40 | })
41 | wx.navigateTo({
42 | url: '../../buy/buy',
43 | })
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面显示
55 | */
56 | onShow: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面卸载
69 | */
70 | onUnload: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 |
79 | },
80 |
81 | /**
82 | * 页面上拉触底事件的处理函数
83 | */
84 | onReachBottom: function () {
85 |
86 | },
87 |
88 | /**
89 | * 用户点击右上角分享
90 | */
91 | onShareAppMessage: function () {
92 |
93 | }
94 | })
--------------------------------------------------------------------------------
/pages/index/newGs/newGs.js:
--------------------------------------------------------------------------------
1 | // pages/index/newGs/newGs.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | slides: [
10 | { image: 'https://c1.mifile.cn/f/i/16/chain/philips-bedsidelamp/bslamp-07.jpg' },
11 | { image: 'https://i8.mifile.cn/b2c-mimall-media/86347a6959274cb72519c860ace2de9e.jpg' },
12 | ],
13 | goodsList:[],
14 | detail:[]
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | wx.request({
22 | url: 'https://www.easy-mock.com/mock/5b12b8f4791ed91ba99b11cb/index-newGs',
23 | success: (res)=>{
24 | this.setData({
25 | goodsList:res.data.data
26 | })
27 | // console.log(this.data.detail)
28 | }
29 | })
30 | },
31 | toDetail:function(e){
32 | var index=e.currentTarget.dataset.index;
33 | // console.log(index)
34 | var detail=this.data.goodsList[index];
35 | // console.log(detail)
36 | app.globalData.detail=detail;
37 | console.log(app.globalData.detail)
38 | this.setData({
39 | detail:detail
40 | })
41 | wx.navigateTo({
42 | url: '../../buy/buy',
43 | })
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面显示
55 | */
56 | onShow: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面卸载
69 | */
70 | onUnload: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 |
79 | },
80 |
81 | /**
82 | * 页面上拉触底事件的处理函数
83 | */
84 | onReachBottom: function () {
85 |
86 | },
87 |
88 | /**
89 | * 用户点击右上角分享
90 | */
91 | onShareAppMessage: function () {
92 |
93 | }
94 | })
--------------------------------------------------------------------------------
/pages/index/zhiNeng/zhiNeng.js:
--------------------------------------------------------------------------------
1 | // pages/index/newGs/newGs.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | slides: [
10 | { image: 'https://i8.mifile.cn/b2c-mimall-media/7489e0e81048e3817f1197179d4f0463.jpg?bg=FFFFFF' },
11 | { image: 'https://i8.mifile.cn/b2c-mimall-media/21b4f61d7dff57fa5f7047e3da0dde0e.jpg?bg=FFFFFF' },
12 | ],
13 | goodsList:[],
14 | detail:[]
15 | },
16 |
17 | /**
18 | * 生命周期函数--监听页面加载
19 | */
20 | onLoad: function (options) {
21 | wx.request({
22 | url: 'https://www.easy-mock.com/mock/5b13504fe2546c72e6c64ea5/indexZhineng',
23 | success: (res)=>{
24 | this.setData({
25 | goodsList:res.data.data
26 | })
27 | // console.log(this.data.detail)
28 | }
29 | })
30 | },
31 | toDetail:function(e){
32 | var index=e.currentTarget.dataset.index;
33 | // console.log(index)
34 | var detail=this.data.goodsList[index];
35 | // console.log(detail)
36 | app.globalData.detail=detail;
37 | console.log(app.globalData.detail)
38 | this.setData({
39 | detail:detail
40 | })
41 | wx.navigateTo({
42 | url: '../../buy/buy',
43 | })
44 | },
45 |
46 | /**
47 | * 生命周期函数--监听页面初次渲染完成
48 | */
49 | onReady: function () {
50 |
51 | },
52 |
53 | /**
54 | * 生命周期函数--监听页面显示
55 | */
56 | onShow: function () {
57 |
58 | },
59 |
60 | /**
61 | * 生命周期函数--监听页面隐藏
62 | */
63 | onHide: function () {
64 |
65 | },
66 |
67 | /**
68 | * 生命周期函数--监听页面卸载
69 | */
70 | onUnload: function () {
71 |
72 | },
73 |
74 | /**
75 | * 页面相关事件处理函数--监听用户下拉动作
76 | */
77 | onPullDownRefresh: function () {
78 |
79 | },
80 |
81 | /**
82 | * 页面上拉触底事件的处理函数
83 | */
84 | onReachBottom: function () {
85 |
86 | },
87 |
88 | /**
89 | * 用户点击右上角分享
90 | */
91 | onShareAppMessage: function () {
92 |
93 | }
94 | })
--------------------------------------------------------------------------------
/pages/category/category.wxss:
--------------------------------------------------------------------------------
1 | page, .main{
2 | height: 100%;
3 | overflow: hidden;
4 | }
5 | .category-left{
6 | float: left;
7 | width: 150rpx;
8 | height: 100%;
9 | border-right:1px solid #ddd;
10 | box-sizing: border-box;
11 | }
12 | .category-left .cate-list.on {
13 | color: rgb(219, 29, 29);
14 | transform: scale(1.3)
15 | }
16 | .category-left .cate-list {
17 | font-size: 28rpx;
18 | text-align: center;
19 | line-height: 86rpx;
20 | }
21 | ::-webkit-scrollbar{
22 | width: 0;
23 | height: 0;
24 | color:transparent;
25 | }
26 | .category-right{
27 | /* float: right; */
28 | height: 100%;
29 | /* */
30 | /* background: #000; */
31 | margin-left: 97rpx;
32 | box-sizing: border-box;
33 | /* padding-left: 0rpx; */
34 | }
35 | .category-right{
36 | width: 600rpx;
37 | /* display: block; */
38 | position: absolute;
39 | top: 35rpx;
40 | /* background: #000; */
41 | }
42 | .cat-title{
43 | margin-left: -50rpx;
44 | display: flex;
45 | display: inline-block;
46 | text-align: center;
47 | padding-bottom: 20rpx;
48 | }
49 | .cat-title .Ttitle{
50 | /* width: 100%; */
51 | display:block;
52 | position: relative;
53 | top: -15rpx;
54 | right: -210rpx;
55 | width: 100%;
56 | }
57 | /* .line1,line2{
58 | display: inline-block;
59 | width: 100rpx;
60 | height: 1px;
61 | background: #000;
62 | } */
63 | .pro-desc{
64 | /* display: inline-block; */
65 | margin-right: 105rpx;
66 | margin-left: -38rpx;
67 | padding-top: 70rpx;
68 | width: 133rpx;
69 | height: 140rpx;
70 | margin-top: 30rpx;
71 | margin-bottom: 30rpx;
72 | /* background: #000; */
73 | box-sizing: border-box
74 | }
75 | .pro-desc:nth-child(3n){
76 | margin-right: 0;
77 | }
78 | .product .pro-desc .pro-image{
79 | display: block;
80 | width: 100rpx;
81 | height: 60rpx;
82 | }
83 | .product .pro-desc .pro-desc1{
84 | font-size: 22rpx;
85 | }
86 |
--------------------------------------------------------------------------------
/pages/user/user.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{userInfo.name}}
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | 我的订单
18 |
19 |
20 |
21 |
22 |
23 |
24 | 我的优惠券
25 |
26 |
27 |
28 |
29 |
30 |
31 | 我的F码
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | 设置
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/pages/buy/buy.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | {{goodds.title}}
14 | {{goodds.desc}}
15 | {{goodds.price}}元
16 |
17 |
18 |
19 |
20 |
21 | 已选
22 |
23 |
24 |
25 | 保修
26 |
27 |
28 |
29 |
30 |
31 |
32 | 用户评价
33 | 查看全部评价
34 |
35 |
36 |
37 | {{person.nickname}}
38 | {{person.content}}
39 |
40 |
41 |
42 | 概述
43 | 参数
44 |
45 |
46 |
47 |
48 |
49 |
50 | 加入购物车
51 |
52 |
53 | 立即购买
54 |
55 |
56 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | background: rgb(235, 234, 234);
3 | }
4 | .section{
5 | width: 100%;
6 | height: 400rpx;
7 | }
8 | .section image{
9 | width: 100%;
10 | height: 100%;
11 | }
12 | .weui-search-bar{
13 | background: #FF4500;
14 | border: 0;
15 | }
16 | .weui-search-bar__form{
17 | border-radius: 30rpx;
18 | }
19 | .weui-search-bar__box{
20 | left: 50%;
21 | transform: translateX(-10%)
22 | }
23 | .nav{
24 | display: inline-block;
25 | }
26 | .nav .navParts{
27 | height: 150rpx;
28 | width:150rpx;
29 | background: #fff;
30 | box-sizing: border-box;
31 |
32 | }
33 | .nav .navParts image{
34 | display: block;
35 | height: 55rpx;
36 | width: 55rpx;
37 | position: relative;
38 | left: 50%;
39 | transform:translateX(-50%);
40 | padding-top: 30rpx;
41 |
42 | }
43 | .nav .navParts text{
44 | display: flex;
45 | justify-content: center;
46 | font-size: 25rpx;
47 | color: rgb(34, 34, 34);
48 | margin-top: 10rpx;
49 | }
50 | .goodsList{
51 | display: inline-block;
52 | margin-top: 20rpx;
53 | margin-bottom: 20rpx;
54 | box-sizing: border-box;
55 | }
56 | .goodsList .ListButton{
57 | display: inline-block;
58 | width: 100%;
59 | background: #fff;
60 | box-sizing: border-box;
61 | }
62 | .goodsList .ListButton image{
63 | width: 370rpx;
64 | height: 300rpx;
65 | margin-right: 5rpx;
66 | }
67 | .goodsList .block{
68 | display: block;
69 | width: 750rpx;
70 | height: 100rpx;
71 | }
72 | .goodsList .block .imgbut{
73 | background: #fff;
74 | }
75 | .goodsList .block image{
76 | display: block;
77 | width: 750rpx;
78 | height: 500rpx;
79 | }
80 | .goodsList .ListButton .title,.disc{
81 | /* display: flex; */
82 | display: block;
83 | /* font-size: 25rpx; */
84 | color: rgb(34, 34, 34);
85 | margin-top: 10rpx;
86 | padding-left: 40rpx;
87 | box-sizing: border-box;
88 | }
89 |
90 | .pric{
91 | display: inline-block;
92 | /* padding-left: 20rpx; */
93 | box-sizing: border-box
94 | }
95 | .title{
96 | font-size: 30rpx;
97 | color: #000;
98 | }
99 | .disc{
100 | font-size: 25rpx;
101 | color: rgb(109, 106, 106);
102 | }
103 | .pric{
104 | font-size: 30rpx;
105 | color: red;
106 | margin-left: 30rpx;
107 | }
108 |
--------------------------------------------------------------------------------
/api/findGoods.js:
--------------------------------------------------------------------------------
1 | const goods = [
2 | {
3 | id: 1,
4 | image: 'https://i8.mifile.cn/v1/a1/e4f4413d-39ee-6c54-9ef0-741b37a5781d.jpg',
5 | title: '拼团',
6 | detail: '米粉卡日租卡',
7 | },
8 | {
9 | id: 2,
10 | image: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1506057929,3543797930&fm=27&gp=0.jpg',
11 | title: '专题',
12 | detail: '你所向往的生活,小米为你实现'
13 | },
14 | {
15 | id:3,
16 | image: 'http://img4.imgtn.bdimg.com/it/u=2700352272,3286605362&fm=27&gp=0.jpg',
17 | title: '活动',
18 | detail: '小米13款产品 荣获2018iF设计奖'
19 | },
20 | {
21 | id: 4,
22 | image: 'http://img0.imgtn.bdimg.com/it/u=4211454198,1428190006&fm=27&gp=0.jpg',
23 | title: '专题',
24 | detail: '小米年货节,全家过个科技年'
25 | },
26 | {
27 | id: 5,
28 | image: 'http://cdn.fds.api.xiaomi.com/b2c-bbs/cn/attachment/ae1e092b6d3e164fe2c98c81d87f240b.jpg',
29 | title: '活动',
30 | detail: '2017 小米年'
31 | },
32 | {
33 | id: 6,
34 | image: 'http://img1.imgtn.bdimg.com/it/u=2903334633,2436966440&fm=27&gp=0.jpg',
35 | title: '新品',
36 | detail: '小米2017感恩季',
37 |
38 | },
39 | {
40 | id: 7,
41 | image: 'https://i1.mifile.cn/f/i/17/redmi5/index_screen.jpg?',
42 | title: '新品',
43 | detail: '12月7日 红米新发'
44 | },
45 | {
46 | id: 8,
47 | image: 'https://i8.mifile.cn/b2c-mimall-media/d88b0c21dc1f8d7fb77887b3cc097da7.jpg?w=1212&h=716',
48 | title: '专题',
49 | detail: '生活 米兔'
50 | },
51 | {
52 | id: 9,
53 | image: 'https://i1.mifile.cn/f/i/17/redmi5a/gallery-1.jpg',
54 | title: '新品',
55 | detail: '红米A5 浅蓝色新版本 现货在售'
56 | },
57 | {
58 | id: 10,
59 | image: 'https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=291956657,1557711592&fm=27&gp=0.jpg',
60 | title: '新品',
61 | detail: '小米Note3 4GB+64GB'
62 | },
63 | {
64 | id: 11,
65 | image: 'https://i8.mifile.cn/b2c-mimall-media/2c49a45df14d336afb361d1d13c6c841.jpg?bg=FFFFFF',
66 | title: '专题',
67 | detail: '小米电视品牌日'
68 | },
69 | {
70 | id: 12,
71 | image: 'https://c1.mifile.cn/f/i/16/chain/air2s/mj-air2s-07.jpg',
72 | title: '新品',
73 | detail: '空气净化2s,经典再升级'
74 | },
75 | {
76 | id: 13,
77 | image: 'http://img0.imgtn.bdimg.com/it/u=2418482582,3286083692&fm=27&gp=0.jpg',
78 | title: '活动',
79 | detail: '小米11.11返厂特惠'
80 | }
81 |
82 | ]
83 |
84 | export default goods;
--------------------------------------------------------------------------------
/pages/category/category.js:
--------------------------------------------------------------------------------
1 | // pages/category/category.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | category:[
10 | {name:'新品',id:'newPro'},
11 | {name:'手机',id:'shouji'},
12 | {name:'电视',id:'dianshi'},
13 | {name:'电脑',id:'diannao'},
14 | {name:'家电',id:'jiadian'},
15 | {name:'路由',id:'luyou'},
16 | {name:'智能',id:'zhineng'},
17 | {name:'儿童',id:'chid'},
18 | {name:'灯具',id:'dengju'},
19 | {name:'电源',id:'dianyuan'},
20 | {name:'耳机',id:'erji'},
21 | {name:'音响',id:'yinxiang'},
22 | {name:'礼品',id:'lipin'},
23 | {name:'生活',id:'life'},
24 | {name:'服务',id:'server'},
25 | {name:'米粉卡',id:'Mifen'}
26 |
27 | ],
28 | detail:[],
29 | toView:'shouji',
30 | curIndex:0
31 | },
32 |
33 | /**
34 | * 生命周期函数--监听页面加载
35 | */
36 | onLoad: function (options) {
37 | wx.request({
38 | url: 'https://www.easy-mock.com/mock/5b12e16b0f30f86cb1418f70/indexNavList',
39 | success: (res)=>{
40 | // console.log(res.data)
41 | this.setData({
42 | detail:res.data.data
43 | })
44 | // console.log(this.data.detail)
45 | }
46 | })
47 | },
48 | toDetail:function(e){
49 | var index=e.currentTarget.dataset.index;
50 | console.log(index)
51 | var detail=this.data.detail[index];
52 | // console.log(detail)
53 | app.globalData.detail=detail;
54 | // console.log(app.globalData.detail)
55 | wx.navigateTo({
56 | url: '../buy/buy',
57 | })
58 | },
59 | switchCategory (e){
60 | console.log(e.currentTarget.dataset.id);
61 | this.setData({
62 | toView:e.currentTarget.dataset.id,
63 |
64 |
65 | curIndex:e.currentTarget.dataset.index?e.currentTarget.dataset.index: 0
66 | })
67 | },
68 | /**
69 | * 生命周期函数--监听页面初次渲染完成
70 | */
71 | onReady: function () {
72 |
73 | },
74 |
75 | /**
76 | * 生命周期函数--监听页面显示
77 | */
78 | onShow: function () {
79 |
80 | },
81 |
82 | /**
83 | * 生命周期函数--监听页面隐藏
84 | */
85 | onHide: function () {
86 |
87 | },
88 |
89 | /**
90 | * 生命周期函数--监听页面卸载
91 | */
92 | onUnload: function () {
93 |
94 | },
95 |
96 | /**
97 | * 页面相关事件处理函数--监听用户下拉动作
98 | */
99 | onPullDownRefresh: function () {
100 |
101 | },
102 |
103 | /**
104 | * 页面上拉触底事件的处理函数
105 | */
106 | onReachBottom: function () {
107 |
108 | },
109 |
110 | /**
111 | * 用户点击右上角分享
112 | */
113 | onShareAppMessage: function () {
114 |
115 | }
116 | })
--------------------------------------------------------------------------------
/pages/cart/cart.js:
--------------------------------------------------------------------------------
1 | // pages/cart/cart.js
2 | const app = getApp()
3 | Page({
4 | data: {
5 | selectAllStatus:false,
6 | totalPrice:0,
7 | payCount:0,
8 | carMsg:[],
9 | hid:false
10 | },
11 | selectAll: function (e) {
12 | let selectAllStatus = this.data.selectAllStatus;
13 | selectAllStatus = !selectAllStatus;
14 | let carMsg = this.data.carMsg;
15 | for (let i = 0; i < carMsg.length; i++) {
16 |
17 | carMsg[i].selected = selectAllStatus;
18 | }
19 | this.setData({
20 | carMsg,
21 | selectAllStatus,
22 | })
23 | this.getTotalPrice()
24 | },
25 | selectList: function (e) {
26 | const index = e.currentTarget.dataset.index;
27 | let carMsg = this.data.carMsg;
28 | const selected = carMsg[index].selected;
29 | carMsg[index].selected = !selected;
30 | const a = [];
31 | for (let i = 0; i < carMsg.length; i++) {
32 | if (carMsg[i].selected) {
33 | a.push(carMsg[index])
34 | }
35 | }
36 | if (carMsg.length <= a.length) {
37 | this.setData({
38 | selectAllStatus: true, carMsg
39 | });
40 | }else{
41 | this.setData({
42 | selectAllStatus: false, carMsg
43 | });
44 | }
45 | this.getTotalPrice()
46 | },
47 | getTotalPrice: function (e) {
48 | let carMsg = this.data.carMsg;
49 | let total = 0;
50 | for (let i = 0; i < carMsg.length; i++) {
51 | if (carMsg[i].selected) {
52 | total+=carMsg[i].price;
53 | }
54 | }
55 | // total=total.toFixed(1)
56 | this.setData({
57 | totalPrice: total
58 | });
59 | },
60 |
61 | /**
62 | * 生命周期函数--监听页面加载
63 | */
64 | onLoad: function (options) {
65 |
66 | },
67 |
68 | /**
69 | * 生命周期函数--监听页面初次渲染完成
70 | */
71 | onReady: function () {
72 |
73 | },
74 |
75 | /**
76 | * 生命周期函数--监听页面显示
77 | */
78 | onShow: function () {
79 | this.setData({
80 | carMsg:[...app.globalData.tocartMsg]
81 | })
82 | console.log(this.data.carMsg)
83 | if(this.data.carMsg.length>0){
84 | this.setData({
85 | hid:true
86 | })
87 | }
88 | },
89 | toIndex:function(){
90 | wx.switchTab({
91 | url: '../index/index'
92 | })
93 | },
94 | /**
95 | * 生命周期函数--监听页面隐藏
96 | */
97 | onHide: function () {
98 |
99 | },
100 |
101 | /**
102 | * 生命周期函数--监听页面卸载
103 | */
104 | onUnload: function () {
105 |
106 | },
107 |
108 | /**
109 | * 页面相关事件处理函数--监听用户下拉动作
110 | */
111 | onPullDownRefresh: function () {
112 |
113 | },
114 |
115 | /**
116 | * 页面上拉触底事件的处理函数
117 | */
118 | onReachBottom: function () {
119 |
120 | },
121 |
122 | /**
123 | * 用户点击右上角分享
124 | */
125 | onShareAppMessage: function () {
126 |
127 | }
128 | })
--------------------------------------------------------------------------------
/pages/buy/buy.wxss:
--------------------------------------------------------------------------------
1 | .page{
2 | height: auto;
3 | box-sizing: border-box;
4 | background: rgb(153, 151, 151);
5 | }
6 | .section{
7 | height: 600rpx;
8 | width: 100%;
9 | background: rgb(145, 161, 131);
10 | }
11 | .section image{
12 | height: 100%;
13 | width: 100%;
14 | /* background: #000; */
15 | }
16 | .page_bd{
17 | height: auto;
18 | width: 100%;
19 | background: #fff;
20 | }
21 | .page_bd .title,.desc,.pric{
22 | padding-left: 20rpx;
23 | padding-top: 10rpx;
24 | }
25 | .weui-cell__bd{
26 | font-size: 27rpx;
27 | }
28 | .say{
29 | background: #fff;
30 | margin-bottom: 10rpx;
31 | border-bottom: 1rpx solid rgb(177, 177, 177);
32 | }
33 | .say .top{
34 | box-sizing: border-box;
35 | display: inline-block;
36 | width: 100%;
37 | height: 100rpx;
38 | padding-left: 20rpx;
39 | padding-right: 20rpx;
40 | border-bottom: 0.5rpx solid rgb(184, 183, 183);
41 | }
42 | .say .top .left{
43 | padding-top: 20rpx;
44 | float: left;
45 | }
46 | .say .top .right{
47 | padding-top: 20rpx;
48 | float: right;
49 | font-size: 30rpx;
50 | color: rgb(158, 154, 154)
51 | }
52 | .say .personImg{
53 | display: inline-block;
54 | margin: 30rpx;
55 | height: 100rpx;
56 | width: 100rpx;
57 | border-radius: 50%;
58 | }
59 | .say .Nickname,.content{
60 | font-size: 25rpx;
61 | }
62 | .say .Nickname{
63 | position: relative;
64 | top: -70rpx;
65 | }
66 | .say .content{
67 | width: 500rpx;
68 | position: relative;
69 | top: -70rpx;
70 | right: -160rpx;
71 | }
72 | .page_bd{
73 | background: #fff;
74 | display: inline-block;
75 | }
76 | .page_bd .desc{
77 | font-size: 25rpx;
78 | color: rgb(141, 136, 136)
79 | }
80 | .page_bd .title{
81 | font-size: 35rpx;
82 |
83 | }
84 | .page_bd .pric{
85 | font-size: 25rpx;
86 | color:red;
87 | }
88 | .goodsdesc{
89 | background: #fff;
90 | display: flex;
91 | }
92 | .goodsdesc .desc,.canshu{
93 | display: inline-block;
94 | flex: 1;
95 | text-align: center;
96 | /* line-height: 100%; */
97 | }
98 | .buy{
99 | position: fixed;
100 | bottom: 0;
101 | width: 100%;
102 | display: inline-block;
103 | display: flex;
104 | background: #FFF;
105 | border-top: 0.5rpx solid rgb(201, 199, 199);
106 | box-sizing: border-box
107 |
108 | }
109 | .buy .image image{
110 | width: 100rpx;
111 | height: 100rpx;
112 | float: left;
113 | flex: 1
114 | }
115 | .buy .order,.buy1{
116 | display: inline-block;
117 | flex: 1;
118 | text-align: center;
119 | line-height: 100%;
120 | color: #fff
121 |
122 | }
123 | .buy .order{
124 | background: rgb(245, 63, 18);
125 | }
126 | .buy .buy1{
127 | background: rgb(221, 73, 54);
128 | }
--------------------------------------------------------------------------------
/pages/index/search/search.js:
--------------------------------------------------------------------------------
1 | // pages/index/search/search.js
2 | const app = getApp()
3 | Page({
4 |
5 | /**
6 | * 页面的初始数据
7 | */
8 | data: {
9 | inputValue:'',
10 | goodsList:[],
11 | newList:[],
12 | hidden:false
13 | },
14 |
15 | /**
16 | * 生命周期函数--监听页面加载
17 | */
18 | onLoad: function (options) {
19 | wx.request({
20 | url: 'https://www.easy-mock.com/mock/5b1ca08841e3435437657cdc/search',
21 | success: (res)=>{
22 | this.setData({
23 | goodsList:res.data.data
24 | })
25 | }
26 | })
27 | },
28 | input:function(e){
29 | var inputValue=e.detail.value;
30 | // console.log(inputValue)
31 | this.setData({
32 | inputValue
33 | })
34 | },
35 | search:function(e){
36 | var c=this.data.inputValue;
37 | // console.log(c);
38 | var goods=this.data.goodsList;
39 | // console.log(goods);
40 | // var inputValue1=this.data.inputValue;
41 | var re=new RegExp(c);
42 | var temp = [];
43 | if(c==''){
44 | return false
45 | }else{
46 | for(let i=0;i