Suppliers.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <template>
  2. <div id="store-list">
  3. <table class="table">
  4. <thead>
  5. <tr data-v-12978a78="">
  6. <td width="120"><span v-text="storeType === 'factory' ? '原 厂' : '代理经销'">原厂</span></td>
  7. <td width="100" data-v-12978a78=""></td>
  8. <td width="450" data-v-12978a78=""></td>
  9. <td width="150" style="vertical-align: middle" data-v-12978a78=""></td>
  10. <td width="120" style="vertical-align: middle;" data-v-12978a78=""></td>
  11. </tr>
  12. </thead>
  13. <tbody>
  14. <!--<tr>{{$data}}</tr>-->
  15. <tr style="height: 50px;">
  16. <td colspan="5">
  17. <search-header :outerKeyword="keyword" @searchAction="search" :placeholder="'品牌/类目/型号/店铺名'"></search-header>
  18. <a @click="goStoreApply" class="btn-sure"><button class="btn btn-primary">立即入驻</button></a>
  19. </td>
  20. </tr>
  21. <tr v-for="store in stores.content" v-if="store">
  22. <td>
  23. <div class="logo">
  24. <a :href="'/store/' + store.uuid" target="_blank"><img :src="store.logoUrl || '/images/store/common/default.png'" :alt="store.storeName"></a>
  25. </div>
  26. </td>
  27. <td colspan="3">
  28. <a class="store-name" :href="'/store/' + store.uuid" target="_blank"><div :title="store.storeName">{{store.storeName}}</div></a>
  29. <div class="store-message">
  30. <span>企业介绍:</span>
  31. <span style="word-break: break-word;">{{showLittleDescription(store.enterprise.description)}}<em v-if="store.description && store.description.length > 160">...</em></span>
  32. </div>
  33. </td>
  34. <td class="vertical-middle" style="text-align: center">
  35. <a :href="'/store/' + store.uuid" target="_blank"><button class="btn btn-primary">进入店铺</button></a>
  36. </td>
  37. </tr>
  38. <tr v-if="!stores.content || stores.content.length == 0">
  39. <td colspan="10" class="text-center" style="line-height: 40px; font-size: 20px;">
  40. <i class="fa fa-smile-o fa-lg"></i> 暂无店铺信息
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. <div style="float: right;">
  46. <page :total="stores.totalElements" :page-size="pageParams.count"
  47. :current="pageParams.page" v-on:childEvent="handleCurrentChange"></page>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import Page from '~components/common/page/pageComponent.vue'
  53. import SearchHeader from '~components/common/PcSearchHeader.vue'
  54. export default {
  55. name: 'suppliers',
  56. props: ['types'],
  57. components: {
  58. Page,
  59. SearchHeader
  60. },
  61. data () {
  62. return {
  63. keyword: '',
  64. pageParams: {
  65. page: 1,
  66. count: 10,
  67. keyword: '',
  68. type: this.types,
  69. field: ''
  70. }
  71. }
  72. },
  73. computed: {
  74. storeType () {
  75. return this.$store.state.provider.stores.storeType.data
  76. },
  77. stores () {
  78. return this.$store.state.provider.stores.storeList.data
  79. },
  80. user () {
  81. return this.$store.state.option.user
  82. },
  83. enterprise () {
  84. let ens = this.user.data.enterprises
  85. if (ens && ens.length) {
  86. return ens.find(item => item.current) || {enName: '个人账户'}
  87. } else {
  88. return {enName: '个人账户'}
  89. }
  90. }
  91. },
  92. methods: {
  93. search (obj) {
  94. this.pageParams.page = 1
  95. this.pageParams.keyword = obj.keyword === '' ? null : obj.keyword
  96. this.pageParams.field = obj.type ? 'similar' : null
  97. this.pageCommodity(this.pageParams)
  98. },
  99. showLittleDescription (description) {
  100. if (!description || description === '') {
  101. return '暂无企业介绍'
  102. }
  103. return description.slice(0, 160)
  104. },
  105. async pageCommodity (pageParams) {
  106. // pageCommodity (pageParams) {
  107. pageParams.op = 'similar'
  108. try {
  109. let { data } = await this.$http.get('/api/store-service/stores', { params: pageParams })
  110. this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', data)
  111. } catch (err) {
  112. this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  113. }
  114. // this.$http.get('/api/store-service/stores', { params: pageParams }).then(response => {
  115. // this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', response)
  116. // }, err => {
  117. // this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  118. // })
  119. },
  120. handleCurrentChange (page) {
  121. this.pageParams.page = page
  122. this.pageParams.keyword = this.keyword === '' ? null : this.keyword
  123. this.pageCommodity(this.pageParams)
  124. }
  125. }
  126. }
  127. </script>
  128. <style lang="scss" scoped>
  129. #store-list{
  130. width: 955px;
  131. table{
  132. table-layout: fixed;
  133. width: 955px;
  134. height: 1216px;
  135. thead{
  136. padding: 10px 0 9px 9px;
  137. width: 955px;
  138. height: 34px;
  139. line-height: 34px;
  140. tr{
  141. vertical-align: middle;
  142. td{
  143. padding: 0!important;
  144. height: 34px;
  145. line-height: 34px;
  146. background-color: #2496f1;
  147. span{
  148. padding-left: 10px;
  149. font-size: 16px;
  150. color: #fff;
  151. }
  152. &:first-child {
  153. border-top-left-radius: 5px;
  154. }
  155. &:last-child {
  156. border-top-right-radius: 5px;
  157. }
  158. }
  159. }
  160. }
  161. tbody{
  162. background: #fff;
  163. tr{
  164. height: 112px;
  165. td{
  166. padding: 0!important;
  167. vertical-align: middle;
  168. a.btn-sure{
  169. button{
  170. margin: 0px 0 0 80px;
  171. width: 110px !important;
  172. height: 28px;
  173. font-size: 14px;
  174. color: #2496f1;
  175. background-color: #fff;
  176. border-radius: 3px;
  177. border: solid 1px #2496f1;
  178. &:hover{
  179. background-color: #2496f1;
  180. font-size: 14px;
  181. color: #fff;
  182. }
  183. }
  184. }
  185. }
  186. &:hover td div{
  187. color: #2496f1;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. #store-list table>thead>tr input {
  194. font-weight: 100;
  195. }
  196. #store-list .text-message {
  197. color: rgb(80,120,203);
  198. }
  199. #store-list .btn-primary {
  200. width: 88px;
  201. height: 28px;
  202. font-size: 14px;
  203. color: #2496f1;
  204. background-color: #ffffff;
  205. border-radius: 3px;
  206. border: solid 1px #2496f1;
  207. }
  208. #store-list .btn-primary:hover{
  209. background-color: #2496f1;
  210. border: solid 1px #2496f1;
  211. color: #fff;
  212. }
  213. #store-list table>tbody .logo {
  214. margin-left: 15px;
  215. width: 80px;
  216. height: 80px;
  217. line-height: 80px;
  218. text-align: center;
  219. border-radius: 2px;
  220. border: solid 1px #e2e2e2;
  221. overflow: hidden;
  222. }
  223. #store-list table>tbody img {
  224. max-width: 80px;
  225. max-height: 80px;
  226. }
  227. #store-list table>tbody .vertical-middle{
  228. vertical-align: middle;
  229. }
  230. #store-list table>tbody .store-mark {
  231. margin: 10px 0;
  232. }
  233. #store-list table>tbody .text-point {
  234. color: #ff3737;
  235. font-weight: 600;
  236. }
  237. #store-list table>tbody .store-name {
  238. font-size: 17px;
  239. font-weight: 600;
  240. color: #000;
  241. }
  242. #store-list table>tbody .store-message {
  243. margin-top: 15px;
  244. color: #999;
  245. width: 100%;
  246. overflow: hidden;
  247. text-overflow: ellipsis;
  248. display: -webkit-box;
  249. -webkit-box-orient: vertical;
  250. -webkit-line-clamp: 3;
  251. line-height: 18px;
  252. }
  253. #store-list table>tbody tr td{
  254. padding: 15px;
  255. }
  256. @font-face {
  257. font-family: 'iconfont'; /* project id 357960 */
  258. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot');
  259. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot?#iefix') format('embedded-opentype'),
  260. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.woff') format('woff'),
  261. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.ttf') format('truetype'),
  262. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.svg#iconfont') format('svg');
  263. }
  264. .el-pagination .el-pager li.active{
  265. background-color: #5078cb;
  266. border-color: #337ab7;
  267. }
  268. </style>