Commit 75b91c089acad57cc87112e1b25cdddf0a8b9a90
1 parent
23fa4bab
卡券发放
Showing
5 changed files
with
101 additions
and
206 deletions
common/common.js
... | ... | @@ -31,12 +31,10 @@ const getPayOrderByOrderId = serverUrl + "/business/h5/order/getPayOrderByOrderI |
31 | 31 | |
32 | 32 | // 商户卡券-可以购买卡券列表-分页 |
33 | 33 | const couponRuleParkPage = serverUrl + "/business/h5/coupon/couponRuleParkPage"; |
34 | - | |
35 | - | |
36 | 34 | // 商户卡券-卡券申领明细 |
37 | 35 | const couponIssuedParkPage = serverUrl + "/business/h5/couponIssued/couponIssuedParkPage"; |
38 | - | |
39 | - | |
36 | +// 商户卡券-卡券发放-生成领券的动态码 | |
37 | +const getCouponDynamicQR = serverUrl + "/business/h5/couponsend/getCouponDynamicQR"; | |
40 | 38 | |
41 | 39 | //陈彪接口 |
42 | 40 | |
... | ... | @@ -216,7 +214,7 @@ export default { |
216 | 214 | getPayOrderByOrderId, |
217 | 215 | couponRuleParkPage, |
218 | 216 | couponIssuedParkPage, |
219 | - | |
217 | + getCouponDynamicQR, | |
220 | 218 | //陈彪接口 |
221 | 219 | rechargeList, |
222 | 220 | walletKindType, | ... | ... |
pages.json
... | ... | @@ -14,6 +14,19 @@ |
14 | 14 | "pages": [ |
15 | 15 | // pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages |
16 | 16 | { |
17 | + "path": "pages/businessCard/provideCard", | |
18 | + "style": { | |
19 | + "navigationBarTitleText": "商户卡券发放" | |
20 | + } | |
21 | + }, | |
22 | + { | |
23 | + "path": "pages/businessCard/businessCard", | |
24 | + "style": { | |
25 | + "navigationBarTitleText": "商户卡券" | |
26 | + } | |
27 | + }, | |
28 | + | |
29 | + { | |
17 | 30 | "path": "pages/businessCard/cardDetail", |
18 | 31 | "style": { |
19 | 32 | "navigationBarTitleText": "商户卡券明细", |
... | ... | @@ -64,24 +77,14 @@ |
64 | 77 | } |
65 | 78 | }, |
66 | 79 | |
67 | - { | |
68 | - "path": "pages/businessCard/provideCard", | |
69 | - "style": { | |
70 | - "navigationBarTitleText": "商户卡券发放" | |
71 | - } | |
72 | - }, | |
80 | + | |
73 | 81 | { |
74 | 82 | "path": "pages/businessCard/buyCard", |
75 | 83 | "style": { |
76 | 84 | "navigationBarTitleText": "商户卡券购买" |
77 | 85 | } |
78 | 86 | }, |
79 | - { | |
80 | - "path": "pages/businessCard/businessCard", | |
81 | - "style": { | |
82 | - "navigationBarTitleText": "商户卡券" | |
83 | - } | |
84 | - }, | |
87 | + | |
85 | 88 | |
86 | 89 | { |
87 | 90 | "path": "pages/parkRecordList/recordDetail", | ... | ... |
pages/businessCard/businessCard.vue
... | ... | @@ -18,11 +18,11 @@ |
18 | 18 | <uni-icons type="cart-filled" size="18" color="#999"></uni-icons> |
19 | 19 | <text class="card-actions-item-text">购买</text> |
20 | 20 | </view> |
21 | - <view class="card-actions-item" @click="actionsClick('发放')" v-if="i.cardNum>0"> | |
21 | + <view class="card-actions-item" @click="provideCard(i)" v-show="i.cardNum>0"> | |
22 | 22 | <uni-icons type="redo-filled" size="18" color="#999"></uni-icons> |
23 | 23 | <text class="card-actions-item-text">发放</text> |
24 | 24 | </view> |
25 | - <view class="card-actions-item" @click="actionsClick('打印')" v-if="i.cardNum>0"> | |
25 | + <view class="card-actions-item" @click="printClick(i)" v-show="i.cardNum>0"> | |
26 | 26 | <uni-icons type="shop-filled" size="18" color="#999"></uni-icons> |
27 | 27 | <text class="card-actions-item-text">打印</text> |
28 | 28 | </view> |
... | ... | @@ -88,6 +88,17 @@ export default { |
88 | 88 | url: '../businessCard/buyCard?optionData='+JSON.stringify(i) |
89 | 89 | }); |
90 | 90 | }, |
91 | + printClick(i){ | |
92 | + uni.navigateTo({ | |
93 | + url: '../businessCard/cardPrint?optionData='+JSON.stringify(i) | |
94 | + }); | |
95 | + }, | |
96 | + provideCard(i){ | |
97 | + uni.navigateTo({ | |
98 | + url: '../businessCard/provideCard?optionData='+JSON.stringify(i) | |
99 | + }); | |
100 | + } | |
101 | + | |
91 | 102 | } |
92 | 103 | } |
93 | 104 | </script> | ... | ... |
pages/businessCard/cardPrint.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> |
... | ... | @@ -14,11 +14,10 @@ |
14 | 14 | |
15 | 15 | <view class="paddinglr30 bg-white" style="margin-top: 10px;padding-top: 10px;padding-bottom: 10px;"> |
16 | 16 | <text style="float: left;margin-right: 15px;line-height: 29px;">打印张数:</text> |
17 | - <uni-number-box @change="changeValue" /> | |
17 | + <uni-number-box @change="changeValue" min="1" :max="maxNum"/> | |
18 | 18 | </view> |
19 | 19 | |
20 | 20 | |
21 | - | |
22 | 21 | <view class="uni-padding-wrap uni-common-mt"> |
23 | 22 | <!--<button type="primary" style="margin-bottom: 15px">停止自动发放</button>--> |
24 | 23 | <button type="warn">立即打印</button> |
... | ... | @@ -29,127 +28,64 @@ |
29 | 28 | </template> |
30 | 29 | |
31 | 30 | <script> |
32 | -import common from "../../common/common.js"; | |
33 | 31 | export default { |
34 | 32 | data() { |
35 | - const currentDate = this.getDate({ | |
36 | - format: true | |
37 | - }) | |
33 | + | |
38 | 34 | return { |
39 | - numberValue: 0, | |
40 | - title: 'picker', | |
41 | - array: ['全部', '充值', '支付'], | |
42 | - arrayWay: ['所有方式', '微信', '线下公对公'], | |
43 | - index: 0, | |
44 | - indexWay: 0, | |
45 | - benginDate: currentDate, | |
46 | - overDate: currentDate, | |
47 | - rows:[], | |
48 | - pageNum:1,//当前页 | |
49 | - pageSize:1,//每页条数 | |
50 | - reload:false, | |
51 | - status:'more', | |
52 | - contentText:{ | |
53 | - contentdown:'上拉加载更多~', | |
54 | - contentrefresh:'正在加载更多~', | |
55 | - contentmore:'我是有底线的~' | |
56 | - }, | |
57 | - iconType:'auto', // 图标样式 | |
35 | + numberValue: 0,// 选择打印张数 | |
36 | + | |
37 | + cardTypeName: '',// 卡类型名称 | |
38 | + cardRuleName: '',// 卡名称 | |
39 | + plName:'', // 停车场 | |
40 | + price:'', // 卡价格 | |
41 | + cardNum:'', // 库存 | |
42 | + maxNum:'', // 最多可打印 | |
43 | + | |
58 | 44 | } |
59 | 45 | }, |
60 | 46 | onLoad(params) { |
61 | 47 | wx.showShareMenu({ |
62 | 48 | withShareTicket: true |
63 | 49 | }) |
64 | - // this.mycarNumber = params.carNumber; | |
65 | - // this.myorderId = params.orderId; | |
66 | - // this.myparkCode = params.parkCode; | |
67 | - // this.myorderState = params.orderState; | |
68 | - // this.totalFee = params.totalFee | |
69 | - // this.unPayFee = params.unPayFee | |
70 | - // if (params.orderState == 5) { | |
71 | - // //停车补缴单 103 | |
72 | - // this.mypaySrcType = '103' | |
73 | - // } else { | |
74 | - // this.mypaySrcType = '101' | |
75 | - // } | |
76 | - // // this.GetbillQueryInfo(this.mycarNumber, this.myorderId, this.myparkCode); | |
77 | - // this.getWxCode(); | |
78 | - // this.PDlogin(); | |
79 | - //console.log("xxxmake = "+this.makedateFormat()); | |
50 | + let option = JSON.parse(params.optionData) | |
51 | + console.log(option) | |
52 | + this.cardTypeName = option.cardTypeName | |
53 | + this.cardRuleName = option.cardRuleName | |
54 | + this.plName = option.plName | |
55 | + this.price = option.value | |
56 | + this.cardNum = option.cardNum | |
57 | + this.maxNum = option.cardNum | |
80 | 58 | }, |
81 | 59 | onShow() { |
82 | 60 | var me = this; |
83 | - var userInfo = me.getGlobalUser("globalUser"); | |
84 | - if (userInfo != null) { | |
85 | - me.phoneNumb = userInfo.userPhone; | |
86 | - } | |
87 | - var pages = getCurrentPages(); | |
88 | - var currPage = pages[pages.length - 1]; //当前页面 | |
89 | - console.log('currPage.data.selCoupon = ' + currPage.data.selCoupon); | |
90 | - me.selCoupon = currPage.data.selCoupon; | |
91 | - console.log(JSON.stringify(me.selCoupon)); | |
92 | - // me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType, me.selCoupon | |
93 | - // .discValue); | |
94 | 61 | // GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) { |
95 | 62 | }, |
96 | 63 | computed: { |
97 | - startDate() { | |
98 | - return this.getDate('start'); | |
99 | - }, | |
100 | - endDate() { | |
101 | - return this.getDate('end'); | |
102 | - } | |
64 | + | |
103 | 65 | }, |
104 | 66 | methods: { |
105 | - change(value) { | |
67 | + changeValue(value) { | |
106 | 68 | this.numberValue = value |
107 | 69 | }, |
108 | - actionsClick(text){ | |
70 | + actionsClick(text) { | |
109 | 71 | uni.showToast({ |
110 | - title:text, | |
111 | - icon:'none' | |
72 | + title: text, | |
73 | + icon: 'none' | |
112 | 74 | }) |
113 | 75 | }, |
114 | - bindPickerChange: function (e) { | |
115 | - console.log('picker发送选择改变,携带值为', e.detail.value) | |
116 | - this.index = e.detail.value | |
117 | - }, | |
118 | - bindPickerChangeWay: function (e) { | |
119 | - console.log('picker发送选择改变,携带值为', e.detail.value) | |
120 | - this.indexWay = e.detail.value | |
121 | - }, | |
122 | - bindStartDateChange: function (e) { | |
123 | - this.benginDate = e.detail.value | |
124 | - }, | |
125 | - bindEndDateChange: function (e) { | |
126 | - this.overDate = e.detail.value | |
127 | - }, | |
128 | - getDate(type) { | |
129 | - const date = new Date(); | |
130 | - let year = date.getFullYear(); | |
131 | - let month = date.getMonth() + 1; | |
132 | - let day = date.getDate(); | |
133 | - if (type === 'start') { | |
134 | - year = year - 60; | |
135 | - } else if (type === 'end') { | |
136 | - year = year + 2; | |
137 | - } | |
138 | - month = month > 9 ? month : '0' + month; | |
139 | - day = day > 9 ? day : '0' + day; | |
140 | - return `${year}-${month}-${day}`; | |
141 | - }, | |
76 | + | |
142 | 77 | } |
143 | 78 | } |
144 | 79 | </script> |
145 | 80 | |
146 | 81 | <style lang="scss" scoped> |
147 | - /deep/ .uni-section{ | |
82 | + /deep/ .uni-section { | |
148 | 83 | padding-bottom: 10px; |
149 | 84 | } |
150 | - .rechargeWrap{ | |
85 | + | |
86 | + .rechargeWrap { | |
151 | 87 | position: relative; |
152 | - .rechargeArrow{ | |
88 | + .rechargeArrow { | |
153 | 89 | position: absolute; |
154 | 90 | right: 10px; |
155 | 91 | top: 30px; |
... | ... | @@ -157,6 +93,7 @@ export default { |
157 | 93 | color: #999; |
158 | 94 | } |
159 | 95 | } |
96 | + | |
160 | 97 | .recordCon { |
161 | 98 | padding-right: 35px; |
162 | 99 | color: #999; |
... | ... | @@ -197,20 +134,24 @@ export default { |
197 | 134 | height: 45px; |
198 | 135 | border-top: 1px #eee solid; |
199 | 136 | } |
137 | + | |
200 | 138 | .card-actions-item { |
201 | 139 | display: flex; |
202 | 140 | flex-direction: row; |
203 | 141 | align-items: center; |
204 | 142 | } |
143 | + | |
205 | 144 | .card-actions-item-text { |
206 | 145 | font-size: 12px; |
207 | 146 | color: #666; |
208 | 147 | margin-left: 5px; |
209 | 148 | } |
149 | + | |
210 | 150 | .cover-image { |
211 | 151 | flex: 1; |
212 | 152 | height: 150px; |
213 | 153 | } |
154 | + | |
214 | 155 | .no-border { |
215 | 156 | border-width: 0; |
216 | 157 | } | ... | ... |
pages/businessCard/provideCard.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> |
... | ... | @@ -32,111 +32,53 @@ |
32 | 32 | </template> |
33 | 33 | |
34 | 34 | <script> |
35 | -import common from "../../common/common.js"; | |
36 | 35 | export default { |
37 | 36 | data() { |
38 | - const currentDate = this.getDate({ | |
39 | - format: true | |
40 | - }) | |
41 | 37 | return { |
42 | - title: 'picker', | |
43 | - array: ['全部', '充值', '支付'], | |
44 | - arrayWay: ['所有方式', '微信', '线下公对公'], | |
45 | - index: 0, | |
46 | - indexWay: 0, | |
47 | - benginDate: currentDate, | |
48 | - overDate: currentDate, | |
49 | - rows:[], | |
50 | - pageNum:1,//当前页 | |
51 | - pageSize:1,//每页条数 | |
52 | - reload:false, | |
53 | - status:'more', | |
54 | - contentText:{ | |
55 | - contentdown:'上拉加载更多~', | |
56 | - contentrefresh:'正在加载更多~', | |
57 | - contentmore:'我是有底线的~' | |
58 | - }, | |
59 | - iconType:'auto', // 图标样式 | |
38 | + | |
39 | + cardTypeName: '',// 卡类型名称 | |
40 | + cardRuleName: '',// 卡名称 | |
41 | + plName:'', // 停车场 | |
42 | + price:'', // 卡价格 | |
43 | + cardNum:'', // 库存 | |
60 | 44 | } |
61 | 45 | }, |
62 | 46 | onLoad(params) { |
63 | 47 | wx.showShareMenu({ |
64 | 48 | withShareTicket: true |
65 | 49 | }) |
66 | - // this.mycarNumber = params.carNumber; | |
67 | - // this.myorderId = params.orderId; | |
68 | - // this.myparkCode = params.parkCode; | |
69 | - // this.myorderState = params.orderState; | |
70 | - // this.totalFee = params.totalFee | |
71 | - // this.unPayFee = params.unPayFee | |
72 | - // if (params.orderState == 5) { | |
73 | - // //停车补缴单 103 | |
74 | - // this.mypaySrcType = '103' | |
75 | - // } else { | |
76 | - // this.mypaySrcType = '101' | |
77 | - // } | |
78 | - // // this.GetbillQueryInfo(this.mycarNumber, this.myorderId, this.myparkCode); | |
79 | - // this.getWxCode(); | |
80 | - // this.PDlogin(); | |
81 | - //console.log("xxxmake = "+this.makedateFormat()); | |
50 | + let option = JSON.parse(params.optionData) | |
51 | + console.log(option) | |
52 | + this.cardTypeName = option.cardTypeName | |
53 | + this.cardRuleName = option.cardRuleName | |
54 | + this.plName = option.plName | |
55 | + this.price = option.value | |
56 | + this.cardNum = option.cardNum | |
57 | + // this.maxNum = option.cardNum | |
58 | + this.getCouponDynamicQR() | |
82 | 59 | }, |
83 | 60 | onShow() { |
84 | 61 | var me = this; |
85 | - var userInfo = me.getGlobalUser("globalUser"); | |
86 | - if (userInfo != null) { | |
87 | - me.phoneNumb = userInfo.userPhone; | |
88 | - } | |
89 | - var pages = getCurrentPages(); | |
90 | - var currPage = pages[pages.length - 1]; //当前页面 | |
91 | - console.log('currPage.data.selCoupon = ' + currPage.data.selCoupon); | |
92 | - me.selCoupon = currPage.data.selCoupon; | |
93 | - console.log(JSON.stringify(me.selCoupon)); | |
94 | - // me.GetbillQueryInfo(me.mycarNumber, me.myorderId, me.myparkCode, me.selCoupon.cardNo, me.selCoupon.couponType, me.selCoupon | |
95 | - // .discValue); | |
96 | - // GetbillQueryInfo(carnum, orderId, parkCode, cardNo, couponType, disValue) { | |
62 | + | |
97 | 63 | }, |
98 | 64 | computed: { |
99 | - startDate() { | |
100 | - return this.getDate('start'); | |
101 | - }, | |
102 | - endDate() { | |
103 | - return this.getDate('end'); | |
104 | - } | |
65 | + | |
105 | 66 | }, |
106 | 67 | methods: { |
107 | - actionsClick(text){ | |
108 | - uni.showToast({ | |
109 | - title:text, | |
110 | - icon:'none' | |
111 | - }) | |
112 | - }, | |
113 | - bindPickerChange: function (e) { | |
114 | - console.log('picker发送选择改变,携带值为', e.detail.value) | |
115 | - this.index = e.detail.value | |
116 | - }, | |
117 | - bindPickerChangeWay: function (e) { | |
118 | - console.log('picker发送选择改变,携带值为', e.detail.value) | |
119 | - this.indexWay = e.detail.value | |
120 | - }, | |
121 | - bindStartDateChange: function (e) { | |
122 | - this.benginDate = e.detail.value | |
123 | - }, | |
124 | - bindEndDateChange: function (e) { | |
125 | - this.overDate = e.detail.value | |
126 | - }, | |
127 | - getDate(type) { | |
128 | - const date = new Date(); | |
129 | - let year = date.getFullYear(); | |
130 | - let month = date.getMonth() + 1; | |
131 | - let day = date.getDate(); | |
132 | - if (type === 'start') { | |
133 | - year = year - 60; | |
134 | - } else if (type === 'end') { | |
135 | - year = year + 2; | |
68 | + getCouponDynamicQR() { | |
69 | + let that = this | |
70 | + let paramsData = { | |
71 | + cardRelParkNo: '123qwe', | |
72 | + codeType: '2' | |
136 | 73 | } |
137 | - month = month > 9 ? month : '0' + month; | |
138 | - day = day > 9 ? day : '0' + day; | |
139 | - return `${year}-${month}-${day}`; | |
74 | + // 首页信息获取 接口 | |
75 | + that.$myRequest({ | |
76 | + url: that.$common.getCouponDynamicQR, | |
77 | + method: 'POST', | |
78 | + data: that.$common.requestSign(paramsData) | |
79 | + }).then(res => { | |
80 | + console.log(res) | |
81 | + }) | |
140 | 82 | }, |
141 | 83 | } |
142 | 84 | } | ... | ... |