pictureList.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div class="dis_flex_order_li">
  3. <div class="list" v-for="(item, index) in list" :key="index">
  4. <img :src="backFullSrc(item.img)" alt="" />
  5. <div class="right">
  6. <h4>{{ item.label }}:</h4>
  7. <p>
  8. {{ item.value || info[item.prop] | formatPrice }}{{ item.ch || "元" }}
  9. </p>
  10. </div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. export default {
  16. name: "SaasMasterPlatformPictureList",
  17. props: {
  18. list: {
  19. type: Array,
  20. default: () => {
  21. return [];
  22. },
  23. },
  24. fn: {
  25. type: Function,
  26. default: () => {
  27. return Promise.resolve({ data: {} });
  28. },
  29. },
  30. },
  31. data() {
  32. return {
  33. info: {},
  34. };
  35. },
  36. mounted() {
  37. this.fn().then((res) => {
  38. this.info = res.data;
  39. });
  40. },
  41. methods: {
  42. backFullSrc(name) {
  43. return require(`@/assets/images/${name}@2x.png`);
  44. },
  45. },
  46. };
  47. </script>
  48. <style lang="scss" scoped>
  49. .dis_flex_order_li {
  50. display: flex;
  51. align-items: center;
  52. flex-wrap: wrap;
  53. & > .list {
  54. user-select: none;
  55. cursor: pointer;
  56. transition: all 0.3s;
  57. box-shadow: 0px 0px 4px 1px rgba(0, 0, 0, 0.2);
  58. &:hover {
  59. transform: scale(1.04);
  60. }
  61. width: 136px;
  62. height: 44px;
  63. border-radius: 6px;
  64. display: flex;
  65. align-items: center;
  66. flex-shrink: 0;
  67. margin-right: 10px;
  68. margin-bottom: 10px;
  69. & > img {
  70. margin-left: 2px;
  71. width: 40px;
  72. height: 40px;
  73. }
  74. & > .right {
  75. flex: 1;
  76. padding-left: 4px;
  77. & > h4 {
  78. color: #000;
  79. margin: 0;
  80. font-size: 12px;
  81. }
  82. & > p {
  83. font-size: 12px;
  84. color: red;
  85. margin: 0;
  86. }
  87. }
  88. }
  89. }
  90. </style>