Commit 30e0d4fe by 李伟康

员工注册拦截

1 parent 8ddbe0ae
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
@touchend="touchend" @touchend="touchend"
> >
<template v-if="detail.isStaffLoginLink"> <template v-if="detail.isStaffLoginLink">
<template v-if="supportOpenLaunch">
员工注册 员工注册
<wx-open-launch-weapp <wx-open-launch-weapp
class="mini" class="mini"
...@@ -40,6 +41,10 @@ ...@@ -40,6 +41,10 @@
</wx-open-launch-weapp> </wx-open-launch-weapp>
</template> </template>
<template v-else> <template v-else>
<div @click="errorToast">员工注册</div>
</template>
</template>
<template v-else>
<template v-if="detail.activityStatus == 1 && detail.buyFlag != 2">预热下单</template> <template v-if="detail.activityStatus == 1 && detail.buyFlag != 2">预热下单</template>
<template v-else-if="detail.activityStatus == 3">活动已结束</template> <template v-else-if="detail.activityStatus == 3">活动已结束</template>
<template v-else> <template v-else>
...@@ -130,7 +135,8 @@ export default { ...@@ -130,7 +135,8 @@ export default {
miniprogramInfo: {}, miniprogramInfo: {},
path: '', path: '',
totalGoodsNumber: 0, totalGoodsNumber: 0,
totalPrice: {} totalPrice: {},
supportOpenLaunch: true
} }
}, },
props: { props: {
...@@ -144,9 +150,40 @@ export default { ...@@ -144,9 +150,40 @@ export default {
} }
}, },
mounted () { 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' this.iSMiniprogram = window.__wxjs_environment === 'miniprogram'
}, },
methods: { methods: {
errorToast () {
this.showToast('当前系统或微信版本不支持该功能,请升级后再试。')
},
setTotalPrice () { setTotalPrice () {
const { const {
userSelectGoodsList userSelectGoodsList
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!