Commit 30e0d4fe by 李伟康

员工注册拦截

1 parent 8ddbe0ae
......@@ -27,17 +27,22 @@
@touchend="touchend"
>
<template v-if="detail.isStaffLoginLink">
员工注册
<wx-open-launch-weapp
class="mini"
:path="path"
:username="miniprogramInfo.username"
:env-version="miniprogramInfo.envVersion"
>
<script type="text/wxtag-template">
<div class="mini-btn">点击跳转</div>
<template v-if="supportOpenLaunch">
员工注册
<wx-open-launch-weapp
class="mini"
:path="path"
:username="miniprogramInfo.username"
:env-version="miniprogramInfo.envVersion"
>
<script type="text/wxtag-template">
<div class="mini-btn">点击跳转</div>
</script>
</wx-open-launch-weapp>
</wx-open-launch-weapp>
</template>
<template v-else>
<div @click="errorToast">员工注册</div>
</template>
</template>
<template v-else>
<template v-if="detail.activityStatus == 1 && detail.buyFlag != 2">预热下单</template>
......@@ -130,7 +135,8 @@ export default {
miniprogramInfo: {},
path: '',
totalGoodsNumber: 0,
totalPrice: {}
totalPrice: {},
supportOpenLaunch: true
}
},
props: {
......@@ -144,9 +150,40 @@ export default {
}
},
mounted () {
const userAgent = navigator.userAgent,
wechat_version = userAgent.match(/MicroMessenger\/([\d\.]+)/i)[1]
try {
let [w_a, w_b, w_c] = wechat_version.split('.')
if (!w_c) c = 0
if (w_a < 7) throw false
if (w_a == 7 && w_b == 0 && w_c < 12) throw false
if (userAgent.includes('iPhone') || userAgent.includes('iPad')) {
let [phone_version] = userAgent.match(/iPhone OS .*?(?= )/)
if (phone_version) {
let [a, b] = phone_version.split(' ').at(-1).split('_')
if (!b) b = 0
if (a < 10) throw false
if (a == 10 && b < 3) throw false
if (a == 15 && w_a == 8 && w_b == 0 && w_c < 8) throw false
}
}
if (userAgent.includes('Android')) {
let [phone_version] = userAgent.match(/Android.*?(?=;)/)
if (phone_version) {
let [a] = phone_version.split(' ').at(-1).split('.')
if (a < 5) throw false
}
}
} catch (error) {
this.supportOpenLaunch = error
}
this.iSMiniprogram = window.__wxjs_environment === 'miniprogram'
},
methods: {
errorToast () {
this.showToast('当前系统或微信版本不支持该功能,请升级后再试。')
},
setTotalPrice () {
const {
userSelectGoodsList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!