Commit 43add255 by tangjinlin

0517

parent 692941d9
......@@ -8,6 +8,7 @@ Page({
*/
data: {
mediaId: 0,
courseId: '',
courseTitle: '',
teacherName: '',
teacherProfile: '',
......@@ -20,7 +21,8 @@ Page({
fufeiPage: 0,
playUrl: '',
detailComment: '',
money: 0,
price: 0,//购买价格,合集则为合集价格,单个视频则为单个视频的价格
haveBuy:false,//是否已经购买
subTab1: true,
subTab2: false
},
......@@ -90,7 +92,8 @@ Page({
}
},
cliLearn(e) {
//点击观看处理
learn(e) {
var that = this;
let id = e.currentTarget.dataset['id'];
wx.getStorage({
......@@ -100,6 +103,7 @@ Page({
wx.request({
url: app.url + 'ajax_get_play_media_detail.php',
data: {
courseId: that.data.courseId,
mediaId: id,
unionId: res.data.unionId
},
......@@ -116,7 +120,7 @@ Page({
that.setData({
playUrl: resp.data.result.courseMediaDat.media,
fufeiPage: 1,
money: resp.data.result.courseMediaDat.price
price: resp.data.result.courseMediaDat.price
})
}
}
......@@ -134,6 +138,7 @@ Page({
// play:1
// })
},
// 查询课程详细
classDetails() {
var that = this;
......@@ -153,6 +158,7 @@ Page({
console.log(res)
if (res.statusCode == 200) {
that.setData({
courseId: res.data.result.courseId,
courseTitle: res.data.result.courseTitle,
teacherName: res.data.result.teacherName,
teacherProfile: res.data.result.teacherProfile,
......@@ -162,14 +168,22 @@ Page({
updateTime: res.data.result.updateTime,
viewCount: res.data.result.viewCount,
mediaList: res.data.result.mediaList,
money: res.data.result.price
price: res.data.result.price
})
//判断为单个还是合集
if (res.data.result.courseId==0) {
that.setData({
price: res.data.result.mediaList[0].price
})
}
}
},
fail: function (res) {},
complete: function (res) {},
})
},
//合集点击明细处理
videoplay() {
if (this.data.show1) {
this.setData({
......@@ -196,6 +210,7 @@ Page({
play: 0
})
},
// 付费观看
fufeilook() {
var config = wx.getStorageSync('config');
......
......@@ -25,7 +25,7 @@
<view>课程介绍</view>
<view>{{courseComment}}</view>
</view>
<view class="content1" wx:if="{{mediaList.length > 1}}">
<view class="content1" wx:if="{{courseId > 0}}">
<view class="sub_title">
<view class="sub" bindtap='subTab' data-index="1">
<text>相关详情</text>
......@@ -47,7 +47,8 @@
<block wx:for="{{mediaList}}">
<view class="catalog">
<text bindtap='videoplay'>{{item.title}}</text>
<image src='/img/suo1.png' class='suo' wx:if="{{!item.haveBuy&&!item.is_free}}"></image>
<image src='/img/suo1.png' class='suo' wx:if="{{!haveBuy&&price>0}}" bindtap=""></image>
<image src='/img/sanjiao.png' class='suo' wx:if="{{haveBuy||price==0}}" bindtap="playCourse"></image>
</view>
</block>
</view>
......@@ -59,9 +60,13 @@
<image src="/img/share.png"></image>
课程分享
</view>
<!-- <view class="buyBtn" wx:if="{{mediaList.length > 1 && !check}}">课程金额:{{money}}</view> -->
<view class="buyBtn" wx:if="{{mediaList.length > 1}}" bindtap="cliLearn" data-id="{{mediaId}}">课程金额:{{money}}</view>
<view class="buyBtn" wx:if="{{mediaList.length==1}}" bindtap="cliLearn" data-id="{{mediaList[0].id}}">课程金额:{{mediaList[0].price}}</view>
<!-- 单个课程 -->
<view class="buyBtn" wx:if="{{courseId==0 && haveBuy==false && price > 0}}" bindtap="learn" data-id="{{mediaId}}">课程金额:{{price}}</view>
<view class="buyBtn" wx:elif="{{courseId==0}}" bindtap="learn" data-id="{{mediaId}}">学习</view>
<!-- 合集课程 -->
<view class="buyBtn" wx:if="{{courseId>0 && haveBuy==false && price > 0}}" bindtap="learn" data-id="{{mediaId}}">课程金额:{{price}}</view>
<view class="buyBtn" wx:elif="{{courseId>0}}" bindtap="learn" data-id="{{mediaId}}">学习</view>
</view>
</view>
<view class='play' wx:if="{{play==1}}">
......@@ -85,7 +90,7 @@
<view style="margin-top:70px;">
付费金额
</view>
<view style="margin: 10px 0 50px;font-size: 18px;"><text style="color:red;">¥{{money}}</text></view>
<view style="margin: 10px 0 50px;font-size: 18px;"><text style="color:red;">¥{{price}}</text></view>
<view style="color: #898989;font-size: 12px">费用用途:所收金额全部用于公益用途</view>
<view class='fufeiBtn'>
<view style="background: linear-gradient(to right, #e85c6d, #fb689b);color:#fff" bindtap='surefufei'>确认</view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment