index.php 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  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. 用户ID:{{ruleForm.user_id}}
  32. </div>
  33. <div class="flex flex-y-center">
  34. 用户昵称:{{ruleForm.nickname}}
  35. </div>
  36. </el-form-item>
  37. <el-form-item label="店长姓名:" prop="shop_owner">
  38. <div class="flex flex-y-center">
  39. <el-input v-model="ruleForm.shop_owner" placeholder="请输入店长姓名" size="small" style="width:300px;"></el-input>
  40. </div>
  41. </el-form-item>
  42. <el-form-item label="手机号:" prop="shop_mobile">
  43. <div class="flex flex-y-center">
  44. {{ruleForm.shop_mobile}}
  45. </div>
  46. </el-form-item>
  47. <el-form-item label="门店名称:" prop="store_name">
  48. <div class="flex flex-y-center">
  49. <el-input v-model="ruleForm.store_name" placeholder="请输入门店名称" size="small" style="width:300px;"></el-input>
  50. </div>
  51. </el-form-item>
  52. <el-form-item label="门店简介:" prop="store_desc">
  53. <div class="flex flex-y-center">
  54. <el-input
  55. type="textarea"
  56. :autosize="{ minRows: 2, maxRows: 4}"
  57. placeholder="门店简介"
  58. v-model="ruleForm.store_desc"
  59. size="small" style="width:300px;">
  60. </el-input>
  61. </div>
  62. </el-form-item>
  63. <el-form-item prop="logo_img">
  64. <label slot="label">
  65. <span>商家logo:</span>
  66. </label>
  67. <com-attachment v-model="ruleForm.logo_img" :multiple="false" :max="1">
  68. <el-tooltip class="item" effect="dark" content="建议尺寸:120 * 120" placement="top">
  69. <el-button size="mini">选择图片</el-button>
  70. </el-tooltip>
  71. </com-attachment>
  72. <div class="customize-share-title">
  73. <com-image mode="aspectFill" width='100px' height='100px'
  74. :src="ruleForm.logo_img ? ruleForm.logo_img : ''"></com-image>
  75. <el-button v-if="ruleForm.logo_img" class="del-btn" size="mini"
  76. type="danger" icon="el-icon-close" circle
  77. @click="ruleForm.logo_img = ''"></el-button>
  78. </div>
  79. </el-form-item>
  80. <el-form-item prop="business_license">
  81. <label slot="label">
  82. <span>营业执照:</span>
  83. </label>
  84. <com-attachment v-model="ruleForm.license_img" :multiple="false" :max="1">
  85. <el-tooltip class="item" effect="dark" content="建议尺寸:686 * 485" placement="top">
  86. <el-button size="mini">选择图片</el-button>
  87. </el-tooltip>
  88. </com-attachment>
  89. <div class="customize-share-title">
  90. <com-image mode="aspectFill" width='100px' height='100px'
  91. :src="ruleForm.license_img ? ruleForm.license_img : ''"></com-image>
  92. <el-button v-if="ruleForm.license_img" class="del-btn" size="mini"
  93. type="danger" icon="el-icon-close" circle
  94. @click="ruleForm.license_img = ''"></el-button>
  95. </div>
  96. </el-form-item>
  97. <el-form-item label="创建时间:" prop="created_at">
  98. <div class="flex flex-y-center">
  99. {{ruleForm.created_at|dateTimeFormat('Y-m-d H:i:s')}}
  100. </div>
  101. </el-form-item>
  102. <el-form-item label="所在区域:" prop="mobile">
  103. <div class="flex flex-y-center">
  104. <el-select v-model="ruleForm.province" value-key='id' placeholder="请选择省"
  105. @change="provinceChange" size="small">
  106. <el-option v-for="item in province_arr" :key="item.id" :label="item.name"
  107. :value="item"></el-option>
  108. </el-select>
  109. <el-select v-model="ruleForm.city" value-key='id' placeholder="请选择市"
  110. @change="cityChange" size="small">
  111. <el-option v-for="item in city_arr" :key="item.id" :label="item.name"
  112. :value="item"></el-option>
  113. </el-select>
  114. <el-select v-model="ruleForm.district" value-key='id' placeholder="请选择区"
  115. @change='districtChange' size="small">
  116. <el-option v-for="item in district_arr" :key="item.id" :label="item.name"
  117. :value="item"></el-option>
  118. </el-select>
  119. </div>
  120. </el-form-item>
  121. <el-form-item label="详细地址:" prop="address">
  122. <div class="flex flex-y-center">
  123. <el-input v-model="ruleForm.address" type='textarea'
  124. placeholder="详细地址" size="small" style="width:300px;"></el-input>
  125. </div>
  126. </el-form-item>
  127. <el-form-item label="经纬度:" prop="ll">
  128. <div class="flex flex-y-center">
  129. <el-input v-model="ruleForm.ll" placeholder="请输入经纬度" size="small" style="width:300px;" disabled></el-input>
  130. </div>
  131. </el-form-item>
  132. <com-qq-map @map-submit="mapEvent" :address="ruleForm.address" :lat="ruleForm.latitude"
  133. :long="ruleForm.longitude">
  134. <el-button type="primary">展开地图</el-button>
  135. </com-qq-map>
  136. </div>
  137. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  138. <div class='line'></div>
  139. <div>运营</div>
  140. </div>
  141. <div class='basic_body'>
  142. <el-form-item label="营业状态:" prop="status">
  143. <template>
  144. <el-radio v-model="ruleForm.shop_status" label="1">营业</el-radio>
  145. <el-radio v-model="ruleForm.shop_status" label="0">休息</el-radio>
  146. </template>
  147. </el-form-item>
  148. <el-form-item label="营业时间:" prop="manage">
  149. <div class="flex flex-y-center">
  150. <template>
  151. <el-time-select
  152. v-model="ruleForm.business_time_start"
  153. :picker-options="{
  154. start: '00:00',
  155. step: '00:10',
  156. end: '23:59'
  157. }"
  158. placeholder="选择时间" size="small">
  159. </el-time-select>
  160. -
  161. <el-time-select
  162. v-model="ruleForm.business_time_end"
  163. :picker-options="{
  164. start: '00:00',
  165. step: '00:10',
  166. end: '23:59'
  167. }"
  168. placeholder="选择时间" size="small">
  169. </el-time-select>
  170. </template>
  171. </div>
  172. </el-form-item>
  173. </div>
  174. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  175. <div class='line'></div>
  176. <div>配送</div>
  177. </div>
  178. <div class='basic_body'>
  179. <el-form-item label="同城配送:" prop="merchant_distribution">
  180. <div class="flex flex-y-center">
  181. <template>
  182. <el-switch
  183. :active-value="1"
  184. :inactive-value="0"
  185. v-model="ruleForm.merchant_distribution">
  186. </el-switch>
  187. </template>
  188. </div>
  189. 启用同城配送后,在配送范围内的买家可以选择同城配送,商家自己配送
  190. </el-form-item>
  191. <!-- <el-form-item label="是否独立设置:" prop="status" v-if="ruleForm.merchant_distribution==1">-->
  192. <!-- <template>-->
  193. <!-- <el-radio-group v-model="ruleForm.intra_city_distribution.is_alone" @input="changeRadioValue">-->
  194. <!-- <el-radio :label="0">跟随系统</el-radio>-->
  195. <!-- <el-radio :label="1">独立设置</el-radio>-->
  196. <!-- </el-radio-group>-->
  197. <!-- </template>-->
  198. <!-- </el-form-item>-->
  199. <template v-if="ruleForm.merchant_distribution==1">
  200. <div v-if="ruleForm.intra_city_distribution.is_alone == 1">
  201. <el-form-item label="配送范围:" prop="intra_city_distribution">
  202. <div class="flex flex-y-center">
  203. <el-input v-model="ruleForm.intra_city_distribution.distribution_scope" oninput="value=value.replace(/[^\d]/g,'')" type="number" placeholder="请输入配送范围" size="small" style="width:300px;">
  204. <template slot="append">KM</template>
  205. </el-input>
  206. </div>
  207. </el-form-item>
  208. <el-form-item label="起送金额:" prop="intra_city_distribution">
  209. <div class="flex flex-y-center">
  210. <el-input v-model="ruleForm.intra_city_distribution.initial_delivery_amount" oninput="value=value.replace(/[^\d]/g,'')" type="number" placeholder="请输入起送金额" size="small" style="width:300px;">
  211. <template slot="append">元</template>
  212. </el-input>
  213. </div>
  214. </el-form-item>
  215. <el-form-item label="配送费设置" prop="delivery_fee">
  216. <template>
  217. <el-radio v-model="ruleForm.intra_city_distribution.delivery_fee" :label="0">免配送费</el-radio>
  218. <el-radio v-model="ruleForm.intra_city_distribution.delivery_fee" :label="1">统一配送费</el-radio><br />
  219. </template>
  220. </el-form-item>
  221. <el-form-item label="配送费:" prop="intra_city_distribution" v-if="ruleForm.intra_city_distribution.delivery_fee == 1">
  222. <div style="float: left;">
  223. <el-input style="width: 70px;" v-model="ruleForm.intra_city_distribution.distance"
  224. placeholder="" class="width-200"
  225. oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  226. </div>
  227. <div style="float: left;margin-left: 20px;">公里内,收费
  228. <el-input style="width: 70px;"
  229. v-model="ruleForm.intra_city_distribution.distance_charge" placeholder=""
  230. class="width-200" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  231. </div>
  232. <div style="float: left;margin-left: 20px;">元,每增加
  233. <el-input style="width: 70px;"
  234. v-model="ruleForm.intra_city_distribution.every_distance" placeholder=""
  235. class="width-200" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  236. </div>
  237. <div style="float: left;margin-left: 20px;">公里,配送费增加
  238. <el-input style="width: 70px;"
  239. v-model="ruleForm.intra_city_distribution.every_distance_charge"
  240. placeholder="" class="width-200" size="small"
  241. oninput="value=value.replace(/[^\d]/g,'')"></el-input>
  242. 元
  243. </div>
  244. </el-form-item>
  245. </div>
  246. <div v-else>
  247. <el-form-item label="配送范围:" prop="intra_city_distribution">
  248. <div class="flex flex-y-center">
  249. <el-input disabled v-model="ruleForm.intra_city_distribution.distribution_scope" oninput="value=value.replace(/[^\d]/g,'')" type="number" placeholder="请输入配送范围" size="small" style="width:300px;">
  250. <template slot="append">KM</template>
  251. </el-input>
  252. </div>
  253. </el-form-item>
  254. <el-form-item label="起送金额:" prop="intra_city_distribution">
  255. <div class="flex flex-y-center">
  256. <el-input disabled v-model="ruleForm.intra_city_distribution.initial_delivery_amount" oninput="value=value.replace(/[^\d]/g,'')" type="number" placeholder="请输入起送金额" size="small" style="width:300px;">
  257. <template slot="append">元</template>
  258. </el-input>
  259. </div>
  260. </el-form-item>
  261. <el-form-item label="配送费设置" prop="delivery_fee">
  262. <template>
  263. <el-radio disabled v-model="ruleForm.intra_city_distribution.delivery_fee" :label="0">免配送费</el-radio>
  264. <el-radio disabled v-model="ruleForm.intra_city_distribution.delivery_fee" :label="1">统一配送费</el-radio><br />
  265. </template>
  266. </el-form-item>
  267. <el-form-item label="配送费:" prop="intra_city_distribution" v-if="ruleForm.intra_city_distribution.delivery_fee == 1">
  268. <div style="float: left;">
  269. <el-input disabled style="width: 70px;" v-model="ruleForm.intra_city_distribution.distance"
  270. placeholder="" class="width-200"
  271. oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  272. </div>
  273. <div style="float: left;margin-left: 20px;">公里内,收费
  274. <el-input disabled style="width: 70px;"
  275. v-model="ruleForm.intra_city_distribution.distance_charge" placeholder=""
  276. class="width-200" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  277. </div>
  278. <div style="float: left;margin-left: 20px;">元,每增加
  279. <el-input disabled style="width: 70px;"
  280. v-model="ruleForm.intra_city_distribution.every_distance" placeholder=""
  281. class="width-200" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  282. </div>
  283. <div style="float: left;margin-left: 20px;">公里,配送费增加
  284. <el-input disabled style="width: 70px;"
  285. v-model="ruleForm.intra_city_distribution.every_distance_charge"
  286. placeholder="" class="width-200" size="small"
  287. oninput="value=value.replace(/[^\d]/g,'')"></el-input>
  288. 元
  289. </div>
  290. </el-form-item>
  291. </div>
  292. </template>
  293. <el-form-item label="上门自提:" prop="self_mention">
  294. <div class="flex flex-y-center">
  295. <template>
  296. <el-switch
  297. :active-value="1"
  298. :inactive-value="0"
  299. v-model="ruleForm.self_mention">
  300. </el-switch>
  301. </template>
  302. </div>
  303. 启用上门自提后,买家可以就近选择商品自提点,买家下单后,您需要确保买家指定的自提点商品库存充足
  304. </el-form-item>
  305. </div>
  306. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  307. <div class='line'></div>
  308. <div>汇付设置</div>
  309. </div>
  310. <div class='basic_body'>
  311. <el-form-item label="客户编号:" prop="huifu_no">
  312. <div class="flex flex-y-center">
  313. <el-input v-model="ruleForm.huifu_no" placeholder="请输入汇付编号" size="small"
  314. style="width:300px;"></el-input>
  315. </div>
  316. </el-form-item>
  317. </div>
  318. </div>
  319. </el-form>
  320. </div>
  321. </el-card>
  322. </div>
  323. <script>
  324. const app = new Vue({
  325. el: '#app',
  326. data() {
  327. return {
  328. keyword: '',
  329. category: [],
  330. activeName: '1',
  331. imagesCount: 1,
  332. value1:"",
  333. value2:"",
  334. community_status:0,
  335. ruleForm: {
  336. huifu_no: '',
  337. user_id: '',
  338. province_id: '',
  339. province: '',
  340. city_id: '',
  341. city: '',
  342. district_id: '',
  343. district: '',
  344. address: '',
  345. longitude: '',
  346. latitude: '',
  347. ll: '',
  348. license_img: '',
  349. shop_owner: '',
  350. shop_mobile: '',
  351. store_desc: '',
  352. store_name: '',
  353. status:1,
  354. merchant_distribution:1,
  355. self_mention:1,
  356. intra_city_distribution:{
  357. is_alone: 1,
  358. delivery_fee: 0,
  359. distribution_scope: '',
  360. initial_delivery_amount: 0,
  361. distance: '',
  362. distance_charge: '',
  363. every_distance: '',
  364. every_distance_charge: '',
  365. },
  366. business_time_start:'00:00',
  367. business_time_end:"23:59",
  368. content: '',
  369. introduce: 1,
  370. },
  371. system_setting: [],
  372. alone_setting: {
  373. is_alone: 1,
  374. distribution_scope: '',
  375. delivery_fee: 0,
  376. initial_delivery_amount: 0,
  377. distance: 0,
  378. distance_charge: 0,
  379. every_distance: 0,
  380. every_distance_charge: 0,
  381. },
  382. store_images: [],
  383. user_nickname: '',
  384. user_mobile: '',
  385. submitLoading: true,
  386. dialogVisible: false,
  387. province_arr: [],
  388. city_arr: [],
  389. district_arr: [],
  390. rules: {
  391. shop_owner: [{
  392. required: true,
  393. message: '请输入店长姓名',
  394. trigger: 'blur'
  395. }],
  396. store_name:
  397. [{
  398. required: true,
  399. message: '请输入门店名称',
  400. trigger: 'blur'
  401. }]
  402. }
  403. };
  404. },
  405. methods: {
  406. //地图确定事件
  407. // mapEvent(e) {
  408. // this.ruleForm.longitude = e.long;
  409. // this.ruleForm.latitude = e.lat;
  410. // this.ruleForm.ll = e.lat + ',' + e.long;
  411. // this.ruleForm.address = e.address;
  412. // },
  413. mapEvent(e) {
  414. // console.log(e, '----')
  415. this.ruleForm.longitude = e.long;
  416. this.ruleForm.latitude = e.lat;
  417. this.ruleForm.ll = e.lat + ',' + e.long;
  418. this.ruleForm.address = e.address;
  419. let address = e.address;
  420. let reg = new RegExp(/(.*?(?:省|自治区|北京市|天津市|上海市|重庆市))+(.*?(?:市|自治州|地区|区划|县))+(.*?(?:市|区|县|镇|乡|街道))/);
  421. let rst = address.match(reg);
  422. let addr = '';
  423. if (rst) {
  424. addr += rst[1] + '/' + rst[2] + '/' + rst[3];
  425. }
  426. this.ruleForm.addr = addr;
  427. },
  428. getTime(e) {
  429. console.log(e, 'eeee');
  430. },
  431. back() {
  432. window.history.back();
  433. },
  434. save() {
  435. // 获取当前日期
  436. const today = new Date();
  437. const business_time_start = this.ruleForm.business_time_start;
  438. const [hours_start, minutes_start] = business_time_start.split(':').map(Number);
  439. const dateTime_start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_start, minutes_start);
  440. const timestamp_start = dateTime_start.getTime();
  441. const business_time_end = this.ruleForm.business_time_end;
  442. const [hours_end, minutes_end] = business_time_end.split(':').map(Number);
  443. const dateTime_end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_end, minutes_end);
  444. const timestamp_end = dateTime_end.getTime();
  445. if(timestamp_start >= timestamp_end){
  446. this.$message.error("营业时间中,结束时间不能小于开始时间");
  447. return false;
  448. }
  449. this.ruleForm.store_images = this.store_images
  450. console.log(this.ruleForm)
  451. this.$refs['ruleForm'].validate((valid) => {
  452. if (valid) {
  453. request({
  454. params: {
  455. r: 'happiness/client/setting/index',
  456. },
  457. method: 'post',
  458. data: {
  459. form: this.ruleForm
  460. }
  461. }).then(e => {
  462. this.submitLoading = false;
  463. if (e.data.code === 0) {
  464. this.$message.success(e.data.msg);
  465. } else {
  466. this.$message.error(e.data.msg);
  467. }
  468. }).catch(e => {
  469. this.submitLoading = false;
  470. this.$message.error(e.data.msg);
  471. });
  472. } else {
  473. console.log('error submit!!');
  474. this.submitLoading = false;
  475. return false;
  476. }
  477. });
  478. },
  479. getCity(level, id = '') {
  480. this.loading = true;
  481. request({
  482. params: {
  483. r: 'happiness/client/setting/get-address-list',
  484. level,
  485. id
  486. },
  487. method: 'get',
  488. }).then(e => {
  489. this.loading = false;
  490. if (e.data.code == 0) {
  491. if (level == '1') {
  492. this.province_arr = e.data.data;
  493. } else if (level == '2') {
  494. this.city_arr = e.data.data;
  495. } else if(level == '3') {
  496. this.district_arr = e.data.data;
  497. }
  498. } else {
  499. this.$message.error(e.data.msg);
  500. }
  501. })
  502. },
  503. provinceChange(val) {
  504. this.ruleForm.province_id = val.id;
  505. this.ruleForm.province = val.name;
  506. //将其它赋值为空
  507. this.ruleForm.city = '';
  508. this.ruleForm.district = '';
  509. this.getCity('2', val.id);
  510. },
  511. cityChange(val) {
  512. this.ruleForm.city_id = val.id;
  513. this.ruleForm.district = '';
  514. this.getCity('3', val.id);
  515. },
  516. districtChange(val) {
  517. this.ruleForm.district_id = val.id;
  518. this.ruleForm.district = val.name;
  519. this.ruleForm.latitude = val.lat
  520. this.ruleForm.longitude = val.lng
  521. this.getCity('4', val.id);
  522. },
  523. load() {
  524. request({
  525. params: {
  526. r: 'happiness/client/setting/index',
  527. },
  528. method: 'get',
  529. }).then(e => {
  530. this.submitLoading = false;
  531. if (e.data.code === 0) {
  532. var intra_city_distribution = this.ruleForm.intra_city_distribution;
  533. this.ruleForm = {...this.ruleForm, ...e.data.data.detail}
  534. // this.system_setting = e.data.data.configs;
  535. this.community_status = e.data.data.detail.community_status
  536. if(e.data.data.detail.intra_city_distribution==''){
  537. this.ruleForm.intra_city_distribution = intra_city_distribution;
  538. }
  539. this.system_setting = e.data.data.configs;
  540. if (Object.keys(e.data.data.configs).length > 0 && this.ruleForm.intra_city_distribution.is_alone == 0) {
  541. this.ruleForm.intra_city_distribution.distribution_scope = e.data.data.configs.localtion_limit;
  542. this.ruleForm.intra_city_distribution.delivery_fee = e.data.data.configs.delivery_fee;
  543. this.ruleForm.intra_city_distribution.initial_delivery_amount = e.data.data.configs.delivery_amount;
  544. this.ruleForm.intra_city_distribution.distance = e.data.data.configs.start_limit;
  545. this.ruleForm.intra_city_distribution.distance_charge = e.data.data.configs.start_amount;
  546. this.ruleForm.intra_city_distribution.every_distance = e.data.data.configs.add_limit;
  547. this.ruleForm.intra_city_distribution.every_distance_charge = e.data.data.configs.add_amount;
  548. // console.log(self.storeForm);
  549. }
  550. // this.ruleForm.intra_city_distribution.is_alone = this.ruleForm.intra_city_distribution.is_alone.toString();
  551. this.ruleForm.status = this.ruleForm.status.toString();
  552. this.ruleForm.shop_status = this.ruleForm.shop_status.toString();
  553. this.store_images = e.data.data.detail.store_images
  554. } else {
  555. this.$message.error(e.data.msg);
  556. }
  557. }).catch(e => {
  558. this.submitLoading = false;
  559. this.$message.error(e.data.msg);
  560. });
  561. },
  562. jump_to_freight_rules(){
  563. param = {
  564. r: 'happiness/client/setting/freight-rules'
  565. };
  566. navigateTo(param);
  567. },
  568. querySearchAsync(queryString, cb) {
  569. this.keyword = queryString;
  570. this.getUser(cb);
  571. },
  572. getCategory() {
  573. request({
  574. params: {
  575. r: 'happiness/client/setting/store-cate-tree',
  576. }
  577. }).then(res => {
  578. if (res.data.code == 0) {
  579. this.category = res.data.data.list
  580. } else {
  581. this.$message.error(res.data.msg);
  582. }
  583. });
  584. },
  585. createStateFilter(queryString) {
  586. return (state) => {
  587. return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  588. };
  589. },
  590. handleSelect(item) {
  591. this.ruleForm.user_id = item.id;
  592. this.user_nickname = item.nickname;
  593. this.user_mobile = item.mobile;
  594. this.dialogVisible = false;
  595. },
  596. addImage(){
  597. this.store_images.push({
  598. src: '',
  599. })
  600. },
  601. delPic(type, index) { // 删除图片
  602. switch (type) {
  603. case 'introduce':
  604. this.ruleForm.introduce.splice(index, 1)
  605. break;
  606. default:
  607. break;
  608. }
  609. },
  610. changeRadioValue(e) {
  611. if (e == 1) {
  612. this.ruleForm.intra_city_distribution = {...this.ruleForm.intra_city_distribution, ...this.alone_setting};
  613. } else {
  614. this.alone_setting = {...this.alone_setting, ...this.ruleForm.intra_city_distribution};
  615. this.alone_setting.is_alone = 1;
  616. this.ruleForm.intra_city_distribution.distribution_scope = this.system_setting.localtion_limit;
  617. this.ruleForm.intra_city_distribution.delivery_fee = this.system_setting.delivery_fee;
  618. this.ruleForm.intra_city_distribution.initial_delivery_amount = this.system_setting.delivery_amount;
  619. this.ruleForm.intra_city_distribution.distance = this.system_setting.start_limit;
  620. this.ruleForm.intra_city_distribution.distance_charge = this.system_setting.start_amount;
  621. this.ruleForm.intra_city_distribution.every_distance = this.system_setting.add_limit;
  622. this.ruleForm.intra_city_distribution.every_distance_charge = this.system_setting.add_amount;
  623. // console.log(this.alone_setting);
  624. }
  625. },
  626. },
  627. mounted() {
  628. this.load();
  629. this.getCity('1')
  630. this.getCategory()
  631. }
  632. });
  633. </script>
  634. <style>
  635. .table-body {
  636. padding: 20px;
  637. background-color: #fff;
  638. height: calc(100vh - 100px);
  639. overflow-y: auto;
  640. position: relative;
  641. }
  642. .head-btns .el-button {
  643. padding: 10px 35px;
  644. }
  645. .form-body {
  646. padding: 10px 20px 20px;
  647. background-color: #fff;
  648. margin-bottom: 30px;
  649. }
  650. /* 基础设置 */
  651. .basic_set {
  652. /* border: 1px solid #CCCCCC; */
  653. padding: 20px;
  654. border-radius: 10px;
  655. overflow-y: auto;
  656. }
  657. .common_head {
  658. border-bottom: 1px solid #CCCCCC;
  659. padding-bottom: 10px;
  660. font-size: 15px;
  661. margin-bottom: 30px;
  662. }
  663. .common_head2 {
  664. padding-bottom: 10px;
  665. font-size: 15px;
  666. margin-bottom: 20px;
  667. }
  668. .basic_body {
  669. padding-left: 25px;
  670. /* width: 50%; */
  671. }
  672. .add_user {
  673. width: 350px;
  674. padding-left: 70px;
  675. }
  676. .line {
  677. margin-right: 10px;
  678. width: 5px;
  679. height: 23px;
  680. background: #03C5FF;
  681. }
  682. .stores {
  683. margin-bottom: 20px;
  684. }
  685. .customize-share-title {
  686. /* margin-top: 10px; */
  687. width: 100px;
  688. height: 100px;
  689. position: relative;
  690. cursor: move;
  691. }
  692. .del-btn {
  693. position: absolute;
  694. right: -8px;
  695. top: -8px;
  696. padding: 4px 4px;
  697. transform: scale(0.8);
  698. }
  699. .add-image-btn {
  700. width: 100px;
  701. height: 100px;
  702. color: #419EFB;
  703. border: 1px solid #e2e2e2;
  704. cursor: pointer;
  705. text-align: center;
  706. }
  707. .el-date-editor .el-range-separator {
  708. padding: 0;
  709. }
  710. .operate_state {
  711. padding-left: 15px;
  712. font-size: 15px;
  713. }
  714. .switchStyle {
  715. transform: scale(1.2);
  716. margin-left: 10px;
  717. }
  718. .switchStyle .el-switch__label {
  719. position: absolute;
  720. display: none;
  721. color: #fff;
  722. }
  723. .switchStyle .el-switch__label--left {
  724. z-index: 9;
  725. left: 20px;
  726. }
  727. .switchStyle .el-switch__label * {
  728. font-size: 12px !important;
  729. }
  730. .switchStyle .el-switch__label--right {
  731. z-index: 9;
  732. left: 0px;
  733. }
  734. .switchStyle .el-switch__label * {
  735. font-size: 12px !important;
  736. }
  737. .switchStyle .el-switch__label.is-active {
  738. display: block;
  739. }
  740. .switchStyle.el-switch .el-switch__core,
  741. .el-switch .el-switch__label {
  742. width: 70px !important;
  743. }
  744. .clear_style.el-form-item {
  745. margin-bottom: 0px;
  746. }
  747. .clear_style .el-input--medium .el-input__inner {
  748. width: 45%;
  749. }
  750. .add_radio .el-form-item__content {
  751. margin-top: 10px;
  752. }
  753. @media screen and (max-width: 1400px) {
  754. .basic_body {
  755. width: 70%;
  756. }
  757. .clear_style .el-input--medium .el-input__inner {
  758. width: 70%;
  759. }
  760. }
  761. /* 公共样式 */
  762. .flex {
  763. display: -webkit-box;
  764. display: -webkit-flex;
  765. /* #ifndef APP-NVUE */
  766. display: flex;
  767. /* #endif */
  768. }
  769. .flex-x-center {
  770. display: -webkit-box;
  771. display: -webkit-flex;
  772. /* #ifndef APP-NVUE */
  773. display: flex;
  774. /* #endif */
  775. -webkit-box-pack: center;
  776. -webkit-justify-content: center;
  777. -ms-flex-pack: center;
  778. justify-content: center;
  779. }
  780. .flex-x-between {
  781. display: -webkit-box;
  782. display: -webkit-flex;
  783. /* #ifndef APP-NVUE */
  784. display: flex;
  785. /* #endif */
  786. -webkit-box-pack: space-between;
  787. -webkit-justify-content: space-between;
  788. -ms-flex-pack: space-between;
  789. justify-content: space-between;
  790. }
  791. .flex-y-center {
  792. display: -webkit-box;
  793. display: -webkit-flex;
  794. /* #ifndef APP-NVUE */
  795. display: flex;
  796. /* #endif */
  797. -webkit-box-align: center;
  798. -webkit-align-items: center;
  799. -ms-flex-align: center;
  800. -ms-grid-row-align: center;
  801. align-items: center;
  802. }
  803. /* 溢出隐藏 */
  804. .over1 {
  805. text-overflow: -o-ellipsis-lastline;
  806. overflow: hidden;
  807. text-overflow: ellipsis;
  808. display: -webkit-box;
  809. -webkit-line-clamp: 1;
  810. -webkit-box-orient: vertical;
  811. }
  812. .over2 {
  813. text-overflow: -o-ellipsis-lastline;
  814. overflow: hidden;
  815. text-overflow: ellipsis;
  816. display: -webkit-box;
  817. -webkit-line-clamp: 2;
  818. -webkit-box-orient: vertical;
  819. }
  820. .fixed-header {
  821. background: #fff;
  822. padding: 15px 20px;
  823. box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
  824. margin-bottom: 10px;
  825. }
  826. /* 确保 el-card 不会产生滚动 */
  827. .el-card {
  828. overflow: hidden !important;
  829. }
  830. </style>