Commit 2e99af66822a427566109b092682d9f8dcd70760

Authored by chenbiao
1 parent 0b55ba4d

add 账单详情 接口联调

common/common.js
@@ -52,6 +52,10 @@ const walletDetailsPage = serverUrl + "/business/h5/wallet/detailsPage"; @@ -52,6 +52,10 @@ const walletDetailsPage = serverUrl + "/business/h5/wallet/detailsPage";
52 // 钱包充值-微信 52 // 钱包充值-微信
53 const publicUnifiedOrder = serverUrl + "/business/h5/pay/weixinpay/publicUnifiedOrder"; 53 const publicUnifiedOrder = serverUrl + "/business/h5/pay/weixinpay/publicUnifiedOrder";
54 54
  55 +// 钱包-根据订单ID获取购买优惠券信息
  56 +const couponInfo = serverUrl + "/business/h5/wallet/detail/couponInfo";
  57 +// const couponInfo = "http://127.0.0.1:8075/business/h5/wallet/detail/couponInfo";
  58 +
55 59
56 60
57 61
@@ -223,5 +227,6 @@ export default { @@ -223,5 +227,6 @@ export default {
223 detailSummary, 227 detailSummary,
224 walletDetailsPage, 228 walletDetailsPage,
225 publicUnifiedOrder, 229 publicUnifiedOrder,
  230 + couponInfo,
226 231
227 } 232 }
pages/rechargeDetail/outDetail.vue
1 <template> 1 <template>
2 - <view>  
3 - <view style="height: 100px;line-height: 100px;" class="uni-center">  
4 - <text>-5.2</text>  
5 - </view>  
6 - <view class="border-bg"></view> 2 + <view>
  3 + <view style="height: 100px;line-height: 100px;" class="uni-center">
  4 + <text style="font-size: 32px;font-weight: 500;">{{changeFeeDetail | toFixed2}}</text>
  5 + </view>
  6 + <view class="border-bg"></view>
7 7
8 - <view class="uni-list">  
9 - <view class="uni-list-cell paddingTopBottom">  
10 - <view class="uni-list-cell-left">  
11 - 订单编号  
12 - </view>  
13 - <view class="uni-list-cell-db">  
14 - 12313123128787312673  
15 - </view>  
16 - </view>  
17 - <view class="uni-list-cell paddingTopBottom">  
18 - <view class="uni-list-cell-left">  
19 - 支付时间  
20 - </view>  
21 - <view class="uni-list-cell-db">  
22 - 2020-10-01 19:19:19  
23 - </view>  
24 - </view>  
25 - <view class="uni-list-cell paddingTopBottom">  
26 - <view class="uni-list-cell-left">  
27 - 支付方式  
28 - </view>  
29 - <view class="uni-list-cell-db color-green">  
30 - 商户余额  
31 - </view>  
32 - </view>  
33 - <view class="uni-list-cell paddingTopBottom">  
34 - <view class="uni-list-cell-left">  
35 - 交易类型  
36 - </view>  
37 - <view class="uni-list-cell-db">  
38 - 停车支付  
39 - </view>  
40 - </view>  
41 - </view> 8 + <view class="uni-list">
  9 + <view class="uni-list-cell paddingTopBottom">
  10 + <view class="uni-list-cell-left">
  11 + 订单编号
  12 + </view>
  13 + <view class="uni-list-cell-db">
  14 + {{orderId | tranNull}}
  15 + </view>
  16 + </view>
  17 + <view class="uni-list-cell paddingTopBottom">
  18 + <view class="uni-list-cell-left">
  19 + 支付时间
  20 + </view>
  21 + <view class="uni-list-cell-db">
  22 + {{payTime | tranNull}}
  23 + </view>
  24 + </view>
  25 + <view class="uni-list-cell paddingTopBottom">
  26 + <view class="uni-list-cell-left">
  27 + 支付方式
  28 + </view>
  29 + <view class="uni-list-cell-db color-green">
  30 + {{payType | tranNull}}
  31 + </view>
  32 + </view>
  33 + <view class="uni-list-cell paddingTopBottom">
  34 + <view class="uni-list-cell-left">
  35 + 交易类型
  36 + </view>
  37 + <view class="uni-list-cell-db">
  38 + {{typeName | tranNull}}
  39 + </view>
  40 + </view>
  41 + <view class="" v-if="cardIsShow">
  42 + <view class="uni-list-cell paddingTopBottom">
  43 + <view class="uni-list-cell-left">
  44 + 卡券类型
  45 + </view>
  46 + <view class="uni-list-cell-db">
  47 + {{cardType | tranNull}}
  48 + </view>
  49 + </view>
  50 + <view class="uni-list-cell paddingTopBottom">
  51 + <view class="uni-list-cell-left">
  52 + 卡规则名称
  53 + </view>
  54 + <view class="uni-list-cell-db">
  55 + {{cardRuleName | tranNull}}
  56 + </view>
  57 + </view>
  58 + <view class="uni-list-cell paddingTopBottom">
  59 + <view class="uni-list-cell-left">
  60 + 购买数量
  61 + </view>
  62 + <view class="uni-list-cell-db">
  63 + {{cardNum | tranNull}}张
  64 + </view>
  65 + </view>
