Browse Source

增加无连接网络状态

master
zhengshuiqi 3 years ago
parent
commit
be3936a1bf
  1. 3
      pages/account/myCoupons.vue
  2. 8
      pages/index/index.vue
  3. 4
      pages/login/index.vue

3
pages/account/myCoupons.vue

@ -23,7 +23,8 @@
</view> </view>
<view>sorry,no coupons~</view> <view>sorry,no coupons~</view>
<view> <view>
<button @click="goPage(1)">Go to the home page</button> <button @click="goPage(1)">Get coupons</button>
<!-- <button @click="goPage(1)">Go to the home page</button> -->
</view> </view>
</view> </view>
</view> </view>

8
pages/index/index.vue

@ -216,7 +216,13 @@
uni.getNetworkType({ uni.getNetworkType({
success: (res) => { success: (res) => {
console.log(res.networkType, s); console.log(res.networkType, s);
if (res.networkType !== 'none') { if (res.networkType == 'none') {
uni.showToast({
icon: 'none',
title: 'Please connect to the network',
duration: 3000,
})
} else if (res.networkType !== 'none') {
that.typee = 2; that.typee = 2;
clearInterval(time); clearInterval(time);
let home = 'HOME' let home = 'HOME'

4
pages/login/index.vue

@ -207,8 +207,8 @@
uni.setStorageSync('isLogin',1) uni.setStorageSync('isLogin',1)
uni.setStorageSync('user_info',res.data) uni.setStorageSync('user_info',res.data)
uni.switchTab({ uni.switchTab({
// delta: 1 delta: 1
url:'../index/index' // url:'../index/index'
}) })
}else{ }else{
if(res.data){ if(res.data){

Loading…
Cancel
Save