This commit is contained in:
weiwei committed 2025-04-03 16:29:48 +08:00
1 parent 67a220b60b
commit 2c8e8ff9bd
3 files changed
+20 -12

No files matched your search

+5 -4
View File
@@ -83,11 +83,12 @@ const pay = async () => {
customPrice: storePrice(Number(amount.value)),
})
if (res.code != 0) {
throw new Error()
uni.showToast({ title: res.msg || "支付失败", icon: "error" })
} else {
uni.hideLoading()
usePayStore().setPayData({ ...scanData.value, customPrice: Number(amount.value).toFixed(2) })
router.jump("/pages/pay/payComplete", {}, 2)
}
uni.hideLoading()
usePayStore().setPayData({ ...scanData.value, customPrice: Number(amount.value).toFixed(2) })
router.jump("/pages/pay/payComplete", {}, 2)
} catch (error: any) {
uni.showToast({ title: "错误", icon: "error" })
uni.hideLoading()
+7 -5
View File
@@ -153,13 +153,13 @@ const confirmTransfer = async () => {
if (!amount.value || amount.value === "0" || amount.value === "0." || parseFloat(amount.value) === 0) {
return uni.showToast({ title: "金额不能为零", icon: "none" })
}
if (numAmount > transferMoney.sourceWalletType.balance) {
if (numAmount.value > transferMoney.sourceWalletType.balance) {
return uni.showToast({ title: "转账金额不能超过钱包余额", icon: "none" })
}
console.log("state.sourceWalletTypeId", state.sourceWalletTypeId)
console.log("state.targetWalletTypeId", state.targetWalletTypeId)
console.log("金额", numAmount.value)
// console.log("state.sourceWalletTypeId", state.sourceWalletTypeId)
// console.log("state.targetWalletTypeId", state.targetWalletTypeId)
// console.log("金额", numAmount.value)
uni.showModal({
title: "确定转入吗?",
@@ -181,7 +181,9 @@ const confirmTransferAgain = async () => {
})
if (res.code == 0) {
uni.showToast({ title: "转账成功", icon: "success" })
router.jump("/pages/wallet/list", {}, 2)
transferMoney.setSourceWalletType({})
// router.jump("/pages/wallet/list", {}, 2)
router.back()
} else {
uni.showToast({ title: res.msg, icon: "none" })
}
+8 -3
View File
@@ -1,11 +1,10 @@
<script setup lang="ts">
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import uqrcode from "@@/utils/uqrcode"
import { hooks, router } from "@@/index"
import { merchantApi, walletApi } from "@@/api"
import { walletApi } from "@@/api"
import { filePath } from "@@/utils/file"
import { useTransferMoney } from "@/sheep/stores/transferMoney"
@@ -31,7 +30,13 @@ const freezeForm = reactive<any>({
})
onLoad(() => {})
onShow(() => {})
onShow(async () => {
const isLogin = await hooks.useCheckLogin()
if (!isLogin) return
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, walletApi.all, null, "data.records")