商品列表筛选,贡献值筛选,贡献值图标,区块链证书信息完善,商品溯源信息新增接口,时间轴处理等细节完善

This commit is contained in:
2021-11-03 18:36:04 +08:00
parent 416fc09bab
commit 1df114459c
10 changed files with 192 additions and 65 deletions

View File

@@ -188,6 +188,21 @@ const managesTracedTo = (id) => {
url: 'mall/goods/' + id + '/trace' url: 'mall/goods/' + id + '/trace'
}) })
} }
// 商品第一条溯源
const checkmessage = (id) => {
return request({
url: 'mall/goods/' + id + '/checkmessage'
})
}
// 商品类型 0全1自营2合作
const shopself = () => {
return request({
url: 'mall/shopself'
})
}
export { export {
managesGoodsIndex, managesGoodsIndex,
managesGoodsMint, managesGoodsMint,
@@ -212,5 +227,7 @@ export {
mallBuyGoods, mallBuyGoods,
managesChain, managesChain,
managesAttestation, managesAttestation,
managesTracedTo managesTracedTo,
checkmessage,
shopself
} }

View File

@@ -24,9 +24,10 @@
<view class="price cny" v-if="priceType === 'CNY'"> <view class="price cny" v-if="priceType === 'CNY'">
<text></text>{{item.price.price_min}} <text></text>{{item.price.price_min}}
</view> </view>
<view class="sales"> <view class="sales" v-if="item.price.pv>0">
<slot name="statistics" :value="item"> <slot name="statistics" :value="item">
月销量{{item.sales}} <!-- 月销量{{item.sales}} -->
贡献值:{{item.price.pv}} <image style="width: 30rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
</slot> </slot>
</view> </view>
</view> </view>
@@ -167,6 +168,9 @@
line-height: 50rpx; line-height: 50rpx;
text-align: right; text-align: right;
@extend .nowrap; @extend .nowrap;
display: flex;
align-items: center;
justify-content: flex-end;
} }
} }
} }

View File

