index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  1. <template>
  2. <div class="app-container">
  3. <div v-if="!isAdmin">
  4. <el-tabs v-model="step">
  5. <el-tab-pane label="首页模版配置" name="first"></el-tab-pane>
  6. <el-tab-pane label="商城logo配置" name="second"></el-tab-pane>
  7. </el-tabs>
  8. <div v-show="step == 'first'">
  9. <el-form label-width="120px" label-position="right">
  10. <el-form-item label="选择模版:" style="margin-bottom: 40px">
  11. <el-radio-group v-model="currentTemplate" @change="changeTemplate()">
  12. <div class="item">
  13. <el-radio :label="1">模版一</el-radio>
  14. <el-image :src="require('@/assets/template/tmp_1_thumb.png')"
  15. :preview-src-list="[require('@/assets/template/tmp_1.png')]" fit="cover"></el-image>
  16. </div>
  17. <div class="item">
  18. <el-radio :label="2">模版二</el-radio>
  19. <el-image :src="require('@/assets/template/tmp_2_thumb.png')"
  20. :preview-src-list="[require('@/assets/template/tmp_2.png')]" fit="cover"></el-image>
  21. </div>
  22. <div class="item">
  23. <el-radio :label="3">模版三</el-radio>
  24. <el-image :src="require('@/assets/template/tmp_3_thumb.png')"
  25. :preview-src-list="[require('@/assets/template/tmp_3.png')]" fit="cover"></el-image>
  26. </div>
  27. </el-radio-group>
  28. </el-form-item>
  29. <el-form-item label="首页模块设置:" v-show="currentTemplate === 1">
  30. <div class="diy-table">
  31. <div class="item head">
  32. <div class="label">模块名称</div>
  33. <div class="value">状态</div>
  34. </div>
  35. <div class="item">
  36. <div class="label">分类</div>
  37. <div class="value">
  38. <el-switch v-model="switch_classify" disabled></el-switch>
  39. <span :class="switch_classify ? 'on' : ''">{{ switch_classify ? '开启' : '隐藏' }}</span>
  40. </div>
  41. </div>
  42. <div class="item">
  43. <div class="label">轮播图</div>
  44. <div class="value">
  45. <el-switch v-model="switch_banner"></el-switch>
  46. <span :class="switch_banner ? 'on' : ''">{{ switch_banner ? '开启' : '隐藏' }}</span>
  47. </div>
  48. </div>
  49. <div class="item">
  50. <div class="label">公告</div>
  51. <div class="value">
  52. <el-switch v-model="switch_notice"></el-switch>
  53. <span :class="switch_notice ? 'on' : ''">{{ switch_notice ? '开启' : '隐藏' }}</span>
  54. </div>
  55. </div>
  56. <div class="item">
  57. <div class="label">专属优惠券</div>
  58. <div class="value">
  59. <el-switch v-model="switch_coupon"></el-switch>
  60. <span :class="switch_coupon ? 'on' : ''">{{ switch_coupon ? '开启' : '隐藏' }}</span>
  61. </div>
  62. </div>
  63. <div class="item">
  64. <div class="label">客户经理</div>
  65. <div class="value">
  66. <el-switch v-model="switch_manager"></el-switch>
  67. <span :class="switch_manager ? 'on' : ''">{{ switch_manager ? '开启' : '隐藏' }}</span>
  68. </div>
  69. </div>
  70. <div class="item">
  71. <div class="label">秒杀专区</div>
  72. <div class="value">
  73. <el-switch v-model="switch_seckill"></el-switch>
  74. <span :class="switch_seckill ? 'on' : ''">{{ switch_seckill ? '开启' : '隐藏' }}</span>
  75. </div>
  76. </div>
  77. <div class="item">
  78. <div class="label">好物推荐</div>
  79. <div class="value">
  80. <el-switch v-model="switch_recom" disabled></el-switch>
  81. <span :class="switch_recom ? 'on' : ''">{{ switch_recom ? '开启' : '隐藏' }}</span>
  82. </div>
  83. </div>
  84. </div>
  85. </el-form-item>
  86. <el-form-item label="首页模块设置:" v-show="currentTemplate === 2">
  87. <div class="diy-table">
  88. <div class="item head">
  89. <div class="label">模块名称</div>
  90. <div class="value">状态</div>
  91. </div>
  92. <div class="item">
  93. <div class="label">首页弹窗</div>
  94. <div class="value">
  95. <el-switch v-model="switch_dialog"></el-switch>
  96. <span :class="switch_dialog ? 'on' : ''">{{ switch_dialog ? '开启' : '隐藏' }}</span>
  97. </div>
  98. </div>
  99. <div class="item">
  100. <div class="label">轮播图</div>
  101. <div class="value">
  102. <el-switch v-model="switch_banner"></el-switch>
  103. <span :class="switch_banner ? 'on' : ''">{{ switch_banner ? '开启' : '隐藏' }}</span>
  104. </div>
  105. </div>
  106. <div class="item">
  107. <div class="label">胶囊图</div>
  108. <div class="value">
  109. <el-switch v-model="switch_activity1"></el-switch>
  110. <span :class="switch_activity1 ? 'on' : ''">{{ switch_activity1 ? '开启' : '隐藏' }}</span>
  111. </div>
  112. </div>
  113. <div class="item">
  114. <div class="label">分类</div>
  115. <div class="value">
  116. <el-switch v-model="switch_classify" disabled></el-switch>
  117. <span :class="switch_classify ? 'on' : ''">{{ switch_classify ? '开启' : '隐藏' }}</span>
  118. </div>
  119. </div>
  120. <div class="item">
  121. <div class="label">活动专区2</div>
  122. <div class="value">
  123. <el-switch v-model="switch_activity2"></el-switch>
  124. <span :class="switch_activity2 ? 'on' : ''">{{ switch_activity2 ? '开启' : '隐藏' }}</span>
  125. </div>
  126. </div>
  127. <div class="item">
  128. <div class="label">专场专区</div>
  129. <div class="value">
  130. <el-switch v-model="switch_special"></el-switch>
  131. <span :class="switch_special ? 'on' : ''">{{ switch_special ? '开启' : '隐藏' }}</span>
  132. </div>
  133. </div>
  134. <div class="item">
  135. <div class="label">秒杀专区</div>
  136. <div class="value">
  137. <el-switch v-model="switch_seckill"></el-switch>
  138. <span :class="switch_seckill ? 'on' : ''">{{ switch_seckill ? '开启' : '隐藏' }}</span>
  139. </div>
  140. </div>
  141. <div class="item">
  142. <div class="label">专属优惠券</div>
  143. <div class="value">
  144. <el-switch v-model="switch_coupon"></el-switch>
  145. <span :class="switch_coupon ? 'on' : ''">{{ switch_coupon ? '开启' : '隐藏' }}</span>
  146. </div>
  147. </div>
  148. <div class="item">
  149. <div class="label">客户经理</div>
  150. <div class="value">
  151. <el-switch v-model="switch_manager"></el-switch>
  152. <span :class="switch_manager ? 'on' : ''">{{ switch_manager ? '开启' : '隐藏' }}</span>
  153. </div>
  154. </div>
  155. <div class="item">
  156. <div class="label">公告</div>
  157. <div class="value">
  158. <el-switch v-model="switch_notice"></el-switch>
  159. <span :class="switch_notice ? 'on' : ''">{{ switch_notice ? '开启' : '隐藏' }}</span>
  160. </div>
  161. </div>
  162. <div class="item">
  163. <div class="label">新维度分类专区</div>
  164. <div class="value">
  165. <el-switch v-model="switch_newclassify" disabled></el-switch>
  166. <span :class="switch_newclassify ? 'on' : ''">{{ switch_newclassify ? '开启' : '隐藏' }}</span>
  167. </div>
  168. </div>
  169. </div>
  170. </el-form-item>
  171. <el-form-item label="首页模块设置:" v-show="currentTemplate === 3">
  172. <div class="diy-table">
  173. <div class="item head">
  174. <div class="label">模块名称</div>
  175. <div class="value">状态</div>
  176. </div>
  177. <div class="item">
  178. <div class="label">首页弹窗</div>
  179. <div class="value">
  180. <el-switch v-model="switch_dialog"></el-switch>
  181. <span :class="switch_dialog ? 'on' : ''">{{ switch_dialog ? '开启' : '隐藏' }}</span>
  182. </div>
  183. </div>
  184. <div class="item">
  185. <div class="label">轮播图</div>
  186. <div class="value">
  187. <el-switch v-model="switch_banner"></el-switch>
  188. <span :class="switch_banner ? 'on' : ''">{{ switch_banner ? '开启' : '隐藏' }}</span>
  189. </div>
  190. </div>
  191. <div class="item">
  192. <div class="label">胶囊图</div>
  193. <div class="value">
  194. <el-switch v-model="switch_activity1"></el-switch>
  195. <span :class="switch_activity1 ? 'on' : ''">{{ switch_activity1 ? '开启' : '隐藏' }}</span>
  196. </div>
  197. </div>
  198. <div class="item">
  199. <div class="label">分类</div>
  200. <div class="value">
  201. <el-switch v-model="switch_classify" disabled></el-switch>
  202. <span :class="switch_classify ? 'on' : ''">{{ switch_classify ? '开启' : '隐藏' }}</span>
  203. </div>
  204. </div>
  205. <div class="item">
  206. <div class="label">活动专区2</div>
  207. <div class="value">
  208. <el-switch v-model="switch_activity2"></el-switch>
  209. <span :class="switch_activity2 ? 'on' : ''">{{ switch_activity2 ? '开启' : '隐藏' }}</span>
  210. </div>
  211. </div>
  212. <div class="item">
  213. <div class="label">专场专区</div>
  214. <div class="value">
  215. <el-switch v-model="switch_special"></el-switch>
  216. <span :class="switch_special ? 'on' : ''">{{ switch_special ? '开启' : '隐藏' }}</span>
  217. </div>
  218. </div>
  219. <div class="item">
  220. <div class="label">秒杀专区</div>
  221. <div class="value">
  222. <el-switch v-model="switch_seckill"></el-switch>
  223. <span :class="switch_seckill ? 'on' : ''">{{ switch_seckill ? '开启' : '隐藏' }}</span>
  224. </div>
  225. </div>
  226. <div class="item">
  227. <div class="label">专题精选</div>
  228. <div class="value">
  229. <el-switch v-model="switch_selected"></el-switch>
  230. <span :class="switch_selected ? 'on' : ''">{{ switch_selected ? '开启' : '隐藏' }}</span>
  231. </div>
  232. </div>
  233. <div class="item">
  234. <div class="label">专属优惠券</div>
  235. <div class="value">
  236. <el-switch v-model="switch_coupon"></el-switch>
  237. <span :class="switch_coupon ? 'on' : ''">{{ switch_coupon ? '开启' : '隐藏' }}</span>
  238. </div>
  239. </div>
  240. <div class="item">
  241. <div class="label">客户经理</div>
  242. <div class="value">
  243. <el-switch v-model="switch_manager"></el-switch>
  244. <span :class="switch_manager ? 'on' : ''">{{ switch_manager ? '开启' : '隐藏' }}</span>
  245. </div>
  246. </div>
  247. <div class="item">
  248. <div class="label">公告</div>
  249. <div class="value">
  250. <el-switch v-model="switch_notice"></el-switch>
  251. <span :class="switch_notice ? 'on' : ''">{{ switch_notice ? '开启' : '隐藏' }}</span>
  252. </div>
  253. </div>
  254. <div class="item">
  255. <div class="label">新维度分类专区</div>
  256. <div class="value">
  257. <el-switch v-model="switch_newclassify" disabled></el-switch>
  258. <span :class="switch_newclassify ? 'on' : ''">{{ switch_newclassify ? '开启' : '隐藏' }}</span>
  259. </div>
  260. </div>
  261. <div class="item">
  262. <div class="label">底部广告图</div>
  263. <div class="value">
  264. <el-switch v-model="switch_bottom"></el-switch>
  265. <span :class="switch_bottom ? 'on' : ''">{{ switch_bottom ? '开启' : '隐藏' }}</span>
  266. </div>
  267. </div>
  268. </div>
  269. </el-form-item>
  270. </el-form>
  271. </div>
  272. <div v-show="step == 'second'">
  273. <el-form label-width="120px" label-position="right">
  274. <el-upload class="avatar-uploader" :action="baseURL + 'common/upload'" :headers="myHeaders"
  275. :show-file-list="false" :on-success="uploadSuccess" :before-upload="beforeUpload">
  276. </el-upload>
  277. <el-form-item label="主logo:" prop="imgUrl">
  278. <div class="images">
  279. <div class="main-img">
  280. <div class="img" v-if="img1_url" @mouseover="img1_hover = true;" @mouseout="img1_hover = false;">
  281. <el-image ref="img1" :src="img1_url" :preview-src-list="[img1_url]" style="width: 120px; height: 120px"
  282. fit="contain"></el-image>
  283. <div class="mask" v-show="img1_hover">
  284. <i class="el-icon-zoom-in" @click="previewImage('img1')"></i>
  285. <i class="el-icon-upload2" @click="uploadImage('img1')"></i>
  286. </div>
  287. </div>
  288. <div class="add" v-else @click="uploadImage('img1')">
  289. <i class="el-icon-plus avatar-uploader-icon"></i>
  290. </div>
  291. </div>
  292. <div class="tmp-img">
  293. <el-image :src="require('@/assets/template/template_1.png')"
  294. :preview-src-list="[require('@/assets/template/template_1.png')]"
  295. style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  296. <div class="tmp">示例图</div>
  297. </div>
  298. </div>
  299. <div class="tips">
  300. <span>建议尺寸:400*400</span>
  301. </div>
  302. </el-form-item>
  303. <el-form-item label="通用logo:" prop="imgUrl">
  304. <div class="images">
  305. <div class="main-img">
  306. <div class="img" v-if="img2_url" @mouseover="img2_hover = true;" @mouseout="img2_hover = false;">
  307. <el-image ref="img2" :src="img2_url" :preview-src-list="[img2_url]" style="width: 120px; height: 120px"
  308. fit="contain"></el-image>
  309. <div class="mask" v-show="img2_hover">
  310. <i class="el-icon-zoom-in" @click="previewImage('img2')"></i>
  311. <i class="el-icon-upload2" @click="uploadImage('img2')"></i>
  312. </div>
  313. </div>
  314. <div class="add" v-else @click="uploadImage('img2')">
  315. <i class="el-icon-plus avatar-uploader-icon"></i>
  316. </div>
  317. </div>
  318. <div class="tmp-img">
  319. <el-image :src="require('@/assets/template/template_2.png')"
  320. :preview-src-list="[require('@/assets/template/template_2.png')]"
  321. style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  322. <div class="tmp">示例图</div>
  323. </div>
  324. </div>
  325. <div class="tips">
  326. <span>建议尺寸:280*60</span>
  327. </div>
  328. </el-form-item>
  329. <el-form-item label="头像logo:" prop="imgUrl">
  330. <div class="images">
  331. <div class="main-img">
  332. <div class="img" v-if="img3_url" @mouseover="img3_hover = true;" @mouseout="img3_hover = false;">
  333. <el-image ref="img3" :src="img3_url" :preview-src-list="[img3_url]" style="width: 120px; height: 120px"
  334. fit="contain"></el-image>
  335. <div class="mask" v-show="img3_hover">
  336. <i class="el-icon-zoom-in" @click="previewImage('img3')"></i>
  337. <i class="el-icon-upload2" @click="uploadImage('img3')"></i>
  338. </div>
  339. </div>
  340. <div class="add" v-else @click="uploadImage('img3')">
  341. <i class="el-icon-plus avatar-uploader-icon"></i>
  342. </div>
  343. </div>
  344. <div class="tmp-img">
  345. <el-image :src="require('@/assets/template/template_3.png')"
  346. :preview-src-list="[require('@/assets/template/template_3.png')]"
  347. style="width: 120px; height: 120px; display: block" fit="contain"></el-image>
  348. <div class="tmp">示例图</div>
  349. </div>
  350. </div>
  351. <div class="tips">
  352. <span>建议尺寸:400*400</span>
  353. </div>
  354. </el-form-item>
  355. </el-form>
  356. </div>
  357. <div class="page-footer">
  358. <div class="footer" :class="classObj">
  359. <el-button type="primary" @click="submitStep1Form" :loading="formLoading" v-if="step == 'first'">{{ formLoading
  360. ? '保存中 ...' : '保 存' }}</el-button>
  361. <el-button type="primary" @click="submitStep2Form" :loading="formLoading" v-if="step == 'second'">{{ formLoading
  362. ? '保存中 ...' : '保 存' }}</el-button>
  363. </div>
  364. </div>
  365. </div>
  366. <div v-else>
  367. <div class="nodata">超级管理员无法进行商城配置</div>
  368. </div>
  369. </div>
  370. </template>
  371. <script>
  372. import { getToken, getUserid } from '@/utils/auth';
  373. import { getTemplate, editAccount, editTemplate, getDetail } from "@/api/merchant";
  374. import { getInfo } from '@/api/user'
  375. export default {
  376. data() {
  377. return {
  378. isAdmin: JSON.parse(localStorage.getItem("greemall_user")).type === 2,
  379. baseURL: process.env.VUE_APP_BASE_API,
  380. myHeaders: { 'x-token': getToken() },
  381. step: 'first',
  382. companyId: JSON.parse(localStorage.getItem("greemall_user")).companyWechatId,
  383. currentTemplate: JSON.parse(localStorage.getItem("greemall_user")).useTemplate,
  384. switch_dialog: true,
  385. switch_banner: true,
  386. switch_activity1: true,
  387. switch_classify: true,
  388. switch_activity2: true,
  389. switch_special: true,
  390. switch_seckill: true,
  391. switch_coupon: true,
  392. switch_manager: true,
  393. switch_notice: true,
  394. switch_newclassify: true,
  395. switch_recom: true,
  396. switch_selected: true,
  397. switch_bottom: true,
  398. templateList: [],
  399. uploadImageType: null,
  400. img1_url: '',
  401. img1_hover: false,
  402. img2_url: '',
  403. img2_hover: false,
  404. img3_url: '',
  405. img3_hover: false,
  406. formLoading: false
  407. }
  408. },
  409. computed: {
  410. sidebar() {
  411. return this.$store.state.app.sidebar
  412. },
  413. classObj() {
  414. return {
  415. hideSidebar: !this.sidebar.opened,
  416. openSidebar: this.sidebar.opened
  417. }
  418. },
  419. },
  420. created() {
  421. if (this.isAdmin) return false;
  422. this.getTemplate();
  423. },
  424. watch: {
  425. step() {
  426. if (this.step === 'first') {
  427. this.getTemplate();
  428. } else {
  429. this.getLogoDetail();
  430. }
  431. }
  432. },
  433. methods: {
  434. // 获取模版列表
  435. getTemplate() {
  436. getTemplate({
  437. companyId: this.companyId
  438. }).then(res => {
  439. if(res.data){
  440. this.templateList = res.data;
  441. }
  442. this.initHome();
  443. })
  444. },
  445. // 切换模版
  446. changeTemplate() {
  447. this.initHome();
  448. },
  449. // 初始化配置
  450. initHome() {
  451. let index = this.$findElem(this.templateList, 'templateType', this.currentTemplate);
  452. this.switch_dialog = this.templateList[index].popupStatus;
  453. this.switch_banner = this.templateList[index].carouseStatus;
  454. this.switch_activity1 = this.templateList[index].active1Status;
  455. this.switch_classify = this.templateList[index].categoryStatus;
  456. this.switch_activity2 = this.templateList[index].active2Status;
  457. this.switch_special = this.templateList[index].onlyStatus;
  458. this.switch_seckill = this.templateList[index].killStatus;
  459. this.switch_coupon = this.templateList[index].couponStatus;
  460. this.switch_manager = this.templateList[index].customerStatus;
  461. this.switch_notice = this.templateList[index].notiveStatus;
  462. this.switch_newclassify = this.templateList[index].newsStatus;
  463. this.switch_recom = this.templateList[index].okStatus;
  464. this.switch_selected = this.templateList[index].topicsStatus;
  465. this.switch_bottom = this.templateList[index].bottomBannerStatus;
  466. },
  467. // 保存首页配置
  468. submitStep1Form() {
  469. let index = this.$findElem(this.templateList, 'templateType', this.currentTemplate);
  470. let params = {
  471. companyWechatId: this.companyId,
  472. useTemplate: this.currentTemplate,
  473. companyWechatTemplatesList: [{
  474. companyWechatTemplateId: this.templateList[index].companyWechatTemplateId,
  475. templateType: this.templateList[index].templateType,
  476. popupStatus: this.switch_dialog,
  477. carouseStatus: this.switch_banner,
  478. active1Status: this.switch_activity1,
  479. categoryStatus: this.switch_classify,
  480. active2Status: this.switch_activity2,
  481. onlyStatus: this.switch_special,
  482. killStatus: this.switch_seckill,
  483. couponStatus: this.switch_coupon,
  484. customerStatus: this.switch_manager,
  485. notiveStatus: this.switch_notice,
  486. newsStatus: this.switch_newclassify,
  487. okStatus: this.switch_recom,
  488. topicsStatus: this.switch_selected,
  489. bottomBannerStatus: this.switch_bottom,
  490. }],
  491. }
  492. this.formLoading = true;
  493. editTemplate(params).then(res => {
  494. this.getTemplate();
  495. this.$successMsg('保存成功');
  496. getInfo(getUserid()).then(response => {
  497. localStorage.setItem("greemall_user", JSON.stringify(response.data));
  498. })
  499. }).finally(res => {
  500. this.formLoading = false;
  501. })
  502. },
  503. // 获取logo信息
  504. getLogoDetail() {
  505. getDetail({ adminUserId: getUserid() }).then(res => {
  506. this.img1_url = res.data.minLogo1;
  507. this.img2_url = res.data.minLogo2;
  508. this.img3_url = res.data.minLogo3;
  509. })
  510. },
  511. uploadImage(type) {
  512. this.uploadImageType = type;
  513. document.querySelector('.avatar-uploader input').click();
  514. },
  515. // 上传图片
  516. uploadSuccess(res, file) {
  517. this[this.uploadImageType + '_url'] = res.data.url;
  518. },
  519. beforeUpload(file) {
  520. const fileSuffix = file.name.substring(file.name.lastIndexOf(".") + 1);
  521. const whiteList = ['jpg', 'jpeg', 'png'];
  522. if (whiteList.indexOf(fileSuffix) === -1) {
  523. this.$errorMsg('只支持上传jpg/jpeg/png文件!');
  524. return false;
  525. }
  526. },
  527. // 预览图片
  528. previewImage(type) {
  529. this.$refs[type].showViewer = true;
  530. },
  531. submitStep2Form() {
  532. if (!this.img1_url) {
  533. return this.$errorMsg('请上传主logo');
  534. }
  535. if (!this.img2_url) {
  536. return this.$errorMsg('请上传通用logo');
  537. }
  538. if (!this.img3_url) {
  539. return this.$errorMsg('请上传头像logo');
  540. }
  541. this.formLoading = true;
  542. let params = {
  543. companyWechatId: this.companyId,
  544. mainLog: this.img1_url,
  545. commonLog: this.img2_url,
  546. minLogo: this.img3_url,
  547. }
  548. editTemplate(params).then(res => {
  549. this.getLogoDetail();
  550. this.$successMsg('保存成功');
  551. }).finally(res => {
  552. this.formLoading = false;
  553. })
  554. },
  555. }
  556. }
  557. </script>
  558. <style lang="scss" scoped>
  559. ::v-deep .el-radio-group {
  560. display: flex;
  561. .item {
  562. margin-right: 20px;
  563. .el-radio {
  564. height: 40px;
  565. line-height: 40px;
  566. }
  567. .el-image {
  568. width: 120px;
  569. height: 200px;
  570. display: block;
  571. }
  572. }
  573. }
  574. .images {
  575. display: flex;
  576. flex-wrap: wrap;
  577. .main-img {
  578. display: flex;
  579. flex-direction: column;
  580. justify-content: center;
  581. align-items: center;
  582. width: 120px;
  583. margin-right: 20px;
  584. .img {
  585. border: 1px dashed #eaeaea;
  586. border-radius: 5px;
  587. overflow: hidden;
  588. position: relative;
  589. .el-image {
  590. display: block;
  591. }
  592. .mask {
  593. position: absolute;
  594. left: 0;
  595. top: 0;
  596. width: 120px;
  597. height: 120px;
  598. background: rgba($color: #000000, $alpha: 0.3);
  599. display: flex;
  600. align-items: center;
  601. justify-content: center;
  602. i {
  603. font-size: 20px;
  604. color: #ffffff;
  605. cursor: pointer;
  606. margin: 0 8px;
  607. }
  608. }
  609. }
  610. .text {
  611. font-size: 14px;
  612. color: #666666;
  613. }
  614. }
  615. .add {
  616. width: 120px;
  617. height: 120px;
  618. border: 1px dashed #eaeaea;
  619. border-radius: 5px;
  620. cursor: pointer;
  621. display: flex;
  622. align-items: center;
  623. justify-content: center;
  624. i {
  625. font-size: 30px;
  626. color: #999;
  627. }
  628. }
  629. .tmp-img {
  630. position: relative;
  631. .tmp {
  632. position: absolute;
  633. left: 0;
  634. top: 0;
  635. line-height: 20px;
  636. padding: 0 8px;
  637. background: #f66460;
  638. border-radius: 0 0 10px 0;
  639. font-size: 12px;
  640. color: #ffffff;
  641. }
  642. }
  643. }
  644. .tips {
  645. margin-top: 10px;
  646. span {
  647. display: inline-block;
  648. width: 300px;
  649. text-align: center;
  650. line-height: 32px;
  651. background: #ffefef;
  652. font-size: 14px;
  653. color: #f66460;
  654. }
  655. }
  656. .diy-table {
  657. width: 400px;
  658. .item {
  659. display: flex;
  660. border: 1px solid #eaeaea;
  661. border-bottom: none;
  662. &.head {
  663. font-weight: bold;
  664. }
  665. &:last-child {
  666. border-bottom: 1px solid #eaeaea;
  667. }
  668. >div {
  669. flex: 1;
  670. display: flex;
  671. align-items: center;
  672. justify-content: center;
  673. }
  674. .label {
  675. border-right: 1px solid #eaeaea;
  676. }
  677. .value {
  678. span {
  679. margin-left: 10px;
  680. color: #666666;
  681. &.on {
  682. color: #409EFF;
  683. }
  684. }
  685. }
  686. }
  687. }
  688. .nodata {
  689. font-size: 18px;
  690. color: #666666;
  691. }</style>