作者 lihan

订单详情分批次退款

... ... @@ -26,6 +26,9 @@ class CouponModel extends Model
$y = 0;
$z = 0;
$map['user_id'] = array('eq', $user_id);
$data['unused'] = [];
$data['used'] = [];
$data['expired'] = [];
$res = Db::name('discount_coupon')->field('reduce,discount_coupon_name,deadline,status')->where($map)->order('status')->select()->toArray();
foreach ($res as $key => $item) {
$item['deadline'] = date('Y.m.d', $item['deadline']);
... ...
... ... @@ -245,21 +245,28 @@ class CenterController extends HomeBaseController
$info['status_text'] = getOrderStatusText($info['status']);
$info['count'] = Db::name('order_detail')->where(['oid' => $oid])->count();
$escort = Db::name('order_detail')->alias('d')
->field('d.id,d.status,e.name,e.tel')
->field('d.id,d.status,d.reason,e.name,e.tel')
->join('escort e', 'e.id=d.escort_id')
->where(['oid' => $oid])
->select();
foreach ($escort as $k => $v) {
$v['count'] = 1;
$v['down_price'] = $info['down_price'];
$v['bar'] = $this->progressBar($v['status']);
$escort[$k] = $v;
}
$return = [
'baseInfo' => $info,
'escort' => $escort
];
echo json_encode(['data' => $return, 'code' => 20000]);
exit();
if ($request->isPost()) {
echo json_encode(['data' => $return, 'code' => 20000]);
exit();
} else {
return $this->fetch(':order_detail', [
'data' => $return
]);
}
}
/**
... ... @@ -305,4 +312,106 @@ class CenterController extends HomeBaseController
]);
}
//进度条
private function progressBar($status)
{
if ($status == 2) {
$bar = '<div class="faqi_out">
<div class="circle_main active_circle">
<span class="circle">
</span>
<span class="fa">
发起退款待审核中
</span>
</div>
<div class="circle_main active_circle">
<span class="circle">
</span>
<span class="fa">
审核通过
</span>
<span class="span_line"></span>
</div>
<div class="circle_main active_circle">
<span class="circle">
</span>
<span class="fa">
已退款
</span>
<span class="span_line"></span>
</div>
</div>';
} elseif ($status == 3) {
$bar = '<div class="faqi_out">
<div class="circle_main active_circle">
<span class="circle">
</span>
<span class="fa">
发起退款待审核中
</span>
</div>
<div class="circle_main">
<span class="circle">
<i class="iconfont icon-chahao" id="icon-chahao"></i>
</span>
<span class="fa ">
审核不通过
</span>
<span class="span_line"></span>
</div>
<div class="circle_main ">
<span class="circle">
</span>
<span class="fa">
已退款
</span>
<span class="span_line"></span>
</div>
</div>';
} else {
$bar = '<div class="faqi_out">
<div class="circle_main active_circle">
<span class="circle">
</span>
<span class="fa">
发起退款待审核中
</span>
</div>
<div class="circle_main">
<span class="circle">
</span>
<span class="fa ">
</span>
<span class="span_line"></span>
</div>
<div class="circle_main ">
<span class="circle">
</span>
<span class="fa">
</span>
<span class="span_line"></span>
</div>
</div>';
}
return $bar;
}
public function refund()
{
$request = request();
if ($request->isAjax()) {
$id = $request->param('id');
$data = [
'id' => $id,
'status' => 1,
'cause' => $request->param('cause'),
];
if (Db::name('order_detail')->update($data)) {
$this->success('', '', true);
}
}
}
}
\ No newline at end of file
... ...
... ... @@ -88,10 +88,12 @@ body{
outline: none;
border: 1px solid #3988E5;
background: #fff;
padding: 0.1rem 0.3rem;
/*padding: 0.1rem 0.3rem;*/
color: #3988E5;
border-radius:0.05rem ;
font-size: 0.31rem;
position: relative;
top: -40px;
}
.confirmed{
font-size:0.28rem;
... ... @@ -158,11 +160,12 @@ body{
padding:0.1rem 0.2rem;
width: 6rem;
height: 3rem;
align-items: center;
align-items: center;
display: flex;
flex-direction: column;
border:0.01rem solid #ccc;
top:7rem;left: 0.5rem;
flex-direction: column;
border:0.01rem solid #ccc;
top:1rem;
left: 0.5rem;
}
textarea{
outline: none;
... ... @@ -179,14 +182,14 @@ textarea{
position: fixed;
height: 100%;
width: 100%;
z-index: 999
}
.icon-chahao{
position: absolute;
right: 0.12rem;
top: 0.08rem;
color:#000;
/*color:#000;*/
}
.refund_reason_submit{
... ...
... ... @@ -56,9 +56,11 @@
</div>
</div>
</a>
<div class="sub_out">
<ul class="sub">
<a href="{:url('user/Center/orderList',['status'=>1])}">
<li>
<span >
<i class="iconfont icon-daizhifu"></i>
... ... @@ -67,17 +69,19 @@
待付定金
</span>
</li>
</a>
<a href="{:url('user/Center/orderList',['status'=>2])}">
<li>
<span >
<span>
<i class="iconfont icon-dingdanyizhifu"></i>
</span>
<span class="dai">
已付定金
</span>
</li>
</a>
<a href="{:url('user/Center/orderList',['status'=>3])}">
<li>
<span >
<i class="iconfont icon-daishouhuo"></i>
... ... @@ -86,18 +90,18 @@
待付尾款
</span>
</li>
</a>
<a href="{:url('user/Center/orderList',['status'=>4])}">
<li>
<span >
<i class="iconfont icon-daiwancheng"></i>
</span>
<span class="dai">
待完成
已付尾款
</span>
</li>
</a>
<a href="{:url('user/Center/orderList',['status'=>5])}">
<li>
<span >
<i class="iconfont icon-pingjia"></i>
... ... @@ -106,10 +110,10 @@
待评价
</span>
</li>
</a>
</ul>
</div>
</a>
<a href="{:url('Center/discountCoupon')}">
<div class="wallet">
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<script type="text/javascript" src="__TMPL__/static/js/base.js"></script>
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/weui.min.css" />
<link rel="stylesheet" type="text/css" href="__TMPL__/static/assets/css/swiper-3.4.2.min.css" />
<link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_773803_5o00hpwhlb.css" />
<script type="text/javascript" src="__TMPL__/static/assets/font/iconfont.js">
</script>
<link rel="stylesheet" href="__TMPL__/static/css/paybalance.css" />
<link rel="stylesheet" href="__TMPL__/static/css/common.css"/>
<link rel="stylesheet" href="__TMPL__/static/css/payed.css" />
<style type="text/css">
.bot_reason {
display: none;
}
</style>
</head>
<body>
<div class="good">
<span>订单号:{$data.baseInfo.order_sn}</span>
<span class="confirmed">{$data.baseInfo.status_text}</span>
</div>
<div class="goods">
<div class="pic_row">
<span class="rock">
<span class="pic">
<img src="{$data.baseInfo.thumb}" alt="" style=" width: 2.04rem; height: 0.98rem;" />
</span>
<span class="two">
<span>{$data.baseInfo.name}</span>
<span class="price">
<span>定金 ¥{$data.baseInfo.down_price}</span>
<span>价格 ¥{$data.baseInfo.price}</span>
</span>
</span>
</span>
</div>
<span class="five">
x{$data.baseInfo.count}
</span>
</div>
<div class="list">
<div class="title">{$data.baseInfo.status_text}</div>
<volist name="data.escort" id="vo" key="k">
<div class="caned_out caned_bottom">
<div class="caned">
<div class="real">出行人{$k}:{$vo.name} {$vo.tel} x1 定金{$vo.down_price}</div>
<if condition="$vo['status'] neq '0'">
<div class="refundmoneyed">
<span>已发起退款</span>
<i class="iconfont icon-iconset0413"></i>
</div>
<else/>
<span id="B_{$vo.id}" style="height: 30px">
<button class="cancel" id="escort_{$vo.id}" data-id="{$vo.id}">退款</button>
</span>
</if>
</div>
<div class="refund_main_out">
<div class="refund">
<span class="tui">
退款进度
</span>
<if condition="$vo['status'] eq '3'">
<span class="tui reson">查看原因</span>
</if>
</div>
{$vo.bar}
</div>
<div class="bot_reason">
<div class="bottom_reason">
<span>{$vo.reason}</span>
</div>
</div>
</div>
</volist>
<!--点击取消填写退款原因-->
<div class="refund_reason_out" id="refund_reason_out">
<div class="refund_reason">
<i class="iconfont icon-chahao"></i>
<textarea id="T" name="" rows="" cols="" placeholder="请填写申请退款原因"></textarea>
<button class="refund_reason_submit">提交</button>
</div>
</div>
<!--提交后toast的提示-->
<div id="toast" style='display: none;'>
<div class="weui-mask_transparent"></div>
<div class="weui-toast">
<!--<i class="weui-icon-success-no-circle weui-icon_toast"></i>-->
<p class="weui-toast__content">已完成</p>
</div>
</div>
<div class="footer_out">
<div class="footer ok">
立即支付
</div>
</div>
<!--选择支付方式-->
<div class='move1'>
<div class='move_main1'>
<div class="shang2">
<div class="shang1">
<span class="choose">
选择支付方式
</span>
</div>
<div class="shang1 shan1 shang_list">
<div class="shang1_inner">
<div class="img_out">
<img src="__TMPL__/static/images/yue.png" alt="" class="yue" />
</div>
<div>
余额支付
</div>
</div>
<div>
<i class='iconfont icon-xuanzhong2'></i>
</div>
</div>
<div class="shang1 shan1">
<div class="shang1_inner">
<div class="img_out">
<img src="__TMPL__/static/images/wei.png" alt="" class="yue" />
</div>
<div>
微信支付
</div>
</div>
<div>
<i class='iconfont'></i>
</div>
</div>
<div class="shang1 shan1">
<div class="shang1_inner">
<div class="img_out">
<img src="__TMPL__/static/images/zhi.png" alt="" class="yue" />
</div>
<div>
支付宝支付
</div>
</div>
<div>
<i class='iconfont'></i>
</div>
</div>
<div class="agreepay">
确认支付
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<script type="text/javascript" src="__TMPL__/static/assets/js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/swiper-3.4.2.min.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/weui.js"></script>
<script type="text/javascript" src="__TMPL__/static/assets/js/common.js"></script>
<script type='text/javascript' src='__TMPL__/static/assets/js/Augly_Verification.js'></script>
<script>
//点击选择支付方式
$('.footer').click(function() {
$('.move1').css('display', 'block');
})
$('.move1').click(function() {
$(this).css('display', 'none');
})
$('.move_main').click(function(e) {
e.stopPropagation();
})
$('.move_main1').click(function(e) {
e.stopPropagation();
})
$('.shan1').click(function() {
$(this).find('i').attr('class', 'iconfont icon-xuanzhong2');
$(this).siblings().find('i').attr('class', 'iconfont');
})
$('.move1').click(function() {
$(this).css('display', 'none');
})
$('.phone_btn').click(function() {
$('.move3').css('display', 'none');
})
$('.reson').click(function() {
if($(this).parents('.caned_out').find('.bot_reason').css('display') == 'none') {
$(this).parents('.caned_out').find('.bot_reason').css('display', 'block');
} else {
$(this).parents('.caned_out').find('.bot_reason').css('display', 'none');
}
})
$('.refundmoneyed').click(function() {
if($(this).parents('.caned_out').find('.refund_main_out').css('display') == 'none') {
$(this).parents('.caned_out').find('.refund_main_out').css('display', 'block');
//$(this).parents('.caned_out').find('.iconfont').attr("class", "iconfont icon-chahao icon-iconset0414");
$('#icon-chahao').attr("class", "iconfont icon-chahao");
} else {
$(this).parents('.caned_out').find('.refund_main_out').css('display', 'none');
$(this).parents('.caned_out').find('.bot_reason').css('display', 'none');
//$(this).parents('.caned_out').find('.iconfont').attr("class", "iconfont icon-chahao icon-iconset0413");
$('#icon-chahao').attr("class", "iconfont icon-chahao");
}
})
var id='';
$(function(){
//确认取消弹出框
$('.cancel').click(function(){
id = $(this).attr('data-id');
$('.refund_reason_out').css('display','block');
})
//阻止按钮的点击冒泡
$('.btnlist').click(function(event) {
event.stopPropagation();
});
$('.choice .swiper-slide').click(function(){
$(this).addClass("active_top").siblings().removeClass("active_top");
})
//点击提交
$('.refund_reason_submit').click(function(){
$('.refund_reason_out').css('display','none');
if($("#T").val() == '') {
setTimeout("toast('请填写您的退款原因');", 900);
}else {
$.ajax({
url: "{:url('user/Center/refund')}",
data: {
id: id,
cause: $("#T").val()
},
type: "POST",
dataType: "JSON",
success: function (data) {
if (data.data === true) {
if(setTimeout("toast('提交成功');", 900)) {
}
}
}
})
}
})
$('.refund_reason_out').click(function(event){
$(this).css('display','none');
})
$('.icon-chahao').click(function(){
$(this).parents('.refund_reason_out').css('display','none');
})
$('.refund_reason').click(function(event){
event.stopPropagation();
})
})
</script>
\ No newline at end of file
... ...
... ... @@ -119,6 +119,7 @@
</div>
<volist name="data" id="vo">
<a href="{:url('user/Center/orderDetail',['oid'=>$vo['oid']])}">
<div class="good_out_stay" data-id="{$vo.oid}">
<div class="good">
<span>订单号:{$vo.order_sn}</span>
... ... @@ -162,6 +163,7 @@
</div>
</if>
</div>
</a>
</volist>
... ...