Commit a4ff3991 by 李嘉林

更新

parent f48d727b
...@@ -39,7 +39,7 @@ const componentOptions = { ...@@ -39,7 +39,7 @@ const componentOptions = {
isPageHidden: false, // 页面是否处于隐藏状态 isPageHidden: false, // 页面是否处于隐藏状态
titleIcon: "", titleIcon: "",
classificationLoadPage: 1, classificationLoadPage: 1,
classificationLoadNum: 10, classificationLoadNum: 4,
queryProductInfoLoading: false, queryProductInfoLoading: false,
loading: false, loading: false,
scrollLoading: false, // 滚动加载优化后添加加载动画 scrollLoading: false, // 滚动加载优化后添加加载动画
...@@ -64,6 +64,7 @@ const componentOptions = { ...@@ -64,6 +64,7 @@ const componentOptions = {
goodsSpecificationIds: [], goodsSpecificationIds: [],
}, },
randomNumber: "", randomNumber: "",
selectScreen: false, // 筛选选中状态
}, },
// 数据监听器 // 数据监听器
observers: {}, observers: {},
...@@ -75,10 +76,18 @@ const componentOptions = { ...@@ -75,10 +76,18 @@ const componentOptions = {
app.getFilterGoodsData = (val) => { app.getFilterGoodsData = (val) => {
if (val.randomNumber != _this.data.randomNumber) return; if (val.randomNumber != _this.data.randomNumber) return;
console.log(val,'-------------------------77') console.log(val,'-------------------------77')
let selectScreen = val.submitFliterVal.minPrice!=""
|| val.submitFliterVal.maxPrice!=""
|| val.submitFliterVal.attribute.length>0
|| val.submitFliterVal.brandIdList.length>0
|| val.submitFliterVal.brandActiveNameList.length>0
|| val.submitFliterVal.goodsSpecificationIds.length>0
_this.setData({ _this.setData({
submitFliterVal: val.submitFliterVal, submitFliterVal: val.submitFliterVal,
selectScreen,
loading: true
}) })
console.log(_this.data.submitFliterVal,'----------submitFliterVal') console.log(_this.data.submitFliterVal, '----------submitFliterVal')
_this.init(); _this.init();
} }
this.setData({ this.setData({
...@@ -130,20 +139,8 @@ const componentOptions = { ...@@ -130,20 +139,8 @@ const componentOptions = {
filterGoods(e) { filterGoods(e) {
let { item } = e.currentTarget.dataset; let { item } = e.currentTarget.dataset;
let { filterPriceType, filterType } = this.data; let { filterPriceType, filterType } = this.data;
if(item == 2) {
// 价格筛选
filterPriceType = filterPriceType == 0?1:0
} else {
// 还原默认值
filterPriceType = 1
}
this.setData({
filterType: item,
filterPriceType
})
if(item == 99) { if(item == 99) {
// 展示筛选弹窗 // 展示筛选弹窗
// wx.showToast({title:"暂未开发", icon:"error"})
let _this = this; let _this = this;
app.openFilterGoods({ app.openFilterGoods({
submitFliterVal: _this.data.submitFliterVal, submitFliterVal: _this.data.submitFliterVal,
...@@ -152,12 +149,18 @@ const componentOptions = { ...@@ -152,12 +149,18 @@ const componentOptions = {
randomNumber: _this.data.randomNumber, randomNumber: _this.data.randomNumber,
hideBrandSelectFlag: _this.data.datas.componentData.filterBrand.length>0?true:false, hideBrandSelectFlag: _this.data.datas.componentData.filterBrand.length>0?true:false,
}); });
// this.opt.bus.$emit("openGoodsFilters",{
// submitFliterVal: this.submitFliterVal,
// randomNumber: this.randomNumber,
// hideBrandSelectFlag: this.filterBrand.length>0?true:false,
// });
} else { } else {
if(item == 2) {
// 价格筛选
filterPriceType = filterPriceType == 0?1:0
} else {
// 还原默认值
filterPriceType = 1
}
this.setData({
filterType: item,
filterPriceType
})
this.init(); this.init();
} }
}, },
...@@ -233,9 +236,7 @@ const componentOptions = { ...@@ -233,9 +236,7 @@ const componentOptions = {
let query = { let query = {
categoryId: this.data.datas.componentData.categoryId, categoryId: this.data.datas.componentData.categoryId,
page: this.showRowNum() ? classificationLoadPage : 1, page: this.showRowNum() ? classificationLoadPage : 1,
rows: this.showRowNum() rows: this.data.datas.componentData.classificationLoadNum,
? this.data.classificationLoadNum
: this.getItemNum(),
sortColumn: goodsSort, sortColumn: goodsSort,
sortType: goodsSort != 2 ? 1 : 0, sortType: goodsSort != 2 ? 1 : 0,
whetherShowSoldOutGoods: this.data.datas.componentData whetherShowSoldOutGoods: this.data.datas.componentData
......
...@@ -26,30 +26,33 @@ ...@@ -26,30 +26,33 @@
<view class="btn" bindtap="init">搜索</view> <view class="btn" bindtap="init">搜索</view>
</view> </view>
<view class="filterCondition flex"> <view class="filterCondition flex">
<view class="filterItem {{filterType == -1?'activeStatus':''}}" bindtap="filterGoods" data-item="{{-1}}"> <view class="left flex">
综合 <view class="filterItem {{filterType == -1?'activeStatus':''}}" bindtap="filterGoods" data-item="{{-1}}">
</view> 综合
<view class="filterItem {{filterType == 3?'activeStatus':''}}" bindtap="filterGoods" data-item="{{3}}"> </view>
销量 <view class="filterItem {{filterType == 3?'activeStatus':''}}" bindtap="filterGoods" data-item="{{3}}">
</view> 销量
<view class="filterItem flex filterPrice {{filterType == 2?'activeStatus':''}}" bindtap="filterGoods" data-item="{{2}}"> </view>
<text>价格</text> <view class="filterItem flex filterPrice {{filterType == 2?'activeStatus':''}}" bindtap="filterGoods" data-item="{{2}}">
<view class="svgItem flex"> <text>价格</text>
<view class="arrowTop"> <view class="svgItem flex">
<m-svg src="/static/svg/arrowTop.svg" colors="{{[filterType == 2 && filterPriceType == 0?mainColor:'']}}"></m-svg> <view class="arrowTop">
</view> <m-svg src="/static/svg/arrowTop.svg" colors="{{[filterType == 2 && filterPriceType == 0?mainColor:'']}}"></m-svg>
<view class="arrowBottom"> </view>
<m-svg src="/static/svg/arrowBottom.svg" colors="{{[filterType == 2 && filterPriceType == 1?mainColor:'']}}"></m-svg> <view class="arrowBottom">
<m-svg src="/static/svg/arrowBottom.svg" colors="{{[filterType == 2 && filterPriceType == 1?mainColor:'']}}"></m-svg>
</view>
</view> </view>
</view> </view>
<view class="filterItem {{filterType == 8?'activeStatus':''}}" bindtap="filterGoods" data-item="{{8}}">
上新
</view>
</view> </view>
<view class="filterItem {{filterType == 8?'activeStatus':''}}" bindtap="filterGoods" data-item="{{8}}"> <view class="filterItem flex verticalLine">|</view>
上新 <view class="filterItem flex {{selectScreen == true?'activeStatus':''}}" bindtap="filterGoods" data-item="{{99}}">
</view> <text>筛选</text>
<view class="filterItem flex {{filterType == 99?'activeStatus':''}}" bindtap="filterGoods" data-item="{{99}}">
<text> | 筛选</text>
<view class="shaixuan"> <view class="shaixuan">
<m-svg src="/static/svg/shaixuan1.svg" colors="{{[filterType == 99?mainColor:'']}}"></m-svg> <m-svg src="/static/svg/shaixuan1.svg" colors="{{[selectScreen == true?mainColor:'']}}"></m-svg>
</view> </view>
</view> </view>
</view> </view>
...@@ -140,6 +143,10 @@ ...@@ -140,6 +143,10 @@
<view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}"> <view class="goods-heap-Item" wx:if="{{datas.componentData.style==='heap'}}">
<heap-item datas="{{datas}}"></heap-item> <heap-item datas="{{datas}}"></heap-item>
</view> </view>
<view class="noGoods" wx:if="{{datas.componentData.goodsList.length == 0 && datas.componentData.filterComponentsFlag && !loading}}">
<image mode="widthFix" src="https://cdn.mayi888.com/static/img/empty-goods.png"></image>
没有找到商品
</view>
<view <view
class="moreBottom" class="moreBottom"
bindtap="viewMore" bindtap="viewMore"
......
...@@ -50,6 +50,19 @@ image{ ...@@ -50,6 +50,19 @@ image{
transform: rotate(405deg); transform: rotate(405deg);
margin-left: 0px; margin-left: 0px;
} }
.noGoods{
font-size: 14px;
text-align: center;
padding: 10px 0 30px 0;
color: #666;
display: flex;
flex-direction: column;
align-items: center;
}
.noGoods image{
width: 40%;
margin: 20px 0;
}
.moreBottom { .moreBottom {
font-size: 13px; font-size: 13px;
text-align: center; text-align: center;
...@@ -106,14 +119,18 @@ image{ ...@@ -106,14 +119,18 @@ image{
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
} }
.filterComponents .filterCondition .left{
flex: 1;
justify-content: space-between;
}
.filterComponents .filterCondition .verticalLine {
margin: 0 10px;
}
.filterComponents .filterCondition .filterItem{ .filterComponents .filterCondition .filterItem{
font-size: 14px; font-size: 14px;
color: #999; color: #999;
align-items: center; align-items: center;
} }
.filterComponents .filterCondition .filterItem:last-child{
margin-left: 30px;
}
.filterComponents .filterCondition .filterItem:last-child .shaixuan{ .filterComponents .filterCondition .filterItem:last-child .shaixuan{
width: 14px; width: 14px;
height: 14px; height: 14px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment