Commit bdafe2c4 by 冷斌

fix bug

parent 6dc489dd
...@@ -59,13 +59,13 @@ ...@@ -59,13 +59,13 @@
<div v-if="item.price == 0" class="layout_h"> <div v-if="item.price == 0" class="layout_h">
<div class="home_item_mark_green layout_center">免费</div> <div class="home_item_mark_green layout_center">免费</div>
<span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-right: 1.5rem;margin-left: 0.625rem;">{{item.title}}</span> <span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-right: 1.5rem;margin-left: 0.625rem;">{{item.title}}</span>
<div @click="onItem(item)" class="home_button_green layout_center">开始做题</div> <div @click="onStart(item.id)" class="home_button_green layout_center">开始做题</div>
</div> </div>
<div v-else class="layout_h"> <div v-else class="layout_h">
<div class="home_item_mark_orange layout_center">{{item.is_buy ? "免费" : "付费" }}</div> <div class="home_item_mark_orange layout_center">{{item.is_buy ? "免费" : "付费" }}</div>
<span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-right: 1.5rem;margin-left: 0.625rem;">{{item.title}}</span> <span class="text_14_600 color_333333 weight_full van-multi-ellipsis--l2" style="margin-right: 1.5rem;margin-left: 0.625rem;">{{item.title}}</span>
<div v-if="item.is_buy" @click="onItem(item)" class="home_button_green layout_center">开始做题</div> <div v-if="item.is_buy" @click="onStart(item.id)" class="home_button_green layout_center">开始做题</div>
<div v-else class="home_button_orange layout_center">¥{{item.price}}</div> <div v-else @click="onPay(item.id)" class="home_button_orange layout_center">¥{{item.price}}</div>
</div> </div>
<div class="layout_h_b" style="margin-top: 0.5rem;"> <div class="layout_h_b" style="margin-top: 0.5rem;">
<span class="text_14_600 color_FF3B3B">¥{{item.price}}</span> <span class="text_14_600 color_FF3B3B">¥{{item.price}}</span>
...@@ -238,6 +238,45 @@ ...@@ -238,6 +238,45 @@
this.onLoad() this.onLoad()
} }
}, },
onPay: function(id) {
console.log("Id = " + id)
if (MID <= 0) {
ui.confirm('请先登录', {
yes: function() {
window.location.href = "{:U('basic/Passport/login')}";
}
})
return
}
$.ajax({
type: "POST",
url: "{:U('exams/index/getPayUrl')}",
data: {
paper_id: id,
},
dataType: "json",
success: function(res) {
var res = getResponseData(res)
if (res.status == 1) {
window.location.href = res.data
} else {
ui.error(res.message)
}
}
})
},
onStart: function(id) {
if (MID <= 0) {
ui.confirm('请先登录', {
yes: function() {
window.location.href = "{:U('basic/Passport/login')}";
}
})
return
}
let url = "{:U('exams/index/examsroom')}" + "&paper_id=" + id + "&joinType=1"
window.location.href = url
}
onLoad: function() { onLoad: function() {
let that = this let that = this
let opt = that.options[that.tab] let opt = that.options[that.tab]
......
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