59 lines
1.2 KiB
JavaScript
59 lines
1.2 KiB
JavaScript
// pages/course/courseDetail/courseDetail.js
|
|
Page({
|
|
data: {
|
|
items: [null, null, null,null, null, null],
|
|
activeTab: 'intro', // 默认选中“课程简介”
|
|
activeIndex: null, // 默认没有任何标题被选中
|
|
},
|
|
|
|
/** 切换选项卡 */
|
|
selectTab(e) {
|
|
const tab = e.currentTarget.dataset.tab;
|
|
this.setData({ activeTab: tab });
|
|
},
|
|
|
|
/** 选择课程标题 */
|
|
selectCourse(e) {
|
|
const index = e.currentTarget.dataset.index;
|
|
this.setData({
|
|
activeIndex: index // 设置选中的课程标题索引
|
|
});
|
|
},
|
|
|
|
// 跳转课程订单创建页面
|
|
gotoCourseOrder(e) {
|
|
const courseId = e.currentTarget.dataset.id;
|
|
wx.navigateTo({
|
|
url: `/pages/course/createCourseOrder/createCourseOrder?id=${courseId}`,
|
|
})
|
|
},
|
|
|
|
// 跳转申请推广页面
|
|
gotoApplyPromotion(e) {
|
|
const courseId = e.currentTarget.dataset.id;
|
|
wx.navigateTo({
|
|
url: `/pages/course/applyPromotion/applyPromotion?id=${courseId}`,
|
|
})
|
|
},
|
|
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad(options) {},
|
|
|
|
onReady() {},
|
|
|
|
onShow() {},
|
|
|
|
onHide() {},
|
|
|
|
onUnload() {},
|
|
|
|
onPullDownRefresh() {},
|
|
|
|
onReachBottom() {},
|
|
|
|
onShareAppMessage() {}
|
|
});
|