正在显示
9 个修改的文件
包含
425 行增加
和
104 行删除
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | "window": { | 21 | "window": { |
22 | "backgroundTextStyle": "light", | 22 | "backgroundTextStyle": "light", |
23 | "navigationBarBackgroundColor": "#fff", | 23 | "navigationBarBackgroundColor": "#fff", |
24 | - "navigationBarTitleText": "团购商城", | 24 | + "navigationBarTitleText": "壹万商城", |
25 | "navigationBarTextStyle": "black" | 25 | "navigationBarTextStyle": "black" |
26 | }, | 26 | }, |
27 | "tabBar": { | 27 | "tabBar": { |
iconfont/iconfont.wxss
0 → 100644
1 | +@font-face {font-family: "iconfont"; | ||
2 | + src: url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.eot?t=1557278553716'); /* IE9 */ | ||
3 | + src: url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.eot?t=1557278553716#iefix') format('embedded-opentype'), /* IE6-IE8 */ | ||
4 | + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKAAAsAAAAABigAAAI0AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAosRwE2AiQDCAsGAAQgBYRtBzYbcwUR1Yshsj9AJre6AwBJRxHkIEu13DMydnmg7MP5ASaFryABAAAAAOLhv/1Y9/0ZVJNq4lBNmmgik/DQNUFqhEgo0PEIq3GTJiDPRIKDAPTZwif+zWnqv0UmSIBkwuedk3vIK0M+R+lgqADB5lfWewAkApRyMQz5PJfTu10cyPxAue5BY02aNIB6cUCB7YlRZAUSesPYBS/wMYFKHcbEwuX9O5TL7FWB2E9BQ3khLMssVy6UNhzM4gZKlBdXx3tcR9+P78ajnEJJYjes7V04mPngFCT/dgMCIgR0vAQJY8jEVmN6RRJMlFSmsx6OVRt8+P8/cImj2gX76+zqatAGM8EHb6UABTwWpb960nSi9MCHF0d/nbOFmw8z4L+jtPpVMPl76v6lDB5f0ZL/zktdKF/PE7y/cmBPNtS2s8iasnG4ULrfpkqV+B/2N3qfamk5WT6Ua5ngLdOeISnXR2Z2DCWqTKBUuWlUGrV8vEqTU0nkCow4Awj1blGodYek3gOZ2TeUaPUTpeojodJOdGGVgTCTWkkLOTS/mCyv3nWLimtfKeyzrnl1JP6kuqUYDm1fzl3RSnWJLdtXGEU8+soLXoLnaJ4ZS+VMVtooUk5d55ve1FpeQMFKWsih+cVkefXBaFGVz79S2GddO7rqip9UtzQ5Dm0/gLwyrIO6HuWV7SuMIh595QUvwTyaZ8bSPC+TlTZOSJZT5wzyQw3t9qbl744BoMC2Hg/O7kROehXeG8vlFwAAAA==') format('woff2'), | ||
5 | + url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.woff?t=1557278553716') format('woff'), | ||
6 | + url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.ttf?t=1557278553716') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ | ||
7 | + url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.svg?t=1557278553716#iconfont') format('svg'); /* iOS 4.1- */ | ||
8 | +} | ||
9 | + | ||
10 | +.iconfont { | ||
11 | + font-family: "iconfont" !important; | ||
12 | + font-size: 16px; | ||
13 | + font-style: normal; | ||
14 | + -webkit-font-smoothing: antialiased; | ||
15 | + -moz-osx-font-smoothing: grayscale; | ||
16 | +} | ||
17 | + | ||
18 | +.icon-jiantou-copy:before { | ||
19 | + content: "\e667"; | ||
20 | +} | ||
21 | + | ||
22 | + | ||
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | ||
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | ||
37 | + | ||
38 | + | ||
39 | + | ||
40 | + | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | +/* 按钮样式 */ | ||
58 | +.clearshop{ | ||
59 | + width:212rpx; | ||
60 | + height:61rpx; | ||
61 | + background:rgba(21,39,109,1); | ||
62 | + box-shadow:0rpx 0rpx 20rpx 0rpx rgba(4,0,0,0.2); | ||
63 | + color:#fff; | ||
64 | + font-size: 28rpx; | ||
65 | + line-height:61rpx; | ||
66 | + text-align: center; | ||
67 | + border-top-left-radius: 16rpx; | ||
68 | + border-bottom-right-radius: 16rpx; | ||
69 | + margin:60rpx auto 0; | ||
70 | +} | ||
71 | + | ||
72 | +/* 客服弹层 */ | ||
73 | + | ||
74 | +.kefuregister{ | ||
75 | + width: 100%; | ||
76 | + height: 100%; | ||
77 | + background-color: rgba(0,0,0,0.5); | ||
78 | + position:fixed; | ||
79 | + left:0; | ||
80 | + right:0; | ||
81 | + z-index: 5; | ||
82 | + } | ||
83 | +.kefuwrap{ | ||
84 | + width:465rpx; | ||
85 | + height:195rpx; | ||
86 | + background: #ffffff; | ||
87 | + border-radius: 10rpx; | ||
88 | + position: absolute; | ||
89 | + z-index: 6; | ||
90 | + /*left:0.4rem;*/ | ||
91 | + /*top: 3rem;*/ | ||
92 | + top:50%; | ||
93 | + left:50%; | ||
94 | + transform: translate(-50%,-50%); | ||
95 | + | ||
96 | + | ||
97 | +} | ||
98 | + | ||
99 | +.pohone{ | ||
100 | + width:300rpx; | ||
101 | + margin:65rpx auto; | ||
102 | + color:#15276D; | ||
103 | + font-size: 36rpx; | ||
104 | + text-align: center; | ||
105 | + border-bottom:1rpx solid #15276D; | ||
106 | + | ||
107 | +} | ||
108 | +.kefucancel{ | ||
109 | + text-align: center; | ||
110 | + position: absolute; | ||
111 | + top:112%; | ||
112 | + left:0; | ||
113 | + right:0; | ||
114 | + /* transform: translate(112%,-50%); */ | ||
115 | + margin:0 auto; | ||
116 | + z-index: 999; | ||
117 | + color:#fff; | ||
118 | + font-size: 60rpx !important; | ||
119 | +} | ||
120 | +/* 暂无数据 */ | ||
121 | +.nodata{ | ||
122 | + color:#999; | ||
123 | + font-size: 26rpx; | ||
124 | + text-align: center; | ||
125 | + margin-top: 20rpx; | ||
126 | +} | ||
127 | + | ||
128 | +/* 没有产品的提示 */ | ||
129 | +.quewrap{ | ||
130 | + width:465rpx; | ||
131 | + height:245rpx; | ||
132 | + background: #4c4c4c; | ||
133 | + border-radius: 10rpx; | ||
134 | + position: absolute; | ||
135 | + | ||
136 | + /*left:0.4rem;*/ | ||
137 | + /*top: 3rem;*/ | ||
138 | + top:50%; | ||
139 | + left:50%; | ||
140 | + transform: translate(-50%,-50%); | ||
141 | + /* opacity: 0.8; */ | ||
142 | + z-index:999; | ||
143 | + padding: 20rpx 30rpx; | ||
144 | + box-sizing: border-box | ||
145 | + | ||
146 | + | ||
147 | +} | ||
148 | +.tishi{ | ||
149 | + color:#82a7f5; | ||
150 | + font-size: 36rpx; | ||
151 | + margin-left:14rpx; | ||
152 | + margin-top:15rpx; | ||
153 | +} | ||
154 | +.product{ | ||
155 | + margin-left:14rpx; | ||
156 | + color:#fff; | ||
157 | + font-size: 30rpx; | ||
158 | + margin-top:22rpx; | ||
159 | +} |
img/bac.jpg
0 → 100644
244.0 KB
@@ -20,9 +20,13 @@ page { | @@ -20,9 +20,13 @@ page { | ||
20 | } | 20 | } |
21 | 21 | ||
22 | .beginimg { | 22 | .beginimg { |
23 | - width: 750rpx; | ||
24 | - height: 100%; | ||
25 | - position: relative | 23 | + width: 500rpx; |
24 | + height: 500rpx; | ||
25 | + position:absolute; | ||
26 | + top:40%; | ||
27 | + left:50%; | ||
28 | + transform: translate(-50%,-40%) | ||
29 | + | ||
26 | } | 30 | } |
27 | 31 | ||
28 | .beginimg image { | 32 | .beginimg image { |
@@ -13,40 +13,40 @@ Page({ | @@ -13,40 +13,40 @@ Page({ | ||
13 | detail_id: null, | 13 | detail_id: null, |
14 | detailCon: {}, | 14 | detailCon: {}, |
15 | assess: [], | 15 | assess: [], |
16 | - id:'', | 16 | + id: '', |
17 | days: 0, | 17 | days: 0, |
18 | hours: 0, | 18 | hours: 0, |
19 | minutes: 0, | 19 | minutes: 0, |
20 | seconds: 0, | 20 | seconds: 0, |
21 | - over:true, | ||
22 | - short:[], | ||
23 | - seemore:true, | ||
24 | - images:[] | 21 | + over: true, |
22 | + short: [], | ||
23 | + seemore: true, | ||
24 | + images: [] | ||
25 | }, | 25 | }, |
26 | 26 | ||
27 | /** | 27 | /** |
28 | * 生命周期函数--监听页面加载 | 28 | * 生命周期函数--监听页面加载 |
29 | */ | 29 | */ |
30 | - onLoad: function (options) { | 30 | + onLoad: function(options) { |
31 | console.log(options) | 31 | console.log(options) |
32 | this.setData({ | 32 | this.setData({ |
33 | detail_id: options.id, | 33 | detail_id: options.id, |
34 | - id:options.id | 34 | + id: options.id |
35 | }) | 35 | }) |
36 | this.detaiFun(options.id) | 36 | this.detaiFun(options.id) |
37 | - | 37 | + |
38 | }, | 38 | }, |
39 | - slectpic(e){ | ||
40 | - let that=this; | 39 | + slectpic(e) { |
40 | + let that = this; | ||
41 | console.log(e) | 41 | console.log(e) |
42 | - let idx=e.currentTarget.dataset.idx; | 42 | + let idx = e.currentTarget.dataset.idx; |
43 | let newassess = that.data.assess; | 43 | let newassess = that.data.assess; |
44 | - for (var i = 0; i < newassess.length;i++){ | ||
45 | - if(i==idx){ | ||
46 | - that.setData({ | ||
47 | - images: newassess[i].img | ||
48 | - }) | ||
49 | - } | 44 | + for (var i = 0; i < newassess.length; i++) { |
45 | + if (i == idx) { | ||
46 | + that.setData({ | ||
47 | + images: newassess[i].img | ||
48 | + }) | ||
49 | + } | ||
50 | 50 | ||
51 | } | 51 | } |
52 | 52 | ||
@@ -54,7 +54,7 @@ Page({ | @@ -54,7 +54,7 @@ Page({ | ||
54 | }, | 54 | }, |
55 | 55 | ||
56 | // 图片预览 | 56 | // 图片预览 |
57 | - previewImage: function (e) { | 57 | + previewImage: function(e) { |
58 | 58 | ||
59 | let that = this; | 59 | let that = this; |
60 | console.log(e) | 60 | console.log(e) |
@@ -68,7 +68,7 @@ Page({ | @@ -68,7 +68,7 @@ Page({ | ||
68 | } | 68 | } |
69 | 69 | ||
70 | } | 70 | } |
71 | - | 71 | + |
72 | var current = e.target.dataset.src | 72 | var current = e.target.dataset.src |
73 | wx.previewImage({ | 73 | wx.previewImage({ |
74 | current: current, | 74 | current: current, |
@@ -77,26 +77,26 @@ Page({ | @@ -77,26 +77,26 @@ Page({ | ||
77 | }, | 77 | }, |
78 | 78 | ||
79 | //已成团 | 79 | //已成团 |
80 | - group(){ | 80 | + group() { |
81 | wx.showToast({ | 81 | wx.showToast({ |
82 | title: '商品已成团,无法继续购买', | 82 | title: '商品已成团,无法继续购买', |
83 | - icon:"none" | 83 | + icon: "none" |
84 | }) | 84 | }) |
85 | }, | 85 | }, |
86 | -//结束 | ||
87 | - gameover(){ | 86 | + //结束 |
87 | + gameover() { | ||
88 | wx.showToast({ | 88 | wx.showToast({ |
89 | title: '活动已结束', | 89 | title: '活动已结束', |
90 | - icon:"none" | 90 | + icon: "none" |
91 | }) | 91 | }) |
92 | }, | 92 | }, |
93 | - moresee(){ | 93 | + moresee() { |
94 | let that = this; | 94 | let that = this; |
95 | that.setData({ | 95 | that.setData({ |
96 | - seemore:false | 96 | + seemore: false |
97 | }) | 97 | }) |
98 | 98 | ||
99 | - | 99 | + |
100 | let url = "home/index/shopMessage"; | 100 | let url = "home/index/shopMessage"; |
101 | let header = { | 101 | let header = { |
102 | "XX-Token": wx.getStorageSync('token'), | 102 | "XX-Token": wx.getStorageSync('token'), |
@@ -108,23 +108,51 @@ Page({ | @@ -108,23 +108,51 @@ Page({ | ||
108 | app.post(url, params, header).then((res) => { | 108 | app.post(url, params, header).then((res) => { |
109 | console.log(res) | 109 | console.log(res) |
110 | let masarr = [] | 110 | let masarr = [] |
111 | - | 111 | + |
112 | that.setData({ | 112 | that.setData({ |
113 | // short: masarr, | 113 | // short: masarr, |
114 | //assess: res.data | 114 | //assess: res.data |
115 | - assess:res.data | 115 | + assess: res.data |
116 | }) | 116 | }) |
117 | }).catch((err) => { | 117 | }).catch((err) => { |
118 | console.log(err) | 118 | console.log(err) |
119 | }) | 119 | }) |
120 | }, | 120 | }, |
121 | 121 | ||
122 | - | ||
123 | - | 122 | + |
123 | + | ||
124 | goFirm_order1(e) { | 124 | goFirm_order1(e) { |
125 | - wx.navigateTo({ | ||
126 | - url: '../firm_order1/firm_order1?id=' + e.currentTarget.dataset.id + "&&num=" + this.data.num, | 125 | + let that = this; |
126 | + let url = '/user/index/checkNum', | ||
127 | + params = { | ||
128 | + num: that.data.num, | ||
129 | + shop_id: that.data.id | ||
130 | + | ||
131 | + } | ||
132 | + let header = { | ||
133 | + 'XX-Token': wx.getStorageSync("token"), | ||
134 | + 'XX-Device-Type': 'wxapp' | ||
135 | + } | ||
136 | + app.post(url, params).then((res) => { | ||
137 | + console.log(res); | ||
138 | + if (res.msg.msg == "可以购买") { | ||
139 | + wx.navigateTo({ | ||
140 | + url: '../firm_order1/firm_order1?id=' + e.currentTarget.dataset.id + "&&num=" + this.data.num, | ||
141 | + }) | ||
142 | + }else{ | ||
143 | + wx.showToast({ | ||
144 | + title: '库存不足', | ||
145 | + icon:"none" | ||
146 | + }) | ||
147 | + } | ||
148 | + | ||
149 | + | ||
150 | + | ||
151 | + }).catch((err) => { | ||
152 | + | ||
127 | }) | 153 | }) |
154 | + | ||
155 | + | ||
128 | }, | 156 | }, |
129 | 157 | ||
130 | // 商品详情数据 | 158 | // 商品详情数据 |
@@ -145,7 +173,7 @@ Page({ | @@ -145,7 +173,7 @@ Page({ | ||
145 | content: res.content | 173 | content: res.content |
146 | }) | 174 | }) |
147 | 175 | ||
148 | - | 176 | + |
149 | // WxParse.wxParse('content', 'html', this.data.content, this, 5); | 177 | // WxParse.wxParse('content', 'html', this.data.content, this, 5); |
150 | WxParse.wxParse('article', 'html', res.data.content, that, 5) | 178 | WxParse.wxParse('article', 'html', res.data.content, that, 5) |
151 | console.log(that.data.detailCon); | 179 | console.log(that.data.detailCon); |
@@ -157,7 +185,7 @@ Page({ | @@ -157,7 +185,7 @@ Page({ | ||
157 | var totalSecond = number; | 185 | var totalSecond = number; |
158 | console.log(totalSecond) | 186 | console.log(totalSecond) |
159 | 187 | ||
160 | - var interval = setInterval(function () { | 188 | + var interval = setInterval(function() { |
161 | // 秒数 | 189 | // 秒数 |
162 | var second = totalSecond; | 190 | var second = totalSecond; |
163 | // 天数位 | 191 | // 天数位 |
@@ -176,18 +204,18 @@ Page({ | @@ -176,18 +204,18 @@ Page({ | ||
176 | var sec = second - day * 3600 * 24 - hr * 3600 - min * 60; | 204 | var sec = second - day * 3600 * 24 - hr * 3600 - min * 60; |
177 | var secStr = sec.toString(); | 205 | var secStr = sec.toString(); |
178 | if (secStr.length == 1) secStr = '0' + secStr; | 206 | if (secStr.length == 1) secStr = '0' + secStr; |
179 | - | 207 | + |
180 | that.setData({ | 208 | that.setData({ |
181 | days: dayStr, | 209 | days: dayStr, |
182 | hours: hrStr, | 210 | hours: hrStr, |
183 | - minutes: minStr, | 211 | + minutes: minStr, |
184 | seconds: secStr, | 212 | seconds: secStr, |
185 | }); | 213 | }); |
186 | totalSecond--; | 214 | totalSecond--; |
187 | - | 215 | + |
188 | if (totalSecond <= 0) { | 216 | if (totalSecond <= 0) { |
189 | that.setData({ | 217 | that.setData({ |
190 | - over:false | 218 | + over: false |
191 | }) | 219 | }) |
192 | console.log(that.data.over) | 220 | console.log(that.data.over) |
193 | clearInterval(interval); | 221 | clearInterval(interval); |
@@ -205,7 +233,7 @@ Page({ | @@ -205,7 +233,7 @@ Page({ | ||
205 | }); | 233 | }); |
206 | } | 234 | } |
207 | }.bind(this), 1000); | 235 | }.bind(this), 1000); |
208 | - | 236 | + |
209 | 237 | ||
210 | }).catch((err) => { | 238 | }).catch((err) => { |
211 | console.log(err) | 239 | console.log(err) |
@@ -224,12 +252,12 @@ Page({ | @@ -224,12 +252,12 @@ Page({ | ||
224 | } | 252 | } |
225 | app.post(url, params, header).then((res) => { | 253 | app.post(url, params, header).then((res) => { |
226 | console.log(res) | 254 | console.log(res) |
227 | - let masarr=[] | ||
228 | - for (var i = 0; i < res.data.length;i++){ | ||
229 | - if(i<5){ | 255 | + let masarr = [] |
256 | + for (var i = 0; i < res.data.length; i++) { | ||
257 | + if (i < 5) { | ||
230 | masarr.push(res.data[i]) | 258 | masarr.push(res.data[i]) |
231 | } | 259 | } |
232 | - | 260 | + |
233 | } | 261 | } |
234 | that.setData({ | 262 | that.setData({ |
235 | // short: masarr, | 263 | // short: masarr, |
@@ -262,19 +290,19 @@ Page({ | @@ -262,19 +290,19 @@ Page({ | ||
262 | duration: 1500 | 290 | duration: 1500 |
263 | }) | 291 | }) |
264 | 292 | ||
265 | - setTimeout(function(){ | 293 | + setTimeout(function() { |
266 | that.detaiFun() | 294 | that.detaiFun() |
267 | - },1500) | 295 | + }, 1500) |
268 | 296 | ||
269 | // } | 297 | // } |
270 | }).catch((err) => { | 298 | }).catch((err) => { |
271 | console.log(err) | 299 | console.log(err) |
272 | wx.showToast({ | 300 | wx.showToast({ |
273 | title: err.msg, | 301 | title: err.msg, |
274 | - icon:'none' | 302 | + icon: 'none' |
275 | }) | 303 | }) |
276 | 304 | ||
277 | - setTimeout(function () { | 305 | + setTimeout(function() { |
278 | that.detaiFun() | 306 | that.detaiFun() |
279 | }, 1500) | 307 | }, 1500) |
280 | }) | 308 | }) |
@@ -283,25 +311,25 @@ Page({ | @@ -283,25 +311,25 @@ Page({ | ||
283 | this.setData({ | 311 | this.setData({ |
284 | index: e.currentTarget.dataset.id, | 312 | index: e.currentTarget.dataset.id, |
285 | }) | 313 | }) |
286 | - if (e.currentTarget.dataset.id==2){ | 314 | + if (e.currentTarget.dataset.id == 2) { |
287 | console.log(9909) | 315 | console.log(9909) |
288 | this.assessFun() | 316 | this.assessFun() |
289 | - }else{ | 317 | + } else { |
290 | this.detaiFun() | 318 | this.detaiFun() |
291 | } | 319 | } |
292 | }, | 320 | }, |
293 | - goConfirm: function () { | 321 | + goConfirm: function() { |
294 | this.setData({ | 322 | this.setData({ |
295 | showModal: true, | 323 | showModal: true, |
296 | }) | 324 | }) |
297 | }, | 325 | }, |
298 | - m_close: function () { | 326 | + m_close: function() { |
299 | this.setData({ | 327 | this.setData({ |
300 | showModal: false, | 328 | showModal: false, |
301 | }) | 329 | }) |
302 | }, | 330 | }, |
303 | // 点击加减 | 331 | // 点击加减 |
304 | - bindMinus: function () { | 332 | + bindMinus: function() { |
305 | var num = this.data.num; | 333 | var num = this.data.num; |
306 | if (num > 1) { | 334 | if (num > 1) { |
307 | num--; | 335 | num--; |
@@ -311,7 +339,7 @@ Page({ | @@ -311,7 +339,7 @@ Page({ | ||
311 | }); | 339 | }); |
312 | }, | 340 | }, |
313 | // 点击加 | 341 | // 点击加 |
314 | - bindPlus: function () { | 342 | + bindPlus: function() { |
315 | var num = this.data.num; | 343 | var num = this.data.num; |
316 | num++; | 344 | num++; |
317 | this.setData({ | 345 | this.setData({ |
@@ -321,49 +349,49 @@ Page({ | @@ -321,49 +349,49 @@ Page({ | ||
321 | /** | 349 | /** |
322 | * 生命周期函数--监听页面初次渲染完成 | 350 | * 生命周期函数--监听页面初次渲染完成 |
323 | */ | 351 | */ |
324 | - onReady: function () { | 352 | + onReady: function() { |
325 | 353 | ||
326 | }, | 354 | }, |
327 | 355 | ||
328 | /** | 356 | /** |
329 | * 生命周期函数--监听页面显示 | 357 | * 生命周期函数--监听页面显示 |
330 | */ | 358 | */ |
331 | - onShow: function () { | 359 | + onShow: function() { |
332 | 360 | ||
333 | }, | 361 | }, |
334 | 362 | ||
335 | /** | 363 | /** |
336 | * 生命周期函数--监听页面隐藏 | 364 | * 生命周期函数--监听页面隐藏 |
337 | */ | 365 | */ |
338 | - onHide: function () { | 366 | + onHide: function() { |
339 | 367 | ||
340 | }, | 368 | }, |
341 | 369 | ||
342 | /** | 370 | /** |
343 | * 生命周期函数--监听页面卸载 | 371 | * 生命周期函数--监听页面卸载 |
344 | */ | 372 | */ |
345 | - onUnload: function () { | 373 | + onUnload: function() { |
346 | 374 | ||
347 | }, | 375 | }, |
348 | 376 | ||
349 | /** | 377 | /** |
350 | * 页面相关事件处理函数--监听用户下拉动作 | 378 | * 页面相关事件处理函数--监听用户下拉动作 |
351 | */ | 379 | */ |
352 | - onPullDownRefresh: function () { | 380 | + onPullDownRefresh: function() { |
353 | 381 | ||
354 | }, | 382 | }, |
355 | 383 | ||
356 | /** | 384 | /** |
357 | * 页面上拉触底事件的处理函数 | 385 | * 页面上拉触底事件的处理函数 |
358 | */ | 386 | */ |
359 | - onReachBottom: function () { | 387 | + onReachBottom: function() { |
360 | 388 | ||
361 | }, | 389 | }, |
362 | 390 | ||
363 | /** | 391 | /** |
364 | * 用户点击右上角分享 | 392 | * 用户点击右上角分享 |
365 | */ | 393 | */ |
366 | - onShareAppMessage: function () { | 394 | + onShareAppMessage: function() { |
367 | 395 | ||
368 | } | 396 | } |
369 | }) | 397 | }) |
@@ -9,7 +9,7 @@ Page({ | @@ -9,7 +9,7 @@ Page({ | ||
9 | date: '2016-09-01', | 9 | date: '2016-09-01', |
10 | time: '12:01', | 10 | time: '12:01', |
11 | region: ['请选择', '请选择', '请选择'], | 11 | region: ['请选择', '请选择', '请选择'], |
12 | - selectregion:"请选择省市区", | 12 | + selectregion: "请选择省市区", |
13 | // customItem: '全部', | 13 | // customItem: '全部', |
14 | 14 | ||
15 | status: false, | 15 | status: false, |
@@ -23,28 +23,36 @@ Page({ | @@ -23,28 +23,36 @@ Page({ | ||
23 | county: '', | 23 | county: '', |
24 | address: '', | 24 | address: '', |
25 | type: 0, | 25 | type: 0, |
26 | - noorder:'', | ||
27 | - noorderid:'', | ||
28 | - num:'' | 26 | + noorder: '', |
27 | + noorderid: '', | ||
28 | + num: '', | ||
29 | + multiArray: [], | ||
30 | + multiIndex: [0, 0, 0], | ||
31 | + selectprocname: '请选择省市区', | ||
32 | + pro: '', | ||
33 | + selprovince: '', | ||
34 | + selcity:'', | ||
35 | + zone: '' | ||
29 | }, | 36 | }, |
30 | 37 | ||
31 | /** | 38 | /** |
32 | * 生命周期函数--监听页面加载 | 39 | * 生命周期函数--监听页面加载 |
33 | */ | 40 | */ |
34 | - onLoad: function (options) { | 41 | + onLoad: function(options) { |
35 | console.log(options) | 42 | console.log(options) |
43 | + this.getalladdress() | ||
36 | if (options.id != undefined) { | 44 | if (options.id != undefined) { |
37 | this.setData({ | 45 | this.setData({ |
38 | address_id: options.id, | 46 | address_id: options.id, |
39 | - | 47 | + |
40 | }) | 48 | }) |
41 | } | 49 | } |
42 | 50 | ||
43 | - if(options.noorder!=undefined){ | 51 | + if (options.noorder != undefined) { |
44 | this.setData({ | 52 | this.setData({ |
45 | - noorder:options.noorder, | ||
46 | - noorderid:options.noorderid, | ||
47 | - num:options.num | 53 | + noorder: options.noorder, |
54 | + noorderid: options.noorderid, | ||
55 | + num: options.num | ||
48 | }) | 56 | }) |
49 | } | 57 | } |
50 | 58 | ||
@@ -57,6 +65,113 @@ Page({ | @@ -57,6 +65,113 @@ Page({ | ||
57 | // this.getaddressEdit() | 65 | // this.getaddressEdit() |
58 | }, | 66 | }, |
59 | 67 | ||
68 | + // bindMultiPickerChange(e) { | ||
69 | + // console.log('picker发送选择改变,携带值为', e.detail.value) | ||
70 | + // this.setData({ | ||
71 | + // multiIndex: e.detail.value | ||
72 | + // }) | ||
73 | + // }, | ||
74 | + | ||
75 | + bindMultiPickerColumnChange(e) { | ||
76 | + console.log('修改的列为', e.detail.column, ',值为', e.detail.value) | ||
77 | + const data = { | ||
78 | + multiArray: this.data.multiArray, | ||
79 | + multiIndex: this.data.multiIndex | ||
80 | + } | ||
81 | + data.multiIndex[e.detail.column] = e.detail.value | ||
82 | + switch (e.detail.column) { | ||
83 | + | ||
84 | + case 0: | ||
85 | + console.log('修改的列为', e.detail.column, ',值为', e.detail.value) | ||
86 | + console.log(data.multiIndex) | ||
87 | + | ||
88 | + let newpro = this.data.pro; | ||
89 | + let province = newpro; | ||
90 | + let city = newpro[e.detail.value].son | ||
91 | + | ||
92 | + let zone = newpro[e.detail.value].son[0].son; | ||
93 | + console.log(province); | ||
94 | + console.log(city); | ||
95 | + console.log(zone) | ||
96 | + this.setData({ | ||
97 | + selprovince: province, | ||
98 | + selcity:city, | ||
99 | + zone:zone | ||
100 | + }) | ||
101 | + | ||
102 | + data.multiArray[1] = city | ||
103 | + data.multiArray[2] = zone | ||
104 | + break | ||
105 | + case 1: | ||
106 | + console.log(data.multiIndex) | ||
107 | + console.log(e.detail.value) | ||
108 | + let secnewpro = this.data.pro; | ||
109 | + let secity = this.data.selcity; | ||
110 | + console.log(secity) | ||
111 | + | ||
112 | + let seczone = secity[e.detail.value].son | ||
113 | + data.multiArray[2] = seczone | ||
114 | + break | ||
115 | + } | ||
116 | + | ||
117 | + this.setData(data) | ||
118 | + }, | ||
119 | + | ||
120 | + | ||
121 | + bindMultiPickerChange(e) { | ||
122 | + let that = this | ||
123 | + console.log(e) | ||
124 | + let p=e.detail.value; | ||
125 | + console.log(p) | ||
126 | + console.log(that.data.multiArray[0][p[0]].name) | ||
127 | + | ||
128 | + | ||
129 | + that.setData({ | ||
130 | + multiIndex: [p[0],p[1], p[2]], | ||
131 | + selectprocname: that.data.multiArray[0][p[0]].name + that.data.multiArray[1][p[1]].name + that.data.multiArray[2][p[2]].name, | ||
132 | + province: that.data.multiArray[0][p[0]].name, | ||
133 | + city: that.data.multiArray[1][p[1]].name, | ||
134 | + county: that.data.multiArray[2][p[2]].name, | ||
135 | + | ||
136 | + }) | ||
137 | + | ||
138 | + console.log(that.data.selectprocname) | ||
139 | + | ||
140 | + | ||
141 | + }, | ||
142 | + | ||
143 | + | ||
144 | + //获取省市区 | ||
145 | + getalladdress() { | ||
146 | + let that = this; | ||
147 | + let url = '/home/index/getAddress', | ||
148 | + params = { | ||
149 | + token: wx.getStorageSync('token'), | ||
150 | + | ||
151 | + } | ||
152 | + app.post(url, params).then((res) => { | ||
153 | + console.log(res) | ||
154 | + let pro = res.data; | ||
155 | + let province = res.data; | ||
156 | + let city = res.data[0].son | ||
157 | + let zone = res.data[0].son[0].son; | ||
158 | + | ||
159 | + let arr = []; | ||
160 | + that.setData({ | ||
161 | + pro: res.data, | ||
162 | + multiArray: [province, city, zone] | ||
163 | + }) | ||
164 | + | ||
165 | + console.log(that.data.multiArray) | ||
166 | + | ||
167 | + | ||
168 | + | ||
169 | + | ||
170 | + }).catch((err) => { | ||
171 | + | ||
172 | + }) | ||
173 | + }, | ||
174 | + | ||
60 | // 姓名 | 175 | // 姓名 |
61 | enterName(e) { | 176 | enterName(e) { |
62 | console.log(e) | 177 | console.log(e) |
@@ -107,7 +222,7 @@ Page({ | @@ -107,7 +222,7 @@ Page({ | ||
107 | city: res.data.city, | 222 | city: res.data.city, |
108 | county: res.data.city, | 223 | county: res.data.city, |
109 | address: res.data.address, | 224 | address: res.data.address, |
110 | - selectregion:res.data.province+res.data.city+res.data.county | 225 | + selectprocname: res.data.province + res.data.city + res.data.county |
111 | }) | 226 | }) |
112 | 227 | ||
113 | 228 | ||
@@ -124,7 +239,7 @@ Page({ | @@ -124,7 +239,7 @@ Page({ | ||
124 | add_1() { | 239 | add_1() { |
125 | 240 | ||
126 | let that = this; | 241 | let that = this; |
127 | - | 242 | + |
128 | 243 | ||
129 | // 接收信息 | 244 | // 接收信息 |
130 | let name = that.data.name; | 245 | let name = that.data.name; |
@@ -137,32 +252,32 @@ Page({ | @@ -137,32 +252,32 @@ Page({ | ||
137 | // 正则表达式 | 252 | // 正则表达式 |
138 | //let regName = /^[\u4e00-\u9fa5]{0,}$/; | 253 | //let regName = /^[\u4e00-\u9fa5]{0,}$/; |
139 | let regPhone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; | 254 | let regPhone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/; |
140 | - if(name ==''){ | 255 | + if (name == '') { |
141 | wx.showToast({ | 256 | wx.showToast({ |
142 | title: '请输入姓名', | 257 | title: '请输入姓名', |
143 | icon: 'none' | 258 | icon: 'none' |
144 | }) | 259 | }) |
145 | - }else if(mobile ==''){ | 260 | + } else if (mobile == '') { |
146 | wx.showToast({ | 261 | wx.showToast({ |
147 | title: '请输入手机号', | 262 | title: '请输入手机号', |
148 | icon: 'none' | 263 | icon: 'none' |
149 | }) | 264 | }) |
150 | - }else if(!regPhone.test(mobile)){ | 265 | + } else if (!regPhone.test(mobile)) { |
151 | wx.showToast({ | 266 | wx.showToast({ |
152 | title: '请输入正确的手机号', | 267 | title: '请输入正确的手机号', |
153 | icon: 'none' | 268 | icon: 'none' |
154 | }) | 269 | }) |
155 | - } else if (that.data.selectregion =="请选择省市区"){ | 270 | + } else if (that.data.selectprocname == "请选择省市区") { |
156 | wx.showToast({ | 271 | wx.showToast({ |
157 | title: '请选择省市区', | 272 | title: '请选择省市区', |
158 | icon: 'none' | 273 | icon: 'none' |
159 | }) | 274 | }) |
160 | - } else if (address==''){ | 275 | + } else if (address == '') { |
161 | wx.showToast({ | 276 | wx.showToast({ |
162 | title: '请输入详细地址', | 277 | title: '请输入详细地址', |
163 | icon: 'none' | 278 | icon: 'none' |
164 | }) | 279 | }) |
165 | - }else{ | 280 | + } else { |
166 | let url = 'user/index/addressPost'; | 281 | let url = 'user/index/addressPost'; |
167 | let params = { | 282 | let params = { |
168 | 283 | ||
@@ -187,29 +302,29 @@ Page({ | @@ -187,29 +302,29 @@ Page({ | ||
187 | icon: "none", | 302 | icon: "none", |
188 | duration: 1500 | 303 | duration: 1500 |
189 | }) | 304 | }) |
190 | - console.log(that.data.noorder) | ||
191 | - if (that.data.noorder==1){ | ||
192 | - setTimeout(function () { | 305 | + console.log(that.data.noorder) |
306 | + if (that.data.noorder == 1) { | ||
307 | + setTimeout(function() { | ||
193 | console.log(that.data.num) | 308 | console.log(that.data.num) |
194 | wx.navigateTo({ | 309 | wx.navigateTo({ |
195 | - url: '/pages/kind/firm_order1/firm_order1?num='+that.data.num+'&id='+that.data.noorderid, | 310 | + url: '/pages/kind/firm_order1/firm_order1?num=' + that.data.num + '&id=' + that.data.noorderid, |
196 | }) | 311 | }) |
197 | }, 1000) | 312 | }, 1000) |
198 | - }else{ | ||
199 | - setTimeout(function () { | 313 | + } else { |
314 | + setTimeout(function() { | ||
200 | wx.navigateTo({ | 315 | wx.navigateTo({ |
201 | url: '/pages/mine/addr_1/addr_1', | 316 | url: '/pages/mine/addr_1/addr_1', |
202 | }) | 317 | }) |
203 | }, 1000) | 318 | }, 1000) |
204 | } | 319 | } |
205 | - | 320 | + |
206 | 321 | ||
207 | }).catch((err) => { | 322 | }).catch((err) => { |
208 | 323 | ||
209 | }) | 324 | }) |
210 | } | 325 | } |
211 | 326 | ||
212 | - | 327 | + |
213 | }, | 328 | }, |
214 | 329 | ||
215 | 330 | ||
@@ -234,7 +349,7 @@ Page({ | @@ -234,7 +349,7 @@ Page({ | ||
234 | 349 | ||
235 | }, | 350 | }, |
236 | // 选择器 | 351 | // 选择器 |
237 | - bindRegionChange: function (e) { | 352 | + bindRegionChange: function(e) { |
238 | console.log('picker发送选择改变,携带值为', e.detail.value) | 353 | console.log('picker发送选择改变,携带值为', e.detail.value) |
239 | let address_1 = e.detail.value | 354 | let address_1 = e.detail.value |
240 | this.setData({ | 355 | this.setData({ |
@@ -284,49 +399,49 @@ Page({ | @@ -284,49 +399,49 @@ Page({ | ||
284 | /** | 399 | /** |
285 | * 生命周期函数--监听页面初次渲染完成 | 400 | * 生命周期函数--监听页面初次渲染完成 |
286 | */ | 401 | */ |
287 | - onReady: function () { | 402 | + onReady: function() { |
288 | 403 | ||
289 | }, | 404 | }, |
290 | 405 | ||
291 | /** | 406 | /** |
292 | * 生命周期函数--监听页面显示 | 407 | * 生命周期函数--监听页面显示 |
293 | */ | 408 | */ |
294 | - onShow: function () { | 409 | + onShow: function() { |
295 | 410 | ||
296 | }, | 411 | }, |
297 | 412 | ||
298 | /** | 413 | /** |
299 | * 生命周期函数--监听页面隐藏 | 414 | * 生命周期函数--监听页面隐藏 |
300 | */ | 415 | */ |
301 | - onHide: function () { | 416 | + onHide: function() { |
302 | 417 | ||
303 | }, | 418 | }, |
304 | 419 | ||
305 | /** | 420 | /** |
306 | * 生命周期函数--监听页面卸载 | 421 | * 生命周期函数--监听页面卸载 |
307 | */ | 422 | */ |
308 | - onUnload: function () { | 423 | + onUnload: function() { |
309 | 424 | ||
310 | }, | 425 | }, |
311 | 426 | ||
312 | /** | 427 | /** |
313 | * 页面相关事件处理函数--监听用户下拉动作 | 428 | * 页面相关事件处理函数--监听用户下拉动作 |
314 | */ | 429 | */ |
315 | - onPullDownRefresh: function () { | 430 | + onPullDownRefresh: function() { |
316 | 431 | ||
317 | }, | 432 | }, |
318 | 433 | ||
319 | /** | 434 | /** |
320 | * 页面上拉触底事件的处理函数 | 435 | * 页面上拉触底事件的处理函数 |
321 | */ | 436 | */ |
322 | - onReachBottom: function () { | 437 | + onReachBottom: function() { |
323 | 438 | ||
324 | }, | 439 | }, |
325 | 440 | ||
326 | /** | 441 | /** |
327 | * 用户点击右上角分享 | 442 | * 用户点击右上角分享 |
328 | */ | 443 | */ |
329 | - onShareAppMessage: function () { | 444 | + onShareAppMessage: function() { |
330 | 445 | ||
331 | } | 446 | } |
332 | }) | 447 | }) |
@@ -10,11 +10,26 @@ | @@ -10,11 +10,26 @@ | ||
10 | </view> | 10 | </view> |
11 | <view class='top_item top_between'> | 11 | <view class='top_item top_between'> |
12 | <view class='top_item_name'>省市/区</view> | 12 | <view class='top_item_name'>省市/区</view> |
13 | - <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}"> | 13 | + <!-- <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}"> |
14 | <view class="top_item_right"> | 14 | <view class="top_item_right"> |
15 | - <!-- <view>{{region[0]}},{{region[1]}},{{region[2]}} </view> --> | 15 | + |
16 | <view>{{selectregion}}</view> | 16 | <view>{{selectregion}}</view> |
17 | - <!-- 箭头图片 --> | 17 | + |
18 | + <view class='top_item_right_pic'> | ||
19 | + <image src='../../../img/right_1.png'></image> | ||
20 | + </view> | ||
21 | + | ||
22 | + </view> | ||
23 | + </picker> --> | ||
24 | + | ||
25 | + | ||
26 | + <picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}" range-key='name'> | ||
27 | + | ||
28 | + <view class="top_item_right"> | ||
29 | + | ||
30 | + <!-- <view>{{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}}</view> --> | ||
31 | + <view>{{selectprocname}}</view> | ||
32 | + | ||
18 | <view class='top_item_right_pic'> | 33 | <view class='top_item_right_pic'> |
19 | <image src='../../../img/right_1.png'></image> | 34 | <image src='../../../img/right_1.png'></image> |
20 | </view> | 35 | </view> |
-
请 注册 或 登录 后发表评论