setting-message.js
928 Bytes
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
import wx from '../../utils/wx.js';
Component({
/**
* 组件的属性列表
*/
properties: {
showMsg: {
type: Boolean,
value: false
},
messageTitle: {
type: String,
value: ''
}
},
/**
* 组件的初始数据
*/
data: {
showMsg: false
},
/**
* 组件的方法列表
*/
methods: {
closeMsg: function() {
this.setData({
showMsg: false
})
},
/**
* 微信修改打开设置的机制之后按钮班定了打开设置的方法
*/
openSetting: function () {
wx.openSetting().then(res => {
this.setData({
showMsg: false
});
this.triggerEvent('myevent',
{
hasLocationSetting: res.authSetting['scope.userLocation'] || false,
hasImageSetting: res.authSetting['scope.writePhotosAlbum'] || false
},
{});
});
},
}
})