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,48 +66,35 @@ ...@@ -65,48 +66,35 @@
methods: { methods: {
onBuy: function(id, type) { onBuy: function(id, type) {
let that = this let that = this
if(that.agree) { if(MID<=0){
$.post( ui.confirm('请先登录', {
U("course/PayVideo/checkPayOperat"), yes: function () {
{ window.location.href = "{:U('basic/Passport/login')}";
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)
} }
}) });
} else {
ui.error('请阅读并同意购买协议')
} }
}, if(that.agree) {
startWxPay: function(id) {
$.ajax({ $.ajax({
url: "{:U('course/PayVideo/payLibrary')}", url: "{:U('course/PayVideo/payLibraryExams')}",
data:{ 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']}"
}, },
async:false, async:false,
type:'post', type:'post',
success: function(data){ success: function(data){
let res = JSON.parse(data) if(data.status == 1) {
if(res.status == 1) {
} else { } else {
ui.error(res.data) ui.error(data.info ? data.info : data.data)
}
})
} else {
ui.error('请阅读并同意购买协议')
} }
}})
}, },
checkPayStatus: function(num) { checkPayStatus: function(num) {
let that = this let that = this
......
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