<!--
|
* @Author: wuyue
|
* @Date: 2022-11-30 11:44:04
|
* @LastEditTime: 2022-12-12 11:14:58
|
* @LastEditors: wuyue
|
* @Descripttion:下架商品页
|
* @version:
|
-->
|
<template>
|
<div>
|
<van-nav-bar title="商品已下架" left-arrow @click-left="onClickLeft" />
|
<div class="top-tip">
|
<img src="../../assets/images/logo.png" />
|
<span class="tip-text">打开五粮液新零售,查看更多商品</span>
|
<van-button type="danger" size="mini" @click="isDownloadApp">立即打开</van-button>
|
</div>
|
<div class="content">
|
<img src="../../assets/images/offIcon.png" />
|
</div>
|
<guide-open :openStatus.sync="openStatus"></guide-open>
|
</div>
|
</template>
|
<script>
|
import openAppMixin from './openAppMixin.js'
|
import guideOpen from '@/components/pop-up/guideOpen.vue'
|
|
export default {
|
mixins: [openAppMixin],
|
components: { guideOpen },
|
data() {
|
return {
|
WeiXin: '', // 微信
|
flag: true, // pc
|
openStatus: false,
|
}
|
},
|
methods: {
|
isDownloadApp() {
|
this.isWeiXin();
|
if (this.WeiXin) {
|
this.openStatus = true
|
} else {
|
// 通用协议地址
|
let commSchemeUrl = "uni.wlyxls.commodity.share://wlyxlslaunch?shopspuId=''&enable=false";
|
// 首次尝试打开 App 并跳转
|
if (this.$root.isIos) {
|
commSchemeUrl = `${process.env.VUE_APP_IOS_QRCODE_URL}/home`;
|
}
|
this.openApp(commSchemeUrl)
|
console.log(this.$root.isIos);
|
}
|
},
|
// 点击箭头关闭页面
|
onClickLeft() {
|
const userAgent = navigator.userAgent;
|
this.isWeiXin();
|
this.isPc();
|
if (this.WeiXin) {
|
window.WeixinJSBridge.call('closeWindow');
|
}
|
if (!this.flag) {
|
window.opener = null;
|
window.open('about:blank', '_self', '').close();
|
}
|
if (
|
userAgent.includes('Firefox') ||
|
userAgent.includes('Chrome')
|
) {
|
window.location.href = 'about:blank';
|
} else {
|
window.opener = null;
|
window.open('about:blank', '_self');
|
window.close();
|
}
|
},
|
isWeiXin() {
|
const ua = window.navigator.userAgent.toLowerCase();
|
if (ua.match(/MicroMessenger/i) == 'micromessenger') {
|
this.WeiXin = true;
|
} else {
|
this.WeiXin = false;
|
}
|
},
|
isPc() {
|
const userAgent = navigator.userAgent;
|
const Agents = [
|
'Android',
|
'iPhone',
|
'SymbianOS',
|
'Windows Phone',
|
'iPad',
|
'iPod',
|
];
|
for (let v = 0; v < Agents.length; v++) {
|
if (userAgent.includes(Agents[v])) {
|
this.flag = false;
|
break;
|
}
|
}
|
},
|
}
|
}
|
</script>
|
<style lang="scss" scoped>
|
/deep/.van-nav-bar .van-icon {
|
color: rgba(0, 0, 0, 0.88);
|
}
|
|
.top-tip {
|
display: flex;
|
padding: 8px 16px;
|
background: rgba(248, 248, 248, 1);
|
|
.tip-text {
|
line-height: 64px;
|
color: rgba(0, 0, 0, 1);
|
font-size: 28px;
|
font-weight: 400;
|
display: inline-block;
|
}
|
|
/deep/.van-button {
|
font-size: 28px;
|
font-weight: 400;
|
background: rgb(217, 39, 27);
|
border-radius: 4px;
|
padding: 12px 20px;
|
border-radius: 8px;
|
line-height: 64px;
|
margin-left: auto;
|
margin-top: auto;
|
margin-bottom: auto;
|
}
|
}
|
|
.content {
|
display: flex;
|
justify-content: center;
|
margin-top: 250px;
|
}
|
</style>
|