<script>
|
import WxStorage from "./static/lib/wxStorage.js" //微信Storage
|
export default {
|
data() {
|
return {
|
login: '',
|
}
|
},
|
methods: {
|
judgeAdmin() {
|
var scss = this.$route.path == "/pages/loging/loging";
|
wx.getSystemInfo({
|
success(res) {
|
console.log(res)
|
}
|
})
|
console.log(this.$store.state.logPath, 'scss')
|
if (scss) {
|
return
|
}
|
this.login = WxStorage.get("init");
|
// console.log(this.login, 'login')
|
if (this.login == "false") {
|
wx.navigateTo({
|
url: 'pages/loging/loging?id=1',
|
})
|
}
|
}
|
},
|
computed: {
|
socketValue() {
|
return this.$store.state.socketValue;
|
}
|
},
|
watch: {
|
socketValue() {
|
// console.log(this.socketValue);
|
let that = this;
|
if (that.socketValue.type === "start") {
|
// console.log("任务开启")
|
this.$store.commit("addTask", this.socketValue.rid);
|
} else if (that.socketValue.type === "stop") {
|
// console.log("任务结束")
|
this.$store.commit("stopTask", this.socketValue.rid);
|
}
|
}
|
},
|
mounted() {
|
this.$store.dispatch("connectws");
|
},
|
onLaunch: function() { //初始化完成时触发(全局只触发一次)
|
console.log('第一次进入')
|
// Window.say = Window.console;
|
// Window.console = function() {
|
// say.log("关闭console")
|
// }
|
if (WxStorage.get("init") == '') {
|
WxStorage.set("init", 'false');
|
console.log('第一次进入')
|
}
|
// this.judgeAdmin();
|
},
|
onShow: function() { //当 uni-app 启动,或从后台进入前台显示 //监听用户进入小程序
|
// console.log('App Show')
|
// this.judgeAdmin();
|
},
|
onHide: function() {
|
// console.log('App Hide')
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
// @import '@smallwei/avue/lib/index.css';
|
@import url("/components/feng-parse/parse.css");
|
/*uview全局样式*/
|
@import "uview-ui/index.scss";
|
/*app全局样式*/
|
@import 'static/style/app.scss';
|
|
uni-page-wrapper {
|
width: 100%;
|
height: 100%;
|
}
|
|
uni-page-body {
|
width: 100%;
|
height: 100%;
|
}
|
|
/*每个页面公共css */
|
</style>
|