初始化

This commit is contained in:
zhu
2026-03-27 13:29:41 +08:00
commit ee03132cee
112 changed files with 6417 additions and 0 deletions

58
app.js Normal file
View File

@@ -0,0 +1,58 @@
// app.js
App({
towxml: require('/towxml/index'),
globalData: {
userInfo: null
},
onLaunch() {
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
console.log('检查更新');
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '更新提示',
content: '新版本下载失败',
showCancel: false
})
})
},
})
! function () {
//获取页面配置并进行页面分享配置
var PageTmp = Page
Page = function (pageConfig) {
//全局开启分享
pageConfig = Object.assign({
onShareAppMessage: function () {
return {
title: "分享标题",
path: "/pages/home/index",
imageUrl: ""
};
},
onShareTimeline() {
return {
title: "分享标题",
path: "/pages/home/index",
};
}
}, pageConfig);
PageTmp(pageConfig);
}
}();