<template>
    <a-form ref="form" :model="model" :form="form" :rules="validatorRules"  :label-col="{ span: 2 }" :wrapper-col="{ span: 22 }">
        <a-form-item v-show="false"><a-input v-decorator="['id']" /></a-form-item>
        <a-form-item label="酒店名称">
            <a-input type="text" placeholder="请填写酒店名称"
                     v-decorator="['name', { rules: [{ required: true, message: '请填写酒店名称！' }] }]"></a-input>
        </a-form-item>

        <a-form-item label="星级" :wrapper-col="{ span: 5 }">
<!--            <j-dict-select-tag v-model="model.tenantId" placeholder="请选择关联租户" dictCode="sys_tenant,name,id" />-->
<!--            v-model="form.sex"-->
<!--            <a-select placeholder="请选择星级"-->
<!--                      v-decorator="['star', {rules: [{ required: true, message: '请选择项目名称！' }]}]">-->
<!--                <a-select-option :value="1">一星及以下/经济</a-select-option>-->
<!--                <a-select-option :value="2">二星/实惠</a-select-option>-->
<!--                <a-select-option :value="3">三星/舒适</a-select-option>-->
<!--                <a-select-option :value="4">四星/高档</a-select-option>-->
<!--                <a-select-option :value="5">五星/豪华</a-select-option>-->
<!--            </a-select>-->

            <j-dict-select-tag v-decorator="['star', {rules: [{ required: true, message: '请选择项目名称！' }]}]"
                               placeholder="请选择星级" dictCode="hotel_star"/>
        </a-form-item>

        <a-form-item label="酒店地址">
            <a-input type="text" placeholder="请填写酒店地址"
                     v-decorator="['address', { rules: [{ required: true, message: '请填写酒店地址！' }] }]"></a-input>
        </a-form-item>

        <a-form-item label="经纬度">
            <a-row>
                <a-col :span="10">
                    <a-input type="text" placeholder="请填写经纬度"
                             v-decorator="['latlng', { rules: [{ required: true, message: '请填写经纬度！' }] }]"></a-input>
                </a-col>
                <a-col :span="3" class="padding_left_10">
                    <a-button @click="getLonAndLat()" >获取经纬度</a-button>
                </a-col>
                <a-col :span="3" class="padding_left_10">
                    <a-button @click="getLonAndLat()" >地图选点</a-button>
                </a-col>
            </a-row>
        </a-form-item>

        <a-form-item label="联系人">
            <a-input type="text" placeholder="请填写联系人"
                     v-decorator="['linkName']"></a-input>
        </a-form-item>

        <a-form-item label="联系电话">
            <a-input type="text" placeholder="请填写电话"
                     v-decorator="['linkTel']"></a-input>
        </a-form-item>

        <a-form-item label="酒店电话">
            <a-input type="text" placeholder="请填写酒店电话"
                     v-decorator="['tel', { rules: [{ required: true, message: '请填写酒店电话！' }] }]"></a-input>
        </a-form-item>

        <a-form-item label="开业时间">
            <a-date-picker type="text" placeholder="请选择开业时间"
                           v-decorator="['openTime', { rules: [{ required: false, message: '请选择开业时间！' }] }]"></a-date-picker>
        </a-form-item>

        <a-form-item label="装修时间">
            <a-date-picker type="text" placeholder="请选择装修时间"
                           v-decorator="['renovationTime', { rules: [{ required: false, message: '请选择装修时间！' }] }]"></a-date-picker>
        </a-form-item>

        <a-form-item label="集团品牌">
<!--            <a-input type="text" placeholder="请选择集团品牌"-->
<!--                     v-decorator="['linkTel']"></a-input>-->
        </a-form-item>

        <a-form-item label="退订规则">
            <a-input type="text" placeholder="请填写退订规则"
                     v-decorator="['rule']"></a-input>
        </a-form-item>

        <a-form-item label="酒店标签">
