Suppliers.vue 8.8 KB

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