Suppliers.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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, page) {
  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.keyword = this.pageParams.keyword
  114. this.pageCommodity(this.pageParams)
  115. },
  116. showLittleDescription (description) {
  117. if (!description || description === '') {
  118. return '暂无企业介绍'
  119. }
  120. return description.slice(0, 160)
  121. },
  122. async pageCommodity (pageParams) {
  123. // pageCommodity (pageParams) {
  124. pageParams.op = 'similar'
  125. try {
  126. let { data } = await this.$http.get('/api/store-service/stores', { params: pageParams })
  127. this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', data)
  128. } catch (err) {
  129. this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  130. }
  131. // this.$http.get('/api/store-service/stores', { params: pageParams }).then(response => {
  132. // this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', response)
  133. // }, err => {
  134. // this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
  135. // })
  136. },
  137. handleCurrentChange (page) {
  138. // this.$nextTick(() => {
  139. if (localStorage.getItem('pageChange') === 'true') {
  140. this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
  141. this.pageParams.page = page
  142. this.pageParams.keyword = this.keyword === '' ? null : this.keyword
  143. this.pageCommodity(this.pageParams)
  144. }
  145. // })
  146. },
  147. goStoreDetail (store) {
  148. window.open('/store/' + store.uuid)
  149. }
  150. },
  151. watch: {
  152. '$route' (to, from) {
  153. if (to.params.type === "factory") {
  154. this.storeTypes = 'ORIGINAL_FACTORY'
  155. } else if (to.params.type === "origin") {
  156. this.storeTypes = 'AGENCY,DISTRIBUTION'
  157. } else {
  158. this.storeTypes = ''
  159. }
  160. this.keyword = ''
  161. this.pageParams.keyword = ''
  162. localStorage.setItem('pageChange', 'true')
  163. this.handleCurrentChange(1)
  164. // if (to.fullPath)
  165. // this.keyword = to.query.keyword
  166. // this.displayKeyword = to.query.keyword
  167. // this.setChangelistHander(to.query.choosetype)
  168. }
  169. }
  170. }
  171. </script>
  172. <style lang="scss" scoped>
  173. #store-list{
  174. width: 955px;
  175. height: 1213px;
  176. background: #fff;
  177. border-radius: 5px;
  178. table{
  179. table-layout: fixed;
  180. width: 955px;
  181. thead{
  182. padding: 10px 0 9px 9px;
  183. width: 955px;
  184. height: 34px;
  185. line-height: 34px;
  186. tr{
  187. vertical-align: middle;
  188. td{
  189. padding: 0!important;
  190. height: 34px;
  191. line-height: 34px;
  192. background-color: #2496f1;
  193. span{
  194. padding-left: 10px;
  195. font-size: 14px;
  196. font-weight: bold;
  197. color: #fff;
  198. }
  199. &:first-child {
  200. border-top-left-radius: 5px;
  201. }
  202. &:last-child {
  203. border-top-right-radius: 5px;
  204. }
  205. }
  206. }
  207. }
  208. tbody{
  209. background: #fff;
  210. tr{
  211. height: 112px;
  212. td{
  213. padding: 0!important;
  214. vertical-align: middle;
  215. a.btn-sure{
  216. button{
  217. margin: 0px 0 0 15px;
  218. width: 110px !important;
  219. height: 28px;
  220. font-size: 14px;
  221. color: #2496f1;
  222. background-color: #fff;
  223. border-radius: 3px;
  224. border: solid 1px #2496f1;
  225. &:hover{
  226. background-color: #2496f1;
  227. font-size: 14px;
  228. color: #fff;
  229. }
  230. }
  231. }
  232. }
  233. &:hover td div{
  234. color: #2496f1;
  235. }
  236. }
  237. }
  238. }
  239. }
  240. #store-list table>thead>tr input {
  241. font-weight: 100;
  242. }
  243. #store-list .text-message {
  244. color: rgb(80,120,203);
  245. }
  246. #store-list .btn-primary {
  247. width: 88px;
  248. height: 28px;
  249. font-size: 14px;
  250. color: #2496f1;
  251. background-color: #ffffff;
  252. border-radius: 3px;
  253. border: solid 1px #2496f1;
  254. }
  255. #store-list .btn-primary:hover{
  256. background-color: #2496f1;
  257. border: solid 1px #2496f1;
  258. color: #fff;
  259. }
  260. #store-list table>tbody .logo {
  261. margin-left: 15px;
  262. width: 80px;
  263. height: 80px;
  264. line-height: 80px;
  265. text-align: center;
  266. border-radius: 2px;
  267. border: solid 1px #e2e2e2;
  268. overflow: hidden;
  269. }
  270. #store-list table>tbody img {
  271. max-width: 80px;
  272. max-height: 80px;
  273. }
  274. #store-list table>tbody .vertical-middle{
  275. vertical-align: middle;
  276. }
  277. #store-list table>tbody .store-mark {
  278. margin: 10px 0;
  279. }
  280. #store-list table>tbody .text-point {
  281. color: #ff3737;
  282. font-weight: 600;
  283. }
  284. #store-list table>tbody .store-name {
  285. font-size: 17px;
  286. font-weight: 600;
  287. color: #000;
  288. div{
  289. width: 410px;
  290. overflow: hidden;
  291. text-overflow: ellipsis;
  292. white-space: nowrap;
  293. }
  294. }
  295. #store-list table>tbody .store-message {
  296. margin-top: 5px;
  297. color: #666;
  298. width: 100%;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. display: -webkit-box;
  302. -webkit-box-orient: vertical;
  303. -webkit-line-clamp: 2;
  304. line-height: 18px;
  305. }
  306. #store-list table>tbody .store-message span.title{
  307. float: left;
  308. }
  309. #store-list table>tbody .store-message span.info{
  310. float: left;
  311. display: inline-block;
  312. max-width: 280px;
  313. overflow: hidden;
  314. text-overflow: ellipsis;
  315. white-space: nowrap;
  316. }
  317. #store-list table>tbody .store-message span.split_line {
  318. float: left;
  319. margin: 0 5px;
  320. }
  321. #store-list table>tbody tr:hover{
  322. box-shadow: 1px 1px 12px rgb(145, 197, 239);
  323. -moz-box-shadow: 1px 1px 12px rgb(145, 197, 239);
  324. -o-box-shadow: 1px 1px 12px rgb(145, 197, 239);
  325. -webkit-box-shadow: 1px 1px 12px rgb(145, 197, 239) ;
  326. cursor: pointer;
  327. }
  328. #store-list table>tbody tr:first-child:hover{
  329. box-shadow: none;
  330. cursor: default ;
  331. }
  332. #store-list table>tbody tr.no-content:hover{
  333. box-shadow: none;
  334. cursor: default ;
  335. }
  336. #store-list table>tbody tr td{
  337. padding: 15px;
  338. }
  339. @font-face {
  340. font-family: 'iconfont'; /* project id 357960 */
  341. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot');
  342. src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot?#iefix') format('embedded-opentype'),
  343. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.woff') format('woff'),
  344. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.ttf') format('truetype'),
  345. url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.svg#iconfont') format('svg');
  346. }
  347. .el-pagination .el-pager li.active{
  348. background-color: #5078cb;
  349. border-color: #337ab7;
  350. }
  351. </style>