<?php include_once(mvc::$cfg['PATH_TPL'].'public/headMenu.php');?>
<link rel="stylesheet" type="text/css" href="<?php echo mvc::$cfg['SYS_URL'];?>static/css/user.css?ver=<?php echo mvc::$cfg['VER']['css'];?>">
<link href="<?php echo mvc::$cfg['SYS_URL'];?>static/mui/dist/css/mui.picker.min.css" rel="stylesheet" />
<link href="<?php echo mvc::$cfg['SYS_URL'];?>static/mui/dist/css/mui.poppicker.css" rel="stylesheet" />
<header class="mui-bar mui-bar-nav">
    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
    <h1 class="mui-title">订单详情</h1>
</header>
<div class="mui-content ord-refund">
    <form id="refund-form" action="" method="post">
        <div data-reactroot="" id="apply-refund" class="apply-refund ">
            <div id="root_1" class="apply-refund -root">
                <input type="hidden" name="rep[rep_id]" value="<?php echo $repArr['rep_id'];?>"/>
                <input type="hidden" name="rep[rep_type]" value="<?php if(!empty($Params['type'])){ echo ($Params['type']-1);}else{echo $repArr['rep_type'];};?>">
                <input type="hidden" name="rep[rep_orp_id]" value="<?php echo $repArr['orp_id'];?>"/>
<!--                 <div id="batchRefundEditBizOrderWithBridge_1" class="mod-bridge">
                    <div class="itemMultiSelectEntrence apply-refund -bizOrderMultiSelect normal mod-item-multi-select-entrence flexcell"><span class="flexcell ">退款商品</span><span class="flexcell shrink align-self-end button">添加和编辑</span></div>
                    <div class="mask"></div>
                </div> -->
                <div class="item-info itemInfo apply-router -itemInfo">
                    <div class="item-img-wrap" style="">
                        <?php if(!empty($proPicArr['spi_name'])){?>
                        <img class="item-img" src="<?php echo mvc::$cfg['FILE_CENTER']['b2c']['url_get'];?>&c=product&f=<?php echo $proPicArr['spi_path'];?>100/<?php echo $proPicArr['spi_name'].$proPicArr['spi_ext'];?><?php echo mvc::$cfg['FILE_CENTER']['b2c']['get_uri'];?>" alt="">
                        <?php }else{?>
                            <img class="item-img" src="<?php echo mvc::$cfg['HOST']['b2c']?>static/images/noimg.png" alt="">
                        <?php }?>
                    </div>
                    <div class="item-detail">
                        <div class="item-title"><?php echo $repArr['orp_pro_name'];?></div>
                        <!-- <div class="item-sku">颜色:003白色;尺码:M</div> -->
                        <div class="ext-skuinfo"></div>
                    </div>
                    <div class="item-price"></div>
                    <div class="item-amount"></div>
                    <div class="item-refund-info"><span class="item-refund-title"></span><span class="item-refund-price"></span></div>
                </div>
                <div id="itemInfo_1@2" class="mod-separate-line blockSeparator">
                    <div class="line"></div>
                </div>
                <div id="showstatusPicker">
                    <div id="applyRefundSelectContainer_1@1" class="mod-select flexcell select apply-refund -applyRefundSelectContainer">
                        <span class="title flexcell shrink">货物状态</span>
                        <div class="flexcell flexcell justify-content-end select-wrapper">
                            <div class="select-view">
                                <?php if($repArr['rep_pro_status']!=='0'&&$repArr['rep_pro_status']!=='1'){?>
                                <span class="default-select-color" id="statusResult">请选择</span>
                                <?php }else{?>
                                <?php foreach($typeArr as $status){?>
                                <?php if($status['value']==$repArr['rep_pro_status']){?>
                                <span class="default-select-color" id="statusResult"><?php echo $status['text'];?></span>
                                <?php }?>
                                <?php }?>
                                <?php }?>
                                <span class="right-arrow right-triangle"><a class="mui-icon mui-icon-forward" href="javascript:;"></a></span>
                            </div>
                            <input type="hidden" name="rep[rep_pro_status]" value="<?php echo $repArr['rep_pro_status'];?>" class="hidden-select">
                        </div>
                    </div>
                </div>
                <div class="mod-separate-line marginLeftSeparator">
                    <div class="line"></div>
                </div>
                <div id="showReasonPicker">
                    <div id="applyRefundSelectContainer_1@3" class="mod-select flexcell select apply-refund -applyRefundSelectContainer">
                        <span class="title flexcell shrink">退换原因</span>
                        <div class="flexcell flexcell justify-content-end select-wrapper">
                            <div class="select-view ">
                                <?php if(!empty($repArr['rep_reason'])){?>
                                <span class="default-select-color" id="reasonResult"><?php echo $repArr['rep_reason'];?></span>
                                <?php }else{?>
                                <span class="default-select-color" id="reasonResult">请选择</span>
                                <?php }?>
                                <span class="right-arrow right-triangle"><a class="mui-icon mui-icon-forward" href="javascript:;"></a></span>
                            </div>
                            <input type="hidden" name="rep[rep_reason]" class="hidden-select" value="<?php echo $repArr['rep_reason'];?>">
                        </div>
                    </div>
                </div>
                <div class="mod-label label apply-refund -applyRefundReasonTipsLabel flexcell" id="applyRefundReasonTipsLabel_4">
                    <div class="link-wrap">
                        <div class="flexcell content-wrap">
                            <div class="title-wrap flexcell shrink align-self-start align-items-center ">
                                <div class="title flexcell align-items-center"><span style="color: rgb(153, 153, 153); font-size: 12px;"></span></div>
                            </div>
                            <p class="value flexcell "></p>
                        </div>
                    </div>
                </div>
                <div id="applyRefundReasonSeparateLine_1" class="mod-separate-line blockSeparator">
                    <div class="line"></div>
                </div>
                <?php if($Params['type']<3){?>
                <div class="mod-input input apply-refund -applyRefundFeeContainer" id="applyRefundFeeContainer_2@1">
                    <label class="flexcell center" for="applyRefundFeeContainer_2@1">
                        <p class="title flexcell shrink">退款金额：</p>
                        <div class="input-wrap flexcell center">
                            <span class="prefix">￥</span>
                            <input type="text" data-maxval="<?php echo sprintf("%.2f",$maxMoney['maxMoney']);?>" class="flexcell highlight refund-price" placeholder="请填写" value="<?php if(isset($repArr['rep_money'])) echo sprintf("%.2f", $repArr['rep_money']); else echo sprintf("%.2f",$maxMoney['maxMoney']);?>" name="rep[rep_money]">
                        </div>
                    </label>
                </div>
                <div class="mod-label label apply-refund -applyRefundFeeContainer flexcell" >
                    <div class="link-wrap link-wrap-exp">
                        <div class="flexcell content-wrap">
                            <div class="title-wrap flexcell shrink align-self-start align-items-center ">
                                <div class="title flexcell align-items-center"><span style="">最多￥<?php echo sprintf("%.2f",$maxMoney['maxMoney']);?>，含发货邮费￥<?php echo sprintf("%.2f", $maxMoney['freightMoney']);?></span></div>
                            </div>
                            <p class="value flexcell "></p>
                        </div>
                    </div>
                </div>
                <?php }?>
                <div class="mod-input input apply-refund -refundDescInput" id="refundDescInput_1@1">
                    <label class="flexcell center" for="refundDescInput_1@1">
                        <p class="title flexcell shrink">退换说明：</p>
                        <div class="input-wrap flexcell center">
                            <input type="text" class="flexcell " name="rep[rep_instructions]" placeholder="选填" value="<?php if(!empty($repArr['rep_instructions'])) echo $repArr['rep_instructions'];?>">
                        </div>
                    </label>
                </div>
                <div class="mod-separate-line blockSeparator">
                    <div class="line"></div>
                </div>
                <div class="mod-bottomfloatcontainer" id="bottomFloatContainer_1">
                    <div class="mod-fullbuttonlist flexcell">
                        <div class="flexcell center button-item highlight"><span class="btn-content">提交</span></div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>
