Suppliers.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  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 :storeTypes="storeTypes" :outerKeyword="keyword" :similarUrl="similarUrl" @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. <div>
  32. <span class="title">主营产品:</span>
  33. <span class="info" v-text="store.description || '-'" :title="store.description">123</span>
  34. <span class="split_line">|</span>
  35. <span class="title">经营范围:</span>
  36. <span class="info" v-text="store.storeApplication || '-'" :title="store.storeApplication">1212324</span>
  37. </div>
  38. <div>
  39. <span class="title">电话:</span>
  40. <span class="info" v-text="store.enterprise.enTel || '-'" :title="store.enterprise.enTel">123</span>
  41. <span class="split_line">|</span>
  42. <span class="title">地址:</span>
  43. <span class="info" v-text="store.enterprise.enAddress || '-'" :title="store.enterprise.enAddress">1212324</span>
  44. </div>
  45. </div>
  46. </td>
  47. <td class="vertical-middle" style="text-align: center">
  48. <a><button class="btn btn-primary">进入店铺</button></a>
  49. </td>
  50. </tr>
  51. <tr v-if="!stores.content || stores.content.length == 0" class="no-content">
  52. <td colspan="10" class="text-center" style="line-height: 1125px; font-size: 20px;">
  53. <i class="fa fa-smile-o fa-lg"></i> 暂无店铺信息
  54. </td>
  55. </tr>
  56. </tbody>
  57. </table>
  58. </div>
  59. <div style="float: right;">
  60. <page :total="stores.totalElements" :page-size="pageParams.count"
  61. :current="pageParams.page" v-on:childEvent="handleCurrentChange"></page>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import Page from '~components/common/page/pageComponent.vue'
  67. import SearchHeader from '~components/common/PcSearchHeader.vue'
  68. export default {
  69. name: 'suppliers',
  70. components: {
  71. Page,
  72. SearchHeader
  73. },
  74. data () {
  75. return {
  76. keyword: '',
  77. pageParams: {
  78. page: 1,
  79. count: 10,
  80. keyword: '',
  81. type: 'ORIGINAL_FACTORY',
  82. field: ''
  83. },
  84. similarUrl: '/search/similarKeywords/goods',
  85. storeTypes: 'ORIGINAL_FACTORY'
  86. }
  87. },
  88. computed: {
  89. storeType () {
  90. return this.$route.params.type
  91. },
  92. stores () {
  93. return this.$store.state.provider.stores.storeList.data
  94. },
  95. user () {
  96. return this.$store.state.option.user
  97. },
  98. enterprise () {
  99. let ens = this.user.data.enterprises
  100. if (ens && ens.length) {
  101. return ens.find(item => item.current) || {enName: '个人账户'}
  102. } else {
  103. return {enName: '个人账户'}
  104. }
  105. }
  106. },
  107. methods: {
  108. search (obj) {
  109. this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
  110. this.pageParams.page = 1
  111. this.pageParams.keyword = obj.keyword === '' ? null : obj.keyword
  112. this.pageParams.field = obj.type && obj.type !== 'store' ? obj.type : ''
  113. this.pageCommodity(this.pageParams)
  114. },
  115. showLittleDescription (description) {
  116. if (!description || description === '') {
  117. return '暂无企业介绍'
  118. }
  119. return description.slice(0, 160)
  120. },
  121. async pageCommodity (pageParams) {
  122. // pageCommodity (pageParams) {
  123. pageParams.op = 'similar'
  124. try {
  125. let { data } = await this.$http.get('/api/store-service/stores', { params: pageParams })
  126. this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', data)
  127. } catch (err) {
  128. this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  129. }
  130. // this.$http.get('/api/store-service/stores', { params: pageParams }).then(response => {
  131. // this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', response)
  132. // }, err => {
  133. // this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  134. // })
  135. },
  136. handleCurrentChange (page) {
  137. // this.$nextTick(() => {
  138. if (localStorage.getItem('pageChange') === 'true') {
  139. this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
  140. this.pageParams.page = page
  141. this.pageParams.keyword = this.keyword === '' ? null : this.keyword
  142. this.pageCommodity(this.pageParams)
  143. }
  144. // })
  145. },
  146. goStoreDetail (store) {
  147. window.open('/store/' + store.uuid)
  148. }
  149. },
  150. watch: {
  151. '$route' (to, from) {
  152. if (to.params.type === "factory") {
  153. this.storeTypes = 'ORIGINAL_FACTORY'
  154. } else if (to.params.type === "origin") {
  155. this.storeTypes = 'AGENCY,DISTRIBUTION'
  156. } else {
  157. this.storeTypes = ''
  158. }
  159. localStorage.setItem('pageChange', 'true')
  160. this.handleCurrentChange(1)
  161. // if (to.fullPath)
  162. // this.keyword = to.query.keyword
  163. // this.displayKeyword = to.query.keyword
  164. // this.setChangelistHander(to.query.choosetype)
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss" scoped>
  170. #store-list{
  171. width: 955px;
  172. height: 1213px;
  173. background: #fff;
  174. border-radius: 5px;
  175. table{
  176. table-layout: fixed;
  177. width: 955px;
  178. thead{
  179. padding: 10px 0 9px 9px;
  180. width: 955px;
  181. height: 34px;
  182. line-height: 34px;
  183. tr{
  184. vertical-align: middle;
  185. td{
  186. padding: 0!important;
  187. height: 34px;
  188. line-height: 34px;
  189. background-color: #2496f1;
  190. span{
  191. padding-left: 10px;
  192. font-size: 14px;
  193. font-weight: bold;
  194. color: #fff;
  195. }
  196. &:first-child {
  197. border-top-left-radius: 5px;
  198. }
  199. &:last-child {
  200. border-top-right-radius: 5px;
  201. }
  202. }
  203. }
  204. }
  205. tbody{
  206. background: #fff;
  207. tr{
  208. height: 112px;
  209. td{
  210. padding: 0!important;
  211. vertical-align: middle;
  212. a.btn-sure{
  213. button{
  214. margin: 0px 0 0 15px;
  215. width: 110px !important;
  216. height: 28px;
  217. font-size: 14px;
  218. color: #2496f1;
  219. background-color: #fff;
  220. border-radius: 3px;
  221. border: solid 1px #2496f1;
  222. &:hover{
  223. background-color: #2496f1;
  224. font-size: 14px;
  225. color: #fff;
  226. }
  227. }
  228. }
  229. }
  230. &:hover td div{
  231. color: #2496f1;
  232. }
  233. }
  234. }
  235. }
  236. }
  237. #store-list table>thead>tr input {
  238. font-weight: 100;
  239. }
  240. #store-list .text-message {
  241. color: rgb(80,120,203);
  242. }
  243. #store-list .btn-primary {
  244. width: 88px;
  245. height: 28px;
  246. font-size: 14px;
  247. color: #2496f1;
  248. background-color: #ffffff;
  249. border-radius: 3px;
  250. border: solid 1px #2496f1;
  251. }
  252. #store-list .btn-primary:hover{
  253. background-color: #2496f1;
  254. border: solid 1px #2496f1;
  255. color: #fff;
  256. }
  257. #store-list table>tbody .logo {
  258. margin-left: 15px;
  259. width: 80px;
  260. height: 80px;
  261. line-height: 80px;
  262. text-align: center;
  263. border-radius: 2px;
  264. border: solid 1px #e2e2e2;
  265. overflow: hidden;
  266. }
  267. #store-list table>tbody img {
  268. max-width: 80px;
  269. max-height: 80px;
  270. }
  271. #store-list table>tbody .vertical-middle{
  272. vertical-align: middle;
  273. }
  274. #store-list table>tbody .store-mark {
  275. margin: 10px 0;
  276. }
  277. #store-list table>tbody .text-point {
  278. color: #ff3737;
  279. font-weight: 600;
  280. }
  281. #store-list table>tbody .store-name {
  282. font-size: 17px;
  283. font-weight: 600;
  284. color: #000;
  285. div{
  286. width: 410px;
  287. overflow: hidden;
  288. text-overflow: ellipsis;
  289. white-space: nowrap;
  290. }
  291. }
  292. #store-list table>tbody .store-message {
  293. margin-top: 5px;
  294. color: #666;
  295. width: 100%;
  296. overflow: hidden;
  297. text-overflow: ellipsis;
  298. display: -webkit-box;
  299. -webkit-box-orient: vertical;
  300. -webkit-line-clamp: 2;
  301. line-height: 18px;
  302. }
  303. #store-list table>tbody .store-message span.title{
  304. float: left;
  305. }
  306. #store-list table>tbody .store-message span.info{
  307. float: left;
  308. display: inline-block;
  309. max-width: 280px;
  310. overflow: hidden;
  311. text-overflow: ellipsis;
  312. white-space: nowrap;
  313. }
  314. #store-list table>tbody .store-message span.split_line {
  315. float: left;
  316. margin: 0 5px;
  317. }
  318. #store-list table>tbody tr:hover{
  319. box-shadow: 1px 1px 12px rgb(145, 197, 239);
  320. -moz-box-shadow: 1px 1px 12px rgb(145, 197, 239);
  321. -o-box-shadow: 1px 1px 12px rgb(145, 197, 239);
  322. -webkit-box-shadow: 1px 1px 12px rgb(145, 197, 239) ;
  323. cursor: pointer;
  324. }
  325. #store-list table>tbody tr:first-child:hover{
  326. box-shadow: none;
  327. cursor: default ;
  328. }
  329. #store-list table>tbody tr.no-content:hover{
  330. box-shadow: none;
  331. cursor: default ;
  332. }
  333. #store-list table>tbody tr td{
  334. padding: 15px;
  335. }
  336. @font-face {
  337. font-family: 'iconfont'; /* project id 357960 */
  338. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot');
  339. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot?#iefix') format('embedded-opentype'),
  340. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.woff') format('woff'),
  341. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.ttf') format('truetype'),
  342. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.svg#iconfont') format('svg');
  343. }
  344. .el-pagination .el-pager li.active{
  345. background-color: #5078cb;
  346. border-color: #337ab7;
  347. }
  348. </style>