文字信息走配置

This commit is contained in:
Abin committed 2026-01-14 13:02:00 +08:00
1 parent c363e18fc2
commit 6171e514cd
6 files changed
+70 -10

No files matched your search

+27
View File
@@ -15,12 +15,27 @@ Page({
webPageCount: 1,
hasTouchBottom:false,
bannerImgName:[],
text1: wx.getStorageSync('Config')[2].value,
text2: wx.getStorageSync('Config')[3].value,
text3: wx.getStorageSync('Config')[4].value,
text4: wx.getStorageSync('Config')[11].value,
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
//获取配置
MyApi.ApiGetConfig()
.then(result => {
// 将信息存储到本地缓存中
wx.setStorageSync('Config', result);
})
.catch(err => {
// 失败后执行的代码
console.error("请求失败:"+err);
});
//获取首页banner图片
MyApi.ApiGetBannerImg()
.then(result => {
@@ -130,6 +145,18 @@ updateManager.onUpdateFailed(function () {
*/
onPullDownRefresh() {
//逻辑同onLoad()一样,略有修改
//获取配置
MyApi.ApiGetConfig()
.then(result => {
// 将信息存储到本地缓存中
wx.setStorageSync('Config', result);
})
.catch(err => {
// 失败后执行的代码
console.error("请求失败:"+err);
});
//获取小知识
MyApi.ApiGetTips()
.then(result => {