Commit 45086c3d by 陈超

A

parent 0b60bd44
<include file="__THEME__/public_header_w3g" />
<style>
body {
padding: 0 !important;
}
......@@ -30,7 +31,7 @@
</van-tab>
</van-tabs>
<div class="layout_h course_detail_share">
<van-icon size="16" :name="shareIcon" style="margin-right: 1rem;"></van-icon>
<van-icon @click="onCollect" size="16" :name="shareIcon" style="margin-right: 1rem;"></van-icon>
<van-icon size="16" name="__THEME__/img/share_line.png"></van-icon>
</div>
</van-sticky>
......@@ -102,6 +103,42 @@
this.section.push(p[k])
}
},
methods: {
onCollect: function() {
let that = this
if (uid <= 0) {
ui.confirm('请先登录', {
yes: that.onLogin
})
} else {
$.ajax({
type: 'POST',
url: "{:U('classroom/Public/collect')}",
data: {
type: this.isCollect ? 0 : 1,
sctype: 2,
source_id: this.info.id,
is_video: 1
},
dataType: "json",
cache: false,
success: function (data) {
if (data.status == '0') {
ui.error(data.info)
} else {
ui.success(data.info)
}
},
})
}
},
onTapCourse: function(course) {
},
onLogin: function() {
window.location.href = "{:U('basic/Passport/login')}"
}
},
computed: {
isCollect: function() {
return this.info.iscollect == 1
......@@ -160,15 +197,6 @@
<script type="text/javascript">
//window.location.href = "{:U('basic/Passport/login')}";
// function payCourseHour() {
// if (uid <= 0) {
// ui.confirm('请先登录', {
// yes: login_fun()
// });
// return false;
// }
// }
//解锁课时提示
// $(".learn_note").click(function(){
// ui.error('请先购买课程');
......
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