CommodityList.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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="share_title"><span></span><div>今日现货</div></div>
  6. <div class="date">
  7. <span>{{date.month}}</span>月<span>{{date.day}}</span>日
  8. </div>
  9. <div class="fr">真实库存、真实价格</div>
  10. </div>
  11. <ul>
  12. <li v-for="commodity in commodities.content">
  13. <div class="fl">
  14. <p>{{commodity.code || '-'}}</p>
  15. <span v-if="commodity.brandNameEn || commodity.brandEn">{{commodity.brandNameEn || commodity.brandEn || '-'}}</span>
  16. </div>
  17. <div class="fr">
  18. <span>{{commodity.currencyName === 'USD' ? '$' : '¥'}}</span>
  19. <span>{{commodity.prices[0].rMBPrice}}</span>
  20. </div>
  21. </li>
  22. </ul>
  23. <div v-if="!commodities.content || !commodities.content.length" class="empty">
  24. <img src="/images/mobile/@2x/shareStore/empty.png" alt="">
  25. <p>抱歉,该店铺暂未上架商品</p>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. export default {
  31. filters: {
  32. price: function (val) {
  33. return val.toFixed(2)
  34. }
  35. },
  36. computed: {
  37. commodities () {
  38. return this.$store.state.shop.storeInfo.storeCommodity.data
  39. // return []
  40. },
  41. date () {
  42. let now = new Date()
  43. const monthTemp = now.getMonth() + 1
  44. const dayTemp = now.getDate()
  45. const month = monthTemp < 10 ? '0' + monthTemp : monthTemp
  46. const day = dayTemp < 10 ? '0' + dayTemp : dayTemp
  47. return {
  48. month: month,
  49. day: day
  50. }
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. .share-store-commodity {
  57. .share_title {
  58. font-weight: bold;
  59. margin-top: 0.06rem;
  60. float: left;
  61. span {
  62. width: 0.08rem;
  63. height: 0.3rem;
  64. line-height: 0.3rem;
  65. background-image: linear-gradient(90deg,
  66. #7188ff 0%,
  67. #6066fe 84%,
  68. #4f44fd 100%),
  69. linear-gradient(
  70. #000000,
  71. #000000);
  72. display: inline-block;
  73. margin-top: 0.02rem;
  74. margin-right: 0.09rem;
  75. vertical-align: top;
  76. }
  77. div {
  78. font-size: 0.28rem;
  79. color: #09061e;
  80. display: inline-block;
  81. vertical-align: top;
  82. margin-top: 0.02rem;
  83. }
  84. }
  85. padding: .24rem .3rem;
  86. padding-bottom: 0rem;
  87. .title {
  88. margin-bottom: .2rem;
  89. display: flex;
  90. &::after {
  91. content: ' ';
  92. clear: both;
  93. display: block;
  94. visibility: hidden;
  95. zoom: 1;
  96. }
  97. img {
  98. width: 1.59rem;
  99. height: .45rem;
  100. }
  101. .date {
  102. flex: 1;
  103. // display: inline-block;
  104. font-size: .21rem;
  105. color: #fa3f46;
  106. // position: relative;
  107. // top: .06rem;
  108. // left: .32rem;
  109. margin-left: .32rem;
  110. margin-top: .06rem;
  111. float: left;
  112. span {
  113. color: #fff;
  114. font-size: .24rem;
  115. display: inline-block;
  116. width: .32rem;
  117. height: .28rem;
  118. line-height: .28rem;
  119. text-align: center;
  120. border-radius: 2px;
  121. background: #fa3f46;
  122. margin: .04rem;
  123. }
  124. }
  125. .fr {
  126. font-size: .24rem;
  127. color: #666;
  128. position: relative;
  129. top: .1rem;
  130. }
  131. }
  132. > ul {
  133. li {
  134. &::after {
  135. content: ' ';
  136. clear: both;
  137. display: block;
  138. visibility: hidden;
  139. }
  140. // height: 1rem;
  141. border-bottom: .02rem solid rgba(217, 217, 217, .35);
  142. > div {
  143. padding: 0.1rem 0;
  144. // height: 1rem;
  145. &.fl {
  146. line-height: .4rem;
  147. p {
  148. font-size: .26rem;
  149. color: #fb6f03;
  150. }
  151. span {
  152. font-size: .24rem;
  153. color: #666;
  154. }
  155. }
  156. &.fr {
  157. // float: none;
  158. font-size: .28rem;
  159. color: #e21616;
  160. line-height: .82rem;
  161. // width: 1.8rem;
  162. overflow: hidden;
  163. text-overflow: ellipsis;
  164. white-space: nowrap;
  165. span {
  166. &:nth-child(2) {
  167. font-size: .24rem;
  168. }
  169. }
  170. }
  171. }
  172. }
  173. }
  174. .empty {
  175. text-align: center;
  176. padding: 1.44rem 0 2.04rem 0;
  177. img {
  178. width: 1.21rem;
  179. height: 1.21rem;
  180. }
  181. p {
  182. font-size: .24rem;
  183. color: #ddd;
  184. margin-top: .17rem;
  185. }
  186. }
  187. }
  188. </style>