123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <script>
- export default {
- globalData: {
- privacyContractName: '',
- showPrivacy: false,
- memberInfo: null,
- uid: null
- },
- onLaunch: function() {
- let that = this;
-
- wx.getPrivacySetting({
- success(res) {
- console.log('是否需要授权:', res.needAuthorization, '隐私协议的名称为:', res.privacyContractName);
- if (res.needAuthorization) {
- that.globalData.privacyContractName = res.privacyContractName;
- that.globalData.showPrivacy = true;
- } else {
- that.globalData.showPrivacy = false;
- }
- }
- });
- if (wx.canIUse('getUpdateManager')) {
- const updateManager = wx.getUpdateManager();
- updateManager.onCheckForUpdate(function(res) {
-
- if (res.hasUpdate) {
- updateManager.onUpdateReady(function() {
- that.tui.modal('更新提示', '新版本已经上线啦~,为了获得更好的体验,建议立即更新', false, res => {
-
- updateManager.applyUpdate();
- });
- });
- updateManager.onUpdateFailed(function() {
-
- that.tui.modal('更新失败', '新版本更新失败,为了获得更好的体验,请您删除当前小程序,重新搜索打开', false,
- res => {});
- });
- }
- });
- }
-
- },
- onShow: function() {
-
- },
- onHide: function() {
-
- },
- onError: function(err) {
-
-
- plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
- const res = uni.getSystemInfoSync();
- let errMsg =
- `手机品牌:${res.brand};手机型号:${res.model};操作系统版本:${res.system};客户端平台:${res.platform};错误描述:${err}`;
- console.log('发生错误:' + errMsg);
- });
-
- }
- };
- </script>
- <style>
- @import './common/app.css';
- </style>
|