feat:小程序修改
This commit is contained in:
1 parent
6412d3be5c
commit
0398148db7
8 files changed
+73
-41
No files matched your search
@@ -11,17 +11,29 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
})
|
||||
|
||||
function getHeight() {
|
||||
const { top, bottom } = uni.getSystemInfoSync().safeAreaInsets!
|
||||
let _statusBarHeight = 0;
|
||||
let _bottom = 0;
|
||||
const { statusBarHeight, safeAreaInsets } = uni.getSystemInfoSync()
|
||||
const { bottom = 0 } = safeAreaInsets ?? {}
|
||||
if (statusBarHeight) {
|
||||
_statusBarHeight = statusBarHeight
|
||||
}
|
||||
if (_statusBarHeight <= 20) {
|
||||
_statusBarHeight = 20
|
||||
}
|
||||
if (bottom) {
|
||||
_bottom = bottom
|
||||
}
|
||||
if (_bottom <= 8) {
|
||||
_bottom = 8
|
||||
}
|
||||
if (props.type && props.type === "bottom") {
|
||||
return bottom + "px"
|
||||
return _bottom + "px"
|
||||
}
|
||||
if (props.type && props.type === "top") {
|
||||
if (top < 22) {
|
||||
return "22px"
|
||||
}
|
||||
return top + "px"
|
||||
return _statusBarHeight + "px"
|
||||
}
|
||||
return 22 + "px"
|
||||
return 20 + "px"
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -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