xinelu-applet-ui/App.vue

44 lines
822 B
Vue
Raw Normal View History

2023-09-19 14:58:40 +08:00
<script>
2024-01-22 22:11:26 +08:00
import {
mapMutations
} from "vuex";
2024-03-13 09:15:38 +08:00
import {
createMobileToken
} from '@/api/pages/login/index.js'
2023-09-19 14:58:40 +08:00
export default {
2023-09-20 10:42:44 +08:00
onLaunch: function() {},
2024-01-22 22:11:26 +08:00
methods: {
...mapMutations(['socketOpenfalse']),
2024-03-19 11:19:46 +08:00
...mapMutations(['scoket']),
2024-01-22 22:11:26 +08:00
},
2024-03-13 09:15:38 +08:00
onShow: function() {
2024-03-19 11:19:46 +08:00
if (uni.getStorageSync('patientId') && !this.$store.state.socketOpen) {
this.scoket();
}
2024-03-13 09:15:38 +08:00
createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token)
})
},
2024-01-22 22:11:26 +08:00
onHide: function() {
this.socketOpenfalse();
uni.closeSocket();
clearInterval(this.$store.state.timeoutObj);
}
2023-09-19 14:58:40 +08:00
}
</script>
2023-09-20 10:42:44 +08:00
<style lang="scss">
@import "uview-ui/index.scss";
2023-09-19 14:58:40 +08:00
/*每个页面公共css */
2023-09-20 10:42:44 +08:00
page {
2023-10-12 15:54:10 +08:00
background-color: #F4F5F7;
2023-09-20 10:42:44 +08:00
}
.app {
width: 100%;
height: 100%;
2023-09-20 11:30:45 +08:00
text-align: justify;
2023-09-20 10:42:44 +08:00
color: #000000;
}
2024-01-31 14:45:23 +08:00
</style>