Commit 438e8e43830638842cc8af88a1dac6dae15928c8
1 parent
904a46e0
卡券购买下单
Showing
4 changed files
with
84 additions
and
108 deletions
pages.json
... | ... | @@ -14,12 +14,21 @@ |
14 | 14 | "pages": [ |
15 | 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 | 24 | "path": "pages/businessCard/businessCard", |
18 | 25 | "style": { |
19 | 26 | "navigationBarTitleText": "商户卡券" |
20 | 27 | } |
21 | 28 | }, |
22 | 29 | |
30 | + | |
31 | + | |
23 | 32 | { |
24 | 33 | "path": "pages/businessCard/buyCard", |
25 | 34 | "style": { |
... | ... | @@ -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 | 42 | "path": "pages/businessCard/provideCard", | ... | ... |
pages/businessCard/businessCard.vue
... | ... | @@ -32,8 +32,8 @@ |
32 | 32 | </view> |
33 | 33 | |
34 | 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 | 37 | </view> |
38 | 38 | </template> |
39 | 39 | |
... | ... | @@ -44,15 +44,9 @@ export default { |
44 | 44 | dataList: [], |
45 | 45 | rows: [], |
46 | 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 | 52 | onLoad(params) { |
... | ... | @@ -64,14 +58,37 @@ export default { |
64 | 58 | onShow() { |
65 | 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 | 83 | computed: {}, |
68 | 84 | methods: { |
69 | 85 | // 通过商户ID查询停车记录信息 |
70 | 86 | couponRuleParkPage() { |
71 | 87 | let that = this |
88 | + that.status = 'loading' | |
72 | 89 | let paramsData = { |
73 | - pageNum: '1', | |
74 | - pageSize: '10' | |
90 | + pageNum: this.pageNum, | |
91 | + pageSize: this.pageSize | |
75 | 92 | } |
76 | 93 | // 首页信息获取 接口 |
77 | 94 | that.$myRequest({ |
... | ... | @@ -79,8 +96,19 @@ export default { |
79 | 96 | method: 'POST', |
80 | 97 | data: that.$common.requestSign(paramsData) |
81 | 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 | 114 | toBuy(i) { |
... | ... | @@ -107,48 +135,7 @@ export default { |
107 | 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 | 140 | .card-actions { |
154 | 141 | display: flex; | ... | ... |
pages/businessCard/buyCard.vue
... | ... | @@ -45,22 +45,22 @@ |
45 | 45 | @close="dialogClose"></uni-popup-dialog> |
46 | 46 | </uni-popup> |
47 | 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 | 64 | <!--<uni-section title="24小时(包天券)" type="line" >--> |
65 | 65 | <!--<uni-card padding="0" spacing="0">--> |
66 | 66 | ... | ... |
pages/businessCard/cardDetail.vue
... | ... | @@ -107,9 +107,9 @@ |
107 | 107 | </uni-list> |
108 | 108 | </uni-section> |
109 | 109 | </view> |
110 | - <uni-load-more :status="status"/> | |
110 | + <!--<uni-load-more :status="status"/>--> | |
111 | 111 | </view> |
112 | - | |
112 | + <uni-load-more :status="status"/> | |
113 | 113 | |
114 | 114 | <!--<uni-section title="8折(折扣券)" type="line">--> |
115 | 115 | <!--<uni-list>--> |
... | ... | @@ -253,8 +253,6 @@ export default { |
253 | 253 | pageNum: '1',//当前页 |
254 | 254 | pageSize: '10',//每页条数 |
255 | 255 | totalPages: '1', // 总条数 |
256 | - // isLoadAll: false, | |
257 | - // reload: false, | |
258 | 256 | status: 'no-more', |
259 | 257 | dataList: [], |
260 | 258 | issuedCount: 0,// 被领取张数 |
... | ... | @@ -288,7 +286,6 @@ export default { |
288 | 286 | console.log(this.dataList.length) |
289 | 287 | if (this.totalPages == this.dataList.length) { |
290 | 288 | this.status = 'no-more' |
291 | - console.log('111') | |
292 | 289 | return |
293 | 290 | } else { |
294 | 291 | this.pageNum++; |
... | ... | @@ -322,11 +319,17 @@ export default { |
322 | 319 | data: that.$common.requestSign(paramsData) |
323 | 320 | }).then(res => { |
324 | 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 | 333 | that.totalPages = res.data.pageTotals; |
331 | 334 | that.dataList = that.dataList.concat(res.data.dataList) |
332 | 335 | console.log(that.dataList.length) |
... | ... | @@ -361,7 +364,7 @@ export default { |
361 | 364 | this.pageSize = this.pageSize |
362 | 365 | this.totalPages = 1 |
363 | 366 | this.dataList = [] |
364 | - this.couponIssuedParkPage() | |
367 | + this.fetchData() | |
365 | 368 | this.couponDetailSummary() |
366 | 369 | }, |
367 | 370 | bindPickerChangeWay: function (e, storage) { |
... | ... | @@ -372,7 +375,7 @@ export default { |
372 | 375 | this.pageSize = this.pageSize |
373 | 376 | this.totalPages = 1 |
374 | 377 | this.dataList = [] |
375 | - this.couponIssuedParkPage() | |
378 | + this.fetchData() | |
376 | 379 | this.couponDetailSummary() |
377 | 380 | }, |
378 | 381 | bindStartDateChange: function (e) { |
... | ... | @@ -382,7 +385,7 @@ export default { |
382 | 385 | this.pageSize = this.pageSize |
383 | 386 | this.totalPages = 1 |
384 | 387 | this.dataList = [] |
385 | - this.couponIssuedParkPage() | |
388 | + this.fetchData() | |
386 | 389 | this.couponDetailSummary() |
387 | 390 | }, |
388 | 391 | bindEndDateChange: function (e) { |
... | ... | @@ -391,7 +394,7 @@ export default { |
391 | 394 | this.pageSize = this.pageSize |
392 | 395 | this.totalPages = 1 |
393 | 396 | this.dataList = [] |
394 | - this.couponIssuedParkPage() | |
397 | + this.fetchData() | |
395 | 398 | this.couponDetailSummary() |
396 | 399 | }, |
397 | 400 | getDate(type) { |
... | ... | @@ -413,23 +416,6 @@ export default { |
413 | 416 | </script> |
414 | 417 | |
415 | 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 | 420 | .paddingRight { |
435 | 421 | padding-right: 20px; | ... | ... |