This commit is contained in:
王一嘉
2025-07-22 16:45:11 +08:00
parent c58ae0d06e
commit 12eec0a6b7
4 changed files with 13 additions and 4 deletions

View File

@@ -55,6 +55,7 @@ const initQR = async () => {
watch( watch(
() => visible.value, () => visible.value,
(val) => { (val) => {
console.log('变了', visible.value);
if (!val) { if (!val) {
clearInterval(timer); clearInterval(timer);
emits('success'); emits('success');

View File

@@ -1,7 +1,9 @@
<script setup> <script setup>
import {ref} from "vue"; import {ref} from "vue";
import GoPay from "./GoPay.vue"; import GoPay from "./GoPay.vue";
import Api from "../../api/index.js";
const id = ref(null);
const payInfo = ref(null); const payInfo = ref(null);
const visible = ref(false); const visible = ref(false);
const emits = defineEmits(['close']); const emits = defineEmits(['close']);
@@ -10,6 +12,7 @@ let successFun = () => {
const open = (options) => { const open = (options) => {
const {props, success} = options; const {props, success} = options;
successFun = success; successFun = success;
id.value = props.id;
payInfo.value = props.payInfo; payInfo.value = props.payInfo;
visible.value = true; visible.value = true;
} }
@@ -21,6 +24,11 @@ const success = () => {
successFun && successFun.apply(); successFun && successFun.apply();
} }
const update = async () => {
const {data} = await Api.merchant.startTask({id: id.value});
payInfo.value = data;
}
defineExpose({ defineExpose({
open, open,
close close
@@ -71,7 +79,7 @@ defineExpose({
<div v-if="payInfo.user_money < payInfo?.total_money" class="text-[12px] text-[#86909C] pl-[20px]"> <div v-if="payInfo.user_money < payInfo?.total_money" class="text-[12px] text-[#86909C] pl-[20px]">
*余额不足本次任务所需,请充值后再进行支付 *余额不足本次任务所需,请充值后再进行支付
</div> </div>
<go-pay @success=""> <go-pay @success="update">
<a-button class="mt-[20px]" type="primary">去充值 <a-button class="mt-[20px]" type="primary">去充值
</a-button> </a-button>
</go-pay> </go-pay>

View File

@@ -226,9 +226,9 @@ const changeStatus = async (record) => {
<settlement :task="record" :disabled="!(record.is_settlement === 0)" <settlement :task="record" :disabled="!(record.is_settlement === 0)"
@success="fetchData"> @success="fetchData">
<a-link :hoverable="false" <a-link :hoverable="false"
:disabled="!(record.is_settlement === 0)" :disabled="!(record.is_settlement === 0 || record.is_settlement === 1)"
status="success"> status="success">
{{ record.settlement_text }} {{ record.admin_settlement_text }}
</a-link> </a-link>
</settlement> </settlement>
</div> </div>

View File

@@ -139,7 +139,7 @@ const startTask = async (_value, record) => {
} else { } else {
const {data} = await Api.merchant.startTask({id}); const {data} = await Api.merchant.startTask({id});
openPayTask({ openPayTask({
props: {payInfo: data}, props: {payInfo: data, id: id},
success: async () => { success: async () => {
const {msg} = await Api.merchant.moneyToTask(id); const {msg} = await Api.merchant.moneyToTask(id);
await showMessageAndFetch(msg); await showMessageAndFetch(msg);