feat:小程序修改
This commit is contained in:
1 parent
6412d3be5c
commit
0398148db7
8 files changed
+73
-41
No files matched your search
@@ -1,12 +1,14 @@
|
||||
import { router } from ".."
|
||||
import { getUrlParamsObj, isDevEnv } from "../utils/app"
|
||||
|
||||
const normalizeScanResult = (scanResult: string) => scanResult.replace("https://stgl.pj.gov.cn", "https://www.pjzhhq.cn")
|
||||
|
||||
export function useScanCode(actModalShow) {
|
||||
async function scanCodeAction(): Promise<string | undefined> {
|
||||
if (isDevEnv()) {
|
||||
const testQrCode = "https://stgl.pj.gov.cn/h5/#/pages/pay/scanPay?id=1931916121241079810"
|
||||
uni.showModal({ content: "开发环境不是浙政钉和诗画环境,扫码仅供测试" })
|
||||
return Promise.resolve(testQrCode)
|
||||
return normalizeScanResult(testQrCode)
|
||||
}
|
||||
const scanResult = await new Promise<string>((resolve, reject) => {
|
||||
uni.scanCode({
|
||||
@@ -20,7 +22,7 @@ export function useScanCode(actModalShow) {
|
||||
},
|
||||
})
|
||||
})
|
||||
return scanResult
|
||||
return normalizeScanResult(scanResult || "")
|
||||
}
|
||||
|
||||
// 处理url扫码结果
|
||||
|
||||
Reference in new issue
Block a user