25 lines
669 B
JavaScript
25 lines
669 B
JavaScript
Page({
|
|
data: {
|
|
appVersion: '1.0.0'
|
|
},
|
|
onLoad() {
|
|
const accountInfo = wx.getAccountInfoSync();
|
|
if (accountInfo && accountInfo.miniProgram) {
|
|
this.setData({
|
|
appVersion: accountInfo.miniProgram.version || '1.0.0'
|
|
});
|
|
}
|
|
},
|
|
openDoc(e) {
|
|
if (wx.openPrivacyContract) {
|
|
wx.openPrivacyContract({
|
|
fail: () => {
|
|
wx.showToast({ title: '无法打开协议', icon: 'none' });
|
|
}
|
|
});
|
|
} else {
|
|
wx.showToast({ title: '当前微信版本不支持查看', icon: 'none' });
|
|
}
|
|
}
|
|
});
|