<template>
    <div class="main-content12">
        <!-- page content -->
        <div class="site-setting-wrap min-flex-right">
            <div class="siteMessage flex-common" id="siteMessage1">
                <h3>站点信息</h3>
                <el-form>
                    <div class="flex-wrap">
                        <div class="flex-left">
                            <GuipInput ref="GuipInput" column="column" label="站点简称" :maxlength="10"
                                :showWordLimit="true" desc="一个站点对应一个销售渠道，定义好名字好区分" v-model="siteInfo.short_name"
                                prop="short_name" placeholder="仅自己区分站点销售渠道，客户看不到" />

                            <GuipInput ref="GuipInput" column="column" label="公司电话" desc="在站点首页底部“关于我们”展示"
                                v-model="siteInfo.phone_num" prop="company_phone" placeholder="非必填" />
                        </div>
                        <div class="flex-line"></div>
                        <div class="flex-right">
                            <GuipTextarea v-model="siteInfo.company_name" label="详细介绍" column="column"
                                prop="doctor_detail" width="100%" height="90px" placeholder="请输入描述内容"
                                desc="在站点首页底部“关于我们”展示" show-word-limit />
                        </div>
                    </div>
                </el-form>
                <GroupFormBtns @cancel="cancleUpdateSiteInfo()" @confirm="updateSiteInfo()" />
            </div>
        </div>
    </div>
</template>
<script>
import store from '@/store';
import { mapState } from 'vuex';
import GuipInput from '@/components/GuipInput.vue';
import GuipTextarea from '@/components/GuipTextarea.vue';
import GroupFormBtns from '@/components/GroupFormBtns.vue';
export default {
    name: 'siteServiceAdd',
    props: [''],
    components: {
        GuipInput,
        GuipTextarea,
        GroupFormBtns

    },
    data() {
        return {
            // AUTH
            token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE3NTAwNTM3MjQsIm5iZiI6MTc1MDA1MzcyNCwiZXhwIjoxNzUyNjQ1NzI0LCJ1c2VyIjoic3VidXNlciIsImxvZ2luX3R5cGUiOjAsImFpZCI6IjEifQ.xyIqBLelB-k6jCifgRevBJTyg_Qrm6m1e4OcHhOpepU',
        }
    },
    computed: {
        ...mapState(['pageTitle']) // 从Vuex映射showSidebar状态到组件的计算属性中
    },
    created() {
        store.commit('SET_CUSTOMIZE', true);
        store.commit('SET_SLIDER_MENU', 'siteSettingData');
    },
    mounted() {
        store.commit('SET_PAGETITLE', '基本设置');

        this.getSiteInfo();
    },
    methods: {
        // 获取站点信息
        getSiteInfo() {
            const that = this
            that.siteInfo = []
            this.$http('POST', '/agentnew/ajax_get_site_info', {
                uid: this.$route.query.uid,
            }, {
                headers: {
                    'Auth': this.token
                }
            }).then(response => {
                this.$nextTick(() => {
                    that.siteInfo = response.data
                })
            }).catch(error => {
                console.error(error, 'error')
            })
        },
    }
}
</script>
<style lang="scss" scoped>
.pageheader {
    display: flex;
    justify-content: space-between;
    /* 关键属性 */
    align-items: center;
    margin: 16px 0px 16px 0px;
}

.pagetitle {
    font-size: 18px;
    font-weight: bold;
    line-height: normal;
    letter-spacing: 0.08em;
    color: #1E2226;
    margin-top: 8px;
}

.siteMessage {
    border-radius: 4px;
    transition: all .5s;
    border: 1px solid transparent;
}
.combo-formItem {
    ::v-deep {
        .form-item-bottom {
            position: relative;
        }

        .select-trigger {
            background: #F6F7FA;
            border-color: transparent;
        }

        .is-open .select-trigger {
            border-color: #006AFF;
        }

        .el-input__inner {
            border-radius: 2px 0 0 2px;
        }
    }
    .self-drop-wrap {
        position: absolute;
        z-index: 1;
        width: 100%;
    }
    .appendDrop {
        height: 38px;
        align-items: center;
        border-radius: 0 2px 2px 0;
        border: 1px solid #DFE2E6;
        border-left-color: transparent;
        justify-content: center;
        box-sizing: border-box;
        padding: 0 30px 0 12px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;
        &:hover {
            border: 1px solid #006AFF;
        }
    }
}
.addStore {
    margin-top: 12px;
    // border-radius: 4px;
    // opacity: 1;
    // /* text/text_white_2 */
    // border: 1px dashed #BABDC2;
    // padding: 15px 20px;
    // color: #626573;
    // justify-content: center;

    // img {
    //     margin-right: 12px;
    // }
}


.site-setting-wrap {
    width: 100%;
}

#siteMessage2 {
    margin: 12px 0;
}

.domain-wrap {
    .domain-item {
        margin-bottom: 10px;
    }


    .domain-item p:last-child {
        padding-left: 23px;
        color: #8A9099;
    }

    p {
        text-align: left;
        line-height: 18px;
        margin-bottom: 8px;
    }

    .domain-box {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
}
</style>