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. </div>
  243. </el-form-item>
  244. </div>
  245. <div v-else>
  246. <el-form-item label="配送范围:" prop="intra_city_distribution">
  247. <div class="flex flex-y-center">
  248. <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;">
  249. <template slot="append">KM</template>
  250. </el-input>
  251. </div>
  252. </el-form-item>
  253. <el-form-item label="起送金额:" prop="intra_city_distribution">
  254. <div class="flex flex-y-center">
  255. <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;">
  256. <template slot="append">元</template>
  257. </el-input>
  258. </div>
  259. </el-form-item>
  260. <el-form-item label="配送费设置" prop="delivery_fee">
  261. <template>
  262. <el-radio disabled v-model="ruleForm.intra_city_distribution.delivery_fee" :label="0">免配送费</el-radio>
  263. <el-radio disabled v-model="ruleForm.intra_city_distribution.delivery_fee" :label="1">统一配送费</el-radio><br />
  264. </template>
  265. </el-form-item>
  266. <el-form-item label="配送费:" prop="intra_city_distribution" v-if="ruleForm.intra_city_distribution.delivery_fee == 1">
  267. <div style="float: left;">
  268. <el-input disabled style="width: 70px;" v-model="ruleForm.intra_city_distribution.distance"
  269. placeholder="" class="width-200"
  270. oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  271. </div>
  272. <div style="float: left;margin-left: 20px;">公里内,收费
  273. <el-input disabled style="width: 70px;"
  274. v-model="ruleForm.intra_city_distribution.distance_charge" placeholder=""
  275. class="width-200" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  276. </div>
  277. <div style="float: left;margin-left: 20px;">元,每增加
  278. <el-input disabled style="width: 70px;"
  279. v-model="ruleForm.intra_city_distribution.every_distance" placeholder=""
  280. class="width-200" oninput="value=value.replace(/[^\d]/g,'')" size="small"></el-input>
  281. </div>
  282. <div style="float: left;margin-left: 20px;">公里,配送费增加
  283. <el-input disabled style="width: 70px;"
  284. v-model="ruleForm.intra_city_distribution.every_distance_charge"
  285. placeholder="" class="width-200" size="small"
  286. oninput="value=value.replace(/[^\d]/g,'')"></el-input>
  287. </div>
  288. </el-form-item>
  289. </div>
  290. </template>
  291. <el-form-item label="上门自提:" prop="self_mention">
  292. <div class="flex flex-y-center">
  293. <template>
  294. <el-switch
  295. :active-value="1"
  296. :inactive-value="0"
  297. v-model="ruleForm.self_mention">
  298. </el-switch>
  299. </template>
  300. </div>
  301. 启用上门自提后,买家可以就近选择商品自提点,买家下单后,您需要确保买家指定的自提点商品库存充足
  302. </el-form-item>
  303. </div>
  304. <div class="common_head flex flex-y-center" style="margin-top: 30px">
  305. <div class='line'></div>
  306. <div>汇付设置</div>
  307. </div>
  308. <div class='basic_body'>
  309. <el-form-item label="客户编号:" prop="huifu_no">
  310. <div class="flex flex-y-center">
  311. <el-input v-model="ruleForm.huifu_no" placeholder="请输入汇付编号" size="small"
  312. style="width:300px;"></el-input>
  313. </div>
  314. </el-form-item>
  315. </div>
  316. </div>
  317. </el-form>
  318. </div>
  319. </el-card>
  320. </div>
  321. <script>
  322. const app = new Vue({
  323. el: '#app',
  324. data() {
  325. return {
  326. keyword: '',
  327. category: [],
  328. activeName: '1',
  329. imagesCount: 1,
  330. value1:"",
  331. value2:"",
  332. community_status:0,
  333. ruleForm: {
  334. huifu_no: '',
  335. user_id: '',
  336. province_id: '',
  337. province: '',
  338. city_id: '',
  339. city: '',
  340. district_id: '',
  341. district: '',
  342. address: '',
  343. longitude: '',
  344. latitude: '',
  345. ll: '',
  346. license_img: '',
  347. shop_owner: '',
  348. shop_mobile: '',
  349. store_desc: '',
  350. store_name: '',
  351. status:1,
  352. merchant_distribution:1,
  353. self_mention:1,
  354. intra_city_distribution:{
  355. is_alone: 1,
  356. delivery_fee: 0,
  357. distribution_scope: '',
  358. initial_delivery_amount: 0,
  359. distance: '',
  360. distance_charge: '',
  361. every_distance: '',
  362. every_distance_charge: '',
  363. },
  364. business_time_start:'00:00',
  365. business_time_end:"23:59",
  366. content: '',
  367. introduce: 1,
  368. },
  369. system_setting: [],
  370. alone_setting: {
  371. is_alone: 1,
  372. distribution_scope: '',
  373. delivery_fee: 0,
  374. initial_delivery_amount: 0,
  375. distance: 0,
  376. distance_charge: 0,
  377. every_distance: 0,
  378. every_distance_charge: 0,
  379. },
  380. store_images: [],
  381. user_nickname: '',
  382. user_mobile: '',
  383. submitLoading: true,
  384. dialogVisible: false,
  385. province_arr: [],
  386. city_arr: [],
  387. district_arr: [],
  388. rules: {
  389. shop_owner: [{
  390. required: true,
  391. message: '请输入店长姓名',
  392. trigger: 'blur'
  393. }],
  394. store_name:
  395. [{
  396. required: true,
  397. message: '请输入门店名称',
  398. trigger: 'blur'
  399. }]
  400. }
  401. };
  402. },
  403. methods: {
  404. //地图确定事件
  405. // mapEvent(e) {
  406. // this.ruleForm.longitude = e.long;
  407. // this.ruleForm.latitude = e.lat;
  408. // this.ruleForm.ll = e.lat + ',' + e.long;
  409. // this.ruleForm.address = e.address;
  410. // },
  411. mapEvent(e) {
  412. // console.log(e, '----')
  413. this.ruleForm.longitude = e.long;
  414. this.ruleForm.latitude = e.lat;
  415. this.ruleForm.ll = e.lat + ',' + e.long;
  416. this.ruleForm.address = e.address;
  417. let address = e.address;
  418. let reg = new RegExp(/(.*?(?:省|自治区|北京市|天津市|上海市|重庆市))+(.*?(?:市|自治州|地区|区划|县))+(.*?(?:市|区|县|镇|乡|街道))/);
  419. let rst = address.match(reg);
  420. let addr = '';
  421. if (rst) {
  422. addr += rst[1] + '/' + rst[2] + '/' + rst[3];
  423. }
  424. this.ruleForm.addr = addr;
  425. },
  426. getTime(e) {
  427. console.log(e, 'eeee');
  428. },
  429. back() {
  430. window.history.back();
  431. },
  432. save() {
  433. // 获取当前日期
  434. const today = new Date();
  435. const business_time_start = this.ruleForm.business_time_start;
  436. const [hours_start, minutes_start] = business_time_start.split(':').map(Number);
  437. const dateTime_start = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_start, minutes_start);
  438. const timestamp_start = dateTime_start.getTime();
  439. const business_time_end = this.ruleForm.business_time_end;
  440. const [hours_end, minutes_end] = business_time_end.split(':').map(Number);
  441. const dateTime_end = new Date(today.getFullYear(), today.getMonth(), today.getDate(), hours_end, minutes_end);
  442. const timestamp_end = dateTime_end.getTime();
  443. if(timestamp_start >= timestamp_end){
  444. this.$message.error("营业时间中,结束时间不能小于开始时间");
  445. return false;
  446. }
  447. this.ruleForm.store_images = this.store_images
  448. console.log(this.ruleForm)
  449. this.$refs['ruleForm'].validate((valid) => {
  450. if (valid) {
  451. request({
  452. params: {
  453. r: 'happiness/client/setting/index',
  454. },
  455. method: 'post',
  456. data: {
  457. form: this.ruleForm
  458. }
  459. }).then(e => {
  460. this.submitLoading = false;
  461. if (e.data.code === 0) {
  462. this.$message.success(e.data.msg);
  463. } else {
  464. this.$message.error(e.data.msg);
  465. }
  466. }).catch(e => {
  467. this.submitLoading = false;
  468. this.$message.error(e.data.msg);
  469. });
  470. } else {
  471. console.log('error submit!!');
  472. this.submitLoading = false;
  473. return false;
  474. }
  475. });
  476. },
  477. getCity(level, id = '') {
  478. this.loading = true;
  479. request({
  480. params: {
  481. r: 'happiness/client/setting/get-address-list',
  482. level,
  483. id
  484. },
  485. method: 'get',
  486. }).then(e => {
  487. this.loading = false;
  488. if (e.data.code == 0) {
  489. if (level == '1') {
  490. this.province_arr = e.data.data;
  491. } else if (level == '2') {
  492. this.city_arr = e.data.data;
  493. } else if(level == '3') {
  494. this.district_arr = e.data.data;
  495. }
  496. } else {
  497. this.$message.error(e.data.msg);
  498. }
  499. })
  500. },
  501. provinceChange(val) {
  502. this.ruleForm.province_id = val.id;
  503. this.ruleForm.province = val.name;
  504. //将其它赋值为空
  505. this.ruleForm.city = '';
  506. this.ruleForm.district = '';
  507. this.getCity('2', val.id);
  508. },
  509. cityChange(val) {
  510. this.ruleForm.city_id = val.id;
  511. this.ruleForm.district = '';
  512. this.getCity('3', val.id);
  513. },
  514. districtChange(val) {
  515. this.ruleForm.district_id = val.id;
  516. this.ruleForm.district = val.name;
  517. this.ruleForm.latitude = val.lat
  518. this.ruleForm.longitude = val.lng
  519. this.getCity('4', val.id);
  520. },
  521. load() {
  522. request({
  523. params: {
  524. r: 'happiness/client/setting/index',
  525. },
  526. method: 'get',
  527. }).then(e => {
  528. this.submitLoading = false;
  529. if (e.data.code === 0) {
  530. var intra_city_distribution = this.ruleForm.intra_city_distribution;
  531. this.ruleForm = {...this.ruleForm, ...e.data.data.detail}
  532. // this.system_setting = e.data.data.configs;
  533. this.community_status = e.data.data.detail.community_status
  534. if(e.data.data.detail.intra_city_distribution==''){
  535. this.ruleForm.intra_city_distribution = intra_city_distribution;
  536. }
  537. this.system_setting = e.data.data.configs;
  538. if (Object.keys(e.data.data.configs).length > 0 && this.ruleForm.intra_city_distribution.is_alone == 0) {
  539. this.ruleForm.intra_city_distribution.distribution_scope = e.data.data.configs.localtion_limit;
  540. this.ruleForm.intra_city_distribution.delivery_fee = e.data.data.configs.delivery_fee;
  541. this.ruleForm.intra_city_distribution.initial_delivery_amount = e.data.data.configs.delivery_amount;
  542. this.ruleForm.intra_city_distribution.distance = e.data.data.configs.start_limit;
  543. this.ruleForm.intra_city_distribution.distance_charge = e.data.data.configs.start_amount;
  544. this.ruleForm.intra_city_distribution.every_distance = e.data.data.configs.add_limit;
  545. this.ruleForm.intra_city_distribution.every_distance_charge = e.data.data.configs.add_amount;
  546. // console.log(self.storeForm);
  547. }
  548. // this.ruleForm.intra_city_distribution.is_alone = this.ruleForm.intra_city_distribution.is_alone.toString();
  549. this.ruleForm.status = this.ruleForm.status.toString();
  550. this.ruleForm.shop_status = this.ruleForm.shop_status.toString();
  551. this.store_images = e.data.data.detail.store_images
  552. } else {
  553. this.$message.error(e.data.msg);
  554. }
  555. }).catch(e => {
  556. this.submitLoading = false;
  557. this.$message.error(e.data.msg);
  558. });
  559. },
  560. jump_to_freight_rules(){
  561. param = {
  562. r: 'happiness/client/setting/freight-rules'
  563. };
  564. navigateTo(param);
  565. },
  566. querySearchAsync(queryString, cb) {
  567. this.keyword = queryString;
  568. this.getUser(cb);
  569. },
  570. getCategory() {
  571. request({
  572. params: {
  573. r: 'happiness/client/setting/store-cate-tree',
  574. }
  575. }).then(res => {
  576. if (res.data.code == 0) {
  577. this.category = res.data.data.list
  578. } else {
  579. this.$message.error(res.data.msg);
  580. }
  581. });
  582. },
  583. createStateFilter(queryString) {
  584. return (state) => {
  585. return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
  586. };
  587. },
  588. handleSelect(item) {
  589. this.ruleForm.user_id = item.id;
  590. this.user_nickname = item.nickname;
  591. this.user_mobile = item.mobile;
  592. this.dialogVisible = false;
  593. },
  594. addImage(){
  595. this.store_images.push({
  596. src: '',
  597. })
  598. },
  599. delPic(type, index) { // 删除图片
  600. switch (type) {
  601. case 'introduce':
  602. this.ruleForm.introduce.splice(index, 1)
  603. break;
  604. default:
  605. break;
  606. }
  607. },
  608. changeRadioValue(e) {
  609. if (e == 1) {
  610. this.ruleForm.intra_city_distribution = {...this.ruleForm.intra_city_distribution, ...this.alone_setting};
  611. } else {
  612. this.alone_setting = {...this.alone_setting, ...this.ruleForm.intra_city_distribution};
  613. this.alone_setting.is_alone = 1;
  614. this.ruleForm.intra_city_distribution.distribution_scope = this.system_setting.localtion_limit;
  615. this.ruleForm.intra_city_distribution.delivery_fee = this.system_setting.delivery_fee;
  616. this.ruleForm.intra_city_distribution.initial_delivery_amount = this.system_setting.delivery_amount;
  617. this.ruleForm.intra_city_distribution.distance = this.system_setting.start_limit;
  618. this.ruleForm.intra_city_distribution.distance_charge = this.system_setting.start_amount;
  619. this.ruleForm.intra_city_distribution.every_distance = this.system_setting.add_limit;
  620. this.ruleForm.intra_city_distribution.every_distance_charge = this.system_setting.add_amount;
  621. // console.log(this.alone_setting);
  622. }
  623. },
  624. },
  625. mounted() {
  626. this.load();
  627. this.getCity('1')
  628. this.getCategory()
  629. }
  630. });
  631. </script>
  632. <style>
  633. .table-body {
  634. padding: 20px;
  635. background-color: #fff;
  636. height: calc(100vh - 100px);
  637. overflow-y: auto;
  638. position: relative;
  639. }
  640. .head-btns .el-button {
  641. padding: 10px 35px;
  642. }
  643. .form-body {
  644. padding: 10px 20px 20px;
  645. background-color: #fff;
  646. margin-bottom: 30px;
  647. }
  648. /* 基础设置 */
  649. .basic_set {
  650. /* border: 1px solid #CCCCCC; */
  651. padding: 20px;
  652. border-radius: 10px;
  653. overflow-y: auto;
  654. }
  655. .common_head {
  656. border-bottom: 1px solid #CCCCCC;
  657. padding-bottom: 10px;
  658. font-size: 15px;
  659. margin-bottom: 30px;
  660. }
  661. .common_head2 {
  662. padding-bottom: 10px;
  663. font-size: 15px;
  664. margin-bottom: 20px;
  665. }
  666. .basic_body {
  667. padding-left: 25px;
  668. /* width: 50%; */
  669. }
  670. .add_user {
  671. width: 350px;
  672. padding-left: 70px;
  673. }
  674. .line {
  675. margin-right: 10px;
  676. width: 5px;
  677. height: 23px;
  678. background: #03C5FF;
  679. }
  680. .stores {
  681. margin-bottom: 20px;
  682. }
  683. .customize-share-title {
  684. /* margin-top: 10px; */
  685. width: 100px;
  686. height: 100px;
  687. position: relative;
  688. cursor: move;
  689. }
  690. .del-btn {
  691. position: absolute;
  692. right: -8px;
  693. top: -8px;
  694. padding: 4px 4px;
  695. transform: scale(0.8);
  696. }
  697. .add-image-btn {
  698. width: 100px;
  699. height: 100px;
  700. color: #419EFB;
  701. border: 1px solid #e2e2e2;
  702. cursor: pointer;
  703. text-align: center;
  704. }
  705. .el-date-editor .el-range-separator {
  706. padding: 0;
  707. }
  708. .operate_state {
  709. padding-left: 15px;
  710. font-size: 15px;
  711. }
  712. .switchStyle {
  713. transform: scale(1.2);
  714. margin-left: 10px;
  715. }
  716. .switchStyle .el-switch__label {
  717. position: absolute;
  718. display: none;
  719. color: #fff;
  720. }
  721. .switchStyle .el-switch__label--left {
  722. z-index: 9;
  723. left: 20px;
  724. }
  725. .switchStyle .el-switch__label * {
  726. font-size: 12px !important;
  727. }
  728. .switchStyle .el-switch__label--right {
  729. z-index: 9;
  730. left: 0px;
  731. }
  732. .switchStyle .el-switch__label * {
  733. font-size: 12px !important;
  734. }
  735. .switchStyle .el-switch__label.is-active {
  736. display: block;
  737. }
  738. .switchStyle.el-switch .el-switch__core,
  739. .el-switch .el-switch__label {
  740. width: 70px !important;
  741. }
  742. .clear_style.el-form-item {
  743. margin-bottom: 0px;
  744. }
  745. .clear_style .el-input--medium .el-input__inner {
  746. width: 45%;
  747. }
  748. .add_radio .el-form-item__content {
  749. margin-top: 10px;
  750. }
  751. @media screen and (max-width: 1400px) {
  752. .basic_body {
  753. width: 70%;
  754. }
  755. .clear_style .el-input--medium .el-input__inner {
  756. width: 70%;
  757. }
  758. }
  759. /* 公共样式 */
  760. .flex {
  761. display: -webkit-box;
  762. display: -webkit-flex;
  763. /* #ifndef APP-NVUE */
  764. display: flex;
  765. /* #endif */
  766. }
  767. .flex-x-center {
  768. display: -webkit-box;
  769. display: -webkit-flex;
  770. /* #ifndef APP-NVUE */
  771. display: flex;
  772. /* #endif */
  773. -webkit-box-pack: center;
  774. -webkit-justify-content: center;
  775. -ms-flex-pack: center;
  776. justify-content: center;
  777. }
  778. .flex-x-between {
  779. display: -webkit-box;
  780. display: -webkit-flex;
  781. /* #ifndef APP-NVUE */
  782. display: flex;
  783. /* #endif */
  784. -webkit-box-pack: space-between;
  785. -webkit-justify-content: space-between;
  786. -ms-flex-pack: space-between;
  787. justify-content: space-between;
  788. }
  789. .flex-y-center {
  790. display: -webkit-box;
  791. display: -webkit-flex;
  792. /* #ifndef APP-NVUE */
  793. display: flex;
  794. /* #endif */
  795. -webkit-box-align: center;
  796. -webkit-align-items: center;
  797. -ms-flex-align: center;
  798. -ms-grid-row-align: center;
  799. align-items: center;
  800. }
  801. /* 溢出隐藏 */
  802. .over1 {
  803. text-overflow: -o-ellipsis-lastline;
  804. overflow: hidden;
  805. text-overflow: ellipsis;
  806. display: -webkit-box;
  807. -webkit-line-clamp: 1;
  808. -webkit-box-orient: vertical;
  809. }
  810. .over2 {
  811. text-overflow: -o-ellipsis-lastline;
  812. overflow: hidden;
  813. text-overflow: ellipsis;
  814. display: -webkit-box;
  815. -webkit-line-clamp: 2;
  816. -webkit-box-orient: vertical;
  817. }
  818. .fixed-header {
  819. background: #fff;
  820. padding: 15px 20px;
  821. box-shadow: 0 2px 4px rgba(0, 0, 0, .12);
  822. margin-bottom: 10px;
  823. }
  824. /* 确保 el-card 不会产生滚动 */
  825. .el-card {
  826. overflow: hidden !important;
  827. }
  828. </style>