Commit a632f3ac by 陈超

A

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