feat: 兼容云闪付

This commit is contained in:
wangsongsole 2023-07-14 18:46:35 +08:00
parent 10f09cddee
commit 91eb05fa36
2 changed files with 14 additions and 3 deletions

View File

@ -373,7 +373,8 @@
self.swiperDataList = res.data;
sessionStorage.setItem('goodsCount', res.data.length);
self.goodsShow = res.data.length > 1;
if (res.data && res.data.length == 1) {//单个商品直接进入详情页面
let ua = window.navigator.userAgent.toLowerCase();/* 判断是否web-view打开 */
if ((res.data && res.data.length == 1) || /miniProgram/i.test(ua)) {//单个商品直接进入详情页面
sessionStorage.setItem('goodsInfo', JSON.stringify(res.data[0]));
this.toPage(res.data[0]);
return false;

View File

@ -17,7 +17,7 @@
<body>
<div id="ysf">
<img @click="backGoodsFn" v-if="backAble" class="backIcon"
<img @click="backGoodsFn" v-if="backAble&&!isMini" class="backIcon"
src="https://lsxdemall.oss-cn-beijing.aliyuncs.com/MarketingSystem/img/backprepageBtn.png" alt="">
<div class="prompt" :class="promptShow?'proactive':''">
{{prompt_text}}
@ -115,7 +115,8 @@
popStatus: 1, /*1 成功 2提示 3失败 */
prompt_text: '',
cls: null,
money: 0
money: 0,
isMini: false,
};
},
@ -123,6 +124,12 @@
modelPop
},
mounted () {
/* 判断是否是微信小程序内 */
let ua = window.navigator.userAgent.toLowerCase();
this.isMini = /miniProgram/i.test(ua);
},
methods: {
/* 立即领取 */
submit () {
@ -157,6 +164,7 @@
} else {
this.tip('领取成功,请前往【云闪付】-【卡包】中查看', 1);
}
self.ysf.available = 9;
} else {
if (code == 403) {
if (this.backAble) {
@ -178,6 +186,8 @@
/* 返回 */
backGoodsFn () {
this.money = 0;
/* 判断是否web-view打开 则不返回 */
if (this.isMini) return;
if (this.backAble) {
window.location.replace('./homepage.html');
} else {