commission--yt-commit
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import { baseUrl } from "../../../request";
|
||||
const { globalImgUrl } = require("../../../request")
|
||||
|
||||
// pages/course/homepage/homepage.js
|
||||
Page({
|
||||
@ -31,10 +32,9 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
// 获取热门课程
|
||||
|
||||
getCourseList() {
|
||||
// 请求后端接口
|
||||
wx.request({
|
||||
url: baseUrl + '/course/query/hot', // ← 替换为真实接口
|
||||
@ -44,6 +44,7 @@ Page({
|
||||
},
|
||||
success: (res) => {
|
||||
if (res.data.code === 1) {
|
||||
console.log('课程列表---->',res.data.data);
|
||||
// 将后端的 data 数组绑定到 items
|
||||
this.setData({
|
||||
courseList: res.data.data
|
||||
@ -64,6 +65,13 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
this.getCourseList()
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
Reference in New Issue
Block a user