Commit 10ba946fbc9e90059a550fb94996a7f3fc47b52e

Authored by chenbiao
1 parent b6bde291

add 余额明细 接口联调

pages/rechargeDetail/rechargeDetail.vue
1 1 <template>
2 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 4 <view class="uni-list">
5 5 <view class="uni-list-cell">
6 6 <view class="uni-list-cell-left">
7 7 消费类型
8 8 </view>
9 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 12 <view class="uni-input">{{kindArray[index].kindName}}</view>
12 13 </picker>
13 14 </view>
... ... @@ -20,8 +21,9 @@
20 21 充值方式
21 22 </view>
22 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 27 </picker>
26 28 </view>
27 29 </view>
... ... @@ -35,7 +37,7 @@
35 37 </view>
36 38 <view class="uni-list-cell-db">
37 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 41 </picker>
40 42 </view>
41 43 </view>
... ... @@ -136,12 +138,13 @@
136 138 format: true
137 139 })
138 140 return {
  141 + detailText:'',
139 142 title: 'picker',
140 143 kindArray: [],
141 144 arrayWay: [],
142 145 index: 0,
143 146 indexWay: 0,
144   - benginDate: currentDate,
  147 + beginDate: currentDate,
145 148 overDate: currentDate,
146 149 rows: [],
147 150 pageNum: 1, //当前页
... ... @@ -160,11 +163,11 @@
160 163 wx.showShareMenu({
161 164 withShareTicket: true
162 165 });
163   - this.getKindType()
  166 + this.getKindType();
164 167  
165 168 },
166 169 onShow() {
167   -
  170 + this.getDetailSummary();
168 171  
169 172 },
170 173 computed: {
... ... @@ -183,22 +186,18 @@
183 186 method: 'POST',
184 187 data: that.$common.requestSign()
185 188 }).then(res => {
186   -
  189 +
187 190 let data = res.data;
188   - // let list = [];
189   - // data.forEach((item, index) => {
190   - // list.push(item.kindName)
191   - // });
192   - console.log(data)
193 191 that.kindArray = data;
  192 + that.arrayWay = data[0].typeList;
  193 + console.log(data)
194 194  
195 195 })
196 196 },
197 197 bindPickerChange: function(e) {
198 198 let that = this;
199 199 that.index = e.detail.value
200   -
201   -
  200 + that.arrayWay = that.kindArray[that.index].typeList;
202 201  
203 202 },
204 203 bindPickerChangeWay: function(e) {
... ... @@ -206,7 +205,7 @@
206 205 this.indexWay = e.detail.value
207 206 },
208 207 bindStartDateChange: function(e) {
209   - this.benginDate = e.detail.value
  208 + this.beginDate = e.detail.value
210 209 },
211 210 bindEndDateChange: function(e) {
212 211 this.overDate = e.detail.value
... ... @@ -225,6 +224,35 @@
225 224 day = day > 9 ? day : '0' + day;
226 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 258 </script>
... ...