feat:商家活动兑换券核销
This commit is contained in:
1 parent
f9dcaf2be3
commit
14f2702ba8
8 files changed
+136
-57
No files matched your search
@@ -2,7 +2,7 @@ import { router } from ".."
|
||||
import { APPENV } from "../constant"
|
||||
import { getAppInfo, isDevEnv } from "../utils/app"
|
||||
|
||||
export function useScanCode() {
|
||||
export function useScanCode(actModalShow) {
|
||||
async function scanCodeAction(): Promise<string | undefined> {
|
||||
const appInfo = await getAppInfo()
|
||||
|
||||
@@ -12,8 +12,10 @@ export function useScanCode() {
|
||||
// const testQrCode = "eyJoYXJkRG9vcklkIjoiMTkxNDIxNTYwODQzNzQxMTg0MSIsImNhYmluZXRObyI6IjEifQ==" // 测试线上-智能柜-收款二维码
|
||||
// const testQrCode = "eyJpZCI6IjE5MDU4MTY3NTEwNDM0NTI5MzAiLCJuYW1lIjoi5paw5Y6/5bqc6LaF5biCIn0=" // 邓本地-测试环境-新县府超市收款二维码
|
||||
// const testQrCode = "eyJoYXJkRG9vcklkIjoiMTkxMzE1NzA4MDQxODI5NTgwOSIsImNhYmluZXRObyI6IjEifQ==" // 邓本地-测试单门智能柜柜门二维码
|
||||
const testQrCode = "http://192.168.101.45:8889/h5/#/pages/pay/scanPay?id=1905816751043452930&name=测试新县府超市" // 邓本地-测试环境-新县府超市收款二维码
|
||||
// const testQrCode = "http://192.168.101.45:8889/h5/#/pages/pay/scanPay?id=1905816751043452930&name=测试新县府超市" // 邓本地-测试环境-新县府超市收款二维码
|
||||
// const testQrCode = "http://192.168.101.45:8889/h5/#/pages/pay/scanPay?hardDoorId=1913157080418295809&cabinetNo=1" // 测试智能柜柜门二维码
|
||||
// const testQrCode = "eyJhY3RJZCI6IjE5NjkyNTAwOTg1MTM4MDUzMTQiLCJ0b3RhbFByaWNlIjoxfQ==" // 测试商户活动核销
|
||||
const testQrCode = "eyJhY3RJZCI6IjE5NjkzMjQwNjMwNTk4Nzc4OTAiLCJ0b3RhbFByaWNlIjoxfQ==" // 测试商户活动核销
|
||||
uni.showModal({ content: "开发环境不是浙政钉和诗画环境,扫码仅供测试" })
|
||||
return Promise.resolve(testQrCode)
|
||||
}
|
||||
@@ -64,14 +66,20 @@ export function useScanCode() {
|
||||
function processBase64ScanResult(scanResult: string) {
|
||||
const decodedString = decodeBase64(scanResult)
|
||||
if (!decodedString) return
|
||||
|
||||
try {
|
||||
const decodedJson = JSON.parse(decodedString)
|
||||
// 商户活动优惠券扫码核销
|
||||
if (decodedJson.actId) {
|
||||
actModalShow({ actId: decodedJson.actId, totalPrice: decodedJson.totalPrice })
|
||||
return
|
||||
}
|
||||
// 商户扫码支付
|
||||
if (decodedJson.id) {
|
||||
router.jump("/pages/pay/scanPay", { id: decodedJson.id })
|
||||
return
|
||||
}
|
||||
if (decodedJson?.hardDoorId && decodedJson?.cabinetNo) {
|
||||
// 智能柜扫码开门
|
||||
if (decodedJson.hardDoorId && decodedJson.cabinetNo) {
|
||||
router.jump("/pages/cabinet/buy", { hardDoorId: decodedJson.hardDoorId, cabinetNo: decodedJson.cabinetNo })
|
||||
return
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user