index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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()">{{downName}} <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. downName: '全部'
  40. }
  41. },
  42. fetch ({ store }) {
  43. return Promise.all([
  44. store.dispatch('provider/findStoreList', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY' })
  45. ])
  46. },
  47. computed: {
  48. list () {
  49. return this.$store.state.provider.stores.storeList.data
  50. }
  51. },
  52. methods: {
  53. isType (type) {
  54. let bgurl = ''
  55. if (type === 'ORIGINAL_FACTORY') {
  56. bgurl = '/images/mobile/@2x/shop/yuangchang@2x.png'
  57. }
  58. if (type === 'DISTRIBUTION') {
  59. bgurl = '/images/mobile/@2x/shop/jingxiao@2x.png'
  60. }
  61. if (type === 'AGENCY') {
  62. bgurl = '/images/mobile/@2x/shop/daili@2x.png'
  63. }
  64. return bgurl
  65. },
  66. onClick () {
  67. this.down = !this.down
  68. },
  69. onDown (type) {
  70. this.$store.dispatch('provider/findStoreList', { page: 1, count: 10, types: type })
  71. this.down = !this.down
  72. if (type === 'ORIGINAL_FACTORY') {
  73. this.downName = '原厂'
  74. }
  75. if (type === 'DISTRIBUTION') {
  76. this.downName = '经销'
  77. }
  78. if (type === 'AGENCY') {
  79. this.downName = '代理'
  80. }
  81. if (type === 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY') {
  82. this.downName = '全部'
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. .shop{
  90. margin-top: .88rem;
  91. margin-bottom: .98rem;
  92. min-height: 10rem;
  93. background: #e2e4e6;
  94. .shop-top{
  95. display:inline-flex;
  96. justify-content: space-between;
  97. align-items: center;
  98. width:100%;
  99. height:1.14rem;
  100. padding:0 .3rem;
  101. position:relative;
  102. background:#fff;
  103. .supdown{
  104. position:absolute;
  105. top:.8rem;
  106. right:.2rem;
  107. z-index:100;
  108. background:#616264;
  109. border-radius:.1rem;
  110. li{
  111. font-size: .28rem;
  112. color:#ffffff;
  113. height: .32rem;
  114. line-height: .32rem;
  115. margin: .2rem;
  116. margin-right:.4rem;
  117. }
  118. }
  119. p{
  120. font-size:.24rem;
  121. color:#000;
  122. i{
  123. font-size: .53rem;
  124. color:#418ef7;
  125. }
  126. span{
  127. font-size:.3rem;
  128. color:#f94f28;
  129. margin:0 .1rem;
  130. }
  131. }
  132. >span{
  133. font-size:.28rem;
  134. color:#53a0f7;
  135. }
  136. }
  137. .shop-list {
  138. background:#fff;
  139. margin-top:.12rem;
  140. padding-bottom:.28rem;
  141. &:hover{
  142. background: #e1e1e1;
  143. }
  144. h3{
  145. font-size:.32rem;
  146. line-height: .8rem;
  147. margin:0;
  148. margin-left:.27rem;
  149. margin-bottom:.14rem;
  150. }
  151. .list-item{
  152. width:6.77rem;
  153. margin-left:.39rem;
  154. justify-content: space-around;
  155. display:inline-flex;
  156. .item-img{
  157. position:relative;
  158. width:2.42rem;
  159. height:1.69rem;
  160. i{
  161. display:block;
  162. position:absolute;
  163. width:.65rem;
  164. height:.33rem;
  165. }
  166. img{
  167. display:inline-block;
  168. width:100%;
  169. height:100%;
  170. border:.02rem solid #418bf6;
  171. }
  172. }
  173. .list-item-phone{
  174. width:3.95rem;
  175. padding-top:.18rem;
  176. position:relative;
  177. p{
  178. font-size:.28rem;
  179. line-height: .45rem;
  180. margin:0;
  181. }
  182. i{
  183. display:block;
  184. position:absolute;
  185. top:.1rem;
  186. right:.1rem;
  187. font-size:.4rem;
  188. color:#ff7800;
  189. }
  190. i.active{
  191. color:#333;
  192. }
  193. }
  194. }
  195. }
  196. }
  197. </style>