55 lines
1.2 KiB
Vue
55 lines
1.2 KiB
Vue
<script>
|
|
// #ifdef APP-PLUS
|
|
import APPUpdate, { getCurrentNo } from "@/config/appUpdate";
|
|
// #endif
|
|
import { mapState, mapActions } from "vuex";
|
|
export default {
|
|
data() {
|
|
return {
|
|
version: "",
|
|
};
|
|
},
|
|
onLaunch: function () {
|
|
uni.setStorageSync("isImSound", true);
|
|
// #ifdef APP-PLUS
|
|
getCurrentNo((res) => {
|
|
this.version = res.version;
|
|
});
|
|
this.onAPPUpdate();
|
|
// #endif
|
|
setTimeout(() => {
|
|
uni.hideTabBar();
|
|
}, 500);
|
|
},
|
|
computed: {
|
|
...mapState("user", ["uid", "userInfo", "socket"]),
|
|
},
|
|
onShow: function () {
|
|
setTimeout(() => {
|
|
uni.hideTabBar();
|
|
}, 500);
|
|
setTimeout(() => {
|
|
if (this.userInfo && Object.keys(this.userInfo).length > 0) {
|
|
this.connectSocket(this.userInfo);
|
|
}
|
|
});
|
|
},
|
|
onHide: function () {},
|
|
onBackPress: function () {},
|
|
methods: {
|
|
...mapActions("user", ["connectSocket"]),
|
|
onAPPUpdate() {
|
|
APPUpdate(this.version);
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
// @import "./uni_modules/uview-ui/index.scss";
|
|
// @import "./uni_modules/uview-ui/theme.scss";
|
|
/*每个页面公共css */
|
|
|
|
@import "@/static/font/iconfont.css";
|
|
</style>
|