StoreDetail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="store-detail">
  3. <div class="store-logo">
  4. <div class="store-logo-box">
  5. <img :src="store.logoUrl || '/images/component/default.png'"/>
  6. </div>
  7. </div>
  8. <div class="store-switch-item">
  9. <span :class="activeType=='detail'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='detail'">介绍</span>
  10. <span :class="activeType=='product'?'mobile-switch-btn active':'mobile-switch-btn'" @click="activeType='product'">产品</span>
  11. </div>
  12. <div class="store-description" v-if="activeType=='detail'">
  13. <p>
  14. {{store.description}}
  15. </p>
  16. </div>
  17. <div class="product-store" v-if="activeType == 'product'">
  18. <table v-if="commodities.content&&commodities.content.length > 0">
  19. <thead>
  20. <tr>
  21. <th>型号/品牌</th>
  22. <th>包装</th>
  23. <th>数量</th>
  24. <th>单价</th>
  25. <th>交期(天)</th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <tr v-for="commodity in commodities.content" @click="goProductDetail(commodity.uuid)">
  30. <td class="store-name">
  31. <div>{{commodity.kindNameCn}}</div>
  32. <div>{{commodity.brandNameCn}}</div>
  33. </td>
  34. <td>
  35. <div v-if="!commodity.packaging && !commodity.breakUp && !commodity.produceDate">-</div>
  36. <div>{{commodity.packaging}}</div>
  37. <div>{{commodity.breakUp?'可拆卖':'不可拆卖'}}</div>
  38. <div>{{commodity.produceDate}}</div>
  39. </td>
  40. <td>
  41. <div v-if="!commodity.prices || commodity.prices.length == 0">-</div>
  42. <div v-for="price in commodity.prices">{{price.start}}+</div>
  43. </td>
  44. <td>
  45. <div v-if="!commodity.prices || commodity.prices.length == 0">
  46. <span>—</span>
  47. </div>
  48. <div v-for="price in commodity.prices" class="price-level">
  49. <span v-if="commodity.currencyName.indexOf('RMB')!==-1">¥{{price.rMBPrice | currency}}</span>
  50. <span v-if="commodity.currencyName.indexOf('USD')!==-1">${{price.uSDPrice | currency}}</span>
  51. </div>
  52. </td>
  53. <td>
  54. <div v-if="commodity.b2cMinDelivery">
  55. <span>交期:</span>
  56. <span>{{commodity.b2cMinDelivery}}</span>
  57. <span v-if="commodity.b2cMaxDelivery && commodity.b2cMaxDelivery !== commodity.b2cMinDelivery">-</span>
  58. <span v-if="commodity.b2cMaxDelivery && commodity.b2cMaxDelivery !== commodity.b2cMinDelivery">{{commodity.b2cMaxDelivery}}</span>
  59. </div>
  60. <div v-if="commodity.minBuyQty"><span class="order-tag">订</span>{{commodity.minBuyQty}}起订</div>
  61. <div v-if="!commodity.b2cMinDelivery">
  62. <span>—</span>
  63. </div>
  64. </td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. <!--<div v-if="!storeList.content || storeList.content.length == 0" class="no-store">-->
  69. <!--<img src="/images/mobile/@2x/car@2x.png" alt="">-->
  70. <!--<div>抱歉,暂无商家出售此型号!</div>-->
  71. <!--<div>您可前往<strong>www.usoftmall.com</strong>网页版进行<strong>“发布求购”</strong>或<strong>“产品上架”</strong>操作!</div>-->
  72. <!--</div>-->
  73. </div>
  74. </div>
  75. </template>
  76. <script>
  77. export default {
  78. data () {
  79. return {
  80. activeType: 'product'
  81. }
  82. },
  83. filters: {
  84. currency: function (num) {
  85. if (typeof num === 'number') {
  86. if (num <= 0.000001) {
  87. num = 0.000001
  88. } else {
  89. if (num.toString().indexOf('.') === -1) {
  90. num += '.00'
  91. } else {
  92. let inputStr = num.toString()
  93. let arr = inputStr.split('.')
  94. let floatNum = arr[1]
  95. if (floatNum.length > 6) {
  96. num = inputStr.substring(0, arr[0].length + 7)
  97. if (Number(floatNum.charAt(6)) > 4) {
  98. num = (Number(num) * 1000000 + 1) / 1000000
  99. }
  100. } else if (floatNum.length === 1) {
  101. num = num + '0'
  102. }
  103. }
  104. }
  105. }
  106. return num
  107. }
  108. },
  109. computed: {
  110. store () {
  111. return this.$store.state.shop.storeInfo.store.data
  112. },
  113. commodities () {
  114. return this.$store.state.shop.storeInfo.storeCommodity.data
  115. }
  116. },
  117. methods: {
  118. goProductDetail: function (uuid) {
  119. this.$router.push('/mobile/brand/componentDetail/' + uuid)
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .store-detail {
  126. margin: 0 auto;
  127. margin-bottom: 1.2rem;
  128. text-align: center;
  129. background: #f7f7f7;
  130. height: 100%;
  131. .store-logo {
  132. height: 3.17rem;
  133. width: 6.96rem;
  134. display: inline-block;
  135. margin: .38rem auto .18rem;
  136. line-height: 2.13rem;
  137. background: #fff;
  138. text-align: center;
  139. border-radius: .1rem;
  140. background: url('/images/mobile/@2x/brand-bg.png') no-repeat;
  141. background-size: cover;
  142. .store-logo-box {
  143. border: .01rem solid #c7e5fd;
  144. border-radius: .1rem;
  145. height: 2.21rem;
  146. width: 3.73rem;
  147. margin: .5rem auto 0;
  148. background: #fff;
  149. img {
  150. max-height: 2.13rem;
  151. max-width: 3.7rem;
  152. }
  153. }
  154. }
  155. .store-switch-item {
  156. text-align: center;
  157. background: #fff;
  158. .mobile-switch-btn {
  159. background: #fff;
  160. color: #666;
  161. display: inline-block;
  162. height: .64rem;
  163. font-size: .34rem;
  164. line-height: .64rem;
  165. width: 1.4rem;
  166. &:first-child {
  167. margin-right: 1.78rem;
  168. }
  169. &.active {
  170. color: #fc5708;
  171. border-bottom: .01rem solid #fc5708;
  172. }
  173. }
  174. }
  175. .store-description {
  176. background: #f7f7f7;
  177. p {
  178. background: #fff;
  179. margin: .2rem .5rem;
  180. padding: .4rem .2rem;
  181. font-size: .28rem;
  182. color: #666;
  183. text-align: left;
  184. }
  185. }
  186. .product-store {
  187. margin: .2rem 0;
  188. table {
  189. width: 100%;
  190. font-size: .28rem;
  191. thead {
  192. background: #d5e5fb;
  193. tr {
  194. th {
  195. font-weight: bold;
  196. text-align: center;
  197. height: .78rem;
  198. line-height: .78rem;
  199. }
  200. }
  201. }
  202. tbody {
  203. tr {
  204. background: #fff;
  205. border-top: .01rem solid rgb(174,175,176);
  206. td {
  207. padding: .2rem .1rem;
  208. text-align: left;
  209. div {
  210. overflow: hidden;
  211. text-overflow: ellipsis;
  212. white-space: nowrap;
  213. margin-bottom: .2rem;
  214. max-width: 1.58rem;
  215. &:last-child {
  216. margin-bottom: 0;
  217. }
  218. }
  219. .price-level:last-child {
  220. color: #fc5708;
  221. }
  222. .order-tag {
  223. display: inline-block;
  224. font-size: .18rem;
  225. color: #fff;
  226. font-weight: bold;
  227. background: #ee1717;
  228. height: .27rem;
  229. width: .27rem;
  230. line-height: .27rem;
  231. text-align: center;
  232. border-radius: .05rem;
  233. position: relative;
  234. top: -.03rem;
  235. }
  236. }
  237. &:active {
  238. background: #e1e1e1;
  239. }
  240. }
  241. }
  242. }
  243. .no-store {
  244. background: #fff;
  245. padding-top: 1rem;
  246. img {
  247. display: block;
  248. text-align: center;
  249. margin: 0 auto;
  250. margin-bottom: .45rem;
  251. width: 3.31rem;
  252. height: 2.13rem;
  253. }
  254. div {
  255. width: 5.27rem;
  256. margin: 0 auto;
  257. text-align: center;
  258. line-height: .4rem;
  259. color: #999;
  260. .link-url {
  261. color: #01a44e;
  262. }
  263. }
  264. }
  265. }
  266. }
  267. </style>