Commit a632f3ac by 陈超

A

parent fe6dde6a
...@@ -33,13 +33,13 @@ ...@@ -33,13 +33,13 @@
我已阅读并同意<a href="{:U('basic/Single/info',array('id'=>'buy'))}"><span class="color_primary">《{$site['site_keyword']}购买协议》</span></a> 我已阅读并同意<a href="{:U('basic/Single/info',array('id'=>'buy'))}"><span class="color_primary">《{$site['site_keyword']}购买协议》</span></a>
</div> </div>
</div> </div>
<!-- <div class="layout_h_v_c fixed_bottom_bar"> <div class="layout_h_v_c fixed_bottom_bar">
<span class="text_14_600 color_333333" style="margin-right: 0.5rem;">合计</span> <span class="text_14_600 color_333333" style="margin-right: 0.5rem;">合计</span>
<span class="text_14_600 color_FF3B3B">¥{$price}</span> <span class="text_14_600 color_FF3B3B">111</span>
<div class="weight_full layout_h_r"> <div class="weight_full layout_h_r">
<div @click="onBuy({$id}, 'exam')" 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>
</div> </div>
</div> --> </div>
</div> </div>
<script> <script>
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
data: function() { data: function() {
return { return {
agree: false, agree: false,
examId: "{$exams_paper_id}",
info: {} info: {}
} }
}, },
...@@ -56,7 +57,7 @@ ...@@ -56,7 +57,7 @@
}, },
computed: { computed: {
totalPrice: function() { totalPrice: function() {
return "111" return "${price}"
}, },
discount: function() { discount: function() {
return "(已优惠:¥0)" return "(已优惠:¥0)"
...@@ -65,49 +66,36 @@ ...@@ -65,49 +66,36 @@
methods: { methods: {
onBuy: function(id, type) { onBuy: function(id, type) {
let that = this let that = this
if(MID<=0){
ui.confirm('请先登录', {
yes: function () {
window.location.href = "{:U('basic/Passport/login')}";
}
});
}
if(that.agree) { if(that.agree) {
$.post( $.ajax({
U("course/PayVideo/checkPayOperat"), url: "{:U('course/PayVideo/payLibraryExams')}",
{ data: {
check_type: '{$pay_video_type}', paper_id: that.examId,
mid: MID, mid: MID,
vid: id, money: that.totalPrice,
pay: "wxpay", pay: "wxpay",
money: "{$moner_data['oriPrice']}", vst: "{$_GET['vst']}"
}, },
function(data) { async:false,
let res = JSON.parse(data) type:'post',
if(res.status == 1) { success: function(data){
that.startWxPay(id) if(data.status == 1) {
} else {
ui.error(res.info) } else {
} ui.error(data.info ? data.info : data.data)
}) }
})
} else { } else {
ui.error('请阅读并同意购买协议') ui.error('请阅读并同意购买协议')
} }
}, },
startWxPay: function(id) {
$.ajax({
url: "{:U('course/PayVideo/payLibrary')}",
data:{
check_type: '{$pay_video_type}',
mid: MID,
vid: id,
pay: "wxpay",
money: "{$moner_data['oriPrice']}",
},
async:false,
type:'post',
success: function(data){
let res = JSON.parse(data)
if(res.status == 1) {
} else {
ui.error(res.data)
}
}})
},
checkPayStatus: function(num) { checkPayStatus: function(num) {
let that = this let that = this
$.ajax({ $.ajax({
......
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