Suppliers.vue 7.7 KB

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