测试扫码支付
This commit is contained in:
1 parent
b1f0b230e3
commit
3576ec1206
3 files changed
+6
-13
No files matched your search
@@ -7,7 +7,7 @@
|
||||
<span class="text-2xl text-[#333] mr-1 line-height-normal">¥</span>
|
||||
<span class="text-3xl font-medium text-[#333]">{{ displayAmount }}</span>
|
||||
</tm-sheet>
|
||||
|
||||
<view>{{ scanData }}</view>
|
||||
<tm-button class="mt-40" :block="true" @click="disabled ? '' : handlePay()" :disabled="disabled">支付</tm-button>
|
||||
|
||||
<view class="bg-[#f5f5f5] px-1 py-2 rounded-4 absolute bottom-0 w-full">
|
||||
@@ -72,9 +72,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { usePayStore } from "@/sheep/stores/pay"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { ref, computed } from "vue"
|
||||
import { onShow } from "@dcloudio/uni-app"
|
||||
import { usePayStore } from "@/sheep/stores/pay"
|
||||
|
||||
const amount = ref("")
|
||||
const keyboardLayout = ref([
|
||||
@@ -88,7 +88,7 @@ const disabled = ref(false)
|
||||
onShow(() => {
|
||||
scanData.value = usePayStore().payData
|
||||
if (scanData.value) {
|
||||
uni.showToast({ title: `扫码成功:${scanData.value}`, icon: "none" })
|
||||
disabled.value = false
|
||||
} else {
|
||||
uni.showToast({ title: "扫码信息不存在", icon: "none" })
|
||||
disabled.value = true
|
||||
|
||||
@@ -61,7 +61,7 @@ const state = reactive<{ wallet: any; userInfo: any; menuList: MenuItem[] }>({
|
||||
wallet: [],
|
||||
userInfo: {},
|
||||
menuList: [
|
||||
{ text: "扫一扫", icon: "/static/icon/service_3.png", router: "" },
|
||||
{ text: "扫一扫", icon: "/static/icon/scan.png", router: "" },
|
||||
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
|
||||
// { text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
|
||||
// { text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
|
||||
@@ -177,16 +177,10 @@ const doLogout = async () => {
|
||||
|
||||
// 扫一扫
|
||||
const doScanCode = async () => {
|
||||
console.log("ssss")
|
||||
try {
|
||||
const res: any = await (window as any).dd.scan({ type: "all" })
|
||||
console.log(res)
|
||||
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: "none",
|
||||
})
|
||||
usePayStore().setPayData(JSON.stringify(res))
|
||||
usePayStore().setPayData(res.text)
|
||||
router.jump("/pages/pay/scanPay")
|
||||
} catch (error: any) {
|
||||
uni.showToast({
|
||||
@@ -194,7 +188,6 @@ const doScanCode = async () => {
|
||||
icon: "none",
|
||||
})
|
||||
}
|
||||
console.log("eee")
|
||||
}
|
||||
|
||||
const onTabMenu = async (v: MenuItem, i: number) => {
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Reference in new issue
Block a user