Commit 44d935db35ac86f5c0b50b315a26d689d302ef3d
Merge remote-tracking branch 'origin/branch' into branch
Showing
8 changed files
with
518 additions
and
571 deletions
common/common.js
... | ... | @@ -35,6 +35,19 @@ const couponRuleParkPage = serverUrl + "/business/h5/coupon/couponRuleParkPage"; |
35 | 35 | const couponIssuedParkPage = serverUrl + "/business/h5/couponIssued/couponIssuedParkPage"; |
36 | 36 | // 商户卡券-卡券发放-生成领券的动态码 |
37 | 37 | const getCouponDynamicQR = serverUrl + "/business/h5/couponsend/getCouponDynamicQR"; |
38 | +// 商户卡券-卡券发放-生成领券的静态码下载地址 | |
39 | +const getCouponStaticQR = serverUrl + "/business/h5/couponsend/getCouponStaticQR"; | |
40 | +// 卡券申领明细总览 | |
41 | +const couponDetailSummary = serverUrl + "/business/h5/couponIssued/couponDetailSummary"; | |
42 | + | |
43 | +// 商户卡券-卡券下单 | |
44 | +const createCouponOrder = serverUrl + "/business/h5/coupon/createCouponOrder"; | |
45 | +// 商户卡券-使用余额购买 | |
46 | +const accountPay = serverUrl + "/business/h5/pay/busAccount/accountPay"; | |
47 | + | |
48 | + | |
49 | + | |
50 | + | |
38 | 51 | |
39 | 52 | //陈彪接口 |
40 | 53 | |
... | ... | @@ -219,6 +232,12 @@ export default { |
219 | 232 | couponRuleParkPage, |
220 | 233 | couponIssuedParkPage, |
221 | 234 | getCouponDynamicQR, |
235 | + getCouponStaticQR, | |
236 | + couponDetailSummary, | |
237 | + createCouponOrder, | |
238 | + accountPay, | |
239 | + | |
240 | + | |
222 | 241 | //陈彪接口 |
223 | 242 | rechargeList, |
224 | 243 | walletKindType, | ... | ... |
common/requestServer.js
... | ... | @@ -52,7 +52,7 @@ export const myRequest = (options) => { |
52 | 52 | uni.hideLoading(); |
53 | 53 | uni.showToast({ |
54 | 54 | title: result.message, |
55 | - icon: 'error', | |
55 | + icon: 'none', | |
56 | 56 | duration: 2000 |
57 | 57 | }); |
58 | 58 | } |
... | ... | @@ -65,7 +65,7 @@ export const myRequest = (options) => { |
65 | 65 | console.log("请求失败", error); |
66 | 66 | uni.showToast({ |
67 | 67 | title: error.message, |
68 | - icon: 'error', | |
68 | + icon: 'none', | |
69 | 69 | duration: 2000 |
70 | 70 | }) |
71 | 71 | // 失败数据 | ... | ... |
pages.json
... | ... | @@ -21,9 +21,10 @@ |
21 | 21 | } |
22 | 22 | }, |
23 | 23 | { |
24 | - "path": "pages/businessCard/provideCard", | |
24 | + "path": "pages/businessCard/cardDetail", | |
25 | 25 | "style": { |
26 | - "navigationBarTitleText": "商户卡券发放" | |
26 | + "navigationBarTitleText": "商户卡券明细", | |
27 | + "enablePullDownRefresh": true | |
27 | 28 | } |
28 | 29 | }, |
29 | 30 | { |
... | ... | @@ -33,13 +34,34 @@ |
33 | 34 | } |
34 | 35 | }, |
35 | 36 | |
37 | + | |
38 | + | |
36 | 39 | { |
37 | - "path": "pages/businessCard/cardDetail", | |
40 | + "path": "pages/businessCard/buyCard", | |
38 | 41 | "style": { |
39 | - "navigationBarTitleText": "商户卡券明细", | |
40 | - "enablePullDownRefresh": true | |
42 | + "navigationBarTitleText": "商户卡券购买" | |
41 | 43 | } |
42 | 44 | }, |
45 | + | |
46 | + | |
47 | + | |
48 | + { | |
49 | + "path": "pages/businessCard/provideCard", | |
50 | + "style": { | |
51 | + "navigationBarTitleText": "商户卡券发放" | |
52 | + } | |
53 | + }, | |
54 | + { | |
55 | + "path": "pages/businessCard/printCard", | |
56 | + "style": { | |
57 | + "navigationBarTitleText": "商户卡券打印" | |
58 | + } | |
59 | + }, | |
60 | + | |
61 | + | |
62 | + | |
63 | + | |
64 | + | |
43 | 65 | { |
44 | 66 | "path": "pages/rechargeDetail/rechargeDetail", |
45 | 67 | "style": { |
... | ... | @@ -71,20 +93,9 @@ |
71 | 93 | } |
72 | 94 | }, |
73 | 95 | |
74 | - { | |
75 | - "path": "pages/businessCard/printCard", | |
76 | - "style": { | |
77 | - "navigationBarTitleText": "商户卡券打印" | |
78 | - } | |
79 | - }, | |
80 | 96 | |
81 | 97 | |
82 | - { | |
83 | - "path": "pages/businessCard/buyCard", | |
84 | - "style": { | |
85 | - "navigationBarTitleText": "商户卡券购买" | |
86 | - } | |
87 | - }, | |
98 | + | |
88 | 99 | |
89 | 100 | |
90 | 101 | { | ... | ... |
pages/businessCard/businessCard.vue
... | ... | @@ -9,7 +9,7 @@ |
9 | 9 | <uni-list-item title="适应车场" :rightText="i.plName"> |
10 | 10 | <text></text> |
11 | 11 | </uni-list-item> |
12 | - <uni-list-item :title="`价格: ¥${i.value}/张`" | |
12 | + <uni-list-item :title="`价格: ¥${$common.moneyFormat(i.value)}/张`" | |
13 | 13 | :rightText="`商户库存:${i.cardNum}张`"></uni-list-item> |
14 | 14 | </uni-list> |
15 | 15 | <view slot="actions" class="card-actions no-border"> |
... | ... | @@ -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,26 +96,36 @@ 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) { |
87 | 115 | uni.navigateTo({ |
88 | - url: '../businessCard/buyCard?optionData='+JSON.stringify(i) | |
116 | + url: '../businessCard/buyCard?optionData=' + JSON.stringify(i) | |
89 | 117 | }); |
90 | 118 | }, |
91 | - printClick(i){ | |
119 | + printClick(i) { | |
92 | 120 | uni.navigateTo({ |
93 | - url: '../businessCard/cardPrint?optionData='+JSON.stringify(i) | |
121 | + url: '../businessCard/cardPrint?optionData=' + JSON.stringify(i) | |
94 | 122 | }); |
95 | 123 | }, |
96 | - provideCard(i){ | |
124 | + provideCard(i) { | |
97 | 125 | uni.navigateTo({ |
98 | - url: '../businessCard/provideCard?optionData='+JSON.stringify(i) | |
126 | + url: '../businessCard/provideCard?optionData=' + JSON.stringify(i) | |
99 | 127 | }); |
100 | 128 | } |
101 | - | |
102 | 129 | } |
103 | 130 | } |
104 | 131 | </script> |
... | ... | @@ -108,48 +135,7 @@ export default { |
108 | 135 | padding-bottom: 10px; |
109 | 136 | } |
110 | 137 | |
111 | - .rechargeWrap { | |
112 | - position: relative; | |
113 | - .rechargeArrow { | |
114 | - position: absolute; | |
115 | - right: 10px; | |
116 | - top: 30px; | |
117 | - font-size: 20px; | |
118 | - color: #999; | |
119 | - } | |
120 | - } | |
121 | - | |
122 | - .recordCon { | |
123 | - padding-right: 35px; | |
124 | - color: #999; | |
125 | - display: flex; | |
126 | - justify-content: space-between; | |
127 | - } | |
128 | - | |
129 | - .container { | |
130 | - overflow: hidden; | |
131 | - } | |
132 | 138 | |
133 | - .custom-cover { | |
134 | - flex: 1; | |
135 | - flex-direction: row; | |
136 | - position: relative; | |
137 | - } | |
138 | - | |
139 | - .cover-content { | |
140 | - position: absolute; | |
141 | - bottom: 0; | |
142 | - left: 0; | |
143 | - right: 0; | |
144 | - height: 40px; | |
145 | - background-color: rgba($color: #000000, $alpha: 0.4); | |
146 | - display: flex; | |
147 | - flex-direction: row; | |
148 | - align-items: center; | |
149 | - padding-left: 15px; | |
150 | - font-size: 14px; | |
151 | - color: #fff; | |
152 | - } | |
153 | 139 | |
154 | 140 | .card-actions { |
155 | 141 | display: flex; | ... | ... |
pages/businessCard/buyCard.vue
1 | 1 | <template> |
2 | 2 | <view> |
3 | 3 | |
4 | - <uni-section title="2小时(时长券)" type="line" > | |
4 | + <uni-section :title="`${cardRuleName}(${cardTypeName})`" type="line"> | |
5 | 5 | <uni-card padding="0" spacing="0"> |
6 | 6 | <uni-list> |
7 | - <uni-list-item title="适应车场" rightText="万达商业广场" > | |
7 | + <uni-list-item title="适应车场" :rightText="plName"> | |
8 | 8 | <text></text> |
9 | 9 | </uni-list-item> |
10 | - <uni-list-item title="价格:¥5/张" rightText="商户库存:0张"></uni-list-item> | |
10 | + <uni-list-item :title="`价格:¥${$common.moneyFormat(price)}/张`" :rightText="`商户库存:${cardNum}张`"></uni-list-item> | |
11 | 11 | </uni-list> |
12 | - | |
13 | 12 | </uni-card> |
14 | 13 | </uni-section> |
15 | 14 | |
16 | 15 | |
17 | - | |
18 | - <uni-list > | |
19 | - <uni-list-item title="购买数量" > | |
16 | + <uni-list> | |
17 | + <uni-list-item title="购买数量"> | |
20 | 18 | <template v-slot:footer> |
21 | - <uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" /> | |
19 | + <uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" | |
20 | + :max="cardNum" min="1"/> | |
22 | 21 | </template> |
23 | 22 | </uni-list-item> |
24 | - <uni-list-item title="应付金额" > | |
23 | + <uni-list-item title="应付金额"> | |
25 | 24 | <template v-slot:footer> |
26 | - <text style="color: red">¥25.00元</text> | |
25 | + <text style="color: red">¥{{ $common.moneyFormat(needPay)}}元</text> | |
27 | 26 | </template> |
28 | 27 | </uni-list-item> |
29 | - <uni-list-item title="支付方式" rightText="商户余额" /> | |
30 | - <uni-list-item note="请认真核对购买信息,卡券一经购买概不支持退款" > | |
28 | + <uni-list-item title="支付方式" rightText="商户余额"/> | |
29 | + <uni-list-item note="请认真核对购买信息,卡券一经购买概不支持退款"> | |
31 | 30 | <template v-slot:header> |
32 | 31 | <text style="color: red">温馨提示</text> |
33 | 32 | </template> |
... | ... | @@ -35,68 +34,69 @@ |
35 | 34 | </uni-list> |
36 | 35 | |
37 | 36 | <view class="uni-padding-wrap uni-common-mt"> |
38 | - <button type="primary" @click="dialogToggle('warn')">立即购买</button> | |
37 | + <button type="primary" @click="dialogToggle()">立即购买</button> | |
39 | 38 | </view> |
40 | 39 | |
41 | 40 | <view> |
42 | 41 | <!-- 提示窗示例 --> |
43 | 42 | <uni-popup ref="alertDialog" type="dialog"> |
44 | - <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确定" title="提示" content="二次确定" @confirm="dialogConfirm" | |
43 | + <uni-popup-dialog :type="msgType" cancelText="取消" confirmText="确定" title="提示" :content="`确定购买${cardRuleName}(${cardTypeName})${vModelValue}张\\n共支付${$common.moneyFormat(needPay)}元`" | |
44 | + @confirm="dialogConfirm" | |
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> | |
53 | - | |
54 | - <uni-forms-item label="生效时间"> | |
55 | - <uni-datetime-picker :clear-icon="false" type="datetime" return-type="timestamp" v-model="baseFormData.datetimesingle"/> | |
56 | - </uni-forms-item> | |
57 | - <uni-forms-item label="失效时间"> | |
58 | - <uni-datetime-picker :clear-icon="false" type="datetime" return-type="timestamp" v-model="baseFormData.datetimesingle"/> | |
59 | - </uni-forms-item> | |
60 | - </uni-forms> | |
61 | - </view> | |
62 | - <uni-section title="24小时(包天券)" type="line" > | |
63 | - <uni-card padding="0" spacing="0"> | |
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>--> | |
64 | 53 | |
65 | - <uni-list> | |
66 | - <uni-list-item title="适应车场" rightText="万达商业广场" > | |
67 | - <text></text> | |
68 | - </uni-list-item> | |
69 | - <uni-list-item title="价格:¥5/张" rightText="商户库存:0张"></uni-list-item> | |
70 | - </uni-list> | |
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" >--> | |
65 | + <!--<uni-card padding="0" spacing="0">--> | |
71 | 66 | |
72 | - </uni-card> | |
73 | - </uni-section> | |
67 | + <!--<uni-list>--> | |
68 | + <!--<uni-list-item title="适应车场" rightText="万达商业广场" >--> | |
69 | + <!--<text></text>--> | |
70 | + <!--</uni-list-item>--> | |
71 | + <!--<uni-list-item title="价格:¥5/张" rightText="商户库存:0张"></uni-list-item>--> | |
72 | + <!--</uni-list>--> | |
74 | 73 | |
74 | + <!--</uni-card>--> | |
75 | + <!--</uni-section>--> | |
75 | 76 | |
76 | 77 | |
77 | - <uni-list > | |
78 | - <uni-list-item title="购买数量" > | |
79 | - <template v-slot:footer> | |
80 | - <uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" /> | |
81 | - </template> | |
82 | - </uni-list-item> | |
83 | - <uni-list-item title="应付金额" > | |
84 | - <template v-slot:footer> | |
85 | - <text style="color: red">¥25.00元</text> | |
86 | - </template> | |
87 | - </uni-list-item> | |
88 | - <uni-list-item title="支付方式" rightText="商户余额" /> | |
89 | - <uni-list-item note="请认真核对购买信息,卡券一经购买概不支持退款" > | |
90 | - <template v-slot:header> | |
91 | - <text style="color: red">温馨提示</text> | |
92 | - </template> | |
93 | - </uni-list-item> | |
94 | - </uni-list> | |
95 | - | |
96 | - <view class="uni-padding-wrap uni-common-mt"> | |
97 | - <button type="primary" @click="dialogToggle('warn')">立即购买</button> | |
98 | - </view> | |
78 | + <!--<uni-list >--> | |
79 | + <!--<uni-list-item title="购买数量" >--> | |
80 | + <!--<template v-slot:footer>--> | |
81 | + <!--<uni-number-box v-model="vModelValue" @blur="blur" @focus="focus" @change="changeValue" />--> | |
82 | + <!--</template>--> | |
83 | + <!--</uni-list-item>--> | |
84 | + <!--<uni-list-item title="应付金额" >--> | |
85 | + <!--<template v-slot:footer>--> | |
86 | + <!--<text style="color: red">¥25.00元</text>--> | |
87 | + <!--</template>--> | |
88 | + <!--</uni-list-item>--> | |
89 | + <!--<uni-list-item title="支付方式" rightText="商户余额" />--> | |
90 | + <!--<uni-list-item note="请认真核对购买信息,卡券一经购买概不支持退款" >--> | |
91 | + <!--<template v-slot:header>--> | |
92 | + <!--<text style="color: red">温馨提示</text>--> | |
93 | + <!--</template>--> | |
94 | + <!--</uni-list-item>--> | |
95 | + <!--</uni-list>--> | |
99 | 96 | |
97 | + <!--<view class="uni-padding-wrap uni-common-mt">--> | |
98 | + <!--<button type="primary" @click="dialogToggle('warn')">立即购买</button>--> | |
99 | + <!--</view>--> | |
100 | 100 | |
101 | 101 | |
102 | 102 | </view> |
... | ... | @@ -109,16 +109,10 @@ export default { |
109 | 109 | format: true |
110 | 110 | }) |
111 | 111 | return { |
112 | - vModelValue: 3, | |
113 | - title: 'picker', | |
114 | - array: ['全部', '充值', '支付'], | |
115 | - arrayWay: ['所有方式', '微信', '线下公对公'], | |
116 | - index: 0, | |
117 | - indexWay: 0, | |
112 | + vModelValue: 1, | |
118 | 113 | benginDate: currentDate, |
119 | 114 | overDate: currentDate, |
120 | - | |
121 | - iconType:'auto', // 图标样式 | |
115 | + iconType: 'auto', // 图标样式 | |
122 | 116 | datetimesingle: '', |
123 | 117 | // 基础表单数据 |
124 | 118 | baseFormData: { |
... | ... | @@ -134,23 +128,38 @@ export default { |
134 | 128 | }] |
135 | 129 | } |
136 | 130 | }, |
131 | + cardTypeName: '',// 卡类型名称 | |
132 | + cardRuleName: '',// 卡名称 | |
133 | + plName: '', // 停车场 | |
134 | + price: '', // 卡价格 | |
135 | + cardNum: '', // 库存 | |
136 | + needPay: 0, // 应付 | |
137 | + cardRuleNo: '', | |
137 | 138 | } |
138 | 139 | }, |
139 | 140 | onLoad(params) { |
140 | 141 | wx.showShareMenu({ |
141 | 142 | withShareTicket: true |
142 | 143 | }) |
143 | - | |
144 | + let option = JSON.parse(params.optionData) | |
145 | + console.log(option) | |
146 | + this.cardRelParkNo = option.cardRelParkNo | |
147 | + this.cardRuleNo = option.cardRuleNo | |
148 | + this.cardTypeName = option.cardTypeName | |
149 | + this.cardRuleName = option.cardRuleName | |
150 | + this.plName = option.plName | |
151 | + this.price = option.value | |
152 | + this.cardNum = option.cardNum | |
153 | + this.needPay = this.price * this.vModelValue | |
144 | 154 | }, |
145 | 155 | onShow() { |
146 | 156 | var me = this; |
147 | - | |
148 | 157 | }, |
149 | 158 | mounted() { |
150 | 159 | setTimeout(() => { |
151 | - this.baseFormData.datetimesingle = Date.now() - 2*24*3600*1000 | |
152 | - this.datetimesingle = Date.now() - 2*24*3600*1000 | |
153 | - },500) | |
160 | + this.baseFormData.datetimesingle = Date.now() - 2 * 24 * 3600 * 1000 | |
161 | + this.datetimesingle = Date.now() - 2 * 24 * 3600 * 1000 | |
162 | + }, 500) | |
154 | 163 | }, |
155 | 164 | computed: { |
156 | 165 | startDate() { |
... | ... | @@ -161,6 +170,48 @@ export default { |
161 | 170 | } |
162 | 171 | }, |
163 | 172 | methods: { |
173 | + tobuy() { | |
174 | + let that = this | |
175 | + let paramsData = { | |
176 | + buyNum: this.vModelValue, | |
177 | + totalPrice: this.needPay, | |
178 | + cardRelParkNo: this.cardRelParkNo, | |
179 | + cardRuleNo: this.cardRuleNo | |
180 | + } | |
181 | + // 首页信息获取 接口 | |
182 | + that.$myRequest({ | |
183 | + url: that.$common.createCouponOrder, | |
184 | + method: 'POST', | |
185 | + data: that.$common.requestSign(paramsData) | |
186 | + }).then(res => { | |
187 | + console.log(res) | |
188 | + let orderId = res.data.orderId | |
189 | + this.accountPay(orderId) | |
190 | + }) | |
191 | + }, | |
192 | + accountPay(orderId){ | |
193 | + let that = this | |
194 | + let paramsData = { | |
195 | + payType: '35', // '35' 商户余额支付 | |
196 | + paySrcType: '501', // '101' : 停车付款单, '501': '商户优惠券购买' | |
197 | + orderId: orderId, | |
198 | + payFee: this.needPay | |
199 | + } | |
200 | + // 首页信息获取 接口 | |
201 | + that.$myRequest({ | |
202 | + url: that.$common.accountPay, | |
203 | + method: 'POST', | |
204 | + data: that.$common.requestSign(paramsData) | |
205 | + }).then(res => { | |
206 | + console.log(res) | |
207 | + uni.showToast({ | |
208 | + title: '购买成功', | |
209 | + icon: 'success', | |
210 | + duration: 1000 | |
211 | + }) | |
212 | + | |
213 | + }) | |
214 | + }, | |
164 | 215 | changeLog(e) { |
165 | 216 | console.log('change事件:', e); |
166 | 217 | }, |
... | ... | @@ -169,15 +220,15 @@ export default { |
169 | 220 | }, |
170 | 221 | dialogConfirm() { |
171 | 222 | console.log('点击确认') |
172 | - this.messageText = `点击确认了 ${this.msgType} 窗口` | |
173 | - this.$refs.message.open() | |
223 | + this.tobuy() | |
174 | 224 | }, |
175 | 225 | dialogToggle(type) { |
176 | - this.msgType = type | |
177 | 226 | this.$refs.alertDialog.open() |
178 | 227 | }, |
179 | 228 | changeValue(value) { |
180 | 229 | console.log('返回数值:', value); |
230 | + this.vModelValue = value | |
231 | + this.needPay = this.price * this.vModelValue | |
181 | 232 | }, |
182 | 233 | blur(e) { |
183 | 234 | console.log('blur:', e); |
... | ... | @@ -185,10 +236,10 @@ export default { |
185 | 236 | focus(e) { |
186 | 237 | console.log('focus:', e); |
187 | 238 | }, |
188 | - actionsClick(text){ | |
239 | + actionsClick(text) { | |
189 | 240 | uni.showToast({ |
190 | - title:text, | |
191 | - icon:'none' | |
241 | + title: text, | |
242 | + icon: 'none' | |
192 | 243 | }) |
193 | 244 | }, |
194 | 245 | bindPickerChange: function (e) { |
... | ... | @@ -229,11 +280,11 @@ export default { |
229 | 280 | background-color: #fff; |
230 | 281 | } |
231 | 282 | |
232 | - /deep/ .uni-section{ | |
283 | + /deep/ .uni-section { | |
233 | 284 | padding-bottom: 10px; |
234 | 285 | } |
235 | - /*/deep/ .uni-datetime-picker-btn-text{*/ | |
236 | - /*display: none;*/ | |
237 | - /*}*/ | |
238 | 286 | |
287 | + /deep/ .uni-dialog-content-text{ | |
288 | + text-align: center; | |
289 | + } | |
239 | 290 | </style> | ... | ... |
pages/businessCard/cardDetail.vue
1 | 1 | <template> |
2 | 2 | <view> |
3 | - <view class="statistics yellow-bg uni-list-cell-pd" style="color: #fff">共18张券被领取,合计金额100.00元,其中已使用16张</view> | |
3 | + <view class="statistics yellow-bg uni-list-cell-pd" style="color: #fff"> | |
4 | + 共{{issuedCount}}张券被领取,合计金额{{$common.moneyFormat(totalFee)}}元,其中已使用{{usedCount}}张 | |
5 | + </view> | |
4 | 6 | |
5 | 7 | |
6 | 8 | <view class="uni-list"> |
... | ... | @@ -77,7 +79,8 @@ |
77 | 79 | <view class="uni-flex uni-space-between" style="padding: 10px 0"> |
78 | 80 | <view> |
79 | 81 | <text class="color-blue paddingRight">领取时间</text> |
80 | - <uni-dateformat :date="i.issuedEffDate" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
82 | + <uni-dateformat :date="i.issuedEffDate" | |
83 | + format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
81 | 84 | </view> |
82 | 85 | <view class="color-green" v-if="i.isUesed=='1'"> |
83 | 86 | 已使用 |
... | ... | @@ -89,8 +92,10 @@ |
89 | 92 | <view class="uni-flex uni-space-between"> |
90 | 93 | <view> |
91 | 94 | <text class="color-red paddingRight">使用时间</text> |
92 | - <uni-dateformat v-if="i.isUesed=='1'" :date="i.usedDate" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
93 | - <uni-dateformat v-else :date="i.exp_data" format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
95 | + <uni-dateformat v-if="i.isUesed=='1'" :date="i.usedDate" | |
96 | + format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
97 | + <uni-dateformat v-else :date="i.exp_data" | |
98 | + format="yyyy-MM-dd hh:mm:ss"></uni-dateformat> | |
94 | 99 | </view> |
95 | 100 | <view class="color-green"> |
96 | 101 | {{i.fullCutValue}}元/张 |
... | ... | @@ -102,123 +107,120 @@ |
102 | 107 | </uni-list> |
103 | 108 | </uni-section> |
104 | 109 | </view> |
105 | - <uni-load-more :status="status" /> | |
110 | + <!--<uni-load-more :status="status"/>--> | |
106 | 111 | </view> |
107 | - | |
108 | - | |
109 | - | |
110 | - | |
112 | + <uni-load-more :status="status"/> | |
111 | 113 | |
112 | 114 | <!--<uni-section title="8折(折扣券)" type="line">--> |
113 | - <!--<uni-list>--> | |
114 | - <!--<uni-list-item>--> | |
115 | - <!--<template v-slot:body>--> | |
116 | - <!--<view class="slot-box uni-con-width">--> | |
117 | - <!--<view class="uni-flex uni-space-between ">--> | |
118 | - <!--<view class="color-blue">--> | |
119 | - <!--JE000100011--> | |
120 | - <!--</view>--> | |
121 | - <!--<view class="color-blue">--> | |
122 | - <!--京A123456--> | |
123 | - <!--</view>--> | |
124 | - <!--</view>--> | |
125 | - <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">--> | |
126 | - <!--<view>--> | |
127 | - <!--<text class="color-blue paddingRight">领取时间</text>--> | |
128 | - <!--2020-11-01 01:01:01--> | |
129 | - <!--</view>--> | |
130 | - <!--<view class="color-green">--> | |
131 | - <!--已使用--> | |
132 | - <!--</view>--> | |
133 | - <!--</view>--> | |
134 | - <!--<view class="uni-flex uni-space-between">--> | |
135 | - <!--<view>--> | |
136 | - <!--<text class="color-red paddingRight">使用时间</text>--> | |
137 | - <!--2020-11-01 01:01:01--> | |
138 | - <!--</view>--> | |
139 | - <!--<view class="color-green">--> | |
140 | - <!--5元/张--> | |
141 | - <!--</view>--> | |
142 | - <!--</view>--> | |
143 | - <!--</view>--> | |
144 | - <!--</template>--> | |
145 | - <!--</uni-list-item>--> | |
146 | - <!--</uni-list>--> | |
115 | + <!--<uni-list>--> | |
116 | + <!--<uni-list-item>--> | |
117 | + <!--<template v-slot:body>--> | |
118 | + <!--<view class="slot-box uni-con-width">--> | |
119 | + <!--<view class="uni-flex uni-space-between ">--> | |
120 | + <!--<view class="color-blue">--> | |
121 | + <!--JE000100011--> | |
122 | + <!--</view>--> | |
123 | + <!--<view class="color-blue">--> | |
124 | + <!--京A123456--> | |
125 | + <!--</view>--> | |
126 | + <!--</view>--> | |
127 | + <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">--> | |
128 | + <!--<view>--> | |
129 | + <!--<text class="color-blue paddingRight">领取时间</text>--> | |
130 | + <!--2020-11-01 01:01:01--> | |
131 | + <!--</view>--> | |
132 | + <!--<view class="color-green">--> | |
133 | + <!--已使用--> | |
134 | + <!--</view>--> | |
135 | + <!--</view>--> | |
136 | + <!--<view class="uni-flex uni-space-between">--> | |
137 | + <!--<view>--> | |
138 | + <!--<text class="color-red paddingRight">使用时间</text>--> | |
139 | + <!--2020-11-01 01:01:01--> | |
140 | + <!--</view>--> | |
141 | + <!--<view class="color-green">--> | |
142 | + <!--5元/张--> | |
143 | + <!--</view>--> | |
144 | + <!--</view>--> | |
145 | + <!--</view>--> | |
146 | + <!--</template>--> | |
147 | + <!--</uni-list-item>--> | |
148 | + <!--</uni-list>--> | |
147 | 149 | <!--</uni-section>--> |
148 | 150 | |
149 | 151 | |
150 | 152 | <!--<uni-section title="8折(折扣券)" type="line">--> |
151 | - <!--<uni-list>--> | |
152 | - <!--<uni-list-item>--> | |
153 | - <!--<template v-slot:body>--> | |
154 | - <!--<view class="slot-box uni-con-width">--> | |
155 | - <!--<view class="uni-flex uni-space-between ">--> | |
156 | - <!--<view class="color-blue">--> | |
157 | - <!--JE000100011--> | |
158 | - <!--</view>--> | |
159 | - <!--<view class="color-blue">--> | |
160 | - <!--京A123456--> | |
161 | - <!--</view>--> | |
162 | - <!--</view>--> | |
163 | - <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">--> | |
164 | - <!--<view>--> | |
165 | - <!--<text class="color-blue paddingRight">领取时间</text>--> | |
166 | - <!--2020-11-01 01:01:01--> | |
167 | - <!--</view>--> | |
168 | - <!--<view class="color-red">--> | |
169 | - <!--已失效--> | |
170 | - <!--</view>--> | |
171 | - <!--</view>--> | |
172 | - <!--<view class="uni-flex uni-space-between">--> | |
173 | - <!--<view>--> | |
174 | - <!--<text class="color-red paddingRight">失效时间</text>--> | |
175 | - <!--2020-11-01 01:01:01--> | |
176 | - <!--</view>--> | |
177 | - <!--<view class="color-green">--> | |
178 | - <!--5元/张--> | |
179 | - <!--</view>--> | |
180 | - <!--</view>--> | |
181 | - <!--</view>--> | |
182 | - <!--</template>--> | |
183 | - <!--</uni-list-item>--> | |
184 | - <!--</uni-list>--> | |
153 | + <!--<uni-list>--> | |
154 | + <!--<uni-list-item>--> | |
155 | + <!--<template v-slot:body>--> | |
156 | + <!--<view class="slot-box uni-con-width">--> | |
157 | + <!--<view class="uni-flex uni-space-between ">--> | |
158 | + <!--<view class="color-blue">--> | |
159 | + <!--JE000100011--> | |
160 | + <!--</view>--> | |
161 | + <!--<view class="color-blue">--> | |
162 | + <!--京A123456--> | |
163 | + <!--</view>--> | |
164 | + <!--</view>--> | |
165 | + <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">--> | |
166 | + <!--<view>--> | |
167 | + <!--<text class="color-blue paddingRight">领取时间</text>--> | |
168 | + <!--2020-11-01 01:01:01--> | |
169 | + <!--</view>--> | |
170 | + <!--<view class="color-red">--> | |
171 | + <!--已失效--> | |
172 | + <!--</view>--> | |
173 | + <!--</view>--> | |
174 | + <!--<view class="uni-flex uni-space-between">--> | |
175 | + <!--<view>--> | |
176 | + <!--<text class="color-red paddingRight">失效时间</text>--> | |
177 | + <!--2020-11-01 01:01:01--> | |
178 | + <!--</view>--> | |
179 | + <!--<view class="color-green">--> | |
180 | + <!--5元/张--> | |
181 | + <!--</view>--> | |
182 | + <!--</view>--> | |
183 | + <!--</view>--> | |
184 | + <!--</template>--> | |
185 | + <!--</uni-list-item>--> | |
186 | + <!--</uni-list>--> | |
185 | 187 | <!--</uni-section>--> |
186 | 188 | |
187 | 189 | <!--<uni-section title="8折(折扣券)" type="line">--> |
188 | - <!--<uni-list>--> | |
189 | - <!--<uni-list-item>--> | |
190 | - <!--<template v-slot:body>--> | |
191 | - <!--<view class="slot-box uni-con-width">--> | |
192 | - <!--<view class="uni-flex uni-space-between ">--> | |
193 | - <!--<view class="color-blue">--> | |
194 | - <!--JE000100011--> | |
195 | - <!--</view>--> | |
196 | - <!--<view class="color-blue">--> | |
197 | - <!--京A123456--> | |
198 | - <!--</view>--> | |
199 | - <!--</view>--> | |
200 | - <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">--> | |
201 | - <!--<view>--> | |
202 | - <!--<text class="color-blue paddingRight">领取时间</text>--> | |
203 | - <!--2020-11-01 01:01:01--> | |
204 | - <!--</view>--> | |
205 | - <!--<view class="color-blue">--> | |
206 | - <!--未使用--> | |
207 | - <!--</view>--> | |
208 | - <!--</view>--> | |
209 | - <!--<view class="uni-flex uni-space-between">--> | |
210 | - <!--<view>--> | |
211 | - <!--<text class="color-green paddingRight">有效截止</text>--> | |
212 | - <!--2020-11-01 01:01:01--> | |
213 | - <!--</view>--> | |
214 | - <!--<view class="color-green">--> | |
215 | - <!--5元/张--> | |
216 | - <!--</view>--> | |
217 | - <!--</view>--> | |
218 | - <!--</view>--> | |
219 | - <!--</template>--> | |
220 | - <!--</uni-list-item>--> | |
221 | - <!--</uni-list>--> | |
190 | + <!--<uni-list>--> | |
191 | + <!--<uni-list-item>--> | |
192 | + <!--<template v-slot:body>--> | |
193 | + <!--<view class="slot-box uni-con-width">--> | |
194 | + <!--<view class="uni-flex uni-space-between ">--> | |
195 | + <!--<view class="color-blue">--> | |
196 | + <!--JE000100011--> | |
197 | + <!--</view>--> | |
198 | + <!--<view class="color-blue">--> | |
199 | + <!--京A123456--> | |
200 | + <!--</view>--> | |
201 | + <!--</view>--> | |
202 | + <!--<view class="uni-flex uni-space-between" style="padding: 10px 0">--> | |
203 | + <!--<view>--> | |
204 | + <!--<text class="color-blue paddingRight">领取时间</text>--> | |
205 | + <!--2020-11-01 01:01:01--> | |
206 | + <!--</view>--> | |
207 | + <!--<view class="color-blue">--> | |
208 | + <!--未使用--> | |
209 | + <!--</view>--> | |
210 | + <!--</view>--> | |
211 | + <!--<view class="uni-flex uni-space-between">--> | |
212 | + <!--<view>--> | |
213 | + <!--<text class="color-green paddingRight">有效截止</text>--> | |
214 | + <!--2020-11-01 01:01:01--> | |
215 | + <!--</view>--> | |
216 | + <!--<view class="color-green">--> | |
217 | + <!--5元/张--> | |
218 | + <!--</view>--> | |
219 | + <!--</view>--> | |
220 | + <!--</view>--> | |
221 | + <!--</template>--> | |
222 | + <!--</uni-list-item>--> | |
223 | + <!--</uni-list>--> | |
222 | 224 | <!--</uni-section>--> |
223 | 225 | </view> |
224 | 226 | </template> |
... | ... | @@ -250,11 +252,12 @@ export default { |
250 | 252 | endTime: currentDate, |
251 | 253 | pageNum: '1',//当前页 |
252 | 254 | pageSize: '10',//每页条数 |
253 | - totalPages:'1', // 总条数 | |
254 | - // isLoadAll: false, | |
255 | - // reload: false, | |
255 | + totalPages: '1', // 总条数 | |
256 | 256 | status: 'no-more', |
257 | 257 | dataList: [], |
258 | + issuedCount: 0,// 被领取张数 | |
259 | + usedCount: 0,// 使用张数 | |
260 | + totalFee: 0, // 金额 | |
258 | 261 | } |
259 | 262 | }, |
260 | 263 | onLoad(params) { |
... | ... | @@ -262,6 +265,7 @@ export default { |
262 | 265 | withShareTicket: true |
263 | 266 | }) |
264 | 267 | this.fetchData() |
268 | + this.couponDetailSummary() | |
265 | 269 | }, |
266 | 270 | onShow() { |
267 | 271 | var me = this; |
... | ... | @@ -282,14 +286,11 @@ export default { |
282 | 286 | console.log(this.dataList.length) |
283 | 287 | if (this.totalPages == this.dataList.length) { |
284 | 288 | this.status = 'no-more' |
285 | - console.log('111') | |
286 | 289 | return |
287 | 290 | } else { |
288 | 291 | this.pageNum++; |
289 | 292 | this.fetchData() |
290 | 293 | } |
291 | - | |
292 | - | |
293 | 294 | }, |
294 | 295 | computed: { |
295 | 296 | startDate() { |
... | ... | @@ -301,15 +302,13 @@ export default { |
301 | 302 | }, |
302 | 303 | methods: { |
303 | 304 | fetchData: function () { |
304 | - | |
305 | - | |
306 | 305 | let that = this |
307 | 306 | that.status = 'loading' |
308 | 307 | let paramsData = { |
309 | 308 | pageNum: this.pageNum, |
310 | 309 | pageSize: this.pageSize, |
311 | - beginTime: this.beginTime+' 00:00:00', | |
312 | - endTime: this.endTime+' 23:59:59', | |
310 | + beginTime: this.beginTime + ' 00:00:00', | |
311 | + endTime: this.endTime + ' 23:59:59', | |
313 | 312 | cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 |
314 | 313 | isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用 |
315 | 314 | } |
... | ... | @@ -320,16 +319,43 @@ export default { |
320 | 319 | data: that.$common.requestSign(paramsData) |
321 | 320 | }).then(res => { |
322 | 321 | // const resDataArray = that.dataList.concat(res.data.dataList); |
323 | - if(res.data.pageTotals<10){ | |
324 | - this.status = 'no-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 | + } | |
325 | 329 | }else{ |
326 | - this.status = 'more' | |
330 | + that.status = 'no-more' | |
327 | 331 | } |
332 | + | |
328 | 333 | that.totalPages = res.data.pageTotals; |
329 | 334 | that.dataList = that.dataList.concat(res.data.dataList) |
330 | 335 | console.log(that.dataList.length) |
331 | 336 | }) |
332 | 337 | }, |
338 | + couponDetailSummary: function () { | |
339 | + let that = this | |
340 | + that.status = 'loading' | |
341 | + let paramsData = { | |
342 | + beginTime: this.beginTime + ' 00:00:00', | |
343 | + endTime: this.endTime + ' 23:59:59', | |
344 | + cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 | |
345 | + isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用 | |
346 | + } | |
347 | + // 首页信息获取 接口 | |
348 | + that.$myRequest({ | |
349 | + url: that.$common.couponDetailSummary, | |
350 | + method: 'POST', | |
351 | + data: that.$common.requestSign(paramsData) | |
352 | + }).then(res => { | |
353 | + console.log(res) | |
354 | + this.issuedCount = res.data.issuedCount // 被领取张数 | |
355 | + this.usedCount = res.data.usedCount // 使用张数 | |
356 | + this.totalFee = res.data.totalFee // 金额 | |
357 | + }) | |
358 | + }, | |
333 | 359 | bindPickerChange: function (e, storage) { |
334 | 360 | console.log('picker发送选择改变,携带值为', e.detail.value) |
335 | 361 | this.index = e.detail.value |
... | ... | @@ -338,7 +364,8 @@ export default { |
338 | 364 | this.pageSize = this.pageSize |
339 | 365 | this.totalPages = 1 |
340 | 366 | this.dataList = [] |
341 | - this.couponIssuedParkPage() | |
367 | + this.fetchData() | |
368 | + this.couponDetailSummary() | |
342 | 369 | }, |
343 | 370 | bindPickerChangeWay: function (e, storage) { |
344 | 371 | console.log(storage) |
... | ... | @@ -348,7 +375,8 @@ export default { |
348 | 375 | this.pageSize = this.pageSize |
349 | 376 | this.totalPages = 1 |
350 | 377 | this.dataList = [] |
351 | - this.couponIssuedParkPage() | |
378 | + this.fetchData() | |
379 | + this.couponDetailSummary() | |
352 | 380 | }, |
353 | 381 | bindStartDateChange: function (e) { |
354 | 382 | console.log(e.detail.value) |
... | ... | @@ -357,7 +385,8 @@ export default { |
357 | 385 | this.pageSize = this.pageSize |
358 | 386 | this.totalPages = 1 |
359 | 387 | this.dataList = [] |
360 | - this.couponIssuedParkPage() | |
388 | + this.fetchData() | |
389 | + this.couponDetailSummary() | |
361 | 390 | }, |
362 | 391 | bindEndDateChange: function (e) { |
363 | 392 | this.endTime = e.detail.value |
... | ... | @@ -365,7 +394,8 @@ export default { |
365 | 394 | this.pageSize = this.pageSize |
366 | 395 | this.totalPages = 1 |
367 | 396 | this.dataList = [] |
368 | - this.couponIssuedParkPage() | |
397 | + this.fetchData() | |
398 | + this.couponDetailSummary() | |
369 | 399 | }, |
370 | 400 | getDate(type) { |
371 | 401 | const date = new Date(); |
... | ... | @@ -386,23 +416,6 @@ export default { |
386 | 416 | </script> |
387 | 417 | |
388 | 418 | <style lang="scss" scoped> |
389 | - .rechargeWrap { | |
390 | - position: relative; | |
391 | - .rechargeArrow { | |
392 | - position: absolute; | |
393 | - right: 10px; | |
394 | - top: 30px; | |
395 | - font-size: 20px; | |
396 | - color: #999; | |
397 | - } | |
398 | - } | |
399 | - | |
400 | - .recordCon { | |
401 | - padding-right: 35px; | |
402 | - color: #999; | |
403 | - display: flex; | |
404 | - justify-content: space-between; | |
405 | - } | |
406 | 419 | |
407 | 420 | .paddingRight { |
408 | 421 | padding-right: 20px; | ... | ... |
pages/businessCard/printCard.vue
1 | 1 | <template> |
2 | 2 | <view> |
3 | - <uni-section title="50%(折扣券)" type="line"> | |
3 | + <uni-section :title="`${cardRuleName}(${cardTypeName})`" type="line"> | |
4 | 4 | <uni-card padding="0" spacing="0"> |
5 | 5 | <uni-list> |
6 | - <uni-list-item title="适应车场" rightText="万达商业广场" > | |
6 | + <uni-list-item title="适应车场" :rightText="plName"> | |
7 | 7 | <text></text> |
8 | 8 | </uni-list-item> |
9 | - <uni-list-item title="价格:¥5/张" rightText="商户库存:0张"></uni-list-item> | |
9 | + <uni-list-item :title="`价格:¥${price}/张`" :rightText="`商户库存:${cardNum}张`"></uni-list-item> | |
10 | 10 | </uni-list> |
11 | 11 | </uni-card> |
12 | 12 | </uni-section> |
13 | 13 | |
14 | - <view class=" uni-card" style="padding: 10px 0"> | |
15 | - <view style="width: 80%;height: 100px;border: 1px solid #ccc;margin: 0 auto"> | |
16 | - | |
17 | - </view> | |
14 | + <view class=" uni-card text-center" style="padding: 10px 0"> | |
15 | + <image :src="qrUrl"></image> | |
18 | 16 | </view> |
19 | 17 | |
20 | - <view style="padding: 15px"> | |
18 | + | |
19 | + <view class=" uni-card" style="padding: 10px 15px"> | |
21 | 20 | 二维码有效期:(自打印时间算起) |
22 | - <uni-number-box @change="changeValue" /> | |
21 | + <uni-number-box @change="changeValue" min="1"/> | |
23 | 22 | </view> |
24 | 23 | |
25 | - | |
26 | - | |
27 | 24 | <view class="uni-padding-wrap uni-common-mt"> |
28 | 25 | <!--<button type="primary" style="margin-bottom: 15px">停止自动发放</button>--> |
29 | - <button type="warn">立即打印</button> | |
26 | + <button type="warn" @click="changeTime">立即打印</button> | |
30 | 27 | </view> |
31 | 28 | |
32 | 29 | |
... | ... | @@ -34,190 +31,87 @@ |
34 | 31 | </template> |
35 | 32 | |
36 | 33 | <script> |
37 | -import common from "../../common/common.js"; | |
34 | +import uQRCode from '../../common/uqrcode.js' //引入uqrcode.js | |
38 | 35 | export default { |
39 | 36 | data() { |
40 | - const currentDate = this.getDate({ | |
41 | - format: true | |
42 | - }) | |
43 | 37 | return { |
44 | - numberValue: 0, | |
45 | - title: 'picker', | |
46 | - array: ['全部', '充值', '支付'], | |
47 | - arrayWay: ['所有方式', '微信', '线下公对公'], | |
48 | - index: 0, | |
49 | - indexWay: 0, | |
50 | - benginDate: currentDate, | |
51 | - overDate: currentDate, | |
52 | - rows:[], | |
53 | - pageNum:1,//当前页 | |
54 | - pageSize:1,//每页条数 | |
55 | - reload:false, | |
56 | - status:'more', | |
57 | - contentText:{ | |
58 | - contentdown:'上拉加载更多~', | |
59 | - contentrefresh:'正在加载更多~', | |
60 | - contentmore:'我是有底线的~' | |
61 | - }, | |
62 | - iconType:'auto', // 图标样式 | |
38 | + cardTypeName: '',// 卡类型名称 | |
39 | + cardRuleName: '',// 卡名称 | |
40 | + plName: '', // 停车场 | |
41 | + price: '', // 卡价格 | |
42 | + cardNum: '', // 库存 | |
43 | + cardRelParkNo: '',//商券规则关联车场和商户编码 | |
44 | + numberValue: '1', | |
45 | + hour: '9999999999999999999999', | |
46 | + qrUrl: '', // 图片地址 | |
63 | 47 | } |
64 | 48 | }, |
65 | 49 | onLoad(params) { |
66 | 50 | wx.showShareMenu({ |
67 | 51 | withShareTicket: true |
68 | 52 | }) |
69 | - // this.mycarNumber = params.carNumber; | |
70 | - // this.myorderId = params.orderId; | |
71 | - // this.myparkCode = params.parkCode; | |
72 | - // this.myorderState = params.orderState; | |
73 | - // this.totalFee = params.totalFee | |
74 | - // this.unPayFee = params.unPayFee | |
75 | - // if (params.orderState == 5) { | |
76 | - // //停车补缴单 103 | |
77 | - // this.mypaySrcType = '103' | |
78 | - // } else { | |
79 | - // this.mypaySrcType = '101' | |
80 | - // } | |
81 | - // // this.GetbillQueryInfo(this.mycarNumber, this.myorderId, this.myparkCode); | |
82 | - // this.getWxCode(); | |
83 | - // this.PDlogin(); | |
84 | - //console.log("xxxmake = "+this.makedateFormat()); | |
53 | + console.log(params) | |
54 | + let option = params | |
55 | + this.cardRelParkNo = option.cardRelParkNo | |
56 | + this.cardTypeName = option.cardTypeName | |
57 | + this.cardRuleName = option.cardRuleName | |
58 | + this.plName = option.plName | |
59 | + this.price = option.price | |
60 | + this.cardNum = option.cardNum | |
61 | + this.getCouponStaticQR() | |
85 | 62 | }, |
86 | 63 | onShow() { |
87 | 64 | var me = this; |
88 | - var userInfo = me.getGlobalUser("globalUser"); | |
89 | - if (userInfo != null) { | |
90 | - me.phoneNumb = userInfo.userPhone; | |
91 | - } | |
92 | - var pages = getCurrentPages(); | |
93 | - var currPage = pages[pages.length - 1]; //当前页面 | |
94 | - console.log('currPage.data.selCoupon = ' + currPage.data.selCoupon); | |
95 | - me.selCoupon = currPage.data.selCoupon; | |
96 | - console.log(JSON.stringify(me.selCoupon)); | |
97 | - // me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType, me.selCoupon | |
98 | - // .discValue); | |
99 | - // GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) { | |
100 | - }, | |
101 | - computed: { | |
102 | - startDate() { | |
103 | - return this.getDate('start'); | |
104 | - }, | |
105 | - endDate() { | |
106 | - return this.getDate('end'); | |
107 | - } | |
108 | 65 | }, |
66 | + computed: {}, | |
109 | 67 | methods: { |
110 | - change(value) { | |
68 | + changeValue(value) { | |
111 | 69 | this.numberValue = value |
112 | 70 | }, |
113 | - actionsClick(text){ | |
114 | - uni.showToast({ | |
115 | - title:text, | |
116 | - icon:'none' | |
71 | + getCouponStaticQR() { | |
72 | + let that = this | |
73 | + let paramsData = { | |
74 | + cardRelParkNo: this.cardRelParkNo, | |
75 | + codeType: '2', | |
76 | + hour: this.hour | |
77 | + } | |
78 | + // 首页信息获取 接口 | |
79 | + that.$myRequest({ | |
80 | + url: that.$common.getCouponStaticQR, | |
81 | + method: 'POST', | |
82 | + data: that.$common.requestSign(paramsData) | |
83 | + }).then(res => { | |
84 | + console.log(res) | |
85 | + that.qrUrl = res.data.qrUrl | |
86 | + console.log(that.qrUrl) | |
117 | 87 | }) |
118 | 88 | }, |
119 | - bindPickerChange: function (e) { | |
120 | - console.log('picker发送选择改变,携带值为', e.detail.value) | |
121 | - this.index = e.detail.value | |
122 | - }, | |
123 | - bindPickerChangeWay: function (e) { | |
124 | - console.log('picker发送选择改变,携带值为', e.detail.value) | |
125 | - this.indexWay = e.detail.value | |
126 | - }, | |
127 | - bindStartDateChange: function (e) { | |
128 | - this.benginDate = e.detail.value | |
129 | - }, | |
130 | - bindEndDateChange: function (e) { | |
131 | - this.overDate = e.detail.value | |
132 | - }, | |
133 | - getDate(type) { | |
134 | - const date = new Date(); | |
135 | - let year = date.getFullYear(); | |
136 | - let month = date.getMonth() + 1; | |
137 | - let day = date.getDate(); | |
138 | - if (type === 'start') { | |
139 | - year = year - 60; | |
140 | - } else if (type === 'end') { | |
141 | - year = year + 2; | |
142 | - } | |
143 | - month = month > 9 ? month : '0' + month; | |
144 | - day = day > 9 ? day : '0' + day; | |
145 | - return `${year}-${month}-${day}`; | |
89 | + //**生成二维码**// | |
90 | + qrFun: function (text) { | |
91 | + this.qrShow = true | |
92 | + uQRCode.make({ | |
93 | + canvasId: 'qrcode', | |
94 | + componentInstance: this, | |
95 | + text: text, | |
96 | + size: 150, | |
97 | + margin: 0, | |
98 | + backgroundColor: '#ffffff', | |
99 | + foregroundColor: '#000000', | |
100 | + fileType: 'jpg', | |
101 | + errorCorrectLevel: uQRCode.errorCorrectLevel.H, | |
102 | + success: res => { | |
103 | + } | |
104 | + }) | |
146 | 105 | }, |
106 | + changeTime: function () { | |
107 | + this.hour = this.numberValue | |
108 | + this.getCouponStaticQR() | |
109 | + } | |
147 | 110 | } |
148 | 111 | } |
149 | 112 | </script> |
150 | 113 | |
151 | 114 | <style lang="scss" scoped> |
152 | - /deep/ .uni-section{ | |
153 | - padding-bottom: 10px; | |
154 | - } | |
155 | - .rechargeWrap{ | |
156 | - position: relative; | |
157 | - .rechargeArrow{ | |
158 | - position: absolute; | |
159 | - right: 10px; | |
160 | - top: 30px; | |
161 | - font-size: 20px; | |
162 | - color: #999; | |
163 | - } | |
164 | - } | |
165 | - .recordCon { | |
166 | - padding-right: 35px; | |
167 | - color: #999; | |
168 | - display: flex; | |
169 | - justify-content: space-between; | |
170 | - } | |
171 | - | |
172 | - .container { | |
173 | - overflow: hidden; | |
174 | - } | |
175 | - | |
176 | - .custom-cover { | |
177 | - flex: 1; | |
178 | - flex-direction: row; | |
179 | - position: relative; | |
180 | - } | |
181 | - | |
182 | - .cover-content { | |
183 | - position: absolute; | |
184 | - bottom: 0; | |
185 | - left: 0; | |
186 | - right: 0; | |
187 | - height: 40px; | |
188 | - background-color: rgba($color: #000000, $alpha: 0.4); | |
189 | - display: flex; | |
190 | - flex-direction: row; | |
191 | - align-items: center; | |
192 | - padding-left: 15px; | |
193 | - font-size: 14px; | |
194 | - color: #fff; | |
195 | - } | |
196 | 115 | |
197 | - .card-actions { | |
198 | - display: flex; | |
199 | - flex-direction: row; | |
200 | - justify-content: space-around; | |
201 | - align-items: center; | |
202 | - height: 45px; | |
203 | - border-top: 1px #eee solid; | |
204 | - } | |
205 | - .card-actions-item { | |
206 | - display: flex; | |
207 | - flex-direction: row; | |
208 | - align-items: center; | |
209 | - } | |
210 | - .card-actions-item-text { | |
211 | - font-size: 12px; | |
212 | - color: #666; | |
213 | - margin-left: 5px; | |
214 | - } | |
215 | - .cover-image { | |
216 | - flex: 1; | |
217 | - height: 150px; | |
218 | - } | |
219 | - .no-border { | |
220 | - border-width: 0; | |
221 | - } | |
222 | 116 | |
223 | 117 | </style> | ... | ... |
pages/businessCard/provideCard.vue
... | ... | @@ -18,13 +18,13 @@ |
18 | 18 | </view> |
19 | 19 | |
20 | 20 | <view class="tip-wrap"> |
21 | - <uni-notice-bar single text="温馨提示:" /> | |
22 | - <uni-notice-bar single text="卡券自动发放,扫码领券后会自动刷新卡券二维码。" /> | |
21 | + <uni-notice-bar single text="温馨提示:"/> | |
22 | + <uni-notice-bar single text="卡券自动发放,扫码领券后会自动刷新卡券二维码。"/> | |
23 | 23 | </view> |
24 | 24 | |
25 | 25 | <view class="uni-padding-wrap uni-common-mt"> |
26 | - <button type="primary" style="margin-bottom: 15px">停止自动发放</button> | |
27 | - <button type="warn">打印静态二维码</button> | |
26 | + <button type="primary" style="margin-bottom: 15px" @click="stopProvide">{{provideText}}</button> | |
27 | + <button type="warn" @click="toPrintCard">打印静态二维码</button> | |
28 | 28 | </view> |
29 | 29 | |
30 | 30 | |
... | ... | @@ -39,37 +39,39 @@ export default { |
39 | 39 | qrShow: false, |
40 | 40 | cardTypeName: '',// 卡类型名称 |
41 | 41 | cardRuleName: '',// 卡名称 |
42 | - plName:'', // 停车场 | |
43 | - price:'', // 卡价格 | |
44 | - cardNum:'', // 库存 | |
42 | + plName: '', // 停车场 | |
43 | + price: '', // 卡价格 | |
44 | + cardNum: '', // 库存 | |
45 | + timer: null, // 定时器 | |
46 | + qrUrl: '',// 二维码url | |
47 | + provideText:'停止自动发放', | |
48 | + cardRelParkNo:'',//商券规则关联车场和商户编码 | |
45 | 49 | } |
46 | 50 | }, |
47 | 51 | onLoad(params) { |
48 | 52 | wx.showShareMenu({ |
49 | 53 | withShareTicket: true |
50 | 54 | }) |
51 | - // let option = JSON.parse(params.optionData) | |
52 | - // console.log(option) | |
53 | - // this.cardTypeName = option.cardTypeName | |
54 | - // this.cardRuleName = option.cardRuleName | |
55 | - // this.plName = option.plName | |
56 | - // this.price = option.value | |
57 | - // this.cardNum = option.cardNum | |
55 | + let option = JSON.parse(params.optionData) | |
56 | + console.log(option) | |
57 | + this.cardRelParkNo = option.cardRelParkNo | |
58 | + this.cardTypeName = option.cardTypeName | |
59 | + this.cardRuleName = option.cardRuleName | |
60 | + this.plName = option.plName | |
61 | + this.price = option.value | |
62 | + this.cardNum = option.cardNum | |
58 | 63 | // this.maxNum = option.cardNum |
59 | 64 | this.getCouponDynamicQR() |
60 | 65 | }, |
61 | 66 | onShow() { |
62 | 67 | var me = this; |
63 | - | |
64 | - }, | |
65 | - computed: { | |
66 | - | |
67 | 68 | }, |
69 | + computed: {}, | |
68 | 70 | methods: { |
69 | 71 | getCouponDynamicQR() { |
70 | 72 | let that = this |
71 | 73 | let paramsData = { |
72 | - cardRelParkNo: '123qwe', | |
74 | + cardRelParkNo: this.cardRelParkNo, | |
73 | 75 | codeType: '2' |
74 | 76 | } |
75 | 77 | // 首页信息获取 接口 |
... | ... | @@ -79,13 +81,18 @@ export default { |
79 | 81 | data: that.$common.requestSign(paramsData) |
80 | 82 | }).then(res => { |
81 | 83 | console.log(res) |
82 | - let qrUrl = res.data.qrUrl | |
83 | - that.qrFun(qrUrl) //调用二维码方法 | |
84 | - console.log(qrUrl) | |
84 | + that.qrUrl = res.data.qrUrl | |
85 | + that.qrFun(that.qrUrl) //调用二维码方法 | |
86 | + that.timer = setInterval(() => { | |
87 | + // 业务逻辑 | |
88 | + console.log('11') | |
89 | + that.qrFun(that.qrUrl) //调用二维码方法 | |
90 | + }, 300000) | |
91 | + console.log(that.qrUrl) | |
85 | 92 | }) |
86 | 93 | }, |
87 | 94 | //**生成二维码**// |
88 | - qrFun: function(text) { | |
95 | + qrFun: function (text) { | |
89 | 96 | this.qrShow = true |
90 | 97 | uQRCode.make({ |
91 | 98 | canvasId: 'qrcode', |
... | ... | @@ -97,85 +104,51 @@ export default { |
97 | 104 | foregroundColor: '#000000', |
98 | 105 | fileType: 'jpg', |
99 | 106 | errorCorrectLevel: uQRCode.errorCorrectLevel.H, |
100 | - success: res => {} | |
107 | + success: res => { | |
108 | + } | |
101 | 109 | }) |
110 | + }, | |
111 | + stopProvide: function () { | |
112 | + let that = this | |
113 | + // provideText:'停止自动发放' | |
114 | + if(that.provideText == '停止自动发放'){ | |
115 | + that.provideText = '开始自动发放' | |
116 | + clearInterval(that.timer) | |
117 | + that.timer = null; | |
118 | + }else{ | |
119 | + that.provideText = '停止自动发放' | |
120 | + that.qrFun(that.qrUrl) //调用二维码方法 | |
121 | + that.timer = setInterval(() => { | |
122 | + // 业务逻辑 | |
123 | + console.log('11') | |
124 | + that.qrFun(that.qrUrl) //调用二维码方法 | |
125 | + }, 300000) | |
126 | + } | |
127 | + }, | |
128 | + toPrintCard: function () { | |
129 | + uni.navigateTo({ | |
130 | + | |
131 | + url: '../businessCard/printCard?cardRelParkNo='+this.cardRelParkNo+ | |
132 | + '&cardTypeName='+ this.cardTypeName+ | |
133 | + '&cardRuleName='+this.cardRuleName+ | |
134 | + '&plName='+this.plName+ | |
135 | + '&price='+this.price+ | |
136 | + '&cardNum='+this.cardNum | |
137 | + }); | |
102 | 138 | } |
103 | 139 | } |
104 | 140 | } |
105 | 141 | </script> |
106 | 142 | |
107 | 143 | <style lang="scss" scoped> |
108 | - /deep/ .uni-section{ | |
144 | + /deep/ .uni-section { | |
109 | 145 | padding-bottom: 10px; |
110 | 146 | } |
111 | - .rechargeWrap{ | |
112 | - position: relative; | |
113 | - .rechargeArrow{ | |
114 | - position: absolute; | |
115 | - right: 10px; | |
116 | - top: 30px; | |
117 | - font-size: 20px; | |
118 | - color: #999; | |
119 | - } | |
120 | - } | |
121 | - .recordCon { | |
122 | - padding-right: 35px; | |
123 | - color: #999; | |
124 | - display: flex; | |
125 | - justify-content: space-between; | |
126 | - } | |
127 | 147 | |
128 | - .container { | |
129 | - overflow: hidden; | |
130 | - } | |
131 | 148 | |
132 | - .custom-cover { | |
133 | - flex: 1; | |
134 | - flex-direction: row; | |
135 | - position: relative; | |
136 | - } | |
137 | 149 | |
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 | 150 | |
153 | - .card-actions { | |
154 | - display: flex; | |
155 | - flex-direction: row; | |
156 | - justify-content: space-around; | |
157 | - align-items: center; | |
158 | - height: 45px; | |
159 | - border-top: 1px #eee solid; | |
160 | - } | |
161 | - .card-actions-item { | |
162 | - display: flex; | |
163 | - flex-direction: row; | |
164 | - align-items: center; | |
165 | - } | |
166 | - .card-actions-item-text { | |
167 | - font-size: 12px; | |
168 | - color: #666; | |
169 | - margin-left: 5px; | |
170 | - } | |
171 | - .cover-image { | |
172 | - flex: 1; | |
173 | - height: 150px; | |
174 | - } | |
175 | - .no-border { | |
176 | - border-width: 0; | |
177 | - } | |
178 | - .tip-wrap /deep/ .uni-noticebar{ | |
151 | + .tip-wrap /deep/ .uni-noticebar { | |
179 | 152 | margin-bottom: 0; |
180 | 153 | } |
181 | 154 | </style> | ... | ... |