代码拉取完成,页面将自动刷新
App({
onLaunch: function (options) {
const updateManager = wx.getUpdateManager();
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '全新的「轻航」已经准备好,请更新重启轻航',
showCancel: false,
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
var that = this;
wx.getSystemInfo({
success: function success(res) {
that.globalData.isIphoneX = res.model.match(/iPhone X/gi)
that.globalData.StatusBar = res.statusBarHeight;
that.globalData.screenHeight = res.screenHeight;
let capsule = wx.getMenuButtonBoundingClientRect();
if (capsule) {
that.globalData.Custom = capsule;
that.globalData.CustomBar = capsule.bottom + capsule.top - res.statusBarHeight;
} else {
that.globalData.CustomBar = res.statusBarHeight + 80;
}
that.globalData.statusBarHeight = res.statusBarHeight;
that.globalData.platform = res.platform;
if (res.model.search("iPhone X") != -1) {
that.globalData.isIpx = true;
} else if (res.model.search("iPhone 11") != -1 || res.model.search("iPhone 12") != -1) {
that.globalData.isIp11 = true;
}
if (res.platform != "devtools") {
wx.setInnerAudioOption({
obeyMuteSwitch: false
});
}
}
});
},
modalTip: function (t) {
var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 2500;
wx.showToast({
title: t,
icon: "none",
mask: !0,
duration: e
});
},
showLoading: function () {
var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : "加载中...";
wx.showLoading({
title: t,
mask: !0,
success: function (t) {}
});
},
onShow: function () {},
globalData: {
isIphoneX: '',
screenHeight: 0,
statusBarHeight: 0,
isIpx: false,
platform: "",
qhTheme: "default",
shareTitle: "轻航,专属互联网人的内容兴趣社区",
}
})
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。