扫码调接口获得商户名
This commit is contained in:
1 parent
cd61d385bb
commit
f8481ffbe4
1 file changed
+10
-4
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<crud-layout bg="/static/page/blue-bg.png">
|
<crud-layout bg="/static/page/blue-bg.png">
|
||||||
<view class="h-screen flex flex-col position-relative">
|
<view class="h-screen flex flex-col position-relative">
|
||||||
<view class="mx-auto text-34 py-2">{{ scanData.name }}</view>
|
<view class="mx-auto text-34 py-2 h-80rpx">{{ scanData.name }}</view>
|
||||||
|
|
||||||
<tm-sheet class="flex flex-row">
|
<tm-sheet class="flex flex-row">
|
||||||
<span class="text-2xl text-[#333] mr-1 line-height-normal">¥</span>
|
<span class="text-2xl text-[#333] mr-1 line-height-normal">¥</span>
|
||||||
@@ -77,6 +77,7 @@ import { usePayStore } from "@/sheep/stores/pay"
|
|||||||
import payApi from "@@/api/pay"
|
import payApi from "@@/api/pay"
|
||||||
import { storePrice } from "@/sheep/utils/formatMoney"
|
import { storePrice } from "@/sheep/utils/formatMoney"
|
||||||
import { router } from "@/sheep"
|
import { router } from "@/sheep"
|
||||||
|
import { merchantApi } from "@/sheep/api"
|
||||||
|
|
||||||
const amount = ref("")
|
const amount = ref("")
|
||||||
const keyboardLayout = ref([
|
const keyboardLayout = ref([
|
||||||
@@ -87,14 +88,19 @@ const keyboardLayout = ref([
|
|||||||
const scanData = ref<{ id?: string; name?: string }>({})
|
const scanData = ref<{ id?: string; name?: string }>({})
|
||||||
const disabled = ref(false)
|
const disabled = ref(false)
|
||||||
|
|
||||||
onShow(() => {
|
onShow(async () => {
|
||||||
scanData.value = usePayStore().payData
|
uni.showLoading({ title: "加载中...", mask: true })
|
||||||
if (scanData.value.id && scanData.value.name) {
|
scanData.value.id = usePayStore().payData.id
|
||||||
|
if (scanData.value.id) {
|
||||||
|
const { data } = await merchantApi.detail({ id: scanData.value.id })
|
||||||
|
scanData.value.name = data.name
|
||||||
|
usePayStore().setPayData(scanData.value)
|
||||||
disabled.value = false
|
disabled.value = false
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({ title: "扫码信息不存在", icon: "none" })
|
uni.showToast({ title: "扫码信息不存在", icon: "none" })
|
||||||
disabled.value = true
|
disabled.value = true
|
||||||
}
|
}
|
||||||
|
uni.hideLoading()
|
||||||
})
|
})
|
||||||
|
|
||||||
const displayAmount = computed(() => {
|
const displayAmount = computed(() => {
|
||||||
|
|||||||
Reference in new issue
Block a user