logo.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <div class="plate">
  3. <div>
  4. <ul>
  5. <li app-border dir-bottom>
  6. <div class="preview-con">
  7. <div class="preview">
  8. <img :src="info.logo||require('@/assets/images/default/img_logo_default.png')" alt="" />
  9. </div>
  10. <div class="upload-con">
  11. <button
  12. class="ui-button submit"
  13. @click="$emit('openMaterial'), (param = 'logo')"
  14. >
  15. 选择图片
  16. </button>
  17. <div class="ui-remark">
  18. 建议300*300px,600kb以内,支持jpg/png格式
  19. </div>
  20. </div>
  21. </div>
  22. </li>
  23. <li>
  24. <div class="title">显示设置</div>
  25. <div class="switch-con">
  26. <span class="title">显示logo</span>
  27. <switcher
  28. name="pano"
  29. :value="info.isLogo"
  30. @change="onSwitcherChange"
  31. ></switcher>
  32. </div>
  33. </li>
  34. </ul>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import Switcher from "@/components/shared/Switcher";
  40. import { mapGetters } from "vuex";
  41. export default {
  42. props: ["select"],
  43. components: {
  44. Switcher,
  45. },
  46. computed: {
  47. ...mapGetters({
  48. info: "info",
  49. }),
  50. },
  51. watch: {
  52. select(newVal) {
  53. if (newVal) {
  54. this.info[this.param] = newVal;
  55. this.info.logoChange = true
  56. this.select = "";
  57. }
  58. },
  59. },
  60. data() {
  61. return {
  62. param: "",
  63. };
  64. },
  65. methods: {
  66. onFileChange() {},
  67. onSwitcherChange(data) {
  68. this.info.isLogo = data;
  69. },
  70. },
  71. };
  72. </script>
  73. <style lang="less" src="./style.less"></style>
  74. <style lang="less" scoped>
  75. .preview-con {
  76. display: flex;
  77. .preview {
  78. width: 100px;
  79. height: 100px;
  80. overflow: hidden;
  81. >img{
  82. max-width: 100px;
  83. max-height: 100px;
  84. }
  85. }
  86. .upload-con {
  87. flex: 1;
  88. .ui-button {
  89. width: 100%;
  90. }
  91. .ui-remark {
  92. margin-top: 10px;
  93. width: 100%;
  94. word-break: keep-all;
  95. }
  96. }
  97. .bars {
  98. }
  99. }
  100. </style>