mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2025-12-16 23:45:53 +08:00
解决在app中断网没有及时更新首页的问题
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
|
||||
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
|
||||
</div>
|
||||
<u-no-network></u-no-network>
|
||||
<u-no-network @retry='init' @isConnected='isConnected'></u-no-network>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -128,6 +128,10 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
// 是否有网络链接
|
||||
isConnected(val){
|
||||
val ? this.init() : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* TODO 扫码功能后续还会后续增加
|
||||
|
||||
@@ -59,6 +59,11 @@
|
||||
return this.zIndex ? this.zIndex : this.$u.zIndex.noNetwork;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
isConnected(val){
|
||||
this.$emit('isConnected',val)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.isIOS = (uni.getSystemInfoSync().platform === 'ios');
|
||||
uni.onNetworkStatusChange((res) => {
|
||||
|
||||
Reference in New Issue
Block a user