四端上传
This commit is contained in:
1 parent
25bbb5f9c8
commit
c6e2cb4d5b
276 files changed
+17812
-3
No files matched your search
@@ -0,0 +1,35 @@
|
||||
// pages/IndexNewCourseDetails/IndexNewCourseDetails.js
|
||||
const api = require('../../utils/api');
|
||||
|
||||
Page({
|
||||
data: {
|
||||
html: ' ',
|
||||
courseCode: '',
|
||||
courseTitle: '',
|
||||
priceYuan: '',
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
const id = options.id;
|
||||
if (!id) return;
|
||||
|
||||
api
|
||||
.getHomeCourses()
|
||||
.then((list) => {
|
||||
const item = (list || []).filter((c) => String(c.id) === String(id))[0];
|
||||
if (!item) return;
|
||||
this.setData({
|
||||
html: item.content || ' ',
|
||||
courseCode: item.courseCode || '',
|
||||
courseTitle: item.courseTitle || '',
|
||||
});
|
||||
})
|
||||
.catch((err) => console.error('[IndexNewCourseDetails] 加载失败', err));
|
||||
},
|
||||
|
||||
/** 复用付费课页面完成购买:未拥有时那里会展示价格与购买按钮。 */
|
||||
toBuy() {
|
||||
if (!this.data.courseCode) return;
|
||||
wx.navigateTo({ url: '/pages/VideoDetails/VideoDetails?code=' + this.data.courseCode });
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user