42 66
  67 + </view>
  68 + </view>
  69 + <view class="border-bg"></view>
43 70
44 -  
45 - <view class="border-bg"></view>  
46 - <view class="uni-list">  
47 - <view class="uni-list-cell paddingTopBottom">  
48 - <view class="uni-list-cell-left">  
49 - 订单编号  
50 - </view>  
51 - <view class="uni-list-cell-db">  
52 - 12313123128787312673  
53 - </view>  
54 - </view>  
55 - <view class="uni-list-cell paddingTopBottom">  
56 - <view class="uni-list-cell-left">  
57 - 支付时间  
58 - </view>  
59 - <view class="uni-list-cell-db">  
60 - 2020-10-01 19:19:19  
61 - </view>  
62 - </view>  
63 - <view class="uni-list-cell paddingTopBottom">  
64 - <view class="uni-list-cell-left">  
65 - 支付方式  
66 - </view>  
67 - <view class="uni-list-cell-db color-green">  
68 - 商户余额  
69 - </view>  
70 - </view>  
71 - <view class="uni-list-cell paddingTopBottom">  
72 - <view class="uni-list-cell-left">  
73 - 交易类型  
74 - </view>  
75 - <view class="uni-list-cell-db color-green">  
76 - 购买卡券  
77 - </view>  
78 - </view>  
79 - <view class="uni-list-cell paddingTopBottom">  
80 - <view class="uni-list-cell-left">  
81 - 卡券类型  
82 - </view>  
83 - <view class="uni-list-cell-db">  
84 - 金额券  
85 - </view>  
86 - </view>  
87 - <view class="uni-list-cell paddingTopBottom">  
88 - <view class="uni-list-cell-left">  
89 - 卡规则名称  
90 - </view>  
91 - <view class="uni-list-cell-db">  
92 - 5元金额券  
93 - </view>  
94 - </view>  
95 - <view class="uni-list-cell paddingTopBottom">  
96 - <view class="uni-list-cell-left">  
97 - 购买数量  
98 - </view>  
99 - <view class="uni-list-cell-db">  
100 - 20张  
101 - </view>  
102 - </view>  
103 - </view>  
104 -  
105 -  
106 -  
107 -  
108 -  
109 -  
110 - </view> 71 + </view>
111 </template> 72 </template>
112 73
113 <script> 74 <script>
114 -import common from "../../common/common.js";  
115 -export default {  
116 - data() {  
117 -  
118 - return { 75 + export default {
  76 + data() {
119 77
120 - }  
121 - },  
122 - onLoad(params) {  
123 - wx.showShareMenu({  
124 - withShareTicket: true  
125 - }) 78 + return {
  79 + changeFeeDetail: '',
  80 + orderId: '',
  81 + payTime: '',
  82 + typeName: '',
  83 + payType: '商户余额',
  84 + cardRuleName: '',
  85 + cardType: '',
  86 + cardNum: '',
  87 + cardIsShow: false,
  88 + }
  89 + },
  90 + onLoad(params) {
  91 + wx.showShareMenu({
  92 + withShareTicket: true
  93 + })
  94 + let option = JSON.parse(params.optionData)
  95 + console.log(option)
  96 + this.changeFeeDetail = option.changeFeeDetail
  97 + this.orderId = option.orderId
  98 + this.typeName = option.typeName
  99 + this.payTime = option.opTime
  100 + if (option.typeName == "购买卡券") {
  101 + this.cardIsShow = true;
  102 + this.getCouponInfo();
  103 + }else{
  104 + this.cardIsShow = false;
  105 + }
  106 +
  107 +
126 108
127 - },  
128 - onShow() {  
129 - var me = this;  
130 - var userInfo = me.getGlobalUser("globalUser");  
131 - if (userInfo != null) {  
132 - me.phoneNumb = userInfo.userPhone;  
133 - }  
134 - var pages = getCurrentPages();  
135 - var currPage = pages[pages.length - 1]; //当前页面  
136 - console.log('currPage.data.selCoupon = ' + currPage.data.selCoupon);  
137 - me.selCoupon = currPage.data.selCoupon;  
138 - console.log(JSON.stringify(me.selCoupon));  
139 - // me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType, me.selCoupon  
140 - // .discValue);  
141 - // GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) {  
142 - },  
143 - computed: {  
144 - startDate() {  
145 - return this.getDate('start');  
146 - },  
147 - endDate() {  
148 - return this.getDate('end');  
149 - }  
150 - },  
151 - methods: {  
152 - bindPickerChange: function (e) {  
153 - console.log('picker发送选择改变,携带值为', e.detail.value)  
154 - this.index = e.detail.value  
155 - },  
156 - bindPickerChangeWay: function (e) {  
157 - console.log('picker发送选择改变,携带值为', e.detail.value)  
158 - this.indexWay = e.detail.value  
159 - },  
160 - bindStartDateChange: function (e) {  
161 - this.benginDate = e.detail.value  
162 - },  
163 - bindEndDateChange: function (e) {  
164 - this.overDate = e.detail.value  
165 - },  
166 - getDate(type) {  
167 - const date = new Date();  
168 - let year = date.getFullYear();  
169 - let month = date.getMonth() + 1;  
170 - let day = date.getDate();  
171 - if (type === 'start') {  
172 - year = year - 60;  
173 - } else if (type === 'end') {  
174 - year = year + 2;  
175 - }  
176 - month = month > 9 ? month : '0' + month;  
177 - day = day > 9 ? day : '0' + day;  
178 - return `${year}-${month}-${day}`;  
179 - },  
180 - }  
181 -} 109 + },
  110 + onShow() {
  111 + var me = this;
  112 + var userInfo = me.getGlobalUser("globalUser");
  113 + if (userInfo != null) {
  114 + me.phoneNumb = userInfo.userPhone;
  115 + }
  116 + var pages = getCurrentPages();
  117 + var currPage = pages[pages.length - 1]; //当前页面
  118 + console.log('currPage.data.selCoupon = ' + currPage.data.selCoupon);
  119 + me.selCoupon = currPage.data.selCoupon;
  120 + console.log(JSON.stringify(me.selCoupon));
  121 + // me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType, me.selCoupon
  122 + // .discValue);
  123 + // GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) {
  124 + },
  125 + computed: {
  126 + startDate() {
  127 + return this.getDate('start');
  128 + },
  129 + endDate() {
  130 + return this.getDate('end');
  131 + }
  132 + },
  133 + methods: {
  134 + bindPickerChange: function(e) {
  135 + console.log('picker发送选择改变,携带值为', e.detail.value)
  136 + this.index = e.detail.value
  137 + },
  138 + bindPickerChangeWay: function(e) {
  139 + console.log('picker发送选择改变,携带值为', e.detail.value)
  140 + this.indexWay = e.detail.value
  141 + },
  142 + bindStartDateChange: function(e) {
  143 + this.benginDate = e.detail.value
  144 + },
  145 + bindEndDateChange: function(e) {
  146 + this.overDate = e.detail.value
  147 + },
  148 + getDate(type) {
  149 + const date = new Date();
  150 + let year = date.getFullYear();
  151 + let month = date.getMonth() + 1;
  152 + let day = date.getDate();
  153 + if (type === 'start') {
  154 + year = year - 60;
  155 + } else if (type === 'end') {
  156 + year = year + 2;
  157 + }
  158 + month = month > 9 ? month : '0' + month;
  159 + day = day > 9 ? day : '0' + day;
  160 + return `${year}-${month}-${day}`;
  161 + },
  162 + getCouponInfo(){
  163 + let that = this
  164 + let paramsData = {
  165 + orderId: that.orderId
  166 + }
  167 +
  168 + that.$myRequest({
  169 + url: that.$common.couponInfo,
  170 + method: 'POST',
  171 + data: that.$common.requestSign(paramsData)
  172 + }).then(res => {
  173 + console.log(res)
  174 + that.cardType = res.data.cardTypeName
  175 + that.cardRuleName = res.data.cardRuleName
  176 + that.cardNum = res.data.buyNum
  177 + })
  178 +
  179 +
  180 + },
  181 + }
  182 + }
