解决在app中断网没有及时更新首页的问题

master
lemon橪 2022-06-24 16:59:04 +08:00
parent 905e965917
commit ca32c11296
2 changed files with 11 additions and 2 deletions

View File

@ -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 扫码功能后续还会后续增加

View File

@ -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) => {