Suppliers.vue 8.8 KB

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