goods-sort-list.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <template>
  2. <view class="margin-top zaiui-goods-list-box" :class="show?'show':''">
  3. <view class="cu-list menu-avatar">
  4. <block v-for="(item,index) in list_data" :key="index">
  5. <view class="cu-item" @tap="listTap(item,index)">
  6. <view class="cu-avatar radius lg" :style="[{backgroundImage:'url('+ item.img +')'}]"></view>
  7. <view class="content">
  8. <view class="text-black text-cut">
  9. <text class="cu-tag bg-red radius sm" v-if="item.autarky">自营</text>
  10. <text>{{item.title}}</text>
  11. </view>
  12. <view class="text-gray text-cut text-sm">
  13. <block v-for="(items,indexs) in item.type" :key="indexs">
  14. <text class="cu-tag radius sm">{{items}}</text>
  15. </block>
  16. </view>
  17. <view class="text-gray text-cut text-sm zaiui-tag-view">
  18. <text class="text-red text-price text-lg">{{item.price}}</text>
  19. <text class="text-gray through" v-if="item.cost_price">¥{{item.cost_price}}</text>
  20. <block v-for="(items,indexs) in item.discount" :key="indexs">
  21. <text class="cu-tag line-orange radius sm">{{items}}</text>
  22. </block>
  23. </view>
  24. <view class="text-gray text-cut text-sm ">
  25. <text class="cu-tag light bg-red radius sm" v-if="item.quv">已验机</text>
  26. <block v-for="(items,indexs) in item.style" :key="indexs">
  27. <text class="cu-tag line-blue radius sm">{{items}}</text>
  28. </block>
  29. </view>
  30. </view>
  31. </view>
  32. </block>
  33. </view>
  34. </view>
  35. </template>
  36. <script>
  37. import _tool from '@/static/zaiui/util/tools.js';
  38. export default {
  39. name: 'goods-sort-list',
  40. props: {
  41. list_data: {
  42. type: Array,
  43. default: () => {
  44. return []
  45. }
  46. },
  47. show: {
  48. type: Boolean,
  49. default: true
  50. }
  51. },
  52. methods: {
  53. listTap(data,index) {
  54. this.$emit('listTap', {
  55. data,
  56. index
  57. });
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .zaiui-goods-list-box {
  64. display: none;
  65. .cu-list.menu-avatar > .cu-item {
  66. height: 218.18upx;
  67. &:after {
  68. width: 0;
  69. height: 0;
  70. border-bottom: 0;
  71. }
  72. .cu-avatar.lg {
  73. width: 181.81upx;
  74. height: 181.81upx;
  75. font-size: 2em;
  76. }
  77. .content {
  78. left: 236.36upx;
  79. width: calc(100% - 94.54upx - 59.99upx - 119.99upx);
  80. line-height: 1.7em;
  81. .cu-tag.sm {
  82. display: inline-block;
  83. margin-left: 0;
  84. height: 29.09upx;
  85. font-size: 14.54upx;
  86. line-height: 29.09upx;
  87. margin-right: 9.09upx;
  88. margin-bottom: 9.09upx;
  89. }
  90. view:first-child {
  91. font-size: 29.09upx;
  92. display: inherit;
  93. align-items: inherit;
  94. }
  95. .through {
  96. text-decoration:line-through;
  97. }
  98. .zaiui-tag-view {
  99. text {
  100. margin-right: 9.09upx;
  101. }
  102. }
  103. }
  104. }
  105. }
  106. .zaiui-goods-list-box.show {
  107. display: block;
  108. }
  109. </style>