Commit cca906cb by 杨北旺

券详情添加二维码

1 parent 28ec73f7
This diff could not be displayed because it is too large.
......@@ -181,6 +181,10 @@ export const cardRoll = {
/**套餐申请售后 */
applySale(data) {
return request(data, 'scrm.api.equity.merchant.order.refund')
},
/**将字符串转成二维码 */
strChangeCode(data) {
return request(data, 'scrm.api.equity.coupon.verification.code')
}
}
export const oilStation = {
......
......@@ -11,20 +11,49 @@
>
</div>
<div class="coupons_info_wrap">
<span class="title_text info_title">我的核销码</span>
<span class="title_text info_title">{{ couponsInfo.couponName }}</span>
<span class="info_tip">到店使用服务后请出示该核销码给店员进行核销</span>
<span class="info_code" :class="!failure ? '' : 'info_code_ds_text'">
<span
class="info_code"
:class="!failure || !future ? '' : 'info_code_ds_text'"
>
{{ couponsInfo.verificationCode }}
<span v-if="failure" class="info_code_disable">已失效</span>
<span v-if="future" class="info_code_disable info_code_disable_date">
<span v-if="couponsInfo.nextLimitDays">{{couponsInfo.nextLimitDays}}天</span>
<span v-if="couponsInfo.nextLimitHours">{{couponsInfo.nextLimitHours}}时</span>
<span v-if="couponsInfo.nextLimitMin">{{couponsInfo.nextLimitMin}}分</span>
<!-- <span v-if="failure" class="info_code_disable">已失效</span> -->
<!-- <span v-if="future" class="info_code_disable info_code_disable_date">
<span v-if="couponsInfo.nextLimitDays"
>{{ couponsInfo.nextLimitDays }}天</span
>
<span v-if="couponsInfo.nextLimitHours"
>{{ couponsInfo.nextLimitHours }}时</span
>
<span v-if="couponsInfo.nextLimitMin"
>{{ couponsInfo.nextLimitMin }}分</span
>
<span>后可用</span>
</span>
</span> -->
</span>
<div class="qrcode_wrap">
<img
:class="[{ op30: failure || future }]"
v-if="qrcode"
:src="qrcode"
/>
<div v-if="failure" class="qrBtn">已失效</div>
<div v-if="future" class="qrBtn qrtext">
<span v-if="couponsInfo.nextLimitDays"
>{{ couponsInfo.nextLimitDays }}天</span
>
<span v-if="couponsInfo.nextLimitHours"
>{{ couponsInfo.nextLimitHours }}时</span
>
<span v-if="couponsInfo.nextLimitMin"
>{{ couponsInfo.nextLimitMin }}分</span
>
<span>后可用</span>
</div>
</div>
<div v-if="couponsInfo.countState" class="info_count">不限制次数</div>
<div v-else class="info_count">
<div v-else class="info_count">
剩余可用次数<span class="red_text"
>{{ couponsInfo.usedAmount }}/{{ couponsInfo.useAllAmount }}</span
>
......@@ -79,10 +108,11 @@ export default {
showNote: false,
status: 0,
failure: false,
future:false,
dayDiff:0,
hourDiff:0,
minDiff:0,
future: false,
dayDiff: 0,
hourDiff: 0,
minDiff: 0,
qrcode: "",
};
},
beforeCreate() {
......@@ -90,19 +120,18 @@ export default {
},
mounted() {
let sign = this.getEnvironmentAndSource();
if(sign.platform=='mini'){
let options = this.$route.query;
if(options.urlParam){
let {sessionId,id} = JSON.parse(options.urlParam)
this.sessionId = sessionId
sessionStorage.setItem('URL_PARAM',options.urlParam)
if (sign.platform == "mini") {
let options = this.$route.query;
if (options.urlParam) {
let { sessionId, id } = JSON.parse(options.urlParam);
this.sessionId = sessionId;
sessionStorage.setItem("URL_PARAM", options.urlParam);
this.getDetailInfo(id);
}
}else{
} else {
let options = this.$route.query;
this.getDetailInfo(options.id);
}
},
methods: {
getDetailInfo(id) {
......@@ -117,17 +146,18 @@ export default {
let { code, data } = res;
if (code == 0) {
this.couponsInfo = data;
this.changeCodeImage(data.verificationCode);
this.showNote = data.list.length ? true : false;
this.couponsInfo.verificationCode =
this.couponsInfo.verificationCode.replace(/(.{4})/g, "$1 ");
if(data.couponState==2){
this.failure = true
}else if(data.couponState==1){
this.failure = false
}else if(data.couponState==3){
this.future = true
}else if(data.couponState==4){
this.future = true
this.couponsInfo.verificationCode.replace(/(.{4})/g, "$1 ");
if (data.couponState == 2) {
this.failure = true;
} else if (data.couponState == 1) {
this.failure = false;
} else if (data.couponState == 3) {
this.future = true;
} else if (data.couponState == 4) {
this.future = true;
}
// 如果相等,则表示当前有效期已用完次数
// if (data.timeSlotUsedAmount == data.timeSlotLimitAmount) {
......@@ -171,9 +201,9 @@ export default {
//计算相差秒数
let leave3 = leave2 % (60 * 1000); //计算分钟数后剩余的毫秒数
let seconds = Math.round(leave3 / 1000);
this.dayDiff = dayDiff
this.hourDiff = hours
this.minDiff = minutes
this.dayDiff = dayDiff;
this.hourDiff = hours;
this.minDiff = minutes;
console.log(
"相差" +
dayDiff +
......@@ -186,6 +216,17 @@ export default {
"秒"
);
},
changeCodeImage(code) {
let para = {
verificationCode: code,
merchantId: sessionStorage.getItem("GL_WX_MERCHANTID"),
};
cardRoll.strChangeCode(para).then((res) => {
if (res.code == 0) {
this.qrcode = res.data.data;
}
});
},
},
};
</script>
......@@ -229,16 +270,13 @@ export default {
.info_tip {
color: #b1b1b3;
font-size: 12px;
margin-bottom: 10px;
margin-bottom: 5px;
}
.info_code {
font-size: 22px;
font-size: 20px;
font-family: DINAlternate-Bold, DINAlternate;
font-weight: bold;
color: #fc5b32;
line-height: 37px;
// letter-spacing: 6px;
margin-bottom: 12px;
position: relative;
}
.info_code_ds_text {
......@@ -259,9 +297,9 @@ export default {
text-align: center;
line-height: 32px;
}
.info_code_disable_date{
background: #FDDED5;
color: #FC5B32;
.info_code_disable_date {
background: #fdded5;
color: #fc5b32;
width: 170px;
}
.info_passcode {
......@@ -287,7 +325,41 @@ export default {
.info_count {
color: #3b3b3d;
font-size: 12px;
margin-top: 16px;
}
.qrcode_wrap {
width: 151px;
height: 151px;
position: relative;
margin: 16px 0;
> img {
width: 100%;
height: 100%;
}
.qrBtn {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 118px;
height: 32px;
background: #ffffff;
border: 1px solid #979797;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.29);
border-radius: 8px;
font-size: 12px;
color: #656566;
font-weight: 400;
display: flex;
align-items: center;
justify-content: center;
z-index: 3;
}
.op30 {
opacity: 0.3;
}
.qrtext{
color: #FC5B32 ;
}
}
}
.user_step_wrap {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!