-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.vue
43 lines (42 loc) · 927 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script>
export default {
// 全局变量
globalData: {
text: ""
},
onUniNViewMessage(e) {
let data = e.data;
console.log(e.data)
// 处理
if (data.from && data.from === 'index') {
// 通知分类页修改数据
uni.$emit('index', data)
}
},
onLaunch: function() {
console.log('App Launch')
// 初始化登录状态
this.$store.commit('initUser')
// 更新购物车数据
this.$store.dispatch('updateCartList')
// 监听购物车更新
uni.$on('updateCart', () => {
this.$store.dispatch('updateCartList')
})
},
onShow: function() {
console.log('App Show')
},
onHide: function() {
console.log('App Hide')
}
}
</script>
<style>
/*每个页面公共css */
@import url("/common/uni.css");
@import url("/common/animate.css");
@import url("/common/icon.css");
@import url("/common/common.css");
@import url("/common/zcm-main.css");
</style>