| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150 |
- <?php
- use common\helpers\ComponentHelper;
- ComponentHelper::loadComponentView('com-image');
- ComponentHelper::loadComponentView('com-qq-map');
- ComponentHelper::loadComponentView('component/com-attachment', dirname(__DIR__));
- ComponentHelper::loadComponentView('component/com-attachment-edit', dirname(__DIR__));
- ComponentHelper::loadComponentView('component/com-upload', dirname(__DIR__));
- ?>
- <div id="app" v-cloak>
- <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div class="fixed-header">
- <div class="flex flex-x-between flex-y-center">
- <span>编辑门店</span>
- <div class='head-btns'>
- <el-button type="primary" @click='save'>保存</el-button>
- <el-button type="info" @click='back'>返回</el-button>
- </div>
- </div>
- </div>
- <div class="table-body">
- <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="110px" size="medium"
- label-position='left' class="demo-dynamic">
- <div class="basic_set">
- <div class="common_head flex flex-y-center">
- <div class='line'></div>
- <div>基本信息</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="平台地址:" prop="store_name">
- <div class="flex flex-y-center">
- {{ruleForm.platform_address}}
- </div>
- </el-form-item>
- <el-form-item label="门店分类:" prop="c_id">
- <el-cascader v-model="ruleForm.cIds" placeholder="试试搜索:指南"
- :options="category"
- filterable>
- </el-cascader>
- </el-form-item>
- <el-form-item label="门店名称:" prop="store_name">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.store_name" placeholder="请输入门店名称"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="门店介绍:" prop="store_desc">
- <div class="flex flex-y-center">
- <el-input
- type="textarea"
- :autosize="{ minRows: 2, maxRows: 4}"
- placeholder="门店介绍"
- v-model="ruleForm.store_desc">
- </el-input>
- </div>
- </el-form-item>
- <el-form-item prop="business_license">
- <label slot="label">
- <span>营业执照:</span>
- </label>
- <com-attachment v-model="ruleForm.license_img" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:686 * 485" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.license_img ? ruleForm.license_img : ''"></com-image>
- <el-button v-if="ruleForm.license_img" class="del-btn" size="mini"
- type="danger" icon="el-icon-close" circle
- @click="ruleForm.license_img = ''"></el-button>
- </div>
- </el-form-item>
- <el-form-item prop="store_background">
- <label slot="label">
- <span>门店背景:</span>
- </label>
- <com-attachment v-model="ruleForm.store_background" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:750 * 300" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.store_background ? ruleForm.store_background : ''"></com-image>
- <el-button v-if="ruleForm.store_background" class="del-btn" size="mini"
- type="danger" icon="el-icon-close" circle
- @click="ruleForm.store_background = ''"></el-button>
- </div>
- </el-form-item>
- <el-form-item prop="logo_img">
- <label slot="label">
- <span>门店logo:</span>
- </label>
- <com-attachment v-model="ruleForm.logo_img" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:120 * 120" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.logo_img ? ruleForm.logo_img : ''"></com-image>
- <el-button v-if="ruleForm.logo_img" class="del-btn" size="mini"
- type="danger" icon="el-icon-close" circle
- @click="ruleForm.logo_img = ''"></el-button>
- </div>
- </el-form-item>
- <el-form-item prop="show_style" >
- <label slot="label">
- <span>门店装修风格:</span>
- </label>
- <div class="flex flex-y-center">
- <template>
- <el-radio-group v-model="ruleForm.show_style" size="mini">
- <el-radio-button label="1" style="margin-right: 20px" :disabled="custom_store_style">
- <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_style2" v-if="ruleForm.store_category_switch == 0"></com-image>
- <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_style3" v-if="ruleForm.store_category_switch == 1"></com-image>
- </el-radio-button>
- <el-radio-button label="2" style="margin-right: 20px" :disabled="custom_store_style">
- <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_style1"></com-image>
- </el-radio-button>
- </el-radio-group>
- </template>
- </div>
- </el-form-item>
- <el-form-item label="是否开启分类" prop="store_category_switch" v-if="ruleForm.show_style==1">
- <el-switch v-model="ruleForm.store_category_switch" :active-value="1" :inactive-value="0" :disabled="custom_store_style"></el-switch>
- </el-form-item>
- <el-form-item label="门店分类样式风格" prop="default_store_style" v-if="ruleForm.show_style==2 || ruleForm.store_category_switch == 1">
- <template>
- <el-radio-group v-model="ruleForm.default_store_cate_style" size="mini" :disabled="custom_store_style">
- <el-radio-button label="1" style="margin-right: 20px">
- <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_cate_style1"></com-image>
- </el-radio-button>
- <el-radio-button label="2" style="margin-right: 20px" :disabled="custom_store_style">
- <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_cate_style2"></com-image>
- </el-radio-button>
- </el-radio-group>
- <br />
- </template>
- </el-form-item>
- <el-form-item prop="introduce">
- <label slot="label">
- <span>门店介绍:</span>
- </label>
- <div flex="dir:left">
- <draggable v-if="ruleForm.introduce.length" flex="dif:left">
- <div class="card-coverimg" v-for="(item, index) in ruleForm.introduce">
- <el-image class="elImages" style="width: 80px; height: 80px" :src="item.pic_url"></el-image>
- <el-button @click="delPic('introduce', index)" class="icon-close" type="primary" size="mini" icon="el-icon-close" circle></el-button>
- </div>
- </draggable>
- <com-attachment v-if="ruleForm.introduce.length < 2" :multiple="true" :max="9" type="images" @selected="introduce">
- <div class="card-upload">
- <i class="el-icon-plus"></i>
- </div>
- </com-attachment>
- </div>
- <div style="color: #cccbcb;" v-if="ruleForm.default_store_cate_style==2">建议宽高:360*140</div>
- <div style="color: #cccbcb;" v-else>建议宽度750,高度不限制</div>
- </el-form-item>
- <el-form-item prop="bannar_pic">
- <label slot="label">
- <span>门店环境图:</span>
- </label>
- <div flex="dir:left">
- <draggable v-if="ruleForm.bannar_pic.length" flex="dif:left">
- <div class="card-coverimg" v-for="(item, index) in ruleForm.bannar_pic">
- <el-image class="elImages" style="width: 80px; height: 80px" :src="item.pic_url"></el-image>
- <el-button @click="delPic('bannar_pic', index)" class="icon-close" type="primary" size="mini" icon="el-icon-close" circle></el-button>
- </div>
- </draggable>
- <com-attachment :multiple="true" :max="9" type="images" @selected="bannar_pic">
- <div class="card-upload">
- <i class="el-icon-plus"></i>
- </div>
- </com-attachment>
- </div>
- <div style="color: #cccbcb;">建议宽高:375 * 211</div>
- </el-form-item>
- <el-form-item label="创建时间:" prop="created_at">
- <div class="flex flex-y-center">
- {{ruleForm.created_at|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- </el-form-item>
- <el-form-item label="到期时间:" prop="expire_time">
- <div class="flex flex-y-center">
- {{ruleForm.expire_time|dateTimeFormat('Y-m-d H:i:s')}}
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center">
- <div class='line'></div>
- <div>门店信息</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="店长姓名:" prop="shop_owner">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.shop_owner" placeholder="请输入店长姓名"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="手机号:" prop="shop_mobile">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.shop_mobile" placeholder="请输入联系电话"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="门店地址:" prop="mobile">
- <div class="flex flex-y-center">
- <el-select v-model="ruleForm.province" value-key='id' placeholder="请选择省"
- @change="provinceChange">
- <el-option v-for="item in province_arr" :key="item.id" :label="item.name"
- :value="item"></el-option>
- </el-select>
- <el-select v-model="ruleForm.city" value-key='id' placeholder="请选择市"
- @change="cityChange">
- <el-option v-for="item in city_arr" :key="item.id" :label="item.name"
- :value="item"></el-option>
- </el-select>
- <el-select v-model="ruleForm.district" value-key='id' placeholder="请选择区"
- @change='districtChange'>
- <el-option v-for="item in district_arr" :key="item.id" :label="item.name"
- :value="item"></el-option>
- </el-select>
- <el-select v-model="ruleForm.street" value-key='id' placeholder="请选择街道"
- @change='streetChange'>
- <el-option v-for="item in street_arr" :key="item.id" :label="item.name"
- :value="item"></el-option>
- </el-select>
- <el-select v-model="ruleForm.community" v-if="community_status" value-key='id' placeholder="请选择社区"
- @change='communityChange'>
- <el-option v-for="item in community_arr" :key="item.id" :label="item.name"
- :value="item"></el-option>
- </el-select>
- </div>
- </el-form-item>
- <el-form-item label="门牌号:" prop="address">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.address" type='textarea'
- placeholder="详细地址"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="经纬度:" prop="ll">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.ll" placeholder="请输入经纬度"></el-input>
- </div>
- </el-form-item>
- <com-qq-map @map-submit="mapEvent" :address="show_address" :lat="ruleForm.latitude"
- :long="ruleForm.longitude">
- <el-button type="primary" @click="updateAddress()">展开地图</el-button>
- </com-qq-map>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>分享</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="分享标题:" prop="manage">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.share_title" placeholder="请输分享标题"></el-input>
- </div>
- </el-form-item>
- <el-form-item label="分享描述:" prop="manage">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.share_desc" placeholder="请输入分享描述"></el-input>
- </div>
- </el-form-item>
- <el-form-item prop="business_license">
- <label slot="label">
- <span>分享图片:</span>
- </label>
- <com-attachment v-model="ruleForm.share_pic" :multiple="false" :max="1">
- <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
- <el-button size="mini">选择图片</el-button>
- </el-tooltip>
- </com-attachment>
- <div class="customize-share-title">
- <com-image mode="aspectFill" width='100px' height='100px'
- :src="ruleForm.share_pic ? ruleForm.share_pic : ''"></com-image>
- <el-button v-if="ruleForm.share_pic" class="del-btn" size="mini" type="danger" icon="el-icon-close" circle @click="ruleForm.share_pic = ''"></el-button>
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>运营</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="营业状态:" prop="status">
- <div class="flex flex-y-center">
- <template>
- <el-radio v-model="ruleForm.shop_status" label="1">营业</el-radio>
- <el-radio v-model="ruleForm.shop_status" label="0">休息</el-radio>
- </template>
- </div>
- </el-form-item>
- <el-form-item label="营业时间:" prop="manage">
- <div class="flex flex-y-center">
- <template>
- <el-time-select
- v-model="ruleForm.business_time_start"
- :picker-options="{
- start: '00:00',
- step: '00:10',
- end: '23:59'
- }"
- placeholder="选择时间">
- </el-time-select>
- -
- <el-time-select
- v-model="ruleForm.business_time_end"
- :picker-options="{
- start: '00:00',
- step: '00:10',
- end: '23:59'
- }"
- placeholder="选择时间">
- </el-time-select>
- </template>
- </div>
- </el-form-item>
- <!-- <el-form-item label="门店样式:" prop="manage">-->
- <!-- <div class="flex flex-y-center">-->
- <!-- <template>-->
- <!-- <el-radio v-model="ruleForm.store_style" label="1">样式1</el-radio>-->
- <!-- <el-radio v-model="ruleForm.store_style" label="2">样式2</el-radio>-->
- <!-- </template>-->
- <!-- </div>-->
- <!-- </el-form-item>-->
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>配送</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="快递发货:" prop="express_delivery">
- <div class="flex flex-y-center">
- <template>
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="ruleForm.freight_type.express_delivery">
- </el-switch>
- </template>
- </div>
- 关闭后,影响新建/编辑商品,及买家选择快递配送方式
- <el-button type="primary" size="small" v-if="ruleForm.freight_type.express_delivery==1" @click="jump_to_freight_rules()">编辑运费模板</el-button>
- </el-form-item>
- <el-form-item label="同城配送:" prop="merchant_distribution">
- <div class="flex flex-y-center">
- <template>
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="ruleForm.freight_type.merchant_distribution">
- </el-switch>
- </template>
- </div>
- 关闭后,影响新建/编辑商品,及买家选择同城配送方式
- </el-form-item>
- <template v-if="ruleForm.freight_type.merchant_distribution==1">
- <el-form-item label="配送范围:" prop="intra_city_distribution">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.intra_city_distribution.distribution_scope" type="number" placeholder="请输入配送范围">
- <template slot="append">KM</template>
- </el-input>
- </div>
- </el-form-item>
- <el-form-item label="起送金额:" prop="intra_city_distribution">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.intra_city_distribution.initial_delivery_amount" type="number" placeholder="请输入起送金额">
- <template slot="append">元</template>
- </el-input>
- </div>
- </el-form-item>
- <el-form-item label="配送费:" prop="intra_city_distribution">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.intra_city_distribution.distribution_fee" type="number" placeholder="请输入配送费">
- <template slot="append">元</template>
- </el-input>
- </div>
- </el-form-item>
- <el-form-item label="运费减免:" prop="intra_city_distribution">
- <div class="flex flex-y-center">
- <el-input v-model="ruleForm.intra_city_distribution.full_money" type="number"placeholder="满" style="margin-right: 10px;">
- <template slot="prepend">满:</template>
- <template slot="append">元</template></el-input>
- <el-input v-model="ruleForm.intra_city_distribution.reduce_money" type="number" placeholder="减">
- <template slot="prepend">减:</template>
- <template slot="append">元</template></el-input>
- </div>
- <!-- <div class="flex flex-y-center" style="margin-top: 15px;">
- <el-input v-model="ruleForm.intra_city_distribution.reduce_money" type="number" placeholder="减">
- <template slot="prepend">减:</template>
- <template slot="append">元</template></el-input>
- </div> -->
- </el-form-item>
- </template>
- <el-form-item label="上门自提:" prop="self_mention">
- <div class="flex flex-y-center">
- <template>
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="ruleForm.freight_type.self_mention">
- </el-switch>
- </template>
- </div>
- 关闭后,影响新建/编辑商品,及买家选择该自提核销方式
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center">
- <div class='line'></div>
- <div>云喇叭设置</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="设备ID(IMEI码)">
- <el-input size="small" v-model="ruleForm.device_id" style="width: 150px;"> </el-input>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>自提码</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="是否开启:">
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="ruleForm.pickup.status"
- >
- </el-switch>
- <div style="color: red;">
- 开启选项之后将会生成自提码, 如需要打印自提码还需在主商城「打印机」插件开启自提码
- </div>
- </el-form-item>
- </div>
- <div class="common_head flex flex-y-center" style="margin-top: 30px">
- <div class='line'></div>
- <div>视频号</div>
- </div>
- <div class='basic_body'>
- <el-form-item label="前端展示:">
- <el-switch
- :active-value="1"
- :inactive-value="0"
- v-model="ruleForm.is_show_wechat_video_number"
- >
- </el-switch>
- <div style="color: red;">
- 开启后,前端展示跳转到视频号的入口。
- </div>
- </el-form-item>
- <el-form-item label="视频号id" v-if="ruleForm.is_show_wechat_video_number==1">
- <el-input size="small" v-model="ruleForm.wechat_video_number_id" style="width: 150px;"> </el-input>
- <div style="color: red;">
- ”以sph“开头的ID,登录视频号助手,在首页可以查看自己的视频号ID,复制视频号
- 到后台,点击保存,即可跳到指定视频号的主页
- </div>
- </el-form-item>
- </div>
- </div>
- </el-form>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- default_store_style1: "/resources/addons/store/img/new_default_store_style1.png",
- default_store_style2: "/resources/addons/store/img/new_default_store_style2.png",
- default_store_style3: "/resources/addons/store/img/new_default_store_style3.png",
- default_store_cate_style1: "/resources/addons/store/img/default_store_cate_style1.png",
- default_store_cate_style2: "/resources/addons/store/img/default_store_cate_style2.png",
- keyword: '',
- category: [],
- activeName: '1',
- imagesCount: 1,
- value1:"",
- value2:"",
- community_status:0,
- ruleForm: {
- user_id: '',
- name: '',
- c_id: '',
- cIds: [],
- province_id: '',
- province: '',
- city_id: '',
- city: '',
- district_id: '',
- district: '',
- street_id: '',
- street: '',
- community_id: '',
- community: '',
- address: '',
- longitude: '',
- latitude: '',
- ll: '',
- platform_address: '',
- license_img: '',
- store_img: '',
- id_card_front_img: '',
- id_card_back_img: '',
- shop_owner: '',
- shop_mobile: '',
- operate_scope: '',
- operate_time: '',
- operate_status: '',
- send_type: [],
- offline: 3,
- offline_address: '',
- cost_ratio: '',
- cost_cycle: '',
- cost_days: '',
- validity_type: 1,
- validity_days: '',
- validity_time: '',
- share_title: '',
- share_desc: '',
- share_pic: '',
- store_desc: '',
- store_name: '',
- status:1,
- store_style:1,
- default_store_cate_style:1,
- freight_type:{
- express_delivery:1,
- merchant_distribution:1,
- self_mention:1,
- },
- intra_city_distribution:{
- distribution_scope:0,
- initial_delivery_amount:0,
- distribution_fee:0,
- full_money:0,
- reduce_money:0,
- },
- pickup: {
- status: 0,
- },
- business_time_start:'00:00',
- business_time_end:"23:59",
- content: '',
- show_style: 1,
- bannar_pic: 1,
- introduce: 1,
- device_id:"",
- is_show_wechat_video_number:0,
- wechat_video_number_id:'',
- store_category_switch: 0,
- },
- store_images: [],
- user_nickname: '',
- user_mobile: '',
- send_type_show: false,
- submitLoading: true,
- dialogVisible: false,
- province_arr: [],
- city_arr: [],
- district_arr: [],
- street_arr: [],
- community_arr: [],
- custom_store_style:false,
- show_address:'',
- rules: {
- name: [{
- required: true,
- message: '请输入门店名称',
- trigger: 'blur'
- }],
- store_desc:[
- {
- required: true,
- type: 'array',
- validator: (rule, value, callback) => {
- if (value.length > 500) {
- callback('长度不超过500个字符');
- }
- callback();
- }
- }
- ]
- }
- };
- },
- methods: {
- //地图确定事件
- // mapEvent(e) {
- // this.ruleForm.longitude = e.long;
- // this.ruleForm.latitude = e.lat;
- // this.ruleForm.ll = e.lat + ',' + e.long;
- // this.ruleForm.address = e.address;
- // },
- mapEvent(e) {
- // console.log(e, '----')
- this.ruleForm.longitude = e.lng;
- this.ruleForm.latitude = e.lat;
- this.ruleForm.ll = e.lat + ',' + e.lng;
- this.ruleForm.address = e.address;
- let address = e.address;
- let reg = new RegExp(/(.*?(?:省|自治区|北京市|天津市|上海市|重庆市))+(.*?(?:市|自治州|地区|区划|县))+(.*?(?:市|区|县|镇|乡|街道))/);
- let rst = address.match(reg);
- let addr = '';
- if (rst) {
- addr += rst[1] + '/' + rst[2] + '/' + rst[3];
- }
- this.ruleForm.addr = addr;
- // console.log(rst, 'rst ==================');
- // this.$forceUpdate();
- },
- changeSendType() {
- this.send_type_show = this.ruleForm.send_type.indexOf(1) != -1;
- },
- getTime(e) {
- console.log(e, 'eeee');
- },
- back() {
- window.history.back();
- },
- save() {
- // 获取当前日期
- const today = new Date();
- const business_time_start = this.ruleForm.business_time_start;
- const [hours_start, minutes_start] = business_time_start.split(':').map(Number);
- const dateTime_start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_start, minutes_start);
- const timestamp_start = dateTime_start.getTime();
- const business_time_end = this.ruleForm.business_time_end;
- const [hours_end, minutes_end] = business_time_end.split(':').map(Number);
- const dateTime_end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_end, minutes_end);
- const timestamp_end = dateTime_end.getTime();
- this.ruleForm.store_images = this.store_images
- console.log(this.ruleForm)
- this.$refs['ruleForm'].validate((valid) => {
- if (valid) {
- request({
- params: {
- r: 'store/client/setting/index',
- },
- method: 'post',
- data: {
- form: this.ruleForm
- }
- }).then(e => {
- this.submitLoading = false;
- if (e.data.code === 0) {
- this.$message.success(e.data.msg);
- this.getBaseInfo();
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.submitLoading = false;
- this.$message.error(e.data.msg);
- });
- } else {
- console.log('error submit!!');
- this.submitLoading = false;
- return false;
- }
- });
- },
- getBaseInfo() {
- const cacheKey = 'store_info'; //缓存key
- const MallInfoCacheKey = 'mall_info'; //缓存key
- this.$request({
- params: {
- r: 'store/client/store/index',
- },
- method: 'post'
- }).then(e => {
- this.store_info = e.data.data.store_info;
- this.mall_info = e.data.data.mall_info;
- localStorage.setItem(cacheKey, JSON.stringify(e.data.data.store_info));
- localStorage.setItem(MallInfoCacheKey, JSON.stringify(e.data.data.mall_info));
- }).catch(e => {
- console.log(e);
- });
- },
- getCity(level, id = '') {
- this.loading = true;
- request({
- params: {
- r: 'store/client/setting/get-address-list',
- level,
- id
- },
- method: 'get',
- }).then(e => {
- this.loading = false;
- if (e.data.code == 0) {
- if (level == '1') {
- this.province_arr = e.data.data;
- } else if (level == '2') {
- this.city_arr = e.data.data;
- } else if(level == '3') {
- this.district_arr = e.data.data;
- }else if(level == '4') {
- this.street_arr = e.data.data;
- }else {
- this.community_arr = e.data.data;
- }
- } else {
- this.$message.error(e.data.msg);
- }
- })
- },
- provinceChange(val) {
- this.ruleForm.province_id = val.id;
- this.ruleForm.province = val.name;
- //将其它赋值为空
- this.ruleForm.city = '';
- this.ruleForm.district = '';
- this.ruleForm.street = '';
- this.ruleForm.community = '';
- this.ruleForm.latitude = val.lat
- this.ruleForm.longitude = val.lng
- this.ruleForm.ll = val.lat + ',' + val.lng;
- this.getCity('2', val.id);
- },
- cityChange(val) {
- this.ruleForm.city_id = val.id;
- this.ruleForm.city = val.name;
- this.ruleForm.district = '';
- this.ruleForm.street = '';
- this.ruleForm.community = '';
- this.ruleForm.latitude = val.lat
- this.ruleForm.longitude = val.lng
- this.ruleForm.ll = val.lat + ',' + val.lng;
- this.getCity('3', val.id);
- },
- districtChange(val) {
- this.ruleForm.district_id = val.id;
- this.ruleForm.district = val.name;
- this.ruleForm.latitude = val.lat
- this.ruleForm.longitude = val.lng
- this.ruleForm.ll = val.lat + ',' + val.lng;
- this.ruleForm.street = '';
- this.ruleForm.community = '';
- this.getCity('4', val.id);
- },
- streetChange(val){
- this.ruleForm.street_id = val.id;
- this.ruleForm.street = val.name;
- this.ruleForm.community = '';
- this.getCity('5', val.id);
- },
- communityChange(val){
- this.ruleForm.community_id = val.id;
- this.ruleForm.community = val.name;
- },
- updateAddress(){
- this.show_address = this.ruleForm.province+ this.ruleForm.city + this.ruleForm.district + this.ruleForm.street + this.ruleForm.community + this.ruleForm.address;
- },
- load() {
- request({
- params: {
- r: 'store/client/setting/index',
- },
- method: 'get',
- }).then(e => {
- this.submitLoading = false;
- if (e.data.code === 0) {
- var intra_city_distribution = this.ruleForm.intra_city_distribution;
- this.ruleForm = {...this.ruleForm, ...e.data.data.detail}
- this.community_status = e.data.data.detail.community_status
- if(e.data.data.detail.intra_city_distribution==''){
- this.ruleForm.intra_city_distribution = intra_city_distribution;
- }
- if (!this.ruleForm.pickup) {
- this.ruleForm.pickup = {
- status: 0
- }
- }
- this.ruleForm.status = this.ruleForm.status.toString();
- this.ruleForm.shop_status = this.ruleForm.shop_status.toString();
- this.ruleForm.store_style = this.ruleForm.store_style.toString();
- this.ruleForm.show_style = this.ruleForm.show_style.toString();
- this.store_images = e.data.data.detail.store_images
- if(e.data.data.custom_store_style==0){
- this.custom_store_style = true;
- }
- if(e.data.data.detail.province_id){
- this.getCity(2,e.data.data.detail.province_id);
- }
- if(e.data.data.detail.city_id){
- this.getCity(3,e.data.data.detail.city_id);
- }
- if(e.data.data.detail.district_id){
- this.getCity(4,e.data.data.detail.district_id);
- }
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.submitLoading = false;
- this.$message.error(e.data.msg);
- });
- },
- jump_to_freight_rules(){
- param = {
- r: 'store/client/setting/freight-rules'
- };
- navigateTo(param);
- },
- querySearchAsync(queryString, cb) {
- this.keyword = queryString;
- this.getUser(cb);
- },
- getCategory() {
- request({
- params: {
- r: 'store/client/setting/store-cate-tree',
- }
- }).then(res => {
- console.log(res.data.data.list)
- if (res.data.code == 0) {
- this.category = res.data.data.list
- } else {
- this.$message.error(res.data.msg);
- }
- });
- },
- createStateFilter(queryString) {
- return (state) => {
- return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
- };
- },
- handleSelect(item) {
- this.ruleForm.user_id = item.id;
- this.user_nickname = item.nickname;
- this.user_mobile = item.mobile;
- this.dialogVisible = false;
- },
- addImage(){
- this.store_images.push({
- src: '',
- })
- },
- delPic(type, index) { // 删除图片
- switch (type) {
- case 'bannar_pic':
- this.ruleForm.bannar_pic.splice(index, 1)
- break;
- case 'introduce':
- this.ruleForm.introduce.splice(index, 1)
- break;
- default:
- break;
- }
- },
- introduce(e) { // 选择轮播图
- if (e.length) {
- e.forEach((item, index) => {
- if (this.ruleForm.introduce.length >= 9) return;
- this.ruleForm.introduce.push({
- id: item.id,
- pic_url: item.url
- });
- })
- }
- },
- bannar_pic(e) {
- if (e.length) {
- e.forEach((item, index) => {
- if (this.ruleForm.bannar_pic.length >= 9) return;
- this.ruleForm.bannar_pic.push({
- id: item.id,
- pic_url: item.url
- });
- })
- }
- },
- },
- mounted() {
- this.load();
- this.getCity('1')
- this.getCategory()
- }
- });
- </script>
- <style>
- .table-body {
- padding: 20px;
- background-color: #fff;
- height: calc(100vh - 100px);
- overflow-y: auto;
- position: relative;
- }
- .head-btns .el-button {
- padding: 10px 35px;
- }
- .form-body {
- padding: 10px 20px 20px;
- background-color: #fff;
- margin-bottom: 30px;
- }
- /* 基础设置 */
- .basic_set {
- /* border: 1px solid #CCCCCC; */
- padding: 20px;
- border-radius: 10px;
- overflow-y: auto;
- }
- .common_head {
- border-bottom: 1px solid #CCCCCC;
- padding-bottom: 10px;
- font-size: 15px;
- margin-bottom: 30px;
- }
- .common_head2 {
- padding-bottom: 10px;
- font-size: 15px;
- margin-bottom: 20px;
- }
- .basic_body {
- padding-left: 25px;
- width: 50%;
- }
- .add_user {
- width: 350px;
- padding-left: 70px;
- }
- .line {
- margin-right: 10px;
- width: 5px;
- height: 23px;
- background: #03C5FF;
- }
- .stores {
- margin-bottom: 20px;
- }
- .customize-share-title {
- /* margin-top: 10px; */
- width: 100px;
- height: 100px;
- position: relative;
- cursor: move;
- }
- .del-btn {
- position: absolute;
- right: -8px;
- top: -8px;
- padding: 4px 4px;
- transform: scale(0.8);
- }
- .add-image-btn {
- width: 100px;
- height: 100px;
- color: #419EFB;
- border: 1px solid #e2e2e2;
- cursor: pointer;
- text-align: center;
- }
- .el-date-editor .el-range-separator {
- padding: 0;
- }
- .operate_state {
- padding-left: 15px;
- font-size: 15px;
- }
- .switchStyle {
- transform: scale(1.2);
- margin-left: 10px;
- }
- .switchStyle .el-switch__label {
- position: absolute;
- display: none;
- color: #fff;
- }
- .switchStyle .el-switch__label--left {
- z-index: 9;
- left: 20px;
- }
- .switchStyle .el-switch__label * {
- font-size: 12px !important;
- }
- .switchStyle .el-switch__label--right {
- z-index: 9;
- left: 0px;
- }
- .switchStyle .el-switch__label * {
- font-size: 12px !important;
- }
- .switchStyle .el-switch__label.is-active {
- display: block;
- }
- .switchStyle.el-switch .el-switch__core,
- .el-switch .el-switch__label {
- width: 70px !important;
- }
- .clear_style.el-form-item {
- margin-bottom: 0px;
- }
- .clear_style .el-input--medium .el-input__inner {
- width: 45%;
- }
- .add_radio .el-form-item__content {
- margin-top: 10px;
- }
- @media screen and (max-width: 1400px) {
- .basic_body {
- width: 70%;
- }
- .clear_style .el-input--medium .el-input__inner {
- width: 70%;
- }
- }
- /* 公共样式 */
- .flex {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- }
- .flex-x-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: center;
- -webkit-justify-content: center;
- -ms-flex-pack: center;
- justify-content: center;
- }
- .flex-x-between {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-pack: space-between;
- -webkit-justify-content: space-between;
- -ms-flex-pack: space-between;
- justify-content: space-between;
- }
- .flex-y-center {
- display: -webkit-box;
- display: -webkit-flex;
- /* #ifndef APP-NVUE */
- display: flex;
- /* #endif */
- -webkit-box-align: center;
- -webkit-align-items: center;
- -ms-flex-align: center;
- -ms-grid-row-align: center;
- align-items: center;
- }
- /* 溢出隐藏 */
- .over1 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- .over2 {
- text-overflow: -o-ellipsis-lastline;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .fixed-header {
- background: #fff;
- padding: 15px 20px;
- box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
- margin-bottom: 10px;
- }
- /* 确保 el-card 不会产生滚动 */
- .el-card {
- overflow: hidden !important;
- }
- </style>
|