Commit 438e8e43830638842cc8af88a1dac6dae15928c8
1 parent
904a46e0
卡券购买下单
Showing
4 changed files
with
84 additions
and
108 deletions
pages.json
@@ -14,12 +14,21 @@ | @@ -14,12 +14,21 @@ | ||
14 | "pages": [ | 14 | "pages": [ |
15 | // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages | 15 | // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
16 | { | 16 | { |
17 | + "path": "pages/businessCard/cardDetail", | ||
18 | + "style": { | ||
19 | + "navigationBarTitleText": "商户卡券明细", | ||
20 | + "enablePullDownRefresh": true | ||
21 | + } | ||
22 | + }, | ||
23 | + { | ||
17 | "path": "pages/businessCard/businessCard", | 24 | "path": "pages/businessCard/businessCard", |
18 | "style": { | 25 | "style": { |
19 | "navigationBarTitleText": "商户卡券" | 26 | "navigationBarTitleText": "商户卡券" |
20 | } | 27 | } |
21 | }, | 28 | }, |
22 | 29 | ||
30 | + | ||
31 | + | ||
23 | { | 32 | { |
24 | "path": "pages/businessCard/buyCard", | 33 | "path": "pages/businessCard/buyCard", |
25 | "style": { | 34 | "style": { |
@@ -27,13 +36,7 @@ | @@ -27,13 +36,7 @@ | ||
27 | } | 36 | } |
28 | }, | 37 | }, |
29 | 38 | ||
30 | - { | ||
31 | - "path": "pages/businessCard/cardDetail", | ||
32 | - "style": { | ||
33 | - "navigationBarTitleText": "商户卡券明细", | ||
34 | - "enablePullDownRefresh": true | ||
35 | - } | ||
36 | - }, | 39 | + |
37 | 40 | ||
38 | { | 41 | { |
39 | "path": "pages/businessCard/provideCard", | 42 | "path": "pages/businessCard/provideCard", |
pages/businessCard/businessCard.vue
@@ -32,8 +32,8 @@ | @@ -32,8 +32,8 @@ | ||
32 | </view> | 32 | </view> |
33 | 33 | ||
34 | </view> | 34 | </view> |
35 | - | ||
36 | - <view class="common-page-head" v-else>暂无可以购买的商户卡券</view> | 35 | + <uni-load-more :status="status"/> |
36 | + <!--<view class="common-page-head" v-else>暂无可以购买的商户卡券</view>--> | ||
37 | </view> | 37 | </view> |
38 | </template> | 38 | </template> |
39 | 39 | ||
@@ -44,15 +44,9 @@ export default { | @@ -44,15 +44,9 @@ export default { | ||
44 | dataList: [], | 44 | dataList: [], |
45 | rows: [], | 45 | rows: [], |
46 | pageNum: 1,//当前页 | 46 | pageNum: 1,//当前页 |
47 | - pageSize: 1,//每页条数 | ||
48 | - reload: false, | ||
49 | - status: 'more', | ||
50 | - contentText: { | ||
51 | - contentdown: '上拉加载更多~', | ||
52 | - contentrefresh: '正在加载更多~', | ||
53 | - contentmore: '我是有底线的~' | ||
54 | - }, | ||
55 | - iconType: 'auto', // 图标样式 | 47 | + pageSize: 10,//每页条数 |
48 | + totalPages: '1', // 总条数 | ||
49 | + status: 'no-more', | ||
56 | } | 50 | } |
57 | }, | 51 | }, |
58 | onLoad(params) { | 52 | onLoad(params) { |
@@ -64,14 +58,37 @@ export default { | @@ -64,14 +58,37 @@ export default { | ||
64 | onShow() { | 58 | onShow() { |
65 | var me = this; | 59 | var me = this; |
66 | }, | 60 | }, |
61 | + // 下拉刷新触发 | ||
62 | + onPullDownRefresh(val) { | ||
63 | + console.log('下拉刷新触发') | ||
64 | + this.pageNum = 1 | ||
65 | + this.pageSize = this.pageSize | ||
66 | + this.totalPages = 1 | ||
67 | + this.dataList = [] | ||
68 | + this.couponRuleParkPage() | ||
69 | + }, | ||
70 | + // 上拉加载触发 | ||
71 | + onReachBottom() { | ||
72 | + console.log('上拉加载触发') | ||
73 | + console.log(this.totalPages) | ||
74 | + console.log(this.dataList.length) | ||
75 | + if (this.totalPages == this.dataList.length) { | ||
76 | + this.status = 'no-more' | ||
77 | + return | ||
78 | + } else { | ||
79 | + this.pageNum++; | ||
80 | + this.couponRuleParkPage() | ||
81 | + } | ||
82 | + }, | ||
67 | computed: {}, | 83 | computed: {}, |
68 | methods: { | 84 | methods: { |
69 | // 通过商户ID查询停车记录信息 | 85 | // 通过商户ID查询停车记录信息 |
70 | couponRuleParkPage() { | 86 | couponRuleParkPage() { |
71 | let that = this | 87 | let that = this |
88 | + that.status = 'loading' | ||
72 | let paramsData = { | 89 | let paramsData = { |
73 | - pageNum: '1', | ||
74 | - pageSize: '10' | 90 | + pageNum: this.pageNum, |
91 | + pageSize: this.pageSize | ||
75 | } | 92 | } |
76 | // 首页信息获取 接口 | 93 | // 首页信息获取 接口 |
77 | that.$myRequest({ | 94 | that.$myRequest({ |
@@ -79,8 +96,19 @@ export default { | @@ -79,8 +96,19 @@ export default { | ||
79 | method: 'POST', | 96 | method: 'POST', |
80 | data: that.$common.requestSign(paramsData) | 97 | data: that.$common.requestSign(paramsData) |
81 | }).then(res => { | 98 | }).then(res => { |
82 | - this.dataList = res.data.dataList | ||
83 | - console.log(this.dataList) | 99 | + if(res.data.dataList.length>0){ |
100 | + if (res.data.pageTotals < 10) { | ||
101 | + that.status = 'no-more' | ||
102 | + } else { | ||
103 | + that.status = 'more' | ||
104 | + console.log('more') | ||
105 | + } | ||
106 | + }else{ | ||
107 | + that.status = 'no-more' | ||
108 | + } | ||
109 | + that.totalPages = res.data.pageTotals; | ||
110 | + that.dataList = that.dataList.concat(res.data.dataList) | ||
111 | + console.log(that.dataList.length) | ||
84 | }) | 112 | }) |
85 | }, | 113 | }, |
86 | toBuy(i) { | 114 | toBuy(i) { |
@@ -107,48 +135,7 @@ export default { | @@ -107,48 +135,7 @@ export default { | ||
107 | padding-bottom: 10px; | 135 | padding-bottom: 10px; |
108 | } | 136 | } |
109 | 137 | ||
110 | - .rechargeWrap { | ||
111 | - position: relative; | ||
112 | - .rechargeArrow { | ||
113 | - position: absolute; | ||
114 | - right: 10px; | ||
115 | - top: 30px; | ||
116 | - font-size: 20px; | ||
117 | - color: #999; | ||
118 | - } | ||
119 | - } | ||
120 | - | ||
121 | - .recordCon { | ||
122 | - padding-right: 35px; | ||
123 | - color: #999; | ||
124 | - display: flex; | ||
125 | - justify-content: space-between; | ||
126 | - } | ||
127 | 138 | ||
128 | - .container { | ||
129 | - overflow: hidden; | ||
130 | - } | ||
131 | - | ||
132 | - .custom-cover { | ||
133 | - flex: 1; | ||
134 | - flex-direction: row; | ||
135 | - position: relative; | ||
136 | - } | ||
137 | - | ||
138 | - .cover-content { | ||
139 | - position: absolute; | ||
140 | - bottom: 0; | ||
141 | - left: 0; | ||
142 | - right: 0; | ||
143 | - height: 40px; | ||
144 | - background-color: rgba($color: #000000, $alpha: 0.4); | ||
145 | - display: flex; | ||
146 | - flex-direction: row; | ||
147 | - align-items: center; | ||
148 | - padding-left: 15px; | ||
149 | - font-size: 14px; | ||
150 | - color: #fff; | ||
151 | - } | ||
152 | 139 | ||
153 | .card-actions { | 140 | .card-actions { |
154 | display: flex; | 141 | display: flex; |
pages/businessCard/buyCard.vue
@@ -45,22 +45,22 @@ | @@ -45,22 +45,22 @@ | ||
45 | @close="dialogClose"></uni-popup-dialog> | 45 | @close="dialogClose"></uni-popup-dialog> |
46 | </uni-popup> | 46 | </uni-popup> |
47 | </view> | 47 | </view> |
48 | - <view class="formWrap"> | ||
49 | - <uni-forms ref="baseForm" :modelValue="baseFormData"> | ||
50 | - <uni-forms-item label="车牌号码" required> | ||
51 | - <uni-easyinput v-model="baseFormData.name" placeholder="请输入车牌号码"/> | ||
52 | - </uni-forms-item> | 48 | + <!--<view class="formWrap">--> |
49 | + <!--<uni-forms ref="baseForm" :modelValue="baseFormData">--> | ||
50 | + <!--<uni-forms-item label="车牌号码" required>--> | ||
51 | + <!--<uni-easyinput v-model="baseFormData.name" placeholder="请输入车牌号码"/>--> | ||
52 | + <!--</uni-forms-item>--> | ||
53 | 53 | ||
54 | - <uni-forms-item label="生效时间"> | ||
55 | - <uni-datetime-picker :clear-icon="false" type="datetime" return-type="timestamp" | ||
56 | - v-model="baseFormData.datetimesingle"/> | ||
57 | - </uni-forms-item> | ||
58 | - <uni-forms-item label="失效时间"> | ||
59 | - <uni-datetime-picker :clear-icon="false" type="datetime" return-type="timestamp" | ||
60 | - v-model="baseFormData.datetimesingle"/> | ||
61 | - </uni-forms-item> | ||
62 | - </uni-forms> | ||
63 | - </view> | 54 | + <!--<uni-forms-item label="生效时间">--> |
55 | + <!--<uni-datetime-picker :clear-icon="false" type="datetime" return-type="timestamp"--> | ||
56 | + <!--v-model="baseFormData.datetimesingle"/>--> | ||
57 | + <!--</uni-forms-item>--> | ||
58 | + <!--<uni-forms-item label="失效时间">--> | ||
59 | + <!--<uni-datetime-picker :clear-icon="false" type="datetime" return-type="timestamp"--> | ||
60 | + <!--v-model="baseFormData.datetimesingle"/>--> | ||
61 | + <!--</uni-forms-item>--> | ||
62 | + <!--</uni-forms>--> | ||
63 | + <!--</view>--> | ||
64 | <!--<uni-section title="24小时(包天券)" type="line" >--> | 64 | <!--<uni-section title="24小时(包天券)" type="line" >--> |
65 | <!--<uni-card padding="0" spacing="0">--> | 65 | <!--<uni-card padding="0" spacing="0">--> |
66 | 66 |
pages/businessCard/cardDetail.vue
@@ -107,9 +107,9 @@ | @@ -107,9 +107,9 @@ | ||
107 | </uni-list> | 107 | </uni-list> |
108 | </uni-section> | 108 | </uni-section> |
109 | </view> | 109 | </view> |
110 | - <uni-load-more :status="status"/> | 110 | + <!--<uni-load-more :status="status"/>--> |
111 | </view> | 111 | </view> |
112 | - | 112 | + <uni-load-more :status="status"/> |
113 | 113 | ||
114 | <!--<uni-section title="8折(折扣券)" type="line">--> | 114 | <!--<uni-section title="8折(折扣券)" type="line">--> |
115 | <!--<uni-list>--> | 115 | <!--<uni-list>--> |
@@ -253,8 +253,6 @@ export default { | @@ -253,8 +253,6 @@ export default { | ||
253 | pageNum: '1',//当前页 | 253 | pageNum: '1',//当前页 |
254 | pageSize: '10',//每页条数 | 254 | pageSize: '10',//每页条数 |
255 | totalPages: '1', // 总条数 | 255 | totalPages: '1', // 总条数 |
256 | - // isLoadAll: false, | ||
257 | - // reload: false, | ||
258 | status: 'no-more', | 256 | status: 'no-more', |
259 | dataList: [], | 257 | dataList: [], |
260 | issuedCount: 0,// 被领取张数 | 258 | issuedCount: 0,// 被领取张数 |
@@ -288,7 +286,6 @@ export default { | @@ -288,7 +286,6 @@ export default { | ||
288 | console.log(this.dataList.length) | 286 | console.log(this.dataList.length) |
289 | if (this.totalPages == this.dataList.length) { | 287 | if (this.totalPages == this.dataList.length) { |
290 | this.status = 'no-more' | 288 | this.status = 'no-more' |
291 | - console.log('111') | ||
292 | return | 289 | return |
293 | } else { | 290 | } else { |
294 | this.pageNum++; | 291 | this.pageNum++; |
@@ -322,11 +319,17 @@ export default { | @@ -322,11 +319,17 @@ export default { | ||
322 | data: that.$common.requestSign(paramsData) | 319 | data: that.$common.requestSign(paramsData) |
323 | }).then(res => { | 320 | }).then(res => { |
324 | // const resDataArray = that.dataList.concat(res.data.dataList); | 321 | // const resDataArray = that.dataList.concat(res.data.dataList); |
325 | - if (res.data.pageTotals < 10) { | ||
326 | - this.status = 'no-more' | ||
327 | - } else { | ||
328 | - this.status = 'more' | 322 | + if(res.data.dataList.length>0){ |
323 | + if (res.data.pageTotals < 10) { | ||
324 | + that.status = 'no-more' | ||
325 | + } else { | ||
326 | + that.status = 'more' | ||
327 | + console.log('more') | ||
328 | + } | ||
329 | + }else{ | ||
330 | + that.status = 'no-more' | ||
329 | } | 331 | } |
332 | + | ||
330 | that.totalPages = res.data.pageTotals; | 333 | that.totalPages = res.data.pageTotals; |
331 | that.dataList = that.dataList.concat(res.data.dataList) | 334 | that.dataList = that.dataList.concat(res.data.dataList) |
332 | console.log(that.dataList.length) | 335 | console.log(that.dataList.length) |
@@ -361,7 +364,7 @@ export default { | @@ -361,7 +364,7 @@ export default { | ||
361 | this.pageSize = this.pageSize | 364 | this.pageSize = this.pageSize |
362 | this.totalPages = 1 | 365 | this.totalPages = 1 |
363 | this.dataList = [] | 366 | this.dataList = [] |
364 | - this.couponIssuedParkPage() | 367 | + this.fetchData() |
365 | this.couponDetailSummary() | 368 | this.couponDetailSummary() |
366 | }, | 369 | }, |
367 | bindPickerChangeWay: function (e, storage) { | 370 | bindPickerChangeWay: function (e, storage) { |
@@ -372,7 +375,7 @@ export default { | @@ -372,7 +375,7 @@ export default { | ||
372 | this.pageSize = this.pageSize | 375 | this.pageSize = this.pageSize |
373 | this.totalPages = 1 | 376 | this.totalPages = 1 |
374 | this.dataList = [] | 377 | this.dataList = [] |
375 | - this.couponIssuedParkPage() | 378 | + this.fetchData() |
376 | this.couponDetailSummary() | 379 | this.couponDetailSummary() |
377 | }, | 380 | }, |
378 | bindStartDateChange: function (e) { | 381 | bindStartDateChange: function (e) { |
@@ -382,7 +385,7 @@ export default { | @@ -382,7 +385,7 @@ export default { | ||
382 | this.pageSize = this.pageSize | 385 | this.pageSize = this.pageSize |
383 | this.totalPages = 1 | 386 | this.totalPages = 1 |
384 | this.dataList = [] | 387 | this.dataList = [] |
385 | - this.couponIssuedParkPage() | 388 | + this.fetchData() |
386 | this.couponDetailSummary() | 389 | this.couponDetailSummary() |
387 | }, | 390 | }, |
388 | bindEndDateChange: function (e) { | 391 | bindEndDateChange: function (e) { |
@@ -391,7 +394,7 @@ export default { | @@ -391,7 +394,7 @@ export default { | ||
391 | this.pageSize = this.pageSize | 394 | this.pageSize = this.pageSize |
392 | this.totalPages = 1 | 395 | this.totalPages = 1 |
393 | this.dataList = [] | 396 | this.dataList = [] |
394 | - this.couponIssuedParkPage() | 397 | + this.fetchData() |
395 | this.couponDetailSummary() | 398 | this.couponDetailSummary() |
396 | }, | 399 | }, |
397 | getDate(type) { | 400 | getDate(type) { |
@@ -413,23 +416,6 @@ export default { | @@ -413,23 +416,6 @@ export default { | ||
413 | </script> | 416 | </script> |
414 | 417 | ||
415 | <style lang="scss" scoped> | 418 | <style lang="scss" scoped> |
416 | - .rechargeWrap { | ||
417 | - position: relative; | ||
418 | - .rechargeArrow { | ||
419 | - position: absolute; | ||
420 | - right: 10px; | ||
421 | - top: 30px; | ||
422 | - font-size: 20px; | ||
423 | - color: #999; | ||
424 | - } | ||
425 | - } | ||
426 | - | ||
427 | - .recordCon { | ||
428 | - padding-right: 35px; | ||
429 | - color: #999; | ||
430 | - display: flex; | ||
431 | - justify-content: space-between; | ||
432 | - } | ||
433 | 419 | ||
434 | .paddingRight { | 420 | .paddingRight { |
435 | padding-right: 20px; | 421 | padding-right: 20px; |