@@ -283,13 +283,13 @@
"path": "pages/goods/addClassify", "path": "pages/goods/addClassify",
"name": "goodsaddClassify", "name": "goodsaddClassify",
"style": { "style": {
"navigationBarTitleText": "发布商品类目" "navigationBarTitleText": "发布权证类目"
} }
},{ },{
"path": "pages/goods/details", "path": "pages/goods/details",
"name": "goodsDetails", "name": "goodsDetails",
"style": { "style": {
"navigationBarTitleText": "商品详情", "navigationBarTitleText": "权证详情",
"navigationBarTextStyle":"white", "navigationBarTextStyle":"white",
"titleNView": { "titleNView": {
"backgroundColor": "#8b64fd", "backgroundColor": "#8b64fd",

View File

@@ -120,7 +120,7 @@
<!-- 每日推荐 --> <!-- 每日推荐 -->
<view class="block-title"> <view class="block-title">
<view class="title"> <view class="title">
每日推荐<text>小易精选 推荐好物</text> 每日推荐<text>链商精选 推荐好物</text>
</view> </view>
</view> </view>
<view class="goods-push" v-if="JSON.stringify(position) != '{}'"> <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> <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}} {{position.one.name}}
</view> </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> <span class='is_self' v-if='position.one.specal_tags.is_self'>{{position.one.specal_tags.is_self}}</span>
</view> </view>
<view class="itme"> <view class="itme">
<view class="itme-list" v-for="(item, index) in position.two" :key="index" @click="onGoods(item)"> <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> <image class="cover" :src="item.cover" mode="aspectFill"></image>
<view class="title">{{item.name}}</view> <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 class="price"><text>¥</text>{{item.original_price}}</view>
</view> </view>
</view> </view>
@@ -596,7 +603,7 @@
.title { .title {
font-size: $title-size-lg; font-size: $title-size-lg;
@extend .nowrap; @extend .nowrap;
line-height: 60rpx; line-height: 50rpx;
} }
.price { .price {

View File

@@ -1,21 +1,30 @@
<template> <template>
<view> <view v-if="loaded">
<view class="top"> <view class="top">
<view class="search"> <view class="search">
<input class="search-input" type="text" focus @input="onInput" :placeholder="nameVal" /> <input class="search-input" type="text" focus @input="onInput" :placeholder="nameVal" />
<view class="search-btn" @click="searchClick">搜索</view> <view class="search-btn" @click="searchClick">搜索</view>
</view> </view>
<view class="tabs"> <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"> <view class="tabs-item" @click="onTabs">
{{searchType == 0 ? '价格' : '信用值'}} <span :class="marketType === ''?'':'activess'">{{searchType == 0 ? '价格' : '信用值'}}</span>
<image class="icon" mode="widthFix" <image class="icon" mode="widthFix"
:src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" /> :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
</view> </view>
<view class="tabs-item" v-if="searchType == 0" @click="pageUrl">全部分类 <image class="tabs-item-arrow" <view class="tabs-item" @click="onPv">
src="@/static/icons/search_row.png" mode=""></image> <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>
<view class="tabs-item" v-if="searchType == 1" @click="companyOpne">{{companyName}} <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> </view>
</view> </view>
@@ -45,7 +54,8 @@
import { import {
searchUrl, searchUrl,
companyCategory, companyCategory,
randgoodsUrl randgoodsUrl,
shopself
} from '@/apis/interfaces/goods' } from '@/apis/interfaces/goods'
export default { export default {
data() { data() {
@@ -54,18 +64,22 @@
searchArr: [], searchArr: [],
searchType: '0', // 分类 0位商品 1为企业 searchType: '0', // 分类 0位商品 1为企业
marketType: 'asc', // 排序 marketType: 'asc', // 排序
pvType:'asc',
categoryArr: [], // 分类数组--企业 categoryArr: [], // 分类数组--企业
companyId: '', // 分类数组--企业id companyId: '', // 分类数组--企业id
companyName: '选择行业', companyName: '选择行业',
companyShow: false, companyShow: false,
goodsType: [],
goodsTypeIndex: 0,
// 分页 // 分页
pageStatus: '', pageStatus: '',
page: 1 page: 1,
loaded:false
} }
}, },
onLoad() { onLoad() {
this.searchType = this.$Route.query.type this.searchType = this.$Route.query.type
this.getShopSelf()
// 商品分类默认关键字 type=0为商品列表; type=1为企业列表 // 商品分类默认关键字 type=0为商品列表; type=1为企业列表
let wechaUrl = '' // 定义接口来源名称 let wechaUrl = '' // 定义接口来源名称
if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字 if (this.searchType == '0') wechaUrl = 'mall/randgoods' //商品关键字
@@ -82,8 +96,27 @@
this.categoryArr = res this.categoryArr = res
}) })
} }
}, },
methods: { 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) { onGoods(e) {
this.$Router.push({ this.$Router.push({
@@ -131,7 +164,9 @@
page: this.goodsPage, page: this.goodsPage,
order_by: this.marketType, order_by: this.marketType,
industry_id: this.companyId, industry_id: this.companyId,
name: this.nameVal name: this.nameVal,
is_self:this.goodsType[this.goodsTypeIndex].id,
pv:this.pvType
}).then(res => { }).then(res => {
if (res.page.current === 1) { if (res.page.current === 1) {
this.searchArr = [] this.searchArr = []
@@ -156,6 +191,13 @@
// 筛选产品 // 筛选产品
onTabs(e) { onTabs(e) {
this.marketType = this.marketType == 'asc' ? 'desc' : 'asc' this.marketType = this.marketType == 'asc' ? 'desc' : 'asc'
this.pvType = ''
this.getList()
},
onPv(){
this.pvType = this.pvType == 'asc' ? 'desc' : 'asc'
this.marketType = ''
this.getList() this.getList()
}, },
@@ -242,7 +284,9 @@
.tabs-item { .tabs-item {
font-size: $title-size-m; font-size: $title-size-m;
color: $text-gray; color: $text-gray;
.activess{
color: $main-color;
}
.icon { .icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;

View File

@@ -3,58 +3,58 @@
<view class="authenticationTop">区块链溯源码{{info.token}}</view> <view class="authenticationTop">区块链溯源码{{info.token}}</view>
<!-- 商品认证 商品和服务 --> <!-- 商品认证 商品和服务 -->
<view class="authenticationItem"> <view class="authenticationItem">
<view class="authenticationItemTitle">商品认证</view> <view class="authenticationItemTitle">权证认证</view>
<view class="authenticationItemcontent" v-if="info.goods"> <view class="authenticationItemcontent" v-if="info.goods">
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.goods.name">
<view class="title">{{info.goods.type ===1?'商品名称':'项目名称'}}: </view> <view class="title">{{info.goods.type ===1?'权证名称':'项目名称'}}: </view>
<view class="content">{{info.goods.name || '暂无数据'}}</view> <view class="content">{{info.goods.name || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1"> <view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.batch">
<view class="title">生产批次</view> <view class="title">生产批次</view>
<view class="content">{{info.goods.batch || '暂无数据'}}</view> <view class="content">{{info.goods.batch || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===2"> <view class="authenticationItemcontentItem" v-if="info.goods.type ===2 && info.goods.category">
<view class="title">项目分类</view> <view class="title">项目分类</view>
<view class="content">{{info.goods.category || '暂无数据'}}</view> <view class="content">{{info.goods.category || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1"> <view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.skus[0].unit">
<view class="title">规格</view> <view class="title">规格</view>
<view class="content">{{info.goods.skus[0].unit || '暂无数据'}}</view> <view class="content">{{info.goods.skus[0].unit || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.goods.skus[0].stock">
<view class="title">数量</view> <view class="title">数量</view>
<view class="content">{{info.goods.skus[0].stock || '暂无数据'}}</view> <view class="content">{{info.goods.skus[0].stock || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.goods.skus[0].price">
<view class="title">售价</view> <view class="title">售价</view>
<view class="content">{{info.goods.skus[0].price || '暂无数据'}}</view> <view class="content">{{info.goods.skus[0].price || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1"> <view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.producted_at">
<view class="title">生产日期</view> <view class="title">生产日期</view>
<view class="content">{{info.goods.producted_at || '暂无数据'}}</view> <view class="content">{{info.goods.producted_at || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.goods.expiried_at">
<view class="title">{{info.goods.type ===1?'保质期':'有效期'}}</view> <view class="title">{{info.goods.type ===1?'保质期':'有效期'}}</view>
<view class="content">{{info.goods.expiried_at || '暂无数据'}}</view> <view class="content">{{info.goods.expiried_at || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1"> <view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.product_name">
<view class="title">生产厂家</view> <view class="title">生产厂家</view>
<view class="content">{{info.goods.product_name || '暂无数据'}}</view> <view class="content">{{info.goods.product_name || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1"> <view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.product_address">
<view class="title">生产地</view> <view class="title">生产地</view>
<view class="content">{{info.goods.product_address || '暂无数据'}}</view> <view class="content">{{info.goods.product_address || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <!-- <view class="authenticationItemcontentItem" v-if="info.goods.type ===2 && info.goods.product_name">
<view class="title">供应商</view> <view class="title">供应商</view>
<view class="content">{{info.goods.skus[0].price || '暂无数据'}}</view> <view class="content">{{info.goods.product_name || '暂无数据'}}</view>
</view> </view> -->
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.goods.lisence">
<view class="title">经营许可证</view> <view class="title">经营许可证</view>
<view class="content">{{info.goods.lisence || '暂无数据'}}</view> <view class="content">{{info.goods.lisence || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.goods.cover">
<view class="title">实物照片</view> <view class="title">实物照片</view>
<image class="img" v-if="info.goods.cover" :src="info.goods.cover" <image class="img" v-if="info.goods.cover" :src="info.goods.cover"
@click="priveImg(info.goods.cover)" mode="aspectFill" /> @click="priveImg(info.goods.cover)" mode="aspectFill" />
@@ -67,34 +67,34 @@
<view class="authenticationItem"> <view class="authenticationItem">
<view class="authenticationItemTitle">企业认证</view> <view class="authenticationItemTitle">企业认证</view>
<view class="authenticationItemcontent" v-if="info.certification"> <view class="authenticationItemcontent" v-if="info.certification">
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.name ">
<view class="title">企业名称</view> <view class="title">企业名称</view>
<view class="content">{{info.certification.name || '暂无数据'}}</view> <view class="content">{{info.certification.name || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.address" >
<view class="title">企业地址</view> <view class="title">企业地址</view>
<view class="content">{{info.certification.address || '暂无数据'}}</view> <view class="content">{{info.certification.address || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.certification.code">
<view class="title">统一信用代码</view> <view class="title">统一信用代码</view>
<view class="content">{{info.certification.certification.code || '暂无数据'}}</view> <view class="content">{{info.certification.certification.code || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.industry.title">
<view class="title">行业</view> <view class="title">行业</view>
<view class="content">{{info.certification.industry.title || '暂无数据'}}</view> <view class="content">{{info.certification.industry.title || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.range">
<view class="title">经营范围</view> <view class="title">经营范围</view>
<view class="content">{{info.certification.range || '暂无数据'}}</view> <view class="content">{{info.certification.range || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.contack">
<view class="title">联系电话</view> <view class="title">联系电话</view>
<u-icon name="phone-fill" v-if='info.certification.contack' <u-icon name="phone-fill" v-if='info.certification.contack'
@click="call(info.certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26" @click="call(info.certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26"
:label='info.certification.contact' /> :label='info.certification.contact' />
<view class="content" v-else> 暂无数据 </view> <view class="content" v-else> 暂无数据 </view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="info.certification.certification.license">
<view class="title">营业执照</view> <view class="title">营业执照</view>
<image class="img" v-if='info.certification.certification.license' <image class="img" v-if='info.certification.certification.license'
:src="info.certification.certification.license" :src="info.certification.certification.license"

View File

@@ -3,20 +3,20 @@
<image src="https://e-chain.cnskl.com/storage/imageresource/chain-bg.png" class='chainBg' /> <image src="https://e-chain.cnskl.com/storage/imageresource/chain-bg.png" class='chainBg' />
<view class="chain-content"> <view class="chain-content">
<view class="chain-center"> <view class="chain-center">
<image src="/static/icons/e-logo.png" mode="aspectFill" class="logo" /> <image :src="imgUrl+'images/top_logo.png'" mode="aspectFill" class="logo" />
<view class="name">易品新境区块链溯源证书</view> <view class="name">链商星球区块链溯源证书</view>
<view class="no">区块链溯源证书{{info.token}}</view> <view class="no">区块链溯源证书{{info.token}}</view>
<view class="content"> <view class="content">
<view class="con-item">兹证明</view> <view class="con-item">兹证明</view>
<view class="con-item" v-if="info.company"> <view class="con-item" v-if="info.company">
{{info.company.name}}产品符合溯源规范认证内容如下特授权其产品在易品新境区块链溯源商城出售 {{info.company.name}}产品符合溯源规范认证内容如下特授权其产品在链商星球区块链溯源商城出售
</view> </view>
<view class="con-item">交易哈希: {{info.hash}}</view> <view class="con-item">交易哈希: {{info.hash}}</view>
<view class="con-item">区块链高度: {{info.height}}</view> <view class="con-item">区块链高度: {{info.height}}</view>
</view> </view>
<view class="date" v-if="info.applied_at">授权时间: {{info.applied_at}}</view> <view class="date" v-if="info.applied_at">授权时间: {{info.applied_at}}</view>
<view class="date">有效期至: {{info.ended_at}}</view> <view class="date">有效期至: {{info.ended_at}}</view>
<view class="companyInfo">易品新境区块链有限公司</view> <view class="companyInfo">安徽星煌数字科技有限公司</view>
</view> </view>
</view> </view>
<!-- 弹窗提示喽 --> <!-- 弹窗提示喽 -->
@@ -26,10 +26,12 @@
<script> <script>
import { managesChain } from '@/apis/interfaces/goods' import { managesChain } from '@/apis/interfaces/goods'
import {config} from '@/apis/index.js'
export default { export default {
data() { data() {
return { return {
info: '' info: '',
imgUrl:config.apiUrls
} }
}, },
created() { created() {

View File

@@ -33,6 +33,9 @@
</view> </view>
<view class="title-hot" v-if="goodsObj.specal_tags.is_self">{{goodsObj.specal_tags.is_self}}</view> <view class="title-hot" v-if="goodsObj.specal_tags.is_self">{{goodsObj.specal_tags.is_self}}</view>
{{goodsObj.name}} {{goodsObj.name}}
<span style='font-size: 26rpx;color: #999;font-weight: normal;padding-left: 20rpx;' v-if='goodsObj.price.pv>0'>
贡献值:<span>{{goodsObj.price.pv}}</span><image style="width: 20rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
</span>
</view> </view>
<!-- <view class="sub-title">{{goodsObj.description}}</view> --> <!-- <view class="sub-title">{{goodsObj.description}}</view> -->
</view> </view>
@@ -58,13 +61,13 @@
</view> </view>
<view class="tooSee-label" <view class="tooSee-label"
@click="$Router.push({name: 'GoodsAttestation', params: {id: goodsObj.goods_id}})"> @click="$Router.push({name: 'GoodsAttestation', params: {id: goodsObj.goods_id}})">
商品认证 权证认证
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png" <image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image> mode="aspectFill"></image>
</view> </view>
<view class="tooSee-label" <view class="tooSee-label"
@click="$Router.push({name: 'GoodstracedTo', params: {id: goodsObj.goods_id}})"> @click="$Router.push({name: 'GoodstracedTo', params: {id: goodsObj.goods_id}})">
商品溯源 权证溯源
<image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png" <image class="tooSee-label-img" src="../../static/icons/equity_arrow_right.png"
mode="aspectFill"></image> mode="aspectFill"></image>
</view> </view>

View File

@@ -2,12 +2,21 @@
<view class="Goods-LISTS"> <view class="Goods-LISTS">
<!-- <image :src="`${config.apiUrls}images/baodan-banner.png`" mode="widthFix" /> --> <!-- <image :src="`${config.apiUrls}images/baodan-banner.png`" mode="widthFix" /> -->
<view class="tabs"> <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 == 0}" @click="onTabs" data-index="0">最新</view>
<view class="tabs-item" :class="{'show': tabIndex == 1}" @click="onTabs" data-index="1"> <view class="tabs-item" :class="{'show': tabIndex == 1}" @click="onTabs" data-index="1">
价格 价格
<image class="icon" mode="widthFix" <image class="icon" mode="widthFix"
:src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" /> :src="require(marketType == 'asc' ? '@/static/icons/market_icon_low.png': '@/static/icons/market_icon_high.png')" />
</view> </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>
<view class="lists"> <view class="lists">
<goods-list :list="goods" priceType="CNY" @on-goods="onGoods" /> <goods-list :list="goods" priceType="CNY" @on-goods="onGoods" />
@@ -17,7 +26,7 @@
<script> <script>
import { import {
list list,shopself
} from '@/apis/interfaces/goods' } from '@/apis/interfaces/goods'
import goodsList from '@/components/goods-list/goods-list' import goodsList from '@/components/goods-list/goods-list'
import { import {
@@ -33,6 +42,9 @@
page: 1, page: 1,
has_more: true, has_more: true,
isBaoDan: false, // 是否是报单默认有id不是报单无id是报单 isBaoDan: false, // 是否是报单默认有id不是报单无id是报单
goodsType: [],
goodsTypeIndex: 0,
pvType:'asc'
}; };
}, },
onReachBottom() { onReachBottom() {
@@ -47,21 +59,45 @@
} }
}, },
created() { created() {
this.getList() this.getShopSelf()
}, },
onShow() { onShow() {
if (this.$Route.query.type === 'baodan') { if (this.$Route.query.type === 'baodan') {
this.isBaoDan = true this.isBaoDan = true
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: '报单商品' title: '报单通证'
}) })
} }
}, },
methods: { 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) { onTabs(e) {
let index = e.target.dataset.index let index = e.target.dataset.index
if (index == 0 && index == this.tabIndex) return if (index == 0 && index == this.tabIndex) return
if (index == 1 && index == this.tabIndex) this.marketType = this.marketType == 'asc' ? 'desc' : 'asc' 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.tabIndex = index
this.has_more = true this.has_more = true
this.page = 1 this.page = 1
@@ -83,7 +119,9 @@
getList() { getList() {
let data = { let data = {
order_by: this.tabIndex == 1 ? this.marketType : '', 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') { if (this.$Route.query.type === 'id') {
data.category_id = this.$Route.query.id data.category_id = this.$Route.query.id
@@ -122,7 +160,12 @@
.tabs-item { .tabs-item {
font-size: $title-size-m; font-size: $title-size-m;
color: $text-gray; color: $text-gray;
display: flex;
align-items: center;
.tabs-item-arrow{
width: 32rpx;
height: 32rpx;
}
.icon { .icon {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;

View File

@@ -4,7 +4,8 @@
<!-- 进度条 --> <!-- 进度条 -->
<view v-if='list.length>0' class='timeAxis'> <view v-if='list.length>0' class='timeAxis'>
<view class="box-top" v-for="(item,index) in list" :key="index"> <view class="box-top" v-for="(item,index) in list" :key="index">
<view class="left-box-top"><span>商品交易</span>{{item.blockTime}}</view> <!-- 左边 --> <view class="left-box-top"><span>{{index === list.length - 1?item.note:'权证交易'}}</span>{{item.blockTime}}</view>
<!-- 左边 -->
<view class="line" :class="{active:true,none:index==(list.length-1)}"> <view class="line" :class="{active:true,none:index==(list.length-1)}">
<!-- 中线 --> <!-- 中线 -->
<view class="dot" :class="{active:true}"></view><!-- 圆点 --> <view class="dot" :class="{active:true}"></view><!-- 圆点 -->
@@ -23,7 +24,7 @@
<view class="content">{{item.goods.skus.unit}}</view> <view class="content">{{item.goods.skus.unit}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem">
<view class="title">购买数量</view> <view class="title">{{index === list.length - 1?'初始发行量':'交易数量'}}</view>
<view class="content">{{item.amount}}</view> <view class="content">{{item.amount}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem">
@@ -49,7 +50,8 @@
<script> <script>
import { import {
managesTracedTo managesTracedTo,
checkmessage
} from '@/apis/interfaces/goods' } from '@/apis/interfaces/goods'
export default { export default {
data() { data() {
@@ -59,11 +61,16 @@
} }
}, },
created() { created() {
managesTracedTo(this.$Route.query.id).then(res => { managesTracedTo(this.$Route.query.id).then(res1 => {
console.log(res) console.log(res1)
this.list = res.list this.list= res1.list
this.info = res this.info = res1
checkmessage(this.$Route.query.id).then(res => {
this.list.push(res)
}) })
})
}, },
methods: { methods: {
priveImg(img) { priveImg(img) {
@@ -102,7 +109,7 @@
margin-bottom: 40rpx; margin-bottom: 40rpx;
} }
// 商品认证 // 通证认证
.authenticationItem { .authenticationItem {
width: 100%; width: 100%;
min-height: 300rpx; min-height: 300rpx;
@@ -169,7 +176,7 @@
width: calc(100% - 170rpx); width: calc(100% - 170rpx);
padding: 0 0 20rpx 0; padding: 0 0 20rpx 0;
// 商品认证 // 通证认证
.authenticationItem { .authenticationItem {
width: 100%; width: 100%;
@@ -220,7 +227,7 @@
//激活元素 //激活元素
.active { .active {
background-color: #c82626 !important; background-color: #8b64fd !important;
} }
// 隐藏元素 // 隐藏元素