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

master
lemon橪 2022-06-24 16:59:04 +08:00 committed by 学习很差啦
parent a56ea2d456
commit 17299d00e1
2 changed files with 11 additions and 2 deletions

View File

@ -50,7 +50,7 @@
<!-- <integral v-if="item.type == 'integral'" :res="item.options" /> --> <!-- <integral v-if="item.type == 'integral'" :res="item.options" /> -->
<!-- <spike v-if="item.type == 'spike'" :res="item.options" /> --> <!-- <spike v-if="item.type == 'spike'" :res="item.options" /> -->
</div> </div>
<u-no-network></u-no-network> <u-no-network @retry='init' @isConnected='isConnected'></u-no-network>
</div> </div>
</template> </template>
@ -128,6 +128,10 @@ export default {
} }
}); });
}, },
//
isConnected(val){
val ? this.init() : ''
},
/** /**
* TODO 扫码功能后续还会后续增加 * TODO 扫码功能后续还会后续增加

View File

@ -59,6 +59,11 @@
return this.zIndex ? this.zIndex : this.$u.zIndex.noNetwork; return this.zIndex ? this.zIndex : this.$u.zIndex.noNetwork;
} }
}, },
watch:{
isConnected(val){
this.$emit('isConnected',val)
}
},
mounted() { mounted() {
this.isIOS = (uni.getSystemInfoSync().platform === 'ios'); this.isIOS = (uni.getSystemInfoSync().platform === 'ios');
uni.onNetworkStatusChange((res) => { uni.onNetworkStatusChange((res) => {