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