Suppliers.vue 8.5 KB

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