CommodityList.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <div class="share-store-commodity">
  3. <div class="title" v-if="commodities.content && commodities.content.length">
  4. <img src="/images/mobile/@2x/shareStore/commodity-title@2x.png" alt="">
  5. <div class="date">
  6. <span>{{date.month}}</span>月<span>{{date.day}}</span>日
  7. </div>
  8. <div class="fr">真实库存、真实价格</div>
  9. </div>
  10. <ul>
  11. <li v-for="commodity in commodities.content">
  12. <div class="fl">
  13. <p>{{commodity.code || '-'}}</p>
  14. <span v-if="commodity.brandNameEn || commodity.brandEn">{{commodity.brandNameEn || commodity.brandEn || '-'}}</span>
  15. </div>
  16. <div class="fr">
  17. <span>{{commodity.currencyName === 'USD' ? '$' : '¥'}}</span>
  18. <span>{{commodity.prices[0].rMBPrice}}</span>
  19. </div>
  20. </li>
  21. </ul>
  22. <div v-if="!commodities.content || !commodities.content.length" class="empty">
  23. <img src="/images/mobile/@2x/shareStore/empty.png" alt="">
  24. <p>抱歉,该店铺暂未上架商品</p>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. filters: {
  31. price: function (val) {
  32. return val.toFixed(2)
  33. }
  34. },
  35. computed: {
  36. commodities () {
  37. return this.$store.state.shop.storeInfo.storeCommodity.data
  38. // return []
  39. },
  40. date () {
  41. let now = new Date()
  42. const monthTemp = now.getMonth() + 1
  43. const dayTemp = now.getDate()
  44. const month = monthTemp < 10 ? '0' + monthTemp : monthTemp
  45. const day = dayTemp < 10 ? '0' + dayTemp : dayTemp
  46. return {
  47. month: month,
  48. day: day
  49. }
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="scss" scoped>
  55. .share-store-commodity {
  56. padding: .24rem .3rem;
  57. .title {
  58. margin-bottom: .2rem;
  59. img {
  60. width: 1.59rem;
  61. height: .45rem;
  62. }
  63. .date {
  64. display: inline-block;
  65. font-size: .21rem;
  66. color: #fa3f46;
  67. position: relative;
  68. top: .06rem;
  69. left: .32rem;
  70. span {
  71. color: #fff;
  72. font-size: .24rem;
  73. display: inline-block;
  74. width: .32rem;
  75. height: .28rem;
  76. line-height: .28rem;
  77. text-align: center;
  78. border-radius: 2px;
  79. background: #fa3f46;
  80. margin: .04rem;
  81. }
  82. }
  83. .fr {
  84. font-size: .24rem;
  85. color: #666;
  86. position: relative;
  87. top: .16rem;
  88. }
  89. }
  90. > ul {
  91. li {
  92. height: .82rem;
  93. border-bottom: .02rem solid rgba(217, 217, 217, .35);
  94. > div {
  95. height: .82rem;
  96. &.fl {
  97. line-height: .4rem;
  98. p {
  99. font-size: .24rem;
  100. color: #f1a850;
  101. }
  102. span {
  103. font-size: .21rem;
  104. color: #999;
  105. }
  106. }
  107. &.fr {
  108. font-size: .24rem;
  109. color: #e21616;
  110. line-height: .82rem;
  111. width: 1.2rem;
  112. overflow: hidden;
  113. text-overflow: ellipsis;
  114. white-space: nowrap;
  115. span {
  116. &:nth-child(2) {
  117. font-size: .26rem;
  118. }
  119. }
  120. }
  121. }
  122. }
  123. }
  124. .empty {
  125. text-align: center;
  126. padding: 1.44rem 0 2.04rem 0;
  127. img {
  128. width: 1.21rem;
  129. height: 1.21rem;
  130. }
  131. p {
  132. font-size: .24rem;
  133. color: #ddd;
  134. margin-top: .17rem;
  135. }
  136. }
  137. }
  138. </style>