SupplierList.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <div class="search-suppliers-list">
  3. <ul class="list-inline">
  4. <li class="clearfix" v-for="item in currentGoods.content" @click="goSup(item)">
  5. <div class="img">
  6. <img :src="item.storeLogoUrl || item.enLogoUrl || item.logoUrl || '/images/all/default.png'">
  7. <!--<span class="has_shop"></span>-->
  8. </div>
  9. <div class="content">
  10. <h3 class="enterprise_name">{{item.enName}}</h3>
  11. <p>
  12. <span>企业执照号:</span><span :title="item.enBusinesscode">{{item.enBusinesscode || '暂无信息'}}</span>
  13. <span class="split_line">|</span>
  14. <span>地址:</span><span :title="item.enAddress">{{item.enAddress || '暂无信息'}}</span>
  15. </p>
  16. <p>
  17. <!--<span>邮箱:</span><span :title="item.enEmail">{{baseUtils.isEmptyStr(item.enEmail) ? '暂无信息' : item.enEmail}}</span>
  18. <span class="split_line">|</span>-->
  19. <span>电话:</span><span :title="item.enTel">{{item.enTel || '暂无信息'}}</span>
  20. <span class="split_line">|</span>
  21. <span>行业:</span><span :title="item.enIndustry">{{item.enIndustry || '暂无信息'}}</span>
  22. </p>
  23. </div>
  24. <div class="select_btn">{{resultType === 'current' ? '进入店铺' : '了解详情'}}</div>
  25. </li>
  26. </ul>
  27. <supplier-empty :showObj="showDialogObj"></supplier-empty>
  28. </div>
  29. </template>
  30. <script>
  31. import { SupplierEmpty } from '~components/base'
  32. export default {
  33. props: {
  34. resultType: {
  35. type: String,
  36. default: 'current'
  37. }
  38. },
  39. components: {
  40. SupplierEmpty
  41. },
  42. data () {
  43. return {
  44. showSeekObj: {
  45. show: false
  46. },
  47. productItem: {},
  48. showDialogObj: {
  49. show: false
  50. }
  51. }
  52. },
  53. computed: {
  54. goods () {
  55. return this.$store.state.searchData.searchList.listNew.data
  56. },
  57. currentGoods () {
  58. if (this.goods) {
  59. if (this.resultType === 'current') {
  60. return this.goods.stock || {}
  61. } else {
  62. return this.goods.futures || {}
  63. }
  64. } else {
  65. return {}
  66. }
  67. }
  68. },
  69. methods: {
  70. goSup (item) {
  71. if (this.resultType === 'current') {
  72. if (item.storeUuid) {
  73. this.$router.push(`/store/${item.storeUuid}`)
  74. }
  75. } else {
  76. this.$http.get('vendor/introduction/product/count', {params: {vendUU: item.enUU}})
  77. .then(res => {
  78. if (res.data.count > 0) {
  79. this.$router.push('supplier/' + item.enUU)
  80. } else {
  81. this.showDialogObj.show = true
  82. }
  83. }, err => {
  84. console.log(err)
  85. })
  86. }
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. $border: 1px solid #e8e8e8;
  93. .search-suppliers-list {
  94. ul{
  95. margin:0;
  96. border: {
  97. left: $border;
  98. right: $border;
  99. top: $border;
  100. }
  101. li{
  102. position:relative;
  103. width:100%;
  104. vertical-align: top;
  105. height:112px;
  106. padding:15px;
  107. border-bottom: $border;
  108. .img{
  109. position:relative;
  110. float:left;
  111. width:80px;
  112. height:80px;
  113. border:1px solid #ccc;
  114. img{
  115. width:100%;
  116. height:100%;
  117. vertical-align: top;
  118. }
  119. .has_shop {
  120. position:absolute;
  121. left:0;
  122. top:0;
  123. width:68px;
  124. height:22px;
  125. background: url(/images/supplier/icon/top_left.png)no-repeat;
  126. color:#fff;
  127. font-weight: bold;
  128. text-align: center;
  129. line-height: 22px;
  130. }
  131. }
  132. .content{
  133. margin-left:100px;
  134. color:#333;
  135. padding-top:2px;
  136. .enterprise_name{
  137. width:690px;
  138. overflow: hidden;
  139. text-overflow: ellipsis;
  140. white-space:nowrap;
  141. font-weight: bold;
  142. color:#333;
  143. font-size: 16px;
  144. margin:0 0 10px;
  145. }
  146. p{
  147. width:690px;
  148. overflow: hidden;
  149. text-overflow: ellipsis;
  150. white-space:nowrap;
  151. font-size: 14px;
  152. color:#333;
  153. margin:0 0 5px;
  154. span{
  155. &.split_line{
  156. margin:0 5px;
  157. }
  158. }
  159. }
  160. }
  161. .select_btn{
  162. position:absolute;
  163. top:40%;
  164. right:20px;
  165. z-index:250;
  166. padding:5px 10px;
  167. text-align: center;
  168. background: #1891e4;
  169. color:#fff;
  170. border-radius:3px;
  171. }
  172. &:hover{
  173. cursor:pointer;
  174. background: #ecf2fd;
  175. .content{
  176. color:#2496f1;
  177. .enterprise_name{
  178. color:#2496f1;
  179. }
  180. p{
  181. color:#2496f1;
  182. }
  183. }
  184. }
  185. }
  186. }
  187. }
  188. </style>