美化了样式3.0

This commit is contained in:
2025-08-15 14:15:10 +08:00
parent 23ab2798d8
commit f47e375bfa
12 changed files with 103 additions and 42 deletions

View File

@ -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()
},