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,6 +35,19 @@ const couponRuleParkPage = serverUrl + "/business/h5/coupon/couponRuleParkPage"; | ||
| 35 | const couponIssuedParkPage = serverUrl + "/business/h5/couponIssued/couponIssuedParkPage"; | 35 | const couponIssuedParkPage = serverUrl + "/business/h5/couponIssued/couponIssuedParkPage"; |
| 36 | // 商户卡券-卡券发放-生成领券的动态码 | 36 | // 商户卡券-卡券发放-生成领券的动态码 |
| 37 | const getCouponDynamicQR = serverUrl + "/business/h5/couponsend/getCouponDynamicQR"; | 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,6 +232,12 @@ export default { | ||
| 219 | couponRuleParkPage, | 232 | couponRuleParkPage, |
| 220 | couponIssuedParkPage, | 233 | couponIssuedParkPage, |
| 221 | getCouponDynamicQR, | 234 | getCouponDynamicQR, |
| 235 | + getCouponStaticQR, | ||
| 236 | + couponDetailSummary, | ||
| 237 | + createCouponOrder, | ||
| 238 | + accountPay, | ||
| 239 | + | ||
| 240 | + | ||
| 222 | //陈彪接口 | 241 | //陈彪接口 |
| 223 | rechargeList, | 242 | rechargeList, |
| 224 | walletKindType, | 243 | walletKindType, |
common/requestServer.js
| @@ -52,7 +52,7 @@ export const myRequest = (options) => { | @@ -52,7 +52,7 @@ export const myRequest = (options) => { | ||
| 52 | uni.hideLoading(); | 52 | uni.hideLoading(); |
| 53 | uni.showToast({ | 53 | uni.showToast({ |
| 54 | title: result.message, | 54 | title: result.message, |
| 55 | - icon: 'error', | 55 | + icon: 'none', |
| 56 | duration: 2000 | 56 | duration: 2000 |
| 57 | }); | 57 | }); |
| 58 | } | 58 | } |
| @@ -65,7 +65,7 @@ export const myRequest = (options) => { | @@ -65,7 +65,7 @@ export const myRequest = (options) => { | ||
| 65 | console.log("请求失败", error); | 65 | console.log("请求失败", error); |
| 66 | uni.showToast({ | 66 | uni.showToast({ |
| 67 | title: error.message, | 67 | title: error.message, |
| 68 | - icon: 'error', | 68 | + icon: 'none', |
| 69 | duration: 2000 | 69 | duration: 2000 |
| 70 | }) | 70 | }) |
| 71 | // 失败数据 | 71 | // 失败数据 |
pages.json
| @@ -21,9 +21,10 @@ | @@ -21,9 +21,10 @@ | ||
| 21 | } | 21 | } |
| 22 | }, | 22 | }, |
| 23 | { | 23 | { |
| 24 | - "path": "pages/businessCard/provideCard", | 24 | + "path": "pages/businessCard/cardDetail", |
| 25 | "style": { | 25 | "style": { |
| 26 | - "navigationBarTitleText": "商户卡券发放" | 26 | + "navigationBarTitleText": "商户卡券明细", |
| 27 | + "enablePullDownRefresh": true | ||
| 27 | } | 28 | } |
| 28 | }, | 29 | }, |
| 29 | { | 30 | { |
| @@ -33,13 +34,34 @@ | @@ -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 | "style": { | 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 | "path": "pages/rechargeDetail/rechargeDetail", | 66 | "path": "pages/rechargeDetail/rechargeDetail", |
| 45 | "style": { | 67 | "style": { |
| @@ -71,20 +93,9 @@ | @@ -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,7 +9,7 @@ | ||
| 9 | <uni-list-item title="适应车场" :rightText="i.plName"> | 9 | <uni-list-item title="适应车场" :rightText="i.plName"> |
| 10 | <text></text> | 10 | <text></text> |
| 11 | </uni-list-item> | 11 | </uni-list-item> |
| 12 | - <uni-list-item :title="`价格: ¥${i.value}/张`" | 12 | + <uni-list-item :title="`价格: ¥${$common.moneyFormat(i.value)}/张`" |
| 13 | :rightText="`商户库存:${i.cardNum}张`"></uni-list-item> | 13 | :rightText="`商户库存:${i.cardNum}张`"></uni-list-item> |
| 14 | </uni-list> | 14 | </uni-list> |
| 15 | <view slot="actions" class="card-actions no-border"> | 15 | <view slot="actions" class="card-actions no-border"> |
| @@ -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,26 +96,36 @@ export default { | @@ -79,26 +96,36 @@ 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) { |
| 87 | uni.navigateTo({ | 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 | uni.navigateTo({ | 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 | uni.navigateTo({ | 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 | </script> | 131 | </script> |
| @@ -108,48 +135,7 @@ export default { | @@ -108,48 +135,7 @@ export default { | ||
| 108 | padding-bottom: 10px; | 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 | .card-actions { | 140 | .card-actions { |
| 155 | display: flex; | 141 | display: flex; |
pages/businessCard/buyCard.vue
| 1 | <template> | 1 | <template> |
| 2 | <view> | 2 | <view> |
| 3 | 3 | ||
| 4 | - <uni-section title="2小时(时长券)" type="line" > | 4 | + <uni-section :title="`${cardRuleName}(${cardTypeName})`" type="line"> |
| 5 | <uni-card padding="0" spacing="0"> | 5 | <uni-card padding="0" spacing="0"> |
| 6 | <uni-list> | 6 | <uni-list> |
| 7 | - <uni-list-item title="适应车场" rightText="万达商业广场" > | 7 | + <uni-list-item title="适应车场" :rightText="plName"> |
| 8 | <text></text> | 8 | <text></text> |
| 9 | </uni-list-item> | 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 | </uni-list> | 11 | </uni-list> |
| 12 | - | ||
| 13 | </uni-card> | 12 | </uni-card> |
| 14 | </uni-section> | 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 | <template v-slot:footer> | 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 | </template> | 21 | </template> |
| 23 | </uni-list-item> | 22 | </uni-list-item> |
| 24 | - <uni-list-item title="应付金额" > | 23 | + <uni-list-item title="应付金额"> |
| 25 | <template v-slot:footer> | 24 | <template v-slot:footer> |
| 26 | - <text style="color: red">¥25.00元</text> | 25 | + <text style="color: red">¥{{ $common.moneyFormat(needPay)}}元</text> |
| 27 | </template> | 26 | </template> |
| 28 | </uni-list-item> | 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 | <template v-slot:header> | 30 | <template v-slot:header> |
| 32 | <text style="color: red">温馨提示</text> | 31 | <text style="color: red">温馨提示</text> |
| 33 | </template> | 32 | </template> |
| @@ -35,68 +34,69 @@ | @@ -35,68 +34,69 @@ | ||
| 35 | </uni-list> | 34 | </uni-list> |
| 36 | 35 | ||
| 37 | <view class="uni-padding-wrap uni-common-mt"> | 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 | </view> | 38 | </view> |
| 40 | 39 | ||
| 41 | <view> | 40 | <view> |
| 42 | <!-- 提示窗示例 --> | 41 | <!-- 提示窗示例 --> |
| 43 | <uni-popup ref="alertDialog" type="dialog"> | 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 | @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> | ||
| 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 | </view> | 102 | </view> |
| @@ -109,16 +109,10 @@ export default { | @@ -109,16 +109,10 @@ export default { | ||
| 109 | format: true | 109 | format: true |
| 110 | }) | 110 | }) |
| 111 | return { | 111 | return { |
| 112 | - vModelValue: 3, | ||
| 113 | - title: 'picker', | ||
| 114 | - array: ['全部', '充值', '支付'], | ||
| 115 | - arrayWay: ['所有方式', '微信', '线下公对公'], | ||
| 116 | - index: 0, | ||
| 117 | - indexWay: 0, | 112 | + vModelValue: 1, |
| 118 | benginDate: currentDate, | 113 | benginDate: currentDate, |
| 119 | overDate: currentDate, | 114 | overDate: currentDate, |
| 120 | - | ||
| 121 | - iconType:'auto', // 图标样式 | 115 | + iconType: 'auto', // 图标样式 |
| 122 | datetimesingle: '', | 116 | datetimesingle: '', |
| 123 | // 基础表单数据 | 117 | // 基础表单数据 |
| 124 | baseFormData: { | 118 | baseFormData: { |
| @@ -134,23 +128,38 @@ export default { | @@ -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 | onLoad(params) { | 140 | onLoad(params) { |
| 140 | wx.showShareMenu({ | 141 | wx.showShareMenu({ |
| 141 | withShareTicket: true | 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 | onShow() { | 155 | onShow() { |
| 146 | var me = this; | 156 | var me = this; |
| 147 | - | ||
| 148 | }, | 157 | }, |
| 149 | mounted() { | 158 | mounted() { |
| 150 | setTimeout(() => { | 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 | computed: { | 164 | computed: { |
| 156 | startDate() { | 165 | startDate() { |
| @@ -161,6 +170,48 @@ export default { | @@ -161,6 +170,48 @@ export default { | ||
| 161 | } | 170 | } |
| 162 | }, | 171 | }, |
| 163 | methods: { | 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 | changeLog(e) { | 215 | changeLog(e) { |
| 165 | console.log('change事件:', e); | 216 | console.log('change事件:', e); |
| 166 | }, | 217 | }, |
| @@ -169,15 +220,15 @@ export default { | @@ -169,15 +220,15 @@ export default { | ||
| 169 | }, | 220 | }, |
| 170 | dialogConfirm() { | 221 | dialogConfirm() { |
| 171 | console.log('点击确认') | 222 | console.log('点击确认') |
| 172 | - this.messageText = `点击确认了 ${this.msgType} 窗口` | ||
| 173 | - this.$refs.message.open() | 223 | + this.tobuy() |
| 174 | }, | 224 | }, |
| 175 | dialogToggle(type) { | 225 | dialogToggle(type) { |
| 176 | - this.msgType = type | ||
| 177 | this.$refs.alertDialog.open() | 226 | this.$refs.alertDialog.open() |
| 178 | }, | 227 | }, |
| 179 | changeValue(value) { | 228 | changeValue(value) { |
| 180 | console.log('返回数值:', value); | 229 | console.log('返回数值:', value); |
| 230 | + this.vModelValue = value | ||
| 231 | + this.needPay = this.price * this.vModelValue | ||
| 181 | }, | 232 | }, |
| 182 | blur(e) { | 233 | blur(e) { |
| 183 | console.log('blur:', e); | 234 | console.log('blur:', e); |
| @@ -185,10 +236,10 @@ export default { | @@ -185,10 +236,10 @@ export default { | ||
| 185 | focus(e) { | 236 | focus(e) { |
| 186 | console.log('focus:', e); | 237 | console.log('focus:', e); |
| 187 | }, | 238 | }, |
| 188 | - actionsClick(text){ | 239 | + actionsClick(text) { |
| 189 | uni.showToast({ | 240 | uni.showToast({ |
| 190 | - title:text, | ||
| 191 | - icon:'none' | 241 | + title: text, |
| 242 | + icon: 'none' | ||
| 192 | }) | 243 | }) |
| 193 | }, | 244 | }, |
| 194 | bindPickerChange: function (e) { | 245 | bindPickerChange: function (e) { |
| @@ -229,11 +280,11 @@ export default { | @@ -229,11 +280,11 @@ export default { | ||
| 229 | background-color: #fff; | 280 | background-color: #fff; |
| 230 | } | 281 | } |
| 231 | 282 | ||
| 232 | - /deep/ .uni-section{ | 283 | + /deep/ .uni-section { |
| 233 | padding-bottom: 10px; | 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 | </style> | 290 | </style> |
pages/businessCard/cardDetail.vue
| 1 | <template> | 1 | <template> |
| 2 | <view> | 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 | <view class="uni-list"> | 8 | <view class="uni-list"> |
| @@ -77,7 +79,8 @@ | @@ -77,7 +79,8 @@ | ||
| 77 | <view class="uni-flex uni-space-between" style="padding: 10px 0"> | 79 | <view class="uni-flex uni-space-between" style="padding: 10px 0"> |
| 78 | <view> | 80 | <view> |
| 79 | <text class="color-blue paddingRight">领取时间</text> | 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 | </view> | 84 | </view> |
| 82 | <view class="color-green" v-if="i.isUesed=='1'"> | 85 | <view class="color-green" v-if="i.isUesed=='1'"> |
| 83 | 已使用 | 86 | 已使用 |
| @@ -89,8 +92,10 @@ | @@ -89,8 +92,10 @@ | ||
| 89 | <view class="uni-flex uni-space-between"> | 92 | <view class="uni-flex uni-space-between"> |
| 90 | <view> | 93 | <view> |
| 91 | <text class="color-red paddingRight">使用时间</text> | 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 | </view> | 99 | </view> |
| 95 | <view class="color-green"> | 100 | <view class="color-green"> |
| 96 | {{i.fullCutValue}}元/张 | 101 | {{i.fullCutValue}}元/张 |
| @@ -102,123 +107,120 @@ | @@ -102,123 +107,120 @@ | ||
| 102 | </uni-list> | 107 | </uni-list> |
| 103 | </uni-section> | 108 | </uni-section> |
| 104 | </view> | 109 | </view> |
| 105 | - <uni-load-more :status="status" /> | 110 | + <!--<uni-load-more :status="status"/>--> |
| 106 | </view> | 111 | </view> |
| 107 | - | ||
| 108 | - | ||
| 109 | - | ||
| 110 | - | 112 | + <uni-load-more :status="status"/> |
| 111 | 113 | ||
| 112 | <!--<uni-section title="8折(折扣券)" type="line">--> | 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 | <!--</uni-section>--> | 149 | <!--</uni-section>--> |
| 148 | 150 | ||
| 149 | 151 | ||
| 150 | <!--<uni-section title="8折(折扣券)" type="line">--> | 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 | <!--</uni-section>--> | 187 | <!--</uni-section>--> |
| 186 | 188 | ||
| 187 | <!--<uni-section title="8折(折扣券)" type="line">--> | 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 | <!--</uni-section>--> | 224 | <!--</uni-section>--> |
| 223 | </view> | 225 | </view> |
| 224 | </template> | 226 | </template> |
| @@ -250,11 +252,12 @@ export default { | @@ -250,11 +252,12 @@ export default { | ||
| 250 | endTime: currentDate, | 252 | endTime: currentDate, |
| 251 | pageNum: '1',//当前页 | 253 | pageNum: '1',//当前页 |
| 252 | pageSize: '10',//每页条数 | 254 | pageSize: '10',//每页条数 |
| 253 | - totalPages:'1', // 总条数 | ||
| 254 | - // isLoadAll: false, | ||
| 255 | - // reload: false, | 255 | + totalPages: '1', // 总条数 |
| 256 | status: 'no-more', | 256 | status: 'no-more', |
| 257 | dataList: [], | 257 | dataList: [], |
| 258 | + issuedCount: 0,// 被领取张数 | ||
| 259 | + usedCount: 0,// 使用张数 | ||
| 260 | + totalFee: 0, // 金额 | ||
| 258 | } | 261 | } |
| 259 | }, | 262 | }, |
| 260 | onLoad(params) { | 263 | onLoad(params) { |
| @@ -262,6 +265,7 @@ export default { | @@ -262,6 +265,7 @@ export default { | ||
| 262 | withShareTicket: true | 265 | withShareTicket: true |
| 263 | }) | 266 | }) |
| 264 | this.fetchData() | 267 | this.fetchData() |
| 268 | + this.couponDetailSummary() | ||
| 265 | }, | 269 | }, |
| 266 | onShow() { | 270 | onShow() { |
| 267 | var me = this; | 271 | var me = this; |
| @@ -282,14 +286,11 @@ export default { | @@ -282,14 +286,11 @@ export default { | ||
| 282 | console.log(this.dataList.length) | 286 | console.log(this.dataList.length) |
| 283 | if (this.totalPages == this.dataList.length) { | 287 | if (this.totalPages == this.dataList.length) { |
| 284 | this.status = 'no-more' | 288 | this.status = 'no-more' |
| 285 | - console.log('111') | ||
| 286 | return | 289 | return |
| 287 | } else { | 290 | } else { |
| 288 | this.pageNum++; | 291 | this.pageNum++; |
| 289 | this.fetchData() | 292 | this.fetchData() |
| 290 | } | 293 | } |
| 291 | - | ||
| 292 | - | ||
| 293 | }, | 294 | }, |
| 294 | computed: { | 295 | computed: { |
| 295 | startDate() { | 296 | startDate() { |
| @@ -301,15 +302,13 @@ export default { | @@ -301,15 +302,13 @@ export default { | ||
| 301 | }, | 302 | }, |
| 302 | methods: { | 303 | methods: { |
| 303 | fetchData: function () { | 304 | fetchData: function () { |
| 304 | - | ||
| 305 | - | ||
| 306 | let that = this | 305 | let that = this |
| 307 | that.status = 'loading' | 306 | that.status = 'loading' |
| 308 | let paramsData = { | 307 | let paramsData = { |
| 309 | pageNum: this.pageNum, | 308 | pageNum: this.pageNum, |
| 310 | pageSize: this.pageSize, | 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 | cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 | 312 | cardType: this.cardType.toString(), //卡券类型 :1-单次券,2-时长券,3-满减券,4-金额券,5-包天券 |
| 314 | isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用 | 313 | isUesed: this.isUesed.toString(), //1:已使用/绑定 0:未使用 |
| 315 | } | 314 | } |
| @@ -320,16 +319,43 @@ export default { | @@ -320,16 +319,43 @@ export default { | ||
| 320 | data: that.$common.requestSign(paramsData) | 319 | data: that.$common.requestSign(paramsData) |
| 321 | }).then(res => { | 320 | }).then(res => { |
| 322 | // const resDataArray = that.dataList.concat(res.data.dataList); | 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 | }else{ | 329 | }else{ |
| 326 | - this.status = 'more' | 330 | + that.status = 'no-more' |
| 327 | } | 331 | } |
| 332 | + | ||
| 328 | that.totalPages = res.data.pageTotals; | 333 | that.totalPages = res.data.pageTotals; |
| 329 | that.dataList = that.dataList.concat(res.data.dataList) | 334 | that.dataList = that.dataList.concat(res.data.dataList) |
| 330 | console.log(that.dataList.length) | 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 | bindPickerChange: function (e, storage) { | 359 | bindPickerChange: function (e, storage) { |
| 334 | console.log('picker发送选择改变,携带值为', e.detail.value) | 360 | console.log('picker发送选择改变,携带值为', e.detail.value) |
| 335 | this.index = e.detail.value | 361 | this.index = e.detail.value |
| @@ -338,7 +364,8 @@ export default { | @@ -338,7 +364,8 @@ export default { | ||
| 338 | this.pageSize = this.pageSize | 364 | this.pageSize = this.pageSize |
| 339 | this.totalPages = 1 | 365 | this.totalPages = 1 |
| 340 | this.dataList = [] | 366 | this.dataList = [] |
| 341 | - this.couponIssuedParkPage() | 367 | + this.fetchData() |
| 368 | + this.couponDetailSummary() | ||
| 342 | }, | 369 | }, |
| 343 | bindPickerChangeWay: function (e, storage) { | 370 | bindPickerChangeWay: function (e, storage) { |
| 344 | console.log(storage) | 371 | console.log(storage) |
| @@ -348,7 +375,8 @@ export default { | @@ -348,7 +375,8 @@ export default { | ||
| 348 | this.pageSize = this.pageSize | 375 | this.pageSize = this.pageSize |
| 349 | this.totalPages = 1 | 376 | this.totalPages = 1 |
| 350 | this.dataList = [] | 377 | this.dataList = [] |
| 351 | - this.couponIssuedParkPage() | 378 | + this.fetchData() |
| 379 | + this.couponDetailSummary() | ||
| 352 | }, | 380 | }, |
| 353 | bindStartDateChange: function (e) { | 381 | bindStartDateChange: function (e) { |
| 354 | console.log(e.detail.value) | 382 | console.log(e.detail.value) |
| @@ -357,7 +385,8 @@ export default { | @@ -357,7 +385,8 @@ export default { | ||
| 357 | this.pageSize = this.pageSize | 385 | this.pageSize = this.pageSize |
| 358 | this.totalPages = 1 | 386 | this.totalPages = 1 |
| 359 | this.dataList = [] | 387 | this.dataList = [] |
| 360 | - this.couponIssuedParkPage() | 388 | + this.fetchData() |
| 389 | + this.couponDetailSummary() | ||
| 361 | }, | 390 | }, |
| 362 | bindEndDateChange: function (e) { | 391 | bindEndDateChange: function (e) { |
| 363 | this.endTime = e.detail.value | 392 | this.endTime = e.detail.value |
| @@ -365,7 +394,8 @@ export default { | @@ -365,7 +394,8 @@ export default { | ||
| 365 | this.pageSize = this.pageSize | 394 | this.pageSize = this.pageSize |
| 366 | this.totalPages = 1 | 395 | this.totalPages = 1 |
| 367 | this.dataList = [] | 396 | this.dataList = [] |
| 368 | - this.couponIssuedParkPage() | 397 | + this.fetchData() |
| 398 | + this.couponDetailSummary() | ||
| 369 | }, | 399 | }, |
| 370 | getDate(type) { | 400 | getDate(type) { |
| 371 | const date = new Date(); | 401 | const date = new Date(); |
| @@ -386,23 +416,6 @@ export default { | @@ -386,23 +416,6 @@ export default { | ||
| 386 | </script> | 416 | </script> |
| 387 | 417 | ||
| 388 | <style lang="scss" scoped> | 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 | .paddingRight { | 420 | .paddingRight { |
| 408 | padding-right: 20px; | 421 | padding-right: 20px; |
pages/businessCard/printCard.vue
| 1 | <template> | 1 | <template> |
| 2 | <view> | 2 | <view> |
| 3 | - <uni-section title="50%(折扣券)" type="line"> | 3 | + <uni-section :title="`${cardRuleName}(${cardTypeName})`" type="line"> |
| 4 | <uni-card padding="0" spacing="0"> | 4 | <uni-card padding="0" spacing="0"> |
| 5 | <uni-list> | 5 | <uni-list> |
| 6 | - <uni-list-item title="适应车场" rightText="万达商业广场" > | 6 | + <uni-list-item title="适应车场" :rightText="plName"> |
| 7 | <text></text> | 7 | <text></text> |
| 8 | </uni-list-item> | 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 | </uni-list> | 10 | </uni-list> |
| 11 | </uni-card> | 11 | </uni-card> |
| 12 | </uni-section> | 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 | </view> | 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 | </view> | 22 | </view> |
| 24 | 23 | ||
| 25 | - | ||
| 26 | - | ||
| 27 | <view class="uni-padding-wrap uni-common-mt"> | 24 | <view class="uni-padding-wrap uni-common-mt"> |
| 28 | <!--<button type="primary" style="margin-bottom: 15px">停止自动发放</button>--> | 25 | <!--<button type="primary" style="margin-bottom: 15px">停止自动发放</button>--> |
| 29 | - <button type="warn">立即打印</button> | 26 | + <button type="warn" @click="changeTime">立即打印</button> |
| 30 | </view> | 27 | </view> |
| 31 | 28 | ||
| 32 | 29 | ||
| @@ -34,190 +31,87 @@ | @@ -34,190 +31,87 @@ | ||
| 34 | </template> | 31 | </template> |
| 35 | 32 | ||
| 36 | <script> | 33 | <script> |
| 37 | -import common from "../../common/common.js"; | 34 | +import uQRCode from '../../common/uqrcode.js' //引入uqrcode.js |
| 38 | export default { | 35 | export default { |
| 39 | data() { | 36 | data() { |
| 40 | - const currentDate = this.getDate({ | ||
| 41 | - format: true | ||
| 42 | - }) | ||
| 43 | return { | 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 | onLoad(params) { | 49 | onLoad(params) { |
| 66 | wx.showShareMenu({ | 50 | wx.showShareMenu({ |
| 67 | withShareTicket: true | 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 | onShow() { | 63 | onShow() { |
| 87 | var me = this; | 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 | methods: { | 67 | methods: { |
| 110 | - change(value) { | 68 | + changeValue(value) { |
| 111 | this.numberValue = value | 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 | </script> | 112 | </script> |
| 150 | 113 | ||
| 151 | <style lang="scss" scoped> | 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 | </style> | 117 | </style> |
pages/businessCard/provideCard.vue
| @@ -18,13 +18,13 @@ | @@ -18,13 +18,13 @@ | ||
| 18 | </view> | 18 | </view> |
| 19 | 19 | ||
| 20 | <view class="tip-wrap"> | 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 | </view> | 23 | </view> |
| 24 | 24 | ||
| 25 | <view class="uni-padding-wrap uni-common-mt"> | 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 | </view> | 28 | </view> |
| 29 | 29 | ||
| 30 | 30 | ||
| @@ -39,37 +39,39 @@ export default { | @@ -39,37 +39,39 @@ export default { | ||
| 39 | qrShow: false, | 39 | qrShow: false, |
| 40 | cardTypeName: '',// 卡类型名称 | 40 | cardTypeName: '',// 卡类型名称 |
| 41 | cardRuleName: '',// 卡名称 | 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 | onLoad(params) { | 51 | onLoad(params) { |
| 48 | wx.showShareMenu({ | 52 | wx.showShareMenu({ |
| 49 | withShareTicket: true | 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 | // this.maxNum = option.cardNum | 63 | // this.maxNum = option.cardNum |
| 59 | this.getCouponDynamicQR() | 64 | this.getCouponDynamicQR() |
| 60 | }, | 65 | }, |
| 61 | onShow() { | 66 | onShow() { |
| 62 | var me = this; | 67 | var me = this; |
| 63 | - | ||
| 64 | - }, | ||
| 65 | - computed: { | ||
| 66 | - | ||
| 67 | }, | 68 | }, |
| 69 | + computed: {}, | ||
| 68 | methods: { | 70 | methods: { |
| 69 | getCouponDynamicQR() { | 71 | getCouponDynamicQR() { |
| 70 | let that = this | 72 | let that = this |
| 71 | let paramsData = { | 73 | let paramsData = { |
| 72 | - cardRelParkNo: '123qwe', | 74 | + cardRelParkNo: this.cardRelParkNo, |
| 73 | codeType: '2' | 75 | codeType: '2' |
| 74 | } | 76 | } |
| 75 | // 首页信息获取 接口 | 77 | // 首页信息获取 接口 |
| @@ -79,13 +81,18 @@ export default { | @@ -79,13 +81,18 @@ export default { | ||
| 79 | data: that.$common.requestSign(paramsData) | 81 | data: that.$common.requestSign(paramsData) |
| 80 | }).then(res => { | 82 | }).then(res => { |
| 81 | console.log(res) | 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 | this.qrShow = true | 96 | this.qrShow = true |
| 90 | uQRCode.make({ | 97 | uQRCode.make({ |
| 91 | canvasId: 'qrcode', | 98 | canvasId: 'qrcode', |
| @@ -97,85 +104,51 @@ export default { | @@ -97,85 +104,51 @@ export default { | ||
| 97 | foregroundColor: '#000000', | 104 | foregroundColor: '#000000', |
| 98 | fileType: 'jpg', | 105 | fileType: 'jpg', |
| 99 | errorCorrectLevel: uQRCode.errorCorrectLevel.H, | 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 | </script> | 141 | </script> |
| 106 | 142 | ||
| 107 | <style lang="scss" scoped> | 143 | <style lang="scss" scoped> |
| 108 | - /deep/ .uni-section{ | 144 | + /deep/ .uni-section { |
| 109 | padding-bottom: 10px; | 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 | margin-bottom: 0; | 152 | margin-bottom: 0; |
| 180 | } | 153 | } |
| 181 | </style> | 154 | </style> |