增加loading

This commit is contained in:
mengxiaolong
2020-09-11 15:11:01 +08:00
parent 49445a1d2d
commit d1be1af950

View File

@@ -67,7 +67,7 @@
</template>
<script>
import { NoticeBar, Field, Radio, Popup, RadioGroup } from 'vant'
import { NoticeBar, Field, Radio, Popup, RadioGroup, Toast } from 'vant'
import icon from '@/assets/images/jilu@3x.png'
import { getShopList, saveShareTrack } from '@/api/ebiz/product-store/product-store'
@@ -130,7 +130,11 @@ export default {
if (this.$route.query.sectionName) {
this.sectionName = this.$route.query.sectionName
}
if (this.sectionName !== '一站购齐') {
document.title = `${this.sectionName}简介`
} else {
document.title = this.sectionName
}
},
async mounted() {
if (this.isWeixin) {
@@ -162,7 +166,25 @@ export default {
if (!res) return
if (res.result == '0') {
if (res.content.redirect) {
const toast = Toast.loading({
duration: 0, // 持续展示 toast
forbidClick: true,
icon: 'info-o',
message: '3秒后将跳转第三方平台'
})
let second = 3
const timer = setInterval(() => {
second--
if (second) {
toast.message = `${second}秒后将跳转第三方平台`
} else {
clearInterval(timer)
// 手动清除 Toast
Toast.clear()
this.redirectUrl = res.content.linkUrl
}
}, 1000)
} else {
if (res.content.rightBtnShow && !this.isWeixin) {
// eslint-disable-next-line no-undef