| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231 |
- <template>
- <div class="shop">
- <div class="shop-top">
- <p><i class="iconfont icon-dianpu1"></i><span>{{list.totalElements}}</span>家店铺</p>
- <span @click="onClick()">{{downName}} <i class="iconfont icon-arrow-down"></i></span>
- <ul class="supdown" v-if="down">
- <li @click="onDown('ORIGINAL_FACTORY-DISTRIBUTION-AGENCY' )" v-show="downName !== '全部'">全部</li>
- <li @click="onDown('ORIGINAL_FACTORY')" v-show="downName !== '原厂'">原厂</li>
- <li @click="onDown('AGENCY')" v-show="downName !== '代理'">代理</li>
- <li @click="onDown('DISTRIBUTION')" v-show="downName !== '经销'">经销</li>
- </ul>
- </div>
- <div class="shop-list" v-for="item in list.content" @click="goStoreDetail(item.uuid)">
- <h3>{{item.storeName}}</h3>
- <div class="list-item">
- <div class="item-img">
- <i :style="'background:url(' + isType(item.type) + ')no-repeat 0 0/.65rem .33rem;'"></i>
- <img :src="item.logoUrl || '/images/component/default.png'">
- </div>
- <div class="list-item-phone">
- <p>电话:<span>{{item.enterprise.enTel}}</span></p>
- <p>传真:<span>{{item.enterprise.enFax}}</span></p>
- <!--<p>商家介绍: <nuxt-link :to="'/mobile/merchantDescription/'+item.uuid">点击查看</nuxt-link></p>-->
- <i class="iconfont icon-shoucang" :style="item.isFocus=='true'?'color:#ff7800':'color:#bbb'" @click="focusStore(item, $event)"></i>
- </div>
- </div>
- </div>
- <remind-box :title="collectResult" :timeoutCount="timeoutCount"></remind-box>
- </div>
- </template>
- <script>
- import RemindBox from '~components/mobile/common/RemindBox.vue'
- export default {
- layout: 'main',
- data () {
- return {
- page: '',
- count: '',
- types: '',
- down: false,
- downName: '全部',
- isFocus: true,
- collectResult: '收藏成功',
- timeoutCount: 0
- }
- },
- components: {
- RemindBox
- },
- fetch ({ store }) {
- return Promise.all([
- store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY' })
- ])
- },
- computed: {
- list () {
- return this.$store.state.provider.stores.storeList.data
- }
- },
- methods: {
- isType (type) {
- let bgurl = ''
- if (type === 'ORIGINAL_FACTORY') {
- bgurl = '/images/mobile/@2x/shop/yuanchang@2x.png'
- }
- if (type === 'DISTRIBUTION') {
- bgurl = '/images/mobile/@2x/shop/jingxiao@2x.png'
- }
- if (type === 'AGENCY') {
- bgurl = '/images/mobile/@2x/shop/daili@2x.png'
- }
- return bgurl
- },
- onClick () {
- this.down = !this.down
- },
- onDown (type) {
- this.$store.dispatch('provider/findStoreListInMobil', { page: 1, count: 10, types: type })
- this.down = !this.down
- if (type === 'ORIGINAL_FACTORY') {
- this.downName = '原厂'
- }
- if (type === 'DISTRIBUTION') {
- this.downName = '经销'
- }
- if (type === 'AGENCY') {
- this.downName = '代理'
- }
- if (type === 'ORIGINAL_FACTORY-DISTRIBUTION-AGENCY') {
- this.downName = '全部'
- }
- },
- focusStore: function (item, $event) {
- // item.isFocus = item.isFocus === 'false' ? 'true' : 'false'
- $event.stopPropagation()
- if (item.isFocus === 'false') {
- this.$http.post('/trade/storeFocus/save', {storeName: item.storeName, storeid: item.id})
- .then(response => {
- item.isFocus = 'true'
- this.collectResult = '收藏成功'
- this.timeoutCount++
- })
- } else {
- this.$http.post('/trade/storeFocus/delete/storeId', [item.id])
- .then(response => {
- item.isFocus = 'false'
- this.collectResult = '取消成功'
- this.timeoutCount++
- })
- }
- },
- goStoreDetail: function (uuid) {
- this.$router.push('/mobile/shop/' + uuid)
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .shop{
- margin-bottom: .98rem;
- min-height: 10rem;
- background: #e2e4e6;
- .shop-top{
- display:inline-flex;
- justify-content: space-between;
- align-items: center;
- width:100%;
- height:1.14rem;
- padding:0 .3rem;
- position:relative;
- background:#fff;
- .supdown{
- position:absolute;
- top:.8rem;
- right:.2rem;
- z-index:100;
- background:#616264;
- border-radius:.1rem;
- li{
- font-size: .28rem;
- color:#ffffff;
- height: .32rem;
- line-height: .32rem;
- margin: .4rem .3rem;
- }
- }
- p{
- font-size:.24rem;
- color:#000;
- i{
- font-size: .53rem;
- color:#418ef7;
- }
- span{
- font-size:.3rem;
- color:#f94f28;
- margin:0 .1rem;
- }
- }
- >span{
- font-size:.28rem;
- color:#53a0f7;
- }
- }
- .shop-list {
- background:#fff;
- margin-top:.12rem;
- padding-bottom:.28rem;
- /*&:hover{*/
- /*background: #e1e1e1;*/
- /*}*/
- h3{
- font-size:.32rem;
- line-height: .8rem;
- margin:0;
- margin-left:.27rem;
- margin-bottom:.14rem;
- }
- .list-item{
- width:6.77rem;
- margin-left:.39rem;
- justify-content: space-around;
- display:inline-flex;
- .item-img{
- position:relative;
- width:2.42rem;
- height:1.69rem;
- i{
- display:block;
- position:absolute;
- width:.65rem;
- height:.33rem;
- }
- img{
- display:inline-block;
- width:100%;
- height:100%;
- border:.02rem solid #eee;
- }
- }
- .list-item-phone{
- width:3.95rem;
- padding-top:.18rem;
- position:relative;
- p{
- font-size:.28rem;
- line-height: .45rem;
- margin:0;
- }
- i{
- display:block;
- position:absolute;
- top: 0;
- right: 0;
- font-size:.4rem;
- color:#ff7800;
- }
- i.active{
- color:#333;
- }
- }
- }
- &:active {
- background: #e1e1e1;
- }
- }
- }
- </style>
|