182 </script> 183 </script>
183 184
184 <style lang="scss" scoped> 185 <style lang="scss" scoped>
185 - .rechargeWrap{  
186 - position: relative;  
187 - .rechargeArrow{  
188 - position: absolute;  
189 - right: 10px;  
190 - top: 30px;  
191 - font-size: 20px;  
192 - color: #999;  
193 - }  
194 - }  
195 - .recordCon {  
196 - padding-right: 35px;  
197 - color: #999;  
198 - display: flex;  
199 - justify-content: space-between;  
200 - } 186 + .rechargeWrap {
  187 + position: relative;
  188 +
  189 + .rechargeArrow {
  190 + position: absolute;
  191 + right: 10px;
  192 + top: 30px;
  193 + font-size: 20px;
  194 + color: #999;
  195 + }
  196 + }
  197 +
  198 + .recordCon {
  199 + padding-right: 35px;
  200 + color: #999;
  201 + display: flex;
  202 + justify-content: space-between;
  203 + }
201 </style> 204 </style>
pages/rechargeDetail/rechargeDetail.vue
@@ -60,21 +60,24 @@ @@ -60,21 +60,24 @@
60 60
61 <view class="" v-if="orderList.length > 0"> 61 <view class="" v-if="orderList.length > 0">
62 62
63 - <uni-list class="rechargeWrap pos-rel" v-for="(item, index) in orderList" :key="index">  
64 - <view class="recordCon uni-list-cell-pd">  
65 - <text class="color-black">{{item.changeFeeDetail}}</text>  
66 - <text>{{item.payStateDesc}}</text>  
67 - </view>  
68 - <view class="recordCon uni-list-cell-pd">  
69 - <text v-if="item.typeName == '购买卡券'" class="color-green">{{item.typeName}}</text>  
70 - <text v-if="item.typeName == '微信充值'" class="color-green">{{item.typeName}}</text>  
71 - <text v-if="item.typeName == '支付停车费'" class="color-red">{{item.typeName}}</text>  
72 - <text v-if="item.typeName == '支付宝充值'" class="color-blue">{{item.typeName}}</text>  
73 - <text v-if="item.typeName == '平台现金充值'" class="color-red">{{item.typeName}}</text>  
74 - <text>{{item.opTime}}</text>  
75 - </view>  
76 - <view class="uni-icon pos-abs icon-arrowright uni-icon-arrowright">  
77 - </view> 63 + <uni-list class="rechargeWrap pos-rel" clickable v-for="(item, index) in orderList" :key="index" >
  64 + <view class="" @click="toOutDetail(item)">
  65 + <view class="recordCon uni-list-cell-pd">
  66 + <text class="color-black">{{item.changeFeeDetail}}</text>
  67 + <text>{{item.payStateDesc}}</text>
  68 + </view>
  69 + <view class="recordCon uni-list-cell-pd">
  70 + <text v-if="item.typeName == '购买卡券'" class="color-green">{{item.typeName}}</text>
  71 + <text v-if="item.typeName == '微信充值'" class="color-green">{{item.typeName}}</text>
  72 + <text v-if="item.typeName == '支付停车费'" class="color-red">{{item.typeName}}</text>
  73 + <text v-if="item.typeName == '支付宝充值'" class="color-blue">{{item.typeName}}</text>
  74 + <text v-if="item.typeName == '平台现金充值'" class="color-red">{{item.typeName}}</text>
  75 + <text>{{item.opTime}}</text>
  76 + </view>
  77 + <view class="uni-icon pos-abs icon-arrowright uni-icon-arrowright">
  78 + </view>
  79 + </view>
  80 +
