Suppliers.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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. components: {
  57. Page,
  58. SearchHeader
  59. },
  60. data () {
  61. return {
  62. keyword: '',
  63. pageParams: {
  64. page: 1,
  65. count: 10,
  66. keyword: '',
  67. type: this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION',
  68. field: ''
  69. }
  70. }
  71. },
  72. computed: {
  73. storeType () {
  74. if (this.pageParams) {
  75. this.pageParams.page = 1
  76. }
  77. return this.$store.state.provider.stores.storeType.data
  78. },
  79. stores () {
  80. return this.$store.state.provider.stores.storeList.data
  81. },
  82. user () {
  83. return this.$store.state.option.user
  84. },
  85. enterprise () {
  86. let ens = this.user.data.enterprises
  87. if (ens && ens.length) {
  88. return ens.find(item => item.current) || {enName: '个人账户'}
  89. } else {
  90. return {enName: '个人账户'}
  91. }
  92. }
  93. },
  94. methods: {
  95. search (obj) {
  96. this.pageParams.page = 1
  97. this.pageParams.keyword = obj.keyword === '' ? null : obj.keyword
  98. this.pageParams.field = obj.type ? 'similar' : null
  99. this.pageCommodity(this.pageParams)
  100. },
  101. showLittleDescription (description) {
  102. if (!description || description === '') {
  103. return '暂无企业介绍'
  104. }
  105. return description.slice(0, 160)
  106. },
  107. async pageCommodity (pageParams) {
  108. // pageCommodity (pageParams) {
  109. pageParams.op = 'similar'
  110. try {
  111. let { data } = await this.$http.get('/api/store-service/stores', { params: pageParams })
  112. this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', data)
  113. } catch (err) {
  114. this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  115. }
  116. // this.$http.get('/api/store-service/stores', { params: pageParams }).then(response => {
  117. // this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', response)
  118. // }, err => {
  119. // this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  120. // })
  121. },
  122. handleCurrentChange (page) {
  123. this.pageParams.page = page
  124. this.pageParams.keyword = this.keyword === '' ? null : this.keyword
  125. this.pageCommodity(this.pageParams)
  126. }
  127. }
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. #store-list{
  132. width: 955px;
  133. table{
  134. table-layout: fixed;
  135. width: 955px;
  136. height: 1216px;
  137. thead{
  138. padding: 10px 0 9px 9px;
  139. width: 955px;
  140. height: 34px;
  141. line-height: 34px;
  142. tr{
  143. vertical-align: middle;
  144. td{
  145. padding: 0!important;
  146. height: 34px;
  147. line-height: 34px;
  148. background-color: #2496f1;
  149. span{
  150. padding-left: 10px;
  151. font-size: 16px;
  152. color: #fff;
  153. }
  154. &:first-child {
  155. border-top-left-radius: 5px;
  156. }
  157. &:last-child {
  158. border-top-right-radius: 5px;
  159. }
  160. }
  161. }
  162. }
  163. tbody{
  164. background: #fff;
  165. tr{
  166. height: 112px;
  167. td{
  168. padding: 0!important;
  169. vertical-align: middle;
  170. a.btn-sure{
  171. button{
  172. margin: 0px 0 0 80px;
  173. width: 110px !important;
  174. height: 28px;
  175. font-size: 14px;
  176. color: #2496f1;
  177. background-color: #fff;
  178. border-radius: 3px;
  179. border: solid 1px #2496f1;
  180. &:hover{
  181. background-color: #2496f1;
  182. font-size: 14px;
  183. color: #fff;
  184. }
  185. }
  186. }
  187. }
  188. &:hover td div{
  189. color: #2496f1;
  190. }
  191. }
  192. }
  193. }
  194. }
  195. #store-list table>thead>tr input {
  196. font-weight: 100;
  197. }
  198. #store-list .text-message {
  199. color: rgb(80,120,203);
  200. }
  201. #store-list .btn-primary {
  202. width: 88px;
  203. height: 28px;
  204. font-size: 14px;
  205. color: #2496f1;
  206. background-color: #ffffff;
  207. border-radius: 3px;
  208. border: solid 1px #2496f1;
  209. }
  210. #store-list .btn-primary:hover{
  211. background-color: #2496f1;
  212. border: solid 1px #2496f1;
  213. color: #fff;
  214. }
  215. #store-list table>tbody .logo {
  216. margin-left: 15px;
  217. width: 80px;
  218. height: 80px;
  219. line-height: 80px;
  220. text-align: center;
  221. border-radius: 2px;
  222. border: solid 1px #e2e2e2;
  223. overflow: hidden;
  224. }
  225. #store-list table>tbody img {
  226. max-width: 80px;
  227. max-height: 80px;
  228. }
  229. #store-list table>tbody .vertical-middle{
  230. vertical-align: middle;
  231. }
  232. #store-list table>tbody .store-mark {
  233. margin: 10px 0;
  234. }
  235. #store-list table>tbody .text-point {
  236. color: #ff3737;
  237. font-weight: 600;
  238. }
  239. #store-list table>tbody .store-name {
  240. font-size: 17px;
  241. font-weight: 600;
  242. color: #000;
  243. }
  244. #store-list table>tbody .store-message {
  245. margin-top: 15px;
  246. color: #999;
  247. width: 100%;
  248. overflow: hidden;
  249. text-overflow: ellipsis;
  250. display: -webkit-box;
  251. -webkit-box-orient: vertical;
  252. -webkit-line-clamp: 3;
  253. line-height: 18px;
  254. }
  255. #store-list table>tbody tr td{
  256. padding: 15px;
  257. }
  258. @font-face {
  259. font-family: 'iconfont'; /* project id 357960 */
  260. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot');
  261. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot?#iefix') format('embedded-opentype'),
  262. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.woff') format('woff'),
  263. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.ttf') format('truetype'),
  264. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.svg#iconfont') format('svg');
  265. }
  266. .el-pagination .el-pager li.active{
  267. background-color: #5078cb;
  268. border-color: #337ab7;
  269. }
  270. </style>