大修改
This commit is contained in:
1 parent
a1cbc9404a
commit
e81481623c
47 files changed
+1453
-285
No files matched your search
@@ -1,5 +1,8 @@
|
||||
// pages/IndexNewCourseDetails/IndexNewCourseDetails.js
|
||||
const api = require('../../utils/api');
|
||||
const store = require('../../utils/store');
|
||||
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
data: {
|
||||
@@ -7,6 +10,8 @@ Page({
|
||||
courseCode: '',
|
||||
courseTitle: '',
|
||||
priceYuan: '',
|
||||
buyText: '',
|
||||
contactText: '',
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
@@ -27,9 +32,21 @@ Page({
|
||||
.catch((err) => console.error('[IndexNewCourseDetails] 加载失败', err));
|
||||
},
|
||||
|
||||
/** 复用付费课页面完成购买:未拥有时那里会展示价格与购买按钮。 */
|
||||
onShow() {
|
||||
app.ready().then(() => this.applyConfig());
|
||||
},
|
||||
|
||||
/** 按钮文案取自后台配置,后台改完小程序下拉刷新即可生效。 */
|
||||
applyConfig() {
|
||||
this.setData({
|
||||
buyText: store.cfg('course.button.buy'),
|
||||
contactText: store.cfg('course.button.contact'),
|
||||
});
|
||||
},
|
||||
|
||||
/** 购买统一走商业化页面。 */
|
||||
toBuy() {
|
||||
if (!this.data.courseCode) return;
|
||||
wx.navigateTo({ url: '/pages/VideoDetails/VideoDetails?code=' + this.data.courseCode });
|
||||
wx.navigateTo({ url: '/pages/buy/buy?code=' + this.data.courseCode });
|
||||
},
|
||||
});
|
||||
@@ -4,10 +4,10 @@
|
||||
<view class="fixed-btn-wrapper">
|
||||
<view class="btn-group">
|
||||
<button wx:if="{{courseCode}}" class="DianJiXiangQing1" bind:tap="toBuy">
|
||||
<text class="DianJiXiangQing2">立即购买</text>
|
||||
<text class="DianJiXiangQing2">{{buyText}}</text>
|
||||
</button>
|
||||
<button class="DianJiXiangQing1" open-type="contact" bindcontact="handleContact">
|
||||
<text class="DianJiXiangQing2">咨询客服</text>
|
||||
<text class="DianJiXiangQing2">{{contactText}}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
Reference in new issue
Block a user