<!--            <a-row>-->
<!--                <a-col>-->
<!--                    <div><span>1</span><span>3</span></div>-->
<!--                </a-col>-->
<!--                <a-col class="padding_left_10">-->
<!--                    <a-button @click="addHotelLable()" >添加</a-button>-->
<!--                </a-col>-->
<!--            </a-row>-->
            <template v-for="(tag, index) in tags">
                <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
                    <a-tag :key="tag" :closable="index !== -1" @close="() => handleClose(tag)">
                        {{ `${tag.slice(0, 20)}...` }}
                    </a-tag>
                </a-tooltip>
                <a-tag v-else :key="tag" :closable="index !== -1" @close="() => handleClose(tag)">
                    {{ tag }}
                </a-tag>
            </template>
            <a-input
                    v-if="inputVisible"
                    ref="input"
                    type="text"
                    size="small"
                    :style="{ width: '78px' }"
                    :value="inputValue"
                    @change="handleInputChange"
                    @blur="handleInputConfirm"
                    @keyup.enter="handleInputConfirm"
            />
            <a-tag v-else style="background: #fff; borderStyle: dashed;" @click="showInput">
                <a-icon type="plus" />添加
            </a-tag>
        </a-form-item>

        <a-form-item label="酒店设施">
            <a-row>
                <a-col span="3">
                    <a-checkbox @change="onChange" value="1">
                        温泉
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        租车
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        有餐饮
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        游泳池
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        叫早
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        有早餐
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        WIFI
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        电热水壶
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        电梯
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        吹风机
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        免费停车
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        会议室
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        残疾人设施
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        邮政服务
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        婚宴服务
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        全天前台
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        接待外宾
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        棋牌室
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        收费停车
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        送餐服务
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        洗衣服务
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        商务中心
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        叫车服务
                    </a-checkbox>
                </a-col>
                <a-col span="3">
                    <a-checkbox @change="onChange">
                        房间WIFI
                    </a-checkbox>
                </a-col>
            </a-row>
        </a-form-item>

        <a-form-item label="酒店主题" :wrapper-col="{ span: 5 }">
            <!--            <j-dict-select-tag v-model="model.tenantId" placeholder="请选择关联租户" dictCode="sys_tenant,name,id" />-->
            <!--            v-model="form.sex"-->
            <a-select placeholder="请选择酒店主题"
                      v-decorator="['topic']">
                <a-select-option :value="1">情侣约会</a-select-option>
                <a-select-option :value="2">亲子家庭</a-select-option>
                <a-select-option :value="3">快捷连锁</a-select-option>
                <a-select-option :value="4">主题特色</a-select-option>
                <a-select-option :value="5">海滨风光</a-select-option>
            </a-select>
        </a-form-item>

        <a-form-item label="酒店支持">
            <a-row>
                <a-col span="4">
                    <a-checkbox v-decorator="['unionpay', { valuePropName: 'checked' }]">
                        银联支付
                    </a-checkbox>
                </a-col>
                <a-col span="4">
                    <a-checkbox v-decorator="['wxOpen', { valuePropName: 'checked' }]">
                        微信支付
                    </a-checkbox>
                </a-col>
                <a-col span="4">
                    <a-checkbox v-decorator="['ddOpen', { valuePropName: 'checked' }]">
                        到店支付
                    </a-checkbox>
                </a-col>
                <a-col span="4">
                    <a-checkbox v-decorator="['yeOpen', { valuePropName: 'checked' }]">
                        余额支付
                    </a-checkbox>
                </a-col>
            </a-row>
        </a-form-item>
        <a-form-item label="酒店政策">
            <j-editor v-model="model.policy" />
            <a-button type="primary" @click="autoPolicy()" >自动输入</a-button>
        </a-form-item>
        <a-form-item label="酒店介绍">
            <j-editor v-model="model.introduction"/>
            <a-button type="primary" @click="autoIntroduction()" >自动输入</a-button>
        </a-form-item>
        <a-form-item label="预定提醒">
            <j-editor v-model="model.reserveRemind"/>
            <a-button type="primary" @click="autoReserveRemind()" >自动输入</a-button>
        </a-form-item>
        <a-form-item label="交通和周边">
            <j-editor v-model="model.traffic"/>
            <a-button type="primary" @click="autoTraffic()" >自动输入</a-button>
        </a-form-item>

        <a-button type="primary" @click="submit">确定</a-button>

    </a-form>
