index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div class="shop">
  3. <div class="shop-top">
  4. <p><i class="iconfont icon-dianpu1"></i><span>{{list.totalElements}}</span>家店铺</p>
  5. <span @click="onClick()">全部 <i class="iconfont icon-arrow-down"></i></span>
  6. <ul class="supdown" v-if="down">
  7. <li @click="onDown('ORIGINAL_FACTORY')">原厂</li>
  8. <li @click="onDown('AGENCY')">代理</li>
  9. <li @click="onDown('DISTRIBUTION')">经销</li>
  10. <li @click="onDown('ORIGINAL_FACTORY-DISTRIBUTION-AGENCY' )">全部</li>
  11. </ul>
  12. </div>
  13. <div class="shop-list" v-for="item in list.content">
  14. <h3>{{item.storeName}}</h3>
  15. <div class="list-item">
  16. <div class="item-img">
  17. <i :style="'background:url(' + isType(item.type) + ')no-repeat 0 0/.65rem .33rem;'"></i>
  18. <img :src="item.logoUrl || '/images/component/default.png'">
  19. </div>
  20. <div class="list-item-phone">
  21. <p>电话:<span>{{item.enterprise.enTel}}</span></p>
  22. <p>传真:<span>{{item.enterprise.enFax}}</span></p>
  23. <p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.uuid">点击查看</nuxt-link></p>
  24. <i class="iconfont icon-shoucang" ></i>
  25. </div>
  26. </div>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. layout: 'main',
  33. data () {
  34. return {
  35. page: '',
  36. count: '',
  37. types: '',
  38. down: false
  39. }
  40. },
  41. fetch ({ store }) {
  42. return Promise.all([
  43. store.dispatch('provider/findStoreList', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY' })
  44. ])
  45. },
  46. computed: {
  47. list () {
  48. return this.$store.state.provider.stores.storeList.data
  49. }
  50. },
  51. methods: {
  52. isType (type) {
  53. let bgurl = ''
  54. if (type === 'ORIGINAL_FACTORY') {
  55. bgurl = '/images/mobile/@2x/shop/daili@2x.png'
  56. }
  57. if (type === 'DISTRIBUTION') {
  58. bgurl = '/images/mobile/@2x/shop/jingxiao@2x.png'
  59. }
  60. if (type === 'AGENCY') {
  61. bgurl = '/images/mobile/@2x/shop/yuangchang@2x.png'
  62. }
  63. return bgurl
  64. },
  65. onClick () {
  66. this.down = !this.down
  67. },
  68. onDown (type) {
  69. this.$store.dispatch('provider/findStoreList', { page: 1, count: 10, types: type })
  70. }
  71. }
  72. }
  73. </script>
  74. <style scoped lang="scss">
  75. .shop{
  76. margin-top: .88rem;
  77. margin-bottom: .98rem;
  78. min-height: 10rem;
  79. background: #e2e4e6;
  80. .shop-top{
  81. display:inline-flex;
  82. justify-content: space-between;
  83. align-items: center;
  84. width:100%;
  85. height:1.14rem;
  86. padding:0 .3rem;
  87. position:relative;
  88. background:#fff;
  89. .supdown{
  90. position:absolute;
  91. top:.8rem;
  92. right:.2rem;
  93. z-index:100;
  94. background:#616264;
  95. border-radius:.1rem;
  96. li{
  97. font-size: .28rem;
  98. color:#ffffff;
  99. height: .32rem;
  100. line-height: .32rem;
  101. margin: .2rem;
  102. margin-right:.4rem;
  103. }
  104. }
  105. p{
  106. font-size:.24rem;
  107. color:#000;
  108. i{
  109. font-size: .53rem;
  110. color:#418ef7;
  111. }
  112. span{
  113. font-size:.3rem;
  114. color:#f94f28;
  115. margin:0 .1rem;
  116. }
  117. }
  118. >span{
  119. font-size:.28rem;
  120. color:#53a0f7;
  121. }
  122. }
  123. .shop-list {
  124. background:#fff;
  125. margin-top:.12rem;
  126. padding-bottom:.28rem;
  127. h3{
  128. font-size:.32rem;
  129. line-height: .8rem;
  130. margin:0;
  131. margin-left:.27rem;
  132. margin-bottom:.14rem;
  133. }
  134. .list-item{
  135. width:6.77rem;
  136. margin-left:.39rem;
  137. justify-content: space-around;
  138. display:inline-flex;
  139. .item-img{
  140. position:relative;
  141. width:2.42rem;
  142. height:1.69rem;
  143. i{
  144. display:block;
  145. position:absolute;
  146. width:.65rem;
  147. height:.33rem;
  148. }
  149. img{
  150. display:inline-block;
  151. width:100%;
  152. height:100%;
  153. }
  154. }
  155. .list-item-phone{
  156. width:3.95rem;
  157. padding-top:.18rem;
  158. position:relative;
  159. p{
  160. font-size:.28rem;
  161. line-height: .45rem;
  162. margin:0;
  163. }
  164. i{
  165. display:block;
  166. position:absolute;
  167. top:.1rem;
  168. right:.1rem;
  169. font-size:.4rem;
  170. color:#ff7800;
  171. }
  172. i.active{
  173. color:#333;
  174. }
  175. }
  176. }
  177. }
  178. }
  179. </style>