my_order_ben.html 7.3 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/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">
        .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;
        }

        .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;
        }
    </style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
    <div class="pay_box">
        <div class="pay_item_title">
            <span class="pay_item_title_span">{{order_info.post_title}}</span>
            <span>{{order_info.order_type}}</span>
        </div>
        <div class="pay_detail">
            <div class="pay_detail_item">
                <span class="iconfont icon-dengpao-tianchong"></span>
                <span class="pay_detail_label">权益方案</span>
                <span>{{order_info.attr_name}}</span>
            </div>
            <div class="pay_detail_item">
                <span class="iconfont icon-yonghu"></span>
                <span class="pay_detail_label">服务对象</span>
                <span>{{order_info.name}}</span>
            </div>
            <div class="pay_detail_item">
                <span class="iconfont icon-dianhua-1"></span>
                <span class="pay_detail_label">联系电话</span>
                <span>{{order_info.mobile}}</span>
            </div>
            <div class="pay_detail_item">
                <span class="iconfont icon-zhifu"></span>
                <span class="pay_detail_label">金额</span>
                <span>{{order_info.price}}</span>
            </div>
            <div class="pay_detail_item">
                <span class="iconfont icon-dizhi"></span>
                <span class="pay_detail_label">联系地址</span>
                <span>{{order_info.address}}</span>
            </div>
        </div>
    </div>
    <div class="hr"></div>
    <div class="pay_date">
        <span>下单日期</span><span>{{order_info.addtime}}</span>
    </div>
    <div class="order_btn_box" v-if="order_type=='待付款'">
        <span @click="cancel_order" v-if="order_type=='待付款'||order_type=='支付中'">取消支付</span>
        <span @click="pay_moneny">支付</span>
    </div>
    <div class="order_btn_box" v-if="order_type=='支付中'">
        <span @click="pay_moneny">支付</span>
    </div>
    <div class="order_btn_box" v-if="order_type=='进行中'">
        <span @click="re_money">退款</span>
    </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_type: '',
            order_info: [],
        },
        created: function () {
            apiready = function () {
                app.order_id = api.pageParam.order_id;
                app.order_type = api.pageParam.order_type;
                app.myOrder();
            }
        },
        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)
                    }
                })
            },
            // 退款
            re_money: function () {
                openView('my_re_money', 'my/my_re_money', '退款', 'my_re_money', false, {
                    order_id: app.order_id,
                })
            },
            // 取消订单
            cancel_order: function () {
                api.showProgress({
                    title: '取消订单',
                    text: '正在取消订单',
                    modal: false
                });
                var post = {
                    order_id: app.order_id
                };
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken(),
                };
                getRequest('post', 'user/Order/cancleOrder', post, header).then(function (res) {
                    // alert(JSON.stringify(res));
                    if (res.data.code == 1) {
                        toastMsg(res.data.msg);
                        setTimeout(res => {
                            openView('my_orderlist', 'my/my_orderlist', '我的订单')
                        }, 2000);
                        api.sendEvent({
                            name: 'cancel_order',
                        });
                    } else {
                        toastMsg(res.data.msg)
                    }
                    api.hideProgress();
                });
            },
            // 去支付
            pay_moneny: function () {
                openView('my_pay', 'my/my_pay', '支付', 'my_pay', false, {order_id: app.order_id});
            },

        }
    })
</script>