</template>
<script>
    import { Modal } from 'ant-design-vue';
    import {getHotelInfo, editMainInfo, hotelList} from "../../../api/hotel";
    export default {
        created() {
            // alert("这里获取当前缓存门店信息");
            var _info = JSON.parse(localStorage.getItem("storeInfo"));
            setTimeout(() => {
                getHotelInfo({
                    id: _info.id
                }).then(res => {
                    console.log(res)
                    if (res.code == 200 && res.result ) {
                        var info = res.result

                        this.form.setFieldsValue(
                            {
                                id: info.id,
                                name: info.name,
                                star: info.star,
                                address: info.address,
                                latlng: info.lat+','+info.lng,
                                linkName: info.linkName,
                                linkTel: info.linkTel,
                                tel: info.tel,
                                openTime: info.openTime,
                                renovationTime: info.renovationTime,
                                superiorSellerId: info.superiorSellerId,
                                rule: info.rule,
                                topic: info.topic,
                                unionpay: info.unionpay,
                                wxOpen: info.wxOpen,
                                ddOpen: info.ddOpen,
                                yeOpen: info.yeOpen,
                                policy:info.policy,
                                introduction:info.introduction,
                                reserveRemind:info.reserveRemind,
                                traffic:info.traffic,
                            }
                        )

                        this.model = {
                            policy:info.policy,
                            introduction:info.introduction,
                            reserveRemind:info.reserveRemind,
                            traffic:info.traffic
                        };

                        this.tags = info.tagList.split(',')
                    }
                })
            }, 100)
        },
        data() {
            return {
                visible: false,
                formLayout: 'horizontal',
                validatorRules: {
                    name: [{
                        required: true, message: '请输入酒店名称!'
                    }],
                    linkName: [{
                        required: true, message: '请输入联系人!'
                    }],
                    linkTel: [{
                        required: true, message: '请输入联系电话!'
                    }, {validator: this.validatePhone}],//, {validator: this.validatePhone}
                    tel: [{
                        required: true, message: '请输入酒店电话!'
                    }],
                    address: [{
                        required: true, message: '请输入酒店地址!'
                    }],
                    star: [{
                        required: true, message: '请输入星级!'
                    }],
                    lng: [{
                        required: true, message: '请输入经度!'
                    }],
                    lat: [{
                        required: true, message: '请输入纬度!'
                    }],
                    roomCount: [{
                        required: true, message: '请输入客房总数!'
                    }],
                    // openTime: [{
                    //     required: true, message: '请输入开业时间!'
                    // }],
                    // renovationTime: [{
                    //     required: true, message: '请输入装修时间!'
                    // }],
                    checkStatus: [{
                        required: true, message: '请选择审核状态', trigger: 'change'
                    }]
                },
                form: this.$form.createForm(this),
                model: {
                    policy:'',
                    introduction:'',
                    reserveRemind:'',
                    traffic:'',
                },
                tags: [],
                inputVisible: false,
                inputValue: '',
            }
        },
        computed: {
            formItemLayout() {
                const { formLayout } = this;
                return formLayout === 'horizontal'
                    ? {
                        labelCol: { span: 4 },
                        wrapperCol: { span: 14 },
                    }
                    : {};
            },
        },
        methods: {
            submit() {
                // console.log(this.form.values.certImg)
                this.form.validateFields((err, values) => {
                    console.log(values.lnglat)
                    if (!err) {
                        values['lat'] = values.latlng.split(',')[0]
                        values['lng'] = values.latlng.split(',')[1]
                        values['tagList'] = this.tags.join(",");
                        if(this.model.policy) values['policy'] = this.model.policy
                        if(this.model.introduction) values['introduction'] = this.model.introduction
                        if(this.model.reserveRemind) values['reserveRemind'] = this.model.reserveRemind
                        if(this.model.traffic) values['traffic'] = this.model.traffic
                        editMainInfo(values).then(res=>{
                            // this.$message.success('编辑成功')
                            // localStorage.setItem("storeInfo", JSON.stringify(res.result))
                            if (res.code == 200){
                                this.$message.success('编辑成功')
                                localStorage.setItem("storeInfo", JSON.stringify(res.result))
                            }else{
                                this.$message.error(res.message)
                            }
                        })
                    }
                });
            },
            getLonAndLat() {
                const that = this
                let params = {address: this.model.address}
                getAction(this.url.getLonAndLat, params).then((res) => {
                    if (res.success) {
                        if (res.code === 200) {
                            console.log(res.result)
                            that.model.lat = res.result.lat
                            that.model.lng = res.result.lng
                            that.model = Object.assign({}, that.model)
                        } else {
                            that.$message.warning(res.message)
                        }
                    }
                })
            },
            addHotelLable(){
                console.log('添加酒店标签')
            },
            onChange(e) {
                console.log(`checked = ${e.target.checked}`);
            },
            handleClose(removedTag) {
                const tags = this.tags.filter(tag => tag !== removedTag);
                console.log(tags);
                this.tags = tags;
            },

            showInput() {
                this.inputVisible = true;
                this.$nextTick(function() {
                    this.$refs.input.focus();
                });
            },

            handleInputChange(e) {
                this.inputValue = e.target.value;
            },

            handleInputConfirm() {
                const inputValue = this.inputValue;
                let tags = this.tags;
                if (inputValue && tags.indexOf(inputValue) === -1) {
                    tags = [...tags, inputValue];
                }
                console.log(tags);
                Object.assign(this, {
                    tags,
                    inputVisible: false,
                    inputValue: '',
                });
            },
            autoPolicy(){
                var _policy = `<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                            font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box;
                            font-weight: bolder;\">入离时间</span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                            counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                            white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text;
                            padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif;
                            font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">入住时间：入住当天14:00后&nbsp;&nbsp;&nbsp;
                            </p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
                            color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">
                            离店时间：离店当天12:00前</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                            counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                             white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                             counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                              white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box; font-weight: bolder;\">
                              宠物 </span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
                              color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">
                              &nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
                              color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">
                              不可携带宠物。</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0;
                              color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n
                              <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                              font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box;
                              font-weight: bolder;\">外宾</span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                              counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                              white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                              counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                              white-space: pre-wrap; background-color: #ffffff;\">不接待外宾，该酒店只开放给持中国身份证的用户入住</p>\n<p style=\"box-sizing: border-box;
                              margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                              font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n
                              <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                              font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box;
                              font-weight: bolder;\">膳食安排</span></p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                              counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                              white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text;
                              padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                              white-space: pre-wrap; background-color: #ffffff;\">价格：详询酒店</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text;
                              padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                              white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                               counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                               white-space: pre-wrap; background-color: #ffffff;\"><span style=\"box-sizing: border-box; font-weight: bolder;\">儿童政策</span></p>\n
                               <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                               font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&nbsp;</p>\n
                               <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                               font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&bull;酒店允许携带儿童入住</p>\n
                               <p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133;
                               font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;\">&bull;
                               每间客房最多容纳1名1.2米以下儿童，和成人共用现有床铺。</p>\n<p style=\"box-sizing: border-box; margin: 0px; cursor: text; padding: 0px;
                               counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px;
                               white-space: pre-wrap; background-color: #ffffff;\">&bull;儿童/加床政策请详询酒店。</p>`;
                var _this = this;
                if (this.model.policy.length > 0 ){
                    this.$confirm({
                        title: '提示',
                        content: '您已有酒店政策内容，是否覆盖?',
                        onOk() {
                            // return new Promise((resolve, reject) => {
                            //     setTimeout(Math.random() > 0.5 ? resolve : reject, 100);
                            // }).catch(() => console.log('Oops errors!'));
                            _this.model.policy = _policy;
                        },
                        onCancel() {},
                    })
                }
            },
            autoIntroduction(){
                var _introduction = `<p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">电话：</p>
                                        <p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">房间数：</p>
                                        <p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">开业时间：</p>
                                        <p style="box-sizing: border-box; margin: 0px; cursor: text; padding: 0px; counter-reset: a 0 b 0 c 0 d 0 e 0 f 0 g 0 h 0 i 0; color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">装修时间：</p>`;
                var _this = this;
                if (this.model.introduction.length > 0 ){
                    this.$confirm({
                        title: '提示',
                        content: '您已有酒店介绍内容，是否覆盖?',
                        onOk() {
                            // return new Promise((resolve, reject) => {
                            //     setTimeout(Math.random() > 0.5 ? resolve : reject, 100);
                            // }).catch(() => console.log('Oops errors!'));
                            _this.model.introduction = _introduction;
                        },
                        onCancel() {},
                    })
                }
            },
            autoReserveRemind(){
                var _reserveRemind = `<p><span style="color: #303133; font-family: Helvetica, Arial, sans-serif; font-size: 13px; white-space: pre-wrap; background-color: #ffffff;">预定提醒</span></p>`;
                var _this = this;
                if (this.model.reserveRemind.length > 0 ){
                    this.$confirm({
                        title: '提示',
                        content: '您已预定提醒内容，是否覆盖?',
                        onOk() {
                            // return new Promise((resolve, reject) => {
                            //     setTimeout(Math.random() > 0.5 ? resolve : reject, 100);
                            // }).catch(() => console.log('Oops errors!'));
                            _this.model.reserveRemind = _reserveRemind;
                        },
                        onCancel() {},
                    })
                }
            },
            autoTraffic(){
                console.log('获取交通周边信息');
                this.$message.success('获取周边交通信息')
            }
        },
    }
</script>

<style scoped>
    .padding_left_10{
        padding-left: 10px;
    }

</style>
