正在显示
61 个修改的文件
包含
659 行增加
和
1099 行删除
@@ -3,27 +3,15 @@ let utils = require("../../utils/util.js") | @@ -3,27 +3,15 @@ let utils = require("../../utils/util.js") | ||
3 | let method = require("../../utils/reuqest.js") | 3 | let method = require("../../utils/reuqest.js") |
4 | const app = getApp() | 4 | const app = getApp() |
5 | Component({ | 5 | Component({ |
6 | - /** | ||
7 | - * 组件的属性列表 | ||
8 | - */ | ||
9 | - | ||
10 | - /** | ||
11 | - * 组件的初始数据 | ||
12 | - */ | ||
13 | data: { | 6 | data: { |
14 | - list:[], //时间数组 | ||
15 | deliveryTime: "", | 7 | deliveryTime: "", |
16 | selfData: [], //自提日期 | 8 | selfData: [], //自提日期 |
17 | showDelivery: false, | 9 | showDelivery: false, |
18 | - deliveryTimeList: [{ | ||
19 | - day: "", | ||
20 | - timeList: "" | ||
21 | - }], | 10 | + list: [], //自提时间数组 |
22 | nowDay: 0, | 11 | nowDay: 0, |
23 | - selectTime: '', | 12 | + selectTime: '', //自提时间 |
24 | selectTimeIndex: '', | 13 | selectTimeIndex: '', |
25 | selectDay: 0, | 14 | selectDay: 0, |
26 | - timeLists: '' | ||
27 | }, | 15 | }, |
28 | pageLifetimes: { | 16 | pageLifetimes: { |
29 | show: function () { | 17 | show: function () { |
@@ -42,26 +30,25 @@ Component({ | @@ -42,26 +30,25 @@ Component({ | ||
42 | lifetimes: { | 30 | lifetimes: { |
43 | created() { | 31 | created() { |
44 | let _this = this; | 32 | let _this = this; |
45 | - if(_this.data.nowDay==0){ | 33 | + if (_this.data.nowDay == 0) { |
46 | method.getRequest("/myUser/period/" + '1', data => { | 34 | method.getRequest("/myUser/period/" + '1', data => { |
47 | //let list=this | 35 | //let list=this |
48 | if (data.statusCode == 0) { | 36 | if (data.statusCode == 0) { |
49 | _this.setData({ | 37 | _this.setData({ |
50 | - list:data.data | 38 | + list: data.data |
51 | }) | 39 | }) |
52 | } | 40 | } |
53 | - console.log(_this.data.nowDay,'now') | 41 | + console.log(_this.data.nowDay, 'now') |
54 | console.log(_this.data.deliveryTimeList, 'list') | 42 | console.log(_this.data.deliveryTimeList, 'list') |
55 | }) | 43 | }) |
56 | - }else{ | 44 | + } else { |
57 | method.getRequest("/myUser/period/" + '2', data => { | 45 | method.getRequest("/myUser/period/" + '2', data => { |
58 | - //let list=this | ||
59 | if (data.statusCode == 0) { | 46 | if (data.statusCode == 0) { |
60 | _this.setData({ | 47 | _this.setData({ |
61 | - list:data.data | 48 | + list: data.data |
62 | }) | 49 | }) |
63 | } | 50 | } |
64 | - console.log(_this.data.nowDay,'now') | 51 | + console.log(_this.data.nowDay, 'now') |
65 | console.log(_this.data.deliveryTimeList, 'list') | 52 | console.log(_this.data.deliveryTimeList, 'list') |
66 | }) | 53 | }) |
67 | } | 54 | } |
@@ -83,59 +70,42 @@ Component({ | @@ -83,59 +70,42 @@ Component({ | ||
83 | error() { | 70 | error() { |
84 | console.log("每当组件方法抛出错误时执行") | 71 | console.log("每当组件方法抛出错误时执行") |
85 | }, | 72 | }, |
86 | - /*组件所在页面的生命周期 */ | ||
87 | - pageLifetimes: { | ||
88 | - show: function () { | ||
89 | - // 页面被展示 | ||
90 | - console.log("页面被展示") | ||
91 | - }, | ||
92 | - hide: function () { | ||
93 | - // 页面被隐藏 | ||
94 | - console.log("页面被隐藏") | ||
95 | - }, | ||
96 | - resize: function (size) { | ||
97 | - // 页面尺寸变化 | ||
98 | - console.log("页面尺寸变化") | ||
99 | - } | ||
100 | - } | ||
101 | }, | 73 | }, |
102 | methods: { | 74 | methods: { |
103 | getnowDay(e) { | 75 | getnowDay(e) { |
104 | this.setData({ | 76 | this.setData({ |
105 | nowDay: e.currentTarget.dataset.index | 77 | nowDay: e.currentTarget.dataset.index |
106 | }) | 78 | }) |
107 | - console.log(this.data.nowDay,'nowday') | 79 | + console.log(this.data.nowDay, 'nowday') |
108 | let _this = this; | 80 | let _this = this; |
109 | - if(_this.data.nowDay==0){ | 81 | + if (_this.data.nowDay == 0) { |
110 | method.getRequest("/myUser/period/" + '1', data => { | 82 | method.getRequest("/myUser/period/" + '1', data => { |
111 | - //let list=this | ||
112 | if (data.statusCode == 0) { | 83 | if (data.statusCode == 0) { |
113 | _this.setData({ | 84 | _this.setData({ |
114 | - list:data.data | 85 | + list: data.data |
115 | }) | 86 | }) |
116 | } | 87 | } |
117 | - console.log(_this.data.nowDay,'now') | 88 | + console.log(_this.data.nowDay, 'now') |
118 | console.log(_this.data.deliveryTimeList, 'list') | 89 | console.log(_this.data.deliveryTimeList, 'list') |
119 | }) | 90 | }) |
120 | - }else{ | 91 | + } else { |
121 | method.getRequest("/myUser/period/" + '2', data => { | 92 | method.getRequest("/myUser/period/" + '2', data => { |
122 | //let list=this | 93 | //let list=this |
123 | if (data.statusCode == 0) { | 94 | if (data.statusCode == 0) { |
124 | _this.setData({ | 95 | _this.setData({ |
125 | - list:data.data | 96 | + list: data.data |
126 | }) | 97 | }) |
127 | } | 98 | } |
128 | - console.log(_this.data.nowDay,'now') | 99 | + console.log(_this.data.nowDay, 'now') |
129 | console.log(_this.data.deliveryTimeList, 'list') | 100 | console.log(_this.data.deliveryTimeList, 'list') |
130 | }) | 101 | }) |
131 | } | 102 | } |
132 | }, | 103 | }, |
133 | clickTime(e) { | 104 | clickTime(e) { |
134 | let selfData = this.data.selfData[this.data.nowDay] | 105 | let selfData = this.data.selfData[this.data.nowDay] |
135 | - let id= e.currentTarget.dataset.id; | ||
136 | - let index= e.currentTarget.dataset.index; | 106 | + let id = e.currentTarget.dataset.id; |
107 | + let index = e.currentTarget.dataset.index; | ||
137 | let _this = this; | 108 | let _this = this; |
138 | - // let selectTime = this.data.deliveryTimeList[this.data.nowDay].timeList[index] | ||
139 | let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' ' | 109 | let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' ' |
140 | let nowDay = this.data.nowDay | 110 | let nowDay = this.data.nowDay |
141 | this.setData({ | 111 | this.setData({ |
@@ -144,15 +114,16 @@ Component({ | @@ -144,15 +114,16 @@ Component({ | ||
144 | deliveryTime: deliveryTime, | 114 | deliveryTime: deliveryTime, |
145 | selectDay: nowDay | 115 | selectDay: nowDay |
146 | }) | 116 | }) |
147 | - // this.triggerEvent('selectTime', { | ||
148 | - // deliveryTime: this.data.deliveryTime | ||
149 | - // }) | ||
150 | - this.data.list.map((item,index)=>{ | ||
151 | - if(item.id === id){ | 117 | + this.data.list.map((item, index) => { |
118 | + if (item.id === id) { | ||
152 | let times = item.start + '-' + item.end | 119 | let times = item.start + '-' + item.end |
153 | - _this.triggerEvent('selectTime',{time : times,flag : false,timeId:item.id,deliveryTime:this.data. deliveryTime}) | ||
154 | - //_this.triggerEvent('showTime',false) | ||
155 | - wx.setStorageSync('selecClick',true) | 120 | + _this.triggerEvent('selectTime', { |
121 | + time: times, | ||
122 | + flag: false, | ||
123 | + timeId: item.id, | ||
124 | + deliveryTime: this.data.deliveryTime | ||
125 | + }) | ||
126 | + wx.setStorageSync('selecClick', true) | ||
156 | } | 127 | } |
157 | }) | 128 | }) |
158 | }, | 129 | }, |
@@ -166,63 +137,62 @@ Component({ | @@ -166,63 +137,62 @@ Component({ | ||
166 | }) | 137 | }) |
167 | //获取时间段 | 138 | //获取时间段 |
168 | let timeDate = new Date(date.getTime()); | 139 | let timeDate = new Date(date.getTime()); |
169 | - let todayList = getTimeList(timeDate.getHours(), 1); | ||
170 | - deliveryTimeList.push({ | ||
171 | - timeList: todayList | ||
172 | - }); | ||
173 | - let nextDayList = getTimeList(9, 0); | ||
174 | - for (let i = 1; i < 5; i++) { | ||
175 | - deliveryTimeList.push({ | ||
176 | - timeList: nextDayList | ||
177 | - }); | ||
178 | - } | ||
179 | - this.triggerEvent('selectTime', { | ||
180 | - deliveryTime: this.data.deliveryTime | ||
181 | - }) | ||
182 | - this.setData({ | ||
183 | - deliveryTimeList: [] | ||
184 | - }) | ||
185 | - this.setData({ | ||
186 | - deliveryTimeList: deliveryTimeList | ||
187 | - }) | ||
188 | - // today 1 是今天 0 不是今天 | ||
189 | - function getTimeList(hour, today) { | ||
190 | - | ||
191 | - let timeList = []; | ||
192 | - // let startTime = hour <= 9 ? 9 : hour; | ||
193 | - // for (let i = 0; i < 8; i++) { | ||
194 | - // if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) { | ||
195 | - // break; | ||
196 | - // } else { | ||
197 | - // if (hour <= 9) { | ||
198 | - // timeList.push( | ||
199 | - // startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00" | ||
200 | - // ); | ||
201 | - // } else { | ||
202 | - // if (startTime % 2 === 0) { | ||
203 | - // timeList.push( | ||
204 | - // startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00" | ||
205 | - // ); | ||
206 | - // } else { | ||
207 | - // console.log(i,'i') | ||
208 | - // timeList.push( | ||
209 | - // startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00" | ||
210 | - // ); | ||
211 | - // } | 140 | + // let todayList = getTimeList(timeDate.getHours(), 1); |
141 | + // deliveryTimeList.push({ | ||
142 | + // timeList: todayList | ||
143 | + // }); | ||
144 | + // let nextDayList = getTimeList(9, 0); | ||
145 | + // for (let i = 1; i < 5; i++) { | ||
146 | + // deliveryTimeList.push({ | ||
147 | + // timeList: nextDayList | ||
148 | + // }); | ||
212 | // } | 149 | // } |
150 | + // this.triggerEvent('selectTime', { | ||
151 | + // deliveryTime: this.data.deliveryTime | ||
152 | + // }) | ||
153 | + // this.setData({ | ||
154 | + // deliveryTimeList: [] | ||
155 | + // }) | ||
156 | + // this.setData({ | ||
157 | + // deliveryTimeList: deliveryTimeList | ||
158 | + // }) | ||
159 | + //获取时间段 | ||
160 | + // today 1 是今天 0 不是今天 | ||
161 | + // function getTimeList(hour, today) { | ||
162 | + // let timeList = []; | ||
163 | + // // let startTime = hour <= 9 ? 9 : hour; | ||
164 | + // // for (let i = 0; i < 8; i++) { | ||
165 | + // // if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) { | ||
166 | + // // break; | ||
167 | + // // } else { | ||
168 | + // // if (hour <= 9) { | ||
169 | + // // timeList.push( | ||
170 | + // // startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00" | ||
171 | + // // ); | ||
172 | + // // } else { | ||
173 | + // // if (startTime % 2 === 0) { | ||
174 | + // // timeList.push( | ||
175 | + // // startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00" | ||
176 | + // // ); | ||
177 | + // // } else { | ||
178 | + // // console.log(i,'i') | ||
179 | + // // timeList.push( | ||
180 | + // // startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00" | ||
181 | + // // ); | ||
182 | + // // } | ||
183 | + // // } | ||
184 | + // // } | ||
185 | + // // } | ||
186 | + // method.getRequest("/myUser/period/" + '1', data => { | ||
187 | + // if (data.statusCode == 0) { | ||
188 | + // that.setData({ | ||
189 | + // deliveryTimeList: data.data | ||
190 | + // }) | ||
191 | + // timeList = data.data | ||
213 | // } | 192 | // } |
193 | + // }) | ||
194 | + // return timeList; | ||
214 | // } | 195 | // } |
215 | - method.getRequest("/myUser/period/" + '1', data => { | ||
216 | - if (data.statusCode == 0) { | ||
217 | - that.setData({ | ||
218 | - deliveryTimeList: data.data | ||
219 | - }) | ||
220 | - timeList = data.data | ||
221 | - } | ||
222 | - console.log(timeList, 'list') | ||
223 | - }) | ||
224 | - return timeList; | ||
225 | - } | ||
226 | } | 196 | } |
227 | } | 197 | } |
228 | }) | 198 | }) |
1 | -<!--components/time-picker/time-picker.wxml--> | ||
2 | -<!--component/time-picker/index.wxml--> | 1 | + |
3 | <view class="select-date"> | 2 | <view class="select-date"> |
4 | <view class="time-title">自提时间</view> | 3 | <view class="time-title">自提时间</view> |
5 | <view class="select-day"> | 4 | <view class="select-day"> |
@@ -15,27 +14,5 @@ | @@ -15,27 +14,5 @@ | ||
15 | </view> | 14 | </view> |
16 | <view wx:else class="time-title">对不起,今日暂无自提时间 | 15 | <view wx:else class="time-title">对不起,今日暂无自提时间 |
17 | </view> | 16 | </view> |
18 | - <!-- <view class="select-time"> | ||
19 | - <view wx:if="{{nowDay===0}}"> | ||
20 | - <view wx:if='{{deliveryTimeList.length>0}}'> --> | ||
21 | - <!-- <view wx:if='{{timeLists.length}}'> --> | ||
22 | - <!-- <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' | ||
23 | - wx:for="timeLists" bindtap="clickTime" wx:key="index" data-index='{{index}}'> | ||
24 | - {{item.start}} | ||
25 | - </view> --> | ||
26 | - <!-- <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' | ||
27 | - wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'> | ||
28 | - {{item}} | ||
29 | - </view> --> | ||
30 | - <!-- </view> | ||
31 | 17 | ||
32 | - </view> | ||
33 | - <view wx:if="{{nowDay!==0}}"> | ||
34 | - <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}' | ||
35 | - wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'> | ||
36 | - {{item}} | ||
37 | - </view> | ||
38 | - </view> | ||
39 | - </view> --> | ||
40 | - <!-- </view> --> | ||
41 | </view> | 18 | </view> |
images/01-03/unshoucang.png
0 → 100644
1.8 KB
images/card (2).png
已删除
100644 → 0
188.3 KB
images/refund.png
已删除
100644 → 0
18.2 KB
images/vipcard.png
0 → 100644
52.5 KB
1 | -@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:#646566;color:var(--field-label-color,#646566)}.van-field__label--disabled{color:#c8c9cc;color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{padding:3.6px 0;line-height:1.2em}.van-field__body--textarea,.van-field__input{box-sizing:border-box;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__input{position:relative;display:block;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px)}.van-field__input--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__input--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__input--disabled{background-color:initial;opacity:1;color:#c8c9cc;color:var(--field-input-disabled-text-color,#c8c9cc)}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)} | ||
1 | +@import '../common/index.wxss'; | ||
2 | + | ||
3 | +.van-field { | ||
4 | + --cell-icon-size: 16px; | ||
5 | + --cell-icon-size: var(--field-icon-size, 16px); | ||
6 | + margin-bottom: 20rpx; | ||
7 | +} | ||
8 | + | ||
9 | +.van-field__label { | ||
10 | + color: #646566; | ||
11 | + color: var(--field-label-color, #646566) | ||
12 | +} | ||
13 | + | ||
14 | +.van-field__label--disabled { | ||
15 | + color: #c8c9cc; | ||
16 | + color: var(--field-disabled-text-color, #c8c9cc) | ||
17 | +} | ||
18 | + | ||
19 | +.van-field__body { | ||
20 | + display: -webkit-flex; | ||
21 | + display: flex; | ||
22 | + -webkit-align-items: center; | ||
23 | + align-items: center | ||
24 | +} | ||
25 | + | ||
26 | +.van-field__body--textarea { | ||
27 | + padding: 3.6px 0; | ||
28 | + line-height: 1.2em | ||
29 | +} | ||
30 | + | ||
31 | +.van-field__body--textarea, | ||
32 | +.van-field__input { | ||
33 | + box-sizing: border-box; | ||
34 | + min-height: 24px; | ||
35 | + min-height: var(--cell-line-height, 24px) | ||
36 | +} | ||
37 | + | ||
38 | +.van-field__input { | ||
39 | + position: relative; | ||
40 | + display: block; | ||
41 | + width: 100%; | ||
42 | + margin: 0; | ||
43 | + padding: 0; | ||
44 | + line-height: inherit; | ||
45 | + text-align: left; | ||
46 | + background-color: initial; | ||
47 | + border: 0; | ||
48 | + resize: none; | ||
49 | + color: #323233; | ||
50 | + color: var(--field-input-text-color, #323233); | ||
51 | + height: 24px; | ||
52 | + height: var(--cell-line-height, 24px) | ||
53 | +} | ||
54 | + | ||
55 | +.van-field__input--textarea { | ||
56 | + height: 18px; | ||
57 | + height: var(--field-text-area-min-height, 18px); | ||
58 | + min-height: 18px; | ||
59 | + min-height: var(--field-text-area-min-height, 18px) | ||
60 | +} | ||
61 | + | ||
62 | +.van-field__input--error { | ||
63 | + color: #ee0a24; | ||
64 | + color: var(--field-input-error-text-color, #ee0a24) | ||
65 | +} | ||
66 | + | ||
67 | +.van-field__input--disabled { | ||
68 | + background-color: initial; | ||
69 | + opacity: 1; | ||
70 | + color: #c8c9cc; | ||
71 | + color: var(--field-input-disabled-text-color, #c8c9cc) | ||
72 | +} | ||
73 | + | ||
74 | +.van-field__input--center { | ||
75 | + text-align: center | ||
76 | +} | ||
77 | + | ||
78 | +.van-field__input--right { | ||
79 | + text-align: right | ||
80 | +} | ||
81 | + | ||
82 | +.van-field__placeholder { | ||
83 | + position: absolute; | ||
84 | + top: 0; | ||
85 | + right: 0; | ||
86 | + left: 0; | ||
87 | + pointer-events: none; | ||
88 | + color: #c8c9cc; | ||
89 | + color: var(--field-placeholder-text-color, #c8c9cc) | ||
90 | +} | ||
91 | + | ||
92 | +.van-field__placeholder--error { | ||
93 | + color: #ee0a24; | ||
94 | + color: var(--field-error-message-color, #ee0a24) | ||
95 | +} | ||
96 | + | ||
97 | +.van-field__icon-root { | ||
98 | + display: -webkit-flex; | ||
99 | + display: flex; | ||
100 | + -webkit-align-items: center; | ||
101 | + align-items: center; | ||
102 | + min-height: 24px; | ||
103 | + min-height: var(--cell-line-height, 24px) | ||
104 | +} | ||
105 | + | ||
106 | +.van-field__clear-root, | ||
107 | +.van-field__icon-container { | ||
108 | + line-height: inherit; | ||
109 | + vertical-align: middle; | ||
110 | + padding: 0 8px; | ||
111 | + padding: 0 var(--padding-xs, 8px); | ||
112 | + margin-right: -8px; | ||
113 | + margin-right: -var(--padding-xs, 8px) | ||
114 | +} | ||
115 | + | ||
116 | +.van-field__button, | ||
117 | +.van-field__clear-root, | ||
118 | +.van-field__icon-container { | ||
119 | + -webkit-flex-shrink: 0; | ||
120 | + flex-shrink: 0 | ||
121 | +} | ||
122 | + | ||
123 | +.van-field__clear-root { | ||
124 | + font-size: 16px; | ||
125 | + font-size: var(--field-clear-icon-size, 16px); | ||
126 | + color: #c8c9cc; | ||
127 | + color: var(--field-clear-icon-color, #c8c9cc) | ||
128 | +} | ||
129 | + | ||
130 | +.van-field__icon-container { | ||
131 | + font-size: 16px; | ||
132 | + font-size: var(--field-icon-size, 16px); | ||
133 | + color: #969799; | ||
134 | + color: var(--field-icon-container-color, #969799) | ||
135 | +} | ||
136 | + | ||
137 | +.van-field__icon-container:empty { | ||
138 | + display: none | ||
139 | +} | ||
140 | + | ||
141 | +.van-field__button { | ||
142 | + padding-left: 8px; | ||
143 | + padding-left: var(--padding-xs, 8px) | ||
144 | +} | ||
145 | + | ||
146 | +.van-field__button:empty { | ||
147 | + display: none | ||
148 | +} | ||
149 | + | ||
150 | +.van-field__error-message { | ||
151 | + text-align: left; | ||
152 | + font-size: 12px; | ||
153 | + font-size: var(--field-error-message-text-font-size, 12px); | ||
154 | + color: #ee0a24; | ||
155 | + color: var(--field-error-message-color, #ee0a24) | ||
156 | +} | ||
157 | + | ||
158 | +.van-field__error-message--center { | ||
159 | + text-align: center | ||
160 | +} | ||
161 | + | ||
162 | +.van-field__error-message--right { | ||
163 | + text-align: right | ||
164 | +} | ||
165 | + | ||
166 | +.van-field__word-limit { | ||
167 | + text-align: right; | ||
168 | + margin-top: 4px; | ||
169 | + margin-top: var(--padding-base, 4px); | ||
170 | + color: #646566; | ||
171 | + color: var(--field-word-limit-color, #646566); | ||
172 | + font-size: 12px; | ||
173 | + font-size: var(--field-word-limit-font-size, 12px); | ||
174 | + line-height: 16px; | ||
175 | + line-height: var(--field-word-limit-line-height, 16px) | ||
176 | +} | ||
177 | + | ||
178 | +.van-field__word-num { | ||
179 | + display: inline | ||
180 | +} | ||
181 | + | ||
182 | +.van-field__word-num--full { | ||
183 | + color: #ee0a24; | ||
184 | + color: var(--field-word-num-full-color, #ee0a24) | ||
185 | +} |
@@ -7,15 +7,14 @@ Page({ | @@ -7,15 +7,14 @@ Page({ | ||
7 | username: '', | 7 | username: '', |
8 | phone: '', | 8 | phone: '', |
9 | value: '', | 9 | value: '', |
10 | - checked: 0, | 10 | + checked: 0, //是否默认 |
11 | show: false, | 11 | show: false, |
12 | selectBox: true, | 12 | selectBox: true, |
13 | - location: '', | ||
14 | - latitude: "", | 13 | + location: '', //解析地址 |
14 | + latitude: "", //收货地址 | ||
15 | longitude: "", | 15 | longitude: "", |
16 | - latitudes: "", //传值 | ||
17 | - longitudes: "", | ||
18 | - flag: true | 16 | + latitudes: "", //传参 |
17 | + longitudes: "" | ||
19 | }, | 18 | }, |
20 | //姓名 | 19 | //姓名 |
21 | inputName(e) { | 20 | inputName(e) { |
@@ -94,7 +93,6 @@ Page({ | @@ -94,7 +93,6 @@ Page({ | ||
94 | wx.getLocation({ | 93 | wx.getLocation({ |
95 | type: 'gcj02', | 94 | type: 'gcj02', |
96 | success(res) { | 95 | success(res) { |
97 | - console.log(res, 'rs') | ||
98 | const location = JSON.stringify({ | 96 | const location = JSON.stringify({ |
99 | latitude: res.latitude, | 97 | latitude: res.latitude, |
100 | longitude: res.longitude | 98 | longitude: res.longitude |
@@ -167,9 +165,6 @@ Page({ | @@ -167,9 +165,6 @@ Page({ | ||
167 | title: '保存成功', | 165 | title: '保存成功', |
168 | icon: 'none' | 166 | icon: 'none' |
169 | }) | 167 | }) |
170 | - // wx.redirectTo({ | ||
171 | - // url: '/pages/select-address/select-address?edit=1', | ||
172 | - // }) | ||
173 | wx.navigateBack({ | 168 | wx.navigateBack({ |
174 | delta: 1, | 169 | delta: 1, |
175 | }) | 170 | }) |
@@ -197,7 +192,6 @@ Page({ | @@ -197,7 +192,6 @@ Page({ | ||
197 | onShow: function () { | 192 | onShow: function () { |
198 | let that = this; | 193 | let that = this; |
199 | const location = chooseLocation.getLocation(); | 194 | const location = chooseLocation.getLocation(); |
200 | - console.log(location, 'location') | ||
201 | const address = location.address | 195 | const address = location.address |
202 | const latitude = location.latitude | 196 | const latitude = location.latitude |
203 | const longitude = location.longitude | 197 | const longitude = location.longitude |
1 | <!--pages/add-address/add-address.wxml--> | 1 | <!--pages/add-address/add-address.wxml--> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | <van-cell-group class="addContent"> | 3 | <van-cell-group class="addContent"> |
4 | - <van-field value="{{ username }}" label="姓名" icon="question-o" placeholder="请输入姓名" | ||
5 | - bind:click-icon="onClickIcon" bindinput="inputName" /> | 4 | + <van-field value="{{ username }}" label="姓名" icon="question-o" placeholder="请输入姓名" bind:click-icon="onClickIcon" |
5 | + bindinput="inputName" /> | ||
6 | <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" /> | 6 | <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" /> |
7 | <view class="location" catchtap="map"> | 7 | <view class="location" catchtap="map"> |
8 | <text style="width:200rpx">收货地址</text> | 8 | <text style="width:200rpx">收货地址</text> |
9 | <text class="locationItem">{{location}}</text> | 9 | <text class="locationItem">{{location}}</text> |
10 | </view> | 10 | </view> |
11 | - <!-- </van-cell> --> | ||
12 | - <van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 30%"> | ||
13 | - <van-area area-list="{{ areaList }}" value="area" columns-placeholder="{{ ['请选择', '请选择', '请选择'] }}" | ||
14 | - bind:change="changeAddress" bind:confirm="chooseAddress" bind:cancel="cancelChoose">{{city}}</van-area> | ||
15 | - </van-popup> | ||
16 | - | ||
17 | <van-field value="{{ value }}" label="详细地址" placeholder="请输入详细地址" bindinput="inputAddress" /> | 11 | <van-field value="{{ value }}" label="详细地址" placeholder="请输入详细地址" bindinput="inputAddress" /> |
18 | </van-cell-group> | 12 | </van-cell-group> |
19 | - | ||
20 | <!-- 默认地址 --> | 13 | <!-- 默认地址 --> |
21 | <view class="defaultAddress"> | 14 | <view class="defaultAddress"> |
22 | <view class="defaultText">设为默认地址</view> | 15 | <view class="defaultText">设为默认地址</view> |
@@ -3,12 +3,6 @@ | @@ -3,12 +3,6 @@ | ||
3 | width: 0; | 3 | width: 0; |
4 | } | 4 | } |
5 | 5 | ||
6 | -.container { | ||
7 | - width: 750rpx; | ||
8 | - height: 1624rpx; | ||
9 | - background-color: #f1f2f4; | ||
10 | -} | ||
11 | - | ||
12 | .addContent { | 6 | .addContent { |
13 | background-color: #ffffff; | 7 | background-color: #ffffff; |
14 | } | 8 | } |
@@ -36,7 +30,7 @@ | @@ -36,7 +30,7 @@ | ||
36 | .location { | 30 | .location { |
37 | background-color: #ffffff; | 31 | background-color: #ffffff; |
38 | height: 83rpx; | 32 | height: 83rpx; |
39 | - margin-bottom: 16rpx; | 33 | + margin-bottom: 20rpx; |
40 | margin-top: 16rpx; | 34 | margin-top: 16rpx; |
41 | display: flex; | 35 | display: flex; |
42 | align-items: center; | 36 | align-items: center; |
@@ -45,22 +39,6 @@ | @@ -45,22 +39,6 @@ | ||
45 | color: var(--field-label-color, #646566); | 39 | color: var(--field-label-color, #646566); |
46 | } | 40 | } |
47 | 41 | ||
48 | -/* .address { | ||
49 | - position: relative; | ||
50 | -} | ||
51 | - | ||
52 | -.address .arrow { | ||
53 | - position: absolute; | ||
54 | - top: 26rpx; | ||
55 | - right: 32rpx; | ||
56 | - width: 24rpx; | ||
57 | - height: 24rpx; | ||
58 | -} | ||
59 | - | ||
60 | -.address .arrow image { | ||
61 | - width: 24rpx; | ||
62 | - height: 24rpx; | ||
63 | -} */ | ||
64 | 42 | ||
65 | /* 默认地址 */ | 43 | /* 默认地址 */ |
66 | .defaultAddress { | 44 | .defaultAddress { |
@@ -3,54 +3,37 @@ let method = require("../../utils/reuqest.js"); | @@ -3,54 +3,37 @@ let method = require("../../utils/reuqest.js"); | ||
3 | const util = require("../../utils/util.js"); | 3 | const util = require("../../utils/util.js"); |
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | - userData: "", | ||
7 | - maxlength: 50, | ||
8 | - startTime: '', | ||
9 | - cartList: [{ | ||
10 | - url: '/images/1.jpg', | ||
11 | - name: '鲜切泰国桃子', | ||
12 | - detail: '果肉饱满,香甜可口', | ||
13 | - price: '25' | ||
14 | - }], | ||
15 | - goodsData: '', | 6 | + userData: "", //收货地址 |
7 | + id: '', //收货地址id | ||
8 | + goodsData: '', //商品信息 | ||
16 | show: false, | 9 | show: false, |
17 | - // currentDate: '12:00', | ||
18 | - // currentDateTwo: '13:00', | ||
19 | - date: '', | ||
20 | - minHour: 1, | ||
21 | - maxHour: 23, | 10 | + maxlength: 50, //留言 |
22 | length: 0, | 11 | length: 0, |
23 | leavaWord: '', | 12 | leavaWord: '', |
24 | - // discountText: '满3减1满3减1', | ||
25 | - allMoney: '4.00', | ||
26 | - giveFee: '8.00', | ||
27 | - id: '', | ||
28 | skuId: '', | 13 | skuId: '', |
29 | - orderId: '', //普通商品 | ||
30 | - orderjfId: '', //积分商品 | ||
31 | - couponId: '', //优惠券 | 14 | + orderId: '', //普通商品Id |
15 | + orderjfId: '', //积分商品Id | ||
16 | + couponId: '', //优惠券Id | ||
32 | cardData: '', | 17 | cardData: '', |
33 | - type: "", | ||
34 | - cardAmount: '', | ||
35 | - amount: '', //满减 | ||
36 | - count: '', | ||
37 | - stockNum: '', | ||
38 | - resposeData: '', | ||
39 | - discountText: '', | 18 | + type: "", //优惠券类型 |
19 | + cardAmount: '', //减优惠券金额 | ||
20 | + amount: '', //满优惠券金额 | ||
21 | + // count: '', | ||
22 | + stockNum: '', //商品库存 | ||
23 | + discountText: '', //无门槛优惠券金额 | ||
40 | payment: '', | 24 | payment: '', |
41 | - // storePickupTime:'' | ||
42 | deliveryTime: '', //配送时间年月 | 25 | deliveryTime: '', //配送时间年月 |
43 | - timers: '', // 配送时间 | ||
44 | - timerId: '' | 26 | + timers: '', //配送时间 |
27 | + resposeData: '', //支付 | ||
45 | }, | 28 | }, |
46 | - //选择时间 | 29 | + //选择配送时间 |
47 | selectTime(e) { | 30 | selectTime(e) { |
48 | console.log(e, 'e') | 31 | console.log(e, 'e') |
49 | if (e.detail.time && e.detail.time !== this.data.timers) { | 32 | if (e.detail.time && e.detail.time !== this.data.timers) { |
50 | this.setData({ | 33 | this.setData({ |
51 | timers: e.detail.time, | 34 | timers: e.detail.time, |
52 | // showTime: e.detail.flag, | 35 | // showTime: e.detail.flag, |
53 | - deliveryTime:e.detail.deliveryTime, | 36 | + deliveryTime: e.detail.deliveryTime, |
54 | showTime: false, | 37 | showTime: false, |
55 | timerId: e.detail.timerId | 38 | timerId: e.detail.timerId |
56 | }) | 39 | }) |
@@ -68,23 +51,12 @@ Page({ | @@ -68,23 +51,12 @@ Page({ | ||
68 | this.setData({ | 51 | this.setData({ |
69 | showTime: true | 52 | showTime: true |
70 | }) | 53 | }) |
71 | - // this.timepicker.getDliveryTime(); | ||
72 | }, | 54 | }, |
73 | onClickButton() { | 55 | onClickButton() { |
74 | this.setData({ | 56 | this.setData({ |
75 | showModal: true | 57 | showModal: true |
76 | }) | 58 | }) |
77 | }, | 59 | }, |
78 | - getDayTime() { | ||
79 | - var myDate = new Date(); | ||
80 | - var year = myDate.getFullYear(); | ||
81 | - var month = myDate.getMonth(); | ||
82 | - var day = myDate.getDate(); | ||
83 | - var dayNow = year + '-' + (month + 1) + "-" + day; | ||
84 | - this.setData({ | ||
85 | - startTime: dayNow | ||
86 | - }) | ||
87 | - }, | ||
88 | //选择地址 | 60 | //选择地址 |
89 | getAddress() { | 61 | getAddress() { |
90 | let index = wx.getStorageSync('addIndex') | 62 | let index = wx.getStorageSync('addIndex') |
@@ -94,9 +66,10 @@ Page({ | @@ -94,9 +66,10 @@ Page({ | ||
94 | userData: data.data[index], | 66 | userData: data.data[index], |
95 | }) | 67 | }) |
96 | } else { | 68 | } else { |
97 | - // setTimeout(() => { | ||
98 | - // util.getUser() | ||
99 | - // }, 2000) | 69 | + wx.showToast({ |
70 | + title: data.msg, | ||
71 | + icon: 'none' | ||
72 | + }) | ||
100 | } | 73 | } |
101 | }) | 74 | }) |
102 | }, | 75 | }, |
@@ -105,20 +78,6 @@ Page({ | @@ -105,20 +78,6 @@ Page({ | ||
105 | url: '/pages/select-address/select-address' | 78 | url: '/pages/select-address/select-address' |
106 | }) | 79 | }) |
107 | }, | 80 | }, |
108 | - //选择时间 | ||
109 | - ectTime() { | ||
110 | - this.bindStartTimeChange() | ||
111 | - }, | ||
112 | - bindStartTimeChange: function (e) { | ||
113 | - this.setData({ | ||
114 | - startTime: e.detail.value | ||
115 | - }) | ||
116 | - }, | ||
117 | - bindEndTimeChange: function (e) { | ||
118 | - this.setData({ | ||
119 | - endTime: e.detail.value | ||
120 | - }) | ||
121 | - }, | ||
122 | //商品信息 | 81 | //商品信息 |
123 | getList() { | 82 | getList() { |
124 | let postData = { | 83 | let postData = { |
@@ -210,20 +169,26 @@ Page({ | @@ -210,20 +169,26 @@ Page({ | ||
210 | url: '/pages/my-discount-card/my-discount-card', | 169 | url: '/pages/my-discount-card/my-discount-card', |
211 | }) | 170 | }) |
212 | }, | 171 | }, |
213 | - //商品-生成订单 | ||
214 | - creatOrder() { | 172 | + //立即购买 |
173 | + creatOrder: util.throttle(function () { | ||
215 | if (this.data.userData == undefined) { | 174 | if (this.data.userData == undefined) { |
216 | wx.showToast({ | 175 | wx.showToast({ |
217 | title: '请选择收货地址', | 176 | title: '请选择收货地址', |
218 | icon: 'none' | 177 | icon: 'none' |
219 | }) | 178 | }) |
220 | return false; | 179 | return false; |
180 | + } else if (this.data.timers == '') { | ||
181 | + wx.showToast({ | ||
182 | + title: '请选择配送时间', | ||
183 | + icon: 'none' | ||
184 | + }) | ||
185 | + return false; | ||
221 | } else { | 186 | } else { |
222 | setTimeout(() => { | 187 | setTimeout(() => { |
223 | let postData = { | 188 | let postData = { |
224 | addressId: this.data.userData.id, | 189 | addressId: this.data.userData.id, |
225 | couponId: this.data.couponId, | 190 | couponId: this.data.couponId, |
226 | - deliveryTime: this.data.storePickupTime+this.data.timers, | 191 | + deliveryTime: this.data.deliveryTime + this.data.timers, |
227 | note: this.data.leavaWord, | 192 | note: this.data.leavaWord, |
228 | num: this.data.count, | 193 | num: this.data.count, |
229 | skuId: this.data.skuId | 194 | skuId: this.data.skuId |
@@ -248,10 +213,11 @@ Page({ | @@ -248,10 +213,11 @@ Page({ | ||
248 | wx.setStorageSync('cardAmount', "") | 213 | wx.setStorageSync('cardAmount', "") |
249 | }, 1000) | 214 | }, 1000) |
250 | } | 215 | } |
251 | - }, | 216 | + }, 3000), |
252 | //支付 | 217 | //支付 |
253 | payment() { | 218 | payment() { |
254 | let obj = {} | 219 | let obj = {} |
220 | + let _this = this; | ||
255 | method.postRequest("/payment/payment/" + this.data.orderId, obj, data => { | 221 | method.postRequest("/payment/payment/" + this.data.orderId, obj, data => { |
256 | if (data.statusCode == 0) { | 222 | if (data.statusCode == 0) { |
257 | this.setData({ | 223 | this.setData({ |
@@ -272,23 +238,18 @@ Page({ | @@ -272,23 +238,18 @@ Page({ | ||
272 | }) | 238 | }) |
273 | }, | 239 | }, |
274 | 'fail': function (res) { | 240 | 'fail': function (res) { |
275 | - wx.setStorageSync('orderId', this | ||
276 | - .data.orderId) | ||
277 | - wx.redirectTo({ | ||
278 | - url: '/pages/order-detail/order-detail' | 241 | + console.log(_this.data.orderId) |
242 | + wx.reLaunch({ | ||
243 | + url: '/pages/order-detail/order-detail?orderId=' + _this.data.orderId, | ||
279 | }) | 244 | }) |
280 | }, | 245 | }, |
281 | 'complete': function (res) {} | 246 | 'complete': function (res) {} |
282 | }) | 247 | }) |
283 | - } else { | ||
284 | - // setTimeout(() => { | ||
285 | - // util.getUser() | ||
286 | - // }, 2000) | ||
287 | - } | 248 | + } else {} |
288 | }) | 249 | }) |
289 | }, | 250 | }, |
290 | //立即兑换 | 251 | //立即兑换 |
291 | - change() { | 252 | + change: util.throttle(function () { |
292 | if (this.data.userData == undefined) { | 253 | if (this.data.userData == undefined) { |
293 | wx.showToast({ | 254 | wx.showToast({ |
294 | title: '请选择收货地址', | 255 | title: '请选择收货地址', |
@@ -320,16 +281,11 @@ Page({ | @@ -320,16 +281,11 @@ Page({ | ||
320 | title: data.msg, | 281 | title: data.msg, |
321 | icon: 'none' | 282 | icon: 'none' |
322 | }) | 283 | }) |
323 | - // setTimeout(() => { | ||
324 | - // util.getUser() | ||
325 | - // }, 2000) | ||
326 | } | 284 | } |
327 | }) | 285 | }) |
328 | } | 286 | } |
329 | - | ||
330 | - }, | 287 | + }, 3000), |
331 | onLoad: function (options) { | 288 | onLoad: function (options) { |
332 | - console.log(this.data.type == '' ? 'true' : 'fasle', 'types') | ||
333 | this.setData({ | 289 | this.setData({ |
334 | addressId: options.id | 290 | addressId: options.id |
335 | }) | 291 | }) |
@@ -356,10 +312,6 @@ Page({ | @@ -356,10 +312,6 @@ Page({ | ||
356 | * 生命周期函数--监听页面显示 | 312 | * 生命周期函数--监听页面显示 |
357 | */ | 313 | */ |
358 | onShow: function () { | 314 | onShow: function () { |
359 | - let cardId = wx.getStorageSync('cardId') | ||
360 | - this.setData({ | ||
361 | - couponId: cardId | ||
362 | - }) | ||
363 | this.getAddress(); | 315 | this.getAddress(); |
364 | //优惠券 | 316 | //优惠券 |
365 | let cardIds = wx.getStorageSync('cardId'); | 317 | let cardIds = wx.getStorageSync('cardId'); |
@@ -375,7 +327,6 @@ Page({ | @@ -375,7 +327,6 @@ Page({ | ||
375 | wx.removeStorageSync('cardId'); | 327 | wx.removeStorageSync('cardId'); |
376 | wx.removeStorageSync('type'); | 328 | wx.removeStorageSync('type'); |
377 | wx.removeStorageSync('amount'); | 329 | wx.removeStorageSync('amount'); |
378 | - this.getDayTime() //获取当天时间 | ||
379 | this.getList() | 330 | this.getList() |
380 | }, | 331 | }, |
381 | 332 |
@@ -12,13 +12,11 @@ | @@ -12,13 +12,11 @@ | ||
12 | 请选择收货地址 | 12 | 请选择收货地址 |
13 | </view> | 13 | </view> |
14 | <view class="arrow"> | 14 | <view class="arrow"> |
15 | - <image src="/images/04-01/arrow.png"></image> | 15 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | - | ||
19 | - | ||
20 | <!-- 配送时间 --> | 18 | <!-- 配送时间 --> |
21 | - <view class="timeBox" > | 19 | + <view class="timeBox"> |
22 | <view style="width:95%;display:flex" bindtap='chooseTime'> | 20 | <view style="width:95%;display:flex" bindtap='chooseTime'> |
23 | <view class="calendar " wx:if="{{storePickupTime==''}}"> | 21 | <view class="calendar " wx:if="{{storePickupTime==''}}"> |
24 | 请选择配送时间: | 22 | 请选择配送时间: |
@@ -29,7 +27,7 @@ | @@ -29,7 +27,7 @@ | ||
29 | <view class="selectText">{{timers.length ? timers : ''}}</view> | 27 | <view class="selectText">{{timers.length ? timers : ''}}</view> |
30 | </view> | 28 | </view> |
31 | <view class="arrow" bindtap='chooseTime'> | 29 | <view class="arrow" bindtap='chooseTime'> |
32 | - <image src="/images/04-01/arrow.png"></image> | 30 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
33 | </view> | 31 | </view> |
34 | <view class="section"> | 32 | <view class="section"> |
35 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> | 33 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> |
@@ -39,30 +37,21 @@ | @@ -39,30 +37,21 @@ | ||
39 | </view> | 37 | </view> |
40 | <!-- 商品列表 --> | 38 | <!-- 商品列表 --> |
41 | <view class="cartList"> | 39 | <view class="cartList"> |
42 | - <view class="cartListItem" wx:for="{{cartList}}"> | ||
43 | - <!-- <view class="itemLeft"> | ||
44 | - <view data-type="{{checkType}}" bindtap="checkEvent" data-index="{{index}}"> | ||
45 | - <image src="/images/04-01/uncheck.png" wx:if="{{checkType==1}}"></image> | ||
46 | - <image src="/images/04-01/check.png" wx:if="{{checkType==0}}"></image> | ||
47 | - </view> | ||
48 | - </view> --> | 40 | + <view class="cartListItem" > |
49 | <view class="itemRight"> | 41 | <view class="itemRight"> |
50 | <view class="productPic"> | 42 | <view class="productPic"> |
51 | - <image src="{{goodsData.goodsImg}}"></image> | 43 | + <image src="{{goodsData.goodsImg}}" mode="aspectFill"></image> |
52 | </view> | 44 | </view> |
53 | <view style="width:381rpx"> | 45 | <view style="width:381rpx"> |
54 | <view class="productName">{{goodsData.goodsName}}</view> | 46 | <view class="productName">{{goodsData.goodsName}}</view> |
55 | <view class="productDetail">{{goodsData.goodsAttributes}}</view> | 47 | <view class="productDetail">{{goodsData.goodsAttributes}}</view> |
56 | <view class="productPrice"> | 48 | <view class="productPrice"> |
57 | - <view class="price">¥{{goodsData.goodsPrice}}</view> | 49 | + <view class="price"> |
50 | + <text class="moneyIcon">¥</text> | ||
51 | + <text class="moneyNum">{{goodsData.goodsPrice}}</text> | ||
52 | + </view> | ||
58 | <view class="num"> | 53 | <view class="num"> |
59 | - <!-- <view class="reduce" catchtap="dec"> | ||
60 | - <image src="/images/04-01/reduce.png"></image> | ||
61 | - </view> --> | ||
62 | <view class="numContent">x{{count}}</view> | 54 | <view class="numContent">x{{count}}</view> |
63 | - <!-- <view class="add" catchtap="add"> | ||
64 | - <image src="/images/04-01/add.png"></image> | ||
65 | - </view> --> | ||
66 | </view> | 55 | </view> |
67 | </view> | 56 | </view> |
68 | </view> | 57 | </view> |
@@ -72,20 +61,19 @@ | @@ -72,20 +61,19 @@ | ||
72 | <!-- 买家留言 --> | 61 | <!-- 买家留言 --> |
73 | <view class="messageBox"> | 62 | <view class="messageBox"> |
74 | <view class="messageTitle">买家留言:</view> | 63 | <view class="messageTitle">买家留言:</view> |
75 | - <textarea name="" id="" cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" | ||
76 | - maxlength="{{maxlength}}" bindinput="userInput"></textarea> | 64 | + <textarea cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" maxlength="{{maxlength}}" |
65 | + bindinput="userInput"></textarea> | ||
77 | <view class="numLength">{{length}}/50</view> | 66 | <view class="numLength">{{length}}/50</view> |
78 | </view> | 67 | </view> |
79 | <!-- 优惠券 --> | 68 | <!-- 优惠券 --> |
80 | <view class="discountCard" wx:if="{{goodsData.type==2}}"> | 69 | <view class="discountCard" wx:if="{{goodsData.type==2}}"> |
81 | <view>优惠券</view> | 70 | <view>优惠券</view> |
82 | <view class="discountBox" bindtap="goCardList"> | 71 | <view class="discountBox" bindtap="goCardList"> |
83 | - <!-- <view class="discountText" wx:if="{{type==0}}">无门槛使用{{}}</view> --> | ||
84 | <view class="discountText" wx:if="{{type==' '}}">{{}}</view> | 72 | <view class="discountText" wx:if="{{type==' '}}">{{}}</view> |
85 | <view class="discountText" wx:if="{{type===1}}">满{{amount}}减{{cardAmount}}</view> | 73 | <view class="discountText" wx:if="{{type===1}}">满{{amount}}减{{cardAmount}}</view> |
86 | <view class="discountText" wx:if="{{type===0}}">无门槛{{discountText}}元优惠券</view> | 74 | <view class="discountText" wx:if="{{type===0}}">无门槛{{discountText}}元优惠券</view> |
87 | <view class="arrowRight"> | 75 | <view class="arrowRight"> |
88 | - <image src="/images/04-01/arrow.png"></image> | 76 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
89 | </view> | 77 | </view> |
90 | </view> | 78 | </view> |
91 | </view> | 79 | </view> |
@@ -121,8 +121,8 @@ page { | @@ -121,8 +121,8 @@ page { | ||
121 | width: 5%; | 121 | width: 5%; |
122 | } | 122 | } |
123 | .arrow image{ | 123 | .arrow image{ |
124 | - width: 24rpx; | ||
125 | - height: 32rpx; | 124 | + width: 20rpx; |
125 | + height: 24rpx; | ||
126 | } | 126 | } |
127 | .timeBox { | 127 | .timeBox { |
128 | width: 686rpx; | 128 | width: 686rpx; |
@@ -150,6 +150,16 @@ page { | @@ -150,6 +150,16 @@ page { | ||
150 | 150 | ||
151 | 151 | ||
152 | /* 商品列表 */ | 152 | /* 商品列表 */ |
153 | +.moneyIcon{ | ||
154 | + font-size: 36rpx; | ||
155 | + color: #FF1717; | ||
156 | + margin-right: -10rpx; | ||
157 | +} | ||
158 | +.moneyNum{ | ||
159 | + font-size: 36rpx; | ||
160 | + font-weight: 500; | ||
161 | + color: #FF1717; | ||
162 | +} | ||
153 | .cartList { | 163 | .cartList { |
154 | width: 686rpx; | 164 | width: 686rpx; |
155 | margin: 0 auto; | 165 | margin: 0 auto; |
@@ -199,7 +209,6 @@ page { | @@ -199,7 +209,6 @@ page { | ||
199 | .productPic { | 209 | .productPic { |
200 | width: 180rpx; | 210 | width: 180rpx; |
201 | height: 180rpx; | 211 | height: 180rpx; |
202 | - background-color: azure; | ||
203 | margin-right: 24rpx; | 212 | margin-right: 24rpx; |
204 | } | 213 | } |
205 | 214 | ||
@@ -212,7 +221,7 @@ page { | @@ -212,7 +221,7 @@ page { | ||
212 | width: 320rpx; | 221 | width: 320rpx; |
213 | height: 40rpx; | 222 | height: 40rpx; |
214 | font-size: 28rpx; | 223 | font-size: 28rpx; |
215 | - font-weight: 500; | 224 | + font-weight: 600; |
216 | text-align: left; | 225 | text-align: left; |
217 | color: #333333; | 226 | color: #333333; |
218 | line-height: 40rpx; | 227 | line-height: 40rpx; |
@@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
2 | let method = require("../../utils/reuqest.js") | 2 | let method = require("../../utils/reuqest.js") |
3 | Page({ | 3 | Page({ |
4 | data: { | 4 | data: { |
5 | - list:[], | ||
6 | - goodsId: '', | 5 | + list: [], //评价列表 |
6 | + goodsId: '', //商品id | ||
7 | page: 1, | 7 | page: 1, |
8 | - bottomHint: false | 8 | + bottomHint: false //触底提示 |
9 | }, | 9 | }, |
10 | //评价列表 | 10 | //评价列表 |
11 | getList(goodsId) { | 11 | getList(goodsId) { |
@@ -28,7 +28,7 @@ Page({ | @@ -28,7 +28,7 @@ Page({ | ||
28 | */ | 28 | */ |
29 | onLoad: function (options) { | 29 | onLoad: function (options) { |
30 | this.setData({ | 30 | this.setData({ |
31 | - goodsId:options.goodsid | 31 | + goodsId: options.goodsid |
32 | }) | 32 | }) |
33 | this.getList(options.goodsid) | 33 | this.getList(options.goodsid) |
34 | }, | 34 | }, |
@@ -68,7 +68,7 @@ Page({ | @@ -68,7 +68,7 @@ Page({ | ||
68 | // wx.showNavigationBarLoading(); | 68 | // wx.showNavigationBarLoading(); |
69 | this.setData({ | 69 | this.setData({ |
70 | page: 1, | 70 | page: 1, |
71 | - list:[] | 71 | + list: [] |
72 | }) | 72 | }) |
73 | this.getList() | 73 | this.getList() |
74 | }, | 74 | }, |
@@ -2,23 +2,23 @@ | @@ -2,23 +2,23 @@ | ||
2 | <view class="outerBox" wx:for="{{list}}"> | 2 | <view class="outerBox" wx:for="{{list}}"> |
3 | <view class="userBox"> | 3 | <view class="userBox"> |
4 | <view class="wxHead" wx:if="{{item.anonymous==0}}"> | 4 | <view class="wxHead" wx:if="{{item.anonymous==0}}"> |
5 | - <image src="{{item.wxHeadImg}}"></image> | 5 | + <image src="{{item.wxHeadImg}}" mode="aspectFill"></image> |
6 | </view> | 6 | </view> |
7 | <view class="wxHead" wx:if="{{item.anonymous==1}}"> | 7 | <view class="wxHead" wx:if="{{item.anonymous==1}}"> |
8 | - <image src="/images/nimingtouxiang.png"> </image> | 8 | + <image src="/images/nimingtouxiang.png" mode="aspectFill"> </image> |
9 | </view> | 9 | </view> |
10 | <view class="wxName">{{item.wxName}}</view> | 10 | <view class="wxName">{{item.wxName}}</view> |
11 | </view> | 11 | </view> |
12 | <view class="text">{{item.content}}</view> | 12 | <view class="text">{{item.content}}</view> |
13 | <view class="picBox"> | 13 | <view class="picBox"> |
14 | <view class="pic" wx:for="{{item.images}}"> | 14 | <view class="pic" wx:for="{{item.images}}"> |
15 | - <image src="{{item}}"></image> | 15 | + <image src="{{item}}" mode="aspectFill"></image> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | </view> | 18 | </view> |
19 | <view wx:if="{{list.length==0}}" class="noDataBox"> | 19 | <view wx:if="{{list.length==0}}" class="noDataBox"> |
20 | <view class="noDataPic"> | 20 | <view class="noDataPic"> |
21 | - <image src="/images/message@2x.png"></image> | 21 | + <image src="/images/message@2x.png" mode="aspectFill"></image> |
22 | </view> | 22 | </view> |
23 | <view class="noDataText">这件商品还没有评价,快去评价吧~</view> | 23 | <view class="noDataText">这件商品还没有评价,快去评价吧~</view> |
24 | </view> | 24 | </view> |
@@ -6,19 +6,18 @@ Page({ | @@ -6,19 +6,18 @@ Page({ | ||
6 | pageNum: 1, | 6 | pageNum: 1, |
7 | index: 4, | 7 | index: 4, |
8 | active: 2, | 8 | active: 2, |
9 | - status: '', | ||
10 | orederId: '', | 9 | orederId: '', |
11 | goodsid: '', | 10 | goodsid: '', |
12 | tabList: [], | 11 | tabList: [], |
13 | - totalList: [], | ||
14 | - payList: [], | ||
15 | - sendList: [], | ||
16 | - evaluateList: [], | ||
17 | - reapList: [], | 12 | + totalList: [], //全部订单 |
13 | + payList: [], //待付款 | ||
14 | + sendList: [], //待发货 | ||
15 | + evaluateList: [], //待评价 | ||
16 | + reapList: [], //待收货 | ||
18 | orderid: '', | 17 | orderid: '', |
19 | bottomHint: false //触底提示 | 18 | bottomHint: false //触底提示 |
20 | }, | 19 | }, |
21 | - // 导航切换事件 | 20 | + // 导航切换 |
22 | onClick: function (e) { | 21 | onClick: function (e) { |
23 | let index = e.detail.index; | 22 | let index = e.detail.index; |
24 | switch (index) { | 23 | switch (index) { |
@@ -160,9 +159,6 @@ Page({ | @@ -160,9 +159,6 @@ Page({ | ||
160 | tabList: list | 159 | tabList: list |
161 | }) | 160 | }) |
162 | } else { | 161 | } else { |
163 | - // setTimeout(() => { | ||
164 | - // util.getUser() | ||
165 | - // }, 2000) | ||
166 | } | 162 | } |
167 | }) | 163 | }) |
168 | }, | 164 | }, |
@@ -303,7 +299,6 @@ Page({ | @@ -303,7 +299,6 @@ Page({ | ||
303 | let that = this; | 299 | let that = this; |
304 | //判断第一次加载订单状态 | 300 | //判断第一次加载订单状态 |
305 | that.fristLoad(options.index) | 301 | that.fristLoad(options.index) |
306 | - console.log(options.index) | ||
307 | if (options.index == null) { | 302 | if (options.index == null) { |
308 | this.setData({ | 303 | this.setData({ |
309 | active: 0 | 304 | active: 0 |
@@ -311,7 +306,7 @@ Page({ | @@ -311,7 +306,7 @@ Page({ | ||
311 | this.allOrder(); | 306 | this.allOrder(); |
312 | } else { | 307 | } else { |
313 | this.setData({ | 308 | this.setData({ |
314 | - index:options.index | 309 | + index: options.index |
315 | }) | 310 | }) |
316 | this.fristLoad(options.index) | 311 | this.fristLoad(options.index) |
317 | } | 312 | } |
@@ -328,13 +323,6 @@ Page({ | @@ -328,13 +323,6 @@ Page({ | ||
328 | * 生命周期函数--监听页面显示 | 323 | * 生命周期函数--监听页面显示 |
329 | */ | 324 | */ |
330 | onShow: function () { | 325 | onShow: function () { |
331 | - // let active=this.data.active; | ||
332 | - // if(active==){ | ||
333 | - | ||
334 | - // } | ||
335 | - // this.setData({ | ||
336 | - // index:4 | ||
337 | - // }) | ||
338 | }, | 326 | }, |
339 | 327 | ||
340 | /** | 328 | /** |
@@ -355,7 +343,6 @@ Page({ | @@ -355,7 +343,6 @@ Page({ | ||
355 | * 页面相关事件处理函数--监听用户下拉动作 | 343 | * 页面相关事件处理函数--监听用户下拉动作 |
356 | */ | 344 | */ |
357 | onRefresh() { | 345 | onRefresh() { |
358 | - // wx.showNavigationBarLoading(); | ||
359 | let index = this.data.index; | 346 | let index = this.data.index; |
360 | if (index == 4) { | 347 | if (index == 4) { |
361 | this.setData({ | 348 | this.setData({ |
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | <!-- 商品详情 --> | 26 | <!-- 商品详情 --> |
27 | <view class="bottom"> | 27 | <view class="bottom"> |
28 | <view class="productPic"> | 28 | <view class="productPic"> |
29 | - <image src="{{item.listGoodsVoList[0].goodsPic}}"></image> | 29 | + <image src="{{item.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image> |
30 | </view> | 30 | </view> |
31 | <view class="productDetail"> | 31 | <view class="productDetail"> |
32 | <view class="name">{{item.listGoodsVoList[0].goodsName}}</view> | 32 | <view class="name">{{item.listGoodsVoList[0].goodsName}}</view> |
@@ -81,7 +81,7 @@ | @@ -81,7 +81,7 @@ | ||
81 | </view> | 81 | </view> |
82 | <view class="noData" wx:if="{{tabList.length==0}}"> | 82 | <view class="noData" wx:if="{{tabList.length==0}}"> |
83 | <view class="noDataPic"> | 83 | <view class="noDataPic"> |
84 | - <image src="/images/message@2x.png"></image> | 84 | + <image src="/images/message@2x.png" mode="aspectFill"></image> |
85 | </view> | 85 | </view> |
86 | <view class="top1">您还没有相关的订单</view> | 86 | <view class="top1">您还没有相关的订单</view> |
87 | <view class="bottom1">可以去看看有那些想买的</view> | 87 | <view class="bottom1">可以去看看有那些想买的</view> |
@@ -6,20 +6,15 @@ Page({ | @@ -6,20 +6,15 @@ Page({ | ||
6 | data: { | 6 | data: { |
7 | id: '', //订单号 | 7 | id: '', //订单号 |
8 | orderId: '', | 8 | orderId: '', |
9 | - list: [], | ||
10 | - imgs: [], | ||
11 | - postList: [{ | ||
12 | - number: '1121545456056456445', | ||
13 | - url: '/images/2.jpg', | ||
14 | - name: '鲜切桃子', | ||
15 | - detail: '监测项目:日常用品', | ||
16 | - price: '800.00' | ||
17 | - }], | ||
18 | - columns: [], | ||
19 | - wordNumber: '0', | ||
20 | - word: '', | 9 | + // list: [], |
10 | + imgs: [], //上传图片 | ||
11 | + postList: [], //商品列表 | ||
12 | + columns: [], //退款原因列表 | ||
13 | + text: '', //退款原因 | ||
14 | + wordNumber: '0', //留言字数 | ||
15 | + word: '', //留言内容 | ||
21 | show: false, | 16 | show: false, |
22 | - text: '' | 17 | + |
23 | }, | 18 | }, |
24 | //订单详情 | 19 | //订单详情 |
25 | orderDetail() { | 20 | orderDetail() { |
@@ -29,14 +24,10 @@ Page({ | @@ -29,14 +24,10 @@ Page({ | ||
29 | id: data.data.id, | 24 | id: data.data.id, |
30 | postList: data.data | 25 | postList: data.data |
31 | }) | 26 | }) |
32 | - }else{ | ||
33 | - // setTimeout(() => { | ||
34 | - // util.getUser() | ||
35 | - // }, 2000) | ||
36 | - } | 27 | + } else {} |
37 | }) | 28 | }) |
38 | }, | 29 | }, |
39 | - //弹出层 | 30 | + //退款原因 |
40 | showPopup() { | 31 | showPopup() { |
41 | this.setData({ | 32 | this.setData({ |
42 | show: true | 33 | show: true |
@@ -52,22 +43,14 @@ Page({ | @@ -52,22 +43,14 @@ Page({ | ||
52 | text: e.detail.value.text | 43 | text: e.detail.value.text |
53 | }) | 44 | }) |
54 | }, | 45 | }, |
55 | - //退款原因 | ||
56 | reason() { | 46 | reason() { |
57 | - method.getRequest("/order/refundList",data=>{ | ||
58 | - if(data.statusCode==0){ | 47 | + method.getRequest("/order/refundList", data => { |
48 | + if (data.statusCode == 0) { | ||
59 | this.setData({ | 49 | this.setData({ |
60 | - columns:data.data | 50 | + columns: data.data |
61 | }) | 51 | }) |
62 | - }else{ | ||
63 | - // setTimeout(() => { | ||
64 | - // util.getUser() | ||
65 | - // }, 2000) | ||
66 | - } | 52 | + } else {} |
67 | }) | 53 | }) |
68 | - // this.setData({ | ||
69 | - // text: this.data.columns[0] | ||
70 | - // }) | ||
71 | }, | 54 | }, |
72 | //备注 | 55 | //备注 |
73 | textInput: function (e) { | 56 | textInput: function (e) { |
@@ -78,51 +61,11 @@ Page({ | @@ -78,51 +61,11 @@ Page({ | ||
78 | }) | 61 | }) |
79 | }, | 62 | }, |
80 | //上传凭证 | 63 | //上传凭证 |
81 | - // chooseImageTap: function () { | ||
82 | - // var that = this; | ||
83 | - // if (that.data.imgs.length == 3) { | ||
84 | - // wx.showToast({ | ||
85 | - // title: '最多可以上传三张图片~', | ||
86 | - // icon: 'icon' | ||
87 | - // }) | ||
88 | - // } | ||
89 | - // wx.showActionSheet({ | ||
90 | - // itemList: ['从相册中选择', '拍照'], | ||
91 | - // itemColor: "#00000", | ||
92 | - // success: function (res) { | ||
93 | - // if (!res.cancel) { | ||
94 | - // if (res.tapIndex == 0) { | ||
95 | - // that.chooseWxImage('album') | ||
96 | - // } else if (res.tapIndex == 1) { | ||
97 | - // that.chooseWxImage('camera') | ||
98 | - // } | ||
99 | - // } | ||
100 | - // } | ||
101 | - // }) | ||
102 | - // }, | ||
103 | - // chooseWxImage: function (type) { | ||
104 | - // var that = this; | ||
105 | - // var imgsPaths = that.data.imgs; | ||
106 | - // var list = that.data.lists; | ||
107 | - // wx.chooseImage({ | ||
108 | - // sizeType: ['original', 'compressed'], | ||
109 | - // sourceType: [type], | ||
110 | - // success: function (res) { | ||
111 | - // console.log(res.tempFilePaths[0]); | ||
112 | - // that.setData({ | ||
113 | - // imgs: res.tempFilePaths, | ||
114 | - // }) | ||
115 | - // console.log(that.data.imgs.length, 'length') | ||
116 | - // //that.upImgs(res.tempFilePaths[0], 0) //调用上传方法 | ||
117 | - // } | ||
118 | - // }) | ||
119 | - // }, | ||
120 | - //删除图片 | ||
121 | chooseImage(e) { | 64 | chooseImage(e) { |
122 | let that = this; | 65 | let that = this; |
123 | var type = e.currentTarget.dataset.type; | 66 | var type = e.currentTarget.dataset.type; |
124 | // let num = type == 1 ? (4 - that.data.ppath.length) : (4 - that.data.cpath.length); | 67 | // let num = type == 1 ? (4 - that.data.ppath.length) : (4 - that.data.cpath.length); |
125 | - if(that.data.imgs.length<3){ | 68 | + if (that.data.imgs.length < 3) { |
126 | wx.chooseImage({ | 69 | wx.chooseImage({ |
127 | // count: num, | 70 | // count: num, |
128 | sizeType: ['compressed'], | 71 | sizeType: ['compressed'], |
@@ -133,47 +76,21 @@ Page({ | @@ -133,47 +76,21 @@ Page({ | ||
133 | mask: true | 76 | mask: true |
134 | }) | 77 | }) |
135 | var uploaderList = res.tempFilePaths; | 78 | var uploaderList = res.tempFilePaths; |
136 | - // ary.push(uploaderList[0]) | ||
137 | - // if (ary.length <= 3) { | ||
138 | - // // that.setData({ | ||
139 | - // // imgs: ary | ||
140 | - // // }) | ||
141 | - // } else { | ||
142 | - // wx.showToast({ | ||
143 | - // title: '最多只能上传3张图片', | ||
144 | - // icon: 'none' | ||
145 | - // }) | ||
146 | - // } | ||
147 | - | ||
148 | - console.log(uploaderList, 'liost') | ||
149 | if (type == 1) { | 79 | if (type == 1) { |
150 | that.setData({ | 80 | that.setData({ |
151 | imags: that.data.puploaderList.concat(res.tempFilePaths), | 81 | imags: that.data.puploaderList.concat(res.tempFilePaths), |
152 | }) | 82 | }) |
153 | - // that.setData({ | ||
154 | - // puploaderNum: that.data.puploaderList.length | ||
155 | - // }) | ||
156 | - // } else { | ||
157 | - // that.setData({ | ||
158 | - // cuploaderList: that.data.cuploaderList.concat(res.tempFilePaths), | ||
159 | - // }) | ||
160 | - // that.setData({ | ||
161 | - // cuploaderNum: that.data.cuploaderList.length | ||
162 | - // }) | ||
163 | } | 83 | } |
164 | that.uploadDIY(uploaderList, 0, 0, 0, uploaderList.length, type); | 84 | that.uploadDIY(uploaderList, 0, 0, 0, uploaderList.length, type); |
165 | } | 85 | } |
166 | - | ||
167 | }) | 86 | }) |
168 | - }else{ | 87 | + } else { |
169 | wx.showToast({ | 88 | wx.showToast({ |
170 | title: '最多只能上传三张图片', | 89 | title: '最多只能上传三张图片', |
171 | - icon:'none' | 90 | + icon: 'none' |
172 | }) | 91 | }) |
173 | } | 92 | } |
174 | - | ||
175 | }, | 93 | }, |
176 | - | ||
177 | uploadDIY(filePaths, successUp, failUp, i, length, type) { | 94 | uploadDIY(filePaths, successUp, failUp, i, length, type) { |
178 | let that = this; | 95 | let that = this; |
179 | wx.uploadFile({ | 96 | wx.uploadFile({ |
@@ -195,7 +112,6 @@ Page({ | @@ -195,7 +112,6 @@ Page({ | ||
195 | imgs: ary | 112 | imgs: ary |
196 | }) | 113 | }) |
197 | } | 114 | } |
198 | - | ||
199 | if (type == 1) { | 115 | if (type == 1) { |
200 | that.data.ppath[i] = url; | 116 | that.data.ppath[i] = url; |
201 | that.setData({ | 117 | that.setData({ |
@@ -207,12 +123,6 @@ Page({ | @@ -207,12 +123,6 @@ Page({ | ||
207 | cpath: that.data.cpath | 123 | cpath: that.data.cpath |
208 | }) | 124 | }) |
209 | } | 125 | } |
210 | - // 把获取到的路径存入imagesurl字符串中 | ||
211 | - // this.data.imagesurl | ||
212 | - // this.setData({ | ||
213 | - // imagesurl: this.data.imagesurl.concat(data.data) | ||
214 | - // }) | ||
215 | - // console.log(this.data.imagesurl) | ||
216 | }, | 126 | }, |
217 | fail: (res) => { | 127 | fail: (res) => { |
218 | failUp++; | 128 | failUp++; |
@@ -229,8 +139,6 @@ Page({ | @@ -229,8 +139,6 @@ Page({ | ||
229 | } | 139 | } |
230 | }, | 140 | }, |
231 | }) | 141 | }) |
232 | - | ||
233 | - | ||
234 | }, | 142 | }, |
235 | delPic(e) { | 143 | delPic(e) { |
236 | console.log(e, 'e') | 144 | console.log(e, 'e') |
@@ -259,14 +167,9 @@ Page({ | @@ -259,14 +167,9 @@ Page({ | ||
259 | wx.redirectTo({ | 167 | wx.redirectTo({ |
260 | url: '/pages/all-order/all-order', | 168 | url: '/pages/all-order/all-order', |
261 | }) | 169 | }) |
262 | - }else{ | ||
263 | - // setTimeout(() => { | ||
264 | - // util.getUser() | ||
265 | - // }, 2000) | ||
266 | - } | 170 | + } else {} |
267 | }) | 171 | }) |
268 | }, | 172 | }, |
269 | - // | ||
270 | onLoad: function (options) { | 173 | onLoad: function (options) { |
271 | this.setData({ | 174 | this.setData({ |
272 | orderId: options.orderid | 175 | orderId: options.orderid |
@@ -274,7 +177,6 @@ Page({ | @@ -274,7 +177,6 @@ Page({ | ||
274 | let that = this; | 177 | let that = this; |
275 | that.orderDetail() | 178 | that.orderDetail() |
276 | that.reason() | 179 | that.reason() |
277 | - | ||
278 | }, | 180 | }, |
279 | 181 | ||
280 | /** | 182 | /** |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | </view> | 8 | </view> |
9 | <view class="productBox"> | 9 | <view class="productBox"> |
10 | <view class="pic"> | 10 | <view class="pic"> |
11 | - <image src="{{postList.listGoodsVoList[0].goodsPic}}"></image> | 11 | + <image src="{{postList.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image> |
12 | </view> | 12 | </view> |
13 | <view class="text"> | 13 | <view class="text"> |
14 | <view class="name">{{postList.listGoodsVoList[0].goodsName}}</view> | 14 | <view class="name">{{postList.listGoodsVoList[0].goodsName}}</view> |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | <view class="boxItem"> | 25 | <view class="boxItem"> |
26 | <view class="left"> | 26 | <view class="left"> |
27 | <view> | 27 | <view> |
28 | - <image src="/images/05-06/jianshu.png"></image> | 28 | + <image src="/images/05-06/jianshu.png" mode="aspectFill"></image> |
29 | </view> | 29 | </view> |
30 | <view>退货件数</view> | 30 | <view>退货件数</view> |
31 | </view> | 31 | </view> |
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | <view class="boxItem"> | 34 | <view class="boxItem"> |
35 | <view class="left"> | 35 | <view class="left"> |
36 | <view> | 36 | <view> |
37 | - <image src="/images/05-06/price.png"></image> | 37 | + <image src="/images/05-06/price.png" mode="aspectFill"></image> |
38 | </view> | 38 | </view> |
39 | <view>退款金额</view> | 39 | <view>退款金额</view> |
40 | </view> | 40 | </view> |
@@ -44,14 +44,14 @@ | @@ -44,14 +44,14 @@ | ||
44 | <view class="popupBox"> | 44 | <view class="popupBox"> |
45 | <view class="popupLeft"> | 45 | <view class="popupLeft"> |
46 | <view style="padding-top:8rpx"> | 46 | <view style="padding-top:8rpx"> |
47 | - <image src="/images/05-06/price.png"></image> | 47 | + <image src="/images/05-06/price.png" mode="aspectFill"></image> |
48 | </view> | 48 | </view> |
49 | <view> 退款原因</view> | 49 | <view> 退款原因</view> |
50 | </view> | 50 | </view> |
51 | <view class="reason"> | 51 | <view class="reason"> |
52 | <view>{{text}}</view> | 52 | <view>{{text}}</view> |
53 | <view style="margin-left:16rpx"> | 53 | <view style="margin-left:16rpx"> |
54 | - <image src="/images/04-01/arrow.png"></image> | 54 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
55 | </view> | 55 | </view> |
56 | </view> | 56 | </view> |
57 | </view> | 57 | </view> |
@@ -78,22 +78,15 @@ | @@ -78,22 +78,15 @@ | ||
78 | </view> | 78 | </view> |
79 | <view class="photo"> | 79 | <view class="photo"> |
80 | <view class="photoOne" bindtap="chooseImage"> | 80 | <view class="photoOne" bindtap="chooseImage"> |
81 | - <image src="/images/05-06/photo.png"></image> | 81 | + <image src="/images/05-06/photo.png" mode="aspectFill"></image> |
82 | </view> | 82 | </view> |
83 | <view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}"> | 83 | <view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}"> |
84 | - <image src="{{item}}"></image> | 84 | + <image src="{{item}}" mode="aspectFill"></image> |
85 | <view class="delBox" bindtap="delPic"> | 85 | <view class="delBox" bindtap="delPic"> |
86 | - <image src="/images/05-06/chaIcon.png"></image> | 86 | + <image src="/images/05-06/chaIcon.png" mode="aspectFill"></image> |
87 | </view> | 87 | </view> |
88 | + </view>> | ||
88 | </view> | 89 | </view> |
89 | - <!-- <view class="photoOne"> | ||
90 | - <image src="/images/1.jpg"></image> | ||
91 | - </view> | ||
92 | - <view class="photoOne"> | ||
93 | - <image src="/images/1.jpg"></image> | ||
94 | - </view> --> | ||
95 | - </view> | ||
96 | - <!-- <van-uploader file-list="{{ fileList }}" /> --> | ||
97 | </view> | 90 | </view> |
98 | <!-- buttom --> | 91 | <!-- buttom --> |
99 | <view class="applyBox"> | 92 | <view class="applyBox"> |
@@ -3,27 +3,13 @@ let method = require("../../utils/reuqest.js"); | @@ -3,27 +3,13 @@ let method = require("../../utils/reuqest.js"); | ||
3 | const util = require("../../utils/util.js"); | 3 | const util = require("../../utils/util.js"); |
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | - postData: { | ||
7 | - number: '20000' | ||
8 | - }, | ||
9 | - tabList: [{ | ||
10 | - title: '积分明细' | ||
11 | - }, { | ||
12 | - title: '兑换记录' | ||
13 | - }], | ||
14 | - list: [], | ||
15 | - integralList: [{ | ||
16 | - title: '积分明细', | ||
17 | - time: '2020/12/25 12:09', | ||
18 | - num: '+176' | ||
19 | - }], | ||
20 | - exchangeList: [{ | ||
21 | - title: '兑换记录', | ||
22 | - time: '2020/12/25 12:09', | ||
23 | - num: '-176' | ||
24 | - }], | 6 | + postData: {}, //积分详情 |
7 | + tabList: [], | ||
8 | + list: [], //积分明细/兑换记录列表 | ||
9 | + integralList: [], //积分明细 | ||
10 | + exchangeList: [], //兑换记录 | ||
25 | t: '1', | 11 | t: '1', |
26 | - bottomHint: false | 12 | + bottomHint: false //触底提示 |
27 | }, | 13 | }, |
28 | //第一次数据加载 | 14 | //第一次数据加载 |
29 | getList() { | 15 | getList() { |
@@ -115,13 +101,13 @@ Page({ | @@ -115,13 +101,13 @@ Page({ | ||
115 | * 页面相关事件处理函数--监听用户下拉动作 | 101 | * 页面相关事件处理函数--监听用户下拉动作 |
116 | */ | 102 | */ |
117 | onRefresh() { | 103 | onRefresh() { |
118 | - if(this.data.t==1){ | 104 | + if (this.data.t == 1) { |
119 | this.setData({ | 105 | this.setData({ |
120 | page: 1, | 106 | page: 1, |
121 | integralList: [] | 107 | integralList: [] |
122 | }) | 108 | }) |
123 | this.cardDetail(); | 109 | this.cardDetail(); |
124 | - }else{ | 110 | + } else { |
125 | this.setData({ | 111 | this.setData({ |
126 | page: 1, | 112 | page: 1, |
127 | exchangeList: [] | 113 | exchangeList: [] |
@@ -3,32 +3,23 @@ let method = require("../../utils/reuqest.js"); | @@ -3,32 +3,23 @@ let method = require("../../utils/reuqest.js"); | ||
3 | const util = require("../../utils/util.js"); | 3 | const util = require("../../utils/util.js"); |
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | - userData: "", | 6 | + userData: "", //地址 |
7 | addressId: '', | 7 | addressId: '', |
8 | - startTime: '', | ||
9 | cartList: [], //商品列表 | 8 | cartList: [], //商品列表 |
10 | - goodsData: '', | ||
11 | goodsList: '', | 9 | goodsList: '', |
12 | showTime: false, //配送时间弹框 | 10 | showTime: false, //配送时间弹框 |
13 | - // storePickupTime: '', | ||
14 | deliveryTime: '', //配送时间年月 | 11 | deliveryTime: '', //配送时间年月 |
15 | - timers: '', // 配送时间 | ||
16 | - timerId: '', | 12 | + timers: '', //配送时间 |
17 | show: false, | 13 | show: false, |
18 | - currentDate: '12:00', | ||
19 | - currentDateTwo: '13:00', | ||
20 | - minHour: 1, | ||
21 | - maxHour: 23, | ||
22 | length: 0, | 14 | length: 0, |
23 | maxlength: 50, | 15 | maxlength: 50, |
24 | leavaWord: '', | 16 | leavaWord: '', |
25 | discountText: '', | 17 | discountText: '', |
26 | id: '', | 18 | id: '', |
27 | - date: '', | ||
28 | skuId: '', | 19 | skuId: '', |
29 | orderId: '', | 20 | orderId: '', |
30 | count: '', | 21 | count: '', |
31 | - stockNum: '', | 22 | + stockNum: '', //库存 |
32 | totalPrice: '', | 23 | totalPrice: '', |
33 | cartIds: '', //购物车id | 24 | cartIds: '', //购物车id |
34 | cartsId: [], //列表商品id | 25 | cartsId: [], //列表商品id |
@@ -76,14 +67,13 @@ Page({ | @@ -76,14 +67,13 @@ Page({ | ||
76 | url: '/pages/select-address/select-address', | 67 | url: '/pages/select-address/select-address', |
77 | }) | 68 | }) |
78 | }, | 69 | }, |
79 | - //选择时间 | ||
80 | //配送时间 | 70 | //配送时间 |
81 | selectTime(e) { | 71 | selectTime(e) { |
82 | if (e.detail.time && e.detail.time !== this.data.timers) { | 72 | if (e.detail.time && e.detail.time !== this.data.timers) { |
83 | this.setData({ | 73 | this.setData({ |
84 | timers: e.detail.time, | 74 | timers: e.detail.time, |
85 | // showTime: e.detail.flag, | 75 | // showTime: e.detail.flag, |
86 | - deliveryTime:e.detail.deliveryTime, | 76 | + deliveryTime: e.detail.deliveryTime, |
87 | showTime: false, | 77 | showTime: false, |
88 | timerId: e.detail.timerId | 78 | timerId: e.detail.timerId |
89 | }) | 79 | }) |
@@ -101,23 +91,12 @@ Page({ | @@ -101,23 +91,12 @@ Page({ | ||
101 | this.setData({ | 91 | this.setData({ |
102 | showTime: true | 92 | showTime: true |
103 | }) | 93 | }) |
104 | - // this.timepicker.getDliveryTime(); | ||
105 | }, | 94 | }, |
106 | onClickButton() { | 95 | onClickButton() { |
107 | this.setData({ | 96 | this.setData({ |
108 | showModal: true | 97 | showModal: true |
109 | }) | 98 | }) |
110 | }, | 99 | }, |
111 | - getDayTime() { | ||
112 | - var myDate = new Date(); | ||
113 | - var year = myDate.getFullYear(); | ||
114 | - var month = myDate.getMonth(); | ||
115 | - var day = myDate.getDate(); | ||
116 | - var dayNow = year + '-' + (month + 1) + "-" + day; | ||
117 | - this.setData({ | ||
118 | - startTime: dayNow | ||
119 | - }) | ||
120 | - }, | ||
121 | //点击减少 | 100 | //点击减少 |
122 | dec() { | 101 | dec() { |
123 | let that = this | 102 | let that = this |
@@ -189,26 +168,26 @@ Page({ | @@ -189,26 +168,26 @@ Page({ | ||
189 | }); | 168 | }); |
190 | }, | 169 | }, |
191 | //立即购买 | 170 | //立即购买 |
192 | - buy() { | 171 | + buy: util.throttle(function () { |
193 | //生成订单 | 172 | //生成订单 |
194 | this.getAddress(); | 173 | this.getAddress(); |
195 | - if(this.data.userData == undefined){ | 174 | + if (this.data.userData == undefined) { |
196 | wx.showToast({ | 175 | wx.showToast({ |
197 | title: '请选择收货地址', | 176 | title: '请选择收货地址', |
198 | icon: "none" | 177 | icon: "none" |
199 | }) | 178 | }) |
200 | - }else if(this.data.timers == ""){ | 179 | + } else if (this.data.timers == "") { |
201 | wx.showToast({ | 180 | wx.showToast({ |
202 | title: '请选择配送时间', | 181 | title: '请选择配送时间', |
203 | icon: "none" | 182 | icon: "none" |
204 | }) | 183 | }) |
205 | - }else{ | 184 | + } else { |
206 | setTimeout(() => { | 185 | setTimeout(() => { |
207 | let postData = { | 186 | let postData = { |
208 | addressId: this.data.addressId, | 187 | addressId: this.data.addressId, |
209 | carts: this.data.cartsId, | 188 | carts: this.data.cartsId, |
210 | couponId: this.data.couponId, | 189 | couponId: this.data.couponId, |
211 | - deliveryTime: this.data.deliveryTime+this.data.timers, | 190 | + deliveryTime: this.data.deliveryTime + this.data.timers, |
212 | note: this.data.leavaWord, | 191 | note: this.data.leavaWord, |
213 | } | 192 | } |
214 | method.postRequest("/order/buyNow", postData, data => { | 193 | method.postRequest("/order/buyNow", postData, data => { |
@@ -232,7 +211,7 @@ Page({ | @@ -232,7 +211,7 @@ Page({ | ||
232 | 211 | ||
233 | } | 212 | } |
234 | 213 | ||
235 | - }, | 214 | + }, 3000), |
236 | //购物车-立即购买 | 215 | //购物车-立即购买 |
237 | buys() { | 216 | buys() { |
238 | method.getRequest("/order/buyNow/" + this.data.cartIds, data => { | 217 | method.getRequest("/order/buyNow/" + this.data.cartIds, data => { |
@@ -305,28 +284,22 @@ Page({ | @@ -305,28 +284,22 @@ Page({ | ||
305 | 284 | ||
306 | onShow: function () { | 285 | onShow: function () { |
307 | let that = this; | 286 | let that = this; |
287 | + //优惠券 | ||
308 | let cartsId = wx.getStorageSync('pitchList'); | 288 | let cartsId = wx.getStorageSync('pitchList'); |
309 | let goodsCarts = wx.getStorageSync('pitchCart'); | 289 | let goodsCarts = wx.getStorageSync('pitchCart'); |
310 | - // let date = wx.getStorageSync('date'); | ||
311 | let type = wx.getStorageSync('type') //优惠券类型 | 290 | let type = wx.getStorageSync('type') //优惠券类型 |
312 | - let amount = wx.getStorageSync('amount') //优惠券类型 | ||
313 | - let cardId = wx.getStorageSync('cardId') | ||
314 | - | 291 | + let amount = wx.getStorageSync('amount') //优惠券满金额 |
292 | + let cardId = wx.getStorageSync('cardId') //优惠券id | ||
315 | that.setData({ | 293 | that.setData({ |
316 | cartsId: cartsId, | 294 | cartsId: cartsId, |
317 | cartList: goodsCarts, | 295 | cartList: goodsCarts, |
318 | couponId: cardId, | 296 | couponId: cardId, |
319 | - // date: date, | ||
320 | type: type, | 297 | type: type, |
321 | amount: amount | 298 | amount: amount |
322 | }) | 299 | }) |
323 | that.getTotalPrice(); | 300 | that.getTotalPrice(); |
324 | that.getAddress(); | 301 | that.getAddress(); |
325 | - that.getDayTime(); //获取当天时间 | ||
326 | - // that.buy(); | ||
327 | - that.getList(); // | ||
328 | - // wx.removeStorageSync('pitchCart') | ||
329 | - // wx.removeStorageSync('pitchList') | 302 | + that.getList(); |
330 | wx.removeStorageSync('cardId') | 303 | wx.removeStorageSync('cardId') |
331 | wx.setStorageSync('amount', "") | 304 | wx.setStorageSync('amount', "") |
332 | }, | 305 | }, |
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | 请选择收货地址 | 12 | 请选择收货地址 |
13 | </view> | 13 | </view> |
14 | <view class="arrow"> | 14 | <view class="arrow"> |
15 | - <image src="/images/04-01/arrow.png"></image> | 15 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
16 | </view> | 16 | </view> |
17 | </view> | 17 | </view> |
18 | <!-- 配送时间 --> | 18 | <!-- 配送时间 --> |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | {{timers.length ? timers : ''}} | 25 | {{timers.length ? timers : ''}} |
26 | </view> | 26 | </view> |
27 | <view class="arrow"> | 27 | <view class="arrow"> |
28 | - <image src="/images/04-01/arrow.png"></image> | 28 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
29 | </view> | 29 | </view> |
30 | <view class="section"> | 30 | <view class="section"> |
31 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> | 31 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> |
@@ -38,21 +38,17 @@ | @@ -38,21 +38,17 @@ | ||
38 | <view class="cartListItem" wx:for="{{cartList}}"> | 38 | <view class="cartListItem" wx:for="{{cartList}}"> |
39 | <view class="itemRight"> | 39 | <view class="itemRight"> |
40 | <view class="productPic"> | 40 | <view class="productPic"> |
41 | - <image src="{{item.goodsImg}}"></image> | 41 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
42 | </view> | 42 | </view> |
43 | <view style="width:381rpx"> | 43 | <view style="width:381rpx"> |
44 | <view class="productName">{{item.goodsName}}</view> | 44 | <view class="productName">{{item.goodsName}}</view> |
45 | <view class="productDetail">{{item.goodsAttributes}}</view> | 45 | <view class="productDetail">{{item.goodsAttributes}}</view> |
46 | <view class="productPrice"> | 46 | <view class="productPrice"> |
47 | - <view class="price">¥{{item.goodsPrice}}</view> | 47 | + <view class="price"> |
48 | + <text class="moneyIcon">¥</text> | ||
49 | + <text class="moneyNum">{{item.goodsPrice}}</text></view> | ||
48 | <view class="num"> | 50 | <view class="num"> |
49 | - <!-- <view class="reduce" catchtap="dec"> | ||
50 | - <image src="/images/04-01/reduce.png"></image> | ||
51 | - </view> --> | ||
52 | <view class="numContent">x{{item.num}}</view> | 51 | <view class="numContent">x{{item.num}}</view> |
53 | - <!-- <view class="add" catchtap="add"> | ||
54 | - <image src="/images/04-01/add.png"></image> | ||
55 | - </view> --> | ||
56 | </view> | 52 | </view> |
57 | </view> | 53 | </view> |
58 | </view> | 54 | </view> |
@@ -75,7 +71,7 @@ | @@ -75,7 +71,7 @@ | ||
75 | <view class="discountText" wx:if="{{type===0}}">无门槛{{discountText}}元优惠券</view> | 71 | <view class="discountText" wx:if="{{type===0}}">无门槛{{discountText}}元优惠券</view> |
76 | <!-- <view class="discountText">{{discountText}}</view> --> | 72 | <!-- <view class="discountText">{{discountText}}</view> --> |
77 | <view class="arrowRight"> | 73 | <view class="arrowRight"> |
78 | - <image src="/images/04-01/arrow.png"></image> | 74 | + <image src="/images/04-01/arrow.png" mode="aspectFill"></image> |
79 | </view> | 75 | </view> |
80 | </view> | 76 | </view> |
81 | </view> | 77 | </view> |
@@ -119,6 +119,16 @@ | @@ -119,6 +119,16 @@ | ||
119 | } | 119 | } |
120 | 120 | ||
121 | /* 商品列表 */ | 121 | /* 商品列表 */ |
122 | +.moneyIcon{ | ||
123 | + font-size: 36rpx; | ||
124 | + color: #FF1717; | ||
125 | + margin-right: -10rpx; | ||
126 | +} | ||
127 | +.moneyNum{ | ||
128 | + font-size: 36rpx; | ||
129 | + font-weight: 500; | ||
130 | + color: #FF1717; | ||
131 | +} | ||
122 | .cartList { | 132 | .cartList { |
123 | width: 686rpx; | 133 | width: 686rpx; |
124 | margin: 0 auto; | 134 | margin: 0 auto; |
@@ -180,7 +190,7 @@ | @@ -180,7 +190,7 @@ | ||
180 | width: 320rpx; | 190 | width: 320rpx; |
181 | height: 40rpx; | 191 | height: 40rpx; |
182 | font-size: 28rpx; | 192 | font-size: 28rpx; |
183 | - font-weight: 500; | 193 | + font-weight: 600; |
184 | text-align: left; | 194 | text-align: left; |
185 | color: #333333; | 195 | color: #333333; |
186 | line-height: 40rpx; | 196 | line-height: 40rpx; |
@@ -4,59 +4,25 @@ const util = require("../../utils/util.js"); | @@ -4,59 +4,25 @@ const util = require("../../utils/util.js"); | ||
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | Authorization: '', //判断用户是否登录 | 6 | Authorization: '', //判断用户是否登录 |
7 | + integral: '', //用户积分 | ||
7 | page: 1, | 8 | page: 1, |
8 | - classifyId: "", | 9 | + classifyId: "", //侧边分类id |
10 | + activeKey: 0, | ||
11 | + lableArray: [], //侧边导航 | ||
12 | + list: [], //商品列表 | ||
9 | idx: 0, //商品规格索引 | 13 | idx: 0, //商品规格索引 |
10 | check: false, //商品规格选择 | 14 | check: false, //商品规格选择 |
11 | - goodsData: '', //获取商品库存 | ||
12 | - keyword: '', | 15 | + goodsData: '', //商品信息 |
16 | + stockNum: '', //获取商品库存 | ||
17 | + keyword: '', //搜索 | ||
13 | id: '', | 18 | id: '', |
14 | - activeKey: 0, | ||
15 | - count: 1, | ||
16 | - stockNum: '', | ||
17 | - integral: '', //积分 | ||
18 | - lableArray: [], | ||
19 | - lableOne: [], | ||
20 | - lableTwo: [], | ||
21 | - lableThree: [], | ||
22 | - list: [], | ||
23 | - location: '', | 19 | + count: 1, //加购数量 |
20 | + location: '', //地址解析 | ||
24 | latitude: '', //维度 | 21 | latitude: '', //维度 |
25 | longitude: '', //经度 | 22 | longitude: '', //经度 |
26 | bottomHint: false //触底提示 | 23 | bottomHint: false //触底提示 |
27 | }, | 24 | }, |
28 | - // tabbar | ||
29 | - toHome() { | ||
30 | - wx.reLaunch({ | ||
31 | - url: '/pages/home/home', | ||
32 | - }) | ||
33 | - }, | ||
34 | - toShopCart() { | ||
35 | - wx.reLaunch({ | ||
36 | - url: '/pages/shopping-cart/shopping-cart', | ||
37 | - }) | ||
38 | - }, | ||
39 | - toUser() { | ||
40 | - wx.reLaunch({ | ||
41 | - url: '/pages/user/user', | ||
42 | - }) | ||
43 | - }, | ||
44 | - //获取定位 | ||
45 | - // getLocation() { | ||
46 | - // let that = this; | ||
47 | - // wx.getLocation({ | ||
48 | - // type: 'gcj02', | ||
49 | - // success(res) { | ||
50 | - // that.setData({ | ||
51 | - // latitude: res.latitude, | ||
52 | - // longitude: res.longitude | ||
53 | - // }) | ||
54 | - // that.location(); | ||
55 | - // const speed = res.speed | ||
56 | - // const accuracy = res.accuracy | ||
57 | - // } | ||
58 | - // }) | ||
59 | - // }, | 25 | + //获取位置信息 |
60 | location() { | 26 | location() { |
61 | let that = this | 27 | let that = this |
62 | console.log(that.data.latitude, '5555') | 28 | console.log(that.data.latitude, '5555') |
@@ -71,9 +37,6 @@ Page({ | @@ -71,9 +37,6 @@ Page({ | ||
71 | }) | 37 | }) |
72 | }, | 38 | }, |
73 | //搜索框 | 39 | //搜索框 |
74 | - doSearch() { | ||
75 | - | ||
76 | - }, | ||
77 | getKeyWord(e) { | 40 | getKeyWord(e) { |
78 | this.setData({ | 41 | this.setData({ |
79 | keyword: e.detail.value | 42 | keyword: e.detail.value |
@@ -158,6 +121,7 @@ Page({ | @@ -158,6 +121,7 @@ Page({ | ||
158 | } | 121 | } |
159 | }) | 122 | }) |
160 | }, | 123 | }, |
124 | + //加入购物车 | ||
161 | addCart(e) { | 125 | addCart(e) { |
162 | if (this.data.Authorization) { | 126 | if (this.data.Authorization) { |
163 | let id = e.currentTarget.dataset.id | 127 | let id = e.currentTarget.dataset.id |
@@ -321,7 +285,6 @@ Page({ | @@ -321,7 +285,6 @@ Page({ | ||
321 | * 生命周期函数--监听页面加载 | 285 | * 生命周期函数--监听页面加载 |
322 | */ | 286 | */ |
323 | onLoad: function (options) { | 287 | onLoad: function (options) { |
324 | - // this.dataRequest(); | ||
325 | this.catalog(); | 288 | this.catalog(); |
326 | if (wx.getStorageSync('categoryId')) { | 289 | if (wx.getStorageSync('categoryId')) { |
327 | let id = wx.getStorageSync('categoryId') | 290 | let id = wx.getStorageSync('categoryId') |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <view class="searchMain"> | 3 | <view class="searchMain"> |
4 | <view class="location"> | 4 | <view class="location"> |
5 | <view style="display:inline-block;height: 20rpx;width: 20rpx;" bindtap="open"> | 5 | <view style="display:inline-block;height: 20rpx;width: 20rpx;" bindtap="open"> |
6 | - <image src="/images/location.png"></image> | 6 | + <image src="/images/location.png" mode="aspectFill"></image> |
7 | </view> | 7 | </view> |
8 | <text>{{location}}</text> | 8 | <text>{{location}}</text> |
9 | </view> | 9 | </view> |
@@ -13,35 +13,13 @@ | @@ -13,35 +13,13 @@ | ||
13 | <input class="weui-input" auto-focus="{{false}}" placeholder="请输入商品名称" bindinput="getKeyWord" | 13 | <input class="weui-input" auto-focus="{{false}}" placeholder="请输入商品名称" bindinput="getKeyWord" |
14 | placeholder-class="placeholder" /> | 14 | placeholder-class="placeholder" /> |
15 | <view class="search_right" catchtap="search"> | 15 | <view class="search_right" catchtap="search"> |
16 | - <image src="/images/01-02/sousuo.png"></image> | 16 | + <image src="/images/01-02/sousuo.png" mode="aspectFill"></image> |
17 | </view> | 17 | </view> |
18 | </view> | 18 | </view> |
19 | 19 | ||
20 | </view> | 20 | </view> |
21 | </view> | 21 | </view> |
22 | </view> | 22 | </view> |
23 | -<!-- 头部导航 --> | ||
24 | -<!-- <view class="box"> | ||
25 | - <scroll-view scroll-x="true" class="scroll"> | ||
26 | - <view wx:for="{{}}" class="item"> | ||
27 | - {{item}} | ||
28 | - </view> | ||
29 | - </scroll-view> | ||
30 | - <view class="arrow" bindtap="pullDown"> | ||
31 | - <image src="/images/04-01/arrow.png"> | ||
32 | - </image> | ||
33 | - </view> | ||
34 | - <view wx:if="{{show}}" class="pullDownBox"> | ||
35 | - <view class="mainClassify"> | ||
36 | - 全部分类 | ||
37 | - </view> | ||
38 | - <view wx:for="{{}}" class="downItem" catchtap=""> | ||
39 | - {{item}} | ||
40 | - </view> | ||
41 | - </view> | ||
42 | -</view> | ||
43 | -<view class="mask" wx:if="{{show}}" catchtap="pullDown"> | ||
44 | -</view> --> | ||
45 | <!-- 侧边导航 --> | 23 | <!-- 侧边导航 --> |
46 | <view class="navSide"> | 24 | <view class="navSide"> |
47 | <van-sidebar active-key="{{ activeKey }}" style="background:rgb(247,248,250)"> | 25 | <van-sidebar active-key="{{ activeKey }}" style="background:rgb(247,248,250)"> |
@@ -54,7 +32,7 @@ | @@ -54,7 +32,7 @@ | ||
54 | <scroll-view scroll-with-animation scroll-y class="scroll-view"> | 32 | <scroll-view scroll-with-animation scroll-y class="scroll-view"> |
55 | <view class="navItem" wx:for="{{list}}" data-id="{{item.goodsId}}" data-index="{{index}}" bindtap="goGoodsDetail"> | 33 | <view class="navItem" wx:for="{{list}}" data-id="{{item.goodsId}}" data-index="{{index}}" bindtap="goGoodsDetail"> |
56 | <view class="productLeft"> | 34 | <view class="productLeft"> |
57 | - <image src="{{item.goodsImg}}"></image> | 35 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
58 | </view> | 36 | </view> |
59 | <view class="productRight"> | 37 | <view class="productRight"> |
60 | <view class="name">{{item.goodsName}}</view> | 38 | <view class="name">{{item.goodsName}}</view> |
@@ -66,11 +44,11 @@ | @@ -66,11 +44,11 @@ | ||
66 | {{item.goodsPrice}}</view> | 44 | {{item.goodsPrice}}</view> |
67 | <view class="addIcon" catchtap="addCart" data-id="{{item.goodsId}}" data-index="{{index}}" | 45 | <view class="addIcon" catchtap="addCart" data-id="{{item.goodsId}}" data-index="{{index}}" |
68 | wx:if="{{item.type==2}}"> | 46 | wx:if="{{item.type==2}}"> |
69 | - <image src="/images/03-02/tianjia.png"></image> | 47 | + <image src="/images/03-02/tianjia.png" mode="aspectFill"></image> |
70 | </view> | 48 | </view> |
71 | <view class="exchange" wx:if="{{item.type==1}}" catchtap="exchange" data-integral="{{item.goodsPrice}}" | 49 | <view class="exchange" wx:if="{{item.type==1}}" catchtap="exchange" data-integral="{{item.goodsPrice}}" |
72 | data-defaultSku="{{item.defaultSku}}"> | 50 | data-defaultSku="{{item.defaultSku}}"> |
73 | - <image src="/images/03-02/duihuan.png"></image> | 51 | + <image src="/images/03-02/duihuan.png" mode="aspectFill"></image> |
74 | </view> | 52 | </view> |
75 | </view> | 53 | </view> |
76 | </view> | 54 | </view> |
@@ -85,7 +63,7 @@ | @@ -85,7 +63,7 @@ | ||
85 | <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> | 63 | <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> |
86 | <view class="diceng" catchtap="openMask"> | 64 | <view class="diceng" catchtap="openMask"> |
87 | <view class="info"> | 65 | <view class="info"> |
88 | - <image src="{{goodsData.goodsBanners[0]}}"></image> | 66 | + <image src="{{goodsData.goodsBanners[0]}}" mode="aspectFill"></image> |
89 | <view class="info_right"> | 67 | <view class="info_right"> |
90 | <view class="info_name">{{goodsData.goodsName}}</view> | 68 | <view class="info_name">{{goodsData.goodsName}}</view> |
91 | <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> | 69 | <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> |
@@ -116,32 +94,3 @@ | @@ -116,32 +94,3 @@ | ||
116 | <view class="confrimBtn" catchtap="confrimCart">确定</view> | 94 | <view class="confrimBtn" catchtap="confrimCart">确定</view> |
117 | </view> | 95 | </view> |
118 | </view> | 96 | </view> |
119 | -<!-- tabbar --> | ||
120 | -<!-- <view class="tabbarBox"> | ||
121 | - <ul> | ||
122 | - <li> | ||
123 | - <view class="tabbarPic" bindtap="toHome"> | ||
124 | - <image src="/images/tab/home.png"></image> | ||
125 | - </view> | ||
126 | - <text bindtap="toHome">首页</text> | ||
127 | - </li> | ||
128 | - <li> | ||
129 | - <view class="tabbarPic"> | ||
130 | - <image src="/images/tab/classify.png"></image> | ||
131 | - </view> | ||
132 | - <text class="check">分类</text> | ||
133 | - </li> | ||
134 | - <li> | ||
135 | - <view class="tabbarPic" bindtap="toShopCart"> | ||
136 | - <image src="/images/tab/cart (2).png"></image> | ||
137 | - </view> | ||
138 | - <text bindtap="toShopCart">购物车</text> | ||
139 | - </li> | ||
140 | - <li> | ||
141 | - <view class="tabbarPic" bindtap="toUser"> | ||
142 | - <image src="/images/tab/user.png"></image> | ||
143 | - </view> | ||
144 | - <text bindtap="toUser">我的</text> | ||
145 | - </li> | ||
146 | - </ul> | ||
147 | -</view> --> |
@@ -13,13 +13,13 @@ | @@ -13,13 +13,13 @@ | ||
13 | <view class="time">{{startTime}}-{{endTime}}</view> | 13 | <view class="time">{{startTime}}-{{endTime}}</view> |
14 | <view class="time">{{item.time}}</view> | 14 | <view class="time">{{item.time}}</view> |
15 | </view> | 15 | </view> |
16 | + <view class="bjPic"> | ||
17 | + <image src="/images/youhuiquan.png" mode="aspectFill"></image> | ||
18 | + </view> | ||
16 | <view class="topCircle"></view> | 19 | <view class="topCircle"></view> |
17 | <view class="bottomCircle"></view> | 20 | <view class="bottomCircle"></view> |
18 | 21 | ||
19 | </view> | 22 | </view> |
20 | - <!-- <view class="bgPic"> | ||
21 | - <image src="/images/youhuiquan.png"></image> | ||
22 | - </view> --> | ||
23 | </view> | 23 | </view> |
24 | <view class="bottomHint" wx:if="{{bottomHint}}"> | 24 | <view class="bottomHint" wx:if="{{bottomHint}}"> |
25 | 我是有底线的~ | 25 | 我是有底线的~ |
@@ -17,12 +17,11 @@ | @@ -17,12 +17,11 @@ | ||
17 | height: 246rpx; | 17 | height: 246rpx; |
18 | } | 18 | } |
19 | .picBox { | 19 | .picBox { |
20 | - width:95%; | 20 | + width:92%; |
21 | height: 246rpx; | 21 | height: 246rpx; |
22 | margin: 0 auto; | 22 | margin: 0 auto; |
23 | margin-bottom: 24rpx; | 23 | margin-bottom: 24rpx; |
24 | display: flex; | 24 | display: flex; |
25 | - background-color: #ffffff; | ||
26 | position: relative; | 25 | position: relative; |
27 | border-radius: 16rpx; | 26 | border-radius: 16rpx; |
28 | } | 27 | } |
@@ -30,12 +29,11 @@ | @@ -30,12 +29,11 @@ | ||
30 | .picBox .left { | 29 | .picBox .left { |
31 | width: 200rpx; | 30 | width: 200rpx; |
32 | height: 244rpx; | 31 | height: 244rpx; |
33 | - background: linear-gradient(270deg, #f09c4d -70%, #ff4903); | ||
34 | - /* background: linear-gradient(270deg, #fb7900 -100%, #ff4903); */ | ||
35 | padding-top: 48rpx; | 32 | padding-top: 48rpx; |
36 | padding-bottom: 48rpx; | 33 | padding-bottom: 48rpx; |
37 | box-sizing: border-box; | 34 | box-sizing: border-box; |
38 | border-radius: 16rpx; | 35 | border-radius: 16rpx; |
36 | + z-index: 9; | ||
39 | } | 37 | } |
40 | 38 | ||
41 | .left>view { | 39 | .left>view { |
@@ -56,6 +54,7 @@ | @@ -56,6 +54,7 @@ | ||
56 | padding-bottom: 78rpx; | 54 | padding-bottom: 78rpx; |
57 | padding-left: 32rpx; | 55 | padding-left: 32rpx; |
58 | box-sizing: border-box; | 56 | box-sizing: border-box; |
57 | + z-index: 9; | ||
59 | } | 58 | } |
60 | 59 | ||
61 | .right>view { | 60 | .right>view { |
@@ -72,7 +71,18 @@ color: #999999; | @@ -72,7 +71,18 @@ color: #999999; | ||
72 | letter-spacing: 0px; | 71 | letter-spacing: 0px; |
73 | margin-top: 24rpx; | 72 | margin-top: 24rpx; |
74 | } | 73 | } |
75 | -.topCircle{ | 74 | +.bjPic{ |
75 | + width: 100%; | ||
76 | + height: 246rpx; | ||
77 | + position: absolute; | ||
78 | + top: 0; | ||
79 | + left: 0; | ||
80 | +} | ||
81 | +.bjPic image{ | ||
82 | + width: 100%; | ||
83 | + height: 100%; | ||
84 | +} | ||
85 | +/* .topCircle{ | ||
76 | position: absolute; | 86 | position: absolute; |
77 | top: -4px; | 87 | top: -4px; |
78 | left: 28%; | 88 | left: 28%; |
@@ -80,8 +90,8 @@ margin-top: 24rpx; | @@ -80,8 +90,8 @@ margin-top: 24rpx; | ||
80 | height: 20rpx; | 90 | height: 20rpx; |
81 | background-color: #f1f2f4; | 91 | background-color: #f1f2f4; |
82 | border-radius: 50%; | 92 | border-radius: 50%; |
83 | -} | ||
84 | -.bottomCircle{ | 93 | +} */ |
94 | +/* .bottomCircle{ | ||
85 | position: absolute; | 95 | position: absolute; |
86 | bottom: -4px; | 96 | bottom: -4px; |
87 | left: 28%; | 97 | left: 28%; |
@@ -89,7 +99,7 @@ margin-top: 24rpx; | @@ -89,7 +99,7 @@ margin-top: 24rpx; | ||
89 | height: 20rpx; | 99 | height: 20rpx; |
90 | background-color: #f1f2f4; | 100 | background-color: #f1f2f4; |
91 | border-radius: 50%; | 101 | border-radius: 50%; |
92 | -} | 102 | +} */ |
93 | .listBlank{ | 103 | .listBlank{ |
94 | width: 750rpx; | 104 | width: 750rpx; |
95 | height:400rpx; | 105 | height:400rpx; |
@@ -8,11 +8,10 @@ Page({ | @@ -8,11 +8,10 @@ Page({ | ||
8 | username: '', | 8 | username: '', |
9 | phone: '', | 9 | phone: '', |
10 | value: '', | 10 | value: '', |
11 | - switchChecked:false, | 11 | + switchChecked:false, //默认地址 |
12 | show: false, | 12 | show: false, |
13 | selectBox: true, | 13 | selectBox: true, |
14 | location: '', | 14 | location: '', |
15 | - flag: true, | ||
16 | latitude: "", | 15 | latitude: "", |
17 | longitude: "", | 16 | longitude: "", |
18 | latitudes: "", //传值给后台 | 17 | latitudes: "", //传值给后台 |
@@ -86,8 +85,8 @@ Page({ | @@ -86,8 +85,8 @@ Page({ | ||
86 | }, | 85 | }, |
87 | map() { | 86 | map() { |
88 | let that = this; | 87 | let that = this; |
89 | - const key = 'C4QBZ-UYQLI-S45G2-5ETMC-LQYWE-L6FJU'; //使用在腾讯位置服务申请的key | ||
90 | - const referer = '春晓世纪华联超市'; //调用插件的app的名称 | 88 | + const key = 'C4QBZ-UYQLI-S45G2-5ETMC-LQYWE-L6FJU'; |
89 | + const referer = '春晓世纪华联超市'; | ||
91 | const category = '房产小区,其它'; | 90 | const category = '房产小区,其它'; |
92 | wx.getLocation({ | 91 | wx.getLocation({ |
93 | type: 'gcj02', | 92 | type: 'gcj02', |
@@ -123,21 +122,6 @@ Page({ | @@ -123,21 +122,6 @@ Page({ | ||
123 | console.log(e.detail.values, '确认') | 122 | console.log(e.detail.values, '确认') |
124 | }, | 123 | }, |
125 | 124 | ||
126 | - //开关 | ||
127 | - // onChange(detail) { | ||
128 | - // if(this.data.checked==1){ | ||
129 | - // this.setData({ | ||
130 | - // checked:!detail | ||
131 | - // }) | ||
132 | - // }else{ | ||
133 | - // this.setData({ | ||
134 | - // checked:detail | ||
135 | - // // checked: !this.data.checked | ||
136 | - // }) | ||
137 | - // } | ||
138 | - | ||
139 | - // console.log(detail,'detail') | ||
140 | - // }, | ||
141 | switch1Change(e){ | 125 | switch1Change(e){ |
142 | console.log(e.detail.value,'value') | 126 | console.log(e.detail.value,'value') |
143 | this.setData({ | 127 | this.setData({ |
@@ -163,8 +147,6 @@ Page({ | @@ -163,8 +147,6 @@ Page({ | ||
163 | }) | 147 | }) |
164 | } else { | 148 | } else { |
165 | let delFlags = this.data.switchChecked == true ? 1 : 0; | 149 | let delFlags = this.data.switchChecked == true ? 1 : 0; |
166 | - // let region = this.data.region; | ||
167 | - // let addressStr = region[0] + "" + region[1] + "" + region[2] | ||
168 | let postData = { | 150 | let postData = { |
169 | address: this.data.value, | 151 | address: this.data.value, |
170 | area: this.data.location, | 152 | area: this.data.location, |
@@ -241,8 +223,6 @@ Page({ | @@ -241,8 +223,6 @@ Page({ | ||
241 | longitudes: options.locations.split(",")[1], | 223 | longitudes: options.locations.split(",")[1], |
242 | id: options.id | 224 | id: options.id |
243 | }) | 225 | }) |
244 | - console.log(this.data.switchChecked) | ||
245 | - // } | ||
246 | 226 | ||
247 | }, | 227 | }, |
248 | 228 |
@@ -4,23 +4,6 @@ | @@ -4,23 +4,6 @@ | ||
4 | <van-field value="{{ username }}" clearable label="姓名" icon="question-o" placeholder="请输入姓名" | 4 | <van-field value="{{ username }}" clearable label="姓名" icon="question-o" placeholder="请输入姓名" |
5 | bind:click-icon="onClickIcon" bindinput="inputName" /> | 5 | bind:click-icon="onClickIcon" bindinput="inputName" /> |
6 | <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" /> | 6 | <van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" /> |
7 | - <!-- 地址 --> | ||
8 | - <!-- <van-cell title="展示弹出层" is-link bindtap="showPopup"> --> | ||
9 | - <!-- <view class="popups"> | ||
10 | - <view catchtap="map">地区</view> | ||
11 | - <view class="addBox" catchtap="map"> | ||
12 | - <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}"> | ||
13 | - <view class="picker"> | ||
14 | - {{region[0]}},{{region[1]}},{{region[2]}} | ||
15 | - </view> | ||
16 | - </picker> | ||
17 | - </view> | ||
18 | - </view> --> | ||
19 | - <!-- </van-cell> --> | ||
20 | - <!-- <van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 30%"> | ||
21 | - <van-area area-list="{{ areaList }}" value="area" columns-placeholder="{{ ['请选择', '请选择', '请选择'] }}" | ||
22 | - bind:change="changeAddress" bind:confirm="chooseAddress" bind:cancel="cancelChoose">{{city}}</van-area> | ||
23 | - </van-popup> --> | ||
24 | <view class="location" catchtap="map"> | 7 | <view class="location" catchtap="map"> |
25 | <text style="width:200rpx">收货地址</text> | 8 | <text style="width:200rpx">收货地址</text> |
26 | <text class="locationItem">{{location}}</text> | 9 | <text class="locationItem">{{location}}</text> |
@@ -32,8 +15,6 @@ | @@ -32,8 +15,6 @@ | ||
32 | <view class="defaultAddress"> | 15 | <view class="defaultAddress"> |
33 | <view class="defaultText">设为默认地址</view> | 16 | <view class="defaultText">设为默认地址</view> |
34 | <view class="switch"> | 17 | <view class="switch"> |
35 | - <!-- <van-switch checked="{{checked}}" bind:change="onChange" inactive-color="#d3d3d3" size="48rpx" | ||
36 | - style="margin-left:-60rpx" /> --> | ||
37 | <view class="body-view"> | 18 | <view class="body-view"> |
38 | <switch checked="{{switchChecked}}" bindchange="switch1Change" /> | 19 | <switch checked="{{switchChecked}}" bindchange="switch1Change" /> |
39 | </view> | 20 | </view> |
@@ -20,17 +20,6 @@ | @@ -20,17 +20,6 @@ | ||
20 | value="{{content}}"></textarea> | 20 | value="{{content}}"></textarea> |
21 | <view class="number">300/{{length}}</view> | 21 | <view class="number">300/{{length}}</view> |
22 | 22 | ||
23 | - <!-- <view class="photo"> | ||
24 | - <view class="photoOne" bindtap="chooseImageTap"> | ||
25 | - <image src="/images/05-06/photo.png"></image> | ||
26 | - </view> | ||
27 | - <view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}"> | ||
28 | - <image src="{{item}}"></image> | ||
29 | - <view class="delBox" bindtap="delPic"> | ||
30 | - <image src="/images/05-06/chaIcon.png"></image> | ||
31 | - </view> | ||
32 | - </view> | ||
33 | - </view> --> | ||
34 | <!-- 上传凭证 --> | 23 | <!-- 上传凭证 --> |
35 | <view class="photoBox"> | 24 | <view class="photoBox"> |
36 | <view class="photoText"> | 25 | <view class="photoText"> |
@@ -39,7 +28,7 @@ | @@ -39,7 +28,7 @@ | ||
39 | </view> | 28 | </view> |
40 | <view class="photo"> | 29 | <view class="photo"> |
41 | <view class="photoOne" bindtap="chooseImage"> | 30 | <view class="photoOne" bindtap="chooseImage"> |
42 | - <image src="/images/05-06/photo.png"></image> | 31 | + <image src="/images/05-06/photo.png" mode="aspectFill"></image> |
43 | </view> | 32 | </view> |
44 | <view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}"> | 33 | <view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}"> |
45 | <image src="{{item}}"></image> | 34 | <image src="{{item}}"></image> |
1 | <!--pages/home/home.wxml--> | 1 | <!--pages/home/home.wxml--> |
2 | -<image src="/images/homeBj.png" class="topImage"></image> | 2 | +<image src="/images/homeBj.png" class="topImage" mode="aspectFill"></image> |
3 | <view class="pageTitle1 "></view> | 3 | <view class="pageTitle1 "></view> |
4 | <view class="pageTitle">世纪华联</view> | 4 | <view class="pageTitle">世纪华联</view> |
5 | <view class="contenter"> | 5 | <view class="contenter"> |
@@ -15,11 +15,11 @@ | @@ -15,11 +15,11 @@ | ||
15 | placeholder="搜索" bind:focus="goSearch" /> | 15 | placeholder="搜索" bind:focus="goSearch" /> |
16 | </view> | 16 | </view> |
17 | <!-- 轮播图 --> | 17 | <!-- 轮播图 --> |
18 | - <view style="margin-top:60rpx"> | 18 | + <view style="margin-top:80rpx"> |
19 | <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> | 19 | <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> |
20 | <block wx:for="{{swiperArray}}" wx:for-index="idx"> | 20 | <block wx:for="{{swiperArray}}" wx:for-index="idx"> |
21 | <swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}"> | 21 | <swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}"> |
22 | - <image src="{{item.img}}" class="slideImage"></image> | 22 | + <image src="{{item.img}}" class="slideImage" mode="aspectFill"></image> |
23 | </swiper-item> | 23 | </swiper-item> |
24 | </block> | 24 | </block> |
25 | </swiper> | 25 | </swiper> |
@@ -30,7 +30,7 @@ | @@ -30,7 +30,7 @@ | ||
30 | <view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}" | 30 | <view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}" |
31 | data-index="{{index}}"> | 31 | data-index="{{index}}"> |
32 | <view class="classifyPic"> | 32 | <view class="classifyPic"> |
33 | - <image src="{{item.icon}}"></image> | 33 | + <image src="{{item.icon}}" mode="aspectFill"></image> |
34 | </view> | 34 | </view> |
35 | <view class="classifyText">{{item.categoryName}}</view> | 35 | <view class="classifyText">{{item.categoryName}}</view> |
36 | </view> | 36 | </view> |
@@ -55,7 +55,7 @@ | @@ -55,7 +55,7 @@ | ||
55 | <scroll-view class='wrapper' scroll-x="true"> | 55 | <scroll-view class='wrapper' scroll-x="true"> |
56 | <view class="contentItem" wx:for="{{discountArray}}"> | 56 | <view class="contentItem" wx:for="{{discountArray}}"> |
57 | <view class="countPic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> | 57 | <view class="countPic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> |
58 | - <image src="{{item.goodsImg}}"></image> | 58 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
59 | </view> | 59 | </view> |
60 | <view class="countText">{{item.goodsName}}</view> | 60 | <view class="countText">{{item.goodsName}}</view> |
61 | <view class="countPrice"> | 61 | <view class="countPrice"> |
@@ -65,7 +65,7 @@ | @@ -65,7 +65,7 @@ | ||
65 | <view class="countNum"> | 65 | <view class="countNum"> |
66 | <view class="num">还剩{{item.goodsStock}}件</view> | 66 | <view class="num">还剩{{item.goodsStock}}件</view> |
67 | <view class="icon" bindtap="addCart" data-id="{{item.defaultSku}}" data-type="{{item.type}}"> | 67 | <view class="icon" bindtap="addCart" data-id="{{item.defaultSku}}" data-type="{{item.type}}"> |
68 | - <image src="/images/01-01/cart.png"></image> | 68 | + <image src="/images/01-01/cart.png" mode="aspectFill"></image> |
69 | </view> | 69 | </view> |
70 | </view> | 70 | </view> |
71 | </view> | 71 | </view> |
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | <view class="dayPricePicMain"> | 93 | <view class="dayPricePicMain"> |
94 | <scroll-view class='wrapper' scroll-x="true"> | 94 | <scroll-view class='wrapper' scroll-x="true"> |
95 | <view wx:for="{{dayPicArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> | 95 | <view wx:for="{{dayPicArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> |
96 | - <image src="{{item.goodsImg}}"></image> | 96 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
97 | </view> | 97 | </view> |
98 | </scroll-view> | 98 | </scroll-view> |
99 | </view> | 99 | </view> |
@@ -112,7 +112,7 @@ | @@ -112,7 +112,7 @@ | ||
112 | <view class="dayPricePicMain"> | 112 | <view class="dayPricePicMain"> |
113 | <scroll-view class='wrapper' scroll-x="true"> | 113 | <scroll-view class='wrapper' scroll-x="true"> |
114 | <view wx:for="{{marilyArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> | 114 | <view wx:for="{{marilyArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> |
115 | - <image src="{{item.goodsImg}}"></image> | 115 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
116 | </view> | 116 | </view> |
117 | </scroll-view> | 117 | </scroll-view> |
118 | </view> | 118 | </view> |
@@ -125,7 +125,7 @@ | @@ -125,7 +125,7 @@ | ||
125 | <view class="pickContent"> | 125 | <view class="pickContent"> |
126 | <view class="pickItem" wx:for="{{pickList}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail"> | 126 | <view class="pickItem" wx:for="{{pickList}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail"> |
127 | <view class="pickPic"> | 127 | <view class="pickPic"> |
128 | - <image src="{{item.goodsImg}}"></image> | 128 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
129 | </view> | 129 | </view> |
130 | <view class="pickTitle">{{item.goodsName}}</view> | 130 | <view class="pickTitle">{{item.goodsName}}</view> |
131 | <view class="pickDesc">{{item.goodsAttributes}}</view> | 131 | <view class="pickDesc">{{item.goodsAttributes}}</view> |
@@ -148,10 +148,10 @@ | @@ -148,10 +148,10 @@ | ||
148 | <van-popup show="{{show}}" bind:close="onClose"> | 148 | <van-popup show="{{show}}" bind:close="onClose"> |
149 | <view class="popupBox"> | 149 | <view class="popupBox"> |
150 | <view class="delIcon" bindtap="onClose"> | 150 | <view class="delIcon" bindtap="onClose"> |
151 | - <image src="/images/icon_close@2x.png"></image> | 151 | + <image src="/images/icon_close@2x.png" mode="aspectFill"></image> |
152 | </view> | 152 | </view> |
153 | <view class="popupPic"> | 153 | <view class="popupPic"> |
154 | - <image src="/images/popup.png"></image> | 154 | + <image src="/images/popup.png" mode="aspectFill"></image> |
155 | </view> | 155 | </view> |
156 | <view> | 156 | <view> |
157 | <view class="popupText"> 实名优惠活动券</view> | 157 | <view class="popupText"> 实名优惠活动券</view> |
@@ -129,7 +129,7 @@ page { | @@ -129,7 +129,7 @@ page { | ||
129 | } | 129 | } |
130 | 130 | ||
131 | /* 分类 */ | 131 | /* 分类 */ |
132 | -.classify { | 132 | +.classify1 { |
133 | width: 100%; | 133 | width: 100%; |
134 | /* margin-top: 18rpx; */ | 134 | /* margin-top: 18rpx; */ |
135 | /* background-color: bisque; */ | 135 | /* background-color: bisque; */ |
@@ -146,18 +146,18 @@ page { | @@ -146,18 +146,18 @@ page { | ||
146 | display: inline-block; | 146 | display: inline-block; |
147 | } | 147 | } |
148 | 148 | ||
149 | -.classify .classifyPic { | 149 | +.classify1 .classifyPic { |
150 | width: 104rpx; | 150 | width: 104rpx; |
151 | height: 89rpx; | 151 | height: 89rpx; |
152 | } | 152 | } |
153 | 153 | ||
154 | -.classify .classifyPic image { | 154 | +.classify1 .classifyPic image { |
155 | width: 104rpx; | 155 | width: 104rpx; |
156 | height: 89rpx; | 156 | height: 89rpx; |
157 | border-radius: 16rpx; | 157 | border-radius: 16rpx; |
158 | } | 158 | } |
159 | 159 | ||
160 | -.classify .classifyText { | 160 | +.classify1 .classifyText { |
161 | width: 104rpx; | 161 | width: 104rpx; |
162 | height: 34rpx; | 162 | height: 34rpx; |
163 | font-size: 24rpx; | 163 | font-size: 24rpx; |
@@ -424,6 +424,7 @@ page { | @@ -424,6 +424,7 @@ page { | ||
424 | .dayPricePic image { | 424 | .dayPricePic image { |
425 | width: 100%; | 425 | width: 100%; |
426 | height: 100%; | 426 | height: 100%; |
427 | + border-radius: 16rpx; | ||
427 | } | 428 | } |
428 | 429 | ||
429 | .mainly .mainlyTitle { | 430 | .mainly .mainlyTitle { |
@@ -179,7 +179,7 @@ Page({ | @@ -179,7 +179,7 @@ Page({ | ||
179 | } | 179 | } |
180 | }, | 180 | }, |
181 | //商品-生成订单 | 181 | //商品-生成订单 |
182 | - creatOrder() { | 182 | + creatOrder: util.throttle(function () { |
183 | if (this.data.userData == undefined) { | 183 | if (this.data.userData == undefined) { |
184 | wx.showToast({ | 184 | wx.showToast({ |
185 | title: '请选择收货地址', | 185 | title: '请选择收货地址', |
@@ -214,8 +214,7 @@ Page({ | @@ -214,8 +214,7 @@ Page({ | ||
214 | } | 214 | } |
215 | }) | 215 | }) |
216 | } | 216 | } |
217 | - | ||
218 | - }, | 217 | + }, 3000), |
219 | //立即兑换 | 218 | //立即兑换 |
220 | exchange() { | 219 | exchange() { |
221 | let postData = { | 220 | let postData = { |
@@ -43,13 +43,14 @@ | @@ -43,13 +43,14 @@ | ||
43 | <view class="cartListItem"> | 43 | <view class="cartListItem"> |
44 | <view class="itemRight"> | 44 | <view class="itemRight"> |
45 | <view class="productPic"> | 45 | <view class="productPic"> |
46 | - <image src="{{goodsData.goodsImg}}"></image> | 46 | + <image src="{{goodsData.goodsImg}}" mode="aspectFill"></image> |
47 | </view> | 47 | </view> |
48 | <view style="width:381rpx"> | 48 | <view style="width:381rpx"> |
49 | <view class="productName">{{goodsData.goodsName}}</view> | 49 | <view class="productName">{{goodsData.goodsName}}</view> |
50 | <view class="productDetail">{{goodsData.goodsDesc}}</view> | 50 | <view class="productDetail">{{goodsData.goodsDesc}}</view> |
51 | <view class="productPrice"> | 51 | <view class="productPrice"> |
52 | - <view class="price">¥{{goodsData.goodsPrice}}</view> | 52 | + <view class="price"> <text class="moneyIcon">¥</text> |
53 | + <text class="moneyNum">{{goodsData.goodsPrice}}</text></view> | ||
53 | <view class="num"> | 54 | <view class="num"> |
54 | <view>X{{count}}</view> | 55 | <view>X{{count}}</view> |
55 | </view> | 56 | </view> |
@@ -19,6 +19,7 @@ page { | @@ -19,6 +19,7 @@ page { | ||
19 | color: #323233; | 19 | color: #323233; |
20 | width: 204rpx; | 20 | width: 204rpx; |
21 | } | 21 | } |
22 | + | ||
22 | .calendar1 { | 23 | .calendar1 { |
23 | font-size: 28rpx; | 24 | font-size: 28rpx; |
24 | font-weight: 400; | 25 | font-weight: 400; |
@@ -161,6 +162,18 @@ page { | @@ -161,6 +162,18 @@ page { | ||
161 | } | 162 | } |
162 | 163 | ||
163 | /* 商品列表 */ | 164 | /* 商品列表 */ |
165 | +.moneyIcon { | ||
166 | + font-size: 36rpx; | ||
167 | + color: #FF1717; | ||
168 | + margin-right: -8rpx; | ||
169 | +} | ||
170 | + | ||
171 | +.moneyNum { | ||
172 | + font-size: 36rpx; | ||
173 | + font-weight: 500; | ||
174 | + color: #FF1717; | ||
175 | +} | ||
176 | + | ||
164 | .cartList { | 177 | .cartList { |
165 | width: 686rpx; | 178 | width: 686rpx; |
166 | margin: 0 auto; | 179 | margin: 0 auto; |
@@ -224,7 +237,7 @@ page { | @@ -224,7 +237,7 @@ page { | ||
224 | width: 320rpx; | 237 | width: 320rpx; |
225 | height: 40rpx; | 238 | height: 40rpx; |
226 | font-size: 28rpx; | 239 | font-size: 28rpx; |
227 | - font-weight: 500; | 240 | + font-weight: 600; |
228 | text-align: left; | 241 | text-align: left; |
229 | color: #333333; | 242 | color: #333333; |
230 | line-height: 40rpx; | 243 | line-height: 40rpx; |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <!-- 商品信息 --> | 3 | <!-- 商品信息 --> |
4 | <view class="productInfo"> | 4 | <view class="productInfo"> |
5 | <view class="leftPic"> | 5 | <view class="leftPic"> |
6 | - <image src="{{postData.listGoodsVoList[0].goodsPic}}"></image> | 6 | + <image src="{{postData.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image> |
7 | </view> | 7 | </view> |
8 | <view class="rightText"> | 8 | <view class="rightText"> |
9 | <view class="name">{{postData.listGoodsVoList[0].goodsName}}</view> | 9 | <view class="name">{{postData.listGoodsVoList[0].goodsName}}</view> |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | <view class="expressName"> | 25 | <view class="expressName"> |
26 | <view class="expressLeft"> | 26 | <view class="expressLeft"> |
27 | <view class="expressIcon"> | 27 | <view class="expressIcon"> |
28 | - <image src="/images/05-08/ysExpress.png"></image> | 28 | + <image src="/images/05-08/ysExpress.png" mode="aspectFill"></image> |
29 | </view> | 29 | </view> |
30 | <view>运送快递</view> | 30 | <view>运送快递</view> |
31 | </view> | 31 | </view> |
@@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
34 | <view class="expressNumber"> | 34 | <view class="expressNumber"> |
35 | <view class="expressLeft"> | 35 | <view class="expressLeft"> |
36 | <view class="expressIcon"> | 36 | <view class="expressIcon"> |
37 | - <image src="/images/05-08/number.png"></image> | 37 | + <image src="/images/05-08/number.png" mode="aspectFill"></image> |
38 | </view> | 38 | </view> |
39 | <view>快递单号</view> | 39 | <view>快递单号</view> |
40 | </view> | 40 | </view> |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <view class="pickContent"> | 15 | <view class="pickContent"> |
16 | <view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail"> | 16 | <view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail"> |
17 | <view class="pickPic"> | 17 | <view class="pickPic"> |
18 | - <image src="{{item.goodsImg}}"></image> | 18 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
19 | </view> | 19 | </view> |
20 | <view class="pickTitle">{{item.goodsName}}</view> | 20 | <view class="pickTitle">{{item.goodsName}}</view> |
21 | <view class="pickDesc">{{item.goodsAttributes}}</view> | 21 | <view class="pickDesc">{{item.goodsAttributes}}</view> |
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | <view class="main_item_content "> | 9 | <view class="main_item_content "> |
10 | <!-- <van-card num="{{item.num}}" price="{{item.goodsPrice}}" desc="{{item.goodsAttributes}}" title="{{item.goodsName}}" thumb="{{item.goodsImg}}" /> --> | 10 | <!-- <van-card num="{{item.num}}" price="{{item.goodsPrice}}" desc="{{item.goodsAttributes}}" title="{{item.goodsName}}" thumb="{{item.goodsImg}}" /> --> |
11 | <view class="left"> | 11 | <view class="left"> |
12 | - <image src="{{item.goodsImg}}"></image> | 12 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
13 | </view> | 13 | </view> |
14 | <view class="right"> | 14 | <view class="right"> |
15 | <view class="name">{{item.goodsName}}</view> | 15 | <view class="name">{{item.goodsName}}</view> |
@@ -19,6 +19,7 @@ Page({ | @@ -19,6 +19,7 @@ Page({ | ||
19 | time: '2020.05.18-2017.12.30' | 19 | time: '2020.05.18-2017.12.30' |
20 | }], | 20 | }], |
21 | id: '', | 21 | id: '', |
22 | + bottomHint:false | ||
22 | }, | 23 | }, |
23 | 24 | ||
24 | //获取优惠券 | 25 | //获取优惠券 |
@@ -118,8 +119,15 @@ Page({ | @@ -118,8 +119,15 @@ Page({ | ||
118 | this.setData({ | 119 | this.setData({ |
119 | pageNums: this.data.pageNums + 1 | 120 | pageNums: this.data.pageNums + 1 |
120 | }) | 121 | }) |
121 | - console.log(this.data.pageNums, 'num') | ||
122 | this.getDiscounCard() | 122 | this.getDiscounCard() |
123 | + this.setData({ | ||
124 | + bottomHint:true | ||
125 | + }) | ||
126 | + setTimeout(()=>{ | ||
127 | + this.setData({ | ||
128 | + bottomHint:false | ||
129 | + }) | ||
130 | + },2000) | ||
123 | }, | 131 | }, |
124 | 132 | ||
125 | /** | 133 | /** |
1 | <!--pages/my-discount-card/my-discount-card.wxml--> | 1 | <!--pages/my-discount-card/my-discount-card.wxml--> |
2 | <!--pages/discount-card/discount-card.wxml--> | 2 | <!--pages/discount-card/discount-card.wxml--> |
3 | <view class="container"> | 3 | <view class="container"> |
4 | - <view class="picBox" wx:for="{{cardList}}" data-index="{{index}}" data-id="{{item.id}}" bindtap="useCard" data-type="{{item.type}}" data-amount="{{item.fullAmount}}"data-cardamount="{{item.amount}}"> | 4 | + <view class="picBox" wx:for="{{cardList}}" data-index="{{index}}" data-id="{{item.id}}" bindtap="useCard" |
5 | + data-type="{{item.type}}" data-amount="{{item.fullAmount}}" data-cardamount="{{item.amount}}"> | ||
5 | <view class="left"> | 6 | <view class="left"> |
6 | <view class="price">¥{{item.amount}}</view> | 7 | <view class="price">¥{{item.amount}}</view> |
7 | <view wx:if="{{item.fullAmount==undefined}}">无门槛使用</view> | 8 | <view wx:if="{{item.fullAmount==undefined}}">无门槛使用</view> |
@@ -12,8 +13,12 @@ | @@ -12,8 +13,12 @@ | ||
12 | <view class="time">{{item.startTime}}-{{item.endTime}}</view> | 13 | <view class="time">{{item.startTime}}-{{item.endTime}}</view> |
13 | <view class="time">{{item.time}}</view> | 14 | <view class="time">{{item.time}}</view> |
14 | </view> | 15 | </view> |
15 | - <view class="topCircle"></view> | ||
16 | - <view class="bottomCircle"></view> | 16 | + <view class="bgPic"> |
17 | + <image src="/images/youhuiquan.png" ></image> | ||
18 | + </view> | ||
19 | + </view> | ||
20 | + <view class="bottomHint" wx:if="{{bottomHint}}"> | ||
21 | + 我也是有底线的~ | ||
17 | </view> | 22 | </view> |
18 | <view class="listBlank" wx:if="{{cardList.length==0}}"> | 23 | <view class="listBlank" wx:if="{{cardList.length==0}}"> |
19 | 暂无可用优惠券~ | 24 | 暂无可用优惠券~ |
@@ -13,17 +13,16 @@ | @@ -13,17 +13,16 @@ | ||
13 | margin: 0 auto; | 13 | margin: 0 auto; |
14 | margin-bottom: 24rpx; | 14 | margin-bottom: 24rpx; |
15 | display: flex; | 15 | display: flex; |
16 | - background-color: #ffffff; | ||
17 | position: relative; | 16 | position: relative; |
18 | } | 17 | } |
19 | 18 | ||
20 | .picBox .left { | 19 | .picBox .left { |
21 | width: 200rpx; | 20 | width: 200rpx; |
22 | height: 244rpx; | 21 | height: 244rpx; |
23 | - background: linear-gradient(270deg, #f09c4d -70%, #ff4903); | ||
24 | padding-top: 48rpx; | 22 | padding-top: 48rpx; |
25 | padding-bottom: 48rpx; | 23 | padding-bottom: 48rpx; |
26 | box-sizing: border-box; | 24 | box-sizing: border-box; |
25 | + z-index: 9; | ||
27 | } | 26 | } |
28 | 27 | ||
29 | .left>view { | 28 | .left>view { |
@@ -44,6 +43,7 @@ | @@ -44,6 +43,7 @@ | ||
44 | padding-bottom: 78rpx; | 43 | padding-bottom: 78rpx; |
45 | padding-left: 32rpx; | 44 | padding-left: 32rpx; |
46 | box-sizing: border-box; | 45 | box-sizing: border-box; |
46 | + z-index: 9; | ||
47 | } | 47 | } |
48 | 48 | ||
49 | .right>view { | 49 | .right>view { |
@@ -60,23 +60,14 @@ color: #999999; | @@ -60,23 +60,14 @@ color: #999999; | ||
60 | letter-spacing: 0px; | 60 | letter-spacing: 0px; |
61 | margin-top: 24rpx; | 61 | margin-top: 24rpx; |
62 | } | 62 | } |
63 | -.topCircle{ | 63 | +.bgPic{ |
64 | position: absolute; | 64 | position: absolute; |
65 | - top: -4px; | ||
66 | - left: 98px; | ||
67 | - width: 20rpx; | ||
68 | - height: 20rpx; | ||
69 | - background-color: #f1f2f4; | ||
70 | - border-radius: 43%; | 65 | + top: 0; |
66 | + left: 0; | ||
71 | } | 67 | } |
72 | -.bottomCircle{ | ||
73 | - position: absolute; | ||
74 | - bottom: -4px; | ||
75 | - left: 96px; | ||
76 | - width: 20rpx; | ||
77 | - height: 20rpx; | ||
78 | - background-color: #f1f2f4; | ||
79 | - border-radius: 50%; | 68 | +.bgPic image{ |
69 | + width: 686rpx; | ||
70 | + height: 246rpx; | ||
80 | } | 71 | } |
81 | .listBlank{ | 72 | .listBlank{ |
82 | width: 750rpx; | 73 | width: 750rpx; |
@@ -87,3 +78,10 @@ margin-top: 24rpx; | @@ -87,3 +78,10 @@ margin-top: 24rpx; | ||
87 | color: #999999; | 78 | color: #999999; |
88 | font-size: 30rpx; | 79 | font-size: 30rpx; |
89 | } | 80 | } |
81 | +.bottomHint{ | ||
82 | + font-size: 24rpx; | ||
83 | + color: #999999; | ||
84 | + display: flex; | ||
85 | + justify-content: center; | ||
86 | + padding-bottom: 20rpx; | ||
87 | +} |
@@ -12,13 +12,7 @@ Page({ | @@ -12,13 +12,7 @@ Page({ | ||
12 | txt: '积分兑换卡', | 12 | txt: '积分兑换卡', |
13 | englis: 'Go to get it now' | 13 | englis: 'Go to get it now' |
14 | }, | 14 | }, |
15 | - getData: { | ||
16 | - headPic: '/images/1.jpg', | ||
17 | - userName: '孙俪', | ||
18 | - text: '积分条形码', | ||
19 | - codePic: '/images/card.png', | ||
20 | - cardNumber: '12345678910111213' | ||
21 | - }, | 15 | + getData: { }, //会员卡详情 |
22 | noVip: true, | 16 | noVip: true, |
23 | vip: false, | 17 | vip: false, |
24 | }, | 18 | }, |
@@ -2,8 +2,8 @@ | @@ -2,8 +2,8 @@ | ||
2 | <view class="topLine"> | 2 | <view class="topLine"> |
3 | </view> | 3 | </view> |
4 | <!-- 领取会员卡 --> | 4 | <!-- 领取会员卡 --> |
5 | -<!-- <view class="getCard" wx:if="{{noVip}}" > --> | ||
6 | -<view class="getCard" wx:if="{{true}}" > | 5 | +<view class="getCard" wx:if="{{noVip}}" > |
6 | +<!-- <view class="getCard" wx:if="{{true}}" > --> | ||
7 | <view class="title"> | 7 | <view class="title"> |
8 | {{postData.title}} | 8 | {{postData.title}} |
9 | </view> | 9 | </view> |
@@ -14,22 +14,8 @@ | @@ -14,22 +14,8 @@ | ||
14 | </view> | 14 | </view> |
15 | <!-- card --> | 15 | <!-- card --> |
16 | <view class="cardBox"> | 16 | <view class="cardBox"> |
17 | - <image src="/images/card (2).png"></image> | ||
18 | - </view> | ||
19 | - <view class="cardBoxTwo"> | ||
20 | - <view class="top"> | ||
21 | - <view class="left"> | ||
22 | - <view class="icon"> | ||
23 | - <image src="{{postData.icon}}"></image> | ||
24 | - </view> | ||
25 | - <view class="text"> | ||
26 | - <view>{{postData.name}}</view> | ||
27 | - <view class="card">{{postData.card}}</view> | ||
28 | - </view> | ||
29 | - </view> | ||
30 | - <view class="right">{{postData.txt}}</view> | ||
31 | - </view> | ||
32 | - <view class="bottom">{{postData.englis}}</view> | 17 | + <!-- <image src="/images/card (2).png"></image> --> |
18 | + <image src="/images/vipcard.png"></image> | ||
33 | </view> | 19 | </view> |
34 | <!-- bottom --> | 20 | <!-- bottom --> |
35 | <view class="btn" bindtap="getCart"> | 21 | <view class="btn" bindtap="getCart"> |
@@ -37,8 +23,8 @@ | @@ -37,8 +23,8 @@ | ||
37 | </view> | 23 | </view> |
38 | </view> | 24 | </view> |
39 | <!-- 会员卡详情 --> | 25 | <!-- 会员卡详情 --> |
40 | -<view class="cardDetail" wx:if="{{false}}"> | ||
41 | -<!-- <view class="cardDetail" wx:if="{{vip}}"> --> | 26 | +<!-- <view class="cardDetail" wx:if="{{false}}"> --> |
27 | +<view class="cardDetail" wx:if="{{vip}}"> | ||
42 | <image src="/images/card.png" ></image> | 28 | <image src="/images/card.png" ></image> |
43 | <!-- content --> | 29 | <!-- content --> |
44 | <view class="cardBox1"> | 30 | <view class="cardBox1"> |
@@ -41,89 +41,6 @@ | @@ -41,89 +41,6 @@ | ||
41 | margin: 0 auto; | 41 | margin: 0 auto; |
42 | margin-top: 44rpx; | 42 | margin-top: 44rpx; |
43 | } | 43 | } |
44 | -.cardBoxTwo { | ||
45 | - width: 612rpx; | ||
46 | - height: 310rpx; | ||
47 | - background-color: antiquewhite; | ||
48 | - z-index: 99; | ||
49 | - position: absolute; | ||
50 | - top: 116px; | ||
51 | - border-radius: 16rpx; | ||
52 | - left: 70rpx; | ||
53 | - background: transparent; | ||
54 | -} | ||
55 | - | ||
56 | -.top { | ||
57 | - height: 174rpx; | ||
58 | - display: flex; | ||
59 | - padding-top: 36rpx; | ||
60 | - padding-bottom: 60rpx; | ||
61 | - padding-left: 32rpx; | ||
62 | - box-sizing: border-box; | ||
63 | -} | ||
64 | - | ||
65 | -.top .left { | ||
66 | - width: 348rpx; | ||
67 | - display: flex; | ||
68 | -} | ||
69 | - | ||
70 | -.icon { | ||
71 | - width: 80rpx; | ||
72 | - height: 80rpx; | ||
73 | - border-radius: 50%; | ||
74 | - margin-right: 18rpx; | ||
75 | -} | ||
76 | - | ||
77 | -.text { | ||
78 | - font-size: 32rpx; | ||
79 | - font-weight: 600; | ||
80 | - text-align: left; | ||
81 | - color: #ffffff; | ||
82 | - text-shadow: 0px 2rpx 4rpx 0px #5e3600; | ||
83 | -} | ||
84 | - | ||
85 | -.card { | ||
86 | - font-size: 24rpx; | ||
87 | - font-weight: 400; | ||
88 | - color: #ffffff; | ||
89 | - text-shadow: 0px 1px 2px 0px #5e3600; | ||
90 | - margin-top: 8rpx; | ||
91 | -} | ||
92 | - | ||
93 | -.icon image { | ||
94 | - width: 80rpx; | ||
95 | - height: 80rpx; | ||
96 | - border-radius: 50%; | ||
97 | -} | ||
98 | - | ||
99 | -.top .right { | ||
100 | - width: 144rpx; | ||
101 | - height: 50rpx; | ||
102 | - border: 2rpx solid #ffffff; | ||
103 | - border-radius: 6rpx; | ||
104 | - font-size: 24rpx; | ||
105 | - font-weight: 400; | ||
106 | - text-align: left; | ||
107 | - color: #ffffff; | ||
108 | - text-shadow: 0px 1px 2px 0px #5e3600; | ||
109 | - margin-left: 48rpx; | ||
110 | - margin-top: 14rpx; | ||
111 | - display: flex; | ||
112 | - justify-content: center; | ||
113 | - align-items: center; | ||
114 | -} | ||
115 | - | ||
116 | -.bottom { | ||
117 | - height: 136rpx; | ||
118 | - padding-left: 24rpx; | ||
119 | - box-sizing: border-box; | ||
120 | - font-size: 28rpx; | ||
121 | - font-weight: 500; | ||
122 | - color: #ffffff; | ||
123 | - text-shadow: 0px 2rpx 4rpx 0px #5e3600; | ||
124 | - padding-top: 64rpx; | ||
125 | - box-sizing: border-box; | ||
126 | -} | ||
127 | 44 | ||
128 | /* bottom */ | 45 | /* bottom */ |
129 | .btn { | 46 | .btn { |
@@ -207,6 +124,9 @@ | @@ -207,6 +124,9 @@ | ||
207 | 124 | ||
208 | .text { | 125 | .text { |
209 | margin-top: 20rpx; | 126 | margin-top: 20rpx; |
127 | + text-align: center; | ||
128 | + font-size: 36rpx; | ||
129 | + font-weight: 600; | ||
210 | } | 130 | } |
211 | 131 | ||
212 | .codePic { | 132 | .codePic { |
@@ -2,17 +2,12 @@ | @@ -2,17 +2,12 @@ | ||
2 | let method = require("../../utils/reuqest.js") | 2 | let method = require("../../utils/reuqest.js") |
3 | Page({ | 3 | Page({ |
4 | data: { | 4 | data: { |
5 | - flag:false, //判断是否为退款订单 | ||
6 | - refoundStatus:'', | ||
7 | - goodsId:'', | ||
8 | - userData: { | ||
9 | - }, | ||
10 | - requestData: {}, | ||
11 | - cartList: [], | 5 | + flag: false, //判断是否为退款订单 |
6 | + refoundStatus: '', //退款状态 | ||
7 | + goodsId: '', | ||
8 | + userData: {}, | ||
9 | + requestData: {}, //订单信息 | ||
12 | num: '2222', | 10 | num: '2222', |
13 | - discountText: '满3减1满3减1', | ||
14 | - allMoney: '4.00', | ||
15 | - giveFee: '8.00', | ||
16 | orderData: { | 11 | orderData: { |
17 | number: '123456789456123', | 12 | number: '123456789456123', |
18 | time: '2020-11-03', | 13 | time: '2020-11-03', |
@@ -24,30 +19,29 @@ Page({ | @@ -24,30 +19,29 @@ Page({ | ||
24 | method.getRequest("/order/orderItem/" + orderId, data => { | 19 | method.getRequest("/order/orderItem/" + orderId, data => { |
25 | if (data.statusCode == 0) { | 20 | if (data.statusCode == 0) { |
26 | this.setData({ | 21 | this.setData({ |
27 | - requestData:data.data, | ||
28 | - goodsId:data.data.listGoodsVoList[0].goodsId, | 22 | + requestData: data.data, |
23 | + goodsId: data.data.listGoodsVoList[0].goodsId, | ||
29 | // refoundStatus:this.data.requestData.returnVos[0].status | 24 | // refoundStatus:this.data.requestData.returnVos[0].status |
30 | }) | 25 | }) |
31 | - let status=this.data.requestData.returnVos[0].status | 26 | + let status = this.data.requestData.returnVos[0].status |
32 | this.setData({ | 27 | this.setData({ |
33 | - refoundStatus:status | 28 | + refoundStatus: status |
34 | }) | 29 | }) |
35 | console.log(this.data.requestData.returnVos[0].status) | 30 | console.log(this.data.requestData.returnVos[0].status) |
36 | } | 31 | } |
37 | }) | 32 | }) |
38 | }, | 33 | }, |
39 | //商品详情 | 34 | //商品详情 |
40 | - goGoodsDetail(e){ | ||
41 | - let goodsid=e.currentTarget.dataset.id; | 35 | + goGoodsDetail(e) { |
36 | + let goodsid = e.currentTarget.dataset.id; | ||
42 | wx.navigateTo({ | 37 | wx.navigateTo({ |
43 | - url: '/pages/product-detail/product-detail?id='+goodsid, | 38 | + url: '/pages/product-detail/product-detail?id=' + goodsid, |
44 | }) | 39 | }) |
45 | }, | 40 | }, |
46 | //再次购买 | 41 | //再次购买 |
47 | - buyAgain(){ | ||
48 | - console.log(this.data.goodsId,'goods') | 42 | + buyAgain() { |
49 | wx.redirectTo({ | 43 | wx.redirectTo({ |
50 | - url: '/pages/product-detail/product-detail?id='+this.data.goodsId, | 44 | + url: '/pages/product-detail/product-detail?id=' + this.data.goodsId, |
51 | }) | 45 | }) |
52 | }, | 46 | }, |
53 | /** | 47 | /** |
@@ -55,14 +49,14 @@ Page({ | @@ -55,14 +49,14 @@ Page({ | ||
55 | */ | 49 | */ |
56 | onLoad: function (options) { | 50 | onLoad: function (options) { |
57 | let orderId = options.orderId | 51 | let orderId = options.orderId |
58 | - if(options.flag){ | 52 | + if (options.flag) { |
59 | this.setData({ | 53 | this.setData({ |
60 | - flag:true | 54 | + flag: true |
61 | }) | 55 | }) |
62 | } | 56 | } |
63 | - if(options.orderId){ | 57 | + if (options.orderId) { |
64 | this.orderDetail(orderId) | 58 | this.orderDetail(orderId) |
65 | - }else{ | 59 | + } else { |
66 | this.orderDetail(wx.getStorageSync('orderId')); | 60 | this.orderDetail(wx.getStorageSync('orderId')); |
67 | wx.removeStorageSync('orderId') | 61 | wx.removeStorageSync('orderId') |
68 | } | 62 | } |
@@ -15,19 +15,12 @@ | @@ -15,19 +15,12 @@ | ||
15 | <view class="default">默认</view> | 15 | <view class="default">默认</view> |
16 | <view class="userAddress">{{requestData.receiverDetailAddress}}</view> | 16 | <view class="userAddress">{{requestData.receiverDetailAddress}}</view> |
17 | </view> | 17 | </view> |
18 | - <!-- 配送时间 --> | ||
19 | - <!-- <view class="timeBox"> | ||
20 | - <view class="text">请选择配送时间{{requestData.deliveryTime}}</view> | ||
21 | - <view class="timeArrow"> | ||
22 | - <image src="/images/04-01/arrow.png"></image> | ||
23 | - </view> | ||
24 | - </view> --> | ||
25 | <!-- 商品列表 --> | 18 | <!-- 商品列表 --> |
26 | <view class="cartList"> | 19 | <view class="cartList"> |
27 | <view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> | 20 | <view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> |
28 | <view class="itemRight"> | 21 | <view class="itemRight"> |
29 | <view class="productPic"> | 22 | <view class="productPic"> |
30 | - <image src="{{item.goodsPic}}"></image> | 23 | + <image src="{{item.goodsPic}}" mode="aspectFill"></image> |
31 | </view> | 24 | </view> |
32 | <view style="width:434rpx"> | 25 | <view style="width:434rpx"> |
33 | <view class="productName">{{item.goodsName}}</view> | 26 | <view class="productName">{{item.goodsName}}</view> |
@@ -49,8 +42,6 @@ | @@ -49,8 +42,6 @@ | ||
49 | <view wx:if="{{requestData.note!==''}}"> | 42 | <view wx:if="{{requestData.note!==''}}"> |
50 | <view class="messageBox"> | 43 | <view class="messageBox"> |
51 | <view class="messageTitle">买家留言:</view> | 44 | <view class="messageTitle">买家留言:</view> |
52 | - <!-- <textarea name="" id="" cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" maxlength="50" | ||
53 | - bindinput="userInput"></textarea> --> | ||
54 | <view>{{requestData.note}}</view> | 45 | <view>{{requestData.note}}</view> |
55 | <view class="numLength">{{requestData.note.length}}/50</view> | 46 | <view class="numLength">{{requestData.note.length}}/50</view> |
56 | </view> | 47 | </view> |
@@ -60,9 +51,6 @@ | @@ -60,9 +51,6 @@ | ||
60 | <view>优惠券抵扣金额</view> | 51 | <view>优惠券抵扣金额</view> |
61 | <view class="discountBox"> | 52 | <view class="discountBox"> |
62 | <view class="discountText">{{requestData.couponAmount}}</view> | 53 | <view class="discountText">{{requestData.couponAmount}}</view> |
63 | - <!-- <view class="arrowRight"> | ||
64 | - <image src="/images/04-01/arrow.png"></image> | ||
65 | - </view> --> | ||
66 | </view> | 54 | </view> |
67 | </view> | 55 | </view> |
68 | <!-- 商品总额 --> | 56 | <!-- 商品总额 --> |
@@ -7,10 +7,8 @@ Page({ | @@ -7,10 +7,8 @@ Page({ | ||
7 | id: '', | 7 | id: '', |
8 | skuId: '', | 8 | skuId: '', |
9 | goodsId: '', | 9 | goodsId: '', |
10 | - swiperArray: [{ | ||
11 | - url: '/images/1.jpg' | ||
12 | - }], | ||
13 | - countDownShow: '', | 10 | + swiperArray: [], //商品轮播图 |
11 | + countDownShow: '', //判断限时优惠商品 | ||
14 | time: '', //倒计时 | 12 | time: '', //倒计时 |
15 | timeData: '', | 13 | timeData: '', |
16 | hour: "", | 14 | hour: "", |
@@ -18,11 +16,8 @@ Page({ | @@ -18,11 +16,8 @@ Page({ | ||
18 | second: "", | 16 | second: "", |
19 | endTimess: '', | 17 | endTimess: '', |
20 | goodsData: '', | 18 | goodsData: '', |
21 | - productName: '三好龙虾 招牌泼油小龙虾', | ||
22 | - price: '¥688.00', | ||
23 | - selectNum: '30', | ||
24 | pingjiaNum: 0, | 19 | pingjiaNum: 0, |
25 | - infoList: [], //评价 | 20 | + infoList: [],//评价 |
26 | image: '', //评价图片 | 21 | image: '', //评价图片 |
27 | flags: true, | 22 | flags: true, |
28 | deacArray: [], | 23 | deacArray: [], |
@@ -38,10 +33,10 @@ Page({ | @@ -38,10 +33,10 @@ Page({ | ||
38 | couponVos: [], //优惠券列表 | 33 | couponVos: [], //优惠券列表 |
39 | userData: '', //地址信息 | 34 | userData: '', //地址信息 |
40 | ceshi: [], //商品规格 | 35 | ceshi: [], //商品规格 |
41 | - idx: 0, //商品规格 | 36 | + idx: 0, //商品规格索引 |
42 | jifenNum: '', //商品积分 | 37 | jifenNum: '', //商品积分 |
43 | - integral: '', | ||
44 | - bottomHint:false //触底提示 | 38 | + integral: '', //用户积分 |
39 | + bottomHint: false //触底提示 | ||
45 | }, | 40 | }, |
46 | //倒计时 | 41 | //倒计时 |
47 | onChange1(e) { | 42 | onChange1(e) { |
@@ -148,10 +143,6 @@ Page({ | @@ -148,10 +143,6 @@ Page({ | ||
148 | }, | 143 | }, |
149 | //查看全部评价 | 144 | //查看全部评价 |
150 | openAll() { | 145 | openAll() { |
151 | - // this.setData({ | ||
152 | - // flags: !this.data.flags, | ||
153 | - // flag: !this.data.flag | ||
154 | - // }) | ||
155 | wx.navigateTo({ | 146 | wx.navigateTo({ |
156 | url: '/pages/all-evaluate/all-evaluate?goodsid=' + this.data.goodsId, | 147 | url: '/pages/all-evaluate/all-evaluate?goodsid=' + this.data.goodsId, |
157 | }) | 148 | }) |
@@ -169,11 +160,11 @@ Page({ | @@ -169,11 +160,11 @@ Page({ | ||
169 | } | 160 | } |
170 | }, | 161 | }, |
171 | getCartNum() { | 162 | getCartNum() { |
172 | - method.getRequest("/cart/countCart",data=>{ | ||
173 | - if(data.statusCode==0){ | ||
174 | - if(data.data!==0){ | 163 | + method.getRequest("/cart/countCart", data => { |
164 | + if (data.statusCode == 0) { | ||
165 | + if (data.data !== 0) { | ||
175 | this.setData({ | 166 | this.setData({ |
176 | - cartGoodNum:data.data | 167 | + cartGoodNum: data.data |
177 | }) | 168 | }) |
178 | } | 169 | } |
179 | 170 | ||
@@ -212,11 +203,7 @@ Page({ | @@ -212,11 +203,7 @@ Page({ | ||
212 | }, | 203 | }, |
213 | //联系客服 | 204 | //联系客服 |
214 | linkKefu() { | 205 | linkKefu() { |
215 | - | ||
216 | if (getStorageSync.Authorization == "") { | 206 | if (getStorageSync.Authorization == "") { |
217 | - // setTimeout(() => { | ||
218 | - // util.getUser() | ||
219 | - // }, 2000) | ||
220 | } else { | 207 | } else { |
221 | wx.makePhoneCall({ | 208 | wx.makePhoneCall({ |
222 | phoneNumber: '111111111000', | 209 | phoneNumber: '111111111000', |
@@ -319,9 +306,6 @@ Page({ | @@ -319,9 +306,6 @@ Page({ | ||
319 | duration: 1000 | 306 | duration: 1000 |
320 | }) | 307 | }) |
321 | } else { | 308 | } else { |
322 | - // setTimeout(() => { | ||
323 | - // util.getUser() | ||
324 | - // }, 2000) | ||
325 | } | 309 | } |
326 | }) | 310 | }) |
327 | }, | 311 | }, |
@@ -356,38 +340,6 @@ Page({ | @@ -356,38 +340,6 @@ Page({ | ||
356 | count | 340 | count |
357 | }) | 341 | }) |
358 | }, | 342 | }, |
359 | - //立即兑换 | ||
360 | - immediatelyExchang() { | ||
361 | - this.getAddress() | ||
362 | - let postData = { | ||
363 | - addressId: this.data.userData.id, | ||
364 | - couponId: this.data.couponId, | ||
365 | - deliveryTime: this.data.date, | ||
366 | - note: this.data.leavaWord, | ||
367 | - num: this.data.count, | ||
368 | - skuId: this.data.skuId | ||
369 | - } | ||
370 | - method.postRequest("/order/generateOrder", postData, data => { | ||
371 | - if (data.statusCode == 0) { | ||
372 | - this.setData({ | ||
373 | - orderId: data.data.id | ||
374 | - }) | ||
375 | - wx.navigateTo({ | ||
376 | - url: '/pages/affirm-order/affirm-order', | ||
377 | - }) | ||
378 | - } else { | ||
379 | - // setTimeout(() => { | ||
380 | - // util.getUser() | ||
381 | - // }, 2000) | ||
382 | - console.log("999999") | ||
383 | - wx.showToast({ | ||
384 | - title: '积分不足', | ||
385 | - icon: 'none', | ||
386 | - duration: 3000 | ||
387 | - }) | ||
388 | - } | ||
389 | - }) | ||
390 | - }, | ||
391 | //地址信息 | 343 | //地址信息 |
392 | getAddress() { | 344 | getAddress() { |
393 | method.getRequest("/address", data => { | 345 | method.getRequest("/address", data => { |
@@ -485,9 +437,6 @@ Page({ | @@ -485,9 +437,6 @@ Page({ | ||
485 | duration: 1000 | 437 | duration: 1000 |
486 | }) | 438 | }) |
487 | } else { | 439 | } else { |
488 | - // setTimeout(() => { | ||
489 | - // util.getUser() | ||
490 | - // }, 2000) | ||
491 | } | 440 | } |
492 | }) | 441 | }) |
493 | }, | 442 | }, |
@@ -531,7 +480,7 @@ Page({ | @@ -531,7 +480,7 @@ Page({ | ||
531 | this.setData({ | 480 | this.setData({ |
532 | id: options.id | 481 | id: options.id |
533 | }) | 482 | }) |
534 | - //在发送请求goodsId数据 | 483 | + //请求商品信息 |
535 | if (options.id) { | 484 | if (options.id) { |
536 | this.getList(options.id) | 485 | this.getList(options.id) |
537 | } else if (goodsId) { | 486 | } else if (goodsId) { |
@@ -597,13 +546,13 @@ Page({ | @@ -597,13 +546,13 @@ Page({ | ||
597 | */ | 546 | */ |
598 | onReachBottom: function () { | 547 | onReachBottom: function () { |
599 | this.setData({ | 548 | this.setData({ |
600 | - bottomHint:true | 549 | + bottomHint: true |
601 | }) | 550 | }) |
602 | - setTimeout(()=>{ | 551 | + setTimeout(() => { |
603 | this.setData({ | 552 | this.setData({ |
604 | - bottomHint:false | 553 | + bottomHint: false |
605 | }) | 554 | }) |
606 | - },2000) | 555 | + }, 2000) |
607 | }, | 556 | }, |
608 | 557 | ||
609 | /** | 558 | /** |
@@ -612,7 +561,6 @@ Page({ | @@ -612,7 +561,6 @@ Page({ | ||
612 | onShareAppMessage: function (res) { | 561 | onShareAppMessage: function (res) { |
613 | console.log(this.data.goodsId, 'id') | 562 | console.log(this.data.goodsId, 'id') |
614 | if (res.from === 'button') { | 563 | if (res.from === 'button') { |
615 | - // console.log(id) | ||
616 | } | 564 | } |
617 | return { | 565 | return { |
618 | title: '世纪华联超市', | 566 | title: '世纪华联超市', |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> | 7 | <swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000"> |
8 | <block wx:for="{{swiperArray}}" wx:for-index="idx"> | 8 | <block wx:for="{{swiperArray}}" wx:for-index="idx"> |
9 | <swiper-item> | 9 | <swiper-item> |
10 | - <image src="{{item}}" class="slideImage"></image> | 10 | + <image src="{{item}}" class="slideImage" mode="aspectFill"></image> |
11 | </swiper-item> | 11 | </swiper-item> |
12 | </block> | 12 | </block> |
13 | </swiper> | 13 | </swiper> |
@@ -71,10 +71,10 @@ | @@ -71,10 +71,10 @@ | ||
71 | <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> | 71 | <view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}"> |
72 | <view class="evaluateInfo"> | 72 | <view class="evaluateInfo"> |
73 | <view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==0}}"> | 73 | <view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==0}}"> |
74 | - <image src="{{item.wxHeadImg}}"> </image> | 74 | + <image src="{{item.wxHeadImg}}" mode="aspectFill"> </image> |
75 | </view> | 75 | </view> |
76 | <view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==1}}"> | 76 | <view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==1}}"> |
77 | - <image src="/images/nimingtouxiang.png"> </image> | 77 | + <image src="/images/nimingtouxiang.png" mode="aspectFill"> </image> |
78 | </view> | 78 | </view> |
79 | <view class="userName" style="display:inline-block" >{{item.wxName}}</view> | 79 | <view class="userName" style="display:inline-block" >{{item.wxName}}</view> |
80 | </view> | 80 | </view> |
@@ -120,7 +120,7 @@ | @@ -120,7 +120,7 @@ | ||
120 | </view> | 120 | </view> |
121 | <view class="bottom_left_item" catchtap="collection"> | 121 | <view class="bottom_left_item" catchtap="collection"> |
122 | <view class="collectIcon"> | 122 | <view class="collectIcon"> |
123 | - <image src='{{"goodsData.keep==false"?"/images/01-03/shoucang.png":"/images/01-03/shoucang.png"}}'></image> | 123 | + <image src='{{goodsData.keep==false?"/images/01-03/unshoucang.png":"/images/01-03/shoucang.png"}}'></image> |
124 | <view class="collecttext">{{goodsData.keep==false?"收藏":"已收藏"}}</view> | 124 | <view class="collecttext">{{goodsData.keep==false?"收藏":"已收藏"}}</view> |
125 | </view> | 125 | </view> |
126 | <!-- <view wx:if="{{goodsData.keep==true}}"> | 126 | <!-- <view wx:if="{{goodsData.keep==true}}"> |
@@ -148,39 +148,6 @@ | @@ -148,39 +148,6 @@ | ||
148 | </view> | 148 | </view> |
149 | </view> | 149 | </view> |
150 | <!-- 加入购物车弹框 --> | 150 | <!-- 加入购物车弹框 --> |
151 | -<!-- <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> | ||
152 | - <view class="diceng" catchtap="openMask"> | ||
153 | - <view class="info"> | ||
154 | - <image src="{{goodsData.goodsBanners[idx]}}"></image> | ||
155 | - <view class="info_right"> | ||
156 | - <view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view> | ||
157 | - <view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view> | ||
158 | - <view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view> | ||
159 | - </view> | ||
160 | - </view> | ||
161 | - <view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'> | ||
162 | - <view>{{item.group_name}}</view> | ||
163 | - <view class="attr_main"> | ||
164 | - <view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell' | ||
165 | - wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}' | ||
166 | - catchtap="changeAttrNum">{{cell.spec_value}}</view> | ||
167 | - </view> | ||
168 | - </view> | ||
169 | - <view> | ||
170 | - </view> | ||
171 | - <view class="pay_count"> | ||
172 | - <view>购买数量</view> | ||
173 | - <view class="count_box"> | ||
174 | - <view class="count_jian" catchtap="decNum">-</view> | ||
175 | - <view class="real_count">{{count}}</view> | ||
176 | - <view class="count_jian" catchtap="addNum">+</view> | ||
177 | - </view> | ||
178 | - </view> | ||
179 | - <view class="confrimBtn" catchtap="confrimCart">确定</view> | ||
180 | - <view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view> | ||
181 | - <view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view> | ||
182 | - </view> | ||
183 | -</view> --> | ||
184 | <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> | 151 | <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'> |
185 | <view class="diceng" catchtap="openMask"> | 152 | <view class="diceng" catchtap="openMask"> |
186 | <view class="info"> | 153 | <view class="info"> |
@@ -13,7 +13,7 @@ | @@ -13,7 +13,7 @@ | ||
13 | <!-- 商品详情 --> | 13 | <!-- 商品详情 --> |
14 | <view class="bottom"> | 14 | <view class="bottom"> |
15 | <view class="productPic"> | 15 | <view class="productPic"> |
16 | - <image src="{{item.listGoodsVoList[0].goodsPic}}"></image> | 16 | + <image src="{{item.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image> |
17 | </view> | 17 | </view> |
18 | <view class="productDetail"> | 18 | <view class="productDetail"> |
19 | <view class="name">{{item.listGoodsVoList[0].goodsName}}</view> | 19 | <view class="name">{{item.listGoodsVoList[0].goodsName}}</view> |
@@ -7,11 +7,7 @@ Page({ | @@ -7,11 +7,7 @@ Page({ | ||
7 | goodsId: '', | 7 | goodsId: '', |
8 | searchBox: true, | 8 | searchBox: true, |
9 | keyWord: '', | 9 | keyWord: '', |
10 | - labelArray: [{ | ||
11 | - title: '苹果' | ||
12 | - }, { | ||
13 | - title: '香蕉' | ||
14 | - }], | 10 | + labelArray: [], //搜索历史 |
15 | title: '猜你喜欢', | 11 | title: '猜你喜欢', |
16 | list: [], | 12 | list: [], |
17 | bottomHint:false //触底提示 | 13 | bottomHint:false //触底提示 |
@@ -34,19 +30,16 @@ Page({ | @@ -34,19 +30,16 @@ Page({ | ||
34 | url: '/pages/home/home', | 30 | url: '/pages/home/home', |
35 | }) | 31 | }) |
36 | }, | 32 | }, |
37 | - //取消文本框输入 | ||
38 | cancel() { | 33 | cancel() { |
39 | this.setData({ | 34 | this.setData({ |
40 | keyWord: '', | 35 | keyWord: '', |
41 | }) | 36 | }) |
42 | }, | 37 | }, |
43 | - //取消搜索 | ||
44 | unsearch() { | 38 | unsearch() { |
45 | wx.switchTab({ | 39 | wx.switchTab({ |
46 | url: '/pages/home/home', | 40 | url: '/pages/home/home', |
47 | }) | 41 | }) |
48 | }, | 42 | }, |
49 | - //搜索历史 | ||
50 | searchHistory() { | 43 | searchHistory() { |
51 | method.getRequest("/coupon/historySearch", data => { | 44 | method.getRequest("/coupon/historySearch", data => { |
52 | if (data.statusCode == 0) { | 45 | if (data.statusCode == 0) { |
1 | <!--pages/search/search.wxml--> | 1 | <!--pages/search/search.wxml--> |
2 | <view class="container"> | 2 | <view class="container"> |
3 | <view class="search_center" catchtap="goSearch"> | 3 | <view class="search_center" catchtap="goSearch"> |
4 | - <!-- <view class="real_search_center"> | ||
5 | - <view class="searchIcon"> | ||
6 | - <image src="/images/01-02/sousuo.png"></image> | ||
7 | - </view> | ||
8 | - <input class="weui-input" auto-focus placeholder="搜索" bindinput="getKeyWord" placeholder-class="placeholder" bindconfirm="search"/> | ||
9 | - <view class="searchIcon" bindtap="cancel"> | ||
10 | - <image src="/images/01-02/quxiao.png"></image> | ||
11 | - </view> | ||
12 | - </view> | ||
13 | - <view class="search_right" catchtap="unsearch">取消</view> --> | ||
14 | <van-search value="{{keyWord}}" placeholder="请输入搜索关键词" shape="round" show-action bind:search="search" | 4 | <van-search value="{{keyWord}}" placeholder="请输入搜索关键词" shape="round" show-action bind:search="search" |
15 | bind:cancel="onCancel" bind:change="onChange" /> | 5 | bind:cancel="onCancel" bind:change="onChange" /> |
16 | </view> | 6 | </view> |
@@ -42,7 +32,7 @@ | @@ -42,7 +32,7 @@ | ||
42 | <view class="listTable"> | 32 | <view class="listTable"> |
43 | <view class="listSon" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> | 33 | <view class="listSon" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> |
44 | <view class="listPic"> | 34 | <view class="listPic"> |
45 | - <image src="{{item.goodsImg}}"></image> | 35 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
46 | </view> | 36 | </view> |
47 | <view class="listTitle">{{item.goodsName}}</view> | 37 | <view class="listTitle">{{item.goodsName}}</view> |
48 | <view class="collect">{{item.goodsAttributes}}</view> | 38 | <view class="collect">{{item.goodsAttributes}}</view> |
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | <view class="pickContent"> | 15 | <view class="pickContent"> |
16 | <view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail"> | 16 | <view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail"> |
17 | <view class="pickPic"> | 17 | <view class="pickPic"> |
18 | - <image src="{{item.goodsImg}}"></image> | 18 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
19 | </view> | 19 | </view> |
20 | <view class="pickTitle">{{item.goodsName}}</view> | 20 | <view class="pickTitle">{{item.goodsName}}</view> |
21 | <view class="pickDesc">{{item.goodsAttributes}}</view> | 21 | <view class="pickDesc">{{item.goodsAttributes}}</view> |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | let method = require("../../utils/reuqest.js") | 2 | let method = require("../../utils/reuqest.js") |
3 | Page({ | 3 | Page({ |
4 | data: { | 4 | data: { |
5 | - default: true, | 5 | + default: true, //默认地址 |
6 | defaultType: '', | 6 | defaultType: '', |
7 | list: [], | 7 | list: [], |
8 | exceedRange: true, | 8 | exceedRange: true, |
@@ -4,21 +4,12 @@ const util = require("../../utils/util.js") | @@ -4,21 +4,12 @@ const util = require("../../utils/util.js") | ||
4 | Page({ | 4 | Page({ |
5 | data: { | 5 | data: { |
6 | Authorization: false, //判断用户是否登录 | 6 | Authorization: false, //判断用户是否登录 |
7 | + userData: "", //地址信息 | ||
8 | + addHint: false, //判断有没有地址 | ||
7 | showTime: false, //配送时间 | 9 | showTime: false, //配送时间 |
8 | - // storePickupTime: '', | ||
9 | timers: '', | 10 | timers: '', |
10 | - checkType: 1, | ||
11 | - userData: "", | ||
12 | - addHint: false, //判断有没有地址 | ||
13 | - startTime: '', //日历选择获取当天日期 | ||
14 | - date: '', | ||
15 | - cartList: [], | ||
16 | - buyData: { | ||
17 | - price: 100 | ||
18 | - }, | ||
19 | checkNum: 0, | 11 | checkNum: 0, |
20 | stockNum: '', | 12 | stockNum: '', |
21 | - | ||
22 | // 购物车 | 13 | // 购物车 |
23 | goodsId: '', //商品id | 14 | goodsId: '', //商品id |
24 | goodsNum: '', //商品数量 | 15 | goodsNum: '', //商品数量 |
@@ -33,7 +24,7 @@ Page({ | @@ -33,7 +24,7 @@ Page({ | ||
33 | name: "hello" | 24 | name: "hello" |
34 | }, | 25 | }, |
35 | title: '产品推荐', | 26 | title: '产品推荐', |
36 | - bottomHint: false, //上拉提示 | 27 | + bottomHint: false, //触底提示 |
37 | flagClick: wx.getStorageSync('selecClick') | 28 | flagClick: wx.getStorageSync('selecClick') |
38 | }, | 29 | }, |
39 | //登录 | 30 | //登录 |
@@ -91,9 +82,6 @@ Page({ | @@ -91,9 +82,6 @@ Page({ | ||
91 | }, | 82 | }, |
92 | //地址信息 | 83 | //地址信息 |
93 | getAddress() { | 84 | getAddress() { |
94 | - // if (wx.getStorageSync('addIndex')) { | ||
95 | - // wx.removeStorageSync('addIndex') | ||
96 | - // } | ||
97 | let index = wx.getStorageSync('addIndex') | 85 | let index = wx.getStorageSync('addIndex') |
98 | method.getRequest("/address", data => { | 86 | method.getRequest("/address", data => { |
99 | if (data.statusCode == 0) { | 87 | if (data.statusCode == 0) { |
@@ -258,8 +246,6 @@ Page({ | @@ -258,8 +246,6 @@ Page({ | ||
258 | return false; | 246 | return false; |
259 | } else { | 247 | } else { |
260 | num = num + 1; | 248 | num = num + 1; |
261 | - // console.log(num,'num') | ||
262 | - // console.log(carts[index],'index') | ||
263 | carts[idx].num = num; | 249 | carts[idx].num = num; |
264 | this.setData({ | 250 | this.setData({ |
265 | carts: carts | 251 | carts: carts |
@@ -331,7 +317,7 @@ Page({ | @@ -331,7 +317,7 @@ Page({ | ||
331 | }) | 317 | }) |
332 | }, | 318 | }, |
333 | //立即购买 | 319 | //立即购买 |
334 | - immediatelyPay() { | 320 | + immediatelyPay: util.throttle(function () { |
335 | if (this.data.checkNum == 0) { | 321 | if (this.data.checkNum == 0) { |
336 | wx.showToast({ | 322 | wx.showToast({ |
337 | title: '未选择购买商品', | 323 | title: '未选择购买商品', |
@@ -365,7 +351,7 @@ Page({ | @@ -365,7 +351,7 @@ Page({ | ||
365 | wx.setStorageSync('pitchList', this.data.pitchList) | 351 | wx.setStorageSync('pitchList', this.data.pitchList) |
366 | wx.setStorageSync('pitchCart', this.data.pitchCart) | 352 | wx.setStorageSync('pitchCart', this.data.pitchCart) |
367 | } | 353 | } |
368 | - }, | 354 | + }, 3000), |
369 | //购物车为空 | 355 | //购物车为空 |
370 | goHome() { | 356 | goHome() { |
371 | wx.switchTab({ | 357 | wx.switchTab({ |
@@ -396,7 +382,6 @@ Page({ | @@ -396,7 +382,6 @@ Page({ | ||
396 | onShow: function () { | 382 | onShow: function () { |
397 | this.getTotalPrice(); | 383 | this.getTotalPrice(); |
398 | this.getAddress() //获取默认地址 | 384 | this.getAddress() //获取默认地址 |
399 | - this.getDayTime() //获取当前日期 | ||
400 | this.setData({ //每次购物车下单重新选择商品 | 385 | this.setData({ //每次购物车下单重新选择商品 |
401 | pitchCart: [], | 386 | pitchCart: [], |
402 | pitchList: [] | 387 | pitchList: [] |
@@ -29,9 +29,6 @@ | @@ -29,9 +29,6 @@ | ||
29 | </view> | 29 | </view> |
30 | {{timers.length ? timers : ''}} | 30 | {{timers.length ? timers : ''}} |
31 | </view> | 31 | </view> |
32 | - <!-- <view class="arrow1" style="width:94%"> | ||
33 | - <image src="/images/04-01/arrow.png"></image> | ||
34 | - </view> --> | ||
35 | <view class="section"> | 32 | <view class="section"> |
36 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> | 33 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom"> |
37 | <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="timePicker"></timepicker> | 34 | <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="timePicker"></timepicker> |
@@ -49,7 +46,7 @@ | @@ -49,7 +46,7 @@ | ||
49 | catchtap="selectList" /> | 46 | catchtap="selectList" /> |
50 | <icon wx:else type="circle" class="cart-pro-select" data-index="{{index}}" catchtap="selectList" /> | 47 | <icon wx:else type="circle" class="cart-pro-select" data-index="{{index}}" catchtap="selectList" /> |
51 | <navigator url="../details/details?id={{item.id}}"> | 48 | <navigator url="../details/details?id={{item.id}}"> |
52 | - <image class="cart-thumb" src="{{item.goodsImg}}"></image> | 49 | + <image class="cart-thumb" src="{{item.goodsImg}}" mode="aspectFill"></image> |
53 | </navigator> | 50 | </navigator> |
54 | <text class="cart-pro-name">{{item.goodsName}}</text> | 51 | <text class="cart-pro-name">{{item.goodsName}}</text> |
55 | <text class="cart-pro-desc">{{item.goodsAttributes}}</text> | 52 | <text class="cart-pro-desc">{{item.goodsAttributes}}</text> |
@@ -81,7 +78,7 @@ | @@ -81,7 +78,7 @@ | ||
81 | <view class="listTable"> | 78 | <view class="listTable"> |
82 | <view class="listSon" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> | 79 | <view class="listSon" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}"> |
83 | <view class="listPic"> | 80 | <view class="listPic"> |
84 | - <image src="{{item.goodsImg}}"></image> | 81 | + <image src="{{item.goodsImg}}" mode="aspectFill"></image> |
85 | </view> | 82 | </view> |
86 | <view class="listTitle">{{item.goodsName}}</view> | 83 | <view class="listTitle">{{item.goodsName}}</view> |
87 | <view class="collect">{{item.goodsAttributes}}</view> | 84 | <view class="collect">{{item.goodsAttributes}}</view> |
@@ -100,9 +97,6 @@ | @@ -100,9 +97,6 @@ | ||
100 | </view> | 97 | </view> |
101 | <!-- 立即购买 --> | 98 | <!-- 立即购买 --> |
102 | <view class="bottom"> | 99 | <view class="bottom"> |
103 | - <!-- <view class="checkPic"> | ||
104 | - <image src="/images/04-01/uncheck.png"></image> | ||
105 | - </view> --> | ||
106 | <view class="checkText"> | 100 | <view class="checkText"> |
107 | 已选({{checkNum}}) | 101 | 已选({{checkNum}}) |
108 | </view> | 102 | </view> |
1 | <!--pages/timedmo/timedmo.wxml--> | 1 | <!--pages/timedmo/timedmo.wxml--> |
2 | <view bindtap='chooseTime'>自提时间{{timers.length ? timers : ''}}</view> | 2 | <view bindtap='chooseTime'>自提时间{{timers.length ? timers : ''}}</view> |
3 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" style="display:{{showTime ? 'vilative' : 'none'}}"> | 3 | <van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" style="display:{{showTime ? 'vilative' : 'none'}}"> |
4 | - <timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa" bind:selectTimes="selectTime"></timepicker> | 4 | + <timepicker bind:selectTime="selectTime" id="aaa" bind:selectTimes="selectTime"></timepicker> |
5 | </van-popup> | 5 | </van-popup> |
@@ -18,9 +18,6 @@ | @@ -18,9 +18,6 @@ | ||
18 | 登录/注册 | 18 | 登录/注册 |
19 | </view> | 19 | </view> |
20 | </view> | 20 | </view> |
21 | - <!-- <view class="arrow"> | ||
22 | - <image src="/images/05-01/arrow.png"></image> | ||
23 | - </view> --> | ||
24 | </view> | 21 | </view> |
25 | <view class="container"> | 22 | <view class="container"> |
26 | <!-- 全部订单 --> | 23 | <!-- 全部订单 --> |
@@ -52,6 +52,10 @@ | @@ -52,6 +52,10 @@ | ||
52 | font-size: 36rpx; | 52 | font-size: 36rpx; |
53 | font-weight: 500; | 53 | font-weight: 500; |
54 | color: #ffffff; | 54 | color: #ffffff; |
55 | + width: 520rpx; | ||
56 | + overflow: hidden; | ||
57 | + text-overflow: ellipsis; | ||
58 | + white-space: nowrap; | ||
55 | } | 59 | } |
56 | 60 | ||
57 | .decribe { | 61 | .decribe { |
@@ -26,10 +26,7 @@ function getDates(days, todate = new Date()) { //todate暺恕敶 | @@ -26,10 +26,7 @@ function getDates(days, todate = new Date()) { //todate暺恕敶 | ||
26 | } | 26 | } |
27 | return dateArry; | 27 | return dateArry; |
28 | } | 28 | } |
29 | -/** | ||
30 | - * 传入时间后几天 | ||
31 | - * param:传入时间:dates:"2018-04-02",later:往后多少天 | ||
32 | - */ | 29 | +//传入时间后几天 param:传入时间:dates:"2018-04-02",later:往后多少天 |
33 | function dateLater(dates, later) { | 30 | function dateLater(dates, later) { |
34 | let dateObj = {}; | 31 | let dateObj = {}; |
35 | let show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六'); | 32 | let show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六'); |
@@ -66,55 +63,70 @@ function getUser(msg) { | @@ -66,55 +63,70 @@ function getUser(msg) { | ||
66 | url: '/pages/index/index', | 63 | url: '/pages/index/index', |
67 | }) | 64 | }) |
68 | } | 65 | } |
69 | -//获取位置信息 | ||
70 | -function getLocation(that) { | ||
71 | - wx.getLocation({ | ||
72 | - type: 'wgs84', | ||
73 | - success: function (res) { | ||
74 | - // 经纬度 | ||
75 | - var latitude = res.latitude | ||
76 | - var longitude = res.longitude | ||
77 | - var aK = that.data.aK | ||
78 | - wx.request({ | ||
79 | - url: 'https://api.map.baidu.com/geocoder/v2/?ak=' + aK + '&location=' + latitude + ',' + longitude + '&output=json', | ||
80 | - data: {}, | ||
81 | - header: { | ||
82 | - 'content-type': 'application/json' | ||
83 | - }, | ||
84 | - success: function (res) { | ||
85 | - var city = res.data.result.addressComponent.city; | ||
86 | - that.setData({ | ||
87 | - currentCity: city | ||
88 | - }) | ||
89 | - wx.request({ | ||
90 | - url: 'xxx' + city, | ||
91 | - data: {}, | ||
92 | - header: { | ||
93 | - 'content-type': 'application/json' | ||
94 | - }, | ||
95 | - success: function (res) { | ||
96 | - that.setData({ | ||
97 | - county: res.data, | ||
98 | - }) | ||
99 | - }, | ||
100 | - }) | 66 | +//防抖 |
67 | +function throttle(fn, gapTime) { | ||
68 | + if (gapTime == null || gapTime == undefined) { | ||
69 | + gapTime = 1500 | ||
101 | } | 70 | } |
102 | - }) | ||
103 | 71 | ||
104 | - }, | ||
105 | - fail: function () { | ||
106 | - wx.showToast({ | ||
107 | - title: '授权失败', | ||
108 | - icon: 'success', | ||
109 | - duration: 1000 | ||
110 | - }) | 72 | + let _lastTime = null; |
73 | + return function () { | ||
74 | + let _nowTime = +new Date() | ||
75 | + if (_nowTime - _lastTime > gapTime || !_lastTime) { | ||
76 | + fn.apply(this, arguments) //将this和参数传给原函数 | ||
77 | + _lastTime = _nowTime | ||
78 | + } | ||
111 | } | 79 | } |
112 | - }) | ||
113 | } | 80 | } |
81 | +// //获取位置信息 | ||
82 | +// function getLocation(that) { | ||
83 | +// wx.getLocation({ | ||
84 | +// type: 'wgs84', | ||
85 | +// success: function (res) { | ||
86 | +// // 经纬度 | ||
87 | +// var latitude = res.latitude | ||
88 | +// var longitude = res.longitude | ||
89 | +// var aK = that.data.aK | ||
90 | +// wx.request({ | ||
91 | +// url: 'https://api.map.baidu.com/geocoder/v2/?ak=' + aK + '&location=' + latitude + ',' + longitude + '&output=json', | ||
92 | +// data: {}, | ||
93 | +// header: { | ||
94 | +// 'content-type': 'application/json' | ||
95 | +// }, | ||
96 | +// success: function (res) { | ||
97 | +// var city = res.data.result.addressComponent.city; | ||
98 | +// that.setData({ | ||
99 | +// currentCity: city | ||
100 | +// }) | ||
101 | +// wx.request({ | ||
102 | +// url: 'xxx' + city, | ||
103 | +// data: {}, | ||
104 | +// header: { | ||
105 | +// 'content-type': 'application/json' | ||
106 | +// }, | ||
107 | +// success: function (res) { | ||
108 | +// that.setData({ | ||
109 | +// county: res.data, | ||
110 | +// }) | ||
111 | +// }, | ||
112 | +// }) | ||
113 | +// } | ||
114 | +// }) | ||
115 | + | ||
116 | +// }, | ||
117 | +// fail: function () { | ||
118 | +// wx.showToast({ | ||
119 | +// title: '授权失败', | ||
120 | +// icon: 'success', | ||
121 | +// duration: 1000 | ||
122 | +// }) | ||
123 | +// } | ||
124 | +// }) | ||
125 | +// } | ||
114 | module.exports = { | 126 | module.exports = { |
115 | formatTime: formatTime, | 127 | formatTime: formatTime, |
116 | onReachListData: onReachListData, | 128 | onReachListData: onReachListData, |
117 | getUser: getUser, | 129 | getUser: getUser, |
118 | getDates: getDates, | 130 | getDates: getDates, |
119 | - getLocation:getLocation | 131 | + throttle: throttle |
120 | } | 132 | } |
-
请 注册 或 登录 后发表评论