This commit is contained in:
@@ -9,6 +9,8 @@ import {getUserPoint} from '@/api/admin';
|
||||
const tabValue = ref(0);
|
||||
|
||||
const isShowPay = ref(false);
|
||||
const isShowCode = ref(false);
|
||||
const url = ref('');
|
||||
|
||||
const tabsList = ref([
|
||||
{
|
||||
@@ -150,7 +152,7 @@ const successPay = () => {
|
||||
|
||||
const toDetail = (item: any) => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/users/order_list_detail/index?orderId=${item.joint_oid}`,
|
||||
url: `/pages/users/order_list_detail/index?orderId=${item.oid}&OrderType=2`,
|
||||
});
|
||||
};
|
||||
|
||||
@@ -194,6 +196,41 @@ const getTj = async () => {
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
const t_id = ref();
|
||||
|
||||
const openCode = item => {
|
||||
if (item.status === 2) return;
|
||||
url.value = `https://api.pwmqr.com/qrcode/create?url=${item.oid}`;
|
||||
isShowCode.value = true;
|
||||
t_id.value = setInterval(() => {
|
||||
checkStatus(item);
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
const checkStatus = async itm => {
|
||||
await getList();
|
||||
orderList.value.forEach(item => {
|
||||
if (item.oid === itm.oid) {
|
||||
console.log(item);
|
||||
if (item.status === 2) {
|
||||
clearInterval(t_id.value);
|
||||
isShowCode.value = false;
|
||||
url.value = '';
|
||||
Taro.showToast({
|
||||
title: '核销成功',
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
const closed = () => {
|
||||
isShowCode.value = false;
|
||||
url.value = '';
|
||||
clearInterval(t_id.value);
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -311,10 +348,32 @@ const getTj = async () => {
|
||||
@click.stop="openPay(item)"
|
||||
>立即付款
|
||||
</nut-button>
|
||||
<nut-button
|
||||
style="margin-left: 5px"
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="item.status === 1"
|
||||
@click.stop="openCode(item)"
|
||||
>出示核销码
|
||||
</nut-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||
<!-- 核销码弹窗 -->
|
||||
<nut-popup
|
||||
v-model:visible="isShowCode"
|
||||
position="center"
|
||||
style="padding: 20px; border-radius: 15px"
|
||||
:maskClosable="true"
|
||||
safe-area-inset-bottom
|
||||
@click-overlay="closed"
|
||||
@closed="closed">
|
||||
<view class="code-box">
|
||||
<view>核销码</view>
|
||||
<image class="qrcode" :src="url"></image>
|
||||
</view>
|
||||
</nut-popup>
|
||||
<pay
|
||||
:isShowPay="isShowPay"
|
||||
:interval="false"
|
||||
@@ -433,4 +492,16 @@ page {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.code-box {
|
||||
padding: 20px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
font-size: large;
|
||||
}
|
||||
|
||||
.qrcode {
|
||||
width: 300px;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -248,9 +248,12 @@ const url = ref('');
|
||||
|
||||
const oid = ref('');
|
||||
|
||||
const tId = ref();
|
||||
|
||||
Taro.useLoad(options => {
|
||||
type.value = options.type;
|
||||
oid.value = options.orderId;
|
||||
tId.value = Number(options.OrderType);
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
@@ -265,8 +268,9 @@ Taro.useLoad(options => {
|
||||
const getOrderDetail = async () => {
|
||||
const res = await getActiveOrderDetail({
|
||||
oid: oid.value,
|
||||
OrderType: tId.value,
|
||||
});
|
||||
goodInfo.value = res.data.data;
|
||||
goodInfo.value = res.data.data[0];
|
||||
if (goodInfo.value.status === 1) {
|
||||
startTime();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user