Commit eaaa3980 by 陈超

T

parent a68aa4a5
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
<span class="text_10_400 color_999999 text_line_through">¥{{oldPrice}}</span> <span class="text_10_400 color_999999 text_line_through">¥{{oldPrice}}</span>
</div> </div>
<div class="weight_full layout_h_r"> <div class="weight_full layout_h_r">
<div class="vip_buy_pay_button layout_center"><span class="text_14_400 color_white">立即购买</span></div> <div @click="onBuy" class="vip_buy_pay_button layout_center"><span class="text_14_400 color_white">立即购买</span></div>
<span style="margin-right: 0.75rem;" class="text_12_400 color_999999 self_center">{{personCount}}</span> <span style="margin-right: 0.75rem;" class="text_12_400 color_999999 self_center">{{personCount}}</span>
</div> </div>
</template> </template>
...@@ -103,16 +103,6 @@ ...@@ -103,16 +103,6 @@
for(let k in p) { for(let k in p) {
this.section.push(p[k]) this.section.push(p[k])
} }
let q = "{:U('course/Video/watch',array('id'=>$_GET['id'],'s_id'=>$s_id))}"
console.log(q)
$.ajax({
type: 'POST',
url: "{:U('course/Video/watch',array('id'=>$_GET['id'],'s_id'=>$s_id))}",
dataType: "json",
success: function (data) {
console.log(data)
},
})
}, },
methods: { methods: {
onCollect: function() { onCollect: function() {
...@@ -145,13 +135,44 @@ ...@@ -145,13 +135,44 @@
} }
}, },
onBuy: function() { onBuy: function() {
if (uid <= 0) {
ui.confirm('请先登录', {
yes: that.onLogin
})
} else {
this.onToBuy()
}
}, },
onTapCourse: function(child, item) { onTapCourse: function(child, item) {
}, },
//Action
onLogin: function() { onLogin: function() {
window.location.href = "{:U('basic/Passport/login')}" window.location.href = "{:U('basic/Passport/login')}"
},
onToBuy: function() {
$.post(U("course/PayVideo/checkPay"), { vid: this.info.id }, function (data) {
if (data.status == 1) {
var url = ''
var pay_url = "{$pay_url}"
if(asb == 0){
url = "{:U('course/PayVideo/index',['vst'=>$pay_url, 'asb'=>$jmasb['one']])}"
}else if(asb == 1){
url = "{:U('course/PayVideo/index',['vst'=>$pay_url, 'asb'=>$jmasb['ep']])}"
}else if(asb == 2){
url = SITE_URL + '/pay/' + pay_url + '.html?asb=' + asb_user
}else{
url = "{:U('course/PayVideo/index',['vst'=>$pay_url])}"
}
window.location.href = url
} else if (data.status == 9) {
ui.error(data.info)
window.location.reload()
} else {
ui.error(data.info)
return false
}
}, 'json');
} }
}, },
computed: { computed: {
...@@ -290,7 +311,6 @@ ...@@ -290,7 +311,6 @@
if (data.status == 1) { if (data.status == 1) {
var url = ''; var url = '';
var pay_url = "{$pay_url}"; var pay_url = "{$pay_url}";
if(asb == 0){ if(asb == 0){
url = "{:U('course/PayVideo/index',['vst'=>$pay_url, 'asb'=>$jmasb['one']])}"; url = "{:U('course/PayVideo/index',['vst'=>$pay_url, 'asb'=>$jmasb['one']])}";
}else if(asb == 1){ }else if(asb == 1){
...@@ -300,7 +320,6 @@ ...@@ -300,7 +320,6 @@
}else{ }else{
url = "{:U('course/PayVideo/index',['vst'=>$pay_url])}"; url = "{:U('course/PayVideo/index',['vst'=>$pay_url])}";
} }
// console.log(asb,url);
window.location.href = url; window.location.href = url;
} else if (data.status == 9) { } else if (data.status == 9) {
ui.error(data.info); ui.error(data.info);
......
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