|
|
@@ -57,8 +57,21 @@ export default {
|
|
|
},
|
|
|
onLoad(){
|
|
|
let that = this
|
|
|
- uni.onNetworkStatusChange(function (res) {
|
|
|
- console.log(res.networkType);
|
|
|
+ uni.getNetworkType({
|
|
|
+ success: function (res) {
|
|
|
+ that.dealLogin(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ uni.onNetworkStatusChange(this.dealLogin)
|
|
|
+ },
|
|
|
+ onUnload(){
|
|
|
+ uni.offNetworkStatusChange(this.dealLogin)
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(['setUserShopAll']),
|
|
|
+ dealLogin(res){
|
|
|
+ let that = this
|
|
|
+ console.log(res)
|
|
|
switch(res.networkType){
|
|
|
case '2g':
|
|
|
that.hasMobileNet = true
|
|
|
@@ -75,35 +88,7 @@ export default {
|
|
|
default:
|
|
|
that.hasMobileNet = false
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
- uni.getNetworkType({
|
|
|
- success: function (res) {
|
|
|
- switch(res.networkType){
|
|
|
- case '2g':
|
|
|
- that.hasMobileNet = true
|
|
|
- break;
|
|
|
- case '3g':
|
|
|
- that.hasMobileNet = true
|
|
|
- break;
|
|
|
- case '4g':
|
|
|
- that.hasMobileNet = true
|
|
|
- break;
|
|
|
- case '5g':
|
|
|
- that.hasMobileNet = true
|
|
|
- break;
|
|
|
- default:
|
|
|
- that.hasMobileNet = false
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- },
|
|
|
- onUnload(){
|
|
|
-
|
|
|
- },
|
|
|
- methods: {
|
|
|
- ...mapActions(['setUserShopAll']),
|
|
|
+ },
|
|
|
wxPhoneLogin(e){
|
|
|
let that = this
|
|
|
let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
|