my_re_money.html 8.5 KB
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <script src="../../assets/js/fontsize.js"></script>
    <link rel="stylesheet" href="../../assets/css/weui.min.css">
    <link rel="stylesheet" href="../../assets/css/api.css"/>
    <link rel="stylesheet" href="../../assets/css/style.css">
    <link rel="stylesheet" href="../../assets/css/index.css">
    <link rel="stylesheet" href="../../assets/css/doc.css">
    <link rel="stylesheet" href="../../assets/css/pay.css">
    <link rel="stylesheet" href="../../assets/icon/iconfont.css">
    <title></title>
    <style type="text/css">
        body {
            background-color: #f2f2f2;
            height: 100%;
            position: fixed;
            width: 100%;
            left: 0;
            top: 0;
        }

        .hr {
            height: 0.11rem;
            background-color: #f2f2f2;
        }

        .pay_date {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.2rem 0.53rem 0.2rem 0.77rem;
            font-size: 14px;
            color: #424242;
            background-color: #fff;
        }

        .bordert {
            border-top: 1px solid #ececec;
        }

        .order_num {
            padding: 0.2rem 0.44rem;
            background-color: #f2f2f2;
            font-size: 14px;
            color: #424242;
        }

        .order_btn_box {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            margin: 0.82rem 0;
            padding: 0 0.5rem;
            font-size: 17px;
            color: #D8B25F;
        }

        .order_btn_box span {
            border: 1px solid #D8B25F;
            border-radius: 0.16rem;
            width: 1.81rem;
            text-align: center;
            padding: 0.15rem 0;
            margin-left: 0.44rem;
        }

        .reason_box {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.25rem 0.4rem;
            font-size: 14px;
            color: #424242;
            margin-top: 0.2rem;
            background-color: #fff;
        }

        .swiper_item {
            margin: 0;
            padding: 0.28rem 0.38rem;
        }

        .icon-xiangyou {
            color: #e0e0e0;
        }

        .subimt {
            width: 86%;
            margin: 0.43rem auto;
            background-color: #dbb25f;
            color: #fff;
            font-size: 16px;
            padding: 0.1rem 0;
            text-align: center;
            border-radius: 0.1rem;
        }

        .margin12 {
            margin-top: 0.12rem;
        }
    </style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
    <div class="hr"></div>
    <div class="pay_date">
        <span>下单日期</span><span>{{order_info.addtime}}</span>
    </div>
    <!--<div class="swiper_item" @click="go_detail(order_info.gid)">-->

    <div class="pay_date" v-if="order_info.goods_type==4">
        <div class="swiper_item_title">{{order_info.post_title}}</div>
        <div class="swiper_item_title">{{order_info.attr_name}}</div>
    </div>
    <div class="swiper_item" v-else>
        <div class="swiper_item_img"><img :src="order_info.icon" alt=""></div>
        <div class="swiper_item_right">
            <div class="swiper_item_title">{{order_info.post_title}}</div>
            <div class="swiper_item_content">{{order_info.other_title}}</div>
            <div class="swiper_item_type">
                <div class="swiper_item_type1" v-for="(item,item2_index) in order_info.tag">
                    <div class="icon_img"><img :src="item.url" alt=""></div>
                    <span>{{item.text}}</span>
                </div>
            </div>
            <div class="swiper_item_money">¥{{order_info.price}}</div>
        </div>
    </div>
    <div class="pay_date bordert">
        <span>总金额</span><span>¥{{order_info.price?order_info.price:0}}元</span>
    </div>
    <div @click="showReasons" class="pay_date margin12"><span>取消理由</span><span>{{reason}}      <span
            class="iconfont icon-xiangyou"></span></span></div>
    <div class="subimt" @click="re_money">提交</div>
</div>
</body>
</html>

<script type="text/javascript" src="../../assets/js/api.js"></script>
<script type="text/javascript" src="../../assets/js/weui.min.js"></script>
<script type="text/javascript" src="../../assets/js/vue.min.js"></script>
<script type="text/javascript" src="../../assets/js/index.js"></script>
<script type="text/javascript" src="../../assets/js/public.js"></script>
<script type="text/javascript" src="../../assets/js/fastclick.js"></script>
<script>
    new FastClick(document.body);
</script>
<script type="text/javascript" src="../../assets/js/axios.min.js"></script>
<script type="text/javascript" src="../../assets/icon/iconfont.js"></script>
<script>
    var app = new Vue({
        el: '#app',
        data: {
            order_id: '',
            order_info: [],
            reason_list: [],
            reason_value: '',
            reason: '请选择'
        },
        created: function () {
            apiready = function () {
                app.order_id = api.pageParam.order_id;
                app.myOrder();
                app.getReason();
            }
        },
        methods: {
            myOrder: function () {
                var post = {
                    order_id: app.order_id
                };
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken(),
                };
                getRequest('post', 'user/Order/getOrderInfo', post, header).then(function (res) {
                    // alert(JSON.stringify(res));
                    if (res.data.code == 1) {
                        app.order_info = res.data.data;
                        loadEnd();
                    } else {
                        toastMsg(res.data.msg)
                    }
                })
            },
            // 退款原因
            getReason: function () {
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken(),
                };
                getRequest('post', 'user/Order/getReasonType', null, header).then(function (res) {
                    // alert(JSON.stringify(res.data.data));
                    if (res.data.code == 1) {
                        for (var i in res.data.data) {
                            app.reason_list.push({
                                label: res.data.data[i].name,
                                value: res.data.data[i].id
                            })
                        }
                    } else {
                        // toastMsg(res.data.msg)
                    }
                });
            },
            // 选择原因
            showReasons: function () {
                weui.picker(app.reason_list, {
                    onChange: function (result) {
                    },
                    onConfirm: function (result) {
                        app.reason = result[0].label;
                        app.reason_value = result[0].value;
                    }
                });
            },
            // 提交退款
            re_money: function () {
                if (app.reason_value == '') {
                    toastMsg('请选择退款原因')
                } else {
                    var header = {
                        "XX-Device-Type": getDevice(),
                        'XX-Token': getToken(),
                    };
                    var post = {
                        order_id: app.order_id,
                        reason_id: app.reason_value
                    };
                    getRequest('post', 'user/Order/refundOrderApply', post, header).then(function (res) {
                        if (res.data.code == 1) {
                            toastMsg('提交成功');
                            setTimeout(function () {
                                openView('my_orderlist', 'my/my_orderlist', '我的订单')
                            }, 2000)
                        } else {
                            // toastMsg(res.data.msg)
                        }
                    });
                }
            }
        }
    })
</script>