商品列表筛选,贡献值筛选,贡献值图标,区块链证书信息完善,商品溯源信息新增接口,时间轴处理等细节完善
This commit is contained in:
@@ -2,12 +2,21 @@
|
||||
<view class="Goods-LISTS">
|
||||
<!-- <image :src="`${config.apiUrls}images/baodan-banner.png`" mode="widthFix" /> -->
|
||||
<view class="tabs">
|
||||
<view class="tabs-item" @click="onType" v-if="goodsType.length>0">
|
||||
{{goodsType[goodsTypeIndex].name}}
|
||||
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
|
||||
</view>
|
||||
<view class="tabs-item" :class="{'show': tabIndex == 0}" @click="onTabs" data-index="0">最新</view>
|
||||
<view class="tabs-item" :class="{'show': tabIndex == 1}" @click="onTabs" data-index="1">
|
||||
价格
|
||||
<image class="icon" mode="widthFix"
|
||||
:src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
|
||||
</view>
|
||||
<view class="tabs-item" :class="{'show': tabIndex == 2}" @click="onTabs" data-index="2">
|
||||
贡献值
|
||||
<image class="icon" mode="widthFix"
|
||||
:src="require(pvType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="lists">
|
||||
<goods-list :list="goods" priceType="CNY" @on-goods="onGoods" />
|
||||
@@ -17,7 +26,7 @@
|
||||
|
||||
<script>
|
||||
import {
|
||||
list
|
||||
list,shopself
|
||||
} from '@/apis/interfaces/goods'
|
||||
import goodsList from '@/components/goods-list/goods-list'
|
||||
import {
|
||||
@@ -33,6 +42,9 @@
|
||||
page: 1,
|
||||
has_more: true,
|
||||
isBaoDan: false, // 是否是报单,默认有id不是报单,无id是报单
|
||||
goodsType: [],
|
||||
goodsTypeIndex: 0,
|
||||
pvType:'asc'
|
||||
};
|
||||
},
|
||||
onReachBottom() {
|
||||
@@ -47,21 +59,45 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
this.getShopSelf()
|
||||
},
|
||||
onShow() {
|
||||
if (this.$Route.query.type === 'baodan') {
|
||||
this.isBaoDan = true
|
||||
uni.setNavigationBarTitle({
|
||||
title: '报单商品'
|
||||
title: '报单通证'
|
||||
})
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getShopSelf(){
|
||||
shopself().then(res => {
|
||||
this.goodsType = res
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
// 筛选自营和合作企业等条件
|
||||
onType(e) {
|
||||
uni.showActionSheet({
|
||||
itemList: this.goodsType.map((item) => item.name),
|
||||
success: e => {
|
||||
if(this.goodsTypeIndex !== e.tapIndex){
|
||||
this.goodsTypeIndex = e.tapIndex
|
||||
this.has_more = true
|
||||
this.page = 1
|
||||
this.goods = []
|
||||
this.tabIndex = ''
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
onTabs(e) {
|
||||
let index = e.target.dataset.index
|
||||
if (index == 0 && index == this.tabIndex) return
|
||||
if (index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'asc' ? 'desc' : 'asc'
|
||||
if (index == 2 && index == this.tabIndex) this.pvType = this.pvType == 'asc' ? 'desc' : 'asc'
|
||||
|
||||
this.tabIndex = index
|
||||
this.has_more = true
|
||||
this.page = 1
|
||||
@@ -83,7 +119,9 @@
|
||||
getList() {
|
||||
let data = {
|
||||
order_by: this.tabIndex == 1 ? this.marketType : '',
|
||||
page: this.page
|
||||
pv: this.tabIndex == 2 ? this.pvType : '',
|
||||
page: this.page,
|
||||
is_self:this.goodsType[this.goodsTypeIndex].id
|
||||
}
|
||||
if (this.$Route.query.type === 'id') {
|
||||
data.category_id = this.$Route.query.id
|
||||
@@ -122,7 +160,12 @@
|
||||
.tabs-item {
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray;
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.tabs-item-arrow{
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
|
||||
Reference in New Issue
Block a user