index.php 52 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ComponentHelper::loadComponentView('com-image');
  4. ComponentHelper::loadComponentView('com-qq-map');
  5. ComponentHelper::loadComponentView('component/com-attachment', dirname(__DIR__));
  6. ComponentHelper::loadComponentView('component/com-attachment-edit', dirname(__DIR__));
  7. ComponentHelper::loadComponentView('component/com-upload', dirname(__DIR__));
  8. ?>
  9. <div id="app" v-cloak>
  10. <el-card shadow="never" style="border:0" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
  11. <div class="fixed-header">
  12. <div class="flex flex-x-between flex-y-center">
  13. <span>编辑门店</span>
  14. <div class='head-btns'>
  15. <el-button type="primary" @click='save'>保存</el-button>
  16. <el-button type="info" @click='back'>返回</el-button>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="table-body">
  21. <el-form ref="ruleForm" :model="ruleForm" :rules="rules" label-width="110px" size="medium"
  22. label-position='left' class="demo-dynamic">
  23. <div class="basic_set">
  24. <div class="common_head flex flex-y-center">
  25. <div class='line'></div>
  26. <div>基本信息</div>
  27. </div>
  28. <div class='basic_body'>
  29. <el-form-item label="平台地址:" prop="store_name">
  30. <div class="flex flex-y-center">
  31. {{ruleForm.platform_address}}
  32. </div>
  33. </el-form-item>
  34. <el-form-item label="门店分类:" prop="c_id">
  35. <el-cascader v-model="ruleForm.cIds" placeholder="试试搜索:指南"
  36. :options="category"
  37. filterable>
  38. </el-cascader>
  39. </el-form-item>
  40. <el-form-item label="门店名称:" prop="store_name">
  41. <div class="flex flex-y-center">
  42. <el-input v-model="ruleForm.store_name" placeholder="请输入门店名称"></el-input>
  43. </div>
  44. </el-form-item>
  45. <el-form-item label="门店介绍:" prop="store_desc">
  46. <div class="flex flex-y-center">
  47. <el-input
  48. type="textarea"
  49. :autosize="{ minRows: 2, maxRows: 4}"
  50. placeholder="门店介绍"
  51. v-model="ruleForm.store_desc">
  52. </el-input>
  53. </div>
  54. </el-form-item>
  55. <el-form-item prop="business_license">
  56. <label slot="label">
  57. <span>营业执照:</span>
  58. </label>
  59. <com-attachment v-model="ruleForm.license_img" :multiple="false" :max="1">
  60. <el-tooltip class="item" effect="dark" content="建议尺寸:686 * 485" placement="top">
  61. <el-button size="mini">选择图片</el-button>
  62. </el-tooltip>
  63. </com-attachment>
  64. <div class="customize-share-title">
  65. <com-image mode="aspectFill" width='100px' height='100px'
  66. :src="ruleForm.license_img ? ruleForm.license_img : ''"></com-image>
  67. <el-button v-if="ruleForm.license_img" class="del-btn" size="mini"
  68. type="danger" icon="el-icon-close" circle
  69. @click="ruleForm.license_img = ''"></el-button>
  70. </div>
  71. </el-form-item>
  72. <el-form-item prop="store_background">
  73. <label slot="label">
  74. <span>门店背景:</span>
  75. </label>
  76. <com-attachment v-model="ruleForm.store_background" :multiple="false" :max="1">
  77. <el-tooltip class="item" effect="dark" content="建议尺寸:750 * 300" placement="top">
  78. <el-button size="mini">选择图片</el-button>
  79. </el-tooltip>
  80. </com-attachment>
  81. <div class="customize-share-title">
  82. <com-image mode="aspectFill" width='100px' height='100px'
  83. :src="ruleForm.store_background ? ruleForm.store_background : ''"></com-image>
  84. <el-button v-if="ruleForm.store_background" class="del-btn" size="mini"
  85. type="danger" icon="el-icon-close" circle
  86. @click="ruleForm.store_background = ''"></el-button>
  87. </div>
  88. </el-form-item>
  89. <el-form-item prop="logo_img">
  90. <label slot="label">
  91. <span>门店logo:</span>
  92. </label>
  93. <com-attachment v-model="ruleForm.logo_img" :multiple="false" :max="1">
  94. <el-tooltip class="item" effect="dark" content="建议尺寸:120 * 120" placement="top">
  95. <el-button size="mini">选择图片</el-button>
  96. </el-tooltip>
  97. </com-attachment>
  98. <div class="customize-share-title">
  99. <com-image mode="aspectFill" width='100px' height='100px'
  100. :src="ruleForm.logo_img ? ruleForm.logo_img : ''"></com-image>
  101. <el-button v-if="ruleForm.logo_img" class="del-btn" size="mini"
  102. type="danger" icon="el-icon-close" circle
  103. @click="ruleForm.logo_img = ''"></el-button>
  104. </div>
  105. </el-form-item>
  106. <el-form-item prop="show_style" >
  107. <label slot="label">
  108. <span>门店装修风格:</span>
  109. </label>
  110. <div class="flex flex-y-center">
  111. <template>
  112. <el-radio-group v-model="ruleForm.show_style" size="mini">
  113. <el-radio-button label="1" style="margin-right: 20px" :disabled="custom_store_style">
  114. <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_style2" v-if="ruleForm.store_category_switch == 0"></com-image>
  115. <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_style3" v-if="ruleForm.store_category_switch == 1"></com-image>
  116. </el-radio-button>
  117. <el-radio-button label="2" style="margin-right: 20px" :disabled="custom_store_style">
  118. <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_style1"></com-image>
  119. </el-radio-button>
  120. </el-radio-group>
  121. </template>
  122. </div>
  123. </el-form-item>
  124. <el-form-item label="是否开启分类" prop="store_category_switch" v-if="ruleForm.show_style==1">
  125. <el-switch v-model="ruleForm.store_category_switch" :active-value="1" :inactive-value="0" :disabled="custom_store_style"></el-switch>
  126. </el-form-item>
  127. <el-form-item label="门店分类样式风格" prop="default_store_style" v-if="ruleForm.show_style==2 || ruleForm.store_category_switch == 1">
  128. <template>
  129. <el-radio-group v-model="ruleForm.default_store_cate_style" size="mini" :disabled="custom_store_style">
  130. <el-radio-button label="1" style="margin-right: 20px">
  131. <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_cate_style1"></com-image>
  132. </el-radio-button>
  133. <el-radio-button label="2" style="margin-right: 20px" :disabled="custom_store_style">
  134. <com-image mode="aspectFill" width='100px' height='180px' :src="default_store_cate_style2"></com-image>
  135. </el-radio-button>
  136. </el-radio-group>
  137. <br />
  138. </template>
  139. </el-form-item>
  140. <el-form-item prop="introduce">
  141. <label slot="label">
  142. <span>门店介绍:</span>
  143. </label>
  144. <div flex="dir:left">
  145. <draggable v-if="ruleForm.introduce.length" flex="dif:left">
  146. <div class="card-coverimg" v-for="(item, index) in ruleForm.introduce">
  147. <el-image class="elImages" style="width: 80px; height: 80px" :src="item.pic_url"></el-image>
  148. <el-button @click="delPic('introduce', index)" class="icon-close" type="primary" size="mini" icon="el-icon-close" circle></el-button>
  149. </div>
  150. </draggable>
  151. <com-attachment v-if="ruleForm.introduce.length < 2" :multiple="true" :max="9" type="images" @selected="introduce">
  152. <div class="card-upload">
  153. <i class="el-icon-plus"></i>
  154. </div>
  155. </com-attachment>
  156. </div>
  157. <div style="color: #cccbcb;" v-if="ruleForm.default_store_cate_style==2">建议宽高:360*140</div>
  158. <div style="color: #cccbcb;" v-else>建议宽度750,高度不限制</div>
  159. </el-form-item>
  160. <el-form-item prop="bannar_pic">
  161. <label slot="label">
  162. <span>门店环境图:</span>
  163. </label>
  164. <div flex="dir:left">
  165. <draggable v-if="ruleForm.bannar_pic.length" flex="dif:left">
  166. <div class="card-coverimg" v-for="(item, index) in ruleForm.bannar_pic">
  167. <el-image class="elImages" style="width: 80px; height: 80px" :src="item.pic_url"></el-image>
  168. <el-button @click="delPic('bannar_pic', index)" class="icon-close" type="primary" size="mini" icon="el-icon-close" circle></el-button>
  169. </div>
  170. </draggable>
  171. <com-attachment :multiple="true" :max="9" type="images" @selected="bannar_pic">
  172. <div class="card-upload">
  173. <i class="el-icon-plus"></i>
  174. </div>
  175. </com-attachment>
  176. </div>
  177. <div style="color: #cccbcb;">建议宽高:375 * 211</div>
  178. </el-form-item>
  179. <el-form-item label="创建时间:" prop="created_at">
  180. <div class="flex flex-y-center">
  181. {{ruleForm.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  182. </div>
  183. </el-form-item>
  184. <el-form-item label="到期时间:" prop="expire_time">
  185. <div class="flex flex-y-center">
  186. {{ruleForm.expire_time|dateTimeFormat('Y-m-d H:i:s')}}
  187. </div>
  188. </el-form-item>
  189. </div>
  190. <div class="common_head flex flex-y-center">
  191. <div class='line'></div>
  192. <div>门店信息</div>
  193. </div>
  194. <div class='basic_body'>
  195. <el-form-item label="店长姓名:" prop="shop_owner">
  196. <div class="flex flex-y-center">
  197. <el-input v-model="ruleForm.shop_owner" placeholder="请输入店长姓名"></el-input>
  198. </div>
  199. </el-form-item>
  200. <el-form-item label="手机号:" prop="shop_mobile">
  201. <div class="flex flex-y-center">
  202. <el-input v-model="ruleForm.shop_mobile" placeholder="请输入联系电话"></el-input>
  203. </div>
  204. </el-form-item>
  205. <el-form-item label="门店地址:" prop="mobile">
  206. <div class="flex flex-y-center">
  207. <el-select v-model="ruleForm.province" value-key='id' placeholder="请选择省"
  208. @change="provinceChange">
  209. <el-option v-for="item in province_arr" :key="item.id" :label="item.name"
  210. :value="item"></el-option>
  211. </el-select>
  212. <el-select v-model="ruleForm.city" value-key='id' placeholder="请选择市"
  213. @change="cityChange">
  214. <el-option v-for="item in city_arr" :key="item.id" :label="item.name"
  215. :value="item"></el-option>
  216. </el-select>
  217. <el-select v-model="ruleForm.district" value-key='id' placeholder="请选择区"
  218. @change='districtChange'>
  219. <el-option v-for="item in district_arr" :key="item.id" :label="item.name"
  220. :value="item"></el-option>
  221. </el-select>
  222. <el-select v-model="ruleForm.street" value-key='id' placeholder="请选择街道"
  223. @change='streetChange'>
  224. <el-option v-for="item in street_arr" :key="item.id" :label="item.name"
  225. :value="item"></el-option>
  226. </el-select>
  227. <el-select v-model="ruleForm.community" v-if="community_status" value-key='id' placeholder="请选择社区"
  228. @change='communityChange'>
  229. <el-option v-for="item in community_arr" :key="item.id" :label="item.name"
  230. :value="item"></el-option>
  231. </el-select>
  232. </div>
  233. </el-form-item>
  234. <el-form-item label="门牌号:" prop="address">
  235. <div class="flex flex-y-center">
  236. <el-input v-model="ruleForm.address" type='textarea'
  237. placeholder="详细地址"></el-input>
  238. </div>
  239. </el-form-item>
  240. <el-form-item label="经纬度:" prop="ll">
  241. <div class="flex flex-y-center">
  242. <el-input v-model="ruleForm.ll" placeholder="请输入经纬度"></el-input>
  243. </div>
  244. </el-form-item>
  245. <com-qq-map @map-submit="mapEvent" :address="show_address" :lat="ruleForm.latitude"
  246. :long="ruleForm.longitude">
  247. <el-button type="primary" @click="updateAddress()">展开地图</el-button>
  248. </com-qq-map>
  249. </div>
  250. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  251. <div class='line'></div>
  252. <div>分享</div>
  253. </div>
  254. <div class='basic_body'>
  255. <el-form-item label="分享标题:" prop="manage">
  256. <div class="flex flex-y-center">
  257. <el-input v-model="ruleForm.share_title" placeholder="请输分享标题"></el-input>
  258. </div>
  259. </el-form-item>
  260. <el-form-item label="分享描述:" prop="manage">
  261. <div class="flex flex-y-center">
  262. <el-input v-model="ruleForm.share_desc" placeholder="请输入分享描述"></el-input>
  263. </div>
  264. </el-form-item>
  265. <el-form-item prop="business_license">
  266. <label slot="label">
  267. <span>分享图片:</span>
  268. </label>
  269. <com-attachment v-model="ruleForm.share_pic" :multiple="false" :max="1">
  270. <el-tooltip class="item" effect="dark" content="建议尺寸:420 * 336" placement="top">
  271. <el-button size="mini">选择图片</el-button>
  272. </el-tooltip>
  273. </com-attachment>
  274. <div class="customize-share-title">
  275. <com-image mode="aspectFill" width='100px' height='100px'
  276. :src="ruleForm.share_pic ? ruleForm.share_pic : ''"></com-image>
  277. <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>
  278. </div>
  279. </el-form-item>
  280. </div>
  281. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  282. <div class='line'></div>
  283. <div>运营</div>
  284. </div>
  285. <div class='basic_body'>
  286. <el-form-item label="营业状态:" prop="status">
  287. <div class="flex flex-y-center">
  288. <template>
  289. <el-radio v-model="ruleForm.shop_status" label="1">营业</el-radio>
  290. <el-radio v-model="ruleForm.shop_status" label="0">休息</el-radio>
  291. </template>
  292. </div>
  293. </el-form-item>
  294. <el-form-item label="营业时间:" prop="manage">
  295. <div class="flex flex-y-center">
  296. <template>
  297. <el-time-select
  298. v-model="ruleForm.business_time_start"
  299. :picker-options="{
  300. start: '00:00',
  301. step: '00:10',
  302. end: '23:59'
  303. }"
  304. placeholder="选择时间">
  305. </el-time-select>
  306. -
  307. <el-time-select
  308. v-model="ruleForm.business_time_end"
  309. :picker-options="{
  310. start: '00:00',
  311. step: '00:10',
  312. end: '23:59'
  313. }"
  314. placeholder="选择时间">
  315. </el-time-select>
  316. </template>
  317. </div>
  318. </el-form-item>
  319. <!-- <el-form-item label="门店样式:" prop="manage">-->
  320. <!-- <div class="flex flex-y-center">-->
  321. <!-- <template>-->
  322. <!-- <el-radio v-model="ruleForm.store_style" label="1">样式1</el-radio>-->
  323. <!-- <el-radio v-model="ruleForm.store_style" label="2">样式2</el-radio>-->
  324. <!-- </template>-->
  325. <!-- </div>-->
  326. <!-- </el-form-item>-->
  327. </div>
  328. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  329. <div class='line'></div>
  330. <div>配送</div>
  331. </div>
  332. <div class='basic_body'>
  333. <el-form-item label="快递发货:" prop="express_delivery">
  334. <div class="flex flex-y-center">
  335. <template>
  336. <el-switch
  337. :active-value="1"
  338. :inactive-value="0"
  339. v-model="ruleForm.freight_type.express_delivery">
  340. </el-switch>
  341. </template>
  342. </div>
  343. 关闭后,影响新建/编辑商品,及买家选择快递配送方式
  344. <el-button type="primary" size="small" v-if="ruleForm.freight_type.express_delivery==1" @click="jump_to_freight_rules()">编辑运费模板</el-button>
  345. </el-form-item>
  346. <el-form-item label="同城配送:" prop="merchant_distribution">
  347. <div class="flex flex-y-center">
  348. <template>
  349. <el-switch
  350. :active-value="1"
  351. :inactive-value="0"
  352. v-model="ruleForm.freight_type.merchant_distribution">
  353. </el-switch>
  354. </template>
  355. </div>
  356. 关闭后,影响新建/编辑商品,及买家选择同城配送方式
  357. </el-form-item>
  358. <template v-if="ruleForm.freight_type.merchant_distribution==1">
  359. <el-form-item label="配送范围:" prop="intra_city_distribution">
  360. <div class="flex flex-y-center">
  361. <el-input v-model="ruleForm.intra_city_distribution.distribution_scope" type="number" placeholder="请输入配送范围">
  362. <template slot="append">KM</template>
  363. </el-input>
  364. </div>
  365. </el-form-item>
  366. <el-form-item label="起送金额:" prop="intra_city_distribution">
  367. <div class="flex flex-y-center">
  368. <el-input v-model="ruleForm.intra_city_distribution.initial_delivery_amount" type="number" placeholder="请输入起送金额">
  369. <template slot="append">元</template>
  370. </el-input>
  371. </div>
  372. </el-form-item>
  373. <el-form-item label="配送费:" prop="intra_city_distribution">
  374. <div class="flex flex-y-center">
  375. <el-input v-model="ruleForm.intra_city_distribution.distribution_fee" type="number" placeholder="请输入配送费">
  376. <template slot="append">元</template>
  377. </el-input>
  378. </div>
  379. </el-form-item>
  380. <el-form-item label="运费减免:" prop="intra_city_distribution">
  381. <div class="flex flex-y-center">
  382. <el-input v-model="ruleForm.intra_city_distribution.full_money" type="number"placeholder="满" style="margin-right: 10px;">
  383. <template slot="prepend">满:</template>
  384. <template slot="append">元</template></el-input>
  385. <el-input v-model="ruleForm.intra_city_distribution.reduce_money" type="number" placeholder="减">
  386. <template slot="prepend">减:</template>
  387. <template slot="append">元</template></el-input>
  388. </div>
  389. <!-- <div class="flex flex-y-center" style="margin-top: 15px;">
  390. <el-input v-model="ruleForm.intra_city_distribution.reduce_money" type="number" placeholder="减">
  391. <template slot="prepend">减:</template>
  392. <template slot="append">元</template></el-input>
  393. </div> -->
  394. </el-form-item>
  395. </template>
  396. <el-form-item label="上门自提:" prop="self_mention">
  397. <div class="flex flex-y-center">
  398. <template>
  399. <el-switch
  400. :active-value="1"
  401. :inactive-value="0"
  402. v-model="ruleForm.freight_type.self_mention">
  403. </el-switch>
  404. </template>
  405. </div>
  406. 关闭后,影响新建/编辑商品,及买家选择该自提核销方式
  407. </el-form-item>
  408. </div>
  409. <div class="common_head flex flex-y-center">
  410. <div class='line'></div>
  411. <div>云喇叭设置</div>
  412. </div>
  413. <div class='basic_body'>
  414. <el-form-item label="设备ID(IMEI码)">
  415. <el-input size="small" v-model="ruleForm.device_id" style="width: 150px;"> </el-input>
  416. </el-form-item>
  417. </div>
  418. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  419. <div class='line'></div>
  420. <div>自提码</div>
  421. </div>
  422. <div class='basic_body'>
  423. <el-form-item label="是否开启:">
  424. <el-switch
  425. :active-value="1"
  426. :inactive-value="0"
  427. v-model="ruleForm.pickup.status"
  428. >
  429. </el-switch>
  430. <div style="color: red;">
  431. 开启选项之后将会生成自提码, 如需要打印自提码还需在主商城「打印机」插件开启自提码
  432. </div>
  433. </el-form-item>
  434. </div>
  435. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  436. <div class='line'></div>
  437. <div>视频号</div>
  438. </div>
  439. <div class='basic_body'>
  440. <el-form-item label="前端展示:">
  441. <el-switch
  442. :active-value="1"
  443. :inactive-value="0"
  444. v-model="ruleForm.is_show_wechat_video_number"
  445. >
  446. </el-switch>
  447. <div style="color: red;">
  448. 开启后,前端展示跳转到视频号的入口。
  449. </div>
  450. </el-form-item>
  451. <el-form-item label="视频号id" v-if="ruleForm.is_show_wechat_video_number==1">
  452. <el-input size="small" v-model="ruleForm.wechat_video_number_id" style="width: 150px;"> </el-input>
  453. <div style="color: red;">
  454. ”以sph“开头的ID,登录视频号助手,在首页可以查看自己的视频号ID,复制视频号
  455. 到后台,点击保存,即可跳到指定视频号的主页
  456. </div>
  457. </el-form-item>
  458. </div>
  459. </div>
  460. </el-form>
  461. </div>
  462. </el-card>
  463. </div>
  464. <script>
  465. const app = new Vue({
  466. el: '#app',
  467. data() {
  468. return {
  469. default_store_style1: "/resources/addons/store/img/new_default_store_style1.png",
  470. default_store_style2: "/resources/addons/store/img/new_default_store_style2.png",
  471. default_store_style3: "/resources/addons/store/img/new_default_store_style3.png",
  472. default_store_cate_style1: "/resources/addons/store/img/default_store_cate_style1.png",
  473. default_store_cate_style2: "/resources/addons/store/img/default_store_cate_style2.png",
  474. keyword: '',
  475. category: [],
  476. activeName: '1',
  477. imagesCount: 1,
  478. value1:"",
  479. value2:"",
  480. community_status:0,
  481. ruleForm: {
  482. user_id: '',
  483. name: '',
  484. c_id: '',
  485. cIds: [],
  486. province_id: '',
  487. province: '',
  488. city_id: '',
  489. city: '',
  490. district_id: '',
  491. district: '',
  492. street_id: '',
  493. street: '',
  494. community_id: '',
  495. community: '',
  496. address: '',
  497. longitude: '',
  498. latitude: '',
  499. ll: '',
  500. platform_address: '',
  501. license_img: '',
  502. store_img: '',
  503. id_card_front_img: '',
  504. id_card_back_img: '',
  505. shop_owner: '',
  506. shop_mobile: '',
  507. operate_scope: '',
  508. operate_time: '',
  509. operate_status: '',
  510. send_type: [],
  511. offline: 3,
  512. offline_address: '',
  513. cost_ratio: '',
  514. cost_cycle: '',
  515. cost_days: '',
  516. validity_type: 1,
  517. validity_days: '',
  518. validity_time: '',
  519. share_title: '',
  520. share_desc: '',
  521. share_pic: '',
  522. store_desc: '',
  523. store_name: '',
  524. status:1,
  525. store_style:1,
  526. default_store_cate_style:1,
  527. freight_type:{
  528. express_delivery:1,
  529. merchant_distribution:1,
  530. self_mention:1,
  531. },
  532. intra_city_distribution:{
  533. distribution_scope:0,
  534. initial_delivery_amount:0,
  535. distribution_fee:0,
  536. full_money:0,
  537. reduce_money:0,
  538. },
  539. pickup: {
  540. status: 0,
  541. },
  542. business_time_start:'00:00',
  543. business_time_end:"23:59",
  544. content: '',
  545. show_style: 1,
  546. bannar_pic: 1,
  547. introduce: 1,
  548. device_id:"",
  549. is_show_wechat_video_number:0,
  550. wechat_video_number_id:'',
  551. store_category_switch: 0,
  552. },
  553. store_images: [],
  554. user_nickname: '',
  555. user_mobile: '',
  556. send_type_show: false,
  557. submitLoading: true,
  558. dialogVisible: false,
  559. province_arr: [],
  560. city_arr: [],
  561. district_arr: [],
  562. street_arr: [],
  563. community_arr: [],
  564. custom_store_style:false,
  565. show_address:'',
  566. rules: {
  567. name: [{
  568. required: true,
  569. message: '请输入门店名称',
  570. trigger: 'blur'
  571. }],
  572. store_desc:[
  573. {
  574. required: true,
  575. type: 'array',
  576. validator: (rule, value, callback) => {
  577. if (value.length > 500) {
  578. callback('长度不超过500个字符');
  579. }
  580. callback();
  581. }
  582. }
  583. ]
  584. }
  585. };
  586. },
  587. methods: {
  588. //地图确定事件
  589. // mapEvent(e) {
  590. // this.ruleForm.longitude = e.long;
  591. // this.ruleForm.latitude = e.lat;
  592. // this.ruleForm.ll = e.lat + ',' + e.long;
  593. // this.ruleForm.address = e.address;
  594. // },
  595. mapEvent(e) {
  596. // console.log(e, '----')
  597. this.ruleForm.longitude = e.lng;
  598. this.ruleForm.latitude = e.lat;
  599. this.ruleForm.ll = e.lat + ',' + e.lng;
  600. this.ruleForm.address = e.address;
  601. let address = e.address;
  602. let reg = new RegExp(/(.*?(?:省|自治区|北京市|天津市|上海市|重庆市))+(.*?(?:市|自治州|地区|区划|县))+(.*?(?:市|区|县|镇|乡|街道))/);
  603. let rst = address.match(reg);
  604. let addr = '';
  605. if (rst) {
  606. addr += rst[1] + '/' + rst[2] + '/' + rst[3];
  607. }
  608. this.ruleForm.addr = addr;
  609. // console.log(rst, 'rst ==================');
  610. // this.$forceUpdate();
  611. },
  612. changeSendType() {
  613. this.send_type_show = this.ruleForm.send_type.indexOf(1) != -1;
  614. },
  615. getTime(e) {
  616. console.log(e, 'eeee');
  617. },
  618. back() {
  619. window.history.back();
  620. },
  621. save() {
  622. // 获取当前日期
  623. const today = new Date();
  624. const business_time_start = this.ruleForm.business_time_start;
  625. const [hours_start, minutes_start] = business_time_start.split(':').map(Number);
  626. const dateTime_start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_start, minutes_start);
  627. const timestamp_start = dateTime_start.getTime();
  628. const business_time_end = this.ruleForm.business_time_end;
  629. const [hours_end, minutes_end] = business_time_end.split(':').map(Number);
  630. const dateTime_end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_end, minutes_end);
  631. const timestamp_end = dateTime_end.getTime();
  632. this.ruleForm.store_images = this.store_images
  633. console.log(this.ruleForm)
  634. this.$refs['ruleForm'].validate((valid) => {
  635. if (valid) {
  636. request({
  637. params: {
  638. r: 'store/client/setting/index',
  639. },
  640. method: 'post',
  641. data: {
  642. form: this.ruleForm
  643. }
  644. }).then(e => {
  645. this.submitLoading = false;
  646. if (e.data.code === 0) {
  647. this.$message.success(e.data.msg);
  648. this.getBaseInfo();
  649. } else {
  650. this.$message.error(e.data.msg);
  651. }
  652. }).catch(e => {
  653. this.submitLoading = false;
  654. this.$message.error(e.data.msg);
  655. });
  656. } else {
  657. console.log('error submit!!');
  658. this.submitLoading = false;
  659. return false;
  660. }
  661. });
  662. },
  663. getBaseInfo() {
  664. const cacheKey = 'store_info'; //缓存key
  665. const MallInfoCacheKey = 'mall_info'; //缓存key
  666. this.$request({
  667. params: {
  668. r: 'store/client/store/index',
  669. },
  670. method: 'post'
  671. }).then(e => {
  672. this.store_info = e.data.data.store_info;
  673. this.mall_info = e.data.data.mall_info;
  674. localStorage.setItem(cacheKey, JSON.stringify(e.data.data.store_info));
  675. localStorage.setItem(MallInfoCacheKey, JSON.stringify(e.data.data.mall_info));
  676. }).catch(e => {
  677. console.log(e);
  678. });
  679. },
  680. getCity(level, id = '') {
  681. this.loading = true;
  682. request({
  683. params: {
  684. r: 'store/client/setting/get-address-list',
  685. level,
  686. id
  687. },
  688. method: 'get',
  689. }).then(e => {
  690. this.loading = false;
  691. if (e.data.code == 0) {
  692. if (level == '1') {
  693. this.province_arr = e.data.data;
  694. } else if (level == '2') {
  695. this.city_arr = e.data.data;
  696. } else if(level == '3') {
  697. this.district_arr = e.data.data;
  698. }else if(level == '4') {
  699. this.street_arr = e.data.data;
  700. }else {
  701. this.community_arr = e.data.data;
  702. }
  703. } else {
  704. this.$message.error(e.data.msg);
  705. }
  706. })
  707. },
  708. provinceChange(val) {
  709. this.ruleForm.province_id = val.id;
  710. this.ruleForm.province = val.name;
  711. //将其它赋值为空
  712. this.ruleForm.city = '';
  713. this.ruleForm.district = '';
  714. this.ruleForm.street = '';
  715. this.ruleForm.community = '';
  716. this.ruleForm.latitude = val.lat
  717. this.ruleForm.longitude = val.lng
  718. this.ruleForm.ll = val.lat + ',' + val.lng;
  719. this.getCity('2', val.id);
  720. },
  721. cityChange(val) {
  722. this.ruleForm.city_id = val.id;
  723. this.ruleForm.city = val.name;
  724. this.ruleForm.district = '';
  725. this.ruleForm.street = '';
  726. this.ruleForm.community = '';
  727. this.ruleForm.latitude = val.lat
  728. this.ruleForm.longitude = val.lng
  729. this.ruleForm.ll = val.lat + ',' + val.lng;
  730. this.getCity('3', val.id);
  731. },
  732. districtChange(val) {
  733. this.ruleForm.district_id = val.id;
  734. this.ruleForm.district = val.name;
  735. this.ruleForm.latitude = val.lat
  736. this.ruleForm.longitude = val.lng
  737. this.ruleForm.ll = val.lat + ',' + val.lng;
  738. this.ruleForm.street = '';
  739. this.ruleForm.community = '';
  740. this.getCity('4', val.id);
  741. },
  742. streetChange(val){
  743. this.ruleForm.street_id = val.id;
  744. this.ruleForm.street = val.name;
  745. this.ruleForm.community = '';
  746. this.getCity('5', val.id);
  747. },
  748. communityChange(val){
  749. this.ruleForm.community_id = val.id;
  750. this.ruleForm.community = val.name;
  751. },
  752. updateAddress(){
  753. this.show_address = this.ruleForm.province+ this.ruleForm.city + this.ruleForm.district + this.ruleForm.street + this.ruleForm.community + this.ruleForm.address;
  754. },
  755. load() {
  756. request({
  757. params: {
  758. r: 'store/client/setting/index',
  759. },
  760. method: 'get',
  761. }).then(e => {
  762. this.submitLoading = false;
  763. if (e.data.code === 0) {
  764. var intra_city_distribution = this.ruleForm.intra_city_distribution;
  765. this.ruleForm = {...this.ruleForm, ...e.data.data.detail}
  766. this.community_status = e.data.data.detail.community_status
  767. if(e.data.data.detail.intra_city_distribution==''){
  768. this.ruleForm.intra_city_distribution = intra_city_distribution;
  769. }
  770. if (!this.ruleForm.pickup) {
  771. this.ruleForm.pickup = {
  772. status: 0
  773. }
  774. }
  775. this.ruleForm.status = this.ruleForm.status.toString();
  776. this.ruleForm.shop_status = this.ruleForm.shop_status.toString();
  777. this.ruleForm.store_style = this.ruleForm.store_style.toString();
  778. this.ruleForm.show_style = this.ruleForm.show_style.toString();
  779. this.store_images = e.data.data.detail.store_images
  780. if(e.data.data.custom_store_style==0){
  781. this.custom_store_style = true;
  782. }
  783. if(e.data.data.detail.province_id){
  784. this.getCity(2,e.data.data.detail.province_id);
  785. }
  786. if(e.data.data.detail.city_id){
  787. this.getCity(3,e.data.data.detail.city_id);
  788. }
  789. if(e.data.data.detail.district_id){
  790. this.getCity(4,e.data.data.detail.district_id);
  791. }
  792. } else {
  793. this.$message.error(e.data.msg);
  794. }
  795. }).catch(e => {
  796. this.submitLoading = false;
  797. this.$message.error(e.data.msg);
  798. });
  799. },
  800. jump_to_freight_rules(){
  801. param = {
  802. r: 'store/client/setting/freight-rules'
  803. };
  804. navigateTo(param);
  805. },
  806. querySearchAsync(queryString, cb) {
  807. this.keyword = queryString;
  808. this.getUser(cb);
  809. },
  810. getCategory() {
  811. request({
  812. params: {
  813. r: 'store/client/setting/store-cate-tree',
  814. }
  815. }).then(res => {
  816. console.log(res.data.data.list)
  817. if (res.data.code == 0) {
  818. this.category = res.data.data.list
  819. } else {
  820. this.$message.error(res.data.msg);
  821. }
  822. });
  823. },
  824. createStateFilter(queryString) {
  825. return (state) => {
  826. return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  827. };
  828. },
  829. handleSelect(item) {
  830. this.ruleForm.user_id = item.id;
  831. this.user_nickname = item.nickname;
  832. this.user_mobile = item.mobile;
  833. this.dialogVisible = false;
  834. },
  835. addImage(){
  836. this.store_images.push({
  837. src: '',
  838. })
  839. },
  840. delPic(type, index) { // 删除图片
  841. switch (type) {
  842. case 'bannar_pic':
  843. this.ruleForm.bannar_pic.splice(index, 1)
  844. break;
  845. case 'introduce':
  846. this.ruleForm.introduce.splice(index, 1)
  847. break;
  848. default:
  849. break;
  850. }
  851. },
  852. introduce(e) { // 选择轮播图
  853. if (e.length) {
  854. e.forEach((item, index) => {
  855. if (this.ruleForm.introduce.length >= 9) return;
  856. this.ruleForm.introduce.push({
  857. id: item.id,
  858. pic_url: item.url
  859. });
  860. })
  861. }
  862. },
  863. bannar_pic(e) {
  864. if (e.length) {
  865. e.forEach((item, index) => {
  866. if (this.ruleForm.bannar_pic.length >= 9) return;
  867. this.ruleForm.bannar_pic.push({
  868. id: item.id,
  869. pic_url: item.url
  870. });
  871. })
  872. }
  873. },
  874. },
  875. mounted() {
  876. this.load();
  877. this.getCity('1')
  878. this.getCategory()
  879. }
  880. });
  881. </script>
  882. <style>
  883. .table-body {
  884. padding: 20px;
  885. background-color: #fff;
  886. height: calc(100vh - 100px);
  887. overflow-y: auto;
  888. position: relative;
  889. }
  890. .head-btns .el-button {
  891. padding: 10px 35px;
  892. }
  893. .form-body {
  894. padding: 10px 20px 20px;
  895. background-color: #fff;
  896. margin-bottom: 30px;
  897. }
  898. /* 基础设置 */
  899. .basic_set {
  900. /* border: 1px solid #CCCCCC; */
  901. padding: 20px;
  902. border-radius: 10px;
  903. overflow-y: auto;
  904. }
  905. .common_head {
  906. border-bottom: 1px solid #CCCCCC;
  907. padding-bottom: 10px;
  908. font-size: 15px;
  909. margin-bottom: 30px;
  910. }
  911. .common_head2 {
  912. padding-bottom: 10px;
  913. font-size: 15px;
  914. margin-bottom: 20px;
  915. }
  916. .basic_body {
  917. padding-left: 25px;
  918. width: 50%;
  919. }
  920. .add_user {
  921. width: 350px;
  922. padding-left: 70px;
  923. }
  924. .line {
  925. margin-right: 10px;
  926. width: 5px;
  927. height: 23px;
  928. background: #03C5FF;
  929. }
  930. .stores {
  931. margin-bottom: 20px;
  932. }
  933. .customize-share-title {
  934. /* margin-top: 10px; */
  935. width: 100px;
  936. height: 100px;
  937. position: relative;
  938. cursor: move;
  939. }
  940. .del-btn {
  941. position: absolute;
  942. right: -8px;
  943. top: -8px;
  944. padding: 4px 4px;
  945. transform: scale(0.8);
  946. }
  947. .add-image-btn {
  948. width: 100px;
  949. height: 100px;
  950. color: #419EFB;
  951. border: 1px solid #e2e2e2;
  952. cursor: pointer;
  953. text-align: center;
  954. }
  955. .el-date-editor .el-range-separator {
  956. padding: 0;
  957. }
  958. .operate_state {
  959. padding-left: 15px;
  960. font-size: 15px;
  961. }
  962. .switchStyle {
  963. transform: scale(1.2);
  964. margin-left: 10px;
  965. }
  966. .switchStyle .el-switch__label {
  967. position: absolute;
  968. display: none;
  969. color: #fff;
  970. }
  971. .switchStyle .el-switch__label--left {
  972. z-index: 9;
  973. left: 20px;
  974. }
  975. .switchStyle .el-switch__label * {
  976. font-size: 12px !important;
  977. }
  978. .switchStyle .el-switch__label--right {
  979. z-index: 9;
  980. left: 0px;
  981. }
  982. .switchStyle .el-switch__label * {
  983. font-size: 12px !important;
  984. }
  985. .switchStyle .el-switch__label.is-active {
  986. display: block;
  987. }
  988. .switchStyle.el-switch .el-switch__core,
  989. .el-switch .el-switch__label {
  990. width: 70px !important;
  991. }
  992. .clear_style.el-form-item {
  993. margin-bottom: 0px;
  994. }
  995. .clear_style .el-input--medium .el-input__inner {
  996. width: 45%;
  997. }
  998. .add_radio .el-form-item__content {
  999. margin-top: 10px;
  1000. }
  1001. @media screen and (max-width: 1400px) {
  1002. .basic_body {
  1003. width: 70%;
  1004. }
  1005. .clear_style .el-input--medium .el-input__inner {
  1006. width: 70%;
  1007. }
  1008. }
  1009. /* 公共样式 */
  1010. .flex {
  1011. display: -webkit-box;
  1012. display: -webkit-flex;
  1013. /* #ifndef APP-NVUE */
  1014. display: flex;
  1015. /* #endif */
  1016. }
  1017. .flex-x-center {
  1018. display: -webkit-box;
  1019. display: -webkit-flex;
  1020. /* #ifndef APP-NVUE */
  1021. display: flex;
  1022. /* #endif */
  1023. -webkit-box-pack: center;
  1024. -webkit-justify-content: center;
  1025. -ms-flex-pack: center;
  1026. justify-content: center;
  1027. }
  1028. .flex-x-between {
  1029. display: -webkit-box;
  1030. display: -webkit-flex;
  1031. /* #ifndef APP-NVUE */
  1032. display: flex;
  1033. /* #endif */
  1034. -webkit-box-pack: space-between;
  1035. -webkit-justify-content: space-between;
  1036. -ms-flex-pack: space-between;
  1037. justify-content: space-between;
  1038. }
  1039. .flex-y-center {
  1040. display: -webkit-box;
  1041. display: -webkit-flex;
  1042. /* #ifndef APP-NVUE */
  1043. display: flex;
  1044. /* #endif */
  1045. -webkit-box-align: center;
  1046. -webkit-align-items: center;
  1047. -ms-flex-align: center;
  1048. -ms-grid-row-align: center;
  1049. align-items: center;
  1050. }
  1051. /* 溢出隐藏 */
  1052. .over1 {
  1053. text-overflow: -o-ellipsis-lastline;
  1054. overflow: hidden;
  1055. text-overflow: ellipsis;
  1056. display: -webkit-box;
  1057. -webkit-line-clamp: 1;
  1058. -webkit-box-orient: vertical;
  1059. }
  1060. .over2 {
  1061. text-overflow: -o-ellipsis-lastline;
  1062. overflow: hidden;
  1063. text-overflow: ellipsis;
  1064. display: -webkit-box;
  1065. -webkit-line-clamp: 2;
  1066. -webkit-box-orient: vertical;
  1067. }
  1068. .fixed-header {
  1069. background: #fff;
  1070. padding: 15px 20px;
  1071. box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
  1072. margin-bottom: 10px;
  1073. }
  1074. /* 确保 el-card 不会产生滚动 */
  1075. .el-card {
  1076. overflow: hidden !important;
  1077. }
  1078. </style>