长页等图片压缩,shop长页banner添加两个二维码设置

master
yujialong 4 months ago
parent cf965e2cd6
commit c1867b0064
  1. BIN
      src/assets/images/page/about.png
  2. BIN
      src/assets/images/page/aboutUs.png
  3. BIN
      src/assets/images/page/application.png
  4. BIN
      src/assets/images/page/careers.png
  5. BIN
      src/assets/images/page/contactUs.png
  6. BIN
      src/assets/images/page/devHistory.png
  7. BIN
      src/assets/images/page/deviceIntroBeam.png
  8. BIN
      src/assets/images/page/deviceIntroLayout.png
  9. BIN
      src/assets/images/page/deviceIntroLinear.png
  10. BIN
      src/assets/images/page/edu.png
  11. BIN
      src/assets/images/page/estateEvent.png
  12. BIN
      src/assets/images/page/estateIndex.png
  13. BIN
      src/assets/images/page/estateLocation.png
  14. BIN
      src/assets/images/page/estateOrgSetup.png
  15. BIN
      src/assets/images/page/estateSurvey.png
  16. BIN
      src/assets/images/page/exp.png
  17. BIN
      src/assets/images/page/governance.png
  18. BIN
      src/assets/images/page/home.png
  19. BIN
      src/assets/images/page/iasf.png
  20. BIN
      src/assets/images/page/index.png
  21. BIN
      src/assets/images/page/industrial.png
  22. BIN
      src/assets/images/page/lightSources.png
  23. BIN
      src/assets/images/page/member.png
  24. BIN
      src/assets/images/page/mission.png
  25. BIN
      src/assets/images/page/news.png
  26. BIN
      src/assets/images/page/newsPress.png
  27. BIN
      src/assets/images/page/newsProcurement.png
  28. BIN
      src/assets/images/page/org.png
  29. BIN
      src/assets/images/page/overview.png
  30. BIN
      src/assets/images/page/overviewDevHistory.png
  31. BIN
      src/assets/images/page/overviewIntro.png
  32. BIN
      src/assets/images/page/overviewLocation.png
  33. BIN
      src/assets/images/page/overviewSetup.png
  34. BIN
      src/assets/images/page/overviewTrailer.png
  35. BIN
      src/assets/images/page/research.png
  36. BIN
      src/assets/images/page/researchTeam.png
  37. BIN
      src/assets/images/page/science.png
  38. BIN
      src/assets/images/page/scientific.png
  39. BIN
      src/assets/images/page/sfel.png
  40. BIN
      src/assets/images/page/shop.png
  41. BIN
      src/assets/images/page/speech.png
  42. BIN
      src/assets/images/page/supplier.png
  43. BIN
      src/assets/images/page/survey.png
  44. BIN
      src/assets/images/page/talent.png
  45. BIN
      src/assets/images/page/talentCenter.png
  46. BIN
      src/assets/images/page/talentCentre.png
  47. BIN
      src/assets/images/page/team.png
  48. BIN
      src/assets/images/page/userSharing.png
  49. BIN
      src/assets/images/style/10.png
  50. BIN
      src/assets/images/style/11.png
  51. BIN
      src/assets/images/style/12.png
  52. BIN
      src/assets/images/style/13.png
  53. BIN
      src/assets/images/style/14.png
  54. BIN
      src/assets/images/style/15.png
  55. BIN
      src/assets/images/style/16.png
  56. BIN
      src/assets/images/style/17.png
  57. BIN
      src/assets/images/style/18.png
  58. BIN
      src/assets/images/style/19.png
  59. BIN
      src/assets/images/style/22.png
  60. BIN
      src/assets/images/style/23.png
  61. BIN
      src/assets/images/style/24.png
  62. BIN
      src/assets/images/style/25.png
  63. BIN
      src/assets/images/style/26.png
  64. BIN
      src/assets/images/style/27.png
  65. BIN
      src/assets/images/style/28.png
  66. BIN
      src/assets/images/style/44.png
  67. BIN
      src/assets/images/style/45.png
  68. BIN
      src/assets/images/style/46.png
  69. BIN
      src/assets/images/style/47.png
  70. BIN
      src/assets/images/style/48.png
  71. BIN
      src/assets/images/style/55.png
  72. BIN
      src/assets/images/style/68.png
  73. BIN
      src/assets/images/style/69.png
  74. BIN
      src/assets/images/style/72.png
  75. BIN
      src/assets/images/style/74.png
  76. BIN
      src/assets/images/style/77.png
  77. BIN
      src/assets/images/style/78.png
  78. BIN
      src/assets/images/style/79.png
  79. BIN
      src/assets/images/style/80.png
  80. BIN
      src/assets/images/style/81.png
  81. 67
      src/const/modules.js
  82. 8
      src/pages/column/page/aboutUs.vue
  83. 62
      src/pages/column/page/shop.vue
  84. 55
      src/pages/logo/index.vue

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 588 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 437 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 357 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 614 KiB

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 444 KiB

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 KiB

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 566 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 685 KiB

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 KiB

