美化了样式3.0
This commit is contained in:
@ -6,14 +6,8 @@ const { notLogin } = require('../../../utils/util')
|
||||
Page({
|
||||
|
||||
data: {
|
||||
// 初始时置空,待接口返回后再渲染
|
||||
banners: [
|
||||
'./image/banner.png',
|
||||
'./image/banner.png',
|
||||
'./image/banner.png',
|
||||
'./image/banner.png'
|
||||
],
|
||||
courseList: [],
|
||||
bannerList: [],
|
||||
globalImgUrl
|
||||
},
|
||||
|
||||
@ -70,10 +64,37 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
getBannerList() {
|
||||
const token = wx.getStorageSync('token')
|
||||
wx.request({
|
||||
url: baseUrl + '/banner/mini/list',
|
||||
method: 'GET',
|
||||
header: {
|
||||
'Authorization': token
|
||||
},
|
||||
success: res => {
|
||||
if (res.data.code === 1) {
|
||||
this.setData({
|
||||
bannerList: res.data.data
|
||||
});
|
||||
} else {
|
||||
notLogin(res.data.message)
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.showToast({
|
||||
title: '网络异常,请稍后重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
onLoad() {
|
||||
this.getBannerList()
|
||||
this.getCourseList()
|
||||
},
|
||||
|
||||
|
Reference in New Issue
Block a user