|
|
|
@ -1,61 +1,22 @@ |
|
|
|
<script> |
|
|
|
import {defaultRequest,defaultRequest4} from 'api/index.js' |
|
|
|
import { |
|
|
|
defaultRequest, |
|
|
|
defaultRequest4 |
|
|
|
} from 'api/index.js' |
|
|
|
var jpushModule = uni.requireNativePlugin("JG-JPush"); |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
globalData:{ |
|
|
|
|
|
|
|
}, |
|
|
|
backButtonPress: 0, |
|
|
|
} |
|
|
|
}, |
|
|
|
onLaunch: function() { |
|
|
|
let channel=plus.runtime.channel || ''; |
|
|
|
let channelName=''; |
|
|
|
let isInstall=0; |
|
|
|
let firstTime=uni.getStorageSync('firstTime') || ''; |
|
|
|
if(!firstTime){ |
|
|
|
isInstall=1; |
|
|
|
uni.setStorageSync('firstTime','1'); |
|
|
|
} |
|
|
|
addAppCount({channel:channel,is_install:isInstall}); |
|
|
|
|
|
|
|
// uni.getNetworkType({ |
|
|
|
// success: function(res) { |
|
|
|
// console.log(res.networkType); |
|
|
|
// //网络类型 wifi、2g、3g、4g、ethernet、unknown、none |
|
|
|
// setTimeout(function() { |
|
|
|
// if (res.networkType === "none") { |
|
|
|
// console.log("当前无网络", that.typee); |
|
|
|
// uni.showToast({ |
|
|
|
// title: '网络不佳,请重新打开........', |
|
|
|
// duration: 20000 |
|
|
|
// }); |
|
|
|
// } else { |
|
|
|
// console.log("有网络", that.typee); |
|
|
|
// uni.showToast({ |
|
|
|
// title: '网络不佳,请重新打开........', |
|
|
|
// duration: 2000 |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// }, 1) |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log('App Launch') |
|
|
|
uni.hideTabBar() |
|
|
|
// uni.onTabBarMidButtonTap(()=>{ |
|
|
|
// console.log("点击了") |
|
|
|
// // 这里可以根据 个人需求 做点击处理, |
|
|
|
// // 本人需进行页面跳转。 |
|
|
|
// uni.navigateTo({ |
|
|
|
// url:"../index/index2", |
|
|
|
// animationType:'slide-in-bottom' |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
plus.screen.lockOrientation("portrait-primary"); |
|
|
|
setTimeout(() => { |
|
|
|
plus.navigator.closeSplashscreen(); |
|
|
|
|
|
|
|
}, 2400); |
|
|
|
|
|
|
|
//#ifdef APP-PLUS |
|
|
|
@ -108,28 +69,49 @@ |
|
|
|
let extras = result.extras |
|
|
|
console.log("自定义消息", result) |
|
|
|
}) |
|
|
|
|
|
|
|
//#endif |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
onShow: function() { |
|
|
|
// console.log('App Show') |
|
|
|
console.log('App Show') |
|
|
|
console.log('App Show') |
|
|
|
console.log('11111') |
|
|
|
console.log(this.$store.state.hasNEt); |
|
|
|
let that = this; |
|
|
|
uni.onNetworkStatusChange(function(res) { |
|
|
|
console.log(res); |
|
|
|
if (res.isConnected) { |
|
|
|
that.$store.commit("changeNetStatus", true); |
|
|
|
uni.showToast({ |
|
|
|
title: "有网络", |
|
|
|
icon: "none", |
|
|
|
duration: 200000 |
|
|
|
}) |
|
|
|
console.log('有网络'); |
|
|
|
} else { |
|
|
|
that.$store.commit("changeNetStatus", false); |
|
|
|
uni.showToast({ |
|
|
|
title:"无网络", |
|
|
|
icon: "none", |
|
|
|
duration: 200000 |
|
|
|
}) |
|
|
|
console.log('无网络'); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
onHide: function() { |
|
|
|
// console.log('App Hide') |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
|
|
|
|
/*每个页面公共css */ |
|
|
|
@import "@/common/common.scss"; |
|
|
|
|
|
|
|
page { |
|
|
|
overflow-x: hidden; |
|
|
|
} |
|
|
|
|
|
|
|
</style> |
|
|
|
|