After

Width:  |  Height:  |  Size: 148 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 611 KiB

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 808 KiB

After

Width:  |  Height:  |  Size: 158 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 376 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 825 KiB

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

After

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 KiB

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 512 KiB

After

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 510 KiB

After

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 389 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 302 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 945 KiB

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 419 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 417 KiB

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 KiB

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 548 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 623 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 KiB

After

Width:  |  Height:  |  Size: 164 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 431 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 308 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 474 KiB

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 400 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 749 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 432 KiB

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 385 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 349 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 489 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 220 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 KiB

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 457 KiB

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 793 KiB

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 514 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 MiB

After

Width:  |  Height:  |  Size: 598 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 244 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 288 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 486 KiB

After

Width:  |  Height:  |  Size: 123 KiB

@ -172,17 +172,19 @@ export default {
type: 'introduce', type: 'introduce',
forms: [ forms: [
{ {
type: 'upload', type: 'media',
prop: 'pic', prop: 'pic',
label: '图片', label: '资源',
required: true, required: true,
crop: false width: 1912,
height: 480
}, },
{ {
type: 'input', type: 'editor',
prop: 'title', prop: 'des',
label: '标题', label: '描述',
required: true pureText: true, // 编辑的时候是富文本,但是外面表格里展示的时候是纯文本(富文本里文字图片过大影响表格展示才需要用此方式)
pureProp: 'pureDes', // 跟pureText绑定的属性,有pureText才会有此字段,用以表格里展示纯文本
}, },
{ {
type: 'link', type: 'link',
@ -190,14 +192,33 @@ export default {
label: '链接' label: '链接'
}, },
{ {
type: 'textarea', type: 'upload',
prop: 'des', prop: 'weixinPic1',
label: '描述' label: '公众号二维码',
} width: 103,
height: 103
},
{
type: 'input',
prop: 'weixinText1',
label: '公众号文案'
},
{
type: 'upload',
prop: 'weixinPic2',
label: '小程序二维码',
width: 103,
height: 103
},
{
type: 'input',
prop: 'weixinText2',
label: '小程序文案'
},
], ],
form: { form: {
pic: '', pic: '',
title: '', des: ``,
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
@ -209,13 +230,17 @@ export default {
otherArticleId: '', otherArticleId: '',
isOpen: 1 isOpen: 1
}, },
des: '', pic: '',
weixinPic1: '',
weixinText1: ``,
weixinPic2: '',
weixinText2: ``,
isEnable: 1 isEnable: 1
}, },
list: [ list: [
{ {
pic: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20230904/png/1698579017697353728.png', pic: 'https://huoran.oss-cn-shenzhen.aliyuncs.com/20230904/png/1698579017697353728.png',
title: '最全,最新的实验教学产品中心', mediaType: 'png',
link: { link: {
linkName: '无', linkName: '无',
connectionType: 1, connectionType: 1,
@ -227,11 +252,18 @@ export default {
otherArticleId: '', otherArticleId: '',
isOpen: 1 isOpen: 1
}, },
des: '稳定高效的在线实验教学与学习系统', des: '<h6 style="margin-bottom: 25px;font-size: 2.2rem;color: #fff;">数字经济实训产品哪里有?</h6><p style="font-size: 1.5rem;color: #fff;">职站商城,让您一站式采购无忧</p>',
isEnable: 1 weixinPic1: '',
weixinText1: ``,
weixinPic2: '',
weixinText2: ``,
isEnable: 1,
} }
] ],
dialogWidth: '1200px',
labelWidth: '110px'
}, },
{ {
type: 'introduce', type: 'introduce',
forms: [ forms: [
@ -515,6 +547,7 @@ export default {
weixinText1: ``, weixinText1: ``,
weixinPic2: '', weixinPic2: '',
weixinText2: ``, weixinText2: ``,
isEnable: 1,
}, },
list: [], list: [],
dialogWidth: '1200px', dialogWidth: '1200px',

@ -26,13 +26,13 @@
<div class="text-wrap"> <div class="text-wrap">
<div class="text" v-html="item.des"></div> <div class="text" v-html="item.des"></div>
<div v-if="!GTA" class="qrcodes"> <div v-if="!GTA" class="qrcodes">
<div class="qrcode"> <div v-if="item.weixinPic1" class="qrcode">
<img width="103" :src="item.weixinPic1" alt=""> <img width="103" :src="item.weixinPic1" alt="">
<p class="text">{{ item.weixinText1 }}</p> <p v-if="item.weixinText1" class="text">{{ item.weixinText1 }}</p>
</div> </div>
<div class="qrcode m-l-30"> <div v-if="item.weixinPic2" class="qrcode m-l-30">
<img width="103" :src="item.weixinPic2" alt=""> <img width="103" :src="item.weixinPic2" alt="">
<p class="text">{{ item.weixinText2 }}</p> <p v-if="item.weixinText2" class="text">{{ item.weixinText2 }}</p>
</div> </div>
</div> </div>
</div> </div>

@ -12,11 +12,28 @@
<div class="modules"> <div class="modules">
<div class="relative"> <div class="relative">
<el-carousel height="500px" <el-carousel height="354px" class="carousel"
:indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'"> :indicator-position="modules[0].list.filter(e => e.isEnable).length > 1 ? '' : 'none'">
<template v-for="(item, i) in modules[0].list"> <template v-for="(item, i) in modules[0].list">
<el-carousel-item v-if="item.pic && item.isEnable" :key="i"> <el-carousel-item v-if="item.pic && item.isEnable" :key="i">
<img width="100%" height="100%" :src="item.pic" alt=""> <div v-if="isImg(item.mediaType)" class="pic" :style="{ backgroundImage: 'url(' + item.pic + ')' }"></div>
<video v-else class="pic" width="100%" height="100%" autoplay muted loop>
<source :src="item.pic" type="video/mp4">
您的浏览器不支持 video 标签
</video>
<div class="text-wrap">
<div class="text" v-html="item.des"></div>
<div class="qrcodes">
<div v-if="item.weixinPic1" class="qrcode">
<img width="103" :src="item.weixinPic1" alt="">
<p v-if="item.weixinText1" class="text">{{ item.weixinText1 }}</p>
</div>
<div v-if="item.weixinPic2" class="qrcode m-l-30">
<img width="103" :src="item.weixinPic2" alt="">
<p v-if="item.weixinText2" class="text">{{ item.weixinText2 }}</p>
</div>
</div>
</div>
</el-carousel-item> </el-carousel-item>
</template> </template>
</el-carousel> </el-carousel>
@ -44,10 +61,12 @@
<script> <script>
import mixins from '@/mixins/page' import mixins from '@/mixins/page'
import Modules from '@/const/modules' import Modules from '@/const/modules'
import Util from '@/libs/util'
export default { export default {
mixins: [mixins], mixins: [mixins],
data () { data () {
return { return {
isImg: Util.isImg,
modules: Modules.shop modules: Modules.shop
} }
}, },
@ -61,6 +80,45 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/page.scss'; @import '../../../styles/page/page.scss';
.carousel {
.pic {
height: 100%;
background-position: center center;
background-size: 100% 100%;
background-repeat: no-repeat;
}
/deep/.el-carousel__container {
height: 100%;
}
.text-wrap {
position: absolute;
top: 55%;
left: 12%;
display: flex;
align-items: center;
color: #fff;
transform: translateY(-50%);
}
.qrcodes {
display: flex;
margin-right: 50px;
}
.qrcode {
text-align: center;
.text {
margin-top: 10px;
font-size: 12px;
color: #fff;
}
}
}
.intro { .intro {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;

@ -1,22 +1,39 @@
<template> <template>
<div class="page"> <div class="page">
<el-form ref="form" label-width="100px"> <el-form ref="form" label-width="120px">
<el-form-item label="标题"> <el-form-item label="标题">
<el-input v-model="form.title" ref="account" placeholder="请输入标题" style="width: 400px"></el-input> <el-input v-model="form.title" ref="account" placeholder="请输入标题" style="width: 400px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="图标"> <el-form-item label="彩色图标">
<el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove" <el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove"
:on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :file-list="fileList" :on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :file-list="fileList"
:on-success="uploadSuccess"> :on-success="uploadSuccess">
<div style="text-align: left;"> <div style="text-align: left;">
<el-button size="small" type="primary">上传logo</el-button> <el-button size="small" type="primary">上传彩色logo</el-button>
<div class="m-t-10"> <div v-if="form.logoUrl" class="m-t-10">
<img v-if="form.logoUrl" :src="form.logoUrl" class="logo"> <img :src="form.logoUrl" class="logo">
</div> </div>
</div> </div>
<div slot="tip" class="el-upload__tip"> <div slot="tip" class="el-upload__tip">
<p>只能上传jpg/png/svg文件请上传120*40左右的logo</p> <p>只能上传jpg/png/svg图片请上传120*40左右的彩色logo用于常规页面展示</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="白色图标(非必须)">
<el-upload accept=".jpg,.png,.jpeg,.svg" :action="this.api.upload" :on-remove="handleRemove1"
:on-error="uploadError" :before-remove="beforeRemove" :headers="headers" :file-list="fileList1"
:on-success="uploadSuccess1">
<div style="text-align: left;">
<el-button size="small" type="primary">上传白色logo</el-button>
<div v-if="form.whiteUrl" class="m-t-10">
<img :src="form.whiteUrl" class="logo">
</div>
</div>
<div slot="tip" class="el-upload__tip">
<p>只能上传jpg/png/svg图片请上传120*40左右的白色logo用于透明导航的首页展示</p>
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
@ -42,9 +59,11 @@ export default {
id: '', id: '',
title: '', title: '',
logoUrl: '', logoUrl: '',
whiteUrl: '',
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,
}, },
fileList: [], fileList: [],
fileList1: [],
} }
}, },
mounted () { mounted () {
@ -59,13 +78,17 @@ export default {
name: 'logo.jpg', name: 'logo.jpg',
url: res.data.logoUrl url: res.data.logoUrl
}] : [] }] : []
this.fileList1 = res.data.whiteUrl ? [{
name: 'logo.jpg',
url: res.data.whiteUrl
}] : []
} }
}, },
handleExceed () { // handleExceed () { //
Util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!") Util.warningMsg("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!")
}, },
// //
uploadSuccess (data) { uploadSuccess (data, prop) {
if (data.code === 401) { if (data.code === 401) {
Util.errorMsg("登录过期,请重新登录") Util.errorMsg("登录过期,请重新登录")
setTimeout(() => { setTimeout(() => {
@ -75,19 +98,33 @@ export default {
} }
this.form.logoUrl = data.url this.form.logoUrl = data.url
}, },
uploadError (err, file, fileList) { //
uploadSuccess1 (data, prop) {
if (data.code === 401) {
Util.errorMsg("登录过期,请重新登录")
setTimeout(() => {
this.$store.dispatch('user/logout')
}, 1000)
return false
}
this.form.whiteUrl = data.url
},
uploadError () {
this.$message({ this.$message({
message: "上传出错,请重试!", message: "上传出错,请重试!",
type: "error", type: "error",
center: true center: true
}); });
}, },
beforeRemove (file, fileList) { beforeRemove (file) {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove () { handleRemove () {
this.form.logoUrl = '' this.form.logoUrl = ''
}, },
handleRemove1 () {
this.form.whiteUrl = ''
},
async save () { async save () {
const { form } = this const { form } = this
// if (!form.logoUrl) return Util.errorMsg('logo') // if (!form.logoUrl) return Util.errorMsg('logo')

Loading…
Cancel
Save