123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361 |
- <template>
- <div>
- <div id="store-list">
- <table class="table">
- <thead>
- <tr>
- <td width="120"><span v-text="storeType === 'factory' ? '原 厂' : '代理经销'">原厂</span></td>
- <td width="100"></td>
- <td width="460"></td>
- <td width="150" style="vertical-align: middle"></td>
- <td width="120" style="vertical-align: middle;"></td>
- </tr>
- </thead>
- <tbody>
- <!--<tr>{{$data}}</tr>-->
- <tr style="height: 50px;">
- <td colspan="5">
- <search-header :storeTypes="storeTypes" :outerKeyword="keyword" :similarUrl="similarUrl" @searchAction="search" :placeholder="'店铺名/品牌/物料名称/型号'"></search-header>
- <a @click="goStoreApply" class="btn-sure"><button class="btn btn-primary">立即入驻</button></a>
- </td>
- </tr>
- <tr :key="store.uuid" v-for="store in stores.content" v-if="store" @click="goStoreDetail(store)">
- <td>
- <div class="logo">
- <a><img :src="store.logoUrl || '/images/store/common/default.png'" :alt="store.storeName"></a>
- </div>
- </td>
- <td colspan="3">
- <a class="store-name"><div :title="store.storeName">{{store.storeName}}</div></a>
- <div class="store-message">
- <div>
- <span class="title">主营产品:</span>
- <span class="info" v-text="store.description || '-'" :title="store.description">123</span>
- <span class="split_line">|</span>
- <span class="title">经营范围:</span>
- <span class="info" v-text="store.storeApplication || '-'" :title="store.storeApplication">1212324</span>
- </div>
- <div>
- <span class="title">电话:</span>
- <span class="info" v-text="store.enterprise.enTel || '-'" :title="store.enterprise.enTel">123</span>
- <span class="split_line">|</span>
- <span class="title">地址:</span>
- <span class="info" v-text="store.enterprise.enAddress || '-'" :title="store.enterprise.enAddress">1212324</span>
- </div>
- </div>
- </td>
- <td class="vertical-middle" style="text-align: center">
- <a><button class="btn btn-primary">进入店铺</button></a>
- </td>
- </tr>
- <tr v-if="!stores.content || stores.content.length == 0" class="no-content">
- <td colspan="10" class="text-center" style="line-height: 1125px; font-size: 20px;">
- <i class="fa fa-smile-o fa-lg"></i> 暂无店铺信息
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <div style="float: right;">
- <page :total="stores.totalElements" :page-size="pageParams.count"
- :current="pageParams.page" v-on:childEvent="handleCurrentChange"></page>
- </div>
- </div>
- </template>
- <script>
- import Page from '~components/common/page/pageComponent.vue'
- import SearchHeader from '~components/common/PcSearchHeader.vue'
- export default {
- name: 'suppliers',
- components: {
- Page,
- SearchHeader
- },
- data () {
- return {
- keyword: '',
- pageParams: {
- page: 1,
- count: 10,
- keyword: '',
- type: 'ORIGINAL_FACTORY',
- field: ''
- },
- similarUrl: '/search/similarKeywords/goods',
- storeTypes: 'ORIGINAL_FACTORY'
- }
- },
- computed: {
- storeType () {
- return this.$route.params.type
- },
- stores () {
- return this.$store.state.provider.stores.storeList.data
- },
- user () {
- return this.$store.state.option.user
- },
- enterprise () {
- let ens = this.user.data.enterprises
- if (ens && ens.length) {
- return ens.find(item => item.current) || {enName: '个人账户'}
- } else {
- return {enName: '个人账户'}
- }
- }
- },
- methods: {
- search (obj, page) {
- this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
- this.pageParams.page = 1
- this.pageParams.keyword = obj.keyword === '' ? null : obj.keyword
- this.pageParams.field = obj.type && obj.type !== 'store' ? obj.type : ''
- this.keyword = this.pageParams.keyword
- this.pageCommodity(this.pageParams)
- },
- showLittleDescription (description) {
- if (!description || description === '') {
- return '暂无企业介绍'
- }
- return description.slice(0, 160)
- },
- async pageCommodity (pageParams) {
- // pageCommodity (pageParams) {
- pageParams.op = 'similar'
- try {
- let { data } = await this.$http.get('/api/store-service/stores', { params: pageParams })
- this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', data)
- } catch (err) {
- this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
- }
- // this.$http.get('/api/store-service/stores', { params: pageParams }).then(response => {
- // this.$store.commit('provider/stores/GET_STORE_LIST_SUCCESS', response)
- // }, err => {
- // this.$store.commit('provider/stores/GET_STORE_LIST_FAILURE', err)
- // })
- },
- handleCurrentChange (page) {
- // this.$nextTick(() => {
- if (localStorage.getItem('pageChange') === 'true') {
- this.pageParams.type = this.storeType === 'factory' ? 'ORIGINAL_FACTORY' : 'AGENCY-DISTRIBUTION'
- this.pageParams.page = page
- this.pageParams.keyword = this.keyword === '' ? null : this.keyword
- this.pageCommodity(this.pageParams)
- }
- // })
- },
- goStoreDetail (store) {
- window.open('/store/' + store.uuid)
- }
- },
- watch: {
- '$route' (to, from) {
- if (to.params.type === "factory") {
- this.storeTypes = 'ORIGINAL_FACTORY'
- } else if (to.params.type === "origin") {
- this.storeTypes = 'AGENCY,DISTRIBUTION'
- } else {
- this.storeTypes = ''
- }
- this.keyword = ''
- this.pageParams.keyword = ''
- localStorage.setItem('pageChange', 'true')
- this.handleCurrentChange(1)
- // if (to.fullPath)
- // this.keyword = to.query.keyword
- // this.displayKeyword = to.query.keyword
- // this.setChangelistHander(to.query.choosetype)
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- #store-list{
- width: 955px;
- height: 1213px;
- background: #fff;
- border-radius: 5px;
- table{
- table-layout: fixed;
- width: 955px;
- thead{
- padding: 10px 0 9px 9px;
- width: 955px;
- height: 34px;
- line-height: 34px;
- tr{
- vertical-align: middle;
- td{
- padding: 0!important;
- height: 34px;
- line-height: 34px;
- background-color: #2496f1;
- span{
- padding-left: 10px;
- font-size: 14px;
- font-weight: bold;
- color: #fff;
- }
- &:first-child {
- border-top-left-radius: 5px;
- }
- &:last-child {
- border-top-right-radius: 5px;
- }
- }
- }
- }
- tbody{
- background: #fff;
- tr{
- height: 112px;
- td{
- padding: 0!important;
- vertical-align: middle;
- a.btn-sure{
- button{
- margin: 0px 0 0 15px;
- width: 110px !important;
- height: 28px;
- font-size: 14px;
- color: #2496f1;
- background-color: #fff;
- border-radius: 3px;
- border: solid 1px #2496f1;
- &:hover{
- background-color: #2496f1;
- font-size: 14px;
- color: #fff;
- }
- }
- }
- }
- &:hover td div{
- color: #2496f1;
- }
- }
- }
- }
- }
- #store-list table>thead>tr input {
- font-weight: 100;
- }
- #store-list .text-message {
- color: rgb(80,120,203);
- }
- #store-list .btn-primary {
- width: 88px;
- height: 28px;
- font-size: 14px;
- color: #2496f1;
- background-color: #ffffff;
- border-radius: 3px;
- border: solid 1px #2496f1;
- }
- #store-list .btn-primary:hover{
- background-color: #2496f1;
- border: solid 1px #2496f1;
- color: #fff;
- }
- #store-list table>tbody .logo {
- margin-left: 15px;
- width: 80px;
- height: 80px;
- line-height: 80px;
- text-align: center;
- border-radius: 2px;
- border: solid 1px #e2e2e2;
- overflow: hidden;
- }
- #store-list table>tbody img {
- max-width: 80px;
- max-height: 80px;
- }
- #store-list table>tbody .vertical-middle{
- vertical-align: middle;
- }
- #store-list table>tbody .store-mark {
- margin: 10px 0;
- }
- #store-list table>tbody .text-point {
- color: #ff3737;
- font-weight: 600;
- }
- #store-list table>tbody .store-name {
- font-size: 17px;
- font-weight: 600;
- color: #000;
- div{
- width: 410px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- #store-list table>tbody .store-message {
- margin-top: 5px;
- color: #666;
- width: 100%;
- overflow: hidden;
- text-overflow: ellipsis;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- line-height: 18px;
- }
- #store-list table>tbody .store-message span.title{
- float: left;
- }
- #store-list table>tbody .store-message span.info{
- float: left;
- display: inline-block;
- max-width: 280px;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- #store-list table>tbody .store-message span.split_line {
- float: left;
- margin: 0 5px;
- }
- #store-list table>tbody tr:hover{
- box-shadow: 1px 1px 12px rgb(145, 197, 239);
- -moz-box-shadow: 1px 1px 12px rgb(145, 197, 239);
- -o-box-shadow: 1px 1px 12px rgb(145, 197, 239);
- -webkit-box-shadow: 1px 1px 12px rgb(145, 197, 239) ;
- cursor: pointer;
- }
- #store-list table>tbody tr:first-child:hover{
- box-shadow: none;
- cursor: default ;
- }
- #store-list table>tbody tr.no-content:hover{
- box-shadow: none;
- cursor: default ;
- }
- #store-list table>tbody tr td{
- padding: 15px;
- }
- @font-face {
- font-family: 'iconfont'; /* project id 357960 */
- src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot');
- src: url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.eot?#iefix') format('embedded-opentype'),
- url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.woff') format('woff'),
- url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.ttf') format('truetype'),
- url('//at.alicdn.com/t/font_sw3uw5ndd9uow29.svg#iconfont') format('svg');
- }
- .el-pagination .el-pager li.active{
- background-color: #5078cb;
- border-color: #337ab7;
- }
- </style>
|