78 </uni-list> 81 </uni-list>
79 <uni-load-more :status="status" /> 82 <uni-load-more :status="status" />
80 83
@@ -192,6 +195,11 @@ @@ -192,6 +195,11 @@
192 that.type = that.kindArray[that.index].typeList[0].type; 195 that.type = that.kindArray[that.index].typeList[0].type;
193 console.log(that.kind, that.type) 196 console.log(that.kind, that.type)
194 that.getDetailSummary(); 197 that.getDetailSummary();
  198 +
  199 + that.page = 1
  200 + that.pageSize = this.pageSize
  201 + that.totalPages = 1
  202 + that.orderList = []
195 that.fetchData() 203 that.fetchData()
196 }, 204 },
197 bindPickerChangeWay: function(e) { 205 bindPickerChangeWay: function(e) {
@@ -200,16 +208,28 @@ @@ -200,16 +208,28 @@
200 this.type = this.arrayWay[this.indexWay].type; 208 this.type = this.arrayWay[this.indexWay].type;
201 console.log(this.kind, this.type) 209 console.log(this.kind, this.type)
202 this.getDetailSummary(); 210 this.getDetailSummary();
  211 + this.page = 1
  212 + this.pageSize = this.pageSize
  213 + this.totalPages = 1
  214 + this.orderList = []
203 this.fetchData() 215 this.fetchData()
204 }, 216 },
205 bindStartDateChange: function(e) { 217 bindStartDateChange: function(e) {
206 this.beginDate = e.detail.value 218 this.beginDate = e.detail.value
207 this.getDetailSummary(); 219 this.getDetailSummary();
  220 + this.page = 1
  221 + this.pageSize = this.pageSize
  222 + this.totalPages = 1
  223 + this.orderList = []
208 this.fetchData() 224 this.fetchData()
209 }, 225 },
210 bindEndDateChange: function(e) { 226 bindEndDateChange: function(e) {
211 this.overDate = e.detail.value 227 this.overDate = e.detail.value
212 this.getDetailSummary(); 228 this.getDetailSummary();
  229 + this.page = 1
  230 + this.pageSize = this.pageSize
  231 + this.totalPages = 1
  232 + this.orderList = []
213 this.fetchData() 233 this.fetchData()
214 }, 234 },
215 getDate(type) { 235 getDate(type) {
@@ -274,17 +294,16 @@ @@ -274,17 +294,16 @@
274 } else { 294 } else {
275 this.status = 'more' 295 this.status = 'more'
276 } 296 }
277 -  
278 that.totalPages = res.data.pageTotals; 297 that.totalPages = res.data.pageTotals;
279 that.orderList = that.orderList.concat(res.data.dataList) 298 that.orderList = that.orderList.concat(res.data.dataList)
280 -  
281 -  
282 }) 299 })
283 -  
284 -  
285 -  
286 -  
287 }, 300 },
  301 + toOutDetail(i){
  302 + console.log('详情')
  303 + uni.navigateTo({
  304 + url: '../rechargeDetail/outDetail?optionData='+JSON.stringify(i)
  305 + });
  306 + }
288 307
289 } 308 }
290 } 309 }