Commit 45086c3d by 陈超

A

parent 0b60bd44
<include file="__THEME__/public_header_w3g" /> <include file="__THEME__/public_header_w3g" />
<style> <style>
body { body {
padding: 0 !important; padding: 0 !important;
} }
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
</van-tab> </van-tab>
</van-tabs> </van-tabs>
<div class="layout_h course_detail_share"> <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> <van-icon size="16" name="__THEME__/img/share_line.png"></van-icon>
</div> </div>
</van-sticky> </van-sticky>
...@@ -102,6 +103,42 @@ ...@@ -102,6 +103,42 @@
this.section.push(p[k]) 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: { computed: {
isCollect: function() { isCollect: function() {
return this.info.iscollect == 1 return this.info.iscollect == 1
...@@ -159,15 +196,6 @@ ...@@ -159,15 +196,6 @@
<script type="text/javascript"> <script type="text/javascript">
//window.location.href = "{:U('basic/Passport/login')}"; //window.location.href = "{:U('basic/Passport/login')}";
// function payCourseHour() {
// if (uid <= 0) {
// ui.confirm('请先登录', {
// yes: login_fun()
// });
// return false;
// }
// }
//解锁课时提示 //解锁课时提示
// $(".learn_note").click(function(){ // $(".learn_note").click(function(){
......
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