作者 郭鑫
1 个管道 的构建 通过 耗费 1 秒

雇人修改

... ... @@ -140,6 +140,27 @@ class MemberController extends CommentController
return $this->fetch('ordertail');
}
// 付款
public function toPay(){
$data = $this->request->param();
$pay = new SomepayController();
$where_order['o.id'] = $data['id'];
$where_order['o.user_id'] = Session::get('uid');
$where_order['o.status'] = 3;
$order = Db::name('Order')->alias('o')
->where($where_order)
->join("Member m",'m.id = o.user_id')
->field('m.openid,o.*')
->find();
if(!$order){
$this->apiResponse('0','订单错误');
}else{
$order['money'] = 0.01;
$pay->pay($order['openid'],$order['money'],$order['order_sn'],url('portal/Somepay/pay_notify',['order_sn'=>$order['order_sn'],'id'=>$order['id']],'',true),'青云职上');
}
}
// 取消订单/确认完成
public function changeStatus(){
$data = $this->request->param();
... ...
... ... @@ -86,7 +86,7 @@ function def() {
// 2待审核,3审核通过,待付款,4审核未通过,5已取消,6待完成,7待评价,8已评价
if(val.orderStatus == 3){
html += "<p class=\"cancelorder\" onclick='change("+val.id+",1)'>取消订单</p>\n" +
" <p class=\"sureorder\">付款</p>" ;
" <p class=\"sureorder \" onclick='toPay("+val.id+")'>付款</p>" ;
}else if(val.orderStatus == 6){
html += "<p class=\"sureorder\" onclick='change("+val.id+",2)'>确认完成</p>" ;
}else if(val.orderStatus == 7){
... ... @@ -158,33 +158,23 @@ function common(id) {
window.location.href = url;
}
//取消订单
// window.alert = function(name){
// var iframe = document.createElement("IFRAME");
// iframe.style.display="none";
// document.documentElement.appendChild(iframe);
// window.frames[0].window.alert(name);
// iframe.parentNode.removeChild(iframe);
// }
// window.confirm = function (message) {
// var iframe = document.createElement("IFRAME");
// iframe.style.display = "none";
// iframe.setAttribute("src", 'data:text/plain,');
// document.documentElement.appendChild(iframe);
// var alertFrame = window.frames[0];
// var result = alertFrame.window.confirm(message);
// iframe.parentNode.removeChild(iframe);
// return result;
// }
//
//
// $(".cancelorder").click(function(){
// window.event.stopPropagation();
// var a=confirm("是否取消订单");
// if(a==true){
// alert("取消订单")
// }
// })
// 支付
function toPay(id){
$.ajax({
type: 'POST',
url: "{:url('Member/toPay')}",
data: {
'id': id,
},
success: function (res) {
console.log(res);
},
error: function (res) {
console.log(res);
}
});
}
</script>
</body>
</html>
... ...
... ... @@ -31,6 +31,7 @@
<p class="content_name">{$list.title}</p>
<p class="content_price">¥{$list.money}/天</p>
<p class="content_date">{$list.start_time}-{$list.end_time}</p>
<p class="content_date">{$list.start_time}-{$list.end_time}</p>
</div>
<div class="companyinfo">
<p class="signcompany">
... ...