|
@@ -17,7 +17,7 @@
|
|
|
<view class="tab-item" :class="{on:tabIndex===2}" @click="changetab(2)">店铺</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="tabIndex===1" class='nav acea-row row-middle' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
|
|
|
+ <view v-if="tabIndex===1" class='nav acea-row row-middle flex-between-center' :class="(merId > 0 || cid > 0) ? 'mer-nav' : ''">
|
|
|
<view class='item' :class='title ? "font_color":""' @click='set_where(1,tabIndex)'>
|
|
|
{{title ? title:'默认'}}
|
|
|
</view>
|
|
@@ -27,17 +27,41 @@
|
|
|
<image v-else-if="price==2" :src='downPng'></image>
|
|
|
<image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
|
|
|
</view>
|
|
|
- <view class='item-c item' @click='set_where(3,tabIndex)'>
|
|
|
- 销量
|
|
|
- <image v-if="stock==1" :src='upPng'></image>
|
|
|
- <image v-else-if="stock==2" :src='downPng'></image>
|
|
|
- <image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
|
|
|
+ <template v-if="!flowType">
|
|
|
+ <view class='item-c item' @click='set_where(3,tabIndex)'>
|
|
|
+ 销量
|
|
|
+ <image v-if="stock==1" :src='upPng'></image>
|
|
|
+ <image v-else-if="stock==2" :src='downPng'></image>
|
|
|
+ <image v-else :src="urlDomain+'crmebimage/presets/horn.png'"></image>
|
|
|
+ </view>
|
|
|
+ <!-- down -->
|
|
|
+ <view class="item-shu"></view>
|
|
|
+ <view class='item-icon iconfont' :class="is_switch?'icon-pailie':'icon-tupianpailie'" @click='Changswitch()'>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ <view class='item' v-else>
|
|
|
+ <view class="flex-center" @tap="showCateDrawer = !showCateDrawer">
|
|
|
+ <text>{{'预览' + rangeArr[tabActive].name}}</text>
|
|
|
+ <view class="w-76 h-100 flex-center topic-box">
|
|
|
+ <text class="iconfont fs-24" :class="!showCateDrawer?'icon-xiala3':'icon-xiangshang2'"></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
- <!-- down -->
|
|
|
- <view class="item-shu"></view>
|
|
|
- <view class='item-icon iconfont' :class="is_switch?'icon-pailie':'icon-tupianpailie'" @click='Changswitch()'>
|
|
|
+ </view>
|
|
|
+ <!-- 话题分类下拉 -->
|
|
|
+ <view class="fixed-lt w-full bg--w111-fff rd-b-24rpx z-100 pt-22" v-if="showCateDrawer"
|
|
|
+ :style="{top: (86+86) + 'rpx'}">
|
|
|
+ <view class="w-full pr-20 pb-30 pl-30">
|
|
|
+ <view>
|
|
|
+ <view :class="tabActive == item.id ? 'bg-color-good' : ''" v-for="(item, index) of rangeArr" :key="index"
|
|
|
+ class="flex-between-center h-40 mb-20" @click="tabActiveClick(item)">
|
|
|
+ 预览{{item.name}}
|
|
|
+ <text v-if="tabActive == item.id" class="iconfont icon-gou"></text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view :style="{top: (86+86) + 'rpx'}" class="mask z-80" v-if="showCateDrawer" @tap="()=>{showCateDrawer = false}"></view>
|
|
|
<view v-if="tabIndex===1" :class="is_switch==true?'proList':'listBox'">
|
|
|
<view :class="[(merId > 0 || cid > 0) ? 'mer-listBox' : '']" v-if="productList.length>0">
|
|
|
<view v-if="!is_switch" class='list acea-row row-between-wrapper' :class="[is_switch==true ? '' : 'on', (merId > 0 || cid > 0) ? 'mer-list' : ''] ">
|
|
@@ -77,7 +101,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-else class="goods">
|
|
|
- <WaterfallsFlow :wfList='productList' :type="1">
|
|
|
+ <WaterfallsFlow :wfList='productList' :isDynamics="flowType" :userFair="flowType" :type="1">
|
|
|
<template slot-scope="{item}">
|
|
|
<WaterfallsFlowItem :item="item" :type="1" :isStore="1" />
|
|
|
</template>
|
|
@@ -103,7 +127,8 @@
|
|
|
<image :src="urlDomain+'crmebimage/presets/noSearch.png'"></image>
|
|
|
</view>
|
|
|
<text class="text-ccc">{{tabIndex===1?'暂无商品~':'暂无店铺~'}}</text>
|
|
|
- <recommend v-if="!merId" ref="recommendIndex" class="mt-40"></recommend>
|
|
|
+ <recommend v-if="!merId || !fairCateId" ref="recommendIndex" class="mt-40"></recommend>
|
|
|
+ <recommend v-if="fairCateId" :dynamics="true" :tabActive="tabActive" ref="recommendIndex" class="mt-40"></recommend>
|
|
|
</view>
|
|
|
|
|
|
<tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
|
|
@@ -127,7 +152,8 @@
|
|
|
} from '@/api/product.js';
|
|
|
import {
|
|
|
getMerSearchApi,
|
|
|
- getMerProListApi
|
|
|
+ getMerProListApi,
|
|
|
+ getSecondHandListApi
|
|
|
} from '@/api/merchant.js';
|
|
|
import {
|
|
|
mapGetters
|
|
@@ -195,6 +221,14 @@
|
|
|
},
|
|
|
urlDomain: this.$Cache.get("imgHost"),
|
|
|
keyword: '',
|
|
|
+ rangeArr: [
|
|
|
+ {id: 0, range: 'school', name: '本校'},
|
|
|
+ {id: 1, range: 'school', name: '同城'},
|
|
|
+ {id: 2, range: 'school', name: '全国'},
|
|
|
+ ],
|
|
|
+ rangeStr: '',
|
|
|
+ tabActive: null,
|
|
|
+ flowType: false,
|
|
|
drawers: 0,
|
|
|
tabIndex: 1,
|
|
|
productList: [],
|
|
@@ -238,7 +272,9 @@
|
|
|
merId: 0,
|
|
|
cateId: null,
|
|
|
goodScroll: true,
|
|
|
- isShow: false
|
|
|
+ isShow: false,
|
|
|
+ fairCateId: '',
|
|
|
+ showCateDrawer: false
|
|
|
};
|
|
|
},
|
|
|
// 滚动监听
|
|
@@ -257,18 +293,19 @@
|
|
|
title: '精选商品'
|
|
|
});
|
|
|
}
|
|
|
+ this.$set(this, 'cid', Number(options.cid) || 0);
|
|
|
+ this.title = options.title || '';
|
|
|
if (this.fairCateId) {
|
|
|
- this.merId = 9999999999
|
|
|
+ this.cid = 9999999999
|
|
|
+ this.flowType = true
|
|
|
+ this.$set(this, 'rangeStr', options.rangeStr || '');
|
|
|
+ this.$set(this, 'tabActive', +options.tabActive);
|
|
|
uni.setNavigationBarTitle({
|
|
|
title: '二手交易'
|
|
|
});
|
|
|
}
|
|
|
- this.$set(this, 'cid', Number(options.cid) || 0);
|
|
|
- this.title = options.title || '';
|
|
|
this.$set(this, 'keyword', options.searchValue || '');
|
|
|
- if (this.tabIndex === 1 && !fairCateId) {
|
|
|
- this.get_product_list();
|
|
|
- }
|
|
|
+ if (this.tabIndex === 1) this.get_product_list();
|
|
|
switch (this.theme) {
|
|
|
case 'theme2':
|
|
|
this.upPng = `${this.urlDomain}crmebimage/presets/up_orange.png`;
|
|
@@ -291,8 +328,14 @@
|
|
|
this.downPng = `${this.urlDomain}crmebimage/presets/down_red.png`;
|
|
|
break;
|
|
|
}
|
|
|
+ console.log(this.productList, this.isShow, this.tabIndex, this.loading)
|
|
|
},
|
|
|
methods: {
|
|
|
+ tabActiveClick(item) {
|
|
|
+ this.tabActive = item.id;
|
|
|
+ this.rangeStr = item.range;
|
|
|
+ this.showCateDrawer = false;
|
|
|
+ },
|
|
|
goStore(id) {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/merchant/home/index?merId=${id}`
|
|
@@ -465,33 +508,56 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- this.merId === 0 ? productList(that.where).then(res => {
|
|
|
- let list = res.data.list;
|
|
|
- let productList = that.$util.SplitArray(list, that.productList);
|
|
|
- let loadend = list.length < that.where.limit;
|
|
|
- that.loadend = loadend;
|
|
|
- that.loading = false;
|
|
|
- that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
|
|
- that.$set(that, 'productList', productList);
|
|
|
- that.$set(that.where, 'page', that.where.page + 1);
|
|
|
- this.isShow = true
|
|
|
- }).catch(err => {
|
|
|
- that.loading = false;
|
|
|
- that.loadTitle = '加载更多'
|
|
|
- }) : getMerProListApi(that.where).then(res => {
|
|
|
- let list = res.data.list;
|
|
|
- let productList = that.$util.SplitArray(list, that.productList);
|
|
|
- let loadend = list.length < that.where.limit;
|
|
|
- that.loadend = loadend;
|
|
|
- that.loading = false;
|
|
|
- that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
|
|
- that.$set(that, 'productList', productList);
|
|
|
- that.$set(that.where, 'page', that.where.page + 1);
|
|
|
- this.isShow = true
|
|
|
- }).catch(err => {
|
|
|
- that.loading = false;
|
|
|
- that.loadTitle = '加载更多'
|
|
|
- })
|
|
|
+ if (this.fairCateId) {
|
|
|
+ that.where.range = this.rangeStr
|
|
|
+ if (that.where.range == 'city') {
|
|
|
+ that.where.city = uni.getStorageSync('cityName')
|
|
|
+ }
|
|
|
+ that.where.categoryId = this.fairCateId
|
|
|
+ console.log(this.where)
|
|
|
+ getSecondHandListApi(that.where).then(res => {
|
|
|
+ let list = res.data.list;
|
|
|
+ let productList = that.$util.SplitArray(list, that.productList);
|
|
|
+ let loadend = list.length < that.where.limit;
|
|
|
+ that.loadend = loadend;
|
|
|
+ that.loading = false;
|
|
|
+ that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
|
|
+ that.$set(that, 'productList', productList);
|
|
|
+ that.$set(that.where, 'page', that.where.page + 1);
|
|
|
+ this.isShow = true
|
|
|
+ }).catch(err => {
|
|
|
+ that.loading = false;
|
|
|
+ that.loadTitle = '加载更多'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.merId === 0 ? productList(that.where).then(res => {
|
|
|
+ let list = res.data.list;
|
|
|
+ let productList = that.$util.SplitArray(list, that.productList);
|
|
|
+ let loadend = list.length < that.where.limit;
|
|
|
+ that.loadend = loadend;
|
|
|
+ that.loading = false;
|
|
|
+ that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
|
|
+ that.$set(that, 'productList', productList);
|
|
|
+ that.$set(that.where, 'page', that.where.page + 1);
|
|
|
+ this.isShow = true
|
|
|
+ }).catch(err => {
|
|
|
+ that.loading = false;
|
|
|
+ that.loadTitle = '加载更多'
|
|
|
+ }) : getMerProListApi(that.where).then(res => {
|
|
|
+ let list = res.data.list;
|
|
|
+ let productList = that.$util.SplitArray(list, that.productList);
|
|
|
+ let loadend = list.length < that.where.limit;
|
|
|
+ that.loadend = loadend;
|
|
|
+ that.loading = false;
|
|
|
+ that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
|
|
+ that.$set(that, 'productList', productList);
|
|
|
+ that.$set(that.where, 'page', that.where.page + 1);
|
|
|
+ this.isShow = true
|
|
|
+ }).catch(err => {
|
|
|
+ that.loading = false;
|
|
|
+ that.loadTitle = '加载更多'
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
onReachBottom() {
|
|
@@ -499,7 +565,7 @@
|
|
|
if (this.tabIndex === 2) {
|
|
|
this.getMerStreet();
|
|
|
}
|
|
|
- if (this.productList.length > 0 && !fairCateId) {
|
|
|
+ if (this.productList.length > 0) {
|
|
|
this.get_product_list();
|
|
|
}
|
|
|
if ((this.productList.length == 0 && this.isShow && this.tabIndex === 1 && !this.loading) || (this.merchantList
|
|
@@ -928,4 +994,16 @@
|
|
|
.box-line2 {
|
|
|
overflow: hidden;
|
|
|
}
|
|
|
+ .mask {
|
|
|
+ opacity: .5;
|
|
|
+ position: fixed;
|
|
|
+ inset: 0px;
|
|
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
|
+ transition: opacity 300ms ease 0ms, -webkit-transform 300ms ease 0ms, transform 300ms ease 0ms;
|
|
|
+ transform-origin: 50% 50%;
|
|
|
+
|
|
|
+ }
|
|
|
+ .bg-color-good {
|
|
|
+ color: $bg-color-primary;
|
|
|
+ }
|
|
|
</style>
|