Suppliers.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  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. <tr v-for="store in stores.content" v-if="store">
  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. </tr>
  39. <tr v-if="!stores.content || stores.content.length == 0">
  40. <td colspan="10" class="text-center" style="line-height: 40px; 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.page = page
  127. this.pageParams.keyword = this.keyword === '' ? null : this.keyword
  128. this.pageCommodity(this.pageParams)
  129. }
  130. }
  131. }
  132. </script>
  133. <style lang="scss" scoped>
  134. #store-list{
  135. width: 955px;
  136. height: 1213px;
  137. background: #fff;
  138. border-radius: 5px;
  139. table{
  140. table-layout: fixed;
  141. width: 955px;
  142. thead{
  143. padding: 10px 0 9px 9px;
  144. width: 955px;
  145. height: 34px;
  146. line-height: 34px;
  147. tr{
  148. vertical-align: middle;
  149. td{
  150. padding: 0!important;
  151. height: 34px;
  152. line-height: 34px;
  153. background-color: #2496f1;
  154. span{
  155. padding-left: 10px;
  156. font-size: 14px;
  157. color: #fff;
  158. }
  159. &:first-child {
  160. border-top-left-radius: 5px;
  161. }
  162. &:last-child {
  163. border-top-right-radius: 5px;
  164. }
  165. }
  166. }
  167. }
  168. tbody{
  169. background: #fff;
  170. tr{
  171. height: 112px;
  172. td{
  173. padding: 0!important;
  174. vertical-align: middle;
  175. a.btn-sure{
  176. button{
  177. margin: 0px 0 0 80px;
  178. width: 110px !important;
  179. height: 28px;
  180. font-size: 14px;
  181. color: #2496f1;
  182. background-color: #fff;
  183. border-radius: 3px;
  184. border: solid 1px #2496f1;
  185. &:hover{
  186. background-color: #2496f1;
  187. font-size: 14px;
  188. color: #fff;
  189. }
  190. }
  191. }
  192. }
  193. &:hover td div{
  194. color: #2496f1;
  195. }
  196. }
  197. }
  198. }
  199. }
  200. #store-list table>thead>tr input {
  201. font-weight: 100;
  202. }
  203. #store-list .text-message {
  204. color: rgb(80,120,203);
  205. }
  206. #store-list .btn-primary {
  207. width: 88px;
  208. height: 28px;
  209. font-size: 14px;
  210. color: #2496f1;
  211. background-color: #ffffff;
  212. border-radius: 3px;
  213. border: solid 1px #2496f1;
  214. }
  215. #store-list .btn-primary:hover{
  216. background-color: #2496f1;
  217. border: solid 1px #2496f1;
  218. color: #fff;
  219. }
  220. #store-list table>tbody .logo {
  221. margin-left: 15px;
  222. width: 80px;
  223. height: 80px;
  224. line-height: 80px;
  225. text-align: center;
  226. border-radius: 2px;
  227. border: solid 1px #e2e2e2;
  228. overflow: hidden;
  229. }
  230. #store-list table>tbody img {
  231. max-width: 80px;
  232. max-height: 80px;
  233. }
  234. #store-list table>tbody .vertical-middle{
  235. vertical-align: middle;
  236. }
  237. #store-list table>tbody .store-mark {
  238. margin: 10px 0;
  239. }
  240. #store-list table>tbody .text-point {
  241. color: #ff3737;
  242. font-weight: 600;
  243. }
  244. #store-list table>tbody .store-name {
  245. font-size: 17px;
  246. font-weight: 600;
  247. color: #000;
  248. div{
  249. width: 410px;
  250. overflow: hidden;
  251. text-overflow: ellipsis;
  252. white-space: nowrap;
  253. }
  254. }
  255. #store-list table>tbody .store-message {
  256. margin-top: 5px;
  257. color: #666;
  258. width: 100%;
  259. overflow: hidden;
  260. text-overflow: ellipsis;
  261. display: -webkit-box;
  262. -webkit-box-orient: vertical;
  263. -webkit-line-clamp: 2;
  264. line-height: 18px;
  265. }
  266. #store-list table>tbody tr:hover{
  267. box-shadow: 1px 1px 12px rgb(145, 197, 239);
  268. -moz-box-shadow: 1px 1px 12px rgb(145, 197, 239);
  269. -o-box-shadow: 1px 1px 12px rgb(145, 197, 239);
  270. -webkit-box-shadow: 1px 1px 12px rgb(145, 197, 239) ;
  271. cursor: pointer;
  272. }
  273. #store-list table>tbody tr:first-child:hover{
  274. box-shadow: none;
  275. cursor: default ;
  276. }
  277. #store-list table>tbody tr td{
  278. padding: 15px;
  279. }
  280. @font-face {
  281. font-family: 'iconfont'; /* project id 357960 */
  282. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot');
  283. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot?#iefix') format('embedded-opentype'),
  284. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.woff') format('woff'),
  285. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.ttf') format('truetype'),
  286. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.svg#iconfont') format('svg');
  287. }
  288. .el-pagination .el-pager li.active{
  289. background-color: #5078cb;
  290. border-color: #337ab7;
  291. }
  292. </style>