-
Notifications
You must be signed in to change notification settings - Fork 13
/
App.vue
78 lines (65 loc) · 1.55 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<script>
export default {
globalData: {
db:{}
},
onLaunch: function() {
// 获取视频分类选项
let token = uni.getStorageSync('token')
let setThemeBg = uni.getStorageSync('setThemeBg')
if (setThemeBg) {
this.$store.commit('setThemeBg', JSON.parse(setThemeBg))
}
},
mounted() {
this.initYundb()
},
onShow: function(e) {},
onHide: function() {},
methods: {
initYundb() {
wx.cloud.init({
env: "",
traceUser: true,
})
this.globalData.db = wx.cloud.database()
this.sub.db = this.globalData.db
this.$store.commit('initUser')
this.getvodClassify()
},
async getvodClassify() {
let db = this.globalData.db
db.collection('vodClassifyList').get().then(res=>{
this.$store.commit('setVodClassifyList', res.data)
})
// var data = await this.$api.getvodClassify()
//
},
async getwxuser(token) {
var data = await this.$api.getwxuser({
token: token.replace(/\"/g, '')
})
if (data.code == 1) {
uni.setStorageSync('userInfo', JSON.stringify(data.result))
uni.setStorageSync('token', JSON.stringify(data.token))
} else {
uni.setStorageSync('userInfo', '')
uni.setStorageSync('token', '')
}
}
}
}
</script>
<style>
/*每个页面公共css */
@import "/static/alfont/iconfont.css";
/* 官方ui库 */
@import "/common/uni.css";
/* UI基础库 */
@import "/common/ZUI-main.css";
/* 公共样式 */
/* @import "/common/common.css"; */
</style>
<style lang="scss">
@import "/common/theme.scss";
</style>