文字信息走配置
This commit is contained in:
1 parent
c363e18fc2
commit
6171e514cd
6 files changed
+70
-10
No files matched your search
@@ -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 => {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<view class="shouyetupianlist">
|
||||
<view wx:if="{{CourseList.length > 0}}" class="biaoti01">
|
||||
<image class="biaoti01img" src="{{BaseURL}}/Images/Icon/xinke.png" mode="aspectFill" />
|
||||
<text decode> 新课上线</text>
|
||||
<text decode> {{text1}}</text>
|
||||
</view>
|
||||
<view class="shouyetupianlistcontent" wx:for="{{CourseList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-number="{{index}}" bind:tap="NavigatorToIndexNewCourseDetails">
|
||||
<view class="hengxianglist" key="{{index}}">
|
||||
@@ -39,7 +39,7 @@
|
||||
<view class="shouyetupianlist">
|
||||
<view wx:if="{{FreeCourseList.length > 0}}" class="biaoti01">
|
||||
<image class="biaoti01img" src="{{BaseURL}}/Images/Icon/ziwoxuexi.png" mode="aspectFill" />
|
||||
<text decode> 自我学习</text>
|
||||
<text decode> {{text2}}</text>
|
||||
</view>
|
||||
<view class="shouyetupianlistcontent" wx:for="{{FreeCourseList}}" wx:for-item="item" wx:for-index="index" wx:key="index" data-number="{{item['序号']}}" bind:tap="NavigatorToIndexFreeCourseDetails">
|
||||
<view class="hengxianglist" key="{{index}}">
|
||||
@@ -52,7 +52,7 @@
|
||||
<view class="shouyetupianlist">
|
||||
<view wx:if="{{WebPages.length > 0}}" class="biaoti01">
|
||||
<image class="biaoti01img" src="{{BaseURL}}/Images/Icon/sutong.png" mode="aspectFill" />
|
||||
<text decode> 知识速通</text>
|
||||
<text decode> {{text3}}</text>
|
||||
</view>
|
||||
|
||||
<view class="shouyetupianlistcontent01" wx:for="{{WebPages}}" wx:for-item="imageshuzu" wx:for-index="index" wx:key="index" bind:tap="NavigatorToWebPageDetails" data-index="{{index}}">
|
||||
@@ -67,7 +67,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view style="width: auto; margin: 0px auto; margin-bottom: 10px;">
|
||||
<text wx:if="{{hasTouchBottom}}">已经到底啦!</text>
|
||||
<text wx:if="{{hasTouchBottom}}">{{text4}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
Reference in new issue
Block a user