item.vue 2.25 KB
<template>
    <div class="return-form exchange-form">
        <product :product="product"></product>
        <div class="field" @click="openFeatureSelector(product.product_id)">
            换货的颜色尺码
            <div class="right">
                <span class="change" v-if="product.change">颜色:{{product.change.color}} 尺码:{{product.change.size}}</span>
                <i class="icon icon-right"></i>
            </div>
        </div>
        <reason :product="product">
            <span slot="type">换货原因</span>
        </reason>
    </div>
</template>
<script>
    /**
     *   exchange form
     *   1. 产品信息
     *   2. 更换产品 款式
     *   3. 换货 原因
     */
    import product from 'me/return/item.vue';
    import reason from 'me/return/reason.vue';
    import bus from 'common/vue-bus';

    export default {
        props: {
            product: Object,
            readyonly: Boolean,
            reasons: Array,
            specialReason: Array
        },
        components: {
            product,
            reason
        },
        methods: {
            openFeatureSelector(pid) {
                bus.$emit('open.featureSelector', {
                    pid,
                    uid: this._uid
                });
            }
        },

        created() {
            this.$set('product.change', {
                color: this.product.color_name,
                size: this.product.size_name,
                goodsId: this.product.goods_id,
                sku: this.product.product_sku
            });
        }
    };

</script>
<style>
    .return-form {
        .field {
            position: relative;
            height: 90px;
            line-height: 90px;
            padding: 0 30px;
            background-color: #fff;
            font-size: 32px;

            &:after {
                position: absolute;
                z-index: 1;
                content: "";
                display: block;
                right: 30px;
                bottom: -1px;
                left: 30px;
                border-bottom: 1px solid #eee;
            }
        }
        .field .right {
            color: #b0b0b0;
        }

        .change {
            display: inline-block;
            margin-right: 14px;
        }
    }

</style>