Commit 41e02cb8 by 陈超

A

parent 8d3ba022
......@@ -108,7 +108,38 @@
},
onBuy: function() {
if(MID <= 0) {
ui.confirm('请先登录', {
yes: function () {
window.location.href = "{:U('basic/Passport/login')}";
}
})
return
}
let that = this
if(!that.hasAddress) {
ui.error("请选择收货地址")
return
}
if(!that.agree) {
ui.error("购买必须同意《{$site['site_keyword']}购买协议》")
return
}
$.ajax({
url: "{:U('classroom/Pay/buyGoods')}",
data: {
goods_id: that.info.uid,
total: that.totalPrice,
count: that.count,
address_id: that.address.id,
pay: "wx"
},
async:false,
type:'post',
success: function(res) {
console.log(res)
}
})
},
onAddress: function() {
......
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