商品列表筛选,贡献值筛选,贡献值图标,区块链证书信息完善,商品溯源信息新增接口,时间轴处理等细节完善
This commit is contained in:
@@ -120,7 +120,7 @@
|
||||
<!-- 每日推荐 -->
|
||||
<view class="block-title">
|
||||
<view class="title">
|
||||
每日推荐<text>小易精选 推荐好物</text>
|
||||
每日推荐<text>链商精选 推荐好物</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-push" v-if="JSON.stringify(position) != '{}'">
|
||||
@@ -130,13 +130,20 @@
|
||||
<span class='is_allow_values' v-if='position.one.specal_tags.is_allow_values'>{{position.one.specal_tags.is_allow_values}}</span>
|
||||
{{position.one.name}}
|
||||
</view>
|
||||
<view class="price"><text>¥</text>{{position.one.original_price}}</view>
|
||||
<view class="price"><text>¥</text>{{position.one.original_price}}
|
||||
<span style='font-size: 26rpx;color: #555;font-weight: normal;padding-left: 10rpx;' v-if='position.one.price.pv>0'>
|
||||
贡献值:<span>{{position.one.price.pv}}</span><image style="width: 20rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
|
||||
</span>
|
||||
</view>
|
||||
<span class='is_self' v-if='position.one.specal_tags.is_self'>{{position.one.specal_tags.is_self}}</span>
|
||||
</view>
|
||||
<view class="itme">
|
||||
<view class="itme-list" v-for="(item, index) in position.two" :key="index" @click="onGoods(item)">
|
||||
<image class="cover" :src="item.cover" mode="aspectFill"></image>
|
||||
<view class="title">{{item.name}}</view>
|
||||
<view style='font-size: 26rpx;color: #999;font-weight: normal;' v-if='item.price.pv>0'>
|
||||
贡献值:<span>{{item.price.pv}}</span><image style="width: 20rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
<view class="price"><text>¥</text>{{item.original_price}}</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -596,7 +603,7 @@
|
||||
.title {
|
||||
font-size: $title-size-lg;
|
||||
@extend .nowrap;
|
||||
line-height: 60rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
|
||||
.price {
|
||||
|
||||
@@ -1,21 +1,30 @@
|
||||
<template>
|
||||
<view>
|
||||
<view v-if="loaded">
|
||||
<view class="top">
|
||||
<view class="search">
|
||||
<input class="search-input" type="text" focus @input="onInput" :placeholder="nameVal" />
|
||||
<view class="search-btn" @click="searchClick">搜索</view>
|
||||
</view>
|
||||
<view class="tabs">
|
||||
<view class="tabs-item" @click="onType">
|
||||
{{goodsType[goodsTypeIndex].name || ''}}
|
||||
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
|
||||
</view>
|
||||
<view class="tabs-item" @click="onTabs">
|
||||
{{searchType == 0 ? '价格' : '信用值'}}
|
||||
<span :class="marketType === ''?'':'activess'">{{searchType == 0 ? '价格' : '信用值'}}</span>
|
||||
<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" v-if="searchType == 0" @click="pageUrl">全部分类 <image class="tabs-item-arrow"
|
||||
src="@/static/icons/search_row.png" mode=""></image>
|
||||
<view class="tabs-item" @click="onPv">
|
||||
<span :class="pvType === ''?'':'activess'">贡献值</span>
|
||||
<image class="icon" mode="widthFix"
|
||||
:src="require(pvType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
|
||||
</view>
|
||||
<view class="tabs-item" v-if="searchType == 0" @click="pageUrl">全部分类
|
||||
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
|
||||
</view>
|
||||
<view class="tabs-item" v-if="searchType == 1" @click="companyOpne">{{companyName}}
|
||||
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode=""></image>
|
||||
<image class="tabs-item-arrow" src="@/static/icons/search_row.png" mode="" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -45,7 +54,8 @@
|
||||
import {
|
||||
searchUrl,
|
||||
companyCategory,
|
||||
randgoodsUrl
|
||||
randgoodsUrl,
|
||||
shopself
|
||||
} from '@/apis/interfaces/goods'
|
||||
export default {
|
||||
data() {
|
||||
@@ -54,18 +64,22 @@
|
||||
searchArr: [],
|
||||
searchType: '0', // 分类 0位商品 1为企业
|
||||
marketType: 'asc', // 排序
|
||||
pvType:'asc',
|
||||
categoryArr: [], // 分类数组--企业
|
||||
companyId: '', // 分类数组--企业id
|
||||
companyName: '选择行业',
|
||||
companyShow: false,
|
||||
|
||||
goodsType: [],
|
||||
goodsTypeIndex: 0,
|
||||
// 分页
|
||||
pageStatus: '',
|
||||
page: 1
|
||||
page: 1,
|
||||
loaded:false
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.searchType = this.$Route.query.type
|
||||
this.getShopSelf()
|
||||
// 商品分类默认关键字 type=0为商品列表; type=1为企业列表
|
||||
let wechaUrl = '' // 定义接口来源名称
|
||||
if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字
|
||||
@@ -82,8 +96,27 @@
|
||||
this.categoryArr = res
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
getShopSelf(){
|
||||
shopself().then(res => {
|
||||
this.goodsType = res
|
||||
this.loaded = true
|
||||
})
|
||||
},
|
||||
// 筛选自营和合作企业等条件
|
||||
onType(e) {
|
||||
uni.showActionSheet({
|
||||
itemList: this.goodsType.map((item) => item.name),
|
||||
success: e => {
|
||||
if(this.goodsTypeIndex !== e.tapIndex){
|
||||
this.goodsTypeIndex = e.tapIndex
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 商品详情
|
||||
onGoods(e) {
|
||||
this.$Router.push({
|
||||
@@ -131,7 +164,9 @@
|
||||
page: this.goodsPage,
|
||||
order_by: this.marketType,
|
||||
industry_id: this.companyId,
|
||||
name: this.nameVal
|
||||
name: this.nameVal,
|
||||
is_self:this.goodsType[this.goodsTypeIndex].id,
|
||||
pv:this.pvType
|
||||
}).then(res => {
|
||||
if (res.page.current === 1) {
|
||||
this.searchArr = []
|
||||
@@ -156,6 +191,13 @@
|
||||
// 筛选产品
|
||||
onTabs(e) {
|
||||
this.marketType = this.marketType == 'asc' ? 'desc' : 'asc'
|
||||
this.pvType = ''
|
||||
this.getList()
|
||||
},
|
||||
|
||||
onPv(){
|
||||
this.pvType = this.pvType == 'asc' ? 'desc' : 'asc'
|
||||
this.marketType = ''
|
||||
this.getList()
|
||||
},
|
||||
|
||||
@@ -242,7 +284,9 @@
|
||||
.tabs-item {
|
||||
font-size: $title-size-m;
|
||||
color: $text-gray;
|
||||
|
||||
.activess{
|
||||
color: $main-color;
|
||||
}
|
||||
.icon {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
|
||||
Reference in New Issue
Block a user