├── .DS_Store
├── README.md
├── app.js
├── app.json
├── app.wxss
├── config.js
├── image
├── .DS_Store
├── 1.gif
├── 1.jpg
├── 11.png
├── 12.png
├── 2.jpg
├── 21.png
├── 22.png
├── 3.jpg
├── 31.png
├── 32.png
├── 4.jpg
├── 41.png
├── 42.png
├── 5.jpg
├── 6.jpg
├── b1.jpg
├── b2.jpg
├── b3.jpg
├── bk.png
├── bk
│ ├── .DS_Store
│ ├── banner.png
│ ├── c1.png
│ ├── c10.png
│ ├── c11.png
│ ├── c12.png
│ ├── c13.png
│ ├── c2.png
│ ├── c3.png
│ ├── c4.png
│ ├── c5.png
│ ├── c6.png
│ ├── c7.png
│ ├── c8.png
│ └── c9.png
├── c1.png
├── c2.png
├── c3.png
├── c4.png
├── cart1.png
├── cart2.png
├── category
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── 4.png
│ ├── 5.png
│ ├── 6.png
│ ├── 7.png
│ └── 8.png
├── cx
│ ├── .DS_Store
│ ├── banner.jpeg
│ ├── c1.jpeg
│ ├── c2.jpeg
│ └── c3.jpeg
├── dj.jpg
├── goods1.png
├── hdl.png
├── hdl
│ ├── banner.jpeg
│ ├── c1.jpeg
│ ├── c2.jpeg
│ └── c3.jpeg
├── icon
│ ├── .DS_Store
│ ├── recommend.png
│ ├── 准.png
│ ├── 减.png
│ ├── 折.png
│ ├── 特.png
│ ├── 票.png
│ ├── 赠.png
│ └── 返.png
├── icon3.png
├── list1.png
├── ry.png
├── ry
│ ├── .DS_Store
│ ├── banner.jpg
│ ├── c1.jpg
│ ├── c2.jpg
│ └── c3.jpg
├── s4.png
├── s6.png
├── xyx.jpg
├── ycyk
│ ├── .DS_Store
│ ├── banner.jpg
│ ├── c1.jpg
│ ├── c2.jpg
│ └── c3.jpg
└── ye.png
├── page
├── common
│ ├── common.wxss
│ ├── shop.wxml
│ ├── shop.wxss
│ ├── star-rate.wxml
│ └── star-rate.wxss
├── component
│ ├── address
│ │ ├── address.js
│ │ ├── address.json
│ │ ├── address.wxml
│ │ └── address.wxss
│ ├── cart
│ │ ├── cart.js
│ │ ├── cart.json
│ │ ├── cart.wxml
│ │ └── cart.wxss
│ ├── category
│ │ ├── category.js
│ │ ├── category.json
│ │ ├── category.wxml
│ │ └── category.wxss
│ ├── details
│ │ ├── details.js
│ │ ├── details.json
│ │ ├── details.wxml
│ │ └── details.wxss
│ ├── index.js
│ ├── index.json
│ ├── index.wxml
│ ├── index.wxss
│ ├── list
│ │ ├── list.js
│ │ ├── list.json
│ │ ├── list.wxml
│ │ └── list.wxss
│ ├── orders
│ │ ├── orders.js
│ │ ├── orders.json
│ │ ├── orders.wxml
│ │ └── orders.wxss
│ └── user
│ │ ├── user.js
│ │ ├── user.json
│ │ ├── user.wxml
│ │ └── user.wxss
└── utils
│ ├── apis.js
│ ├── coordtransform.js
│ ├── dateformat.js
│ ├── distance.js
│ ├── qqmap-wx-jssdk.min.js
│ ├── timeago.min.js
│ └── util.js
├── project.config.json
└── weui.wxss
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/.DS_Store
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 微信外卖小程序
2 |
3 | ## 需求
4 | * 该小程序有三端(客户端,骑手端,商户端)
5 | * 客户端是核心端,主要功能用户在该小程序选择物品下单。
6 | * 骑手根据客户下单获取任务进行配送
7 | * 商户获取客户订单,准备餐品
8 |
9 | ## 使用方法
10 | * 将代码克隆下去后用微信开发工具打开
11 |
12 | ## 如果觉得有参考价值 请给star 谢谢支持
13 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | App({
2 | onLaunch: function () {
3 | console.log('App Launch')
4 | },
5 | onShow: function () {
6 | console.log('App Show')
7 | },
8 | onHide: function () {
9 | console.log('App Hide')
10 | },
11 | globalData: {
12 | hasLogin: false
13 | }
14 | })
15 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "pages": [
3 | "page/component/index",
4 | "page/component/category/category",
5 | "page/component/cart/cart",
6 | "page/component/user/user",
7 | "page/component/address/address",
8 | "page/component/orders/orders",
9 | "page/component/details/details",
10 | "page/component/list/list"
11 | ],
12 | "window": {
13 | "navigationBarTextStyle": "#ffffff",
14 | "navigationBarTitleText": "外卖栈",
15 | "navigationBarBackgroundColor": "#AB956D",
16 | "backgroundColor": "#eeeeee",
17 | "enablePullDownRefresh": true
18 | },
19 | "tabBar": {
20 | "color": "#b7b7b7",
21 | "selectedColor": "#AB956D",
22 | "borderStyle": "#f5f5f5",
23 | "backgroundColor": "#f5f5f5",
24 | "list": [{
25 | "pagePath": "page/component/index",
26 | "iconPath": "image/12.png",
27 | "selectedIconPath": "image/11.png",
28 | "text": "主页"
29 | }, {
30 | "pagePath": "page/component/cart/cart",
31 | "iconPath": "image/32.png",
32 | "selectedIconPath": "image/31.png",
33 | "text": "购物车"
34 | }, {
35 | "pagePath": "page/component/user/user",
36 | "iconPath": "image/42.png",
37 | "selectedIconPath": "image/41.png",
38 | "text": "我的"
39 | }]
40 | },
41 | "networkTimeout": {
42 | "request": 10000,
43 | "connectSocket": 10000,
44 | "uploadFile": 10000,
45 | "downloadFile": 10000
46 | },
47 | "debug": false
48 | }
49 |
--------------------------------------------------------------------------------
/app.wxss:
--------------------------------------------------------------------------------
1 | @import './weui.wxss';
2 | page {
3 | background-color: #fbf9fe;
4 | height: 100%;
5 | }
6 | .container {
7 | display: flex;
8 | flex-direction: column;
9 | min-height: 100%;
10 | justify-content: space-between;
11 | }
12 | .page-header {
13 | display: flex;
14 | font-size: 32rpx;
15 | color: #aaa;
16 | justify-content: center;
17 | margin-top: 50rpx;
18 | }
19 | .page-header-text {
20 | padding: 20rpx 40rpx;
21 | border-bottom: 1px solid #ccc;
22 | }
23 |
24 | .page-body {
25 | width: 100%;
26 | display: flex;
27 | flex-direction: column;
28 | align-items: center;
29 | flex-grow: 1;
30 | overflow-x: hidden;
31 | }
32 | .page-body-wrapper {
33 | margin-top: 100rpx;
34 | display: flex;
35 | flex-direction: column;
36 | align-items: center;
37 | width: 100%;
38 | }
39 | .page-body-wrapper form {
40 | width: 100%;
41 | }
42 | .page-body-wording {
43 | text-align: center;
44 | padding: 200rpx 100rpx;
45 | }
46 | .page-body-info {
47 | display: flex;
48 | flex-direction: column;
49 | align-items: center;
50 | background-color: #fff;
51 | margin-bottom: 50rpx;
52 | width: 100%;
53 | padding: 50rpx 0 150rpx 0;
54 | }
55 | .page-body-title {
56 | margin-bottom: 100rpx;
57 | font-size: 32rpx;
58 | }
59 | .page-body-text {
60 | font-size: 30rpx;
61 | line-height: 26px;
62 | color: #ccc;
63 | }
64 | .page-body-text-small {
65 | font-size: 24rpx;
66 | color: #000;
67 | margin-bottom: 100rpx;
68 | }
69 | .page-body-form {
70 | width: 100%;
71 | background-color: #fff;
72 | display: flex;
73 | flex-direction: column;
74 | width: 100%;
75 | border: 1px solid #eee;
76 | }
77 | .page-body-form-item {
78 | display: flex;
79 | align-items: center;
80 | margin-left: 10rpx;
81 | border-bottom: 1px solid #eee;
82 | height: 80rpx;
83 | }
84 | .page-body-form-key {
85 | width: 180rpx;
86 | }
87 | .page-body-form-value {
88 | flex-grow: 1;
89 | }
90 |
91 | .page-body-form-picker {
92 | display: flex;
93 | justify-content: space-between;
94 | height: 100rpx;
95 | align-items: center;
96 | font-size: 36rpx;
97 | margin-left: 20rpx;
98 | padding-right: 20rpx;
99 | border-bottom: 1px solid #eee;
100 | }
101 | .page-body-form-picker-value {
102 | color: #ccc;
103 | }
104 |
105 | .page-body-buttons {
106 | width: 100%;
107 | }
108 | .page-body-button {
109 | margin: 25rpx;
110 | }
111 | .page-body-button image {
112 | width: 150rpx;
113 | height: 150rpx;
114 | }
115 | .page-footer {
116 | text-align: center;
117 | color: #1aad19;
118 | font-size: 24rpx;
119 | margin: 20rpx 0;
120 | }
121 |
122 | .green{
123 | color: #09BB07;
124 | }
125 | .red{
126 | color: #F76260;
127 | }
128 | .blue{
129 | color: #10AEFF;
130 | }
131 | .yellow{
132 | color: #FFBE00;
133 | }
134 | .gray{
135 | color: #C9C9C9;
136 | }
137 |
138 | .strong{
139 | font-weight: bold;
140 | }
141 |
142 | .bc_green{
143 | background-color: #09BB07;
144 | }
145 | .bc_red{
146 | background-color: #F76260;
147 | }
148 | .bc_blue{
149 | background-color: #10AEFF;
150 | }
151 | .bc_yellow{
152 | background-color: #FFBE00;
153 | }
154 | .bc_gray{
155 | background-color: #C9C9C9;
156 | }
157 |
158 | .tc{
159 | text-align: center;
160 | }
161 |
162 | .page input{
163 | padding: 10px 15px;
164 | background-color: #fff;
165 | }
166 | checkbox, radio{
167 | margin-right: 5px;
168 | }
169 |
170 | .btn-area{
171 | padding: 0 15px;
172 | }
173 | .btn-area button{
174 | margin-top: 10px;
175 | margin-bottom: 10px;
176 | }
177 |
178 | .page {
179 | min-height: 100%;
180 | flex: 1;
181 | background-color: #FBF9FE;
182 | font-size: 16px;
183 | font-family: -apple-system-font,Helvetica Neue,Helvetica,sans-serif;
184 | overflow: hidden;
185 | }
186 | .page__hd{
187 | padding: 40px;
188 | }
189 | .page__title{
190 | display: block;
191 | font-size: 20px;
192 | }
193 | .page__desc{
194 | margin-top: 5px;
195 | font-size: 14px;
196 | color: #888888;
197 | }
198 |
199 | .section{
200 | margin-bottom: 40px;
201 | }
202 | .section_gap{
203 | padding: 0 15px;
204 | }
205 | .section__title{
206 | margin-bottom: 8px;
207 | padding-left: 15px;
208 | padding-right: 15px;
209 | }
210 | .section_gap .section__title{
211 | padding-left: 0;
212 | padding-right: 0;
213 | }
214 | .section__ctn{
215 |
216 | }
217 |
--------------------------------------------------------------------------------
/config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 小程序配置文件
3 | */
4 |
5 | // var host = "apitest.ipaotui.com"
6 | var host = "api.ipaotui.com"
7 | const debug = wx.getStorageSync('debug')
8 | if (debug) {
9 | host = "apitest.ipaotui.com"
10 | }
11 |
12 | module.exports = {
13 | host,
14 | qqmapKey: 'FPOBZ-UT2K2-ZFYUC-CX67E-IOOYS-7XFQ6'
15 | }
16 |
--------------------------------------------------------------------------------
/image/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/.DS_Store
--------------------------------------------------------------------------------
/image/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/1.gif
--------------------------------------------------------------------------------
/image/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/1.jpg
--------------------------------------------------------------------------------
/image/11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/11.png
--------------------------------------------------------------------------------
/image/12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/12.png
--------------------------------------------------------------------------------
/image/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/2.jpg
--------------------------------------------------------------------------------
/image/21.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/21.png
--------------------------------------------------------------------------------
/image/22.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/22.png
--------------------------------------------------------------------------------
/image/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/3.jpg
--------------------------------------------------------------------------------
/image/31.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/31.png
--------------------------------------------------------------------------------
/image/32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/32.png
--------------------------------------------------------------------------------
/image/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/4.jpg
--------------------------------------------------------------------------------
/image/41.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/41.png
--------------------------------------------------------------------------------
/image/42.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/42.png
--------------------------------------------------------------------------------
/image/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/5.jpg
--------------------------------------------------------------------------------
/image/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/6.jpg
--------------------------------------------------------------------------------
/image/b1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/b1.jpg
--------------------------------------------------------------------------------
/image/b2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/b2.jpg
--------------------------------------------------------------------------------
/image/b3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/b3.jpg
--------------------------------------------------------------------------------
/image/bk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk.png
--------------------------------------------------------------------------------
/image/bk/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/.DS_Store
--------------------------------------------------------------------------------
/image/bk/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/banner.png
--------------------------------------------------------------------------------
/image/bk/c1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c1.png
--------------------------------------------------------------------------------
/image/bk/c10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c10.png
--------------------------------------------------------------------------------
/image/bk/c11.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c11.png
--------------------------------------------------------------------------------
/image/bk/c12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c12.png
--------------------------------------------------------------------------------
/image/bk/c13.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c13.png
--------------------------------------------------------------------------------
/image/bk/c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c2.png
--------------------------------------------------------------------------------
/image/bk/c3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c3.png
--------------------------------------------------------------------------------
/image/bk/c4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c4.png
--------------------------------------------------------------------------------
/image/bk/c5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c5.png
--------------------------------------------------------------------------------
/image/bk/c6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c6.png
--------------------------------------------------------------------------------
/image/bk/c7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c7.png
--------------------------------------------------------------------------------
/image/bk/c8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c8.png
--------------------------------------------------------------------------------
/image/bk/c9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/bk/c9.png
--------------------------------------------------------------------------------
/image/c1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/c1.png
--------------------------------------------------------------------------------
/image/c2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/c2.png
--------------------------------------------------------------------------------
/image/c3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/c3.png
--------------------------------------------------------------------------------
/image/c4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/c4.png
--------------------------------------------------------------------------------
/image/cart1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cart1.png
--------------------------------------------------------------------------------
/image/cart2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cart2.png
--------------------------------------------------------------------------------
/image/category/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/1.png
--------------------------------------------------------------------------------
/image/category/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/2.png
--------------------------------------------------------------------------------
/image/category/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/3.png
--------------------------------------------------------------------------------
/image/category/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/4.png
--------------------------------------------------------------------------------
/image/category/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/5.png
--------------------------------------------------------------------------------
/image/category/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/6.png
--------------------------------------------------------------------------------
/image/category/7.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/7.png
--------------------------------------------------------------------------------
/image/category/8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/category/8.png
--------------------------------------------------------------------------------
/image/cx/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cx/.DS_Store
--------------------------------------------------------------------------------
/image/cx/banner.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cx/banner.jpeg
--------------------------------------------------------------------------------
/image/cx/c1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cx/c1.jpeg
--------------------------------------------------------------------------------
/image/cx/c2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cx/c2.jpeg
--------------------------------------------------------------------------------
/image/cx/c3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/cx/c3.jpeg
--------------------------------------------------------------------------------
/image/dj.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/dj.jpg
--------------------------------------------------------------------------------
/image/goods1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/goods1.png
--------------------------------------------------------------------------------
/image/hdl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/hdl.png
--------------------------------------------------------------------------------
/image/hdl/banner.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/hdl/banner.jpeg
--------------------------------------------------------------------------------
/image/hdl/c1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/hdl/c1.jpeg
--------------------------------------------------------------------------------
/image/hdl/c2.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/hdl/c2.jpeg
--------------------------------------------------------------------------------
/image/hdl/c3.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/hdl/c3.jpeg
--------------------------------------------------------------------------------
/image/icon/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/.DS_Store
--------------------------------------------------------------------------------
/image/icon/recommend.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/recommend.png
--------------------------------------------------------------------------------
/image/icon/准.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/准.png
--------------------------------------------------------------------------------
/image/icon/减.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/减.png
--------------------------------------------------------------------------------
/image/icon/折.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/折.png
--------------------------------------------------------------------------------
/image/icon/特.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/特.png
--------------------------------------------------------------------------------
/image/icon/票.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/票.png
--------------------------------------------------------------------------------
/image/icon/赠.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/赠.png
--------------------------------------------------------------------------------
/image/icon/返.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon/返.png
--------------------------------------------------------------------------------
/image/icon3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/icon3.png
--------------------------------------------------------------------------------
/image/list1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/list1.png
--------------------------------------------------------------------------------
/image/ry.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ry.png
--------------------------------------------------------------------------------
/image/ry/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ry/.DS_Store
--------------------------------------------------------------------------------
/image/ry/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ry/banner.jpg
--------------------------------------------------------------------------------
/image/ry/c1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ry/c1.jpg
--------------------------------------------------------------------------------
/image/ry/c2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ry/c2.jpg
--------------------------------------------------------------------------------
/image/ry/c3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ry/c3.jpg
--------------------------------------------------------------------------------
/image/s4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/s4.png
--------------------------------------------------------------------------------
/image/s6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/s6.png
--------------------------------------------------------------------------------
/image/xyx.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/xyx.jpg
--------------------------------------------------------------------------------
/image/ycyk/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ycyk/.DS_Store
--------------------------------------------------------------------------------
/image/ycyk/banner.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ycyk/banner.jpg
--------------------------------------------------------------------------------
/image/ycyk/c1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ycyk/c1.jpg
--------------------------------------------------------------------------------
/image/ycyk/c2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ycyk/c2.jpg
--------------------------------------------------------------------------------
/image/ycyk/c3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ycyk/c3.jpg
--------------------------------------------------------------------------------
/image/ye.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/image/ye.png
--------------------------------------------------------------------------------
/page/common/common.wxss:
--------------------------------------------------------------------------------
1 | page{
2 | background-color: #ffffff;
3 | font-family: "Helvetica Neue","Hiragino Sans GB","Microsoft YaHei","\9ED1\4F53",Arial,sans-serif;
4 | font-size: 32rpx;
5 | }
6 | .navigator-hover{
7 | background: none;
8 | }
--------------------------------------------------------------------------------
/page/common/shop.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | 休息中
8 |
9 |
10 | {{seller_name}}
11 |
12 |
13 |
14 |
15 |
16 | 月售 {{sales}} 单
17 |
18 |
19 |
20 |
21 | 起送 ¥{{min_price}}
22 |
23 | {{distanceFormat}}km |
24 | {{reach_time}}分钟
25 |
26 |
27 |
28 |
29 |
30 | {{item.info}}
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 | {{seller_name}}
41 |
42 |
43 |
44 |
45 |
46 | 月售 {{sales}} 单
47 |
48 |
49 |
50 |
51 | 起送 ¥{{min_price}}
52 |
53 | {{distanceFormat}}km |
54 | {{reach_time}}分钟
55 |
56 |
57 |
58 |
59 |
60 | {{item.info}}
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/page/common/shop.wxss:
--------------------------------------------------------------------------------
1 | @import 'star-rate.wxss';
2 |
3 | .weui-media-box__hd {
4 | position: relative;
5 | }
6 |
7 | .shop__rest {
8 | position: absolute;
9 | bottom: 0;
10 | left: 0;
11 | width: 100%;
12 | line-height: 1.5;
13 | color: #fff;
14 | font-size: 0.8em;
15 | background-color: #999;
16 | }
17 |
18 | .shop__item {
19 | align-items: flex-start;
20 | background-color: #fff;
21 | }
22 |
23 | .shop__sales {
24 | display: flex;
25 | align-items: center;
26 | color: #000;
27 | }
28 |
29 | .shop__star {
30 | margin-right: 5px;
31 | }
32 |
33 |
34 |
35 | .shop__misc {
36 | margin-top: 5px;
37 | }
38 |
39 | .shop__promotion {
40 | margin-top: 5px;
41 | font-size: 13px;
42 | color: #999;
43 | border-top: 1rpx dashed #E5E5E5;
44 | }
45 |
46 | .shop__promotion-item {
47 | margin-top: 5px;
48 | white-space: nowrap;
49 | overflow: hidden;
50 | text-overflow: ellipsis;
51 | }
52 |
53 | .shop__promotion-icon {
54 | margin-top: -2px;
55 | width: 18px;
56 | height: 18px;
57 | vertical-align: middle;
58 | }
--------------------------------------------------------------------------------
/page/common/star-rate.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | ★
4 |
5 |
--------------------------------------------------------------------------------
/page/common/star-rate.wxss:
--------------------------------------------------------------------------------
1 | .star-rate {
2 | display: flex;
3 | font-size: 14px;
4 | color: #999;
5 | }
6 |
7 | .star-rate_mini {
8 | font-size: 0.8em;
9 | }
10 |
11 | .star-rate__item_active {
12 | color: #ffd700;
13 | }
--------------------------------------------------------------------------------
/page/component/address/address.js:
--------------------------------------------------------------------------------
1 | // page/component/new-pages/user/address/address.js
2 | Page({
3 | data:{
4 | address:{
5 | name:'',
6 | phone:'',
7 | detail:''
8 | }
9 | },
10 | onLoad(){
11 | var self = this;
12 |
13 | wx.getStorage({
14 | key: 'address',
15 | success: function(res){
16 | self.setData({
17 | address : res.data
18 | })
19 | }
20 | })
21 | },
22 | formSubmit(e){
23 | const value = e.detail.value;
24 | if (value.name && value.phone && value.detail){
25 | wx.setStorage({
26 | key: 'address',
27 | data: value,
28 | success(){
29 | wx.navigateBack();
30 | }
31 | })
32 | }else{
33 | wx.showModal({
34 | title:'提示',
35 | content:'请填写完整资料',
36 | showCancel:false
37 | })
38 | }
39 | }
40 | })
--------------------------------------------------------------------------------
/page/component/address/address.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "地址管理",
3 | "enablePullDownRefresh": false
4 | }
--------------------------------------------------------------------------------
/page/component/address/address.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/page/component/address/address.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | .form-box{
4 | padding-left: 30rpx;
5 | }
6 | .form-box input{
7 | height: 90rpx;
8 | border-bottom: 1rpx solid #ededed;
9 | color: #999;
10 | }
11 | .form-box .input-placeholder{
12 | color: #aaa;
13 | }
14 | .form-box button{
15 | margin:30rpx 30rpx 0 0;
16 | }
--------------------------------------------------------------------------------
/page/component/cart/cart.js:
--------------------------------------------------------------------------------
1 | // page/component/new-pages/cart/cart.js
2 | Page({
3 | data: {
4 | carts:[], // 购物车列表
5 | hasList:false, // 列表是否有数据
6 | totalPrice:0, // 总价,初始为0
7 | selectAllStatus:true, // 全选状态,默认全选
8 | obj:{
9 | name:"hello"
10 | }
11 | },
12 | onShow() {
13 | console.log('cart_onshow')
14 | let _this = this
15 | wx.getStorage({
16 | key: 'card',
17 | success: function (res) {
18 | _this.setData({
19 | hasList: true,
20 | carts: res.data
21 | })
22 | _this.getTotalPrice();
23 | },
24 | })
25 |
26 | },
27 | /**
28 | * 当前商品选中事件
29 | */
30 | selectList(e) {
31 | const index = e.currentTarget.dataset.index;
32 | let carts = this.data.carts;
33 | const selected = carts[index].selected;
34 | carts[index].selected = !selected;
35 | this.setData({
36 | carts: carts
37 | });
38 | this.getTotalPrice();
39 | },
40 |
41 | /**
42 | * 删除购物车当前商品
43 | */
44 | deleteList(e) {
45 | const index = e.currentTarget.dataset.index;
46 | let carts = this.data.carts;
47 | carts.splice(index,1);
48 | this.setData({
49 | carts: carts
50 | });
51 | if(!carts.length){
52 | this.setData({
53 | hasList: false
54 | });
55 | }else{
56 | this.getTotalPrice();
57 | }
58 | },
59 |
60 | /**
61 | * 购物车全选事件
62 | */
63 | selectAll(e) {
64 | let selectAllStatus = this.data.selectAllStatus;
65 | selectAllStatus = !selectAllStatus;
66 | let carts = this.data.carts;
67 |
68 | for (let i = 0; i < carts.length; i++) {
69 | carts[i].selected = selectAllStatus;
70 | }
71 | this.setData({
72 | selectAllStatus: selectAllStatus,
73 | carts: carts
74 | });
75 | this.getTotalPrice();
76 | },
77 |
78 | /**
79 | * 绑定加数量事件
80 | */
81 | addCount(e) {
82 | const index = e.currentTarget.dataset.index;
83 | let carts = this.data.carts;
84 | let num = carts[index].num;
85 | num = num + 1;
86 | carts[index].num = num;
87 | this.setData({
88 | carts: carts
89 | });
90 | this.getTotalPrice();
91 | },
92 |
93 | /**
94 | * 绑定减数量事件
95 | */
96 | minusCount(e) {
97 | const index = e.currentTarget.dataset.index;
98 | const obj = e.currentTarget.dataset.obj;
99 | let carts = this.data.carts;
100 | let num = carts[index].num;
101 | if(num <= 1){
102 | return false;
103 | }
104 | num = num - 1;
105 | carts[index].num = num;
106 | this.setData({
107 | carts: carts
108 | });
109 | this.getTotalPrice();
110 | },
111 |
112 | /**
113 | * 计算总价
114 | */
115 | getTotalPrice() {
116 | let carts = this.data.carts; // 获取购物车列表
117 | let total = 0;
118 | for(let i = 0; i
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{item.title}}
9 | ¥{{item.price}}
10 |
11 | -
12 | {{item.num}}
13 | +
14 |
15 | ×
16 |
17 |
18 |
19 |
28 |
29 |
30 | 购物车是空的哦~
31 |
32 |
--------------------------------------------------------------------------------
/page/component/cart/cart.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | .cart-box{
4 | padding-bottom: 100rpx;
5 | }
6 | .cart-list{
7 | position: relative;
8 | padding: 20rpx 20rpx 20rpx 285rpx;
9 | height: 185rpx;
10 | border-bottom: 1rpx solid #e9e9e9;
11 | }
12 | .cart-list .cart-pro-select{
13 | position: absolute;
14 | left: 20rpx;
15 | top: 90rpx;
16 | width: 45rpx;
17 | height: 45rpx;
18 | }
19 |
20 | .cart-list .cart-thumb{
21 | position: absolute;
22 | top: 20rpx;
23 | left: 85rpx;
24 | width: 185rpx;
25 | height: 185rpx;
26 | }
27 | .cart-list .cart-pro-name{
28 | display: inline-block;
29 | width: 300rpx;
30 | height: 105rpx;
31 | line-height: 50rpx;
32 | overflow: hidden;
33 | }
34 | .cart-list .cart-pro-price{
35 | display: inline-block;
36 | float: right;
37 | height: 105rpx;
38 | line-height: 50rpx;
39 | }
40 | .cart-list .cart-count-box{
41 | position: absolute;
42 | left: 285;
43 | bottom: 20rpx;
44 | width: 250rpx;
45 | height: 80rpx;
46 | }
47 | .cart-list .cart-count-box text{
48 | display: inline-block;
49 | line-height: 80rpx;
50 | text-align: center;
51 | }
52 | .cart-count-down,.cart-count-add{
53 | font-size: 44rpx;
54 | width: 50rpx;
55 | height: 100%;
56 | }
57 | .cart-count-num{
58 | width: 150rpx;
59 | }
60 | .cart-del{
61 | position: absolute;
62 | right: 20rpx;
63 | bottom: 20rpx;
64 | width: 80rpx;
65 | height: 80rpx;
66 | line-height: 80rpx;
67 | text-align: center;
68 | font-size: 44rpx;
69 | }
70 | .cart-footer{
71 | position: fixed;
72 | bottom: 0;
73 | left: 0;
74 | width: 100%;
75 | height: 90rpx;
76 | line-height: 90rpx;
77 | padding:0 100rpx 0 80rpx;
78 | box-sizing: border-box;
79 | background: #AB956D;
80 | color: #fff;
81 | }
82 | .total-select{
83 | position: absolute;
84 | left: 20rpx;
85 | top: 25rpx;
86 | width: 45rpx;
87 | height: 45rpx;
88 | }
89 | .order-icon{
90 | position: absolute;
91 | right: 40rpx;
92 | top: 25rpx;
93 | width: 45rpx;
94 | height: 45rpx;
95 | }
96 | .order-icon image,.order-icon navigator{
97 | display: block;
98 | width: 45rpx;
99 | height: 45rpx;
100 | }
101 | .cart-toatl-price{
102 | float: right;
103 | width: 120rpx;
104 | }
105 |
106 | .cart-no-data{
107 | padding:40rpx 0;
108 | color: #999;
109 | text-align: center;
110 | }
--------------------------------------------------------------------------------
/page/component/category/category.js:
--------------------------------------------------------------------------------
1 | Page({
2 | data: {
3 |
4 | detail:[],
5 | curIndex: 0,
6 | isScroll: false,
7 | toView: 'guowei'
8 | },
9 | onLoad: function (options) {
10 | // 判断进入路由参数,进行相应路由渲染
11 | if (options.d === 'bk') {
12 | console.log('汉堡王')
13 | this.setData({
14 | category: [
15 | { name: '汉堡', id: 'hanbao' },
16 | { name: '套餐', id: 'taocan' },
17 | { name: '早餐', id: 'zaocan' },
18 | { name: '小食', id: 'xiaoshi' },
19 | { name: '甜点', id: 'tiandian' },
20 | { name: '饮料', id: 'yinliao' }
21 | ],
22 | detail: [
23 | {
24 | id: "hanbao",
25 | banner: '../../../image/bk/banner.png',
26 | cate: '汉堡',
27 | detail: [
28 | {
29 | id: 'bk1',
30 | thumb: "../../../image/bk/c1.png",
31 | name: "安格斯厚牛堡",
32 | price: 20,
33 | stock: '有货',
34 | detail: '这里是安格斯厚牛堡详情。',
35 | parameter: 'test',
36 | service: '不支持退货'
37 | },
38 | {
39 | id: 'bk2',
40 | thumb: "../../../image/bk/c2.png",
41 | name: "德州熏厚牛堡",
42 | price: 25,
43 | stock: '有货',
44 | detail: '这里是德州熏厚牛堡详情。',
45 | parameter: 'test',
46 | service: '不支持退货'
47 | },
48 | {
49 | id: 'bk3',
50 | thumb: "../../../image/bk/c3.png",
51 | name: "王堡",
52 | price: 25,
53 | stock: '有货',
54 | detail: '这里是王堡详情。',
55 | parameter: 'test',
56 | service: '不支持退货'
57 |
58 | }
59 | ]
60 | },
61 | {
62 | id: "taocan",
63 | banner: '../../../image/bk/banner.png',
64 | cate: '套餐',
65 | detail: [
66 | {
67 | id: 'bk4',
68 | thumb: "../../../image/bk/c4.png",
69 | name: "小霸王套餐",
70 | price: 45,
71 | stock: '有货',
72 | detail: '这里是王堡详情。',
73 | parameter: 'test',
74 | service: '不支持退货'
75 | },
76 | {
77 | id: 'bk5',
78 | thumb: "../../../image/bk/c5.png",
79 | name: "美式鸡排套餐",
80 | price: 55,
81 | stock: '有货',
82 | detail: '这里是美式鸡排套餐详情。',
83 | parameter: 'test',
84 | service: '不支持退货'
85 | },
86 | {
87 | id: 'bk6',
88 | thumb: "../../../image/bk/c6.png",
89 | name: "鸡腿堡套餐",
90 | price: 35,
91 | stock: '有货',
92 | detail: '这里是王堡详情。',
93 | parameter: 'test',
94 | service: '不支持退货'
95 | }
96 | ]
97 | },
98 | {
99 | id: "zaocan",
100 | banner: '../../../image/bk/banner.png',
101 | cate: '早餐',
102 | detail: [
103 | {
104 | id: 'bk7',
105 | thumb: "../../../image/bk/c7.png",
106 | name: "猪肉可颂",
107 | price: 8,
108 | stock: '有货',
109 | detail: '这里是猪肉可颂详情。',
110 | parameter: 'test',
111 | service: '不支持退货'
112 |
113 | },
114 | {
115 | id: 'bk8',
116 | thumb: "../../../image/bk/c8.png",
117 | name: "蛋包芝士可颂",
118 | price: 10,
119 | stock: '有货',
120 | detail: '这里是蛋包芝士可颂详情。',
121 | parameter: 'test',
122 | service: '不支持退货'
123 |
124 | },
125 | {
126 | id: 'bk9',
127 | thumb: "../../../image/bk/c9.png",
128 | name: "培根蛋包卷",
129 | price: 7,
130 | stock: '有货',
131 | detail: '这里是培根蛋包卷详情。',
132 | parameter: 'test',
133 | service: '不支持退货'
134 |
135 | },
136 | {
137 | id: 'bk10',
138 | thumb: "../../../image/bk/c10.png",
139 | name: "猪肉蛋包卷",
140 | price: 6,
141 | stock: '有货',
142 | detail: '这里是猪肉蛋包卷详情。',
143 | parameter: 'test',
144 | service: '不支持退货'
145 |
146 | }
147 | ]
148 | },
149 | {
150 | id: "xiaoshi",
151 | banner: '../../../image/bk/banner.png',
152 | cate: '小食',
153 | detail: [
154 | {
155 | id: 'bk11',
156 | thumb: "../../../image/bk/c11.png",
157 | name: "霸王鸡条",
158 | price: 15,
159 | stock: '有货',
160 | detail: '这里是霸王鸡条详情。',
161 | parameter: 'test',
162 | service: '不支持退货'
163 | },
164 |
165 | ]
166 | },
167 | {
168 | id: "tiandian",
169 | banner: '../../../image/bk/banner.png',
170 | cate: '甜点',
171 | detail: [
172 | {
173 | id: 'bk12',
174 | thumb: "../../../image/bk/c12.png",
175 | name: "火炬冰淇淋",
176 | price: 5,
177 | stock: '有货',
178 | detail: '这里是火炬冰淇淋详情。',
179 | parameter: 'test',
180 | service: '不支持退货'
181 | },
182 |
183 | ]
184 | },
185 | {
186 | id: "yinliao",
187 | banner: '../../../image/bk/banner.png',
188 | cate: '饮料',
189 | detail: [
190 | {
191 | id: 'bk13',
192 | thumb: "../../../image/bk/c13.png",
193 | name: "纯果乐果汁",
194 | price: 15,
195 | stock: '有货',
196 | detail: '这里是纯果乐果汁详情。',
197 | parameter: 'test',
198 | service: '不支持退货'
199 | },
200 |
201 | ]
202 | },
203 | ]
204 | })
205 | } else if (options.d === 'ycyk') {
206 | console.log('优城悦客')
207 | this.setData({
208 | category: [
209 | { name: '经典扒餐', id: 'guowei' },
210 | { name: '布丁松饼', id: 'shucai' },
211 | { name: '意式咖啡', id: 'chaohuo' },
212 | { name: '私房小菜', id: 'danfan' }
213 | ]
214 | })
215 | } else if (options.d === 'dj') {
216 | this.setData({
217 | category: [
218 | { name: '点心', id: 'dianxin' },
219 | { name: '粥类', id: 'zoulei' },
220 | { name: '炖汤', id: 'duntang' },
221 | { name: '炒点', id: 'chaodian' },
222 | ]
223 | })
224 | console.log('笃记')
225 | } else if (options.d === 'xyx') {
226 | console.log('鲜芋仙')
227 | this.setData({
228 | category: [
229 | { name: '鲜芋仙', id: 'xianyuxian' },
230 | { name: '冰类', id: 'binglei' },
231 | { name: '饮品', id: 'yingpin' },
232 | ]
233 | })
234 | } else if (options.d === 'hdl') {
235 | console.log('海底捞')
236 | this.setData({
237 | category: [
238 | { name: '汤底', id: 'guodi' },
239 | { name: '特色菜品', id: 'teshecaipin' },
240 | { name: '海鲜', id: 'haixian' },
241 | { name: '豆面制品', id: 'doumianzhipin' },
242 | { name: '叶菜类', id: 'yecailei' },
243 | ]
244 | })
245 | } else {
246 | this.setData({
247 | category: [
248 | { name: '汤底', id: 'guodi' },
249 | { name: '特色菜品', id: 'teshecaipin' },
250 | { name: '海鲜', id: 'haixian' },
251 | { name: '豆面制品', id: 'doumianzhipin' },
252 | { name: '叶菜类', id: 'yecailei' },
253 | ]
254 | })
255 | }
256 | // 页面初始化 options为页面跳转所带来的参数
257 | },
258 | onReady(){
259 | // var self = this;
260 | // wx.request({
261 | // url:'http://www.gdfengshuo.com/api/wx/cate-detail.txt',
262 | // success(res){
263 | // self.setData({
264 | // detail : res.data
265 | // })
266 | // }
267 | // });
268 |
269 | },
270 | switchTab(e){
271 | const self = this;
272 | this.setData({
273 | isScroll: true
274 | })
275 | setTimeout(function(){
276 | self.setData({
277 | toView: e.target.dataset.id,
278 | curIndex: e.target.dataset.index
279 | })
280 | },0)
281 | setTimeout(function () {
282 | self.setData({
283 | isScroll: false
284 | })
285 | },1)
286 |
287 | },
288 | redTo: function(e) {
289 | // 获取物品详细信息
290 | let shopdetail = e.currentTarget.dataset.value
291 | // 将json对象转化为string 以url get的方式传送数据
292 | shopdetail = JSON.stringify(shopdetail)
293 | // 页面跳转
294 | wx.navigateTo({
295 | url: '../details/details?d=' + shopdetail
296 | })
297 | }
298 |
299 | })
--------------------------------------------------------------------------------
/page/component/category/category.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "分类",
3 | "backgroundColor": "#eeeeee",
4 | "enablePullDownRefresh": false
5 | }
--------------------------------------------------------------------------------
/page/component/category/category.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{item.name}}
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | {{item.cate}}
16 |
17 |
18 |
19 |
20 |
21 | {{val.name}}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/page/component/category/category.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | page,.main{
4 | height: 100%;
5 | }
6 | .categroy-left{
7 | float: left;
8 | width: 150rpx;
9 | height: 100%;
10 | border-right: 1px solid #ddd;
11 | box-sizing: border-box;
12 | }
13 | .categroy-left .cate-list{
14 | height: 90rpx;
15 | line-height: 90rpx;
16 | text-align: center;
17 | border-left: 3px solid #fff;
18 | }
19 | .categroy-left .cate-list.on{
20 | color: #AB956D;
21 | border-color: #AB956D;
22 | }
23 | .categroy-right{
24 | float: right;
25 | width: 600rpx;
26 | height: 100%;
27 | overflow: hidden;
28 |
29 | }
30 | .cate-box{
31 | height: 100%;
32 | padding:40rpx;
33 | box-sizing: border-box;
34 | }
35 | .cate-box .cate-banner image{
36 | display: block;
37 | width: 100%;
38 | height: 190rpx;
39 | }
40 | .cate-title{
41 | position: relative;
42 | height: 30rpx;
43 | line-height: 30rpx;
44 | padding:30rpx 0 55rpx;
45 | text-align: center;
46 | color: #AB956D;
47 | font-size: 28rpx;
48 | }
49 | .cate-title::before{
50 | position: absolute;
51 | left: 130rpx;
52 | top: 43rpx;
53 | content: '';
54 | width: 70rpx;
55 | height: 4rpx;
56 | background: #AB956D;
57 | }
58 | .cate-title::after{
59 | position: absolute;
60 | right: 130rpx;
61 | top: 43rpx;
62 | content: '';
63 | width: 70rpx;
64 | height: 4rpx;
65 | background: #AB956D;
66 | }
67 |
68 | .product-list{
69 | display: inline-block;
70 | width: 160rpx;
71 | height: 160rpx;
72 | text-align: center;
73 | margin:0 20rpx 20rpx 0;
74 | font-size: 24rpx;
75 | }
76 | .product-list image{
77 | width: 80rpx;
78 | height: 80rpx;
79 | margin-bottom: 20rpx;
80 | }
81 | .product-list:nth-child(3n){
82 | margin-right: 0;
83 | }
--------------------------------------------------------------------------------
/page/component/details/details.js:
--------------------------------------------------------------------------------
1 | // page/component/details/details.js
2 | Page({
3 | data:{
4 |
5 | num: 1,
6 | totalNum: 0,
7 | hasCarts: false,
8 | curIndex: 0,
9 | show: false,
10 | scaleCart: false
11 | },
12 | onLoad(option) {
13 | let detail = JSON.parse(option.d)
14 | console.log(detail)
15 | this.setData({
16 | goods: {
17 | id: 1,
18 | image: detail.thumb,
19 | title: detail.name,
20 | price: detail.price,
21 | stock: detail.stock,
22 | detail: detail.detail,
23 | parameter: detail.parameter,
24 | service: detail.service
25 | }
26 | })
27 | },
28 | // 增加数目
29 | addCount() {
30 | let num = this.data.num;
31 | num++;
32 | this.setData({
33 | num : num
34 | })
35 | },
36 | // 添加到购物车
37 | addToCart() {
38 | let _this = this
39 | console.log(this.data.goods)
40 | const self = this;
41 | const num = this.data.num;
42 | let total = this.data.totalNum;
43 | // { id: 1, title:'新鲜芹菜 半斤', image:'/image/s5.png', num:4, price:0.01, selected:true },
44 | wx.getStorage({
45 | key: 'card',
46 | success: function (res) {
47 | // 购物车有数据,重新封装数据
48 | let data = res.data
49 | data.push({
50 | id: _this.data.goods.id,
51 | title: _this.data.goods.title,
52 | image: _this.data.goods.image,
53 | num: num,
54 | price: _this.data.goods.price,
55 | selected: true
56 | })
57 | wx.setStorage({
58 | key: 'card',
59 | data: data,
60 | })
61 | // console.log(data)
62 | },
63 | fail: function() {
64 | // 购物车无数据
65 | wx.setStorage({
66 | key: "card",
67 | data: [{
68 | id: _this.data.goods.id,
69 | title: _this.data.goods.title,
70 | image: _this.data.goods.image,
71 | num: num,
72 | price: _this.data.goods.price,
73 | selected:true
74 | }]
75 | })
76 | }
77 | })
78 | self.setData({
79 | show: true
80 | })
81 | setTimeout( function() {
82 | self.setData({
83 | show: false,
84 | scaleCart : true
85 | })
86 | setTimeout( function() {
87 | self.setData({
88 | scaleCart: false,
89 | hasCarts : true,
90 | totalNum: num + total
91 | })
92 | }, 200)
93 | }, 300)
94 |
95 | },
96 |
97 | bindTap(e) {
98 | const index = parseInt(e.currentTarget.dataset.index);
99 | this.setData({
100 | curIndex: index
101 | })
102 | }
103 |
104 | })
--------------------------------------------------------------------------------
/page/component/details/details.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/page/component/details/details.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | {{totalNum}}
9 |
10 |
11 |
12 |
13 |
14 | 数量 {{num}}
15 | +
16 | 加入购物车
17 |
18 |
19 |
20 | {{goods.stock}}
21 | {{goods.title}}
22 | ¥ {{goods.price}}
23 |
24 |
25 | 商品详情
26 | 产品参数
27 | 售后保障
28 |
29 | {{goods.detail}}
30 | {{goods.parameter}}
31 | {{goods.service}}
32 |
33 |
34 |
--------------------------------------------------------------------------------
/page/component/details/details.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | .goods-box{
4 | position: relative;
5 | padding: 40rpx 45rpx;
6 | text-align: center;
7 | color: #454552;
8 | border-bottom: 30rpx solid #ededed;
9 | }
10 | .goods-box .goods-thumb{
11 | width: 300rpx;
12 | height: 300rpx;
13 | margin: 35rpx 0 125rpx;
14 | }
15 |
16 | .to-carts-icon{
17 | position: absolute;
18 | right: 70rpx;
19 | top: 70rpx;
20 | width: 10rpx;
21 | height: 10rpx;
22 | border-radius: 50%;
23 | opacity: .6;
24 | -webkit-animation: to_cart .3s ease-out;
25 | animation: to_cart .3s ease-out;
26 | }
27 | @-webkit-keyframes to_cart {
28 | 0%{
29 | right:100rpx;
30 | top:530rpx;
31 | -webkit-transform: scale(4);
32 | }
33 | /*60%{
34 | top: 20rpx;
35 | }*/
36 | }
37 | @keyframes to_cart {
38 | 0%{
39 | right:100rpx;
40 | top:530rpx;
41 | transform: scale(4);
42 | }
43 | /*60%{
44 | top: 20rpx;
45 | }*/
46 | }
47 | .carts-icon{
48 | position: absolute;
49 | right: 40rpx;
50 | top: 40rpx;
51 | width: 75rpx;
52 | height: 75rpx;
53 | }
54 | .carts-icon image{
55 | width: 100%;
56 | height: 100%;
57 | }
58 | .carts-icon.on{
59 | -webkit-animation: to_cart_scale .3s ease;
60 | animation: to_cart_scale .3s ease;
61 | }
62 | @-webkit-keyframes to_cart_scale {
63 | 50%{
64 | -webkit-transform: scale(1.2);
65 | }
66 | }
67 | @keyframes to_cart_scale {
68 | 50%{
69 | transform: scale(1.2);
70 | }
71 | }
72 | .carts-icon-num{
73 | position: absolute;
74 | left: -15rpx;
75 | width: 40rpx;
76 | height: 40rpx;
77 | line-height: 40rpx;
78 | border-radius: 50%;
79 | background: #AB956D;
80 | color: #fff;
81 | font-size: 24rpx;
82 | }
83 | .goods-box .goods-operation{
84 | position: relative;
85 | width: 100%;
86 | height: 100rpx;
87 | line-height: 100rpx;
88 | padding: 0 50rpx;
89 | margin-bottom: 60rpx;
90 | box-sizing: border-box;
91 | border-radius: 50rpx;
92 | background: #AB956D;
93 | color: #fff;
94 | font-size: 28rpx;
95 | }
96 | .goods-operation text{
97 | display: inline-block;
98 | height: 100rpx;
99 | }
100 | .goods-operation-num{
101 | width: 160rpx;
102 | }
103 | .goods-operation-add{
104 | width: 80rpx;
105 | margin-right: 30rpx;
106 | }
107 | .goods-to-cart{
108 | width: 210rpx;
109 | padding-right: 75rpx;
110 | }
111 | .goods-cart-img{
112 | position: absolute;
113 | right: 50rpx;
114 | top: 28rpx;
115 | width: 45rpx;
116 | height: 45rpx;
117 | }
118 |
119 | .goods-stock{
120 | font-size: 28rpx;
121 | margin-bottom: 20rpx;
122 | }
123 | .goods-title{
124 | font-size: 40rpx;
125 | margin-bottom: 30rpx;
126 | }
127 | .goods-price{
128 | font-size: 40rpx;
129 | }
130 | .goods-tab-nav{
131 | display: inline-block;
132 | width: 33.33%;
133 | height: 90rpx;
134 | line-height: 90rpx;
135 | border-bottom: 1rpx solid #ededed;
136 | box-sizing: border-box;
137 | text-align: center;
138 | color: #c7c7cb;
139 | }
140 | .goods-tab-nav.on{
141 | color: #bcaa8a;
142 | border-bottom: 5rpx solid #bcaa8a;
143 | }
144 | .goods-content{
145 | padding: 40rpx;
146 | }
--------------------------------------------------------------------------------
/page/component/index.js:
--------------------------------------------------------------------------------
1 | //获取应用实例
2 | import {
3 | getSellers
4 | } from '../utils/apis'
5 |
6 | Page({
7 | data: {
8 | imgUrls: [
9 | '/image/b1.jpg',
10 | '/image/b2.jpg',
11 | '/image/b3.jpg'
12 | ],
13 | // 分类数据
14 | category: [
15 | {
16 | "category_id": "1",
17 | "title": "本地特产",
18 | "icon": "/image/category/1.png"
19 | },
20 | {
21 | "category_id": "2",
22 | "title": "美食外卖",
23 | "icon": "/image/category/2.png"
24 | },
25 | {
26 | "category_id": "3",
27 | "title": "甜品蛋糕",
28 | "icon": "/image/category/3.png"
29 | },
30 | {
31 | "category_id": "4",
32 | "title": "果蔬生鲜",
33 | "icon": "/image/category/4.png"
34 | },
35 | {
36 | "category_id": "5",
37 | "title": "超市便利",
38 | "icon": "/image/category/5.png"
39 | },
40 | {
41 | "category_id": "6",
42 | "title": "进口产品",
43 | "icon": "/image/category/6.png"
44 | },
45 | {
46 | "category_id": "7",
47 | "title": "优惠活动",
48 | "icon": "/image/category/7.png"
49 | },
50 | {
51 | "category_id": "8",
52 | "title": "全部分类",
53 | "icon": "/image/category/8.png"
54 | }
55 | ],
56 | // 商店数据
57 | business: [
58 | {
59 | "id":'bk',
60 | "title": "汉堡王",
61 | "sellcount": 3600,
62 | "startsell": 30,
63 | "packagesell": 5,
64 | "shopimg": "../../image/bk.png",
65 | "pmin": 30,
66 | "dist": 450,
67 | "shopicon": [
68 | "../../image/icon/准.png",
69 | "../../image/icon/减.png",
70 | "../../image/icon/折.png",
71 | "../../image/icon/特.png",
72 | ]
73 | },
74 | {
75 | "id": 'ycyk',
76 | "title": "优城悦客",
77 | "sellcount": 3720,
78 | "startsell": 25,
79 | "packagesell": 0,
80 | "shopimg": "../../image/ye.png",
81 | "pmin": 23,
82 | "dist": 550,
83 | "shopicon": [
84 | "../../image/icon/折.png",
85 | "../../image/icon/特.png",
86 | ]
87 | },
88 | {
89 | "id":'hdl',
90 | "title": "海底捞",
91 | "sellcount": 12360,
92 | "startsell": 120,
93 | "packagesell": 10,
94 | "shopimg": "../../image/hdl.png",
95 | "pmin": 36,
96 | "dist": 480,
97 | "shopicon": [
98 | "../../image/icon/减.png",
99 | "../../image/icon/折.png",
100 | ]
101 | },
102 | {
103 | "id": 'dj',
104 | "title": "笃记",
105 | "sellcount": 13720,
106 | "startsell": 120,
107 | "packagesell": 0,
108 | "shopimg": "../../image/dj.jpg",
109 | "pmin": 23,
110 | "dist": 20,
111 | "shopicon": [
112 | "../../image/icon/折.png",
113 | "../../image/icon/特.png",
114 | "../../image/icon/减.png",
115 |
116 | ]
117 | },
118 | {
119 | "id": 'xyx',
120 | "title": "鲜芋仙",
121 | "sellcount": 1720,
122 | "startsell": 20,
123 | "packagesell": 0,
124 | "shopimg": "../../image/xyx.jpg",
125 | "pmin": 20,
126 | "dist": 220,
127 | "shopicon": [
128 | "../../image/icon/折.png",
129 | "../../image/icon/减.png",
130 |
131 | ]
132 | },
133 | ],
134 | indicatorDots: false,
135 | autoplay: false,
136 | interval: 3000,
137 | duration: 800,
138 | },
139 | redTo: function(e) {
140 | let shopid = e.currentTarget.dataset.shop
141 | console.log(shopid)
142 | wx.navigateTo({
143 | url: 'category/category?d='+shopid
144 | })
145 | }
146 | })
--------------------------------------------------------------------------------
/page/component/index.json:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/page/component/index.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 | {{item.title}}
19 |
20 |
21 |
22 |
23 |
24 |
25 | 猜你喜欢
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | {{item.title}}
34 | 月销{{item.sellcount}}笔
35 | 起送¥{{item.startsell}}|配送¥{{item.packagesell}} {{item.pmin}}分钟|{{item.dist}}米
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/page/component/index.wxss:
--------------------------------------------------------------------------------
1 | @import '../common/common.wxss';
2 | swiper {
3 | height: 361.5rpx;
4 | }
5 | swiper-item image {
6 | width: 100%;
7 | height: 100%;
8 | }
9 |
10 | .category {
11 | padding: 0 10px 10px;
12 | font-size: 14px;
13 | text-align: center;
14 | background-color: #fff;
15 | overflow: hidden;
16 | }
17 |
18 | .category__item {
19 | float: left;
20 | margin-top: 10px;
21 | width: 25%;
22 | }
23 |
24 | .category__icon {
25 | height: 36px;
26 | width: 36px;
27 | }
28 |
29 | .shop-title {
30 | display: flex;
31 | justify-content: flex-start;
32 | margin: 10rpx 0 10rpx 0;
33 | border-bottom: 1rpx solid #eee;
34 | border-top: 1rpx solid #eee;
35 | padding-top:15rpx;
36 | padding-bottom:5rpx;
37 | font-size: 30rpx;
38 | }
39 | .shop-title image {
40 | margin-left: 20rpx;
41 | margin-right: 20rpx;
42 | width: 34rpx;
43 | height: 34rpx
44 | }
45 |
46 | .shop {
47 | display: flex;
48 | justify-content: space-between;
49 | margin-bottom: 25rpx;
50 | margin-top: 10rpx;
51 | border-bottom: 1rpx solid #eee;
52 | }
53 | .shop-image {
54 | flex: 1;
55 | display: flex;
56 | justify-content: center;
57 |
58 | }
59 | .shop-image image {
60 | width: 195rpx;
61 | height: 145rpx;
62 | }
63 | .right {
64 | flex: 2;
65 | padding-right: 30rpx;
66 | }
67 | .right .title {
68 | font-size: 32rpx;
69 | }
70 | .right .sell-count {
71 | font-size: 22rpx;
72 | color: #999;
73 | display: flex;
74 | justify-content: flex-end;
75 | margin: 15rpx 0 20rpx 0
76 | }
77 | .right .detail {
78 | font-size: 28rpx;
79 | font-weight: 200;
80 | color: #666;
81 | padding-bottom: 5rpx;
82 | border-bottom: 1rpx dashed #999
83 | }
84 | .detail .space{
85 | margin-left: 60rpx;
86 | }
87 | .icon {
88 | flex-direction: column;
89 | margin-top: 8rpx;
90 | }
91 | .icon image {
92 | margin: 0 2rpx 0 2rpx;
93 | width: 35rpx;
94 | height: 35rpx;
95 | }
96 |
--------------------------------------------------------------------------------
/page/component/list/list.js:
--------------------------------------------------------------------------------
1 | // page/component/list/list.js
2 | Page({
3 | data:{
4 |
5 | },
6 | onLoad:function(options){
7 | // 判断进入路由参数,进行相应路由渲染
8 | if (options.d === 'sx') {
9 | console.log('沙县')
10 | this.setData({
11 | banner: '/image/cx/banner.jpeg',
12 | c1: '/image/cx/c1.jpeg',
13 | c1t: '蒸饺',
14 | c1p: 3,
15 | c2: '/image/cx/c2.jpeg',
16 | c2t: '拌面',
17 | c2p: 4,
18 | c3: '/image/cx/c3.jpeg',
19 | c3t: '鸡腿饭',
20 | c3p: 15
21 | })
22 | } else if (options.d === 'ycyk') {
23 | console.log('优城悦客')
24 | this.setData({
25 | banner: '/image/ycyk/banner.jpg',
26 | c1: '/image/ycyk/c1.jpg',
27 | c1t: '牛柳意面',
28 | c1p: 32,
29 | c2: '/image/ycyk/c2.jpg',
30 | c2t: '特级牛肉',
31 | c2p: 48,
32 | c3: '/image/ycyk/c3.jpg',
33 | c3t: '鸡翅',
34 | c3p: 10
35 | })
36 | } else if (options.d === 'bk') {
37 | this.setData({
38 | banner: '/image/bk/banner.png',
39 | c1: '/image/bk/c1.png',
40 | c1t: '安格斯厚牛堡原味/天椒',
41 | c1p: 12,
42 | c2: '/image/bk/c2.png',
43 | c2t: '德州烟熏安格斯厚牛堡',
44 | c2p: 15,
45 | c3: '/image/bk/c3.png',
46 | c3t: '皇堡/天椒皇堡',
47 | c3p: 18
48 | })
49 | console.log('bk')
50 | } else if (options.d === 'ry') {
51 | console.log('如意馄饨')
52 | this.setData({
53 | banner: '/image/ry/banner.jpg',
54 | c1: '/image/ry/c1.jpg',
55 | c1t: '干香红椒馄饨',
56 | c1p: 13,
57 | c2: '/image/ry/c2.jpg',
58 | c2t: '金牌虾仁馄饨',
59 | c2p: 14,
60 | c3: '/image/ry/c3.jpg',
61 | c3t: '馄饨生煎',
62 | c3p: 20,
63 | })
64 | } else if (options.d === 'hdl') {
65 | console.log('海底捞')
66 | this.setData({
67 | banner: '/image/hdl/banner.jpeg',
68 | c1: '/image/hdl/c1.jpeg',
69 | c1t: '鱿鱼须',
70 | c1p: 15,
71 | c2: '/image/hdl/c2.jpeg',
72 | c2t: '墨鱼仔',
73 | c2p: 25,
74 | c3: '/image/hdl/c3.jpeg',
75 | c3t: '泥鳅',
76 | c3p: 35,
77 | })
78 | }
79 | // 页面初始化 options为页面跳转所带来的参数
80 | },
81 | onReady:function(){
82 | // 页面渲染完成
83 | },
84 | onShow:function(){
85 | // 页面显示
86 | },
87 | onHide:function(){
88 | // 页面隐藏
89 | },
90 | onUnload:function(){
91 | // 页面关闭
92 | }
93 | })
--------------------------------------------------------------------------------
/page/component/list/list.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "商品"
3 | }
--------------------------------------------------------------------------------
/page/component/list/list.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | {{c1t}}
11 | ¥ {{c1p}}
12 |
13 |
14 |
15 |
16 |
17 | {{c2t}}
18 | ¥ {{c2p}}
19 |
20 |
21 |
22 |
23 |
24 | {{c3t}}
25 | ¥ {{c3p}}
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/page/component/list/list.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | .banner image{
4 | width: 100%;
5 | height: 400rpx;
6 | }
7 | .list-box{
8 | padding: 30rpx 20rpx;
9 | }
10 | .newest-list{
11 | display: inline-block;
12 | width: 347rpx;
13 | height: 347rpx;
14 | margin:0 15rpx 10rpx 0;
15 | border-radius: 10px;
16 | text-align: center;
17 | background: #f5f6f5;
18 | }
19 | .newest-list:nth-child(2n){
20 | margin-right: 0;
21 | }
22 | .newest-list image{
23 | width: 180rpx;
24 | height: 180rpx;
25 | margin: 30rpx 0 20rpx;
26 | }
27 | .newest-list .newest-text{
28 | font-size: 32rpx;
29 | line-height: 45rpx;
30 | }
--------------------------------------------------------------------------------
/page/component/orders/orders.js:
--------------------------------------------------------------------------------
1 | // page/component/orders/orders.js
2 | Page({
3 | data:{
4 | address:{},
5 | hasAddress: false,
6 | total:0,
7 | orders:[
8 | {id:1,title:'新鲜芹菜 半斤',image:'/image/s5.png',num:4,price:0.01},
9 | {id:2,title:'素米 500g',image:'/image/s6.png',num:1,price:0.03}
10 | ]
11 | },
12 |
13 | onReady() {
14 | this.getTotalPrice();
15 | },
16 |
17 | onShow:function(){
18 | const self = this;
19 | wx.getStorage({
20 | key:'address',
21 | success(res) {
22 | self.setData({
23 | address: res.data,
24 | hasAddress: true
25 | })
26 | }
27 | })
28 | },
29 |
30 | /**
31 | * 计算总价
32 | */
33 | getTotalPrice() {
34 | let orders = this.data.orders;
35 | let total = 0;
36 | for(let i = 0; i < orders.length; i++) {
37 | total += orders[i].num * orders[i].price;
38 | }
39 | this.setData({
40 | total: total
41 | })
42 | },
43 |
44 | toPay() {
45 | wx.showModal({
46 | title: '提示',
47 | content: '本系统只做演示,支付系统已屏蔽',
48 | text:'center',
49 | complete() {
50 | wx.switchTab({
51 | url: '/page/component/user/user'
52 | })
53 | }
54 | })
55 | }
56 | })
--------------------------------------------------------------------------------
/page/component/orders/orders.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "订单详情"
3 | }
--------------------------------------------------------------------------------
/page/component/orders/orders.wxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 收货人: {{address.name}}
5 | 电话: {{address.phone}}
6 | {{address.detail}}
7 |
8 | 添加收货地址
9 |
10 |
11 |
12 |
13 |
14 | {{item.title}}
15 | ¥{{item.price}}
16 | ×{{item.num}}
17 |
18 |
19 |
20 |
24 |
--------------------------------------------------------------------------------
/page/component/orders/orders.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | .orders-address{
4 | position: relative;
5 | padding: 20rpx 50rpx 20rpx 35rpx;
6 | font-size: 14px;
7 | line-height: 25px;
8 | border-bottom: 20rpx solid #ededed;
9 | color: #adadad;
10 | }
11 | .orders-address::after{
12 | position: absolute;
13 | right: 30rpx;
14 | top: 60rpx;
15 | content: '';
16 | width: 8px;
17 | height: 8px;
18 | border-top: 4rpx solid #7f7f7f;
19 | border-right: 4rpx solid #7f7f7f;
20 | -webkit-transform: rotate(45deg);
21 | transform: rotate(45deg);
22 | }
23 | .orders-address-name{
24 | display: inline-block;
25 | width: 300rpx;
26 | }
27 |
28 | .orders-no-address{
29 | position: relative;
30 | height: 90rpx;
31 | line-height: 90rpx;
32 | color: #adadad;
33 | border-bottom: 20rpx solid #ededed;
34 | text-align: center;
35 | }
36 | .orders-no-address::after{
37 | position: absolute;
38 | right: 30rpx;
39 | top: 34rpx;
40 | content: '';
41 | width: 16rpx;
42 | height: 16rpx;
43 | border-top: 4rpx solid #7f7f7f;
44 | border-right: 4rpx solid #7f7f7f;
45 | -webkit-transform: rotate(45deg);
46 | transform: rotate(45deg);
47 | }
48 |
49 | .orders-box{
50 | padding-bottom: 105rpx;
51 | }
52 | .orders-list{
53 | position: relative;
54 | padding:20rpx 20rpx 20rpx 220rpx;
55 | height: 180rpx;
56 | border-bottom: 1rpx solid #ededed;
57 | }
58 | .orders-thumb{
59 | position: absolute;
60 | top: 20rpx;
61 | left: 20rpx;
62 | width: 180rpx;
63 | height: 180rpx;
64 | }
65 | .orders-list view{
66 | line-height: 60rpx;
67 | }
68 |
69 | .orders-footer{
70 | position: fixed;
71 | bottom: 0;
72 | left: 0;
73 | width: 100%;
74 | height: 95rpx;
75 | line-height: 95rpx;
76 | border-top: 1rpx solid #ededed;
77 | }
78 | .orders-footer .orders-footer-total{
79 | display: inline-block;
80 | width: 510rpx;
81 | padding-left: 30rpx;
82 | box-sizing: border-box;
83 | color: #a55350;
84 | }
85 | .orders-footer .orders-footer-btn{
86 | display: inline-block;
87 | width: 240rpx;
88 | text-align: center;
89 | color: #fff;
90 | background: #AB956D;
91 | }
--------------------------------------------------------------------------------
/page/component/user/user.js:
--------------------------------------------------------------------------------
1 | // page/component/new-pages/user/user.js
2 | Page({
3 | data:{
4 | thumb:'',
5 | nickname:'',
6 | orders:[],
7 | hasAddress:false,
8 | address:{}
9 | },
10 | onLoad(){
11 | var self = this;
12 | /**
13 | * 获取用户信息
14 | */
15 | wx.getUserInfo({
16 | success: function(res){
17 | self.setData({
18 | thumb: res.userInfo.avatarUrl,
19 | nickname: res.userInfo.nickName
20 | })
21 | }
22 | }),
23 |
24 | /**
25 | * 发起请求获取订单列表信息
26 | */
27 | wx.request({
28 | url: 'http://www.gdfengshuo.com/api/wx/orders.txt',
29 | success(res){
30 | self.setData({
31 | orders: res.data
32 | })
33 | }
34 | })
35 | },
36 | onShow(){
37 | var self = this;
38 | /**
39 | * 获取本地缓存 地址信息
40 | */
41 | wx.getStorage({
42 | key: 'address',
43 | success: function(res){
44 | self.setData({
45 | hasAddress: true,
46 | address: res.data
47 | })
48 | }
49 | })
50 | },
51 | /**
52 | * 发起支付请求
53 | */
54 | payOrders(){
55 | wx.requestPayment({
56 | timeStamp: 'String1',
57 | nonceStr: 'String2',
58 | package: 'String3',
59 | signType: 'MD5',
60 | paySign: 'String4',
61 | success: function(res){
62 | console.log(res)
63 | },
64 | fail: function(res) {
65 | wx.showModal({
66 | title:'支付提示',
67 | content:'',
68 | showCancel: false
69 | })
70 | }
71 | })
72 | }
73 | })
--------------------------------------------------------------------------------
/page/component/user/user.json:
--------------------------------------------------------------------------------
1 | {
2 | "navigationBarTitleText": "我的"
3 | }
--------------------------------------------------------------------------------
/page/component/user/user.wxml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | 地址管理
10 |
11 |
12 | {{address.name}}
13 | {{address.phone}}
14 | {{address.detail}}
15 |
16 |
17 |
18 | 我的订单
19 |
20 | 订单编号:{{item.number}}
21 |
22 |
23 | {{item.name}}
24 | {{item.count}}
25 | {{item.status}}
26 |
27 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/page/component/user/user.wxss:
--------------------------------------------------------------------------------
1 | @import '../../common/common.wxss';
2 |
3 | .header{
4 | position: relative;
5 | height: 160rpx;
6 | line-height: 100rpx;
7 | padding:30rpx 30rpx 30rpx 150rpx;
8 | box-sizing: border-box;
9 | background: #AB956D;
10 | font-size: 28rpx;
11 | color: #fff;
12 | }
13 | .header .thumb{
14 | position: absolute;
15 | left: 30rpx;
16 | top: 30rpx;
17 | width: 100rpx;
18 | height: 100rpx;
19 | border-radius: 50%;
20 | }
21 | .header .about{
22 | float: right;
23 | }
24 |
25 | .address-box{
26 | border-bottom: 20rpx solid #ededed;
27 | color: #999;
28 | line-height: 90rpx;
29 | font-size: 28rpx;
30 | }
31 | .address-box .address-manage{
32 | position: relative;
33 | height: 90rpx;
34 | border-bottom: 1rpx solid #e9e9e9;
35 | text-align: center;
36 | }
37 | .address-box .address-manage::after{
38 | position: absolute;
39 | right: 30rpx;
40 | top: 34rpx;
41 | content: '';
42 | width: 16rpx;
43 | height: 16rpx;
44 | border-top: 4rpx solid #7f7f7f;
45 | border-right: 4rpx solid #7f7f7f;
46 | -webkit-transform: rotate(45deg);
47 | transform: rotate(45deg);
48 | }
49 | .address-box .address-list{
50 | padding-left: 30rpx;
51 | }
52 | .address-box .address-list view{
53 | height: 90rpx;
54 | border-bottom: 1rpx solid #e9e9e9;
55 | }
56 | .address-box .address-list view:last-child{
57 | border-bottom: 0;
58 | }
59 |
60 | .orders-box{
61 | color: #999;
62 | font-size: 28rpx;
63 | }
64 | .orders{
65 | height: 90rpx;
66 | line-height: 90rpx;
67 | border-bottom: 1rpx solid #e9e9e9;
68 | text-align: center;
69 | }
70 | .orders-list{
71 | padding-left: 30rpx;
72 | border-bottom: 20rpx solid #ededed;
73 | }
74 | .orders-list:last-child{
75 | border-bottom: 0;
76 | }
77 | .orders-number{
78 | height: 90rpx;
79 | line-height: 90rpx;
80 | border-bottom: 1rpx solid #e9e9e9;
81 | }
82 | .orders-detail{
83 | position: relative;
84 | height: 120rpx;
85 | padding: 35rpx 20rpx 35rpx 170rpx;
86 | border-bottom: 1rpx solid #e9e9e9;
87 | }
88 | .orders-detail image{
89 | position: absolute;
90 | left: 0;
91 | top: 20rpx;
92 | width: 150rpx;
93 | height: 150rpx;
94 | }
95 | .orders-detail view{
96 | line-height: 60rpx;
97 | }
98 | .orders-detail .orders-status{
99 | position: absolute;
100 | right: 20rpx;
101 | top: 35rpx;
102 | height: 120rpx;
103 | line-height: 120rpx;
104 | color: #b42f2d;
105 | }
106 | .orders-footer{
107 | height: 60rpx;
108 | line-height: 60rpx;
109 | color: #2f2f2f;
110 | padding:15rpx 30rpx 15rpx 0;
111 | }
112 | .orders-footer .orders-btn{
113 | float: right;
114 | width: 170rpx;
115 | height: 60rpx;
116 | line-height:60rpx;
117 | border-radius: 6rpx;
118 | background: #b42f2d;
119 | color: #fff;
120 | }
--------------------------------------------------------------------------------
/page/utils/apis.js:
--------------------------------------------------------------------------------
1 | import {
2 | fetch, coordFormat,
3 | alert, confirm,
4 | } from './util'
5 |
6 | // 获取商店列表
7 | export function getSellers(options) {
8 | var {
9 | page,
10 | success
11 | } = options
12 | page = page || 0
13 | getApp().getCurrentAddress(address => {
14 | var location = address.location
15 | fetch({
16 | url: 'index.php?m=Mall&c=Seller&a=getSellers',
17 | data: {
18 | page,
19 | city_name: address.city,
20 | city_id: address.city_id,
21 | district_name: address.district,
22 | district_id: address.district_id,
23 | longitude: location.longitude,
24 | latitude: location.latitude
25 | },
26 | success
27 | })
28 | })
29 | }
30 |
31 | // 获取商店详情
32 | export function getSellerInfo(options) {
33 | var {
34 | seller_id,
35 | success, complete
36 | } = options
37 | getApp().getCurrentAddress(address => {
38 | var location = address.location
39 | fetch({
40 | url: 'index.php?m=Mall&c=Seller&a=getSellerInfo',
41 | data: {
42 | seller_id,
43 | longitude: location.longitude,
44 | latitude: location.latitude
45 | },
46 | success, complete
47 | })
48 | })
49 | }
50 |
51 | // 获取商店评论
52 | export function getReviews(options) {
53 | var {
54 | seller_id, page,
55 | success
56 | } = options
57 | page = page || 0
58 | fetch({
59 | url: 'index.php?m=Mall&c=Seller&a=getReviews',
60 | data: {
61 | seller_id, page
62 | },
63 | success
64 | })
65 | }
66 |
67 | // 短信验证码
68 | export function getCode(options) {
69 | const {
70 | phone, success, error
71 | } = options
72 | fetch({
73 | url: "index.php?m=Api&c=Common&a=checkMSG",
74 | data: {
75 | phone,
76 | key: 'fast_login'
77 | },
78 | success, error
79 | })
80 | }
81 |
82 | // 登录
83 | export function login(options) {
84 | const {
85 | phone, code,
86 | success, error
87 | } = options
88 | wx.login({
89 | success(res) {
90 | fetch({
91 | url: 'index.php?m=Api&c=WeixinMall&a=login',
92 | data: {
93 | phone, code,
94 | wx_code: res['code'],
95 | session_3rd: wx.getStorageSync('session_3rd')
96 | },
97 | success, error
98 | })
99 | },
100 | error(res) {
101 | alert(res['errMsg'])
102 | error && error(res['errMsg'])
103 | }
104 | })
105 |
106 | }
107 | // 退出账号
108 | export function logout(options) {
109 | const {
110 | phone,
111 | success, error
112 | } = options
113 | fetch({
114 | url: 'index.php?m=Api&c=WeixinMall&a=logout',
115 | data: {
116 | phone
117 | },
118 | success, error
119 | })
120 | }
121 |
122 | // 获取登录信息
123 | export function getLoginInfo(options) {
124 | const {
125 | success, error
126 | } = options
127 | wx.login({
128 | success(res) {
129 | fetch({
130 | url: 'index.php?m=Api&c=WeixinMall&a=getLoginInfo',
131 | data: {
132 | wx_code: res['code'],
133 | session_3rd: wx.getStorageSync('session_3rd')
134 | },
135 | success, error
136 | })
137 | },
138 | error(res) {
139 | alert(res['errMsg'])
140 | error && error(res['errMsg'])
141 | }
142 | })
143 | }
144 |
145 | // 获取用户地址列表
146 | export function getUserAddrs(options) {
147 | const {
148 | success, error
149 | } = options
150 |
151 | getApp().getLoginInfo(loginInfo => {
152 | if (!loginInfo.user_info) {
153 | return alert('用户未登录')
154 | }
155 | var { user_id, user_token } = loginInfo.user_info
156 | fetch({
157 | url: 'index.php?m=Mall&c=User&a=getUserAddrs',
158 | data: {
159 | user_id, user_token
160 | },
161 | success, error
162 | })
163 |
164 | })
165 | }
166 | // 获取用户地址
167 | export function getUserAddr(options) {
168 | const {
169 | addr_id,
170 | success, error
171 | } = options
172 |
173 | getApp().getLoginInfo(loginInfo => {
174 | if (!loginInfo.user_info) {
175 | return alert('用户未登录')
176 | }
177 | var { user_id, user_token } = loginInfo.user_info
178 | fetch({
179 | url: 'index.php?m=Mall&c=User&a=getUserAddr',
180 | data: {
181 | user_id, user_token,
182 | addr_id
183 | },
184 | success, error
185 | })
186 |
187 | })
188 | }
189 |
190 | // 新增用户地址
191 | export function addUserAddr(options) {
192 | if (options.addr_id) {
193 | return updateUserAddr(options)
194 | }
195 | const {
196 | receiver, phone, detail, address,
197 | success, error
198 | } = options
199 | getApp().getLoginInfo(loginInfo => {
200 | if (!loginInfo.user_info) {
201 | return alert('用户未登录')
202 | }
203 | var { user_id, user_token } = loginInfo.user_info
204 | var gps = address.gps
205 | if (!gps) {
206 | var location = coordFormat(address.location)
207 | gps = `${location.longitude},${location.latitude}`
208 | }
209 | fetch({
210 | url: 'index.php?m=Mall&c=User&a=addUserAddr',
211 | data: {
212 | user_id, user_token,
213 | receiver, phone, detail,
214 | gps,
215 | addr: address.title,
216 | city_id: address.city_id,
217 | city_name: address.city,
218 | district_id: address.district_id,
219 | district_name: address.district,
220 | },
221 | success, error
222 | })
223 |
224 | })
225 | }
226 |
227 | // 修改地址
228 | export function updateUserAddr(options) {
229 | const {
230 | receiver, phone, detail, address,
231 | addr_id,
232 | success, error
233 | } = options
234 | getApp().getLoginInfo(loginInfo => {
235 | if (!loginInfo.user_info) {
236 | return alert('用户未登录')
237 | }
238 | var { user_id, user_token } = loginInfo.user_info
239 | var gps = address.gps
240 | if (!gps) {
241 | var location = coordFormat(address.location)
242 | gps = `${location.longitude},${location.latitude}`
243 | }
244 | fetch({
245 | url: 'index.php?m=Mall&c=User&a=updateUserAddr',
246 | data: {
247 | user_id, user_token,
248 | receiver, phone, detail,
249 | gps, addr_id,
250 | addr: address.title,
251 | city_id: address.city_id,
252 | city_name: address.city,
253 | district_id: address.district_id,
254 | district_name: address.district_name,
255 | },
256 | success, error
257 | })
258 |
259 | })
260 | }
261 |
262 | // 删除地址
263 | export function deleteUserAddr(options) {
264 | const {
265 | addr_id,
266 | success, error
267 | } = options
268 | getApp().getLoginInfo(loginInfo => {
269 | if (!loginInfo.user_info) {
270 | return alert('用户未登录')
271 | }
272 | var { user_id, user_token } = loginInfo.user_info
273 | fetch({
274 | url: 'index.php?m=Mall&c=User&a=deleteUserAddr',
275 | data: {
276 | user_id, user_token,
277 | addr_id
278 | },
279 | success, error
280 | })
281 |
282 | })
283 | }
284 |
285 | // 添加准订单
286 | export function addQuasiOrder(options) {
287 | const {
288 | seller_id,
289 | goods,
290 | success, error
291 | } = options
292 | getApp().getCurrentAddress(address => {
293 | var data = {
294 | seller_id,
295 | goods: JSON.stringify(goods)
296 | }
297 | if (address.addr_id) {
298 | data = Object.assign({
299 | addr_id: address.addr_id
300 | }, data)
301 | } else {
302 | var location = address.location
303 | data = Object.assign({
304 | city_id: address.city_id,
305 | city_name: address.city,
306 | district_id: address.district_id,
307 | district_name: address.district,
308 | longitude: location.longitude,
309 | latitude: location.latitude
310 | }, data)
311 | }
312 | getApp().getLoginInfo(loginInfo => {
313 | if (!loginInfo.user_info) {
314 | return alert('用户未登录')
315 | }
316 | var { user_id, user_token } = loginInfo.user_info
317 | fetch({
318 | url: 'index.php?m=Mall&c=Order&a=addQuasiOrder',
319 | data: Object.assign({
320 | user_id, user_token,
321 | }, data),
322 | success, error
323 | })
324 |
325 | })
326 | })
327 | }
328 |
329 | // 获取准订单
330 | export function getQuasiOrderInfo(options) {
331 | var {
332 | quasi_order_id,
333 | success, error
334 | } = options
335 | getApp().getLoginInfo(loginInfo => {
336 | if (!loginInfo.user_info) {
337 | return alert('用户未登录')
338 | }
339 | var { user_id, user_token } = loginInfo.user_info
340 | fetch({
341 | url: 'index.php?m=Mall&c=Order&a=getQuasiOrderInfo',
342 | data: {
343 | user_id, user_token,
344 | quasi_order_id
345 | },
346 | success, error
347 | })
348 |
349 | })
350 | }
351 |
352 | // 更新准订单地址
353 | export function updateOrderAddr(options) {
354 | var {
355 | quasi_order_id, addr_id,
356 | success, error
357 | } = options
358 | getApp().getLoginInfo(loginInfo => {
359 | if (!loginInfo.user_info) {
360 | return alert('用户未登录')
361 | }
362 | var { user_id, user_token } = loginInfo.user_info
363 | fetch({
364 | url: 'index.php?m=Mall&c=Order&a=updateOrderAddr',
365 | data: {
366 | user_id, user_token,
367 | quasi_order_id, addr_id
368 | },
369 | success, error
370 | })
371 |
372 | })
373 | }
374 | // 更新准订单红包
375 | export function updateOrderCoupon(options) {
376 | var {
377 | quasi_order_id, user_coupon_id,
378 | success, error
379 | } = options
380 | getApp().getLoginInfo(loginInfo => {
381 | if (!loginInfo.user_info) {
382 | return alert('用户未登录')
383 | }
384 | var { user_id, user_token } = loginInfo.user_info
385 | fetch({
386 | url: 'index.php?m=Mall&c=Order&a=updateOrderCoupon',
387 | data: {
388 | user_id, user_token,
389 | quasi_order_id, user_coupon_id
390 | },
391 | success, error
392 | })
393 |
394 | })
395 | }
396 |
397 | // 添加订单
398 | export function addOrder(options) {
399 | var {
400 | quasi_order_id, remark,
401 | success, error
402 | } = options
403 | getApp().getLoginInfo(loginInfo => {
404 | if (!loginInfo.user_info) {
405 | return alert('用户未登录')
406 | }
407 | var { user_id, user_token } = loginInfo.user_info
408 | fetch({
409 | url: 'index.php?m=Mall&c=Order&a=addOrder',
410 | data: {
411 | user_id, user_token,
412 | quasi_order_id, remark
413 | },
414 | success, error
415 | })
416 |
417 | })
418 | }
419 |
420 | // 取消订单
421 | export function cancelOrder(options) {
422 | var {
423 | order_id,
424 | success, error
425 | } = options
426 | getApp().getLoginInfo(loginInfo => {
427 | if (!loginInfo.user_info) {
428 | return alert('用户未登录')
429 | }
430 | var { user_id, user_token } = loginInfo.user_info
431 | fetch({
432 | url: 'index.php?m=Mall&c=Order&a=cancelOrder',
433 | data: {
434 | user_id, user_token,
435 | order_id
436 | },
437 | success, error
438 | })
439 |
440 | })
441 | }
442 |
443 | // 获取订单列表
444 | export function getOrders(options) {
445 | var {
446 | page,
447 | success, error
448 | } = options
449 | getApp().getLoginInfo(loginInfo => {
450 | if (!loginInfo.user_info) {
451 | return alert('用户未登录')
452 | }
453 | var { user_id, user_token } = loginInfo.user_info
454 | fetch({
455 | url: 'index.php?m=Mall&c=Order&a=getOrders',
456 | data: {
457 | user_id, user_token,
458 | page
459 | },
460 | success, error
461 | })
462 |
463 | })
464 | }
465 |
466 | // 获取订单详情
467 | export function getOrderInfo(options) {
468 | var {
469 | order_id,
470 | success, error
471 | } = options
472 | getApp().getLoginInfo(loginInfo => {
473 | if (!loginInfo.user_info) {
474 | return alert('用户未登录')
475 | }
476 | var { user_id, user_token } = loginInfo.user_info
477 | fetch({
478 | url: 'index.php?m=Mall&c=Order&a=getOrderInfo',
479 | data: {
480 | user_id, user_token,
481 | order_id
482 | },
483 | success, error
484 | })
485 |
486 | })
487 | }
488 |
489 | // 订单评论
490 | export function reviewsOrder(options) {
491 | var {
492 | order_id,
493 | service, quality, content,
494 | reach_time,
495 | success, error
496 | } = options
497 | getApp().getLoginInfo(loginInfo => {
498 | if (!loginInfo.user_info) {
499 | return alert('用户未登录')
500 | }
501 | var { user_id, user_token } = loginInfo.user_info
502 | fetch({
503 | url: 'index.php?m=Mall&c=Order&a=reviewsOrder',
504 | data: {
505 | user_id, user_token,
506 | order_id,
507 | service, quality, content,
508 | reach_time
509 | },
510 | success, error
511 | })
512 |
513 | })
514 | }
515 |
516 | // 获取支付参数
517 | export function getPayment(options) {
518 | var {
519 | order_id,
520 | success, error
521 | } = options
522 | getApp().getLoginInfo(loginInfo => {
523 | if (!loginInfo.user_info) {
524 | return alert('用户未登录')
525 | }
526 | var { user_id, user_token } = loginInfo.user_info
527 | fetch({
528 | url: 'index.php?m=Mall&c=WeixinMall&a=getPayment',
529 | data: {
530 | user_id, user_token,
531 | order_id
532 | },
533 | success, error
534 | })
535 |
536 | })
537 | }
538 |
539 |
540 | // 获取分组列表
541 | export function getSellersByCategory(options) {
542 | var {
543 | category_id, page,
544 | success, error
545 | } = options
546 | page = page || 0
547 | getApp().getCurrentAddress(address => {
548 | var {
549 | location,
550 | city_id,
551 | city: city_name,
552 | district_id,
553 | district: district_name
554 | } = address
555 | fetch({
556 | url: 'index.php?m=Mall&c=Seller&a=getSellersByCategory',
557 | data: {
558 | category_id,
559 | city_id, city_name,
560 | district_id, district_name,
561 | page,
562 | gps: `${location.longitude},${location.latitude}`,
563 | },
564 | success, error
565 | })
566 |
567 | })
568 | }
569 |
570 | // 搜索商家和商品
571 | export function search(options) {
572 | var {
573 | keyword, page,
574 | success, error
575 | } = options
576 | page = page || 0
577 | getApp().getCurrentAddress(address => {
578 | var {
579 | location: { longitude, latitude },
580 | city_id,
581 | city: city_name,
582 | district_id,
583 | district: district_name
584 | } = address
585 | fetch({
586 | url: 'index.php?m=Mall&c=Seller&a=search',
587 | data: {
588 | keyword,
589 | city_id, city_name,
590 | district_id, district_name,
591 | page,
592 | longitude, latitude
593 | },
594 | success, error
595 | })
596 |
597 | })
598 | }
599 |
600 |
601 | // 获取用户红包列表
602 | export function getShareUserList(options) {
603 | var {
604 | page,
605 | success, error
606 | } = options
607 | page = page || 0
608 | getApp().getLoginInfo(loginInfo => {
609 | if (!loginInfo.user_info) {
610 | return alert('用户未登录')
611 | }
612 | var { user_id, user_token } = loginInfo.user_info
613 | fetch({
614 | url: 'index.php?m=Mall&c=Coupon&a=getShareUserList',
615 | data: {
616 | user_id, user_token,
617 | page
618 | },
619 | success, error
620 | })
621 |
622 | })
623 | }
--------------------------------------------------------------------------------
/page/utils/coordtransform.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by Wandergis on 2015/7/8.
3 | * 提供了百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换
4 | */
5 | //UMD魔法代码
6 | // if the module has no dependencies, the above pattern can be simplified to
7 | (function (root, factory) {
8 | if (typeof define === 'function' && define.amd) {
9 | // AMD. Register as an anonymous module.
10 | define([], factory);
11 | } else if (typeof module === 'object' && module.exports) {
12 | // Node. Does not work with strict CommonJS, but
13 | // only CommonJS-like environments that support module.exports,
14 | // like Node.
15 | module.exports = factory();
16 | } else {
17 | // Browser globals (root is window)
18 | root.coordtransform = factory();
19 | }
20 | }(this, function () {
21 | //定义一些常量
22 | var x_PI = 3.14159265358979324 * 3000.0 / 180.0;
23 | var PI = 3.1415926535897932384626;
24 | var a = 6378245.0;
25 | var ee = 0.00669342162296594323;
26 | /**
27 | * 百度坐标系 (BD-09) 与 火星坐标系 (GCJ-02)的转换
28 | * 即 百度 转 谷歌、高德
29 | * @param bd_lon
30 | * @param bd_lat
31 | * @returns {*[]}
32 | */
33 | var bd09togcj02 = function bd09togcj02(bd_lon, bd_lat) {
34 | var bd_lon = +bd_lon;
35 | var bd_lat = +bd_lat;
36 | var x = bd_lon - 0.0065;
37 | var y = bd_lat - 0.006;
38 | var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_PI);
39 | var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_PI);
40 | var gg_lng = z * Math.cos(theta);
41 | var gg_lat = z * Math.sin(theta);
42 | return [gg_lng, gg_lat]
43 | };
44 |
45 | /**
46 | * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换
47 | * 即谷歌、高德 转 百度
48 | * @param lng
49 | * @param lat
50 | * @returns {*[]}
51 | */
52 | var gcj02tobd09 = function gcj02tobd09(lng, lat) {
53 | var lat = +lat;
54 | var lng = +lng;
55 | var z = Math.sqrt(lng * lng + lat * lat) + 0.00002 * Math.sin(lat * x_PI);
56 | var theta = Math.atan2(lat, lng) + 0.000003 * Math.cos(lng * x_PI);
57 | var bd_lng = z * Math.cos(theta) + 0.0065;
58 | var bd_lat = z * Math.sin(theta) + 0.006;
59 | return [bd_lng, bd_lat]
60 | };
61 |
62 | /**
63 | * WGS84转GCj02
64 | * @param lng
65 | * @param lat
66 | * @returns {*[]}
67 | */
68 | var wgs84togcj02 = function wgs84togcj02(lng, lat) {
69 | var lat = +lat;
70 | var lng = +lng;
71 | if (out_of_china(lng, lat)) {
72 | return [lng, lat]
73 | } else {
74 | var dlat = transformlat(lng - 105.0, lat - 35.0);
75 | var dlng = transformlng(lng - 105.0, lat - 35.0);
76 | var radlat = lat / 180.0 * PI;
77 | var magic = Math.sin(radlat);
78 | magic = 1 - ee * magic * magic;
79 | var sqrtmagic = Math.sqrt(magic);
80 | dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
81 | dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
82 | var mglat = lat + dlat;
83 | var mglng = lng + dlng;
84 | return [mglng, mglat]
85 | }
86 | };
87 |
88 | /**
89 | * GCJ02 转换为 WGS84
90 | * @param lng
91 | * @param lat
92 | * @returns {*[]}
93 | */
94 | var gcj02towgs84 = function gcj02towgs84(lng, lat) {
95 | var lat = +lat;
96 | var lng = +lng;
97 | if (out_of_china(lng, lat)) {
98 | return [lng, lat]
99 | } else {
100 | var dlat = transformlat(lng - 105.0, lat - 35.0);
101 | var dlng = transformlng(lng - 105.0, lat - 35.0);
102 | var radlat = lat / 180.0 * PI;
103 | var magic = Math.sin(radlat);
104 | magic = 1 - ee * magic * magic;
105 | var sqrtmagic = Math.sqrt(magic);
106 | dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
107 | dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
108 | var mglat = lat + dlat;
109 | var mglng = lng + dlng;
110 | return [lng * 2 - mglng, lat * 2 - mglat]
111 | }
112 | };
113 |
114 | var transformlat = function transformlat(lng, lat) {
115 | var lat = +lat;
116 | var lng = +lng;
117 | var ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
118 | ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;
119 | ret += (20.0 * Math.sin(lat * PI) + 40.0 * Math.sin(lat / 3.0 * PI)) * 2.0 / 3.0;
120 | ret += (160.0 * Math.sin(lat / 12.0 * PI) + 320 * Math.sin(lat * PI / 30.0)) * 2.0 / 3.0;
121 | return ret
122 | };
123 |
124 | var transformlng = function transformlng(lng, lat) {
125 | var lat = +lat;
126 | var lng = +lng;
127 | var ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
128 | ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;
129 | ret += (20.0 * Math.sin(lng * PI) + 40.0 * Math.sin(lng / 3.0 * PI)) * 2.0 / 3.0;
130 | ret += (150.0 * Math.sin(lng / 12.0 * PI) + 300.0 * Math.sin(lng / 30.0 * PI)) * 2.0 / 3.0;
131 | return ret
132 | };
133 |
134 | /**
135 | * 判断是否在国内,不在国内则不做偏移
136 | * @param lng
137 | * @param lat
138 | * @returns {boolean}
139 | */
140 | var out_of_china = function out_of_china(lng, lat) {
141 | var lat = +lat;
142 | var lng = +lng;
143 | // 纬度3.86~53.55,经度73.66~135.05
144 | return !(lng > 73.66 && lng < 135.05 && lat > 3.86 && lat < 53.55);
145 | };
146 |
147 | return {
148 | bd09togcj02: bd09togcj02,
149 | gcj02tobd09: gcj02tobd09,
150 | wgs84togcj02: wgs84togcj02,
151 | gcj02towgs84: gcj02towgs84
152 | }
153 | }));
154 |
--------------------------------------------------------------------------------
/page/utils/dateformat.js:
--------------------------------------------------------------------------------
1 | /*
2 | * Date Format 1.2.3
3 | * (c) 2007-2009 Steven Levithan
4 | * MIT license
5 | *
6 | * Includes enhancements by Scott Trenda
7 | * and Kris Kowal
8 | *
9 | * Accepts a date, a mask, or a date and a mask.
10 | * Returns a formatted version of the given date.
11 | * The date defaults to the current date/time.
12 | * The mask defaults to dateFormat.masks.default.
13 | */
14 |
15 | (function (global) {
16 | 'use strict';
17 |
18 | var dateFormat = (function () {
19 | var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|'[^']*'|'[^']*'/g;
20 | var timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;
21 | var timezoneClip = /[^-+\dA-Z]/g;
22 |
23 | // Regexes and supporting functions are cached through closure
24 | return function (date, mask, utc, gmt) {
25 |
26 | // You can't provide utc if you skip other args (use the 'UTC:' mask prefix)
27 | if (arguments.length === 1 && kindOf(date) === 'string' && !/\d/.test(date)) {
28 | mask = date;
29 | date = undefined;
30 | }
31 |
32 | date = date || new Date;
33 |
34 | if (!(date instanceof Date)) {
35 | date = new Date(date);
36 | }
37 |
38 | if (isNaN(date)) {
39 | throw TypeError('Invalid date');
40 | }
41 |
42 | mask = String(dateFormat.masks[mask] || mask || dateFormat.masks['default']);
43 |
44 | // Allow setting the utc/gmt argument via the mask
45 | var maskSlice = mask.slice(0, 4);
46 | if (maskSlice === 'UTC:' || maskSlice === 'GMT:') {
47 | mask = mask.slice(4);
48 | utc = true;
49 | if (maskSlice === 'GMT:') {
50 | gmt = true;
51 | }
52 | }
53 |
54 | var _ = utc ? 'getUTC' : 'get';
55 | var d = date[_ + 'Date']();
56 | var D = date[_ + 'Day']();
57 | var m = date[_ + 'Month']();
58 | var y = date[_ + 'FullYear']();
59 | var H = date[_ + 'Hours']();
60 | var M = date[_ + 'Minutes']();
61 | var s = date[_ + 'Seconds']();
62 | var L = date[_ + 'Milliseconds']();
63 | var o = utc ? 0 : date.getTimezoneOffset();
64 | var W = getWeek(date);
65 | var N = getDayOfWeek(date);
66 | var flags = {
67 | d: d,
68 | dd: pad(d),
69 | ddd: dateFormat.i18n.dayNames[D],
70 | dddd: dateFormat.i18n.dayNames[D + 7],
71 | m: m + 1,
72 | mm: pad(m + 1),
73 | mmm: dateFormat.i18n.monthNames[m],
74 | mmmm: dateFormat.i18n.monthNames[m + 12],
75 | yy: String(y).slice(2),
76 | yyyy: y,
77 | h: H % 12 || 12,
78 | hh: pad(H % 12 || 12),
79 | H: H,
80 | HH: pad(H),
81 | M: M,
82 | MM: pad(M),
83 | s: s,
84 | ss: pad(s),
85 | l: pad(L, 3),
86 | L: pad(Math.round(L / 10)),
87 | t: H < 12 ? 'a' : 'p',
88 | tt: H < 12 ? 'am' : 'pm',
89 | T: H < 12 ? 'A' : 'P',
90 | TT: H < 12 ? 'AM' : 'PM',
91 | Z: gmt ? 'GMT' : utc ? 'UTC' : (String(date).match(timezone) || ['']).pop().replace(timezoneClip, ''),
92 | o: (o > 0 ? '-' : '+') + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4),
93 | S: ['th', 'st', 'nd', 'rd'][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10],
94 | W: W,
95 | N: N
96 | };
97 |
98 | return mask.replace(token, function (match) {
99 | if (match in flags) {
100 | return flags[match];
101 | }
102 | return match.slice(1, match.length - 1);
103 | });
104 | };
105 | })();
106 |
107 | dateFormat.masks = {
108 | 'default': 'ddd mmm dd yyyy HH:MM:ss',
109 | 'shortDate': 'm/d/yy',
110 | 'mediumDate': 'mmm d, yyyy',
111 | 'longDate': 'mmmm d, yyyy',
112 | 'fullDate': 'dddd, mmmm d, yyyy',
113 | 'shortTime': 'h:MM TT',
114 | 'mediumTime': 'h:MM:ss TT',
115 | 'longTime': 'h:MM:ss TT Z',
116 | 'isoDate': 'yyyy-mm-dd',
117 | 'isoTime': 'HH:MM:ss',
118 | 'isoDateTime': 'yyyy-mm-dd\'T\'HH:MM:sso',
119 | 'isoUtcDateTime': 'UTC:yyyy-mm-dd\'T\'HH:MM:ss\'Z\'',
120 | 'expiresHeaderFormat': 'ddd, dd mmm yyyy HH:MM:ss Z'
121 | };
122 |
123 | // Internationalization strings
124 | dateFormat.i18n = {
125 | dayNames: [
126 | 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat',
127 | 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'
128 | ],
129 | monthNames: [
130 | 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',
131 | 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'
132 | ]
133 | };
134 |
135 | function pad(val, len) {
136 | val = String(val);
137 | len = len || 2;
138 | while (val.length < len) {
139 | val = '0' + val;
140 | }
141 | return val;
142 | }
143 |
144 | /**
145 | * Get the ISO 8601 week number
146 | * Based on comments from
147 | * http://techblog.procurios.nl/k/n618/news/view/33796/14863/Calculate-ISO-8601-week-and-year-in-javascript.html
148 | *
149 | * @param {Object} `date`
150 | * @return {Number}
151 | */
152 | function getWeek(date) {
153 | // Remove time components of date
154 | var targetThursday = new Date(date.getFullYear(), date.getMonth(), date.getDate());
155 |
156 | // Change date to Thursday same week
157 | targetThursday.setDate(targetThursday.getDate() - ((targetThursday.getDay() + 6) % 7) + 3);
158 |
159 | // Take January 4th as it is always in week 1 (see ISO 8601)
160 | var firstThursday = new Date(targetThursday.getFullYear(), 0, 4);
161 |
162 | // Change date to Thursday same week
163 | firstThursday.setDate(firstThursday.getDate() - ((firstThursday.getDay() + 6) % 7) + 3);
164 |
165 | // Check if daylight-saving-time-switch occurred and correct for it
166 | var ds = targetThursday.getTimezoneOffset() - firstThursday.getTimezoneOffset();
167 | targetThursday.setHours(targetThursday.getHours() - ds);
168 |
169 | // Number of weeks between target Thursday and first Thursday
170 | var weekDiff = (targetThursday - firstThursday) / (86400000 * 7);
171 | return 1 + Math.floor(weekDiff);
172 | }
173 |
174 | /**
175 | * Get ISO-8601 numeric representation of the day of the week
176 | * 1 (for Monday) through 7 (for Sunday)
177 | *
178 | * @param {Object} `date`
179 | * @return {Number}
180 | */
181 | function getDayOfWeek(date) {
182 | var dow = date.getDay();
183 | if (dow === 0) {
184 | dow = 7;
185 | }
186 | return dow;
187 | }
188 |
189 | /**
190 | * kind-of shortcut
191 | * @param {*} val
192 | * @return {String}
193 | */
194 | function kindOf(val) {
195 | if (val === null) {
196 | return 'null';
197 | }
198 |
199 | if (val === undefined) {
200 | return 'undefined';
201 | }
202 |
203 | if (typeof val !== 'object') {
204 | return typeof val;
205 | }
206 |
207 | if (Array.isArray(val)) {
208 | return 'array';
209 | }
210 |
211 | return {}.toString.call(val)
212 | .slice(8, -1).toLowerCase();
213 | };
214 |
215 |
216 |
217 | if (typeof define === 'function' && define.amd) {
218 | define(function () {
219 | return dateFormat;
220 | });
221 | } else if (typeof exports === 'object') {
222 | module.exports = dateFormat;
223 | } else {
224 | global.dateFormat = dateFormat;
225 | }
226 | })(this);
227 |
--------------------------------------------------------------------------------
/page/utils/distance.js:
--------------------------------------------------------------------------------
1 | var RADIUS = 6371;
2 |
3 | var toRad = function (n) {
4 | return n * Math.PI / 180;
5 | };
6 |
7 | var getDistance = function (from, to) {
8 | var fromLat = from[0];
9 | var fromLon = from[1];
10 | var toLat = to[0];
11 | var toLon = to[1];
12 |
13 | var dLat = toRad(toLat - fromLat);
14 | var dLon = toRad(toLon - fromLon);
15 | var fromLat = toRad(fromLat);
16 | var toLat = toRad(toLat);
17 |
18 | var a = Math.pow(Math.sin(dLat / 2), 2) +
19 | (Math.pow(Math.sin(dLon / 2), 2) * Math.cos(fromLat) * Math.cos(toLat));
20 | var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
21 |
22 | return RADIUS * c;
23 | };
24 |
25 | var measurePath = function (points) {
26 | return points.reduce(function (memo, point) {
27 | var distance = memo.lastPoint === null ? 0 : getDistance(memo.lastPoint, point);
28 | return { lastPoint: point, distance: distance + memo.distance };
29 | }, { lastPoint: null, distance: 0 }).distance;
30 | };
31 |
32 | module.exports = function (fromLat, fromLon, toLat, toLon) {
33 | if (typeof fromLat === 'number') {
34 | return getDistance([fromLat, fromLon], [toLat, toLon]);
35 | } else {
36 | return measurePath(fromLat);
37 | }
38 | };
--------------------------------------------------------------------------------
/page/utils/qqmap-wx-jssdk.min.js:
--------------------------------------------------------------------------------
1 | var _createClass = function () { function a(e, c) { for (var b = 0; b < c.length; b++) { var d = c[b]; d.enumerable = d.enumerable || false; d.configurable = true; if ("value" in d) { d.writable = true } Object.defineProperty(e, d.key, d) } } return function (d, b, c) { if (b) { a(d.prototype, b) } if (c) { a(d, c) } return d } }(); function _classCallCheck(a, b) { if (!(a instanceof b)) { throw new TypeError("Cannot call a class as a function") } } var ERROR_CONF = { KEY_ERR: 311, KEY_ERR_MSG: "key格式错误", PARAM_ERR: 310, PARAM_ERR_MSG: "请求参数信息有误", SYSTEM_ERR: 600, SYSTEM_ERR_MSG: "系统错误", WX_ERR_CODE: 1000, WX_OK_CODE: 200 }; var BASE_URL = "https://apis.map.qq.com/ws/"; var URL_SEARCH = BASE_URL + "place/v1/search"; var URL_SUGGESTION = BASE_URL + "place/v1/suggestion"; var URL_GET_GEOCODER = BASE_URL + "geocoder/v1/"; var URL_CITY_LIST = BASE_URL + "district/v1/list"; var URL_AREA_LIST = BASE_URL + "district/v1/getchildren"; var URL_DISTANCE = BASE_URL + "distance/v1/"; var Utils = { location2query: function location2query(c) { if (typeof c == "string") { return c } var b = ""; for (var a = 0; a < c.length; a++) { var e = c[a]; if (!!b) { b += ";" } if (e.location) { b = b + e.location.lat + "," + e.location.lng } if (e.latitude && e.longitude) { b = b + e.latitude + "," + e.longitude } } return b }, getWXLocation: function getWXLocation(c, b, a) { wx.getLocation({ type: "gcj02", success: c, fail: b, complete: a }) }, getLocationParam: function getLocationParam(b) { if (typeof b == "string") { var a = b.split(","); if (a.length === 2) { b = { latitude: b.split(",")[0], longitude: b.split(",")[1] } } else { b = {} } } return b }, polyfillParam: function polyfillParam(a) { a.success = a.success || function () { }; a.fail = a.fail || function () { }; a.complete = a.complete || function () { } }, checkParamKeyEmpty: function checkParamKeyEmpty(c, b) { if (!c[b]) { var a = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + b + "参数格式有误"); c.fail(a); c.complete(a); return true } return false }, checkKeyword: function checkKeyword(a) { return !this.checkParamKeyEmpty(a, "keyword") }, checkLocation: function checkLocation(c) { var a = this.getLocationParam(c.location); if (!a || !a.latitude || !a.longitude) { var b = this.buildErrorConfig(ERROR_CONF.PARAM_ERR, ERROR_CONF.PARAM_ERR_MSG + " location参数格式有误"); c.fail(b); c.complete(b); return false } return true }, buildErrorConfig: function buildErrorConfig(a, b) { return { status: a, message: b } }, buildWxRequestConfig: function buildWxRequestConfig(c, a) { var b = this; a.header = { "content-type": "application/json" }; a.method = "GET"; a.success = function (d) { var e = d.data; if (e.status === 0) { c.success(e) } else { c.fail(e) } }; a.fail = function (d) { d.statusCode = ERROR_CONF.WX_ERR_CODE; c.fail(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, result.errMsg)) }; a.complete = function (d) { var e = +d.statusCode; switch (e) { case ERROR_CONF.WX_ERR_CODE: c.complete(b.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, d.errMsg)); break; case ERROR_CONF.WX_OK_CODE: var f = d.data; if (f.status === 0) { c.complete(f) } else { c.complete(b.buildErrorConfig(f.status, f.message)) } break; default: c.complete(b.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) } }; return a }, locationProcess: function locationProcess(f, e, c, a) { var d = this; c = c || function (g) { g.statusCode = ERROR_CONF.WX_ERR_CODE; f.fail(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, g.errMsg)) }; a = a || function (g) { if (g.statusCode == ERROR_CONF.WX_ERR_CODE) { f.complete(d.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, g.errMsg)) } }; if (!f.location) { d.getWXLocation(e, c, a) } else { if (d.checkLocation(f)) { var b = Utils.getLocationParam(f.location); e(b) } } } }; var QQMapWX = function () {
2 | function b(i) { _classCallCheck(this, b); if (!i.key) { throw Error("key值不能为空") } this.key = i.key } _createClass(b, [{ key: "search", value: function f(i) { var l = this; i = i || {}; Utils.polyfillParam(i); if (!Utils.checkKeyword(i)) { return } var k = { keyword: i.keyword, orderby: i.orderby || "_distance", page_size: i.page_size || 10, page_index: i.page_index || 1, output: "json", key: l.key }; if (i.address_format) { k.address_format = i.address_format } if (i.filter) { k.filter = i.filter } var n = i.distance || "1000"; var j = i.auto_extend || 1; var m = function m(o) { k.boundary = "nearby(" + o.latitude + "," + o.longitude + "," + n + "," + j + ")"; wx.request(Utils.buildWxRequestConfig(i, { url: URL_SEARCH, data: k })) }; Utils.locationProcess(i, m) } }, { key: "getSuggestion", value: function h(i) { var k = this; i = i || {}; Utils.polyfillParam(i); if (!Utils.checkKeyword(i)) { return } var j = { keyword: i.keyword, region: i.region || "全国", region_fix: i.region_fix || 0, policy: i.policy || 0, output: "json", key: k.key }; wx.request(Utils.buildWxRequestConfig(i, { url: URL_SUGGESTION, data: j })) } }, { key: "reverseGeocoder", value: function a(i) { var k = this; i = i || {}; Utils.polyfillParam(i); var j = { coord_type: i.coord_type || 5, get_poi: i.get_poi || 0, output: "json", key: k.key }; if (i.poi_options) { j.poi_options = i.poi_options } var l = function l(m) { j.location = m.latitude + "," + m.longitude; wx.request(Utils.buildWxRequestConfig(i, { url: URL_GET_GEOCODER, data: j })) }; Utils.locationProcess(i, l) } }, { key: "geocoder", value: function g(i) { var k = this; i = i || {}; Utils.polyfillParam(i); if (Utils.checkParamKeyEmpty(i, "address")) { return } var j = { address: i.address, output: "json", key: k.key }; wx.request(Utils.buildWxRequestConfig(i, { url: URL_GET_GEOCODER, data: j })) } }, {
3 | key: "getCityList", value: function c(i) {
4 | var k = this; i = i || {}; Utils.polyfillParam(i); var j = { output: "json", key: k.key };
5 | wx.request(Utils.buildWxRequestConfig(i, { url: URL_CITY_LIST, data: j }))
6 | }
7 | }, { key: "getDistrictByCityId", value: function d(i) { var k = this; i = i || {}; Utils.polyfillParam(i); if (Utils.checkParamKeyEmpty(i, "id")) { return } var j = { id: i.id || "", output: "json", key: k.key }; wx.request(Utils.buildWxRequestConfig(i, { url: URL_AREA_LIST, data: j })) } }, { key: "calculateDistance", value: function e(i) { var k = this; i = i || {}; Utils.polyfillParam(i); if (Utils.checkParamKeyEmpty(i, "to")) { return } var j = { mode: i.mode || "walking", to: Utils.location2query(i.to), output: "json", key: k.key }; var l = function l(m) { j.from = m.latitude + "," + m.longitude; wx.request(Utils.buildWxRequestConfig(i, { url: URL_DISTANCE, data: j })) }; if (i.from) { i.location = i.from } Utils.locationProcess(i, l) } }]); return b
8 | }(); module.exports = QQMapWX;
--------------------------------------------------------------------------------
/page/utils/timeago.min.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/locqj/wxapp-waimaishop/6e99e69bf4587cae335aef1e65c1d6e3b63f1c88/page/utils/timeago.min.js
--------------------------------------------------------------------------------
/page/utils/util.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | import timeago from './timeago.min'
3 | import dateFormat from './dateformat'
4 | import distance from './distance'
5 | import QQMapWX from './qqmap-wx-jssdk.min'
6 | import {
7 | gcj02tobd09
8 | } from './coordtransform'
9 | import { host, qqmapKey } from '../../config'
10 |
11 | const qqmap = new QQMapWX({
12 | key: qqmapKey
13 | });
14 |
15 | function resolveAdInfo(adInfo) {
16 | const { city, district, adcode } = adInfo
17 | return {
18 | city, district,
19 | district_id: adcode,
20 | city_id: adcode.replace(/\d{2}$/, '00')
21 | }
22 | }
23 |
24 | // 解析地址
25 | export function reverseGeocoder(options) {
26 | const {
27 | location, success, complete
28 | } = options
29 | qqmap.reverseGeocoder({
30 | location,
31 | success: function (res) {
32 | var address = resolveAdInfo(res.result.ad_info)
33 | success && success(address)
34 | },
35 | fail: function (err) {
36 | console.log(err)
37 | },
38 | complete
39 | })
40 | }
41 |
42 | // 获取当前地理位置
43 | export function getCurrentAddressList(options) {
44 | const {
45 | success, complete
46 | } = options
47 | wx.getLocation({
48 | type: 'gcj02',
49 | success(res) {
50 | getAddressFromLocation({
51 | location: {
52 | latitude: res.latitude,
53 | longitude: res.longitude,
54 | },
55 | success, complete
56 | })
57 | },
58 | fail(res) {
59 | console.log(res.errMsg)
60 | alert('获取用户地址失败')
61 | }
62 | })
63 | }
64 |
65 | // 地点搜索
66 | export function searchAddressList(options) {
67 | const {
68 | keyword, success
69 | } = options
70 | getCurrentCity(function (cityName) {
71 | qqmap.getSuggestion({
72 | region: cityName,
73 | keyword,
74 | success(res) {
75 | success && success(res.data)
76 | }
77 | })
78 | })
79 | }
80 |
81 | // 获取当前地址
82 | export function getCurrentAddress(callback) {
83 | getCurrentAddressList({
84 | success(addressList) {
85 | if (addressList.length > 0) {
86 | callback(addressList[0])
87 | }
88 | }
89 | })
90 | }
91 |
92 |
93 | // 获取当前城市
94 | var cityName;
95 | export function getCurrentCity(callback) {
96 | if (cityName) {
97 | return callback && callback(cityName)
98 | }
99 | wx.getLocation({
100 | type: 'gcj02',
101 | success(res) {
102 | qqmap.reverseGeocoder({
103 | location: {
104 | longitude: res.longitude,
105 | latitude: res.latitude
106 | },
107 | success: function (res) {
108 | cityName = res.result.address_component.city
109 | callback && callback(cityName)
110 | }
111 | })
112 | },
113 | fail(res) {
114 | console.log(res.errMsg)
115 | alert('获取用户地址失败')
116 | }
117 | })
118 | }
119 |
120 |
121 | // 根据坐标获取地址信息
122 | export function getAddressFromLocation(options) {
123 | const { location, success } = options
124 | getPois({
125 | location,
126 | success(pois) {
127 | var addressList = []
128 | pois.forEach(poi => {
129 | var {
130 | title, location,
131 | address, ad_info
132 | } = poi
133 | addressList.push(Object.assign({
134 | title, location, address
135 | }, resolveAdInfo(ad_info)))
136 | })
137 | success && success(addressList)
138 | }
139 | })
140 | }
141 |
142 | // 获取兴趣点
143 | export function getPois(options) {
144 | const {
145 | location, success, complete
146 | } = options
147 | qqmap.reverseGeocoder({
148 | location,
149 | get_poi: 1,
150 | success: function (res) {
151 | success && success(res.result.pois)
152 | },
153 | fail: function (err) {
154 | console.log(err)
155 | },
156 | complete
157 | })
158 | }
159 |
160 | export function getPrevPage() {
161 | const pages = getCurrentPages()
162 | return pages[pages.length - 2]
163 | }
164 | export function getCurrentPage() {
165 | const pages = getCurrentPages()
166 | return pages[pages.length - 1]
167 | }
168 |
169 | export function fetch(options) {
170 | wx.request({
171 | url: `https://${host}/${options.url}`,
172 | data: Object.assign(options.data, {
173 | 'app_v': 'ipaotui_mall'
174 | }),
175 | method: options.method || 'POST',
176 | header: {
177 | 'content-type': 'application/x-www-form-urlencoded'
178 | },
179 | success: function (res) {
180 | const data = res.data
181 | if (data.State == 'Success') {
182 | options.success && options.success(data.data)
183 | } else {
184 | alert(data.info)
185 | options.error && options.error(data.info)
186 | }
187 | options.complete && options.complete()
188 | }
189 | })
190 | }
191 |
192 | // 提示框
193 | export function alert(content, callback) {
194 | wx.showModal({
195 | title: '提示',
196 | content: content,
197 | showCancel: false,
198 | success: callback
199 | })
200 | }
201 | // 确认框
202 | export function confirm(options) {
203 | var {
204 | content, confirmText,
205 | ok,
206 | } = options
207 | confirmText = confirmText || '确定'
208 | wx.showModal({
209 | content,
210 | confirmText,
211 | cancelText: '关闭',
212 | success(res) {
213 | if (res.confirm) {
214 | ok && ok()
215 | }
216 | }
217 | })
218 | }
219 |
220 | // 拨打电话
221 | export function makePhoneCall(phoneNum) {
222 | confirm({
223 | content: `是否拨打电话 ${phoneNum}`,
224 | confirmText: '拨打',
225 | ok() {
226 | wx.makePhoneCall({
227 | phoneNumber: phoneNum,
228 | })
229 | }
230 | })
231 | }
232 |
233 | // 加载提示
234 | export function showLoading() {
235 | wx.showToast({
236 | icon: 'loading',
237 | duration: 10000,
238 | title: '加载中...',
239 | mask: true,
240 | })
241 | }
242 | export function hideLoading() {
243 | wx.hideToast()
244 | }
245 |
246 | // 时间格式化
247 | export function datetimeFormat(unix_timestamp) {
248 | return dateFormat(new Date(unix_timestamp * 1000), "mm月dd日 HH:MM")
249 | }
250 |
251 | // 坐标格式化
252 | export function coordFormat(location) {
253 | if (location.lat && location.lng) {
254 | location = {
255 | longitude: location.lng,
256 | latitude: location.lat
257 | }
258 | }
259 | // gcj02 转 bd09
260 | var location = gcj02tobd09(location.longitude, location.latitude)
261 | return {
262 | longitude: location[0],
263 | latitude: location[1]
264 | }
265 | }
266 |
267 | // 倒计时格式化
268 | export function countdownFormat(count) {
269 | var seconds = count % 60
270 | count = Math.floor(count / 60)
271 | var minutes = count % 60
272 | return `${minutes}分钟${seconds}秒`
273 | }
274 |
275 | // 字符串关键字分组
276 |
277 | export function splitByKeyword(text, keyword) {
278 | if (!text) {
279 | return []
280 | }
281 | var arr = text.split(keyword)
282 | var res = []
283 | res.push({
284 | text: arr[0],
285 | isKeyword: false
286 | })
287 | for (let i = 1, len = arr.length; i < len; i++) {
288 | res.push({
289 | text: keyword,
290 | isKeyword: true
291 | }, {
292 | text: arr[i],
293 | isKeyword: false
294 | })
295 | }
296 | return res
297 | }
298 |
299 | var userInfo
300 | export function getUserInfo(cb) {
301 | if (userInfo) {
302 | return cb(userInfo)
303 | } else {
304 | wx.getUserInfo({
305 | success(res) {
306 | userInfo = res.userInfo
307 | cb(userInfo)
308 | },
309 | fail(res) {
310 | console.log(res)
311 | alert('获取用户信息失败')
312 | }
313 | })
314 | }
315 | }
316 |
317 | // 微信支付
318 | export function requestPayment(options) {
319 | var {
320 | data, success, error, complete
321 | } = options
322 | wx.requestPayment(Object.assign({
323 | complete(res) {
324 | if (res.errMsg == 'requestPayment:ok') {
325 | alert('支付成功', function () {
326 | success && success()
327 | complete && complete()
328 | })
329 | } else if (res.errMsg == 'requestPayment:fail cancel') {
330 | alert('用户取消支付', function () {
331 | error && error()
332 | complete && complete()
333 | })
334 | } else {
335 | alert('支付失败', function () {
336 | error && error()
337 | complete && complete()
338 | })
339 | }
340 | }
341 | }, data))
342 | }
343 |
344 | // 分享
345 | export function share(options) {
346 | if (!wx.showShareMenu) {
347 | return alert('当前微信版本过低, 无法使用该功能, 请升级到最新微信版本后重试.')
348 | }
349 |
350 | wx.showShareMenu(options)
351 | }
--------------------------------------------------------------------------------
/project.config.json:
--------------------------------------------------------------------------------
1 | {
2 | "description": "项目配置文件。",
3 | "setting": {
4 | "urlCheck": true,
5 | "es6": true,
6 | "postcss": true,
7 | "minified": true,
8 | "newFeature": true
9 | },
10 | "compileType": "miniprogram",
11 | "libVersion": "1.7.2",
12 | "appid": "touristappid",
13 | "projectname": "wxapp_mail",
14 | "condition": {
15 | "search": {
16 | "current": -1,
17 | "list": []
18 | },
19 | "conversation": {
20 | "current": -1,
21 | "list": []
22 | },
23 | "miniprogram": {
24 | "current": -1,
25 | "list": []
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/weui.wxss:
--------------------------------------------------------------------------------
1 | page {
2 | line-height: 1.6;
3 | font-family: -apple-system-font, "Helvetica Neue", sans-serif;
4 | }
5 | icon {
6 | vertical-align: middle;
7 | }
8 | .weui-cells {
9 | position: relative;
10 | margin-top: 1.17647059em;
11 | background-color: #FFFFFF;
12 | line-height: 1.41176471;
13 | font-size: 17px;
14 | }
15 | .weui-cells:before {
16 | content: " ";
17 | position: absolute;
18 | left: 0;
19 | top: 0;
20 | right: 0;
21 | height: 1px;
22 | border-top: 1rpx solid #D9D9D9;
23 | color: #D9D9D9;
24 | }
25 | .weui-cells:after {
26 | content: " ";
27 | position: absolute;
28 | left: 0;
29 | bottom: 0;
30 | right: 0;
31 | height: 1px;
32 | border-bottom: 1rpx solid #D9D9D9;
33 | color: #D9D9D9;
34 | }
35 | .weui-cells__title {
36 | margin-top: .77em;
37 | margin-bottom: .3em;
38 | padding-left: 15px;
39 | padding-right: 15px;
40 | color: #999999;
41 | font-size: 14px;
42 | }
43 | .weui-cells_after-title {
44 | margin-top: 0;
45 | }
46 | .weui-cells__tips {
47 | margin-top: .3em;
48 | color: #999999;
49 | padding-left: 15px;
50 | padding-right: 15px;
51 | font-size: 14px;
52 | }
53 | .weui-cell {
54 | padding: 10px 15px;
55 | position: relative;
56 | display: -webkit-box;
57 | display: -webkit-flex;
58 | display: flex;
59 | -webkit-box-align: center;
60 | -webkit-align-items: center;
61 | align-items: center;
62 | }
63 | .weui-cell:before {
64 | content: " ";
65 | position: absolute;
66 | left: 0;
67 | top: 0;
68 | right: 0;
69 | height: 1px;
70 | border-top: 1rpx solid #D9D9D9;
71 | color: #D9D9D9;
72 | left: 15px;
73 | }
74 | .weui-cell:first-child:before {
75 | display: none;
76 | }
77 | .weui-cell_active {
78 | background-color: #ECECEC;
79 | }
80 | .weui-cell_primary {
81 | -webkit-box-align: start;
82 | -webkit-align-items: flex-start;
83 | align-items: flex-start;
84 | }
85 | .weui-cell__bd {
86 | -webkit-box-flex: 1;
87 | -webkit-flex: 1;
88 | flex: 1;
89 | }
90 | .weui-cell__ft {
91 | text-align: right;
92 | color: #999999;
93 | }
94 | .weui-cell_access {
95 | color: inherit;
96 | }
97 | .weui-cell__ft_in-access {
98 | padding-right: 13px;
99 | position: relative;
100 | }
101 | .weui-cell__ft_in-access:after {
102 | content: " ";
103 | display: inline-block;
104 | height: 6px;
105 | width: 6px;
106 | border-width: 2px 2px 0 0;
107 | border-color: #C8C8CD;
108 | border-style: solid;
109 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
110 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
111 | position: relative;
112 | top: -2px;
113 | position: absolute;
114 | top: 50%;
115 | margin-top: -4px;
116 | right: 2px;
117 | }
118 | .weui-cell_link {
119 | color: #586C94;
120 | font-size: 14px;
121 | }
122 | .weui-cell_link:active {
123 | background-color: #ECECEC;
124 | }
125 | .weui-cell_link:first-child:before {
126 | display: block;
127 | }
128 | .weui-icon-radio {
129 | margin-left: 3.2px;
130 | margin-right: 3.2px;
131 | }
132 | .weui-icon-checkbox_circle,
133 | .weui-icon-checkbox_success {
134 | margin-left: 4.6px;
135 | margin-right: 4.6px;
136 | }
137 | .weui-check__label:active {
138 | background-color: #ECECEC;
139 | }
140 | .weui-check {
141 | position: absolute;
142 | left: -9999px;
143 | }
144 | .weui-check__hd_in-checkbox {
145 | padding-right: 0.35em;
146 | }
147 | .weui-cell__ft_in-radio {
148 | padding-left: 0.35em;
149 | }
150 | .weui-cell_input {
151 | padding-top: 0;
152 | padding-bottom: 0;
153 | }
154 | .weui-label {
155 | width: 105px;
156 | word-wrap: break-word;
157 | word-break: break-all;
158 | }
159 | .weui-input {
160 | height: 2.58823529em;
161 | min-height: 2.58823529em;
162 | line-height: 2.58823529em;
163 | }
164 | .weui-toptips {
165 | position: fixed;
166 | -webkit-transform: translateZ(0);
167 | transform: translateZ(0);
168 | top: 0;
169 | left: 0;
170 | right: 0;
171 | padding: 5px;
172 | font-size: 14px;
173 | text-align: center;
174 | color: #FFFFFF;
175 | z-index: 5000;
176 | word-wrap: break-word;
177 | word-break: break-all;
178 | }
179 | .weui-toptips_warn {
180 | background-color: #E64340;
181 | }
182 | .weui-textarea {
183 | display: block;
184 | width: 100%;
185 | }
186 | .weui-textarea-counter {
187 | color: #B2B2B2;
188 | text-align: right;
189 | }
190 | .weui-textarea-counter_warn {
191 | color: #E64340;
192 | }
193 | .weui-cell_warn {
194 | color: #E64340;
195 | }
196 | .weui-form-preview {
197 | position: relative;
198 | background-color: #FFFFFF;
199 | }
200 | .weui-form-preview:before {
201 | content: " ";
202 | position: absolute;
203 | left: 0;
204 | top: 0;
205 | right: 0;
206 | height: 1px;
207 | border-top: 1rpx solid #D9D9D9;
208 | color: #D9D9D9;
209 | }
210 | .weui-form-preview:after {
211 | content: " ";
212 | position: absolute;
213 | left: 0;
214 | bottom: 0;
215 | right: 0;
216 | height: 1px;
217 | border-bottom: 1rpx solid #D9D9D9;
218 | color: #D9D9D9;
219 | }
220 | .weui-form-preview__value {
221 | font-size: 14px;
222 | }
223 | .weui-form-preview__value_in-hd {
224 | font-size: 26px;
225 | }
226 | .weui-form-preview__hd {
227 | position: relative;
228 | padding: 10px 15px;
229 | text-align: right;
230 | line-height: 2.5em;
231 | }
232 | .weui-form-preview__hd:after {
233 | content: " ";
234 | position: absolute;
235 | left: 0;
236 | bottom: 0;
237 | right: 0;
238 | height: 1px;
239 | border-bottom: 1rpx solid #D9D9D9;
240 | color: #D9D9D9;
241 | left: 15px;
242 | }
243 | .weui-form-preview__bd {
244 | padding: 10px 15px;
245 | font-size: .9em;
246 | text-align: right;
247 | color: #999999;
248 | line-height: 2;
249 | }
250 | .weui-form-preview__ft {
251 | position: relative;
252 | line-height: 50px;
253 | display: -webkit-box;
254 | display: -webkit-flex;
255 | display: flex;
256 | }
257 | .weui-form-preview__ft:after {
258 | content: " ";
259 | position: absolute;
260 | left: 0;
261 | top: 0;
262 | right: 0;
263 | height: 1px;
264 | border-top: 1rpx solid #D5D5D6;
265 | color: #D5D5D6;
266 | }
267 | .weui-form-preview__item {
268 | overflow: hidden;
269 | }
270 | .weui-form-preview__label {
271 | float: left;
272 | margin-right: 1em;
273 | min-width: 4em;
274 | color: #999999;
275 | text-align: justify;
276 | text-align-last: justify;
277 | }
278 | .weui-form-preview__value {
279 | display: block;
280 | overflow: hidden;
281 | word-break: normal;
282 | word-wrap: break-word;
283 | }
284 | .weui-form-preview__btn {
285 | position: relative;
286 | display: block;
287 | -webkit-box-flex: 1;
288 | -webkit-flex: 1;
289 | flex: 1;
290 | color: #3CC51F;
291 | text-align: center;
292 | }
293 | .weui-form-preview__btn:after {
294 | content: " ";
295 | position: absolute;
296 | left: 0;
297 | top: 0;
298 | width: 1px;
299 | bottom: 0;
300 | border-left: 1rpx solid #D5D5D6;
301 | color: #D5D5D6;
302 | }
303 | .weui-form-preview__btn:first-child:after {
304 | display: none;
305 | }
306 | .weui-form-preview__btn_active {
307 | background-color: #EEEEEE;
308 | }
309 | .weui-form-preview__btn_default {
310 | color: #999999;
311 | }
312 | .weui-form-preview__btn_primary {
313 | color: #0BB20C;
314 | }
315 | .weui-cell_select {
316 | padding: 0;
317 | }
318 | .weui-select {
319 | position: relative;
320 | padding-left: 15px;
321 | padding-right: 30px;
322 | height: 2.58823529em;
323 | min-height: 2.58823529em;
324 | line-height: 2.58823529em;
325 | border-right: 1rpx solid #D9D9D9;
326 | }
327 | .weui-select:before {
328 | content: " ";
329 | display: inline-block;
330 | height: 6px;
331 | width: 6px;
332 | border-width: 2px 2px 0 0;
333 | border-color: #C8C8CD;
334 | border-style: solid;
335 | -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
336 | transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
337 | position: relative;
338 | top: -2px;
339 | position: absolute;
340 | top: 50%;
341 | right: 15px;
342 | margin-top: -4px;
343 | }
344 | .weui-select_in-select-after {
345 | padding-left: 0;
346 | }
347 | .weui-cell__hd_in-select-after,
348 | .weui-cell__bd_in-select-before {
349 | padding-left: 15px;
350 | }
351 | .weui-cell_vcode {
352 | padding-right: 0;
353 | }
354 | .weui-vcode-img {
355 | margin-left: 5px;
356 | height: 2.58823529em;
357 | vertical-align: middle;
358 | }
359 | .weui-vcode-btn {
360 | display: inline-block;
361 | height: 2.58823529em;
362 | margin-left: 5px;
363 | padding: 0 0.6em 0 0.7em;
364 | border-left: 1px solid #E5E5E5;
365 | line-height: 2.58823529em;
366 | vertical-align: middle;
367 | font-size: 17px;
368 | color: #3CC51F;
369 | white-space: nowrap;
370 | }
371 | .weui-vcode-btn:active {
372 | color: #52a341;
373 | }
374 | .weui-cell_switch {
375 | padding-top: 6px;
376 | padding-bottom: 6px;
377 | }
378 | .weui-uploader__hd {
379 | display: -webkit-box;
380 | display: -webkit-flex;
381 | display: flex;
382 | padding-bottom: 10px;
383 | -webkit-box-align: center;
384 | -webkit-align-items: center;
385 | align-items: center;
386 | }
387 | .weui-uploader__title {
388 | -webkit-box-flex: 1;
389 | -webkit-flex: 1;
390 | flex: 1;
391 | }
392 | .weui-uploader__info {
393 | color: #B2B2B2;
394 | }
395 | .weui-uploader__bd {
396 | margin-bottom: -4px;
397 | margin-right: -9px;
398 | overflow: hidden;
399 | }
400 | .weui-uploader__file {
401 | float: left;
402 | margin-right: 9px;
403 | margin-bottom: 9px;
404 | }
405 | .weui-uploader__img {
406 | display: block;
407 | width: 79px;
408 | height: 79px;
409 | }
410 | .weui-uploader__file_status {
411 | position: relative;
412 | }
413 | .weui-uploader__file_status:before {
414 | content: " ";
415 | position: absolute;
416 | top: 0;
417 | right: 0;
418 | bottom: 0;
419 | left: 0;
420 | background-color: rgba(0, 0, 0, 0.5);
421 | }
422 | .weui-uploader__file-content {
423 | position: absolute;
424 | top: 50%;
425 | left: 50%;
426 | -webkit-transform: translate(-50%, -50%);
427 | transform: translate(-50%, -50%);
428 | color: #FFFFFF;
429 | }
430 | .weui-uploader__input-box {
431 | float: left;
432 | position: relative;
433 | margin-right: 9px;
434 | margin-bottom: 9px;
435 | width: 77px;
436 | height: 77px;
437 | border: 1px solid #D9D9D9;
438 | }
439 | .weui-uploader__input-box:before,
440 | .weui-uploader__input-box:after {
441 | content: " ";
442 | position: absolute;
443 | top: 50%;
444 | left: 50%;
445 | -webkit-transform: translate(-50%, -50%);
446 | transform: translate(-50%, -50%);
447 | background-color: #D9D9D9;
448 | }
449 | .weui-uploader__input-box:before {
450 | width: 2px;
451 | height: 39.5px;
452 | }
453 | .weui-uploader__input-box:after {
454 | width: 39.5px;
455 | height: 2px;
456 | }
457 | .weui-uploader__input-box:active {
458 | border-color: #999999;
459 | }
460 | .weui-uploader__input-box:active:before,
461 | .weui-uploader__input-box:active:after {
462 | background-color: #999999;
463 | }
464 | .weui-uploader__input {
465 | position: absolute;
466 | z-index: 1;
467 | top: 0;
468 | left: 0;
469 | width: 100%;
470 | height: 100%;
471 | opacity: 0;
472 | }
473 | .weui-article {
474 | padding: 20px 15px;
475 | font-size: 15px;
476 | }
477 | .weui-article__section {
478 | margin-bottom: 1.5em;
479 | }
480 | .weui-article__h1 {
481 | font-size: 18px;
482 | font-weight: 400;
483 | margin-bottom: .9em;
484 | }
485 | .weui-article__h2 {
486 | font-size: 16px;
487 | font-weight: 400;
488 | margin-bottom: .34em;
489 | }
490 | .weui-article__h3 {
491 | font-weight: 400;
492 | font-size: 15px;
493 | margin-bottom: .34em;
494 | }
495 | .weui-article__p {
496 | margin: 0 0 .8em;
497 | }
498 | .weui-msg {
499 | padding-top: 36px;
500 | text-align: center;
501 | }
502 | .weui-msg__link {
503 | display: inline;
504 | color: #586C94;
505 | }
506 | .weui-msg__icon-area {
507 | margin-bottom: 30px;
508 | }
509 | .weui-msg__text-area {
510 | margin-bottom: 25px;
511 | padding: 0 20px;
512 | }
513 | .weui-msg__title {
514 | margin-bottom: 5px;
515 | font-weight: 400;
516 | font-size: 20px;
517 | }
518 | .weui-msg__desc {
519 | font-size: 14px;
520 | color: #999999;
521 | }
522 | .weui-msg__opr-area {
523 | margin-bottom: 25px;
524 | }
525 | .weui-msg__extra-area {
526 | margin-bottom: 15px;
527 | font-size: 14px;
528 | color: #999999;
529 | }
530 | @media screen and (min-height: 438px) {
531 | .weui-msg__extra-area {
532 | position: fixed;
533 | left: 0;
534 | bottom: 0;
535 | width: 100%;
536 | text-align: center;
537 | }
538 | }
539 | .weui-flex {
540 | display: -webkit-box;
541 | display: -webkit-flex;
542 | display: flex;
543 | }
544 | .weui-flex__item {
545 | -webkit-box-flex: 1;
546 | -webkit-flex: 1;
547 | flex: 1;
548 | }
549 | .weui-btn {
550 | margin-top: 15px;
551 | }
552 | .weui-btn:first-child {
553 | margin-top: 0;
554 | }
555 | .weui-btn-area {
556 | margin: 1.17647059em 15px 0.3em;
557 | }
558 | .weui-agree {
559 | display: block;
560 | padding: .5em 15px;
561 | font-size: 13px;
562 | }
563 | .weui-agree__text {
564 | color: #999999;
565 | }
566 | .weui-agree__link {
567 | display: inline;
568 | color: #586C94;
569 | }
570 | .weui-agree__checkbox {
571 | position: absolute;
572 | left: -9999px;
573 | }
574 | .weui-agree__checkbox-icon {
575 | position: relative;
576 | top: 2px;
577 | display: inline-block;
578 | border: 1px solid #D1D1D1;
579 | background-color: #FFFFFF;
580 | border-radius: 3px;
581 | width: 11px;
582 | height: 11px;
583 | }
584 | .weui-agree__checkbox-icon-check {
585 | position: absolute;
586 | top: 1px;
587 | left: 1px;
588 | }
589 | .weui-footer {
590 | color: #999999;
591 | font-size: 14px;
592 | text-align: center;
593 | }
594 | .weui-footer_fixed-bottom {
595 | position: fixed;
596 | bottom: .52em;
597 | left: 0;
598 | right: 0;
599 | }
600 | .weui-footer__links {
601 | font-size: 0;
602 | }
603 | .weui-footer__link {
604 | display: inline-block;
605 | vertical-align: top;
606 | margin: 0 .62em;
607 | position: relative;
608 | font-size: 14px;
609 | color: #586C94;
610 | }
611 | .weui-footer__link:before {
612 | content: " ";
613 | position: absolute;
614 | left: 0;
615 | top: 0;
616 | width: 1px;
617 | bottom: 0;
618 | border-left: 1rpx solid #C7C7C7;
619 | color: #C7C7C7;
620 | left: -0.65em;
621 | top: .36em;
622 | bottom: .36em;
623 | }
624 | .weui-footer__link:first-child:before {
625 | display: none;
626 | }
627 | .weui-footer__text {
628 | padding: 0 .34em;
629 | font-size: 12px;
630 | }
631 | .weui-grids {
632 | border-top: 1rpx solid #D9D9D9;
633 | border-left: 1rpx solid #D9D9D9;
634 | overflow: hidden;
635 | }
636 | .weui-grid {
637 | position: relative;
638 | float: left;
639 | padding: 20px 10px;
640 | width: 33.33333333%;
641 | box-sizing: border-box;
642 | border-right: 1rpx solid #D9D9D9;
643 | border-bottom: 1rpx solid #D9D9D9;
644 | }
645 | .weui-grid_active {
646 | background-color: #ECECEC;
647 | }
648 | .weui-grid__icon {
649 | display: block;
650 | width: 28px;
651 | height: 28px;
652 | margin: 0 auto;
653 | }
654 | .weui-grid__label {
655 | margin-top: 5px;
656 | display: block;
657 | text-align: center;
658 | color: #000000;
659 | font-size: 14px;
660 | white-space: nowrap;
661 | text-overflow: ellipsis;
662 | overflow: hidden;
663 | }
664 | .weui-loading {
665 | margin: 0 5px;
666 | width: 20px;
667 | height: 20px;
668 | display: inline-block;
669 | vertical-align: middle;
670 | -webkit-animation: weuiLoading 1s steps(12, end) infinite;
671 | animation: weuiLoading 1s steps(12, end) infinite;
672 | background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsbD0ibm9uZSIgZD0iTTAgMGgxMDB2MTAwSDB6Ii8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTlFOUU5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTMwKSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iIzk4OTY5NyIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgzMCAxMDUuOTggNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjOUI5OTlBIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDYwIDc1Ljk4IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0EzQTFBMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSg5MCA2NSA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNBQkE5QUEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoMTIwIDU4LjY2IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0IyQjJCMiIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgxNTAgNTQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjQkFCOEI5IiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKDE4MCA1MCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDMkMwQzEiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTE1MCA0NS45OCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNDQkNCQ0IiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTEyMCA0MS4zNCA2NSkiLz48cmVjdCB3aWR0aD0iNyIgaGVpZ2h0PSIyMCIgeD0iNDYuNSIgeT0iNDAiIGZpbGw9IiNEMkQyRDIiIHJ4PSI1IiByeT0iNSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDM1IDY1KSIvPjxyZWN0IHdpZHRoPSI3IiBoZWlnaHQ9IjIwIiB4PSI0Ni41IiB5PSI0MCIgZmlsbD0iI0RBREFEQSIgcng9IjUiIHJ5PSI1IiB0cmFuc2Zvcm09InJvdGF0ZSgtNjAgMjQuMDIgNjUpIi8+PHJlY3Qgd2lkdGg9IjciIGhlaWdodD0iMjAiIHg9IjQ2LjUiIHk9IjQwIiBmaWxsPSIjRTJFMkUyIiByeD0iNSIgcnk9IjUiIHRyYW5zZm9ybT0icm90YXRlKC0zMCAtNS45OCA2NSkiLz48L3N2Zz4=) no-repeat;
673 | background-size: 100%;
674 | }
675 | .weui-loading.weui-loading_transparent {
676 | background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect xmlns='http://www.w3.org/2000/svg' width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.56)' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.5)' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.43)' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.38)' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.32)' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.28)' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.25)' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.2)' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.17)' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.14)' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.1)' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='rgba(255,255,255,.03)' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E");
677 | }
678 | @-webkit-keyframes weuiLoading {
679 | 0% {
680 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
681 | transform: rotate3d(0, 0, 1, 0deg);
682 | }
683 | 100% {
684 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
685 | transform: rotate3d(0, 0, 1, 360deg);
686 | }
687 | }
688 | @keyframes weuiLoading {
689 | 0% {
690 | -webkit-transform: rotate3d(0, 0, 1, 0deg);
691 | transform: rotate3d(0, 0, 1, 0deg);
692 | }
693 | 100% {
694 | -webkit-transform: rotate3d(0, 0, 1, 360deg);
695 | transform: rotate3d(0, 0, 1, 360deg);
696 | }
697 | }
698 | .weui-badge {
699 | display: inline-block;
700 | padding: .15em .4em;
701 | min-width: 8px;
702 | border-radius: 18px;
703 | background-color: #E64340;
704 | color: #FFFFFF;
705 | line-height: 1.2;
706 | text-align: center;
707 | font-size: 12px;
708 | vertical-align: middle;
709 | }
710 | .weui-badge_dot {
711 | padding: .4em;
712 | min-width: 0;
713 | }
714 | .weui-loadmore {
715 | width: 65%;
716 | margin: 1.5em auto;
717 | line-height: 1.6em;
718 | font-size: 14px;
719 | text-align: center;
720 | }
721 | .weui-loadmore__tips {
722 | display: inline-block;
723 | vertical-align: middle;
724 | }
725 | .weui-loadmore_line {
726 | border-top: 1px solid #E5E5E5;
727 | margin-top: 2.4em;
728 | }
729 | .weui-loadmore__tips_in-line {
730 | position: relative;
731 | top: -0.9em;
732 | padding: 0 .55em;
733 | background-color: #FFFFFF;
734 | color: #999999;
735 | }
736 | .weui-loadmore__tips_in-dot {
737 | position: relative;
738 | padding: 0 .16em;
739 | width: 4px;
740 | height: 1.6em;
741 | }
742 | .weui-loadmore__tips_in-dot:before {
743 | content: " ";
744 | position: absolute;
745 | top: 50%;
746 | left: 50%;
747 | margin-top: -1px;
748 | margin-left: -2px;
749 | width: 4px;
750 | height: 4px;
751 | border-radius: 50%;
752 | background-color: #E5E5E5;
753 | }
754 | .weui-panel {
755 | background-color: #FFFFFF;
756 | margin-top: 10px;
757 | position: relative;
758 | overflow: hidden;
759 | }
760 | .weui-panel:first-child {
761 | margin-top: 0;
762 | }
763 | .weui-panel:before {
764 | content: " ";
765 | position: absolute;
766 | left: 0;
767 | top: 0;
768 | right: 0;
769 | height: 1px;
770 | border-top: 1rpx solid #E5E5E5;
771 | color: #E5E5E5;
772 | }
773 | .weui-panel:after {
774 | content: " ";
775 | position: absolute;
776 | left: 0;
777 | bottom: 0;
778 | right: 0;
779 | height: 1px;
780 | border-bottom: 1rpx solid #E5E5E5;
781 | color: #E5E5E5;
782 | }
783 | .weui-panel__hd {
784 | padding: 14px 15px 10px;
785 | color: #999999;
786 | font-size: 13px;
787 | position: relative;
788 | }
789 | .weui-panel__hd:after {
790 | content: " ";
791 | position: absolute;
792 | left: 0;
793 | bottom: 0;
794 | right: 0;
795 | height: 1px;
796 | border-bottom: 1rpx solid #E5E5E5;
797 | color: #E5E5E5;
798 | left: 15px;
799 | }
800 | .weui-media-box {
801 | padding: 15px;
802 | position: relative;
803 | }
804 | .weui-media-box:before {
805 | content: " ";
806 | position: absolute;
807 | left: 0;
808 | top: 0;
809 | right: 0;
810 | height: 1px;
811 | border-top: 1rpx solid #E5E5E5;
812 | color: #E5E5E5;
813 | left: 15px;
814 | }
815 | .weui-media-box:first-child:before {
816 | display: none;
817 | }
818 | .weui-media-box__title {
819 | font-weight: 400;
820 | font-size: 17px;
821 | width: auto;
822 | overflow: hidden;
823 | text-overflow: ellipsis;
824 | white-space: nowrap;
825 | word-wrap: normal;
826 | word-wrap: break-word;
827 | word-break: break-all;
828 | }
829 | .weui-media-box__desc {
830 | color: #999999;
831 | font-size: 13px;
832 | line-height: 1.2;
833 | overflow: hidden;
834 | text-overflow: ellipsis;
835 | display: -webkit-box;
836 | -webkit-box-orient: vertical;
837 | -webkit-line-clamp: 2;
838 | }
839 | .weui-media-box__info {
840 | margin-top: 15px;
841 | padding-bottom: 5px;
842 | font-size: 13px;
843 | color: #CECECE;
844 | line-height: 1em;
845 | list-style: none;
846 | overflow: hidden;
847 | }
848 | .weui-media-box__info__meta {
849 | float: left;
850 | padding-right: 1em;
851 | }
852 | .weui-media-box__info__meta_extra {
853 | padding-left: 1em;
854 | border-left: 1px solid #CECECE;
855 | }
856 | .weui-media-box__title_in-text {
857 | margin-bottom: 8px;
858 | }
859 | .weui-media-box_appmsg {
860 | display: -webkit-box;
861 | display: -webkit-flex;
862 | display: flex;
863 | -webkit-box-align: center;
864 | -webkit-align-items: center;
865 | align-items: center;
866 | }
867 | .weui-media-box__thumb {
868 | width: 100%;
869 | height: 100%;
870 | vertical-align: top;
871 | }
872 | .weui-media-box__hd_in-appmsg {
873 | margin-right: .8em;
874 | width: 60px;
875 | height: 60px;
876 | line-height: 60px;
877 | text-align: center;
878 | }
879 | .weui-media-box__bd_in-appmsg {
880 | -webkit-box-flex: 1;
881 | -webkit-flex: 1;
882 | flex: 1;
883 | min-width: 0;
884 | }
885 | .weui-media-box_small-appmsg {
886 | padding: 0;
887 | }
888 | .weui-cells_in-small-appmsg {
889 | margin-top: 0;
890 | }
891 | .weui-cells_in-small-appmsg:before {
892 | display: none;
893 | }
894 | .weui-progress {
895 | display: -webkit-box;
896 | display: -webkit-flex;
897 | display: flex;
898 | -webkit-box-align: center;
899 | -webkit-align-items: center;
900 | align-items: center;
901 | }
902 | .weui-progress__bar {
903 | -webkit-box-flex: 1;
904 | -webkit-flex: 1;
905 | flex: 1;
906 | }
907 | .weui-progress__opr {
908 | margin-left: 15px;
909 | font-size: 0;
910 | }
911 | .weui-navbar {
912 | display: -webkit-box;
913 | display: -webkit-flex;
914 | display: flex;
915 | position: absolute;
916 | z-index: 500;
917 | top: 0;
918 | width: 100%;
919 | border-bottom: 1rpx solid #CCCCCC;
920 | }
921 | .weui-navbar__item {
922 | position: relative;
923 | display: block;
924 | -webkit-box-flex: 1;
925 | -webkit-flex: 1;
926 | flex: 1;
927 | padding: 13px 0;
928 | text-align: center;
929 | font-size: 0;
930 | }
931 | .weui-navbar__item.weui-bar__item_on {
932 | color: #1AAD19;
933 | }
934 | .weui-navbar__slider {
935 | position: absolute;
936 | content: " ";
937 | left: 0;
938 | bottom: 0;
939 | width: 6em;
940 | height: 3px;
941 | background-color: #1AAD19;
942 | -webkit-transition: -webkit-transform .3s;
943 | transition: -webkit-transform .3s;
944 | transition: transform .3s;
945 | transition: transform .3s, -webkit-transform .3s;
946 | }
947 | .weui-navbar__title {
948 | display: inline-block;
949 | font-size: 15px;
950 | max-width: 8em;
951 | width: auto;
952 | overflow: hidden;
953 | text-overflow: ellipsis;
954 | white-space: nowrap;
955 | word-wrap: normal;
956 | }
957 | .weui-tab {
958 | position: relative;
959 | height: 100%;
960 | }
961 | .weui-tab__panel {
962 | box-sizing: border-box;
963 | height: 100%;
964 | padding-top: 50px;
965 | overflow: auto;
966 | -webkit-overflow-scrolling: touch;
967 | }
968 | .weui-search-bar {
969 | position: relative;
970 | padding: 8px 10px;
971 | display: -webkit-box;
972 | display: -webkit-flex;
973 | display: flex;
974 | box-sizing: border-box;
975 | background-color: #EFEFF4;
976 | border-top: 1rpx solid #D7D6DC;
977 | border-bottom: 1rpx solid #D7D6DC;
978 | }
979 | .weui-icon-search {
980 | margin-right: 8px;
981 | font-size: inherit;
982 | }
983 | .weui-icon-search_in-box {
984 | position: absolute;
985 | left: 10px;
986 | top: 7px;
987 | }
988 | .weui-search-bar__text {
989 | display: inline-block;
990 | font-size: 14px;
991 | vertical-align: middle;
992 | }
993 | .weui-search-bar__form {
994 | position: relative;
995 | -webkit-box-flex: 1;
996 | -webkit-flex: auto;
997 | flex: auto;
998 | border-radius: 5px;
999 | background: #FFFFFF;
1000 | border: 1rpx solid #E6E6EA;
1001 | }
1002 | .weui-search-bar__box {
1003 | position: relative;
1004 | padding-left: 30px;
1005 | padding-right: 30px;
1006 | width: 100%;
1007 | box-sizing: border-box;
1008 | z-index: 1;
1009 | }
1010 | .weui-search-bar__input {
1011 | height: 28px;
1012 | line-height: 28px;
1013 | font-size: 14px;
1014 | }
1015 | .weui-icon-clear {
1016 | position: absolute;
1017 | top: 0;
1018 | right: 0;
1019 | padding: 7px 8px;
1020 | font-size: 0;
1021 | }
1022 | .weui-search-bar__label {
1023 | position: absolute;
1024 | top: 0;
1025 | right: 0;
1026 | bottom: 0;
1027 | left: 0;
1028 | z-index: 2;
1029 | border-radius: 3px;
1030 | text-align: center;
1031 | color: #9B9B9B;
1032 | background: #FFFFFF;
1033 | line-height: 28px;
1034 | }
1035 | .weui-search-bar__cancel-btn {
1036 | margin-left: 10px;
1037 | line-height: 28px;
1038 | color: #09BB07;
1039 | white-space: nowrap;
1040 | }
1041 |
--------------------------------------------------------------------------------