Merge branch 'master' into card-pwd

This commit is contained in:
zhangds 2024-03-19 19:47:44 +08:00
commit 21cb27d619
2 changed files with 34 additions and 29 deletions

View File

@ -215,7 +215,7 @@
let goodsCount = null, goodsDetail = null; let goodsCount = null, goodsDetail = null;
new Vue({ new Vue({
el: '#exchangePage', el: '#exchangePage',
data () { data() {
return { return {
account: '', account: '',
reAccount: '', reAccount: '',
@ -253,7 +253,7 @@
filters: { filters: {
cardType (val) { cardType(val) {
return val.map((item) => { return val.map((item) => {
return item == 1 ? "借记卡" : "信用卡" + " "; return item == 1 ? "借记卡" : "信用卡" + " ";
}).join(" "); }).join(" ");
@ -261,17 +261,17 @@
}, },
watch: { watch: {
account (va) { account(va) {
va && this.watchAccount(); va && this.watchAccount();
}, },
reAccount (va) { reAccount(va) {
va && this.watchAccount(); va && this.watchAccount();
}, },
productType: { productType: {
immediate: true, immediate: true,
handler (newVal) { handler(newVal) {
this.maxlen = 50; this.maxlen = 50;
this.acctype = "text"; this.acctype = "text";
switch (Number(newVal)) { switch (Number(newVal)) {
@ -345,15 +345,17 @@
modelPop modelPop
}, },
created () { created() {
/* 配置信息 */ /* 配置信息 */
document.title = localStorage.getItem('title'); document.title = localStorage.getItem('title');
let detailsConfig = JSON.parse(localStorage.getItem('product_detail')); let detailsConfig = JSON.parse(localStorage.getItem('product_detail'));
goodsCount = localStorage.getItem('goodsCount'); goodsCount = localStorage.getItem('goodsCount');
this.backAble = goodsCount > 1;//多个商品才有返回 this.backAble = goodsCount > 1;//多个商品才有返回
if (detailsConfig) {
this.bgcolor = detailsConfig.button_color; this.bgcolor = detailsConfig.button_color;
this.ftColor = detailsConfig.font_color; this.ftColor = detailsConfig.font_color;
this.describe = detailsConfig.describe; this.describe = detailsConfig.describe;
}
//商品详情 //商品详情
goodsDetail = JSON.parse(localStorage.getItem('goodsInfo')); goodsDetail = JSON.parse(localStorage.getItem('goodsInfo'));
@ -364,18 +366,18 @@
computed: { computed: {
/* 手机号验证 */ /* 手机号验证 */
computedAccount () { computedAccount() {
return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account); return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(this.account);
}, },
/* 兑换按钮验证 */ /* 兑换按钮验证 */
computedExChange () { computedExChange() {
return this.exchangeOpen || (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) || this.goodInfo.is_e_card && this.computedAccount && this.jd_code.length === 6; return this.exchangeOpen || (this.goodInfo.product_type === 2 && this.goodInfo.card_show == 2) || this.goodInfo.is_e_card && this.computedAccount && this.jd_code.length === 6;
} }
}, },
methods: { methods: {
bindAvailable () { bindAvailable() {
if (goodsDetail.wait_pay_order == 1) { if (goodsDetail.wait_pay_order == 1) {
this.openErrorDialog('您有未支付的订单'); this.openErrorDialog('您有未支付的订单');
return; return;
@ -387,7 +389,7 @@
}, },
/* 获取京东E卡短信 */ /* 获取京东E卡短信 */
sendJDSms () { sendJDSms() {
if (this.cunt === 60) { if (this.cunt === 60) {
req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account }) req.axiosPost('/key/order/jdSendSms', { code_batch_id: this.goodsDetail.code_batch_id, mobile: this.account })
.then((res) => { .then((res) => {
@ -408,7 +410,7 @@
}, },
/* 请求详情 */ /* 请求详情 */
getDetails (goods_id, code_batch_id) { getDetails(goods_id, code_batch_id) {
const token = localStorage.getItem('token'); const token = localStorage.getItem('token');
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
req.axiosPost(`/key/product_detail/${goods_id}`, { token, code_batch_id }).then(({ code, data, message }) => { req.axiosPost(`/key/product_detail/${goods_id}`, { token, code_batch_id }).then(({ code, data, message }) => {
@ -452,11 +454,11 @@
}, },
/* 跳转订单 */ /* 跳转订单 */
toOrder () { toOrder() {
window.location.replace('./myOrder.html'); window.location.replace('./myOrder.html');
}, },
openErrorDialog (tip, bottomText) { openErrorDialog(tip, bottomText) {
this.popTitle = '温馨提示'; this.popTitle = '温馨提示';
this.popText = tip; this.popText = tip;
this.popStatus = 2; this.popStatus = 2;
@ -464,7 +466,7 @@
this.bottomText = bottomText; this.bottomText = bottomText;
}, },
backHandler () { backHandler() {
if (goodsCount > 1) { if (goodsCount > 1) {
window.location.replace('./couponCollection.html'); window.location.replace('./couponCollection.html');
} else { } else {
@ -473,7 +475,7 @@
}, },
// 单条弹框 // 单条弹框
openDialog (tip) { openDialog(tip) {
this.promtshow = true; this.promtshow = true;
this.promttip = tip; this.promttip = tip;
setTimeout(() => { setTimeout(() => {
@ -483,14 +485,14 @@
}, },
/* 弹窗回调 */ /* 弹窗回调 */
backFunctionPop (type) { backFunctionPop(type) {
if (this.isLogin) { if (this.isLogin) {
this.delayedOut(); this.delayedOut();
} }
}, },
/* 延时自动退出 */ /* 延时自动退出 */
delayedOut (time = 1) { delayedOut(time = 1) {
let entryLink = localStorage.getItem('entryLink'); let entryLink = localStorage.getItem('entryLink');
setTimeout(() => { setTimeout(() => {
window.location.replace(entryLink); window.location.replace(entryLink);
@ -498,7 +500,7 @@
}, },
//兑换商品 //兑换商品
exchangeGoodsFn () { exchangeGoodsFn() {
//wait_pay_order 1有订单 5无订单 //wait_pay_order 1有订单 5无订单
if (goodsDetail.wait_pay_order == 1) { if (goodsDetail.wait_pay_order == 1) {
this.openErrorDialog('您有未支付的订单'); this.openErrorDialog('您有未支付的订单');
@ -603,7 +605,7 @@
window.location.href = './settlement.html'; window.location.href = './settlement.html';
}, },
focusFn (a) { focusFn(a) {
let ele = document.querySelector('.ipt-acc'); let ele = document.querySelector('.ipt-acc');
setTimeout(function () { setTimeout(function () {
ele.scrollIntoView(false); ele.scrollIntoView(false);
@ -612,7 +614,7 @@
}, 400); }, 400);
}, },
/* 监听账号 */ /* 监听账号 */
watchAccount () { watchAccount() {
if ((this.account === this.reAccount) && this.account) { if ((this.account === this.reAccount) && this.account) {
this.exchangeOpen = true; this.exchangeOpen = true;
} else { } else {

View File

@ -28,7 +28,8 @@
<img v-show='!!loadShowHeight' class='img-lodging' <img v-show='!!loadShowHeight' class='img-lodging'
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/img-logding.png" alt=""> src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/img-logding.png" alt="">
<div class="content" slot="content" @scroll="scrollBottom($event)"> <div class="content" slot="content" @scroll="scrollBottom($event)">
<div class="content-item" v-for="item in orderList" :key="item.order_number" @click="toDetails(item)"> <div class="content-item" v-for="item in orderList" :key="item.order_number"
@click.stop="toDetails(item)">
<div class="top"> <div class="top">
<p class="time">{{item.update_time}}</p> <p class="time">{{item.update_time}}</p>
<p class="status" :style="{color:statusColor(item.status)}">{{item.status_text}} <p class="status" :style="{color:statusColor(item.status)}">{{item.status_text}}
@ -48,19 +49,19 @@
<p class="money">实付金额:¥<span>{{item.pay_amount}}</span></p> <p class="money">实付金额:¥<span>{{item.pay_amount}}</span></p>
<!-- 立即支付 --> <!-- 立即支付 -->
<div v-if="item.status==6" class="cancel-pay"> <div v-if="item.status==6" class="cancel-pay">
<p class="button" @click="immediatelyCancel(item)">取消订单</p> <p class="button" @click.stop="immediatelyCancel(item)">取消订单</p>
<p class="button" @click="immediatelyPay(item)">立即支付</p> <p class="button" @click.stop="immediatelyPay(item)">立即支付</p>
</div> </div>
<template v-if="item.type==2"> <template v-if="item.type==2">
<!-- 立减金待领取 --> <!-- 立减金待领取 -->
<p class="button" @click="receiveFn(item)" v-if="item.status==0">去兑换</p> <p class="button" @click.stop="receiveFn(item)" v-if="item.status==0">去兑换</p>
<!-- 立减金领取过期 --> <!-- 立减金领取过期 -->
<p class="button filter" @click="receiveFn(item)" v-if="item.status==5">去兑换 <p class="button filter" @click.stop="receiveFn(item)" v-if="item.status==5">去兑换
</p> </p>
</template> </template>
<template v-if="item.type==1"> <template v-if="item.type==1">
<!-- 查看卡密 --> <!-- 查看卡密 -->
<p class="button-card" @click="lookCard(item)" <p class="button-card" @click.stop="lookCard(item)"
v-if="item.status==2&&item.goods.product_type==2&&item.goods.card_show==2">查看卡密</p> v-if="item.status==2&&item.goods.product_type==2&&item.goods.card_show==2">查看卡密</p>
<!-- 款项状态 --> <!-- 款项状态 -->
<p class="pay_status" v-if="[2,3].includes(item.pay_status)&&item.status==3"> <p class="pay_status" v-if="[2,3].includes(item.pay_status)&&item.status==3">
@ -192,6 +193,8 @@
/*跳转详情*/ /*跳转详情*/
toDetails(order) { toDetails(order) {
if (order.status === 4 || order.status === 6) return;
sessionStorage.setItem('orderNumber', order.order_number); sessionStorage.setItem('orderNumber', order.order_number);
switch (order.goods.product_type) { switch (order.goods.product_type) {
case 1: case 1: