├── .gitignore
├── LICENSE
├── README.md
├── app.js
├── app.json
├── app.wxss
├── common
└── weui.wxss
├── icon
├── Capture1.jpeg
├── Capture2.jpeg
├── Capture3.jpeg
├── Capture4.jpeg
├── Capture5.jpeg
├── Capture6.jpeg
├── Capture7.jpeg
├── cake-1.png
├── cake-2.png
├── cart-1.png
├── cart-2.png
├── home-1.png
├── home-2.png
├── icon_more.png
├── my-1.png
└── my-2.png
├── pages
├── buy
│ ├── buy.js
│ ├── buy.json
│ ├── buy.wxml
│ └── buy.wxss
├── cake
│ ├── cake.js
│ ├── cake.json
│ ├── cake.wxml
│ └── cake.wxss
├── cakeDetail
│ ├── cakeDetail.js
│ ├── cakeDetail.json
│ ├── cakeDetail.wxml
│ └── cakeDetail.wxss
├── cart
│ ├── cart.js
│ ├── cart.json
│ ├── cart.wxml
│ └── cart.wxss
├── index
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ └── index.wxss
├── login
│ ├── login.js
│ ├── login.json
│ ├── login.wxml
│ └── login.wxss
├── logs
│ ├── logs.js
│ ├── logs.json
│ ├── logs.wxml
│ └── logs.wxss
├── order
│ ├── order.js
│ ├── order.json
│ ├── order.wxml
│ └── order.wxss
├── payment
│ ├── payment.js
│ ├── payment.json
│ ├── payment.wxml
│ └── payment.wxss
├── phone
│ ├── phone.js
│ ├── phone.json
│ ├── phone.wxml
│ └── phone.wxss
├── success
│ ├── success.js
│ ├── success.json
│ ├── success.wxml
│ └── success.wxss
└── user
│ ├── editaddress
│ ├── editaddress.js
│ ├── editaddress.json
│ ├── editaddress.wxml
│ └── editaddress.wxss
│ ├── myaddress
│ ├── myaddress.js
│ ├── myaddress.json
│ ├── myaddress.wxml
│ └── myaddress.wxss
│ ├── mycoupons
│ ├── mycoupons.js
│ ├── mycoupons.json
│ ├── mycoupons.wxml
│ └── mycoupons.wxss
│ ├── myjzb
│ ├── myjzb.js
│ ├── myjzb.json
│ ├── myjzb.wxml
│ └── myjzb.wxss
│ ├── myorder
│ ├── myorder.js
│ ├── myorder.json
│ ├── myorder.wxml
│ └── myorder.wxss
│ ├── myorderdetals
│ ├── myorderdetals.js
│ ├── myorderdetals.json
│ ├── myorderdetals.wxml
│ └── myorderdetals.wxss
│ ├── user.js
│ ├── user.json
│ ├── user.wxml
│ └── user.wxss
├── project.config.json
└── utils
├── common.js
├── jzData.js
├── preview.js
└── util.js
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # phpstorm project files
3 | .idea
4 | .DS_STORE
5 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 yaleiliu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # wxbestcake-master
2 | 电商类小程序 包含预览、购物车、添加地址、支付、购买等一系列完整的流程
3 |
4 | # 项目说明
5 |
6 | - **基于微信小程序开发的一款移动端电商**
7 | - **基于 weui.wxss、es6 前端技术开发**
8 | - **前台[wxbestcake-master](https://github.com/kuhami/wxbestcake-master)**
9 |
10 | ## 目录结构
11 |
12 | ```
13 | wxbestcake-master/
14 | |-pages/ # 小程序页面相关文件
15 | |- buy
16 | |- index.js
17 | |- index.json
18 | |- index.wxml
19 | |- index.wxss
20 | |- ...
21 | |-app.js # 小程序逻辑
22 | |-app.json # 小程序公共设置
23 | |-app.wxss # 小程序公共样式表
24 | |-...
25 | ```
26 |
27 | ## Usage
28 |
29 | ```bash
30 | $ git clone https://github.com/kuhami/wxbestcake-master.git
31 | $ cd wxbestcake-master
32 | //导入微信开发者工具就可以啦
33 | ```
34 | ## 商城截图
35 |
36 |

37 |
38 | 
39 |
40 | 
41 |
42 | 
43 |
44 | 
45 |
46 | 
47 |
48 | 
49 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | //app.js
2 | App({
3 | version: {
4 | key: "version",
5 | current: "1.0.2",
6 | getValue: function () {
7 | return wx.getStorageSync(this.key);
8 | }
9 | },
10 | path: {
11 | res: "https://res.bestcake.com/",
12 | //www: "https://mcstj.bestcake.com/"
13 | www:"http://localhost:9419/"
14 | },
15 | user: {
16 | userid: 0,//用户ID
17 | sessionid: "",//秘钥
18 | jzb: 0,
19 | exp: 0,
20 | phone: "",
21 | levels: 0,
22 | headimg: "",
23 | islogin: function (tp) {
24 | var re = false;
25 | if (this.userid > 0) {
26 | re = true;
27 | } else {
28 | if (tp == true) {
29 | wx.navigateTo({
30 | url: '../phone/phone'
31 | })
32 | }
33 | }
34 | return re;
35 | },
36 | key: "userkey",
37 | setCache: function (obj) {
38 | wx.setStorageSync(this.key, obj);
39 | },
40 | getCache: function () {
41 | return wx.getStorageSync(this.key);
42 | },
43 | clear: function () {
44 | wx.removeStorageSync(this.key);
45 | }
46 | },
47 | city: {
48 |
49 | },
50 | cart: {
51 | key: "cart",
52 | ref: "",
53 | add: function (p) {
54 | var re = false;
55 | if (p.supplyno && p.price && p.size && p.name && p.num) {
56 | var dic = wx.getStorageSync(this.key) || {};
57 | if (p.supplyno in dic) {
58 | dic[p.supplyno].num += p.num;
59 | } else {
60 | dic[p.supplyno] = { name: p.name, price: p.price, size: p.size, num: p.num, brand: p.brand }
61 | }
62 | wx.setStorageSync(this.key, dic);
63 | re = true;
64 | }
65 | return re;
66 | },
67 | exist: function (sno) {
68 | var re = false;
69 | var dic = wx.getStorageSync(this.key) || {};
70 | if (sno in dic) {
71 | re = true;
72 | }
73 | return re;
74 | },
75 | remove: function (sno) {
76 | var dic = wx.getStorageSync(this.key) || {};
77 | if (sno in dic) {
78 | delete dic[sno];
79 | wx.setStorageSync(this.key, dic);
80 | }
81 | },
82 | getNum: function () {
83 | var n = 0;
84 | var dic = wx.getStorageSync(this.key) || {}
85 | for (var i in dic) {
86 | n += dic[i].num;
87 | }
88 | return n;
89 | },
90 | num: function (sno, n) {
91 | var dic = wx.getStorageSync(this.key) || {};
92 | if (sno in dic) {
93 | if (n > 0) {
94 | dic[sno].num = n;
95 | } else {
96 | delete dic[sno];
97 | }
98 | wx.setStorageSync(this.key, dic);
99 | }
100 | },
101 | getList: function () {
102 | var list = [];
103 | var dic = wx.getStorageSync(this.key);
104 | for (var p in dic) {
105 | list.push({ supplyno: p, name: dic[p].name, price: dic[p].price, size: dic[p].size, num: dic[p].num, brand: dic[p].brand });
106 | }
107 | return list;
108 | },
109 | clear: function () {
110 | wx.removeStorageSync(this.key);
111 | }
112 | },
113 | cake: {
114 | tab: null,
115 | key: "cake",
116 | setCache: function (obj) {
117 | wx.setStorageSync(this.key, obj);
118 | var vs = getApp().version;
119 | wx.setStorageSync(vs.key, vs.current);//设置当前版本号
120 | },
121 | getCache: function () {
122 | return wx.getStorageSync(this.key);
123 | },
124 | getByName: function (nm) {
125 | var p = null;
126 | var dic = wx.getStorageSync(this.key) || {};
127 | if (nm in dic) {
128 | p = dic[nm];
129 | }
130 | return p;
131 | }
132 | },
133 | onLaunch: function () {
134 | //调用API从本地缓存中获取数据
135 | var _this = this;
136 | var obj = _this.user.getCache("userkey");
137 | if (obj != null) {
138 | _this.user.userid = obj.userid;
139 | _this.user.sessionid = obj.sessionid;
140 | _this.user.jzb = obj.jzb;
141 | _this.user.exp = obj.exp;
142 | _this.user.phone = obj.phone;
143 | _this.user.levels = obj.levels;
144 | _this.user.headimg = obj.headimg;
145 |
146 | }
147 | },
148 | onLoad: function () {
149 |
150 | },
151 | onShow: function () {
152 | var rrr = 1;
153 | },
154 | onHide: function () {
155 | var rrr = 1;
156 | },
157 | getUserInfo: function (cb) {
158 | var that = this
159 | if (this.globalData.userInfo) {
160 | typeof cb == "function" && cb(this.globalData.userInfo)
161 | } else {
162 | //调用登录接口
163 | wx.login({
164 | success: function (v) {
165 | console.log(v);
166 | wx.getUserInfo({
167 | success: function (res) {
168 | console.log(res);
169 | that.globalData.userInfo = res.userInfo
170 | typeof cb == "function" && cb(that.globalData.userInfo)
171 | }
172 | })
173 | }
174 | })
175 | }
176 | },
177 | globalData: {
178 | userInfo: null
179 | },
180 | current: function () {
181 | var list = getCurrentPages();
182 | return list[list.length - 1];
183 | },
184 | load: function (p) {
185 | p = p ? p : {};
186 | var _obj = {//标准化
187 | data: {
188 | },
189 | };
190 | var base = { "onLoad": function () { }, "onReady": function () { }, "onShow": function () { }, "onHide": function () { }, "onUnload": function () { } };
191 | for (var i in base) {
192 | _obj[i] = (function (etype) {
193 | var _etype = "_" + etype;
194 | if (etype in p) {
195 | _obj[_etype] = p[i];//重写局部定义
196 | };
197 | return function (e) {
198 | base[etype]();//执行 global
199 | _obj[_etype] && _obj[_etype](e);
200 | }
201 | })(i)
202 | };
203 | for (var o in p) {
204 | if (!(o in base)) {
205 | if (o == "data") {
206 | for (var d in p[o]) {
207 | _obj.data[d] = p[o][d];
208 | }
209 | } else {
210 | _obj[o] = p[o];
211 | }
212 | }
213 | };
214 | Page(_obj);
215 | },
216 | modal: function (p) {
217 | wx.showModal(p);
218 | },
219 | toast: function (p) {
220 | wx.showToast(p);
221 | },
222 | loading: (function () {
223 | return {
224 | show: function (p) {
225 | p = p ? p : {};
226 | wx.showToast({
227 | title: p.title || '加载中',
228 | icon: 'loading',
229 | duration: p.duration || 10000
230 | })
231 | },
232 | hide: function () {
233 | wx.hideToast();
234 | }
235 | }
236 | })(),
237 | get: function (p, suc, tit) {
238 | var _this = this;
239 | //var loaded = false;//请求状态
240 | _this.loading.show({ title: tit });
241 | // setTimeout(function () {
242 | // if (!loaded) {
243 | // _this.loading.show();
244 | // }
245 | // }, 500);
246 | if (_this.user.islogin()) {
247 | p.userid = _this.user.userid;
248 | p.sessionid = _this.user.sessionid;
249 | }
250 | wx.request({
251 | url: this.path.www + 'client.ashx?v=' + Math.random(),
252 | data: p,
253 | header: {
254 | 'Content-Type': 'application/json'
255 | },
256 | method: "GET",
257 | success: function (res) {
258 | suc(res);
259 | },
260 | fail: function (e) {
261 | _this.toast({ title: "请求出错!" })
262 | },
263 | complete: function () {
264 | //loaded = true;//完成
265 | _this.loading.hide();
266 | }
267 | })
268 | },
269 | post: function (p, suc) {
270 | var _this = this;
271 | var loaded = false;//请求状态
272 | setTimeout(function () {
273 | if (!loaded) {
274 | _this.loading.show();
275 | }
276 | }, 500);
277 | if (_this.user.islogin()) {
278 | p.userid = _this.user.userid;
279 | p.sessionid = _this.user.sessionid;
280 | }
281 | wx.request({
282 | url: this.path.www + 'client.ashx',
283 | data: _this.json2Form(p),
284 | header: {
285 | // 'Content-Type': 'application/json'
286 | "Content-Type": "application/x-www-form-urlencoded"
287 | },
288 | method: "POST",
289 | success: function (res) {
290 | suc(res);
291 | },
292 | fail: function (e) {
293 | _this.toast({ title: "请求出错!" })
294 | },
295 | complete: function () {
296 | loaded = true;//完成
297 | _this.loading.hide();
298 | }
299 | })
300 | },
301 | json2Form: function (json) {
302 | var str = [];
303 | for (var p in json) {
304 | str.push(encodeURIComponent(p) + "=" + encodeURIComponent(json[p]));
305 | }
306 | return str.join("&");
307 | }
308 | });
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "pages/index/index",
4 | "pages/success/success",
5 | "pages/payment/payment",
6 | "pages/order/order",
7 | "pages/cake/cake",
8 | "pages/cakeDetail/cakeDetail",
9 | "pages/buy/buy",
10 | "pages/phone/phone",
11 | "pages/cart/cart",
12 | "pages/user/user",
13 | "pages/login/login",
14 | "pages/logs/logs",
15 | "pages/user/myorder/myorder",
16 | "pages/user/myjzb/myjzb",
17 | "pages/user/myorderdetals/myorderdetals",
18 | "pages/user/myaddress/myaddress",
19 | "pages/user/mycoupons/mycoupons",
20 | "pages/user/editaddress/editaddress"
21 | ],
22 | "window": {
23 | "backgroundTextStyle": "dark",
24 | "navigationBarBackgroundColor": "#576b95",
25 | "navigationBarTitleText": "BigCake",
26 | "navigationBarTextStyle": "white"
27 | },
28 | "tabBar": {
29 | "list": [
30 | {
31 | "pagePath": "pages/index/index",
32 | "text": "首页",
33 | "iconPath": "icon/home-1.png",
34 | "selectedIconPath": "icon/home-2.png"
35 | },
36 | {
37 | "pagePath": "pages/cake/cake",
38 | "text": "蛋糕馆",
39 | "iconPath": "icon/cake-1.png",
40 | "selectedIconPath": "icon/cake-2.png"
41 | },
42 | {
43 | "pagePath": "pages/cart/cart",
44 | "text": "购物车",
45 | "iconPath": "icon/cart-1.png",
46 | "selectedIconPath": "icon/cart-2.png"
47 | },
48 | {
49 | "pagePath": "pages/user/user",
50 | "text": "我的",
51 | "iconPath": "icon/my-1.png",
52 | "selectedIconPath": "icon/my-2.png"
53 | }
54 | ],
55 | "backgroundColor": "#f3f3f3",
56 | "color": "#999",
57 | "selectedColor": "#576b95"
58 | },
59 | "networkTimeout": {
60 | "request": 10000,
61 | "downloadFile": 10000,
62 | "uploadFile": 10000
63 | }
64 | }
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | /**app.wxss**/
2 | @import "common/weui.wxss";
3 | /*.cityselect{position: fixed;z-index: 1000; height: 30px;line-height: 30px; text-align: center; width:200px; left:-1px;top: -30px;background: #000;opacity: 0.4;border: 1px solid #fff; border-radius: 0 15px 15px 0;}*/
--------------------------------------------------------------------------------
/common/weui.wxss:
--------------------------------------------------------------------------------
1 | /*!
2 | * weui.js v1.1.0 (https://github.com/weui/weui-wxss)
3 | * Copyright 2016, wechat ui team
4 | * MIT license
5 | */
6 | page {
7 | line-height: 1.6;
8 | font-family: -apple-system-font, "Helvetica Neue", sans-serif;
9 | }
10 | icon {
11 | vertical-align: middle;
12 | }
13 | .weui-cells {
14 | position: relative;
15 | margin-top: 1.17647059em;
16 | background-color: #FFFFFF;
17 | line-height: 1.41176471;
18 | font-size: 17px;
19 | }
20 | .weui-cells:before {
21 | content: " ";
22 | position: absolute;
23 | left: 0;
24 | top: 0;
25 | right: 0;
26 | height: 1px;
27 | border-top: 1rpx solid #D9D9D9;
28 | color: #D9D9D9;
29 | }
30 | .weui-cells:after {
31 | content: " ";
32 | position: absolute;
33 | left: 0;
34 | bottom: 0;
35 | right: 0;
36 | height: 1px;
37 | border-bottom: 1rpx solid #D9D9D9;
38 | color: #D9D9D9;
39 | }
40 | .weui-cells__title {
41 | margin-top: .77em;
42 | margin-bottom: .3em;
43 | padding-left: 15px;
44 | padding-right: 15px;
45 | color: #999999;
46 | font-size: 14px;
47 | }
48 | .weui-cells_after-title {
49 | margin-top: 0;
50 | }
51 | .weui-cells__tips {
52 | margin-top: .3em;
53 | color: #999999;
54 | padding-left: 15px;
55 | padding-right: 15px;
56 | font-size: 14px;
57 | }
58 | .weui-cell {
59 | padding: 10px 15px;
60 | position: relative;
61 | display: -webkit-box;
62 | display: -webkit-flex;
63 | display: flex;
64 | -webkit-box-align: center;
65 | -webkit-align-items: center;
66 | align-items: center;
67 | }
68 | .weui-cell:before {
69 | content: " ";
70 | position: absolute;
71 | left: 0;
72 | top: 0;
73 | right: 0;
74 | height: 1px;
75 | border-top: 1rpx solid #D9D9D9;
76 | color: #D9D9D9;
77 | left: 15px;
78 | }
79 | .weui-cell:first-child:before {
80 | display: none;
81 | }
82 | .weui-cell_active {
83 | background-color: #ECECEC;
84 | }
85 | .weui-cell_primary {
86 | -webkit-box-align: start;
87 | -webkit-align-items: flex-start;
88 | align-items: flex-start;
89 | }
90 | .weui-cell__bd {
91 | -webkit-box-flex: 1;
92 | -webkit-flex: 1;
93 | flex: 1;
94 | }
95 | .weui-cell__ft {
96 | text-align: right;
97 | color: #999999;
98 | }
99 | .weui-cell_access {
100 | color: inherit;
101 | }
102 | .weui-cell__ft_in-access {
103 | padding-right: 13px;
104 | position: relative;
105 | }
106 | .weui-cell__ft_in-access:after {
107 | content: " ";
108 | display: inline-block;
109 | height: 6px;
110 | width: 6px;
111 | border-width: 2px 2px 0 0;
112 | border-color: #C8C8CD;
113 | border-style: solid;
114 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
115 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
116 | position: relative;
117 | top: -2px;
118 | position: absolute;
119 | top: 50%;
120 | margin-top: -4px;
121 | right: 2px;
122 | }
123 | .weui-cell_link {
124 | color: #586C94;
125 | font-size: 14px;
126 | }
127 | .weui-cell_link:active {
128 | background-color: #ECECEC;
129 | }
130 | .weui-cell_link:first-child:before {
131 | display: block;
132 | }
133 | .weui-icon-radio {
134 | margin-left: 3.2px;
135 | margin-right: 3.2px;
136 | }
137 | .weui-icon-checkbox_circle,
138 | .weui-icon-checkbox_success {
139 | margin-left: 4.6px;
140 | margin-right: 4.6px;
141 | }
142 | .weui-check__label:active {
143 | background-color: #ECECEC;
144 | }
145 | .weui-check {
146 | position: absolute;
147 | left: -9999px;
148 | }
149 | .weui-check__hd_in-checkbox {
150 | padding-right: 0.35em;
151 | }
152 | .weui-cell__ft_in-radio {
153 | padding-left: 0.35em;
154 | }
155 | .weui-cell_input {
156 | padding-top: 0;
157 | padding-bottom: 0;
158 | }
159 | .weui-label {
160 | width: 105px;
161 | word-wrap: break-word;
162 | word-break: break-all;
163 | }
164 | .weui-input {
165 | height: 2.58823529em;
166 | min-height: 2.58823529em;
167 | line-height: 2.58823529em;
168 | }
169 | .weui-toptips {
170 | position: fixed;
171 | -webkit-transform: translateZ(0);
172 | transform: translateZ(0);
173 | top: 0;
174 | left: 0;
175 | right: 0;
176 | padding: 5px;
177 | font-size: 14px;
178 | text-align: center;
179 | color: #FFFFFF;
180 | z-index: 5000;
181 | word-wrap: break-word;
182 | word-break: break-all;
183 | }
184 | .weui-toptips_warn {
185 | background-color: #E64340;
186 | }
187 | .weui-textarea {
188 | display: block;
189 | width: 100%;
190 | }
191 | .weui-textarea-counter {
192 | color: #B2B2B2;
193 | text-align: right;
194 | }
195 | .weui-textarea-counter_warn {
196 | color: #E64340;
197 | }
198 | .weui-cell_warn {
199 | color: #E64340;
200 | }
201 | .weui-form-preview {
202 | position: relative;
203 | background-color: #FFFFFF;
204 | }
205 | .weui-form-preview:before {
206 | content: " ";
207 | position: absolute;
208 | left: 0;
209 | top: 0;
210 | right: 0;
211 | height: 1px;
212 | border-top: 1rpx solid #D9D9D9;
213 | color: #D9D9D9;
214 | }
215 | .weui-form-preview:after {
216 | content: " ";
217 | position: absolute;
218 | left: 0;
219 | bottom: 0;
220 | right: 0;
221 | height: 1px;
222 | border-bottom: 1rpx solid #D9D9D9;
223 | color: #D9D9D9;
224 | }
225 | .weui-form-preview__value {
226 | font-size: 14px;
227 | }
228 | .weui-form-preview__value_in-hd {
229 | font-size: 26px;
230 | }
231 | .weui-form-preview__hd {
232 | position: relative;
233 | padding: 10px 15px;
234 | text-align: right;
235 | line-height: 2.5em;
236 | }
237 | .weui-form-preview__hd:after {
238 | content: " ";
239 | position: absolute;
240 | left: 0;
241 | bottom: 0;
242 | right: 0;
243 | height: 1px;
244 | border-bottom: 1rpx solid #D9D9D9;
245 | color: #D9D9D9;
246 | left: 15px;
247 | }
248 | .weui-form-preview__bd {
249 | padding: 10px 15px;
250 | font-size: .9em;
251 | text-align: right;
252 | color: #999999;
253 | line-height: 2;
254 | }
255 | .weui-form-preview__ft {
256 | position: relative;
257 | line-height: 50px;
258 | display: -webkit-box;
259 | display: -webkit-flex;
260 | display: flex;
261 | }
262 | .weui-form-preview__ft:after {
263 | content: " ";
264 | position: absolute;
265 | left: 0;
266 | top: 0;
267 | right: 0;
268 | height: 1px;
269 | border-top: 1rpx solid #D5D5D6;
270 | color: #D5D5D6;
271 | }
272 | .weui-form-preview__item {
273 | overflow: hidden;
274 | }
275 | .weui-form-preview__label {
276 | float: left;
277 | margin-right: 1em;
278 | min-width: 4em;
279 | color: #999999;
280 | text-align: justify;
281 | text-align-last: justify;
282 | }
283 | .weui-form-preview__value {
284 | display: block;
285 | overflow: hidden;
286 | word-break: normal;
287 | word-wrap: break-word;
288 | }
289 | .weui-form-preview__btn {
290 | position: relative;
291 | display: block;
292 | -webkit-box-flex: 1;
293 | -webkit-flex: 1;
294 | flex: 1;
295 | color: #3CC51F;
296 | text-align: center;
297 | }
298 | .weui-form-preview__btn:after {
299 | content: " ";
300 | position: absolute;
301 | left: 0;
302 | top: 0;
303 | width: 1px;
304 | bottom: 0;
305 | border-left: 1rpx solid #D5D5D6;
306 | color: #D5D5D6;
307 | }
308 | .weui-form-preview__btn:first-child:after {
309 | display: none;
310 | }
311 | .weui-form-preview__btn_active {
312 | background-color: #EEEEEE;
313 | }
314 | .weui-form-preview__btn_default {
315 | color: #999999;
316 | }
317 | .weui-form-preview__btn_primary {
318 | color: #0BB20C;
319 | }
320 | .weui-cell_select {
321 | padding: 0;
322 | }
323 | .weui-select {
324 | position: relative;
325 | padding-left: 15px;
326 | padding-right: 30px;
327 | height: 2.58823529em;
328 | min-height: 2.58823529em;
329 | line-height: 2.58823529em;
330 | border-right: 1rpx solid #D9D9D9;
331 | }
332 | .weui-select:before {
333 | content: " ";
334 | display: inline-block;
335 | height: 6px;
336 | width: 6px;
337 | border-width: 2px 2px 0 0;
338 | border-color: #C8C8CD;
339 | border-style: solid;
340 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
341 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
342 | position: relative;
343 | top: -2px;
344 | position: absolute;
345 | top: 50%;
346 | right: 15px;
347 | margin-top: -4px;
348 | }
349 | .weui-select_in-select-after {
350 | padding-left: 0;
351 | }
352 | .weui-cell__hd_in-select-after,
353 | .weui-cell__bd_in-select-before {
354 | padding-left: 15px;
355 | }
356 | .weui-cell_vcode {
357 | padding-right: 0;
358 | }
359 | .weui-vcode-img {
360 | margin-left: 5px;
361 | height: 2.58823529em;
362 | vertical-align: middle;
363 | }
364 | .weui-vcode-btn {
365 | display: inline-block;
366 | height: 2.58823529em;
367 | margin-left: 5px;
368 | padding: 0 0.6em 0 0.7em;
369 | border-left: 1px solid #E5E5E5;
370 | line-height: 2.58823529em;
371 | vertical-align: middle;
372 | font-size: 17px;
373 | color: #3CC51F;
374 | white-space: nowrap;
375 | }
376 | .weui-vcode-btn:active {
377 | color: #52a341;
378 | }
379 | .weui-cell_switch {
380 | padding-top: 6px;
381 | padding-bottom: 6px;
382 | }
383 | .weui-uploader__hd {
384 | display: -webkit-box;
385 | display: -webkit-flex;
386 | display: flex;
387 | padding-bottom: 10px;
388 | -webkit-box-align: center;
389 | -webkit-align-items: center;
390 | align-items: center;
391 | }
392 | .weui-uploader__title {
393 | -webkit-box-flex: 1;
394 | -webkit-flex: 1;
395 | flex: 1;
396 | }
397 | .weui-uploader__info {
398 | color: #B2B2B2;
399 | }
400 | .weui-uploader__bd {
401 | margin-bottom: -4px;
402 | margin-right: -9px;
403 | overflow: hidden;
404 | }
405 | .weui-uploader__file {
406 | float: left;
407 | margin-right: 9px;
408 | margin-bottom: 9px;
409 | }
410 | .weui-uploader__img {
411 | display: block;
412 | width: 79px;
413 | height: 79px;
414 | }
415 | .weui-uploader__file_status {
416 | position: relative;
417 | }
418 | .weui-uploader__file_status:before {
419 | content: " ";
420 | position: absolute;
421 | top: 0;
422 | right: 0;
423 | bottom: 0;
424 | left: 0;
425 | background-color: rgba(0, 0, 0, 0.5);
426 | }
427 | .weui-uploader__file-content {
428 | position: absolute;
429 | top: 50%;
430 | left: 50%;
431 | -webkit-transform: translate(-50%, -50%);
432 | transform: translate(-50%, -50%);
433 | color: #FFFFFF;
434 | }
435 | .weui-uploader__input-box {
436 | float: left;
437 | position: relative;
438 | margin-right: 9px;
439 | margin-bottom: 9px;
440 | width: 77px;
441 | height: 77px;
442 | border: 1px solid #D9D9D9;
443 | }
444 | .weui-uploader__input-box:before,
445 | .weui-uploader__input-box:after {
446 | content: " ";
447 | position: absolute;
448 | top: 50%;
449 | left: 50%;
450 | -webkit-transform: translate(-50%, -50%);
451 | transform: translate(-50%, -50%);
452 | background-color: #D9D9D9;
453 | }
454 | .weui-uploader__input-box:before {
455 | width: 2px;
456 | height: 39.5px;
457 | }
458 | .weui-uploader__input-box:after {
459 | width: 39.5px;
460 | height: 2px;
461 | }
462 | .weui-uploader__input-box:active {
463 | border-color: #999999;
464 | }
465 | .weui-uploader__input-box:active:before,
466 | .weui-uploader__input-box:active:after {
467 | background-color: #999999;
468 | }
469 | .weui-uploader__input {
470 | position: absolute;
471 | z-index: 1;
472 | top: 0;
473 | left: 0;
474 | width: 100%;
475 | height: 100%;
476 | opacity: 0;
477 | }
478 | .weui-article {
479 | padding: 20px 15px;
480 | font-size: 15px;
481 | }
482 | .weui-article__section {
483 | margin-bottom: 1.5em;
484 | }
485 | .weui-article__h1 {
486 | font-size: 18px;
487 | font-weight: 400;
488 | margin-bottom: .9em;
489 | }
490 | .weui-article__h2 {
491 | font-size: 16px;
492 | font-weight: 400;
493 | margin-bottom: .34em;
494 | }
495 | .weui-article__h3 {
496 | font-weight: 400;
497 | font-size: 15px;
498 | margin-bottom: .34em;
499 | }
500 | .weui-article__p {
501 | margin: 0 0 .8em;
502 | }
503 | .weui-msg {
504 | padding-top: 36px;
505 | text-align: center;
506 | }
507 | .weui-msg__link {
508 | display: inline;
509 | color: #586C94;
510 | }
511 | .weui-msg__icon-area {
512 | margin-bottom: 30px;
513 | }
514 | .weui-msg__text-area {
515 | margin-bottom: 25px;
516 | padding: 0 20px;
517 | }
518 | .weui-msg__title {
519 | margin-bottom: 5px;
520 | font-weight: 400;
521 | font-size: 20px;
522 | }
523 | .weui-msg__desc {
524 | font-size: 14px;
525 | color: #999999;
526 | }
527 | .weui-msg__opr-area {
528 | margin-bottom: 25px;
529 | }
530 | .weui-msg__extra-area {
531 | margin-bottom: 15px;
532 | font-size: 14px;
533 | color: #999999;
534 | }
535 | @media screen and (min-height: 438px) {
536 | .weui-msg__extra-area {
537 | position: fixed;
538 | left: 0;
539 | bottom: 0;
540 | width: 100%;
541 | text-align: center;
542 | }
543 | }
544 | .weui-flex {
545 | display: -webkit-box;
546 | display: -webkit-flex;
547 | display: flex;
548 | }
549 | .weui-flex__item {
550 | -webkit-box-flex: 1;
551 | -webkit-flex: 1;
552 | flex: 1;
553 | }
554 | .weui-btn {
555 | margin-top: 15px;
556 | }
557 | .weui-btn:first-child {
558 | margin-top: 0;
559 | }
560 | .weui-btn-area {
561 | margin: 1.17647059em 15px 0.3em;
562 | }
563 | .weui-agree {
564 | display: block;
565 | padding: .5em 15px;
566 | font-size: 13px;
567 | }
568 | .weui-agree__text {
569 | color: #999999;
570 | }
571 | .weui-agree__link {
572 | display: inline;
573 | color: #586C94;
574 | }
575 | .weui-agree__checkbox {
576 | position: absolute;
577 | left: -9999px;
578 | }
579 | .weui-agree__checkbox-icon {
580 | position: relative;
581 | top: 2px;
582 | display: inline-block;
583 | border: 1px solid #D1D1D1;
584 | background-color: #FFFFFF;
585 | border-radius: 3px;
586 | width: 11px;
587 | height: 11px;
588 | }
589 | .weui-agree__checkbox-icon-check {
590 | position: absolute;
591 | top: 1px;
592 | left: 1px;
593 | }
594 | .weui-footer {
595 | color: #999999;
596 | font-size: 14px;
597 | text-align: center;
598 | }
599 | .weui-footer_fixed-bottom {
600 | position: fixed;
601 | bottom: .52em;
602 | left: 0;
603 | right: 0;
604 | }
605 | .weui-footer__links {
606 | font-size: 0;
607 | }
608 | .weui-footer__link {
609 | display: inline-block;
610 | vertical-align: top;
611 | margin: 0 .62em;
612 | position: relative;
613 | font-size: 14px;
614 | color: #586C94;
615 | }
616 | .weui-footer__link:before {
617 | content: " ";
618 | position: absolute;
619 | left: 0;
620 | top: 0;
621 | width: 1px;
622 | bottom: 0;
623 | border-left: 1rpx solid #C7C7C7;
624 | color: #C7C7C7;
625 | left: -0.65em;
626 | top: .36em;
627 | bottom: .36em;
628 | }
629 | .weui-footer__link:first-child:before {
630 | display: none;
631 | }
632 | .weui-footer__text {
633 | padding: 0 .34em;
634 | font-size: 12px;
635 | }
636 | .weui-grids {
637 | border-top: 1rpx solid #D9D9D9;
638 | border-left: 1rpx solid #D9D9D9;
639 | overflow: hidden;
640 | }
641 | .weui-grid {
642 | position: relative;
643 | float: left;
644 | padding: 20px 10px;
645 | width: 33.33333333%;
646 | box-sizing: border-box;
647 | border-right: 1rpx solid #D9D9D9;
648 | border-bottom: 1rpx solid #D9D9D9;
649 | }
650 | .weui-grid_active {
651 | background-color: #ECECEC;
652 | }
653 | .weui-grid__icon {
654 | display: block;
655 | width: 28px;
656 | height: 28px;
657 | margin: 0 auto;
658 | }
659 | .weui-grid__label {
660 | margin-top: 5px;
661 | display: block;
662 | text-align: center;
663 | color: #000000;
664 | font-size: 14px;
665 | white-space: nowrap;
666 | text-overflow: ellipsis;
667 | overflow: hidden;
668 | }
669 | .weui-loading {
670 | margin: 0 5px;
671 | width: 20px;
672 | height: 20px;
673 | display: inline-block;
674 | vertical-align: middle;
675 | -webkit-animation: weuiLoading 1s steps(12, end) infinite;
676 | animation: weuiLoading 1s steps(12, end) infinite;
677 | background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
678 | background-size: 100%;
679 | }
680 | @-webkit-keyframes weuiLoading {
681 | 0% {
682 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
683 | transform: rotate3d(0, 0, 1, 0deg);
684 | }
685 | 100% {
686 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
687 | transform: rotate3d(0, 0, 1, 360deg);
688 | }
689 | }
690 | @keyframes weuiLoading {
691 | 0% {
692 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
693 | transform: rotate3d(0, 0, 1, 0deg);
694 | }
695 | 100% {
696 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
697 | transform: rotate3d(0, 0, 1, 360deg);
698 | }
699 | }
700 | .weui-badge {
701 | display: inline-block;
702 | padding: .15em .4em;
703 | min-width: 8px;
704 | border-radius: 18px;
705 | background-color: #F43530;
706 | color: #FFFFFF;
707 | line-height: 1.2;
708 | text-align: center;
709 | font-size: 12px;
710 | vertical-align: middle;
711 | }
712 | .weui-badge_dot {
713 | padding: .4em;
714 | min-width: 0;
715 | }
716 | .weui-loadmore {
717 | width: 65%;
718 | margin: 1.5em auto;
719 | line-height: 1.6em;
720 | font-size: 14px;
721 | text-align: center;
722 | }
723 | .weui-loadmore__tips {
724 | display: inline-block;
725 | vertical-align: middle;
726 | }
727 | .weui-loadmore_line {
728 | border-top: 1px solid #E5E5E5;
729 | margin-top: 2.4em;
730 | }
731 | .weui-loadmore__tips_in-line {
732 | position: relative;
733 | top: -0.9em;
734 | padding: 0 .55em;
735 | background-color: #FFFFFF;
736 | color: #999999;
737 | }
738 | .weui-loadmore__tips_in-dot {
739 | position: relative;
740 | padding: 0 .16em;
741 | width: 4px;
742 | height: 1.6em;
743 | }
744 | .weui-loadmore__tips_in-dot:before {
745 | content: " ";
746 | position: absolute;
747 | top: 50%;
748 | left: 50%;
749 | margin-top: -1px;
750 | margin-left: -2px;
751 | width: 4px;
752 | height: 4px;
753 | border-radius: 50%;
754 | background-color: #E5E5E5;
755 | }
756 | .weui-panel {
757 | background-color: #FFFFFF;
758 | margin-top: 10px;
759 | position: relative;
760 | overflow: hidden;
761 | }
762 | .weui-panel:first-child {
763 | margin-top: 0;
764 | }
765 | .weui-panel:before {
766 | content: " ";
767 | position: absolute;
768 | left: 0;
769 | top: 0;
770 | right: 0;
771 | height: 1px;
772 | border-top: 1rpx solid #E5E5E5;
773 | color: #E5E5E5;
774 | }
775 | .weui-panel:after {
776 | content: " ";
777 | position: absolute;
778 | left: 0;
779 | bottom: 0;
780 | right: 0;
781 | height: 1px;
782 | border-bottom: 1rpx solid #E5E5E5;
783 | color: #E5E5E5;
784 | }
785 | .weui-panel__hd {
786 | padding: 14px 15px 10px;
787 | color: #999999;
788 | font-size: 13px;
789 | position: relative;
790 | }
791 | .weui-panel__hd:after {
792 | content: " ";
793 | position: absolute;
794 | left: 0;
795 | bottom: 0;
796 | right: 0;
797 | height: 1px;
798 | border-bottom: 1rpx solid #E5E5E5;
799 | color: #E5E5E5;
800 | left: 15px;
801 | }
802 | .weui-media-box {
803 | padding: 15px;
804 | position: relative;
805 | }
806 | .weui-media-box:before {
807 | content: " ";
808 | position: absolute;
809 | left: 0;
810 | top: 0;
811 | right: 0;
812 | height: 1px;
813 | border-top: 1rpx solid #E5E5E5;
814 | color: #E5E5E5;
815 | left: 15px;
816 | }
817 | .weui-media-box:first-child:before {
818 | display: none;
819 | }
820 | .weui-media-box__title {
821 | font-weight: 400;
822 | font-size: 17px;
823 | width: auto;
824 | overflow: hidden;
825 | text-overflow: ellipsis;
826 | white-space: nowrap;
827 | word-wrap: normal;
828 | word-wrap: break-word;
829 | word-break: break-all;
830 | }
831 | .weui-media-box__desc {
832 | color: #999999;
833 | font-size: 13px;
834 | line-height: 1.2;
835 | overflow: hidden;
836 | text-overflow: ellipsis;
837 | display: -webkit-box;
838 | -webkit-box-orient: vertical;
839 | -webkit-line-clamp: 2;
840 | }
841 | .weui-media-box__info {
842 | margin-top: 15px;
843 | padding-bottom: 5px;
844 | font-size: 13px;
845 | color: #CECECE;
846 | line-height: 1em;
847 | list-style: none;
848 | overflow: hidden;
849 | }
850 | .weui-media-box__info__meta {
851 | float: left;
852 | padding-right: 1em;
853 | }
854 | .weui-media-box__info__meta_extra {
855 | padding-left: 1em;
856 | border-left: 1px solid #CECECE;
857 | }
858 | .weui-media-box__title_in-text {
859 | margin-bottom: 8px;
860 | }
861 | .weui-media-box_appmsg {
862 | display: -webkit-box;
863 | display: -webkit-flex;
864 | display: flex;
865 | -webkit-box-align: center;
866 | -webkit-align-items: center;
867 | align-items: center;
868 | }
869 | .weui-media-box__thumb {
870 | width: 100%;
871 | height: 100%;
872 | vertical-align: top;
873 | }
874 | .weui-media-box__hd_in-appmsg {
875 | margin-right: .8em;
876 | width: 60px;
877 | height: 60px;
878 | line-height: 60px;
879 | text-align: center;
880 | }
881 | .weui-media-box__bd_in-appmsg {
882 | -webkit-box-flex: 1;
883 | -webkit-flex: 1;
884 | flex: 1;
885 | min-width: 0;
886 | }
887 | .weui-media-box_small-appmsg {
888 | padding: 0;
889 | }
890 | .weui-cells_in-small-appmsg {
891 | margin-top: 0;
892 | }
893 | .weui-cells_in-small-appmsg:before {
894 | display: none;
895 | }
896 | .weui-progress {
897 | display: -webkit-box;
898 | display: -webkit-flex;
899 | display: flex;
900 | -webkit-box-align: center;
901 | -webkit-align-items: center;
902 | align-items: center;
903 | }
904 | .weui-progress__bar {
905 | -webkit-box-flex: 1;
906 | -webkit-flex: 1;
907 | flex: 1;
908 | }
909 | .weui-progress__opr {
910 | margin-left: 15px;
911 | font-size: 0;
912 | }
913 | .weui-navbar {
914 | display: -webkit-box;
915 | display: -webkit-flex;
916 | display: flex;
917 | position: absolute;
918 | z-index: 500;
919 | top: 0;
920 | width: 100%;
921 | border-bottom: 1rpx solid #CCCCCC;
922 | }
923 | .weui-navbar__item {
924 | position: relative;
925 | display: block;
926 | -webkit-box-flex: 1;
927 | -webkit-flex: 1;
928 | flex: 1;
929 | padding: 13px 0;
930 | text-align: center;
931 | font-size: 0;
932 | }
933 | .weui-navbar__item.weui-bar__item_on {
934 | color: #1AAD19;
935 | }
936 | .weui-navbar__slider {
937 | position: absolute;
938 | content: " ";
939 | left: 0;
940 | bottom: 0;
941 | width: 6em;
942 | height: 3px;
943 | background-color: #1AAD19;
944 | -webkit-transition: -webkit-transform .3s;
945 | transition: -webkit-transform .3s;
946 | transition: transform .3s;
947 | transition: transform .3s, -webkit-transform .3s;
948 | }
949 | .weui-navbar__title {
950 | display: inline-block;
951 | font-size: 15px;
952 | max-width: 8em;
953 | width: auto;
954 | overflow: hidden;
955 | text-overflow: ellipsis;
956 | white-space: nowrap;
957 | word-wrap: normal;
958 | }
959 | .weui-tab {
960 | position: relative;
961 | height: 100%;
962 | }
963 | .weui-tab__panel {
964 | box-sizing: border-box;
965 | height: 100%;
966 | padding-top: 50px;
967 | overflow: auto;
968 | -webkit-overflow-scrolling: touch;
969 | }
970 | .weui-search-bar {
971 | position: relative;
972 | padding: 8px 10px;
973 | display: -webkit-box;
974 | display: -webkit-flex;
975 | display: flex;
976 | box-sizing: border-box;
977 | background-color: #EFEFF4;
978 | border-top: 1rpx solid #D7D6DC;
979 | border-bottom: 1rpx solid #D7D6DC;
980 | }
981 | .weui-icon-search {
982 | margin-right: 8px;
983 | font-size: inherit;
984 | }
985 | .weui-icon-search_in-box {
986 | position: absolute;
987 | left: 10px;
988 | top: 7px;
989 | }
990 | .weui-search-bar__text {
991 | display: inline-block;
992 | font-size: 14px;
993 | vertical-align: middle;
994 | }
995 | .weui-search-bar__form {
996 | position: relative;
997 | -webkit-box-flex: 1;
998 | -webkit-flex: auto;
999 | flex: auto;
1000 | border-radius: 5px;
1001 | background: #FFFFFF;
1002 | border: 1rpx solid #E6E6EA;
1003 | }
1004 | .weui-search-bar__box {
1005 | position: relative;
1006 | padding-left: 30px;
1007 | padding-right: 30px;
1008 | width: 100%;
1009 | box-sizing: border-box;
1010 | z-index: 1;
1011 | }
1012 | .weui-search-bar__input {
1013 | height: 28px;
1014 | line-height: 28px;
1015 | font-size: 14px;
1016 | }
1017 | .weui-icon-clear {
1018 | position: absolute;
1019 | top: 0;
1020 | right: 0;
1021 | padding: 7px 8px;
1022 | font-size: 0;
1023 | }
1024 | .weui-search-bar__label {
1025 | position: absolute;
1026 | top: 0;
1027 | right: 0;
1028 | bottom: 0;
1029 | left: 0;
1030 | z-index: 2;
1031 | border-radius: 3px;
1032 | text-align: center;
1033 | color: #9B9B9B;
1034 | background: #FFFFFF;
1035 | line-height: 28px;
1036 | }
1037 | .weui-search-bar__cancel-btn {
1038 | margin-left: 10px;
1039 | line-height: 28px;
1040 | color: #09BB07;
1041 | white-space: nowrap;
1042 | }
1043 |
--------------------------------------------------------------------------------
/icon/Capture1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture1.jpeg
--------------------------------------------------------------------------------
/icon/Capture2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture2.jpeg
--------------------------------------------------------------------------------
/icon/Capture3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture3.jpeg
--------------------------------------------------------------------------------
/icon/Capture4.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture4.jpeg
--------------------------------------------------------------------------------
/icon/Capture5.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture5.jpeg
--------------------------------------------------------------------------------
/icon/Capture6.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture6.jpeg
--------------------------------------------------------------------------------
/icon/Capture7.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/Capture7.jpeg
--------------------------------------------------------------------------------
/icon/cake-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/cake-1.png
--------------------------------------------------------------------------------
/icon/cake-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/cake-2.png
--------------------------------------------------------------------------------
/icon/cart-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/cart-1.png
--------------------------------------------------------------------------------
/icon/cart-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/cart-2.png
--------------------------------------------------------------------------------
/icon/home-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/home-1.png
--------------------------------------------------------------------------------
/icon/home-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/home-2.png
--------------------------------------------------------------------------------
/icon/icon_more.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/icon_more.png
--------------------------------------------------------------------------------
/icon/my-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/my-1.png
--------------------------------------------------------------------------------
/icon/my-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kuhami/wxbestcake-master/b48d888e7938fe1744a60bedc322c5e5b097c4f8/icon/my-2.png
--------------------------------------------------------------------------------
/pages/buy/buy.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | Page({
3 | data: {
4 | pay: 1,
5 | brand: 0,
6 | pro: "",
7 | phone: "",
8 | phoneOk: false
9 | },
10 | onLoad: function (e) {
11 | var obj = {
12 | price: 0.01 || e.price,
13 | brand: e.type
14 | }
15 | if (e.pay && e.pay == "free") {
16 | wx.setNavigationBarTitle({ title: "领取奖励" });
17 | obj.pay = 0;
18 | obj.title = "获赠商品";
19 | obj.btn = "领取"
20 | } else {
21 | obj.pay = 1;
22 | obj.title = "购买商品";
23 | obj.btn = "确认并支付"
24 | }
25 | var s = "";
26 | if (e.type == 0) {
27 | s += "经典系列"
28 | } else if (e.type == 1) {
29 | s += "吉致系列"
30 | }
31 | obj.pro = s + obj.price + "元优惠券"
32 | this.setData(obj);
33 | },
34 | checkPhone: function (e) {
35 | var v = e.detail.value;
36 | if (v && v.length == 11) {
37 | this.setData({
38 | phone: v,
39 | phoneOk: true
40 | });
41 | } else {
42 | this.setData({
43 | phone: "",
44 | phoneOk: false
45 | });
46 | }
47 | },
48 | pay: function () {
49 | var _this = this;
50 | if (this.data.phoneOk) {
51 | base.loading.show({title:"验证信息..."});
52 | wx.login({
53 | success: function (res) {
54 | console.log(res);
55 | if (res.code) {
56 | if (_this.data.pay == 1) {
57 | base.get({ c: "ActApiCenter", m: "Apply", brand: _this.data.brand == 0 ? "ksk" : "jzcake", price: _this.data.price, phone: _this.data.phone, code: res.code }, function (res) {
58 | var d = res.data;
59 | if (d.Status == "ok") {
60 | wx.requestPayment({
61 | 'timeStamp': d.Tag.timeStamp,
62 | 'nonceStr': d.Tag.nonceStr,
63 | 'package': d.Tag.package,
64 | 'signType': d.Tag.signType,
65 | 'paySign': d.Tag.sign,
66 | 'success': function (res) {
67 |
68 | //if (res.requestPayment == "ok") {
69 | base.modal({
70 | title: '支付成功!',
71 | content: "优惠券密码已下发到手机号" + _this.data.phone + ",请查收!",
72 | showCancel: false,
73 | confirmText: "确认",
74 | success: function (res) {
75 | if (res.confirm) {
76 | wx.switchTab({
77 | url: "../cake/cake"
78 | })
79 | }
80 | }
81 | })
82 | //}
83 | },
84 | 'fail': function (res) {
85 |
86 | }
87 | })
88 | } else {
89 | base.modal({
90 | title: '提交失败',
91 | content: d.Msg || ""
92 | });
93 | }
94 | },"提交中...");
95 | } else {
96 |
97 | }
98 | } else {
99 | base.modal({
100 | title: '获取信息失败!'
101 | });
102 | }
103 | },
104 | fail: function () {
105 | base.modal({
106 | title: '获取信息失败!'
107 | });
108 | }
109 | });
110 |
111 |
112 |
113 | }
114 | }
115 | });
--------------------------------------------------------------------------------
/pages/buy/buy.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "购买优惠券",
3 | "backgroundColor": "#f3f3f3",
4 | "enablePullDownRefresh":false
5 | }
--------------------------------------------------------------------------------
/pages/buy/buy.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{pro}}
5 |
6 |
7 | +86
8 |
9 |
10 | 优惠券密码将发送到此手机号
11 | {{btn}}
12 |
--------------------------------------------------------------------------------
/pages/buy/buy.wxss:
--------------------------------------------------------------------------------
1 | page{background-color: #f3f3f3;}
2 | .c{padding: 20rpx 30rpx;}
3 | .pro{padding: 0;font-size: 13pt;text-align: center;}
4 | .pro label{color: #000;}
5 | .pro text{color: #ff6a00;}
6 | .fm{width: 700rpx;display: flex; border: 1rpx solid #ddd;background-color: #fff; margin: 20rpx auto 0;border-radius:3px;height:50px;line-height: 50px;}
7 | .fm input{flex: 1;padding: 0 10px; height: 100%; font-size: 15pt;}
8 |
9 | .phone .label{width: 100rpx; border-right: 1rpx solid #eee;text-align: center; color: #999;}
10 | .des{color: #aaa;font-size: 11pt;padding: 10rpx 0;text-align: center;}
11 |
12 | .sub{width: 700rpx;height: 50px;line-height: 50px; text-align: center;border-radius:3px; margin:30rpx auto; }
13 | .sub-ok{background-color:#576b95;color: #fff;}
14 | .sub-dis{background-color: #d0d0d0;color: #999;}
--------------------------------------------------------------------------------
/pages/cake/cake.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | var jzData = require('../../utils/jzData.js')
3 | Page({
4 | data: {
5 | tab: 0,
6 | list: [],
7 | listJz: []
8 | },
9 | onLoad: function () {
10 | var _this = this;
11 | var _dic = base.cake.getCache();
12 | if (_dic) {
13 | this.setlist(_dic);
14 | } else {
15 | this.initData();
16 | }
17 | //极致系列
18 | var list = [],_jzlist = [];
19 | var dic = jzData.data;
20 | for (var i in dic) {
21 | _jzlist.push({
22 | name: i,
23 | price: dic[i].CakeType[0].CurrentPrice + ".00",
24 | des: dic[i].Means,
25 | imgUrl: base.path.res + dic[i].img
26 | })
27 | list.push({
28 | name: i,
29 | price: dic[i].CakeType[0].CurrentPrice + ".00",
30 | des: dic[i].Means,
31 | imgUrl: base.path.res + dic[i].img
32 | })
33 | }
34 | this.setData({
35 | "listJz": _jzlist,
36 | "list": list,
37 | });
38 | },
39 | onShow: function (e) {
40 | if (base.cake.tab != null) {
41 | this.setData({ "tab": base.cake.tab });
42 | base.cake.tab = null;
43 | }
44 | // if (base.version.current != base.version.getValue()) {
45 |
46 | // this.initData();
47 | // }
48 | },
49 | initData: function () {
50 | var _this = this;
51 | // var _dic = base.cake.getCache();
52 | // if (_dic) {
53 | // _this.setlist(_dic);
54 | // } else {
55 | base.get({ c: "Product", m: "GetAllProduct", City: "上海" }, function (d) {
56 | var data = d.data;
57 | if (data.Status == "ok") {
58 | base.cake.setCache(data.Tag);
59 | _this.setlist(data.Tag);
60 | }
61 | })
62 | //}
63 |
64 | },
65 | setlist: function (dic) {
66 | var _list = [];
67 | for (var i in dic) {
68 | _list.push({
69 | name: i,
70 | price: dic[i].CakeType[0].CurrentPrice + ".00",
71 | des: dic[i].Means,
72 | //imgUrl: base.path.res + "images/ksk/mlist/item/" + i + ".jpg"
73 | imgUrl: base.path.res + "/images-2/index-3/jdcake/w_240/" + encodeURI(i) + ".png"
74 | })
75 | }
76 | this.setData({ "list": _list });
77 | },
78 | ing: function (e) {
79 | var price = e.currentTarget.dataset.price;
80 | base.modal({
81 | title: '是否需要购买优惠券?',
82 | showCancel: true,
83 | confirmText: "去购买",
84 | success: function (res) {
85 | if (res.confirm) {
86 | wx.navigateTo({
87 | url: "../buy/buy?type=1&price=" + price
88 | })
89 | }
90 | }
91 | })
92 | },
93 | changeTab: function (e) {
94 | var d = e.currentTarget.dataset.index;
95 | this.setData({ tab: d });
96 | },
97 | goDetail: function (e) {
98 | var d = e.currentTarget.dataset.pname;
99 | var b = e.currentTarget.dataset.brand;
100 | if (d) {
101 | wx.navigateTo({
102 | url: '../cakeDetail/cakeDetail?pname=' + d + "&brand=" + b
103 | })
104 | }
105 | }
106 | });
--------------------------------------------------------------------------------
/pages/cake/cake.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "蛋糕馆",
3 | "backgroundColor": "#f3f3f3",
4 | "enablePullDownRefresh":false
5 | }
--------------------------------------------------------------------------------
/pages/cake/cake.wxml:
--------------------------------------------------------------------------------
1 |
2 | 经典系列
3 | 吉致系列
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{p.name}}
13 | {{p.des}}
14 | ¥
15 | {{p.price}}
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | {{p.name}}
27 | {{p.des}}
28 | ¥
29 | {{p.price}}
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/pages/cake/cake.wxss:
--------------------------------------------------------------------------------
1 | page{padding: 55px 0 0;background-color: #f3f3f3;}
2 | .tab{width: 720rpx; position: fixed;z-index: 100; left: 14rpx; top:10rpx;border:1px solid #576b95;height: 40px; line-height:40px;border-radius: 5px;display: flex;font-size: 13pt;}
3 | .tab-layer{width: 750rpx;height: 50px; background: #fff;opacity: 0.9;left: 0;top: 0; position: fixed;z-index: 99; border-bottom: 1rpx solid #dedede;}
4 | .tab .tab-on{background-color: #576b95;text-align: center; color: #fff;flex: 1;}
5 | .tab .tab-out{text-align: center;flex: 1;}
6 |
7 | .item{display: flex; padding: 10px 0; background-color: #fff;border-bottom: 1px solid #eee;}
8 | .item:active{background-color: #f5f5f5;}
9 | .item .img{width:300rpx; text-align: center;}
10 | .itemjd .img image{width: 250rpx;height: 180rpx; }
11 | .itemjz .img image{width:100%;height:200rpx;}
12 | .item .con{flex: 1; padding: 0 10px 0 0;}
13 | .con .nm{font-size: 14pt; font-weight: bold;}
14 | .con .des{line-height: 22px; font-size: 10pt; padding: 5px 0;color: #999;}
15 | .con .sub{color: #ff6a00;font-size: 10pt;}
16 | .con .sub text{font-size: 15pt;}
17 |
18 | .jzitem image{width: 720rpx; height:540rpx; }
--------------------------------------------------------------------------------
/pages/cakeDetail/cakeDetail.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | var jzData = require('../../utils/jzData.js');
3 | var preview=require('../../utils/preview.js');
4 | Page({
5 | data: {
6 | brand: 0,
7 | loaded: false,
8 | cartNum: 0,
9 | },
10 | onLoad: function (e) {
11 | var brand = e && e.brand ? e.brand : 0;
12 | this.setData({ brand: brand });
13 | var _this = this;
14 | if (brand == 0) {//经典系列
15 | var key = e.pname || "极地牛乳";
16 | var obj = base.cake.getByName(key);
17 | if (obj) {
18 | _this.setData({ loaded: true });
19 | this.initCake(obj);
20 | } else {
21 | base.get({ c: "Product", m: "GetCakeByName", City: "上海", ProName: key }, function (d) {
22 | _this.setData({ loaded: true });
23 | var data = d.data;
24 | if (data.Status == "ok") {
25 | _this.initCake(data.Tag);
26 | }
27 | });
28 | }
29 | } else {//吉致系列
30 | var obj = jzData.data[e.pname];
31 | this.initCake(obj);
32 | _this.setData({ loaded: true });
33 | }
34 | },
35 | initCake: function (d) {
36 | var _this = this;
37 | wx.setNavigationBarTitle({ title: d.Name });
38 | this.setData({
39 | imgMinList: (function () {
40 | var _list = [];
41 | if (_this.data.brand == 0) {
42 | for (var i = 1; i <= 4; i++) {
43 | _list.push(base.path.res + "images-2/classical-detail/" + d.Name + "/w_400/" + d.Name + "-" + i + ".jpg");
44 | }
45 | } else {
46 | _list.push(base.path.res + "images/ksk/item/w_400/" + d.Name + ".jpg");
47 | }
48 | return _list;
49 | })(),
50 | name: d.Name,
51 | num: 1,
52 | des: d.Means,
53 | resource: d.Resourse,
54 | fresh: d.KeepFresh,
55 | current: {
56 | size: d.CakeType[0].Size,
57 | price: d.CakeType[0].CurrentPrice,
58 | supplyno: d.CakeType[0].SupplyNo,
59 | des: d.CakeType[0].PackingList
60 | },
61 | CakeType: d.CakeType
62 | });
63 | },
64 | onShow: function (e) {
65 | this.setData({ cartNum: base.cart.getNum() });
66 | },
67 | previewImg: function (e) {
68 | preview.show(this.data.name,this.data.brand,e.currentTarget.dataset.index)
69 | },
70 | changeCurrent: function (e) {
71 | var s = e.currentTarget.dataset.size;
72 | var p = e.currentTarget.dataset.price;
73 | var sno = e.currentTarget.dataset.supplyno;
74 | if (s && p && this.data.current.size != s) {
75 | this.setData({ "current.size": s, "current.price": p, "current.supplyno": sno })
76 | }
77 | },
78 | addCart: function () {
79 | var _this = this;
80 | if (base.cart.add({
81 | supplyno: this.data.current.supplyno,
82 | name: this.data.name,
83 | size: this.data.current.size,
84 | price: this.data.current.price,
85 | num: this.data.num,
86 | brand:this.data.brand
87 | })) {
88 | this.setData({ cartNum: base.cart.getNum() })
89 | base.modal({
90 | title: '加入成功!',
91 | content: "跳转到购物车或留在当前页",
92 | showCancel: true,
93 | cancelText: "留在此页",
94 | confirmText: "去购物车",
95 | success: function (res) {
96 | if (res.confirm) {
97 | _this.goc();
98 | }
99 | }
100 | })
101 | // base.toast({
102 | // title: '加入成功',
103 | // icon: 'success',
104 | // duration: 1500
105 | // })
106 | }
107 | },
108 | goCart: function () {
109 | if (!base.cart.exist(this.data.current.supplyno)) {
110 | base.cart.add({
111 | supplyno: this.data.current.supplyno,
112 | name: this.data.name,
113 | size: this.data.current.size,
114 | price: this.data.current.price,
115 | num: this.data.num
116 | })
117 | }
118 | this.goc();
119 | },
120 | goc: function () {
121 | var _this = this;
122 | base.cart.ref = "../cakeDetail/cakeDetail?pname=" + _this.data.name + "&brand=" + _this.data.brand;
123 | wx.switchTab({
124 | url: "../cart/cart"
125 | })
126 | },
127 | _go: function () {
128 | var _this = this;
129 | wx.navigateTo({
130 | url: "../buy/buy?type="+_this.data.brand+"&price=" + _this.data.current.price
131 | })
132 | }
133 | });
--------------------------------------------------------------------------------
/pages/cakeDetail/cakeDetail.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/cakeDetail/cakeDetail.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{name}}
11 | {{des}}
12 |
13 | ¥
14 | {{(current.price*num)+".00"}}
15 |
16 |
17 |
18 |
19 | {{s.Size}}
20 |
21 |
22 | 主要原料:
23 | {{resource}}
24 |
25 | 贮存条件:
26 | {{fresh}}
27 |
28 |
29 |
30 | 加入购物车({{cartNum}})
31 | 购买等额优惠券
32 |
33 |
--------------------------------------------------------------------------------
/pages/cakeDetail/cakeDetail.wxss:
--------------------------------------------------------------------------------
1 | .c{padding: 0 0 80px;}
2 | .hd{height:500rpx;background-color: #f3f3f3; }
3 | .hd image{width:750rpx;height:500rpx; }
4 | .tit{font-size: 17pt; font-weight: bold;padding:20rpx 30rpx; margin: 10rpx 0 0; background-color: #fff;}
5 | .des{font-size: 10pt;line-height: 22px;padding:0 35rpx 20rpx;color: #999;}
6 |
7 | .pp{padding:20rpx;color: #ff6a00;border-top: 1rpx solid #eee; display: flex}
8 | .price{flex: 1;}
9 | .price text{font-size: 23pt; font-weight: bold;}
10 |
11 | .size{display: flex;padding:20rpx 15rpx 30rpx;border-bottom: 1rpx solid #eee; }
12 | .size .sitem{flex: 1;text-align: center;padding: 0 15rpx;max-width:400rpx;}
13 | .size .sitem text{height:40px;line-height:40px; display:block;border-radius: 2px}
14 | .size .sitem-on text{border: 2rpx solid #576b95; color: #576b95;font-weight: bold;position: relative;}
15 | .size .sitem-on text:after{content: " "; display:block;position: absolute; width: 0;height: 0;border-top:10px solid #576b95;border-left:10px solid transparent;border-right:10px solid transparent; right:-7px;bottom:-2px;transform:rotateZ(-45deg);}
16 | .size .sitem-out text{border: 1rpx solid #ddd;}
17 | .sm{padding:20px 35rpx 0;font-size: 10pt;line-height: 22px;}
18 | .sm text{color: #999;}
19 |
20 |
21 | .tool{position: fixed;left: 0;bottom: 0; padding: 20rpx 0; display: flex; width: 750rpx;border-top: 1rpx solid #ddd;box-shadow: 0 -1px 5px 0 #eee;background-color: #fff; }
22 | .tool .tbtn{height: 40px;line-height: 40px; text-align: center;border-radius: 3px;}
23 | .tool .add{background-color: #f0f0f0;border: 1rpx solid #ddd;flex:1;margin: 0 10rpx 0 20rpx; position: relative;}
24 | .tool .buy{background-color: #576b95;border: 1rpx solid #576b95; color: #fff;flex:1;margin: 0 20rpx 0 10rpx;}
25 | /*.cart-num{position: absolute; left: 5px;top: -20px; width: 40px; height:40px; line-height: 40px; text-align: center; border: 2px solid #fff;border-radius: 50%; background-color: #f00;color: #fff; box-shadow: 0 0 5px 0 #ccc;}*/
26 | .cart-num{color:#f00;}
27 |
--------------------------------------------------------------------------------
/pages/cart/cart.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | var preview=require('../../utils/preview.js');
3 | Page({
4 | data: {
5 | plist: [],
6 | total: 0,
7 | his: ""
8 | },
9 | onLoad: function (e) {
10 |
11 | },
12 | onShow: function (e) {
13 | if (base.cart.ref) {
14 | this.setData({ his: base.cart.ref });
15 | base.cart.ref = "";
16 | }
17 | var l = base.cart.getList();
18 | for (var i = 0; i < l.length; i++) {
19 | l[i].img = base.path.res + 'images/ksk/item/w_127/' + l[i].name + '.jpg';
20 | l[i].index = i;
21 | }
22 | this.setData({ plist: l });
23 | this.changeTotal();
24 | },
25 | goBack: function () {
26 | var _this = this;
27 | wx.navigateTo({
28 | url: _this.data.his
29 | })
30 | },
31 | previewImg: function (e) {
32 | preview.show(e.currentTarget.dataset.name,e.currentTarget.dataset.brand,e.currentTarget.dataset.index)
33 | },
34 | changeTotal: function () {
35 | var l = this.data.plist;
36 | var t = 0;
37 | for (var i = 0; i < l.length; i++) {
38 | if (!l[i].del) {//排除删除选项
39 | t += l[i].price * l[i].num;
40 | }
41 | }
42 | this.setData({ total: t });
43 | },
44 | changeNum: function (e) {
45 | var t = e.currentTarget.dataset.type;
46 | var index = e.currentTarget.dataset.index;
47 | var re = this.data.plist[index].num + parseInt(t);
48 | if (re < 100 && re > 0) {
49 | var key = "plist[" + index + "].num";
50 | var obj = {}; obj[key] = re;
51 | this.setData(obj);
52 | this.changeTotal();
53 | base.cart.num(this.data.plist[index].supplyno, obj[key]);
54 | }
55 | },
56 | del: function (e) {
57 | var index = e.currentTarget.dataset.index;
58 | var sno = this.data.plist[index].supplyno;
59 | //var l = this.data.plist;
60 | // var _l = [];
61 | //var obj = { total: 0 };
62 | // for (var i = 0; i < l.length; i++) {
63 | // if (i != index) {
64 | // // _l.push(l[i]);
65 | // obj.total += l[i].price * l[i].num;
66 | // }
67 | // }
68 |
69 | var key1 = "plist[" + index + "].del";
70 | var obj = {};
71 | obj[key1] = true;
72 |
73 |
74 |
75 | // var ani = wx.createAnimation({
76 | // duration: 300,
77 | // timingFunction:"ease"
78 | // })
79 | // ani.height(0).step();
80 | // var key = "plist[" + index + "]._ani";
81 | // obj[key] = ani.export();
82 |
83 | this.setData(obj);
84 |
85 |
86 |
87 | this.changeTotal();
88 | base.cart.remove(sno);
89 | },
90 |
91 | clearCart: function () {
92 | var _this = this;
93 | if (this.data.total > 0) {
94 | base.modal({
95 | title: "确认清空所有商品?", confirmText: "清空", success: function (res) {
96 | if (res.confirm) {
97 | _this.setData({ plist: [], total: 0 });
98 | base.cart.clear();
99 | }
100 | }
101 | })
102 | }
103 | },
104 | goOrder: function () {
105 | // this.ing();
106 | if (this.data.plist.length > 0 && this.data.total > 0) {
107 | wx.navigateTo({
108 | url: '../order/order?from=cart'
109 | })
110 | } else {
111 | base.modal({
112 | title: '购物车无商品',
113 | showCancel: false
114 | })
115 | }
116 | },
117 | tips: ["尽请期待!", "不用点了、暂时下不了单!", "真de、不骗你!", "不信再试试?!", "没错吧?!", "您可以去其它地方转转了!", "嘿、还挺执着!", "就喜欢你这股子劲!", "但没有任何niao用!", "你已经陷入无限轮回..."],
118 | //,"......", ".........", "好吧、你赢了!", "你即将获得一份随机奖励!", "just for your 执着!", "不过先声明、我们真的还未开放下单!"],
119 | tipsN: 0,
120 | ing: function () {
121 | if (this.tipsN >= this.tips.length) {
122 | this.tipsN = 0;
123 | }
124 |
125 | base.modal({
126 | title: this.tips[this.tipsN],
127 | showCancel: false
128 | });
129 | this.tipsN += 1;
130 |
131 |
132 |
133 | // if (this.tipsN < this.tips.length) {
134 | // base.modal({
135 | // title: this.tips[this.tipsN],
136 | // showCancel: false
137 | // });
138 | // this.tipsN += 1;
139 | // }
140 | // else {
141 | // base.modal({
142 | // title: "恭喜",
143 | // content: "您已免费获得价值88元经典系列蛋糕优惠券,限领一次",
144 | // cancelText: "放弃机会",
145 | // confirmText: "立即领取",
146 | // showCancel: true,
147 | // success: function (res) {
148 | // if (res.confirm) {
149 | // wx.navigateTo({
150 | // url: "../buy/buy?type=0&price=88&&pay=free"
151 | // })
152 | // } else {
153 |
154 | // }
155 | // }
156 | // })
157 | // }
158 |
159 | },
160 | p: {
161 | currentIndex: -1,
162 | eventOk: true,
163 | eventStartOk: true,
164 | aniOk: true,
165 | len: 0,//当前位置
166 | ani: wx.createAnimation(),
167 | // _ani: wx.createAnimation({
168 | // duration: 200,
169 | // timingFunction: 'ease-out'//
170 | // }),
171 | max: 80,
172 | size: 40
173 | },
174 | moveTo: function (index, x) {
175 | this.p.eventOk = false;//停止事件
176 | if (x == 0) {
177 | this.p.currentIndex = -1;
178 | if (this.p.len > 0 - this.p.max / 2) {
179 | if (this.p.len > 0) {
180 | this.p.ani.translateX(this.p.size).step({
181 | duration: 100,
182 | timingFunction: 'ease-out'
183 | });
184 |
185 | }
186 | this.p.ani.translateX(0 - this.p.size).step({
187 | duration: 200,
188 | timingFunction: 'ease'
189 | });
190 | }
191 | }
192 | if (x == 0 - this.p.max) {
193 | this.p.currentIndex = index;
194 | this.p.ani.translateX(x - this.p.size).step({
195 | duration: 200,
196 | timingFunction: 'ease'
197 | });
198 | }
199 | this.p.ani.translateX(x).step({
200 | duration: 200,
201 | timingFunction: 'ease-out'
202 | });
203 | var obj = {};
204 | var key = "plist[" + index + "].ani";
205 | obj[key] = this.p.ani.export();
206 | this.setData(obj);
207 | },
208 | ptouchsatrt: function (e) {
209 |
210 | var index = e.currentTarget.dataset.index;
211 | if (this.p.currentIndex >= 0) {
212 | this.moveTo(this.p.currentIndex, 0);
213 | return;
214 | }
215 | if (this.p.eventStartOk) {
216 | this.p.eventOk = true;
217 | this.p.len = 0;
218 | var pt = e.changedTouches[0];
219 | pt.aaaaaaa = 11111;
220 | this.p.x = pt.pageX;
221 | this.p.y = pt.pageY;
222 | console.log("start")
223 | }
224 | },
225 | ptouchend: function (e) {
226 | if (this.p.eventOk) {
227 | var pt = e.changedTouches[0];
228 | var len = pt.pageX - this.p.x;//预计目标位置
229 | var ht = pt.pageY - this.p.y;
230 | if (len != 0 && Math.abs(ht) / Math.abs(len) < 0.3) {//滑动倾斜度限制
231 | this.p.len = len;
232 | var index = e.currentTarget.dataset.index;
233 | if (len > 0 - this.p.max / 2) {
234 | this.moveTo(index, 0);
235 | } else {
236 | this.moveTo(index, 0 - this.p.max);
237 | }
238 | }
239 | }
240 | this.p.eventOk = false;
241 | this.p.eventStartOk = false;
242 | var _this = this;
243 | if (this.p.tm) {
244 | clearTimeout(this.p.tm);
245 | }
246 | this.p.tm = setTimeout(function () {
247 | _this.p.eventStartOk = true;
248 | }, 300);
249 | }
250 | });
--------------------------------------------------------------------------------
/pages/cart/cart.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "购物车(体验版)",
3 | "backgroundColor": "#f3f3f3",
4 | "enablePullDownRefresh":false
5 | }
--------------------------------------------------------------------------------
/pages/cart/cart.wxml:
--------------------------------------------------------------------------------
1 |
2 | 返回
3 | 详情(滑动可移除)
4 | 清空
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | {{p.name}}
13 | {{p.size}}
14 |
15 | ¥{{p.price*p.num}}
16 |
17 | -
18 | {{p.num}}
19 | +
20 |
21 |
22 |
23 | 删除
24 |
25 |
26 | 暂无商品
27 |
28 | 总金额:
29 | ¥{{total}}
30 |
31 | 确认下单
32 |
33 |
--------------------------------------------------------------------------------
/pages/cart/cart.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | padding: 0 0 55px;
3 | background-color: #f3f3f3;
4 | }
5 |
6 | .tit {
7 | border-bottom: 1rpx solid #ddd;
8 | padding: 20rpx 25rpx;
9 | display: flex;
10 | align-items: center;
11 | background-color: #f0f0f0;
12 | }
13 |
14 | .tit-back {
15 | flex: 1;
16 | text-align: left;
17 | color: #576b95;
18 | }
19 |
20 | .tit-text {
21 | font-size: 11pt;
22 | color: #999;
23 | flex: 2;
24 | }
25 |
26 | .tit-tool {
27 | flex: 1;
28 | text-align: right;
29 | color: #576b95;
30 | }
31 |
32 | .pro {
33 | border-bottom: 1rpx solid #eee;
34 | position: relative;
35 | overflow-x: hidden;
36 | }
37 |
38 | .del {
39 | position: absolute;
40 | right: 0;
41 | top: 0;
42 | width: 80px;
43 | height:99.5%;
44 | text-align: center;
45 | background-color: #f00;
46 | color: #fff;
47 | z-index: 1;
48 | font-size: 15pt;
49 | display: flex;
50 | justify-content: center;
51 | align-items: center;
52 | }
53 |
54 | .del text {
55 | flex: 1;
56 | }
57 |
58 | .pro-con {
59 | height: 140rpx;
60 | position: relative;
61 | z-index: 2;
62 | background-color: #fff;
63 | display: flex;
64 | justify-content: center;
65 | align-items: center;
66 | }
67 |
68 | .pro-con .pimg {
69 | width: 150rpx;
70 | text-align: center;
71 | }
72 |
73 | .pro-con .pimg image {
74 | width: 110rpx;
75 | height: 100rpx;
76 | border-radius: 5px;
77 | }
78 |
79 | .pro-con .pname {
80 | flex: 1;
81 | }
82 |
83 | .pname .name {
84 | font-size: 11pt;
85 | }
86 |
87 | .pname .des {
88 | font-size: 11pt;
89 | color: #999;
90 | }
91 |
92 | .pro-con .ptprice {
93 | width: 150rpx;
94 | text-align: right;
95 | padding: 0 30rpx 0 0;
96 | color: #ff6a00;
97 | font-size: 13pt;
98 | }
99 |
100 | .pro-con .pnum {
101 | width: 110px;
102 | display: flex;
103 | align-items: center;
104 | }
105 |
106 | .num {
107 | width: 30px;
108 | height: 30px;
109 | border-radius: 50%;
110 | text-align: center;
111 | font-size: 20px;
112 | font-weight: bold;
113 | display: flex;
114 | align-items: center;
115 | align-content: center;
116 | }
117 | .num text{flex: 1;}
118 | .num-a {
119 | border: 1rpx solid #999;
120 | color: #ff6a00;
121 | background-color: #f6f6f6;
122 | }
123 |
124 | .num-b {
125 | border: 1rpx solid #ff6a00;
126 | background-color: #ff6a00;
127 | color: #fff;
128 | }
129 |
130 | .num-text {
131 | width: 30px;
132 | line-height: 30px;
133 | text-align: center;
134 | }
135 |
136 | .null {
137 | text-align: center;
138 | padding: 20px 0;
139 | color: #ccc;
140 | background-color: #fff;
141 | }
142 |
143 | .tool {
144 | position: fixed;
145 | left: 0;
146 | bottom: 6px;
147 | z-index: 3;
148 | display: flex;
149 | width: 750rpx;
150 | align-items: center;
151 | }
152 |
153 | .tool .total {
154 | flex: 2;
155 | text-align: left;
156 | padding: 0 20rpx;
157 | font-size: 11pt;
158 | color: #999;
159 | }
160 |
161 | .tool .total text {
162 | color: #ff6a00;
163 | font-size: 15pt;
164 | }
165 |
166 | .tool .gobuy {
167 | flex: 1;
168 | height: 40px;
169 | line-height: 40px;
170 | text-align: center;
171 | border-radius: 3px;
172 | background-color: #576b95;
173 | border: 1rpx solid #576b95;
174 | color: #fff;
175 | margin: 0 20rpx 0 10rpx;
176 | }
177 |
178 | .tool-layer {
179 | position: fixed;
180 | left: 0;
181 | bottom: 0;
182 | z-index: 2;
183 | width: 100%;
184 | height: 53px;
185 | background-color: #fff;
186 | opacity: 0.9;
187 | box-shadow: 0 -1px 5px 0 #eee;
188 | }
189 |
--------------------------------------------------------------------------------
/pages/index/index.js:
--------------------------------------------------------------------------------
1 | //index.js
2 | //获取应用实例
3 | var base = getApp();
4 | Page({
5 | data: {
6 | path:base.path.res+"smallexe/index/",
7 | motto: '你好、BigCake!',
8 | userInfo: {},
9 | array: ['上海', '北京', '杭州', '宁波'],
10 | index: 0
11 | },
12 | goCake: function (e) {
13 | var brand = e.currentTarget.dataset.brand;
14 | if(brand&&brand==1){
15 | base.cake.tab=1;
16 | }
17 | wx.switchTab({ url: '../cake/cake' });
18 | },
19 | goDetail: function (e) {
20 | var nm = e.currentTarget.dataset.pname;
21 | var b = e.currentTarget.dataset.brand;
22 | wx.navigateTo({
23 | url: '../cakeDetail/cakeDetail?pname=' + nm+"&brand="+(b||0)
24 | })
25 | },
26 | bindPickerChange: function (e) {
27 | this.setData({
28 | index: e.detail.value
29 | })
30 | },
31 | //事件处理函数
32 | bindViewTap: function () {
33 | wx.showActionSheet({
34 | itemList: ['A', 'B', 'C'],
35 | success: function (res) {
36 | if (!res.cancel) {
37 | console.log(res.tapIndex)
38 | }
39 | }
40 | })
41 |
42 | //wx.navigateTo({
43 | //url: '../socket/socket'
44 | //})
45 | },
46 | onLoad: function () {
47 | var that = this
48 | //调用应用实例的方法获取全局数据
49 | //app.getUserInfo(function (userInfo) {
50 | //更新数据
51 | //that.setData({
52 | //userInfo: userInfo
53 | //})
54 | //})
55 |
56 | },
57 | onPullDownRefresh: function () {
58 | wx.stopPullDownRefresh()
59 | },
60 | onShareAppMessage: function () {
61 | return {
62 | title: 'BigCake(体验版)',
63 | desc: '',
64 | path: '/pages/index/index?id=123'
65 | }
66 | }
67 | })
68 |
--------------------------------------------------------------------------------
/pages/index/index.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "BigCake",
3 | "backgroundColor": "#fff"
4 | }
--------------------------------------------------------------------------------
/pages/index/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{array[index]}}
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/pages/index/index.wxss:
--------------------------------------------------------------------------------
1 | /**index.wxss**/
2 | page{background-color: #fff;}
3 | .cityselect{position: fixed;width: 150rpx;height: 30px;line-height: 30px; font-size: 12pt; z-index: 1000;background-color: #000;text-align: center;box-shadow: 0 0 5px 0 #fff;border:1rpx solid #fff; border-radius: 15px;opacity: 0.5;left:20rpx;top: 20rpx;color: #fff;}
4 |
5 | .m{background-color: #fff;margin: 0 0 20rpx;}
6 | .m .mg{height: 750rpx;width: 750rpx;}
7 | .m .mg-1{height:540rpx;width:100%;}
8 | .m .mg-2{margin: 15rpx 20rpx 45rpx; height: 140rpx;}
9 | .m .mg-3{height:500rpx;width:100%;}
10 |
11 |
12 |
--------------------------------------------------------------------------------
/pages/login/login.js:
--------------------------------------------------------------------------------
1 | // pages/login/login.js
2 |
3 | var base = getApp();
4 | Page({
5 | data: {
6 | phone: "",
7 | pwd: ""
8 | },
9 | onLoad: function (options) {
10 | // 页面初始化 options为页面跳转所带来的参数
11 | },
12 | changephone: function (e) {
13 | this.setData({
14 | phone: e.detail.value
15 | });
16 | },
17 | changepwd: function (e) {
18 | this.setData({
19 | pwd: e.detail.value
20 | });
21 | },
22 | submit: function () {
23 | var _this = this;
24 | base.get({ c: "User", m: "Login", phone: _this.data.phone, pwd: _this.data.pwd, }, function (d) {
25 | var dt = d.data;
26 | if (dt.Status == "ok") {
27 | base.user.userid = dt.Tag.Uid;
28 | base.user.sessionid = dt.Tag.SessionId;
29 | base.user.jzb = dt.Tag.Money;
30 | base.user.exp = dt.Tag.Exp;
31 | base.user.phone = dt.Tag.Phone;
32 | base.user.levels = dt.Tag.Levels;
33 | base.user.headimg = dt.Tag.HeadImgPath;
34 | wx.switchTab({
35 | url: '../user/user'
36 | })
37 | }
38 | else {
39 | wx.showModal({
40 | showCancel: false,
41 | title: '',
42 | content: dt.Msg
43 | });
44 |
45 | }
46 | })
47 |
48 | }
49 | })
--------------------------------------------------------------------------------
/pages/login/login.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/login/login.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | 登 录
11 |
--------------------------------------------------------------------------------
/pages/login/login.wxss:
--------------------------------------------------------------------------------
1 | .body {
2 | margin: 20px 0;
3 | background-color: #fff;
4 | box-shadow: 5px 0 #f7f7f7;
5 | font-size: 15px;
6 | font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;
7 | }
8 | .ipt{background: #eee; margin: 10px;width:95%;}
9 | .ipt input{height:40px;}
10 | .btn {
11 | display: block;
12 | height: 1.777em;
13 | line-height: 1.777em;
14 | margin: 10px auto;
15 | width: 80%;
16 | text-align: center;
17 | background: #ff6000;
18 | color: #fff;
19 | border-radius: 8px;
20 | border: none;
21 | font-size: 1.333em;
22 | }
--------------------------------------------------------------------------------
/pages/logs/logs.js:
--------------------------------------------------------------------------------
1 | //logs.js
2 | var util = require('../../utils/util.js')
3 | Page({
4 | data: {
5 | logs: []
6 | },
7 | onLoad: function () {
8 | this.setData({
9 | logs: (wx.getStorageSync('logs') || []).map(function (log) {
10 | return util.formatTime(new Date(log))
11 | })
12 | })
13 | }
14 | })
15 |
--------------------------------------------------------------------------------
/pages/logs/logs.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "查看启动日志"
3 | }
--------------------------------------------------------------------------------
/pages/logs/logs.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | {{index + 1}}. {{log}}
5 |
6 |
7 |
--------------------------------------------------------------------------------
/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/order/order.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | var common = require('../../utils/common.js');
3 | Page({
4 | data: {
5 | arrTime: ['选择配送时间', '10:00-11:00', '11:00-12:00', '12:00-13:00', '13:00-14:00', '14:00-15:00', '15:00-16:00', '16:00-17:00', '17:00-18:00'],
6 | objectArrTime: [
7 | {id: 0, name: '选择配送时间'},
8 | {id: 1, name: '10:00-11:00'},
9 | {id: 2, name: '11:00-12:00'},
10 | {id: 3, name: '12:00-13:00'},
11 | {id: 4, name: '13:00-14:00'},
12 | {id: 5, name: '14:00-15:00'},
13 | {id: 6, name: '15:00-16:00'},
14 | {id: 7, name: '16:00-17:00'},
15 | {id: 8, name: '17:00-18:00'}],
16 | arrTimeIndex: 0,
17 | addr: "",
18 | addresslist: [{
19 | name: '刘先生',
20 | phone: '13623834531',
21 | city: '上海',
22 | area: '上海市',
23 | address: '浦东张江高科',
24 | id: 0
25 | }, {
26 | name: '张先生',
27 | phone: '13623834531',
28 | city: '上海',
29 | area: '上海市',
30 | address: '浦东张江高科',
31 | id: 1
32 | }, {
33 | name: '刘先生',
34 | phone: '13623834531',
35 | city: '上海',
36 | area: '上海市',
37 | address: '浦东张江高科',
38 | id: 2
39 | }, {
40 | name: '刘先生',
41 | phone: '13623834531',
42 | city: '上海',
43 | area: '上海市',
44 | address: '浦东张江高科',
45 | id: 3
46 | }],
47 | addrShow: false,
48 | scrollTop: 100,
49 | selectedID: -1,
50 | oinfo: {
51 | OrderSource: "all|web",
52 | Consignee: "",
53 | Cellphone: "",
54 | City: "",
55 | District: "",
56 | Address: "",
57 | DeliveryDate: "",
58 | DeliveryTime: "",
59 | Payment: "",
60 | Remarks: "",
61 | TotalPrice: 0
62 | },
63 | dateStart: "2017-01-01",
64 | dateEnd: "2017-01-01",
65 | },
66 | bindTimeChange: function (e) {
67 | var _this = this;
68 | if (e.detail.value > 0) {
69 | _this.setData({
70 | arrTimeIndex: e.detail.value,
71 | "oinfo.DeliveryTime": _this.data.arrTime[e.detail.value]
72 | });
73 | }
74 | },
75 | bindDateChange: function (e) {
76 | this.setData({
77 | "oinfo.DeliveryDate": e.detail.value
78 | })
79 | },
80 | myaddrChange: function () {//触摸选择地址
81 | this.setData({addrShow: true});
82 | },
83 | myaddrCancel: function () {//点击地址簿中取消按钮
84 | this.setData({addrShow: false});
85 | },
86 | closeaddr: function () {//触摸遮罩层关闭地址选项
87 | this.setData({addrShow: false});
88 | },
89 | toSelect: function (e) {//选中地址
90 | var _this = this;
91 | var id = e.currentTarget.dataset.aid;
92 | _this.setData({selectedID: id});
93 | for (var i = 0; i < _this.data.addresslist.length; i++) {
94 | if (_this.data.addresslist[i].id == id) {
95 | _this.setData({
96 | "oinfo.City": _this.data.addresslist[i].city,
97 | "oinfo.District": _this.data.addresslist[i].area,
98 | "oinfo.Consignee": _this.data.addresslist[i].name,
99 | "oinfo.Cellphone": _this.data.addresslist[i].phone,
100 | "oinfo.Address": _this.data.addresslist[i].address,
101 | addr: _this.data.addresslist[i].city + ' ' + _this.data.addresslist[i].area + ' ' + _this.data.addresslist[i].address,
102 | addrShow: false
103 | });
104 | break;
105 | }
106 | }
107 | },
108 | onLoad: function (e) {
109 | var _this = this;
110 | var now = new Date();
111 | if (base.user.islogin()) {
112 | if (e.from && e.from == "cart") {
113 | var l = base.cart.getList();
114 | for (var i = 0; i < l.length; i++) {
115 | l[i].img = base.path.res + 'images/ksk/item/w_127/' + l[i].name + '.jpg'
116 |
117 | }
118 | _this.setData({
119 | plist: l,
120 | dateStart: common.addDate(now, 1),
121 | dateEnd: common.addDate(now, 90)
122 | });
123 | }
124 | }
125 | this.getAddressList();
126 | console.log(this.data.plist);
127 | },
128 | getAddressList: function () {
129 | var _this = this;
130 |
131 | base.get({c: "UserCenter", m: "GetAllAddress"}, function (d) {
132 | var dt = d.data;
133 | if (dt.Status == "ok") {
134 | var arr = [];
135 | for (var i = 0; i < dt.Tag.length; i++) {
136 | var obj = dt.Tag[i];
137 | if (i == 0) {
138 | obj.isDefault = true;
139 | }
140 | arr.push(obj);
141 |
142 | }
143 | _this.setData({
144 | addresslist: arr
145 | })
146 |
147 | }
148 | })
149 | },
150 | onShow: function (e) {
151 |
152 | },
153 |
154 | getTotalPrice: function () {//应付金额
155 | var _this = this;
156 | var pl = _this.data.plist;//name: p.name, price: p.price, size: p.size, num: p.num, brand: p.brand,supplyno
157 | var alltotal = 0;
158 | for (var i = 0; i < pl.length; i++) {
159 | if (!isNaN(pl[i].price)) {
160 | alltotal += parseFloat(pl[i].price);
161 | }
162 | }
163 | this.setData({
164 | "oinfo.TotalPrice": alltotal
165 | });
166 | },
167 | getProductList: function () {
168 | var _this = this;
169 | var arr_pro = [];
170 | var pl = _this.data.plist;//name: p.name, price: p.price, size: p.size, num: p.num, brand: p.brand,supplyno
171 | for (var i = 0; i < pl.length; i++) {
172 | arr_pro.push({
173 | ProductName: pl[i].name,
174 | Price: pl[i].price,
175 | Size: pl[i].size,
176 | Num: pl[i].num,
177 | CakeNo: 0,
178 | OType: 0,
179 | IType: 0,
180 | SupplyNo: pl[i].supplyno,
181 | //生日内容
182 | IsCutting: 0,
183 | CutNum: 0,
184 | BrandCandleType: 0,
185 | Remarks: '',
186 | Premark: null,//生产备注
187 | });
188 | }
189 | return arr_pro;
190 | },
191 | valid: function () {
192 | var _this = this;
193 | var err = "";
194 | if (!_this.data.oinfo.Consignee) {
195 | err = "请选择收货人信息!";
196 | wx.showModal({
197 | showCancel: false,
198 | title: '',
199 | content: err
200 | })
201 | return false;
202 | }
203 | if (!_this.data.oinfo.DeliveryDate) {
204 | err = "请选择配送日期!";
205 | wx.showModal({
206 | showCancel: false,
207 | title: '',
208 | content: err
209 | })
210 | return false;
211 | }
212 | if (!_this.data.oinfo.DeliveryTime) {
213 | err = "请选择配送时间段!";
214 | wx.showModal({
215 | showCancel: false,
216 | title: '',
217 | content: err
218 | })
219 | return false;
220 | }
221 | return true;
222 | },
223 | submit: function () {
224 | var _this = this;
225 | if (_this.valid()) {
226 | _this.getTotalPrice();
227 | var obj = {};
228 | obj.UserName = base.user.phone;
229 | obj.UserPhone = base.user.phone;
230 | obj.OrderSource = _this.data.oinfo.OrderSource;
231 | obj.Consignee = _this.data.oinfo.Consignee;
232 | obj.Cellphone = _this.data.oinfo.Cellphone;
233 | obj.City = _this.data.oinfo.City;
234 | obj.District = _this.data.oinfo.District;
235 | obj.Address = _this.data.oinfo.Address;
236 | obj.DeliveryDate = _this.data.oinfo.DeliveryDate;
237 | obj.DeliveryTime = _this.data.oinfo.DeliveryTime;
238 | obj.Payment = _this.data.oinfo.Payment;
239 | obj.Uid = base.user.userid;
240 | obj.Remarks = _this.data.oinfo.Remarks;
241 | obj.TotalPrice = _this.data.oinfo.TotalPrice;
242 | obj.TotalPrice = obj.TotalPrice < 0 ? 0 : obj.TotalPrice;
243 | var oplArr = _this.getProductList();
244 | var oal = [];
245 | base.post({
246 | c: "OrderCenter",
247 | m: "AddOrder",
248 | p: JSON.stringify(obj),
249 | proInfo: JSON.stringify(oplArr),
250 | oalInfo: JSON.stringify(oal)
251 | }, function (d) {
252 | console.log(d)
253 | var dt = d.data;
254 | if (dt.Status == "ok") {
255 | base.cart.clear();
256 | wx.redirectTo({
257 | url: "../payment/payment?oid=" + dt.Tag
258 | })
259 | }
260 |
261 | })
262 |
263 | }
264 | }
265 | })
--------------------------------------------------------------------------------
/pages/order/order.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/order/order.wxml:
--------------------------------------------------------------------------------
1 |
2 | 收货人信息
3 |
4 | {{oinfo.Consignee}} {{oinfo.Cellphone}}
5 | {{addr?addr:'选择收货人信息'}}
6 |
7 |
8 |
9 | 配送日期/时间
10 |
11 |
13 | {{oinfo.DeliveryDate?oinfo.DeliveryDate:'选择配送日期'}}
14 |
15 |
17 | {{arrTime[arrTimeIndex]}}
18 |
19 |
20 |
21 |
22 | 商品详情
23 |
24 |
25 | {{p.name}}
26 | {{p.price}} x {{p.num}}
27 | {{p.price*p.num}}
28 |
29 |
30 |
31 | 配件
32 |
33 |
34 | 优惠方式
35 |
36 |
37 | 代金卡
38 |
39 |
40 |
41 | 优惠券
42 |
43 |
44 |
45 |
46 |
47 | 备注
48 |
50 |
51 |
52 | 提交订单
53 |
54 |
55 |
56 |
57 |
58 | 取消
59 | 我的地址
60 |
61 |
62 |
63 |
64 | 修改
66 |
67 |
68 |
69 | {{a.name}} {{a.phone}}
70 | {{a.city}} {{a.area}} {{a.address}}
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | 新增收货地址
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/pages/order/order.wxss:
--------------------------------------------------------------------------------
1 | .body{z-index: 0;}
2 | page{background-color: #f0f0f0;width: 100%;}
3 | .tab{border-bottom: 1rpx solid #ddd;background-color: #fff;margin-bottom: 20rpx;}
4 | .tab .tit{border-bottom: 1rpx solid #eee;padding: 10rpx 25rpx;font-size:11pt; color: #999;}
5 | .tab .con{padding:20rpx 25rpx;font-size: 13pt;}
6 |
7 | .dt{display:flex;}
8 | .dt-item{flex: 1;padding:20rpx 60rpx;font-size:32rpx;color:#666;}
9 |
10 | .pos{position: relative;}
11 | .pos:after{content: " "; display:block;position: absolute; width: 0;height: 0;border-top:15rpx solid #576b95;border-left:10rpx solid transparent;border-right:10rpx solid transparent; left: 25rpx;top: 35rpx;}
12 |
13 | .arrow{position: relative;}
14 | .arrow:after{content: ""; display:block;position: absolute;width: 20rpx;height: 20rpx;border-top:5rpx solid #ddd;border-right:5rpx solid #ddd;transform:rotateZ(45deg); top: 27rpx; right:30rpx;}
15 |
16 | .item{display:flex;padding:20rpx 20rpx;}
17 | .item .label{width: 200rpx;font-size: 12pt;}
18 | .item .content{flex: 1;}
19 |
20 |
21 | .pro{display:flex;justify-content: center;align-items: center; height: 160rpx; padding: 0 25rpx; border-bottom: 1rpx dotted #eee}
22 | .pro .pimg{width: 150rpx;height: 120rpx;}
23 | .pro .pname{flex: 1;padding:0 20rpx;}
24 | .pro .pprice{flex: 1;color: #666;}
25 | .pro .ptprice{width:100rpx;}
26 |
27 | .tool{position: fixed;left: 0;bottom: 0; padding: 20rpx 0; display: flex; width: 750rpx;border-top: 1rpx solid #ddd;box-shadow: 0 -1px 5px 0 #eee;background-color: #fff; }
28 | .tool .sub{background-color: #576b95;border: 1rpx solid #576b95; color: #fff;flex:1;margin: 0 20rpx;height: 40px;line-height: 40px; text-align: center;border-radius: 3px;}
29 |
30 | /*我的地址css*/
31 | .addr_box{height:350px;width:100%;background:#fff;position:fixed;bottom:0; z-index:20; }
32 | .addr_box_add{position:absolute;bottom:0;border-top:1px solid #eee;width:100%;padding-left:35%;padding-top:10px;background:#fff;font-size: 18px;height: 40px;}
33 | .addr_head{display:flex;border-bottom:1px solid #eee;height:40px;background:#fff;line-height:40px;}
34 | .addr_head_cancel{font-size: 14px;margin:0 10px;color: #108ee9}
35 | .addr_head_title{font-size: 18px;margin:0 30%;}
36 | .addr_body{display: flex;border-bottom:1px dashed #000;margin:10px;opacity: 0.9}
37 | .addr_body_edit{width:9%;padding:10px;font-size:14px;}
38 | .addr_body_my{width:75%;font-size:14px;color:#666;}
39 | .addr_body_my_det{font-size:14px; font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;color:#000;}
40 | .addr_body_sel{padding-top:15px;}
41 | .addr_lbl_add{margin:5px;color:green;font-size:18px;font-weight: bold;}
42 | .hiddenbox{height:100%;width:100%;position: fixed;background:#666;opacity: 0.5;z-index: 10;top:0;}
43 |
44 | .addr_sel_m{font-size:16px;color:#666;width:80%;}
45 | .addr_sel_a{font-size:16px;color:#666;width:80%;}
46 | .textareastyle{width:100%;height:60px;padding:4px 10px 0 10px;font-size: 26rpx;color: #666;z-index: 1;}
--------------------------------------------------------------------------------
/pages/payment/payment.js:
--------------------------------------------------------------------------------
1 | // pages/payment/payment.js
2 | var base = getApp();
3 | Page({
4 | data: {
5 | loaded: false,
6 | oid: "1703101349147978",
7 | myorder: {},
8 | prolist: [],
9 | oalist: [],
10 | goodprice: 0,
11 | paymentList: [
12 | { "id": "0", "name": "微信支付" },
13 | { "id": "1", "name": "货到付款" },
14 | { "id": "2", "name": "吉致币" }
15 | ],
16 | selid: "0",
17 | jzb: 0
18 | },
19 | onLoad: function (options) {
20 | // 页面初始化 options为页面跳转所带来的参数
21 | var _this = this;
22 | _this.setData({
23 | "oid": options.oid,
24 | jzb: base.user.jzb
25 | });
26 |
27 | wx.setNavigationBarTitle({
28 | title: '支付方式'
29 | })
30 | _this.initData();
31 | },
32 | onReady: function () {
33 | // 页面渲染完成
34 | },
35 | onShow: function () {
36 | // 页面显示
37 | },
38 | onHide: function () {
39 | // 页面隐藏
40 | },
41 | onUnload: function () {
42 | // 页面关闭
43 | },
44 | initData: function () {
45 | var _this = this;
46 | base.get({ c: "UserCenter", m: "GetOrderInfoByOrderId", orderId: _this.data.oid }, function (d) {
47 | if (d.data.Status == "ok") {
48 | var dat = d.data.Tag;
49 | var arr = [];
50 | var _goodsprice = 0, discount = parseFloat(dat.Order.DiscountAmount);
51 | for (var i = 0; i < dat.ListCake.length; i++) {
52 | _goodsprice += dat.ListCake[i].Price * dat.ListCake[i].Num;
53 | }
54 | if (dat.OaList.length > 0) {
55 | for (var i = 0; i < dat.OaList.length; i++) {
56 | discount += dat.OaList[i].DiscountAmount;
57 | }
58 | dat.Order.DiscountAmount = discount.toFixed(2);
59 | }
60 | var n = "0";
61 | if (dat.Order.Payment == '货到付款') {
62 | n = "1";
63 | }
64 | else if (dat.Order.Payment == '极致币') {
65 | n = "2";
66 | }
67 | _this.setData({
68 | "loaded": true,
69 | "myorder": dat.Order,
70 | "prolist": arr,
71 | "oalist": dat.OaList,
72 | "goodprice": _goodsprice.toFixed(2),
73 | "selid": n
74 | });
75 | }
76 | })
77 | },
78 | paymentselected: function (e) {
79 | var id = e.currentTarget.dataset.aid;
80 | this.setData({ selid: id });
81 | },
82 | gopay: function () {
83 | var _this = this;
84 | var arr = this.data.paymentList;
85 | var payment = "";
86 | for (var i = 0; i < arr.length; i++) {
87 | if (arr[i].id == _this.data.selid) {
88 | payment = arr[i].name;
89 | break;
90 | }
91 | }
92 | var obj = {};
93 | obj.OrderId = this.data.oid;
94 | obj.Bank = payment == "吉致币" ? "极致币" : payment;
95 | base.post({
96 | c: "OrderCenter", m: "AddPayment", p: JSON.stringify(obj)
97 | }, function (d) {
98 | console.log(d)
99 | var dt = d.data;
100 | if (dt.Status == "ok") {
101 | if (payment == "微信支付") {
102 |
103 | }
104 | else {
105 | wx.redirectTo({
106 | url: "../success/success?oid=" + _this.data.oid
107 | })
108 | }
109 | }
110 | else
111 | {
112 | wx.showModal({
113 | showCancel: false,
114 | title: '',
115 | content: dt.Msg
116 | })
117 | }
118 | })
119 | }
120 | })
--------------------------------------------------------------------------------
/pages/payment/payment.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/payment/payment.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 支付方式
5 |
6 |
7 |
8 |
9 |
10 | 微信支付
11 | 微信扫一扫,安全又健康
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 货到付款
24 | 配送后再收费,支持现金
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 | 吉致币
37 | 使用吉致币支付, 消费更超值
38 |
39 |
40 |
41 |
42 |
43 |
44 | 去充值
45 |
46 | 剩余:{{jzb}}个
47 |
48 |
49 |
50 |
51 |
52 |
53 | 商品金额:¥{{goodprice}}
54 | 优惠:¥{{myorder.DiscountAmount}}
55 | 运费:¥{{myorder.ShippingCost}}
56 | 配件:¥0
57 |
58 |
59 | 应付:¥{{myorder.TotalPrice}}
60 | 去支付
61 |
62 |
--------------------------------------------------------------------------------
/pages/payment/payment.wxss:
--------------------------------------------------------------------------------
1 |
2 | .title{ line-height: 2em;background: #576b95; font-size: 24px; font-weight: 300; color:#fff;text-align: center; font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;margin-bottom: 6%;}
3 |
4 | .p_paylist{display:flex; justify-content: space-between; margin:4%;}
5 | .p_line{border-bottom:1px solid #eee;}
6 | .p_paylist_imgbox{margin:0 5%;}
7 | .p_paylist_img{width:50px;height:50px;}
8 | .p_paylist_icon{margin:0 5%}
9 | .p_payfont { font-size: 18px; font-weight: 600; font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;}
10 | .p_payfont .p_payfont_c{ color: #949494; font-size:15px; margin-top:5px;}
11 | .p_recharge{background: #D93515;height: 30px;width:20%;color: #fff;text-align: center; font-size: 14px;line-height: 2em; border-radius: 20px;}
12 |
13 | .m_totbox{margin:10% 2%;}
14 |
15 | .m_sub{display: flex;margin:10% 2%;}
16 | .m_sub_yf{background: #e1e1e1;height: 40px;width:68%;text-align: center;line-height: 2em;}
17 | .m_sub_btn{background: #D93515;height: 40px;color: #fff;width:30%;text-align: center;line-height: 2em;}
18 |
--------------------------------------------------------------------------------
/pages/phone/phone.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | Page({
3 | data: {
4 | tab: 1,
5 | btnStatus: true,//倒计时已结束
6 | sec: 0,
7 | phone: "",
8 | phoneOk: false,
9 | code: "",
10 | codeOk: false,
11 | pwd: ""
12 |
13 | },
14 | key: "",
15 | onLoad: function () {
16 | var _this = this;
17 | // wx.request({
18 | // url: base.path.www + 'control/messageCodeNew.ashx?v=' + Math.random(),
19 | // success: function (res) {
20 | // _this.key = res.data;
21 | // },
22 | // })
23 | },
24 | checkPhone: function (e) {
25 | var v = e.detail.value;
26 | if (v && v.length == 11) {
27 | this.setData({
28 | phone: v,
29 | phoneOk: true
30 | });
31 | } else {
32 | this.setData({
33 | phone: "",
34 | phoneOk: false
35 | });
36 |
37 | }
38 | },
39 | checkCode: function (e) {
40 | var v = e.detail.value;
41 | if (v && v.length > 2) {
42 | this.setData({
43 | code: v,
44 | codeOk: true
45 | });
46 | } else {
47 | this.setData({
48 | code: "",
49 | codeOk: false
50 | });
51 | }
52 | },
53 | sendCode: function () {
54 | var _this = this;
55 | // if (this.key) {
56 | if (this.data.phoneOk) {
57 | this.setData({
58 | sec: 90,
59 | btnStatus: false
60 | });
61 | var tm = setInterval(function () {
62 | if (_this.data.sec > 0) {
63 | _this.setData({ sec: _this.data.sec - 1 });
64 | if (_this.data.sec == 0) {
65 | _this.setData({ btnStatus: true });
66 | clearInterval(tm);
67 | }
68 | }
69 | }, 1000);
70 | base.get({ m: "SendPhoneCode", c: "User", phone: this.data.phone, ImageCode: this.key }, function (res) {
71 | var data = res.data;
72 | if (data.Status == "ok") {
73 | base.toast({ tilte: "已发送", icon: "success", duration: 2000 });
74 | }
75 | })
76 | }
77 | // }
78 | },
79 | changeTab: function (e) {
80 | var d = e.currentTarget.dataset.index;
81 | this.setData({ tab: d });
82 | },
83 | changepwd: function (e) {
84 | this.setData({
85 | pwd: e.detail.value
86 | });
87 | },
88 | login: function () {
89 | // if (this.key) {
90 | var flag = true;
91 | var err = "";
92 | console.log(this);
93 |
94 | if(this.data.phone == '13623834531' && this.data.pwd == '123456'){
95 | wx.switchTab({
96 | url: '../user/user'
97 | })
98 | }else{
99 | err = "手机号或密码错误!";
100 | base.modal({ title: err })
101 | }
102 | if (this.data.phoneOk) {
103 | if (this.data.tab == 1) {
104 | if (!this.data.pwd) {
105 | flag = false;
106 | err = "请输入密码!";
107 | }
108 | }
109 | else {
110 | if (!this.data.code) {
111 | flag = false;
112 | err = "请输入手机验证码";
113 | }
114 |
115 | }
116 | if (flag) {
117 | base.post({ c: "User", m: "Login", phone: this.data.phone, pwd: this.data.pwd, code: this.data.code, types: this.data.tab }, function (res) {
118 | var dt = res.data;
119 | if (dt.Status == "ok") {
120 | base.user.userid = dt.Tag.Uid;
121 | base.user.sessionid = dt.Tag.SessionId;
122 | base.user.jzb = dt.Tag.Money;
123 | base.user.exp = dt.Tag.Exp;
124 | base.user.phone = dt.Tag.Phone;
125 | base.user.levels = dt.Tag.Levels;
126 | base.user.headimg = dt.Tag.HeadImgPath;
127 | var objuser = {};
128 | objuser.userid = dt.Tag.Uid;
129 | objuser.sessionid = dt.Tag.SessionId;
130 | objuser.jzb = dt.Tag.Money;
131 | objuser.exp = dt.Tag.Exp;
132 | objuser.phone = dt.Tag.Phone;
133 | objuser.levels = dt.Tag.Levels;
134 | objuser.headimg = dt.Tag.HeadImgPath;
135 | base.user.setCache(objuser);
136 | wx.switchTab({
137 | url: '../user/user'
138 | })
139 | } else {
140 | base.modal({ title: dt.Msg })
141 | }
142 | })
143 | } else {
144 | base.modal({ title: err })
145 | }
146 | }
147 | }
148 |
149 | });
--------------------------------------------------------------------------------
/pages/phone/phone.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "快速登录",
3 | "disableScroll":true
4 | }
--------------------------------------------------------------------------------
/pages/phone/phone.wxml:
--------------------------------------------------------------------------------
1 |
2 | 账号密码登录
3 | 动态密码登录
4 |
5 |
6 |
7 | +86
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 | 发送验证码
20 |
21 | {{sec}}秒后重新发送
22 |
23 |
24 |
25 |
26 | 登 录
27 |
28 | 回到首页
29 |
--------------------------------------------------------------------------------
/pages/phone/phone.wxss:
--------------------------------------------------------------------------------
1 | page{background-color: #f3f3f3;padding: 55px 0 0;}
2 | .fm{width: 700rpx;display: flex; border: 1rpx solid #ddd;background-color: #fff; margin: 20rpx auto 0;border-radius:3px;height:50px;line-height: 50px;}
3 | .fm input{flex: 1;padding: 0 10px; height: 100%;}
4 |
5 | .phone .label{width: 100rpx; border-right: 1rpx solid #eee;text-align: center;}
6 | .code .label{width: 300rpx; border-left: 1rpx solid #eee;text-align: center;}
7 |
8 | .btn-ok{background-color:#ff6a00;color: #fff;}
9 | .btn-dis{background-color:#ddd;color: #333;}
10 | .btn-dis text{color:#ff6a00; padding: 0 5rpx; }
11 |
12 |
13 | .sub{width: 700rpx;height: 50px;line-height: 50px; text-align: center;border-radius:3px; margin:30rpx auto; }
14 | .sub-ok{background-color:#576b95;color: #fff;}
15 | .sub-dis{background-color: #d0d0d0;color: #333;}
16 |
17 | .tab{width: 720rpx; position: fixed;z-index: 100; left: 14rpx; top:10rpx;border:1px solid #576b95;height: 40px; line-height:40px;border-radius: 5px;display: flex;font-size: 13pt;}
18 | .tab-layer{width: 750rpx;height: 50px; background: #fff;opacity: 0.9;left: 0;top: 0; position: fixed;z-index: 99; }
19 | .tab .tab-on{background-color: #576b95;text-align: center; color: #fff;flex: 1;}
20 | .tab .tab-out{text-align: center;flex: 1;}
21 | .goBack{font-size: 12pt; margin-left:30rpx;}
22 |
--------------------------------------------------------------------------------
/pages/success/success.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | Page({
3 | data: {
4 | oid: "1703101349147978",
5 | },
6 | onLoad: function (options) {
7 | // 页面初始化 options为页面跳转所带来的参数
8 | var _this = this;
9 | _this.setData({
10 | "oid": options.oid?options.oid:_this.data.oid
11 | });
12 |
13 | },
14 | onReady: function () {
15 | // 页面渲染完成
16 | },
17 | onShow: function () {
18 | // 页面显示
19 | },
20 | onHide: function () {
21 | // 页面隐藏
22 | },
23 | onUnload: function () {
24 | // 页面关闭
25 | },
26 |
27 | go: function () {
28 | var _this = this;
29 | wx.navigateTo({
30 | url: "../user/myorderdetals/myorderdetals?oid=" + _this.data.oid
31 | })
32 |
33 | }
34 |
35 | })
--------------------------------------------------------------------------------
/pages/success/success.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/success/success.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | 您的订单已经提交成功。
7 | 感谢您的预定!
8 | 如需取消或修改订单,请务必在配送前一天
9 | (PM 21:00)前联系客服(400 627 5757)。
10 |
11 |
12 | 订单号:{{oid}}
13 | 查 看
14 |
15 |
16 |
17 | 继续购物
18 |
19 |
--------------------------------------------------------------------------------
/pages/success/success.wxss:
--------------------------------------------------------------------------------
1 | /* pages/success/success.wxss */
2 |
3 | .success_tb {
4 | text-align: center;
5 | margin-top: 10%;
6 | }
7 |
8 | .p_font {
9 | text-indent: 5%;
10 | line-height: 2em;
11 | font-size: 1em;
12 | font-weight: 600;
13 | font-family: 'microsoft yahei', Verdana, Arial, Helvetica, sans-serif;
14 | }
15 |
16 | .p_href {
17 | color: blue;
18 | }
19 | .p_gocake{display: flex;}
20 | .p_jt {
21 | width: 0;
22 | height: 0;
23 | border: 0.8em solid;
24 | border-color: transparent transparent transparent green;
25 | margin:5px 0 0 2em;
26 | }
27 |
28 | .success_tz {
29 | text-align: center;
30 | display: flex;
31 | }
32 |
--------------------------------------------------------------------------------
/pages/user/editaddress/editaddress.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | Page({
3 | data: {
4 | loaded: true,
5 | id: 0,
6 | mode: "add",
7 | consigee: "",
8 | phone: "",
9 | address: "",
10 | arrayCity: [],
11 | objectArrayCity: [],
12 | arrayDistrict: [],
13 | objectArrayDistrict: [],
14 | indexCity: 0,
15 | indexDistrict: 0,
16 | editArea: ""//修改专用初始化字段
17 | },
18 | onLoad: function (options) {
19 | // 页面初始化 options为页面跳转所带来的参数
20 | var _this = this;
21 | _this.setData({
22 | mode: options.mod,
23 | id: options.id
24 | });
25 | _this.getCity(_this.preLoad);//先获取城市,城市获取成功再执行加载其他内容过程。
26 |
27 | },
28 | preLoad: function () {
29 | var _this = this;
30 | if (_this.data.mode == "edit") {
31 | base.get({c: "UserCenter", m: "getAddressById", id: _this.data.id}, function (d) {
32 | var dt = d.data;
33 | if (dt.Status == "ok") {
34 | for (var i = 0; i < _this.data.objectArrayCity.length; i++) {
35 | if (_this.data.objectArrayCity[i].name == dt.Tag.city) {
36 | _this.setData({indexCity: _this.data.objectArrayCity[i].id});
37 | break;
38 | }
39 | }
40 | _this.setData({
41 | loaded: true,
42 | consigee: dt.Tag.name,
43 | phone: dt.Tag.phone,
44 | address: dt.Tag.address,
45 | editArea: dt.Tag.area
46 | })
47 | _this.getAreaByCity(_this.data.arrayCity[_this.data.indexCity], _this.preAreaByEdit);
48 | }
49 | })
50 | }
51 | else {
52 | _this.getAreaByCity(_this.data.arrayCity[0]);
53 | _this.setData({
54 | loaded: true
55 | })
56 | }
57 | },
58 | preAreaByEdit: function () {//编辑状态初始化加载区域
59 | var _this = this;
60 | for (var i = 0; i < _this.data.objectArrayDistrict.length; i++) {
61 | if (_this.data.objectArrayDistrict[i].name == _this.data.editArea) {
62 | _this.setData({indexDistrict: _this.data.objectArrayDistrict[i].id});
63 | break;
64 | }
65 | }
66 | },
67 | getCity: function (call) {//获取所有城市
68 | var _this = this;
69 | base.get({c: "CityCenter", m: "GetCitys"}, function (d) {
70 | var dt = d.data;
71 | if (dt.Status == "ok") {
72 | var arr_objcity = [];
73 | var arr_city = [];
74 | for (var i = 0; i < dt.Tag.length; i++) {
75 | arr_city.push(dt.Tag[i].City);
76 | arr_objcity.push({id: i, name: dt.Tag[i].City});
77 | }
78 | _this.setData({
79 | arrayCity: arr_city,
80 | objectArrayCity: arr_objcity
81 | })
82 | if (call) call();
83 | }
84 | })
85 | },
86 | getAreaByCity: function (city, call) {
87 | var _this = this;
88 | base.get({c: "CityCenter", m: "GetAreaByCity", city: city}, function (d) {
89 | var dt = d.data;
90 | if (dt.Status == "ok") {
91 | var arr_objArea = [];
92 | var arr_Area = [];
93 | for (var i = 0; i < dt.Tag.length; i++) {
94 | arr_Area.push(dt.Tag[i].District);
95 | arr_objArea.push({id: i, name: dt.Tag[i].District});
96 | }
97 | _this.setData({
98 | arrayDistrict: arr_Area,
99 | objectArrayDistrict: arr_objArea
100 | })
101 | if (call) call();
102 | }
103 | })
104 | },
105 | bindPickerChangeCity: function (e) {
106 | console.log('picker发送选择改变,携带值为', e.detail.value)
107 | this.setData({
108 | indexCity: e.detail.value
109 | })
110 | this.getAreaByCity(this.data.arrayCity[e.detail.value]);
111 | },
112 | bindPickerChangeDistrict: function (e) {
113 | console.log('picker发送选择改变,携带值为', e.detail.value)
114 | this.setData({
115 | indexDistrict: e.detail.value
116 | })
117 | },
118 | changeName: function (e) {
119 | this.setData({
120 | consigee: e.detail.value
121 | })
122 | },
123 | changePhone: function (e) {
124 | this.setData({
125 | phone: e.detail.value
126 | })
127 | },
128 | changeAddress: function (e) {
129 | this.setData({
130 | address: e.detail.value
131 | })
132 | },
133 | submit: function () {
134 | var _this = this;
135 | if (_this.valid()) {
136 | var addr = {
137 | city: _this.data.arrayCity[_this.data.indexCity],
138 | area: _this.data.arrayDistrict[_this.data.indexDistrict],
139 | address: _this.data.address,
140 | name: _this.data.consigee,
141 | phone: _this.data.phone,
142 | c: "UserCenter"
143 | };
144 | if (_this.data.mode == "edit") {
145 | addr.id = _this.data.id;
146 | addr.m = "UpdateAddress";
147 | }
148 | else {
149 | addr.m = "AddAddress";
150 | }
151 | base.get(addr, function (d) {
152 | var dt = d.data;
153 | if (dt.Status == "ok") {
154 | wx.redirectTo({
155 | url: "../../user/myaddress/myaddress"
156 | })
157 | }
158 | else {
159 | wx.showModal({
160 | showCancel: false,
161 | title: '',
162 | content: dt.Msg
163 | });
164 |
165 | console.log(dt.Msg);
166 | }
167 | })
168 |
169 |
170 | }
171 |
172 | },
173 | valid: function () {
174 | var _this = this;
175 | var err = "";
176 | if (!_this.data.consigee) {
177 | err = "请填写收货人姓名!";
178 | wx.showModal({
179 | showCancel: false,
180 | title: '',
181 | content: err
182 | })
183 | return false;
184 | }
185 | if (!_this.data.phone) {
186 | err = "请填写收货人手机号码!";
187 | wx.showModal({
188 | showCancel: false,
189 | title: '',
190 | content: err
191 | })
192 | return false;
193 | }
194 | if (!_this.phoneRegex(_this.data.phone)) {
195 | err = "手机号码格式不正确!";
196 | wx.showModal({
197 | showCancel: false,
198 | title: '',
199 | content: err
200 | })
201 | return false;
202 | }
203 | // if (_this.data.area) {
204 | // v.focArea = false;
205 | // return showMsg("请选择区域!", "focArea");
206 | // }
207 | if (!_this.data.address) {
208 | err = "请填写详细收货地址!";
209 | wx.showModal({
210 | showCancel: false,
211 | title: '',
212 | content: err
213 | })
214 | return false;
215 | }
216 | return true;
217 |
218 | },
219 | phoneRegex: function (val) {
220 | var regex = /^1[3|4|5|7|8][0-9]\d{8}$/;
221 | if (!regex.test(val)) {
222 | return false;
223 | }
224 | return true;
225 | }
226 | })
227 |
--------------------------------------------------------------------------------
/pages/user/editaddress/editaddress.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/user/editaddress/editaddress.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | 城市选择:{{arrayCity[indexCity]}}
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | 区域选择:{{arrayDistrict[indexDistrict]}}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | 确认提交
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/pages/user/editaddress/editaddress.wxss:
--------------------------------------------------------------------------------
1 | .body {
2 | margin: 20px 0;
3 | background-color: #fff;
4 | box-shadow: 5px 0 #f7f7f7;
5 | font-size: 15px;
6 | font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;
7 | }
8 | .ipt{background: #eee; margin: 10px;width:95%;}
9 | .ipt input{height:40px;padding-left:10px; }
10 | .section{line-height:40px;background: #eee; margin: 10px;height:40px;width:95%;}
11 | .btn {
12 | display: block;
13 | height: 2.277em;
14 | line-height: 2.277em;
15 | margin: 10% auto;
16 | width: 80%;
17 | text-align: center;
18 | background: #ff6000;
19 | color: #fff;
20 | border-radius: 8px;
21 | border: none;
22 | font-size: 1.133em;
23 | }
--------------------------------------------------------------------------------
/pages/user/myaddress/myaddress.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | Page({
3 | data: {
4 | loaded: true,
5 | addresslist: []
6 | },
7 | onLoad: function (options) {
8 | // 页面初始化 options为页面跳转所带来的参数
9 | var _this = this;
10 | this.getOrderList();
11 | wx.setNavigationBarTitle({
12 | title: '我的地址簿'
13 | })
14 | },
15 | getOrderList: function () {
16 | var _this = this;
17 |
18 | base.get({ c: "UserCenter", m: "GetAllAddress" }, function (d) {
19 | var dt = d.data;
20 | if (dt.Status == "ok") {
21 | var arr = [];
22 | for (var i = 0; i < dt.Tag.length; i++) {
23 | var obj = dt.Tag[i];
24 | if (i == 0) {
25 | obj.isDefault = true;
26 | }
27 | arr.push(obj);
28 |
29 | }
30 | _this.setData({
31 | loaded: true,
32 | addresslist: arr
33 | })
34 |
35 | }
36 | })
37 | },
38 | toDelete: function (e) {
39 | var _this = this;
40 | var id = e.currentTarget.dataset.aid;
41 | wx.showModal({
42 | title: '',
43 | content: '确定要删除该地址?',
44 | success: function (res) {
45 | if (res.confirm) {
46 | base.get({ c: "UserCenter", m: "DelAddressByID", id: id }, function (d) {
47 | var dt = d.data;
48 | if (dt.Status == "ok") {
49 | var arr = [];
50 | for (var i = 0; i < dt.Tag.length; i++) {
51 | var obj = dt.Tag[i];
52 | if (i == 0) {
53 | obj.isDefault = true;
54 | }
55 | arr.push(obj);
56 |
57 | }
58 | _this.setData({
59 | loaded: true,
60 | addresslist: arr
61 | })
62 |
63 | }
64 | })
65 | }
66 | }
67 | })
68 |
69 |
70 | },
71 | toDefault: function (e) {
72 | var _this = this;
73 | var id = e.currentTarget.dataset.aid;
74 | base.get({ c: "UserCenter", m: "SetDefaultAddr", id: id }, function (d) {
75 | var dt = d.data;
76 | if (dt.Status == "ok") {
77 | var arr = [];
78 | for (var i = 0; i < dt.Tag.length; i++) {
79 | var obj = dt.Tag[i];
80 | if (i == 0) {
81 | obj.isDefault = true;
82 | }
83 | arr.push(obj);
84 |
85 | }
86 | _this.setData({
87 | loaded: true,
88 | addresslist: arr
89 | })
90 |
91 | }
92 | })
93 | }
94 |
95 | })
--------------------------------------------------------------------------------
/pages/user/myaddress/myaddress.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/user/myaddress/myaddress.wxml:
--------------------------------------------------------------------------------
1 |
2 | 添加收货地址
3 |
4 |
5 | {{a.name}} {{a.phone}}
6 | {{a.city}} {{a.area}} {{a.address}}
7 |
8 |
9 | 设置默认
10 | 删除
11 |
12 | 修改
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/pages/user/myaddress/myaddress.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/myaddress/myaddress.wxss */
2 |
3 | .body {
4 | margin: 10px 0;
5 | background-color: #fff;
6 | box-shadow: 5px 0 #f7f7f7;
7 | font-size: 13px;
8 | font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;
9 | }
10 |
11 | .shdz {
12 | display: block;
13 | height: 2.777em;
14 | line-height: 2.777em;
15 | margin: 10px auto;
16 | width: 80%;
17 | text-align: center;
18 | background: #ff6000;
19 | color: #fff;
20 | border-radius: 8px;
21 | border: none;
22 | font-size: 1.333em;
23 | }
24 | .m_box {
25 | width: 80%;
26 | margin: 12px auto;
27 | background: #eee;
28 | border-radius: 10px;
29 | box-shadow: 0 3px #f7f7f7;
30 | }
31 | .m_box .m_address_list {
32 | padding: 1.1111em;
33 | line-height: 2em;
34 | }
35 | .m_address_list .m_control {
36 | display: flex;padding: 10px 0 ;
37 | }
38 | .m_address_list .m_control .m_box_control {
39 | padding: 5px 10px ;
40 | margin:5px 5px;
41 | background:#fff;
42 | border-radius: 10px;
43 | }
44 | .m_address_list .m_control .m_box_control_select {
45 | padding: 5px 10px ;
46 | margin:5px 5px;
47 | background:#fff3e8;
48 | color:#ff6000;
49 | border-radius: 10px;
50 | }
--------------------------------------------------------------------------------
/pages/user/mycoupons/mycoupons.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 |
3 | Page({
4 | data: {
5 | // text:"这是一个页面"
6 | actionSheetHidden: true,
7 | actionSheetItems: [
8 | { bindtap: 'Menu1', txt: '支付宝' },
9 | { bindtap: 'Menu2', txt: '微信' },
10 | { bindtap: 'Menu3', txt: '极致币' }
11 | ],
12 | menu: '请选择支付方式'
13 | },
14 | actionSheetTap: function () {
15 | this.setData({
16 | actionSheetHidden: !this.data.actionSheetHidden
17 | })
18 | },
19 | actionSheetbindchange: function () {
20 | this.setData({
21 | actionSheetHidden: !this.data.actionSheetHidden
22 | })
23 | },
24 | bindMenu1: function () {
25 | this.setData({
26 | menu: "支付宝",
27 | actionSheetHidden: !this.data.actionSheetHidden
28 | })
29 | },
30 | bindMenu2: function () {
31 | this.setData({
32 | menu: "微信",
33 | actionSheetHidden: !this.data.actionSheetHidden
34 | })
35 | },
36 | bindMenu3: function () {
37 | this.setData({
38 | menu: "极致币",
39 | actionSheetHidden: !this.data.actionSheetHidden
40 | });
41 |
42 | },
43 | submit: function () {
44 | var _this = this;
45 |
46 | var obj = {};
47 | obj.UserName = base.user.phone;
48 | obj.UserPhone = base.user.phone;
49 | obj.OrderSource = "PC|web";
50 | obj.Consignee = "小刘";
51 | obj.Cellphone = "13696672529";
52 | obj.City = "上海";
53 | obj.District = "普陀区";
54 | obj.Address = "普陀科技大厦";
55 | obj.DeliveryDate = "2017-3-1";
56 | obj.DeliveryTime = "10:00-11:00";
57 | obj.Payment = "支付宝";
58 | obj.Uid = base.user.userid;
59 | obj.Remarks = "";
60 | obj.TotalPrice = 168;
61 | obj.TotalPrice = obj.TotalPrice < 0 ? 0 : obj.TotalPrice;
62 | var oplArr = [{
63 | ProductName: "极地牛乳",
64 | Price: 188,
65 | Size: "1.2磅",
66 | Num: 1,
67 | CakeNo: 0,
68 | OType: 0,
69 | IType: 0,
70 | SupplyNo: "KSK-0001-1",
71 | //生日内容
72 | IsCutting: 0,
73 | CutNum: 0,
74 | BrandCandleType: 0,
75 | Remarks: '',
76 | Premark: null,//生产备注
77 | }
78 | ];
79 | var oal = [];
80 | base.post({
81 | c: "OrderCenter", m: "AddOrder", p: JSON.stringify(obj), proInfo: JSON.stringify(oplArr), oalInfo: JSON.stringify(oal)
82 | }, function(d) {
83 | console.log(d)
84 | if (d.Status == "ok") { }
85 |
86 | })
87 |
88 | }
89 | })
--------------------------------------------------------------------------------
/pages/user/mycoupons/mycoupons.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/user/mycoupons/mycoupons.wxml:
--------------------------------------------------------------------------------
1 | 优惠券
--------------------------------------------------------------------------------
/pages/user/mycoupons/mycoupons.wxss:
--------------------------------------------------------------------------------
1 |
2 | .body {
3 | margin: 10px 0;
4 | background-color: #f6f8f9;
5 | box-shadow: 5px 0 #f7f7f7;
6 | font-size: 14px;
7 | font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;
8 | }
9 | .item{display:flex; justify-content:space-around;}
10 | .item .i_left{margin:0 0 0 5%;width:90%;}
11 | .item .iaddr_right{margin:3% 0;width:5%;}
12 | .i_img{width:20px;height: 20px;}
13 | .item .i_right{margin:2% 0;width:5%;}
14 | .con{flex: 1; padding: 0 10px 0 0;border-bottom: 10rpx solid #fff;}
15 | .ft{font-size: 18px;color:cornflowerblue;}
16 | .commodity_screen {
17 | width: 100%;
18 | height: 100%;
19 | position: fixed;
20 | top: 0;
21 | left: 0;
22 | background: #000;
23 | opacity: 0.2;
24 | overflow: hidden;
25 | z-index: 1000;
26 | color: #fff;
27 | }
28 |
29 | .commodity_attr_box {
30 | width: 100%;
31 | overflow: hidden;
32 | position: fixed;
33 | bottom: 0;
34 | left: 0;
35 | z-index: 2000;
36 | background: #fff;
37 | padding-top: 20rpx;
38 | }
39 |
40 | .addr_box{height:300px;width:100%;background:#eee;position:absolute;bottom:0; opacity: 0.7; }
41 | .addr_box_add{position:absolute;bottom:2px;border-top:1px solid #000;width:100%;padding-left:35%;font-size: 18px;
42 | font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;}
43 | .addr_head{display: flex;border-bottom:1px solid #000;height: 40px;}
44 | .addr_head_cancel{font-size: 14px;margin:15px 5px;}
45 | .addr_head_title{font-size: 18px;margin:15px 35%;}
46 | .addr_body{display: flex;border-bottom:1px dashed #000;margin-top:15px;}
47 | .addr_body_edit{width:9%;padding:10px;font-size:14px;}
48 | .addr_body_my{width:75%;}
49 | .addr_body_my_det{font-size:16px; font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif;}
50 | .addr_body_sel{padding-top:15px;}
51 |
52 |
--------------------------------------------------------------------------------
/pages/user/myjzb/myjzb.js:
--------------------------------------------------------------------------------
1 | // // pages/user/myjzb/myjzb.js
2 | // Page({
3 | // data:{},
4 | // onLoad:function(options){
5 | // // 页面初始化 options为页面跳转所带来的参数
6 | // },
7 | // onReady:function(){
8 | // // 页面渲染完成
9 | // },
10 | // onShow:function(){
11 | // // 页面显示
12 | // },
13 | // onHide:function(){
14 | // // 页面隐藏
15 | // },
16 | // onUnload:function(){
17 | // // 页面关闭
18 | // }
19 | // })
20 | var order = ['red', 'yellow', 'blue', 'green', 'red']
21 | Page({
22 | data: {
23 | toView: 'red',
24 | scrollTop: 100
25 | },
26 | upper: function(e) {
27 | console.log(e)
28 | },
29 | lower: function(e) {
30 | console.log(e)
31 | },
32 | scroll: function(e) {
33 | console.log(e)
34 | },
35 | tap: function(e) {
36 | for (var i = 0; i < order.length; ++i) {
37 | if (order[i] === this.data.toView) {
38 | this.setData({
39 | toView: order[i + 1]
40 | })
41 | break
42 | }
43 | }
44 | },
45 | tapMove: function(e) {
46 | this.setData({
47 | scrollTop: this.data.scrollTop + 10
48 | })
49 | }
50 | })
--------------------------------------------------------------------------------
/pages/user/myjzb/myjzb.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/user/myjzb/myjzb.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | vertical scroll
5 |
6 | 11
7 | 111
8 | 111
9 | 1111
10 |
11 |
12 |
--------------------------------------------------------------------------------
/pages/user/myjzb/myjzb.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/myjzb/myjzb.wxss */
2 |
3 | .bc_green{height:100px;}
4 | .bc_red{height:100px;}
5 | .bc_yellow{height:100px;}
6 | .bc_blue{height:100px;}
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.js:
--------------------------------------------------------------------------------
1 | // pages/user/myorder/myorder.js
2 |
3 | var base = getApp();
4 | var _list = [];
5 | Page({
6 | data: {
7 | loaded: false,
8 | mylist: [],
9 | pagenum: 1
10 | },
11 | onLoad: function (options) {
12 | // 页面初始化 options为页面跳转所带来的参数
13 | var _this = this;
14 | this.initData();
15 | wx.setNavigationBarTitle({
16 | title: '我的订单列表'
17 | })
18 | },
19 | initData: function () {
20 | this.getOrderList();
21 | },
22 |
23 | getOrderList: function () {
24 | var _this = this;
25 | base.get({ c: "UserCenter", m: "GetOrderList", pageSize: 10, currentPage: _this.data.pagenum}, function (d) {
26 | var data = d.data;
27 | if (data.Status == "ok") {
28 | var arr = data.Tag.obj;
29 | for (var i = 0; i < arr.length; i++) {
30 | _list.push({
31 | name: arr[i].ListCake[0].ProductName,
32 | totalprice: arr[i].TotalPrice ,//+ ".00",
33 | num: arr[i].ListCake.length,
34 | imgUrl: base.path.res + "/images/ksk/item/w_113/" + arr[i].ListCake[0].ProductName + ".jpg",
35 | oid: arr[i].OrderId
36 | })
37 | }
38 | _this.setData({
39 | loaded: true,
40 | mylist: _list
41 | })
42 |
43 | }
44 | })
45 |
46 | },
47 | toDetail: function (e) {
48 | var oid = e.currentTarget.dataset.poid;
49 | if (oid) {
50 | wx.navigateTo({
51 | url: "../../user/myorderdetals/myorderdetals?oid=" + oid
52 | })
53 | }
54 | },
55 | onReachBottom: function () {
56 | var _this = this;
57 | this.setData({
58 | "pagenum": this.data.pagenum + 1
59 | });
60 | this.getOrderList();
61 | }
62 | })
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | {{p.name}}
10 | ¥
11 | {{p.totalprice}}
12 |
13 | 共{{p.num}}件商品
14 |
15 |
16 | >>
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/pages/user/myorder/myorder.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/myorder/myorder.wxss */
2 | .body{margin: 10px 0; background-color: #eee; box-shadow: 5px 0 #ccc; font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif; }
3 | .item{display: flex; padding: 10px 0; background-color: #fff; margin-bottom:5px;}
4 | .item .img{width:300rpx; text-align: center;}
5 | .itemjd .img image{width: 250rpx;height: 150rpx;}
6 | .itemjz .img image{width:100%;height:200rpx;}
7 | .item .con{flex: 1; padding: 0 10px 0 0;}
8 | .con .nm{font-size: 12pt; font-weight: bold;}
9 | .con .des{line-height: 20px; font-size: 12pt; padding: 5px 0;color: #666;}
10 | .iconpadding{padding:30px 30px 0 0;}
--------------------------------------------------------------------------------
/pages/user/myorderdetals/myorderdetals.js:
--------------------------------------------------------------------------------
1 | // pages/user/myorderdetals/myorderdetals.js
2 | // pages/user/myorder/myorder.js
3 |
4 | var base = getApp();
5 | var common=require('../../../utils/common.js');
6 | Page({
7 | data: {
8 | loaded: false,
9 | oid:0,
10 | myorder: {},
11 | prolist: [],
12 | oalist: [],
13 | goodprice: 0
14 | },
15 | onLoad: function (options) {
16 | // 页面初始化 options为页面跳转所带来的参数
17 | var _this = this;
18 | _this.setData({
19 | "oid":options.oid
20 | });
21 | this.initData();
22 | },
23 | initData: function () {
24 | var _this = this;
25 | base.get({ c: "UserCenter", m: "GetOrderInfoByOrderId", orderId: _this.data.oid}, function (d) {
26 | if (d.data.Status == "ok") {
27 | var dat = d.data.Tag;
28 | var arr = [];
29 | var _goodsprice = 0, discount = parseFloat(dat.Order.DiscountAmount), _dis;
30 | for (var i = 0; i < dat.ListCake.length; i++) {
31 | dat.ListCake[i].Size = dat.ListCake[i].OType == '1' ? dat.ListCake[i].Remarks : dat.ListCake[i].Size;
32 | if (dat.ListCake[i].ProductName.indexOf("套餐") < 0) {
33 | arr.push(dat.ListCake[i]);
34 | }
35 | _goodsprice += dat.ListCake[i].Price * dat.ListCake[i].Num;
36 | }
37 |
38 | dat.Order.OrderTime = common.JsonDateToDateTimeString(dat.Order.OrderTime);
39 | dat.Order.DeliveryDate = common.JsonDateToDateString(dat.Order.DeliveryDate);
40 | if (dat.OaList.length > 0) {
41 | for (var i = 0; i < dat.OaList.length; i++) {
42 | discount += dat.OaList[i].DiscountAmount;
43 | }
44 | dat.Order.DiscountAmount = discount.toFixed(2);
45 | }
46 | _this.setData({
47 | "loaded": true,
48 | "myorder": dat.Order,
49 | "prolist": arr,
50 | "oalist": dat.OaList,
51 | "goodprice": _goodsprice.toFixed(2)
52 | });
53 | }
54 | })
55 | }
56 |
57 | })
--------------------------------------------------------------------------------
/pages/user/myorderdetals/myorderdetals.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pages/user/myorderdetals/myorderdetals.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 会员中心
4 |
5 | 我的订单
6 |
7 | 订单详情
8 |
9 |
10 | 订单编号:
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | {{p.ProductName}}
25 | {{p.Size}}
26 | ¥{{p.Price}}
27 | 数量x{{p.Num}}
28 |
29 |
30 |
31 |
32 | 商品金额:{{goodprice}}
33 | +运费:{{myorder.ShippingCost}}
34 | -优惠:{{myorder.DiscountAmount}}
35 | 应付金额:{{myorder.TotalPrice}}
36 |
37 |
38 | 订单状态
39 | {{myorder.OrderStatus}}
40 | 收货信息
41 | {{myorder.Consignee+' '+myorder.CellPhone}}
42 | {{myorder.Address}}
43 | 送货时间
44 | {{myorder.DeliveryDate + ' '+myorder.DeliveryTime}}
45 | 支付方式
46 | {{myorder.Payment}}
47 | 支付状态
48 | {{myorder.PayStatus}}
49 | 附言
50 | {{myorder.Remarks}}
51 |
52 |
--------------------------------------------------------------------------------
/pages/user/myorderdetals/myorderdetals.wxss:
--------------------------------------------------------------------------------
1 | /* pages/user/myorderdetals/myorderdetals.wxss */
2 | .body{padding: 10px; background-color: #fff; margin-bottom:5px;box-shadow: 0 3px 3px #ccc; font-family: 'microsoft yahei',Verdana,Arial,Helvetica,sans-serif; }
3 | .body .fontsize{font-size: 14px;}
4 | .body .fontsize .fontsizec {font-size: 14px;font-weight: bold;display:inline;}
5 | .body .ctime {font-size: 14px;display:inline;margin-left:50%;}
6 | .body .item{display: flex; padding: 10px 0; background-color: #fff; margin-bottom:5px;}
7 | .body .item .img{width:300rpx; text-align: center}
8 | .body .item .img image{width: 250rpx;height: 150rpx;}
9 | .body .item .pcake{font-size: 16px;color: #c60;margin-bottom: 10px;}
10 | .body .bld{font-size: 14px;font-weight: bold;margin:10px 0;}
11 |
12 | .daohang{display:flex;color:gray;}
13 | .dh_title{color:cornflowerblue;}
14 | .dh_jt {
15 | width: 0;
16 | height: 0;
17 | border: 0.5em solid;
18 | border-color: transparent transparent transparent green;
19 | }
--------------------------------------------------------------------------------
/pages/user/user.js:
--------------------------------------------------------------------------------
1 | var base = getApp();
2 | Page({
3 | data: {
4 | userInfo:'',
5 | jzb: "16.00",
6 | coupon: '3',
7 | loaded: true,
8 | exp: 88,
9 | phone: "",
10 | levels: 0,
11 | headimg: "https://m.bestcake.com/images/icon_user.jpg"
12 | },
13 | onGotUserInfo:function (e) {//授权登陆
14 | const { userInfo } = e.detail
15 | console.log(e)
16 | this.setData({
17 | userInfo: userInfo
18 | })
19 | },
20 | exist: function () {
21 | base.user.userid = 0;
22 | base.user.sessionid = "";
23 | base.user.clear();
24 | wx.redirectTo({
25 | url: '../phone/phone'
26 | });
27 | },
28 | onReady: function () {
29 | // 页面渲染完成
30 | console.log(base);
31 | },
32 | tomyorder: function () {
33 | wx.navigateTo({
34 | url: '../user/myorder/myorder'
35 | })
36 | },
37 | tomyaddress: function () {
38 | wx.navigateTo({
39 | url: '../user/myaddress/myaddress'
40 | })
41 | },
42 | changeimg: function () {//更改头像
43 | var _this = this;
44 | wx.showModal({
45 | title: '',
46 | content: '确定要更换头像?',
47 | success: function (res) {
48 | if (res.confirm) {
49 | _this.up();
50 | }
51 | }
52 | })
53 | },
54 | up: function () {
55 | var _this = this;
56 | wx.chooseImage({
57 | success: function (res) {
58 | var tempFilePaths = res.tempFilePaths
59 | wx.uploadFile({
60 | url: base.path.www + "upload.ashx", //仅为示例,非真实的接口地址
61 | filePath: tempFilePaths[0],
62 | name: 'file',
63 | formData: {
64 | 'user': 'test'
65 | },
66 | success: function (res) {
67 | var data = JSON.parse(res.data);
68 | data.Tag += '?v=' + Math.random();
69 | base.user.headimg = data.Tag;
70 | //缓存数据更新
71 | var objuser = {};
72 | objuser.userid = base.user.userid;
73 | objuser.sessionid = base.user.sessionid;
74 | objuser.jzb = base.user.jzb;
75 | objuser.exp = base.user.exp;
76 | objuser.phone = base.user.phone;
77 | objuser.levels = base.user.levels;
78 | objuser.headimg = data.Tag;
79 | base.user.setCache(objuser);
80 | _this.setData({
81 | headimg: data.Tag
82 | });
83 | if (data.Status == "ok") {
84 | base.get({c: "UserCenter", m: "UpdateMemberHeadImage", imgurl: data.Tag}, function (d) {
85 | var d = d.data;
86 | if (d.Status == "ok") {
87 | }
88 | });
89 | }
90 | else {
91 | wx.showModal({
92 | showCancel: false,
93 | title: '',
94 | content: data.Msg
95 | })
96 | }
97 | },
98 | faile: function (res) {
99 | var data = JSON.parse(res.data);
100 | wx.showModal({
101 | showCancel: false,
102 | title: '',
103 | content: data.Msg
104 | })
105 | }
106 | })
107 | }
108 | })
109 | },
110 | onLoad: function () {
111 | var that = this
112 | //调用应用实例的方法获取全局数据
113 | base.getUserInfo(function (userInfo) {
114 | //更新数据
115 | that.setData({
116 | userInfo: userInfo
117 | })
118 | })
119 | if (!base.user.islogin()) {
120 | wx.redirectTo({
121 | // url: '../login/login'
122 | //url: '../phone/phone'
123 | });
124 | }
125 | else {
126 | this.setData({
127 | loaded: true,
128 | jzb: base.user.jzb,
129 | exp: base.user.exp,
130 | phone: base.user.phone,
131 | levels: base.user.levels,
132 | headimg: base.user.headimg
133 |
134 | });
135 | }
136 |
137 |
138 | }
139 | });
--------------------------------------------------------------------------------
/pages/user/user.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarBackgroundColor": "#576b95",
3 | "navigationBarTitleText": "用户中心",
4 | "navigationBarTextStyle": "white",
5 | "backgroundColor": "#f0f0f0",
6 | "enablePullDownRefresh":false
7 | }
--------------------------------------------------------------------------------
/pages/user/user.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 | {{userInfo.nickName}}
12 | 1362383****
13 |
14 |
15 |
16 |
17 |
18 |
19 | {{jzb}}元
20 |
21 | 极致币
22 |
23 |
24 |
25 | {{coupon}}张
26 |
27 | 优惠券
28 |
29 |
30 |
31 | {{exp}}分
32 |
33 | 经验
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 | 我的订单
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | 收货地址
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 | 我的优惠券
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | 退出登录
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/pages/user/user.wxss:
--------------------------------------------------------------------------------
1 | page{background-color: #f0f0f0;}
2 | .u{display: flex;padding:15px 0; flex-direction:row; background-color:#576b95}
3 | .u .logo{padding:0 20px;}
4 | .u .logo image{width: 60px; height: 60px; border-radius: 50%; border:2px solid #fff;}
5 |
6 | .des .uname{ color: #fff;font-weight:bold;font-size:15pt; padding: 2px 0;}
7 | .des .phone{ color: #fff;font-size:13pt;}
8 |
9 |
10 | .ua{display: flex;flex-direction:row; background-color: #fff; }
11 | .ua .tab{padding:15px 0; }
12 | .ua .jzb{flex: 1;border-bottom:1rpx solid #ccc;}
13 | .ua .cpn{flex: 1;border-left:1rpx solid #ccc;border-right:1rpx solid #ccc;border-bottom:1rpx solid #ccc;}
14 | .ua .exp{flex: 1;border-bottom:1rpx solid #ccc;}
15 | .ua .amount{text-align: center;font-size: 8pt;}
16 | .ua .amount text{font-size: 15pt; font-weight: bold; padding: 0 3px;}
17 | .ua .nm{text-align: center;font-size: 10pt; color: #666;}
18 | .ua .jzb .amount{color: #f00;}
19 |
20 | .ub{margin-top: 10px; border-top:1rpx solid #ccc;border-bottom:1rpx solid #ccc; background-color: #fff;}
21 | .ub .item{height:45px;line-height: 45px; display: flex;flex-direction:row;}
22 | .ub .item .icon{width: 50px;height: 30px;}
23 | .ub .item .tit{width: 300rpx; font-size: 13pt;}
24 | .ub .item .con{flex: 1; font-size: 12pt}
25 | .item-a .tit,.item-a .con{border-bottom: 1rpx solid #ddd;}
26 | .weui-cell__hd image {margin-right: 5px;vertical-align: middle;width: 20px;height: 20px;}
27 |
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "packOptions": {
4 | "ignore": []
5 | },
6 | "setting": {
7 | "urlCheck": true,
8 | "es6": true,
9 | "postcss": true,
10 | "minified": true,
11 | "newFeature": true
12 | },
13 | "compileType": "miniprogram",
14 | "libVersion": "2.0.4",
15 | "appid": "wx1ed8d583099f139a",
16 | "projectname": "%E7%94%B5%E5%95%86",
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 | }
--------------------------------------------------------------------------------
/utils/common.js:
--------------------------------------------------------------------------------
1 |
2 | var common = {
3 | format: function () {
4 | var args = arguments;
5 | return args[0].replace(/{(\d+)}/g, function (m, num) {
6 | num = +num + 1;
7 | return typeof args[num] != 'undefined'
8 | ? args[num]
9 | : m;
10 | });
11 | },
12 | dateFormat: function (fmt, date) {
13 | if (!date) {
14 | date = new Date();
15 | }
16 | else {
17 | date = new Date(date);
18 | }
19 | var o = {
20 | "M+": date.getMonth() + 1, //月份
21 | "d+": date.getDate(), //日
22 | "h+": date.getHours(), //小时
23 | "m+": date.getMinutes(), //分
24 | "s+": date.getSeconds(), //秒
25 | "q+": Math.floor((date.getMonth() + 3) / 3), //季度
26 | "S": date.getMilliseconds() //毫秒
27 | };
28 | if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
29 | for (var k in o)
30 | if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
31 | return fmt;
32 | },
33 | JsonDateToDateString: function (date, fmt) {
34 | var date = new Date(parseInt(date.slice(6, -2)));
35 | var fmt = fmt || "yyyy-MM-dd";
36 | return common.dateFormat(fmt, date);
37 | },
38 | JsonDateToDateTimeString: function (date) {
39 | var date = new Date(parseInt(date.slice(6, -2)));
40 | return common.dateFormat("yyyy-MM-dd hh:mm:ss", date);
41 | },
42 | addDate: function (date, days) {//date当前日期 days 加减天数 正数为加 负数为减
43 | var d = new Date(date);
44 | d.setDate(d.getDate() + days);
45 | var month = d.getMonth() + 1;
46 | var day = d.getDate();
47 | if (month < 10) {
48 | month = "0" + month;
49 | }
50 | if (day < 10) {
51 | day = "0" + day;
52 | }
53 | var val = d.getFullYear() + "-" + month + "-" + day;
54 | return val;
55 | }
56 | }
57 |
58 |
59 | module.exports =
60 | {
61 | JsonDateToDateString: common.JsonDateToDateString,
62 | JsonDateToDateTimeString: common.JsonDateToDateTimeString,
63 | addDate:common.addDate
64 | }
--------------------------------------------------------------------------------
/utils/jzData.js:
--------------------------------------------------------------------------------
1 |
2 | module.exports = {
3 | data: {
4 | "吉致泡芙": {
5 | "Name":"吉致泡芙",
6 | "Means": "令人兴奋的松脆口感,源自经典choux pastry制作工艺、严格把控每一层菠萝酥",
7 | "Resourse": "顶级酥壳,天然香草棒,新西兰进口奶油(四只装)",
8 | "KeepFresh": "最适宜0℃~8℃冷藏保存,离开冷藏请勿超过2小时。5月1日~10月31日建议2天内食用 11月1日~翌年4月30日建议3天内食用。",
9 | "img":"images/manjian/puff01_new.png",
10 | "CakeType": [{ "Size": "4只装", "CurrentPrice":88, "SupplyNo": "JZ-0011-5", "PackingList": "" }]
11 | },
12 | "吉致泡芙(巧克力)": {
13 | "Name":"吉致泡芙(巧克力)",
14 | "Means": "进口庄园级巧克力、高可可含量,调动味蕾的快感",
15 | "Resourse": "2-3mm巧克力淋面层,48层手工脆皮,10%庄园级巧克力,70%可可含量",
16 | "KeepFresh": "最适宜0℃~8℃冷藏保存,离开冷藏请勿超过2小时。5月1日~10月31日建议2天内食用 11月1日~翌年4月30日建议3天内食用。",
17 | "img":"images/manjian/puff02_new.png",
18 | "CakeType": [{ "Size": "4只装", "CurrentPrice":88, "SupplyNo": "JZ-0011-8", "PackingList": "" }]
19 | },
20 | "吉致牛轧糖(巴旦木味)": {
21 | "Name":"吉致牛轧糖(巴旦木味)",
22 | "Means": "嚼劲十足,与舌尖唇齿纠缠却不拖泥带水",
23 | "Resourse": "麦芽糖饴、白砂糖、奶粉、饮用水、黄油、白巧克力、鸡蛋、开心果酱、杏仁",
24 | "KeepFresh": "常温储存,避免阳光直射。",
25 | "img":"images/manjian/nogut_new.png",
26 | "CakeType": [{ "Size": "16粒装", "CurrentPrice":68, "SupplyNo": "JZ-0019-17", "PackingList": "" }]
27 | },
28 | "吉致班戟-芒果巧克力": {
29 | "Name":"吉致班戟-芒果巧克力",
30 | "Means": "芒果的香滑、巧克力的醇厚,制成内馅包裹进金黄Q弹的面饼里,成就一道经典的港式甜品",
31 | "Resourse": "面皮、芒果、奥利奥、巧克力、卡斯达酱",
32 | "KeepFresh": "最适宜0℃~8℃冷藏保存,离开冷藏请勿超过2小时。5月1日~10月31日建议2天内食用 11月1日~翌年4月30日建议3天内食用。",
33 | "img":"images/manjian/pancake_new3.png",
34 | "CakeType": [{ "Size": "160克", "CurrentPrice":48, "SupplyNo": "JZ-0034-1", "PackingList": "" }]
35 | },
36 | "吉致班戟-草莓抹茶": {
37 | "Name":"吉致班戟-草莓抹茶",
38 | "Means": "草莓的清甜、抹茶的芬芳,制成内馅包裹进金黄Q弹的面饼里,成就一道经典的港式甜品",
39 | "Resourse": "面皮、草莓、抹茶、奥利奥、卡斯达酱",
40 | "KeepFresh": "最适宜0℃~8℃冷藏保存,离开冷藏请勿超过2小时。5月1日~10月31日建议2天内食用 11月1日~翌年4月30日建议3天内食用。",
41 | "img":"images/manjian/pancake_new2.png",
42 | "CakeType": [{ "Size": "160克", "CurrentPrice":48, "SupplyNo": "JZ-0033-1", "PackingList": "" }]
43 | },
44 | "吉致生巧": {
45 | "Name":"吉致生巧",
46 | "Means": "草莓的清甜、抹茶的芬芳,制成内馅包裹进金黄Q弹的面饼里,成就一道经典的港式甜品",
47 | "Resourse": "白砂糖,可可脂,可可液块,淡奶油,黄油,葡萄糖",
48 | "KeepFresh": "最适宜0℃~8℃冷藏保存,离开冷藏请勿超过2小时。5月1日~10月31日建议2天内食用 11月1日~翌年4月30日建议3天内食用。",
49 | "img":"/images/ksk/item/w_200/吉致生巧.jpg",
50 | "CakeType": [{ "Size": "一盒", "CurrentPrice":168, "SupplyNo": "JZ-0029-1", "PackingList": "" }]
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/utils/preview.js:
--------------------------------------------------------------------------------
1 | var base=getApp();
2 | module.exports = {
3 | show: function (nm, brand,index) {
4 | if (brand == 0) {
5 | wx.previewImage({
6 | current: base.path.res + "images-2/classical-detail/" + encodeURI(nm) + "/" + encodeURI(nm) + "-" + index + ".jpg",
7 | urls: (function () {
8 | var _list = [];
9 | for (var i = 1; i <= 4; i++) {
10 | _list.push(base.path.res + "images-2/classical-detail/" + encodeURI(nm) + "/" + encodeURI(nm) + "-" + i + ".jpg");
11 | }
12 | return _list;
13 | })()
14 | });
15 | } else {
16 | wx.previewImage({
17 | current: base.path.res + "images/ksk/item/" + encodeURI(nm) + ".jpg",
18 | urls: [base.path.res + "images/ksk/item/" + encodeURI(nm) + ".jpg"]
19 | });
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/utils/util.js:
--------------------------------------------------------------------------------
1 | function formatTime(date) {
2 | var year = date.getFullYear()
3 | var month = date.getMonth() + 1
4 | var day = date.getDate()
5 |
6 | var hour = date.getHours()
7 | var minute = date.getMinutes()
8 | var second = date.getSeconds()
9 |
10 |
11 | return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
12 | }
13 |
14 | function formatNumber(n) {
15 | n = n.toString()
16 | return n[1] ? n : '0' + n
17 | }
18 |
19 | module.exports = {
20 | formatTime: formatTime
21 | }
22 |
--------------------------------------------------------------------------------