优化vip商城

This commit is contained in:
mengxiaolong
2020-09-25 13:16:32 +08:00
parent e218ae19d3
commit 0d4beedd8c

View File

@@ -48,7 +48,7 @@
</div> </div>
<div v-else> <div v-else>
<template v-if="redirectUrl"> <template v-if="redirectUrl">
<iframe style="width: 100vw; min-height: 100vh;" :src="redirectUrl" frameborder="0"></iframe> <iframe v-show="thirdUrlReady" style="width: 100vw; min-height: 100vh;" :src="redirectUrl" frameborder="0"></iframe>
</template> </template>
<template v-else> <template v-else>
<img id="detailImg" v-if="detailImg" :src="$assetsUrl + detailImg" /> <img id="detailImg" v-if="detailImg" :src="$assetsUrl + detailImg" />
@@ -123,7 +123,8 @@ export default {
loaded: false, loaded: false,
detailImg: '', detailImg: '',
bottomBtnShow: false, bottomBtnShow: false,
redirectUrl: '' redirectUrl: '',
thirdUrlReady: false
} }
}, },
created() { created() {
@@ -165,38 +166,48 @@ export default {
const res = await getShopList(data) const res = await getShopList(data)
if (!res) return if (!res) return
if (res.result == '0') { if (res.result == '0') {
if (res.content.redirect) {
this.redirectUrl = res.content.linkUrl
}
let thirdName = res.content.tip let thirdName = res.content.tip
const toast = Toast.loading({ const toast = Toast.loading({
duration: 0, // 持续展示 toast duration: 0, // 持续展示 toast
forbidClick: true, forbidClick: true,
icon: 'info-o', icon: 'info-o',
message: `将为您跳转至${thirdName}` message: `3s后将为您跳转至${thirdName}`
}) })
setTimeout(() => { let second = 3
// 手动清除 Toast let timer = setInterval(() => {
toast.clear() second--
if (res.content.redirect) { if (second) {
this.redirectUrl = res.content.linkUrl toast.message = `${second}s后将为您跳转至${thirdName}`
} else { } else {
if (res.content.rightBtnShow && !this.isWeixin) { if (res.content.redirect) {
// eslint-disable-next-line no-undef this.thirdUrlReady = true
window.EWebBridge.webCallAppInJs('webview_right_button', { } else {
btns: [ if (res.content.rightBtnShow && !this.isWeixin) {
{ // eslint-disable-next-line no-undef
img: icon, window.EWebBridge.webCallAppInJs('webview_right_button', {
route: { flag: '', extra: {} } btns: [
} {
] img: icon,
}) route: { flag: '', extra: {} }
window['appCallBack'] = this.appCallBack }
]
})
window['appCallBack'] = this.appCallBack
}
this.detailImg = res.content.detailImgUrl
this.bottomBtnShow = res.content.bottomBtnShow
this.detail = res.content
this.pdfUrl = this.$assetsUrl + res.content.pdfUrl
this.isCanCheck2 = true
} }
this.detailImg = res.content.detailImgUrl clearInterval(timer)
this.bottomBtnShow = res.content.bottomBtnShow // 手动清除 Toast
this.detail = res.content toast.clear()
this.pdfUrl = this.$assetsUrl + res.content.pdfUrl
this.isCanCheck2 = true
} }
}, 3000) }, 1000)
this.loaded = true this.loaded = true
} else { } else {
this.$toast(res.resultMessage) this.$toast(res.resultMessage)