[发布商品认证及商品认证展示,详情页面水晶展示位置]

This commit is contained in:
2021-11-26 11:33:51 +08:00
parent c85f1bccc0
commit 47667b9177
7 changed files with 344 additions and 272 deletions

View File

@@ -1,104 +1,59 @@
<template>
<view class="GoodsAuthentication">
<view class="authenticationTop">区块链溯源码{{info.token}}</view>
<view class="GoodsAuthentication" v-if="loaded">
<view class="authenticationTop">商品认证溯源码{{token}}</view>
<!-- 商品认证 商品和服务 -->
<view class="authenticationItem">
<view class="authenticationItemTitle">权证认证</view>
<view class="authenticationItemcontent" v-if="info.goods">
<view class="authenticationItemcontentItem" v-if="info.goods.name">
<view class="title">{{info.goods.type ===1 ? '权证名称':'项目名称'}}: </view>
<view class="content">{{info.goods.name || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.batch">
<view class="title">生产批次</view>
<view class="content">{{info.goods.batch || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===2 && info.goods.category">
<view class="title">项目分类</view>
<view class="content">{{info.goods.category || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.skus[0].unit">
<view class="title">规格</view>
<view class="content">{{info.goods.skus[0].unit || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.skus[0].stock">
<view class="title">数量</view>
<view class="content">{{info.goods.skus[0].stock || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.skus[0].price">
<view class="title">售价</view>
<view class="content">{{info.goods.skus[0].price || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.producted_at">
<view class="title">生产日期</view>
<view class="content">{{info.goods.producted_at || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.expiried_at">
<view class="title">{{info.goods.type ===1?'保质期':'有效期'}}</view>
<view class="content">{{info.goods.expiried_at || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.product_name">
<view class="title">生产厂家</view>
<view class="content">{{info.goods.product_name || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.product_address">
<view class="title">生产地</view>
<view class="content">{{info.goods.product_address || '暂无数据'}}</view>
</view>
<!-- <view class="authenticationItemcontentItem" v-if="info.goods.type ===2 && info.goods.product_name">
<view class="title">供应商</view>
<view class="content">{{info.goods.product_name || '暂无数据'}}</view>
</view> -->
<view class="authenticationItemcontentItem" v-if="info.goods.lisence">
<view class="title">经营许可证</view>
<view class="content">{{info.goods.lisence || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.goods.cover">
<view class="title">实物照片</view>
<image class="img" v-if="info.goods.cover" :src="info.goods.cover"
@click="priveImg(info.goods.cover)" mode="aspectFill" />
<view class="content" v-else>暂无数据</view>
</view>
<view class="authenticationItemcontent">
<block v-for="(item,index) in goods" :key='index'>
<view class="authenticationItemcontentItem" >
<view class="title">{{item.title}}</view>
<view class="content" v-if="item.type !== 2">{{item.value || '暂无数据~'}}</view>
<block v-if="item.type === 2">
<image class="img" v-if="item.value" :src="item.value" @click="priveImg(item.value)" mode="aspectFill" />
<view class="content" v-else>暂无数据~</view>
</block>
</view>
</block>
</view>
</view>
<!-- 企业认证 商品和服务通用 -->
<view class="authenticationItem">
<view class="authenticationItemTitle">企业认证</view>
<view class="authenticationItemcontent" v-if="info.certification">
<view class="authenticationItemcontentItem" v-if="info.certification.name ">
<view class="authenticationItemcontent" v-if="certification">
<view class="authenticationItemcontentItem" v-if="certification.name ">
<view class="title">企业名称</view>
<view class="content">{{info.certification.name || '暂无数据'}}</view>
<view class="content">{{certification.name || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.address" >
<view class="authenticationItemcontentItem" v-if="certification.address" >
<view class="title">企业地址</view>
<view class="content">{{info.certification.address || '暂无数据'}}</view>
<view class="content">{{certification.address || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.certification.code">
<view class="authenticationItemcontentItem" v-if="certification.certification.code">
<view class="title">统一信用代码</view>
<view class="content">{{info.certification.certification.code || '暂无数据'}}</view>
<view class="content">{{certification.certification.code || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.industry.title">
<view class="authenticationItemcontentItem" v-if="certification.industry.title">
<view class="title">行业</view>
<view class="content">{{info.certification.industry.title || '暂无数据'}}</view>
<view class="content">{{certification.industry.title || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.range">
<view class="authenticationItemcontentItem" v-if="certification.range">
<view class="title">经营范围</view>
<view class="content">{{info.certification.range || '暂无数据'}}</view>
<view class="content">{{certification.range || '暂无数据'}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.contack">
<view class="authenticationItemcontentItem" v-if="certification.contack">
<view class="title">联系电话</view>
<u-icon name="phone-fill" v-if='info.certification.contack'
@click="call(info.certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26"
:label='info.certification.contact' />
<u-icon name="phone-fill" v-if='certification.contack'
@click="call(certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26"
:label='certification.contact' />
<view class="content" v-else> 暂无数据 </view>
</view>
<view class="authenticationItemcontentItem" v-if="info.certification.certification.license">
<view class="authenticationItemcontentItem" v-if="certification.certification.license">
<view class="title">营业执照</view>
<image class="img" v-if='info.certification.certification.license'
:src="info.certification.certification.license"
@click="priveImg(info.certification.certification.license)" mode="aspectFill" />
<image class="img" v-if='certification.certification.license'
:src="certification.certification.license"
@click="priveImg(certification.certification.license)" mode="aspectFill" />
<view class="content" v-else>暂无数据</view>
</view>
</view>
@@ -116,18 +71,28 @@
export default {
data() {
return {
info: ''
token:"",
certification: {},
goods:[],
loaded:false
}
},
created() {
managesAttestation(this.$Route.query.id).then(res => {
this.info = res
this.$nextTick(() => {
this.certification = res.certification
this.goods = res.goods
this.token = res.token
this.loaded = true
})
})
},
methods: {
priveImg(img) {
uni.previewImage({
current: img, // 当前显示图片的http链接
longPressActions: {
itemList: []
},
urls: [img] // 需要预览的图片http链接列表
})
},