<script src="<?php echo mvc::$cfg['SYS_URL'];?>static/mui/dist/js/mui.picker.min.js"></script>
<script src="<?php echo mvc::$cfg['SYS_URL'];?>static/mui/dist/js/mui.poppicker.js"></script>
<script type="text/javascript" src="<?php echo mvc::$cfg['SYS_URL'];?>static/js/user.js?ver=<?php echo mvc::$cfg['VER']['js'];?>"></script>
<script type="text/javascript">
    var data1=<?php echo json_encode($typeArr);?>;
    var data2=<?php echo json_encode($refundReason);?>;
    $(document).ready(function(){
        var userPicker = new mui.PopPicker();
        userPicker.setData(data1);
        var showUserPickerButton = document.getElementById('showstatusPicker');
        var userResult = document.getElementById('statusResult');
        showUserPickerButton.addEventListener('tap', function(event) {
            userPicker.show(function(items) {
                userResult.innerText = items[0]['text'];
                $('input[name="rep[rep_pro_status]"]').val(items[0]['value']);
            });
        }, false);
        var userPicker2 = new mui.PopPicker();
        userPicker2.setData(data2);
        var showUserPickerButton2 = document.getElementById('showReasonPicker');
        var userResult2 = document.getElementById('reasonResult');
        showUserPickerButton2.addEventListener('tap', function(event) {
            userPicker2.show(function(items) {
                userResult2.innerText = items[0]['text'];
                $('input[name="rep[rep_reason]"]').val(items[0]['value']);
            });
        }, false);
        refund.init(2);
        checkForm('refund-form','bottomFloatContainer_1');
    })
</script>
<?php include_once(mvc::$cfg['PATH_TPL'].'public/footBase.php');?>