my_cons.html 7.1 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/index.css">
    <link rel="stylesheet" href="../../assets/icon/iconfont.css">
    <title></title>
    <style>
        body {
            padding-bottom: 1rem;
        }

        .cons_top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 12px;
            padding: 0.25rem 0.55rem 0.25rem 0.48rem;
        }

        .cons_top .cons_top_input {
            background-color: #ebebeb;
            color: #424242;
            font-size: 12px;
            border-radius: 0.4rem;
            padding: 0 0.37rem;
            flex: 1;
        }

        .cons_top .cons_top_input input {
            padding: 0.1rem 0;
            width: 100%;
        }

        .cons_top .cons_top_input input::-webkit-input-placeholder {
            color: #B9B4B4;

        }

        .cons_btn {
            color: #DDBB73;
            font-size: 15px;
            margin-left: 0.12rem;
        }

        .cons_item {
            margin: 0.5rem 0.55rem 0.57rem 0.48rem;
            font-size: 12px;
            border-radius: 3px;
            background-color: #D8B25F;
        }

        .cons_item_nouse {
            background-color: #c2c2c2;
        }

        .cons_item_img {
            width: 55px;
            padding: 0.1rem;
        }

        .cons_item_img img, .cons_item_img2 img {
            width: 100%;
        }

        .cons_item_content {
            color: #fff;
            display: flex;
            align-items: center;
        }

        .cons_item_content .rmb {
            font-size: 12px;
        }

        .cons_left {
            padding: 0.17rem 0 0.13rem 0;
            text-align: center;
            flex: 2;
            border-right: 3px #fff solid;
        }

        .cons_right {
            padding: 0.17rem 0 0.13rem 0;
            text-align: center;
            flex: 3;
        }

        .cons_price {
            font-size: 24px;
        }

        .cons_item_bottom {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 10px;
            color: #fff;
            padding: 0.1rem 0.21rem 0.1rem 0.76rem;
        }

        .bottom_btn {
            border: 1px solid #fff;
            text-align: center;
            font-size: 10px;
            padding: 0.03rem 0.17rem;
            border-radius: 0.16rem;
        }

        .save_btn {
            position: fixed;
        }
    </style>
</head>
<body>
<div id="loadStart"></div>
<div id="app" v-cloak>
    <!--<div class="cons_top">-->
    <!--<div class="cons_top_input"><input type="text" placeholder="请输入兑换码" v-model="cons_num"></div>-->
    <!--<span class="cons_btn">兑换</span>-->
    <!--</div>-->
    <!--<div :class="['cons_item',item.able==1?'':'cons_item_nouse']"-->
    <div class='cons_item' v-for="(item,index) in getConsumeMoney_data">
        <div class="cons_item_img"><img src="../../assets/image/juan_03.jpg" alt=""></div>
        <div class="cons_item_content">
            <div class="cons_left">
                <div class="cons_price"><span class="rmb"></span><span>{{item.money}}</span></div>
                <div class="cons_use">满{{item.discount}}使用</div>
            </div>
            <div class="cons_right">
                <div class="cons_price">{{item.name}}</div>
                <div class="cons_use">有效期至{{item.deadline}}</div>
            </div>
        </div>
        <div class="cons_item_img2"><img src="../../assets/image/line.jpg" alt=""></div>
        <div class="cons_item_bottom" v-if="item.able==1">
            <span>{{item.post_title}}</span>
            <span class="bottom_btn" @click="choose_fee(item.money,item.id)">去使用</span>
        </div>
        <div class="cons_item_bottom" v-else>
            <span>{{item.post_title}}</span>
            <span class="bottom_btn">不可使用</span>
        </div>
    </div>
    <div class="save_btn" @click="noUse">不使用消费金</div>
</div>
</body>
</html>

<script type="text/javascript" src="../../assets/js/api.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/vue.min.js"></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: '',
            getConsumeMoney_data: []
        },
        created: function () {
            apiready = function () {
                app.order_id = api.pageParam.order_id;
                // alert(app.order_id);
                app.getConsumeMoney();
            }
        },
        methods: {
            // goUse: function () {
            //     api.openWin({
            //         name: 'win',
            //         url: '../common/index_win.html',
            //     });
            //     api.sendEvent({
            //         name: 'index0',
            //         extra: {
            //             index: 0
            //         }
            //     });
            // },
            noUse: function () {
                api.closeWin();
                api.sendEvent({
                    name: 'price_event',
                    extra: {
                        price: 0,
                        id: null,
                        fee_pay: false
                    }
                });
            },
            choose_fee: function (price, id) {
                api.sendEvent({
                    name: 'price_event',
                    extra: {
                        price: price,
                        id: id,
                        fee_pay: true
                    }
                });
                api.closeWin();
            },
            getConsumeMoney: function () {
                var post = {
                    order_id: app.order_id
                };
                var header = {
                    "XX-Device-Type": getDevice(),
                    'XX-Token': getToken()
                };
                getRequest('post', 'user/Order/getConsumeMoney', post, header).then(function (res) {
                    // alert(JSON.stringify(res))
                    if (res.data.code == 1) {
                        app.getConsumeMoney_data = res.data.data;
                        loadEnd();
                    } else {
                        toastMsg(res.data.msg);
                    }
                });
            },
        }
    })
</script>