Commit 10ba946fbc9e90059a550fb94996a7f3fc47b52e
1 parent
b6bde291
add 余额明细 接口联调
Showing
1 changed file
with
45 additions
and
17 deletions
pages/rechargeDetail/rechargeDetail.vue
1 | <template> | 1 | <template> |
2 | <view> | 2 | <view> |
3 | - <view class="statistics yellow-bg uni-list-cell-pd" style="color: #fff">共18笔充值,充值总金额100.00元</view> | 3 | + <view class="statistics yellow-bg uni-list-cell-pd" style="color: #fff">{{detailText | tranNull}}</view> |
4 | <view class="uni-list"> | 4 | <view class="uni-list"> |
5 | <view class="uni-list-cell"> | 5 | <view class="uni-list-cell"> |
6 | <view class="uni-list-cell-left"> | 6 | <view class="uni-list-cell-left"> |
7 | 消费类型 | 7 | 消费类型 |
8 | </view> | 8 | </view> |
9 | <view class="uni-list-cell-db"> | 9 | <view class="uni-list-cell-db"> |
10 | - <picker @change="bindPickerChange" :value="index" :range="kindArray"> | 10 | + <picker @change="bindPickerChange" :value="index" |
11 | + :range="kindArray" :range-key="'kindName'"> | ||
11 | <view class="uni-input">{{kindArray[index].kindName}}</view> | 12 | <view class="uni-input">{{kindArray[index].kindName}}</view> |
12 | </picker> | 13 | </picker> |
13 | </view> | 14 | </view> |
@@ -20,8 +21,9 @@ | @@ -20,8 +21,9 @@ | ||
20 | 充值方式 | 21 | 充值方式 |
21 | </view> | 22 | </view> |
22 | <view class="uni-list-cell-db"> | 23 | <view class="uni-list-cell-db"> |
23 | - <picker @change="bindPickerChangeWay" :value="indexWay" :range="arrayWay"> | ||
24 | - <view class="uni-input">{{arrayWay[indexWay]}}</view> | 24 | + <picker @change="bindPickerChangeWay" :value="indexWay" |
25 | + :range="arrayWay" :range-key="'typeName'"> | ||
26 | + <view class="uni-input">{{arrayWay[indexWay].typeName}}</view> | ||
25 | </picker> | 27 | </picker> |
26 | </view> | 28 | </view> |
27 | </view> | 29 | </view> |
@@ -35,7 +37,7 @@ | @@ -35,7 +37,7 @@ | ||
35 | </view> | 37 | </view> |
36 | <view class="uni-list-cell-db"> | 38 | <view class="uni-list-cell-db"> |
37 | <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange"> | 39 | <picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindStartDateChange"> |
38 | - <view class="uni-input">{{benginDate}}</view> | 40 | + <view class="uni-input">{{beginDate}}</view> |
39 | </picker> | 41 | </picker> |
40 | </view> | 42 | </view> |
41 | </view> | 43 | </view> |
@@ -136,12 +138,13 @@ | @@ -136,12 +138,13 @@ | ||
136 | format: true | 138 | format: true |
137 | }) | 139 | }) |
138 | return { | 140 | return { |
141 | + detailText:'', | ||
139 | title: 'picker', | 142 | title: 'picker', |
140 | kindArray: [], | 143 | kindArray: [], |
141 | arrayWay: [], | 144 | arrayWay: [], |
142 | index: 0, | 145 | index: 0, |
143 | indexWay: 0, | 146 | indexWay: 0, |
144 | - benginDate: currentDate, | 147 | + beginDate: currentDate, |
145 | overDate: currentDate, | 148 | overDate: currentDate, |
146 | rows: [], | 149 | rows: [], |
147 | pageNum: 1, //当前页 | 150 | pageNum: 1, //当前页 |
@@ -160,11 +163,11 @@ | @@ -160,11 +163,11 @@ | ||
160 | wx.showShareMenu({ | 163 | wx.showShareMenu({ |
161 | withShareTicket: true | 164 | withShareTicket: true |
162 | }); | 165 | }); |
163 | - this.getKindType() | 166 | + this.getKindType(); |
164 | 167 | ||
165 | }, | 168 | }, |
166 | onShow() { | 169 | onShow() { |
167 | - | 170 | + this.getDetailSummary(); |
168 | 171 | ||
169 | }, | 172 | }, |
170 | computed: { | 173 | computed: { |
@@ -183,22 +186,18 @@ | @@ -183,22 +186,18 @@ | ||
183 | method: 'POST', | 186 | method: 'POST', |
184 | data: that.$common.requestSign() | 187 | data: that.$common.requestSign() |
185 | }).then(res => { | 188 | }).then(res => { |
186 | - | 189 | + |
187 | let data = res.data; | 190 | let data = res.data; |
188 | - // let list = []; | ||
189 | - // data.forEach((item, index) => { | ||
190 | - // list.push(item.kindName) | ||
191 | - // }); | ||
192 | - console.log(data) | ||
193 | that.kindArray = data; | 191 | that.kindArray = data; |
192 | + that.arrayWay = data[0].typeList; | ||
193 | + console.log(data) | ||
194 | 194 | ||
195 | }) | 195 | }) |
196 | }, | 196 | }, |
197 | bindPickerChange: function(e) { | 197 | bindPickerChange: function(e) { |
198 | let that = this; | 198 | let that = this; |
199 | that.index = e.detail.value | 199 | that.index = e.detail.value |
200 | - | ||
201 | - | 200 | + that.arrayWay = that.kindArray[that.index].typeList; |
202 | 201 | ||
203 | }, | 202 | }, |
204 | bindPickerChangeWay: function(e) { | 203 | bindPickerChangeWay: function(e) { |
@@ -206,7 +205,7 @@ | @@ -206,7 +205,7 @@ | ||
206 | this.indexWay = e.detail.value | 205 | this.indexWay = e.detail.value |
207 | }, | 206 | }, |
208 | bindStartDateChange: function(e) { | 207 | bindStartDateChange: function(e) { |
209 | - this.benginDate = e.detail.value | 208 | + this.beginDate = e.detail.value |
210 | }, | 209 | }, |
211 | bindEndDateChange: function(e) { | 210 | bindEndDateChange: function(e) { |
212 | this.overDate = e.detail.value | 211 | this.overDate = e.detail.value |
@@ -225,6 +224,35 @@ | @@ -225,6 +224,35 @@ | ||
225 | day = day > 9 ? day : '0' + day; | 224 | day = day > 9 ? day : '0' + day; |
226 | return `${year}-${month}-${day}`; | 225 | return `${year}-${month}-${day}`; |
227 | }, | 226 | }, |
227 | + getDetailSummary(){ | ||
228 | + let that=this; | ||
229 | + let data ={ | ||
230 | + kind: '1', | ||
231 | + type: '1', | ||
232 | + beginDate:new Date(that.beginDate + " 00:00:00") , | ||
233 | + endDate:new Date(that.overDate + " 23:59:59") | ||
234 | + }; | ||
235 | + console.log(data) | ||
236 | + that.$myRequest({ | ||
237 | + url: that.$common.detailSummary, | ||
238 | + method: 'POST', | ||
239 | + data: that.$common.requestSign(data) | ||
240 | + }).then(res => { | ||
241 | + | ||
242 | + let data = res.data; | ||
243 | + if(data.rechargeSummary){ | ||
244 | + that.detailText = data.rechargeSummary | ||
245 | + } | ||
246 | + if(data.paySummary){ | ||
247 | + that.detailText = data.paySummary | ||
248 | + } | ||
249 | + | ||
250 | + }) | ||
251 | + | ||
252 | + } | ||
253 | + | ||
254 | + | ||
255 | + | ||
228 | } | 256 | } |
229 | } | 257 | } |
230 | </script> | 258 | </script> |