This commit is contained in:
zhangmanman
2021-11-30 15:09:57 +08:00
9 changed files with 1397 additions and 1326 deletions

View File

@@ -184,9 +184,12 @@ const managesAttestation = (id) => {
} }
// 商品溯源 // 商品溯源
const managesTracedTo = (id) => { const managesTracedTo = (id,page) => {
return request({ return request({
url: 'mall/goods/' + id + '/trace' url: 'mall/goods/' + id + '/trace',
data:{
page: page
}
}) })
} }
// 商品第一条溯源 // 商品第一条溯源
@@ -203,6 +206,12 @@ const shopself = () => {
}) })
} }
// 商品服务类型调整
const goodsExtendsCreate = (id) => {
return request({
url: 'manages/goods/' + id + '/extends/create'
})
}
export { export {
managesGoodsIndex, managesGoodsIndex,
@@ -230,5 +239,6 @@ export {
managesAttestation, managesAttestation,
managesTracedTo, managesTracedTo,
checkmessage, checkmessage,
shopself shopself,
goodsExtendsCreate
} }

View File

@@ -39,7 +39,6 @@
"color": "#fff" "color": "#fff"
}] }]
} }
} }
} }
}, { }, {

View File

@@ -11,8 +11,10 @@
export default { export default {
data() { data() {
return { return {
}; };
},
mounted() {
let i = "dsadsa"
} }
} }
</script> </script>

View File

@@ -1,104 +1,59 @@
<template> <template>
<view class="GoodsAuthentication"> <view class="GoodsAuthentication" v-if="loaded">
<view class="authenticationTop">区块链溯源码{{info.token}}</view> <view class="authenticationTop">商品认证溯源码{{token}}</view>
<!-- 商品认证 商品和服务 --> <!-- 商品认证 商品和服务 -->
<view class="authenticationItem"> <view class="authenticationItem" v-if="goods.length>0">
<view class="authenticationItemTitle">权证认证</view> <view class="authenticationItemTitle">权证认证</view>
<view class="authenticationItemcontent" v-if="info.goods"> <view class="authenticationItemcontent">
<view class="authenticationItemcontentItem" v-if="info.goods.name"> <block v-for="(item,index) in goods" :key='index'>
<view class="title">{{info.goods.type ===1 ? '权证名称':'项目名称'}}: </view> <view class="authenticationItemcontentItem" >
<view class="content">{{info.goods.name || '暂无数据'}}</view> <view class="title">{{item.title}}</view>
</view> <view class="content" v-if="item.type !== 2">{{item.value || '暂无数据~'}}</view>
<view class="authenticationItemcontentItem" v-if="info.goods.type ===1 && info.goods.batch"> <block v-if="item.type === 2">
<view class="title">生产批次</view> <image class="img" v-if="item.value" :src="item.value" @click="priveImg(item.value)" mode="aspectFill" />
<view class="content">{{info.goods.batch || '暂无数据'}}</view> <view class="content" v-else>暂无数据~</view>
</view> </block>
<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>
</block>
</view> </view>
</view> </view>
<!-- 企业认证 商品和服务通用 --> <!-- 企业认证 商品和服务通用 -->
<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="certification">
<view class="authenticationItemcontentItem" v-if="info.certification.name "> <view class="authenticationItemcontentItem" v-if="certification.name ">
<view class="title">企业名称</view> <view class="title">企业名称</view>
<view class="content">{{info.certification.name || '暂无数据'}}</view> <view class="content">{{certification.name || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.certification.address" > <view class="authenticationItemcontentItem" v-if="certification.address" >
<view class="title">企业地址</view> <view class="title">企业地址</view>
<view class="content">{{info.certification.address || '暂无数据'}}</view> <view class="content">{{certification.address || '暂无数据'}}</view>
</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="title">统一信用代码</view>
<view class="content">{{info.certification.certification.code || '暂无数据'}}</view> <view class="content">{{certification.certification.code || '暂无数据'}}</view>
</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="title">行业</view>
<view class="content">{{info.certification.industry.title || '暂无数据'}}</view> <view class="content">{{certification.industry.title || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.certification.range"> <view class="authenticationItemcontentItem" v-if="certification.range">
<view class="title">经营范围</view> <view class="title">经营范围</view>
<view class="content">{{info.certification.range || '暂无数据'}}</view> <view class="content">{{certification.range || '暂无数据'}}</view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.certification.contack"> <view class="authenticationItemcontentItem" v-if="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='certification.contack'
@click="call(info.certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26" @click="call(certification.contact)" color="#2979ff" label-color="#2979ff" label-size="26"
:label='info.certification.contact' /> :label='certification.contact' />
<view class="content" v-else> 暂无数据 </view> <view class="content" v-else> 暂无数据 </view>
</view> </view>
<view class="authenticationItemcontentItem" v-if="info.certification.certification.license"> <view class="authenticationItemcontentItem" v-if="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='certification.certification.license'
:src="info.certification.certification.license" :src="certification.certification.license"
@click="priveImg(info.certification.certification.license)" mode="aspectFill" /> @click="priveImg(certification.certification.license)" mode="aspectFill" />
<view class="content" v-else>暂无数据</view> <view class="content" v-else>暂无数据</view>
</view> </view>
</view> </view>
@@ -116,18 +71,28 @@
export default { export default {
data() { data() {
return { return {
info: '' token:"",
certification: {},
goods:[],
loaded:false
} }
}, },
created() { created() {
managesAttestation(this.$Route.query.id).then(res => { 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: { methods: {
priveImg(img) { priveImg(img) {
uni.previewImage({ uni.previewImage({
current: img, // 当前显示图片的http链接 longPressActions: {
itemList: []
},
urls: [img] // 需要预览的图片http链接列表 urls: [img] // 需要预览的图片http链接列表
}) })
}, },

View File

@@ -14,12 +14,13 @@
<view class="goods-content"> <view class="goods-content">
<view class="header"> <view class="header">
<view class="flex-box"> <view class="flex-box">
<view class="price"><text></text>{{goodsObj.price.show}}</view> <view class="price"><text></text>{{goodsObj.price.show}}
<!-- <view class="sales">累计交易{{goodsObj.sales}}</view> --> <span class='shuijing' v-if='goodsObj.price.pv>0'>
<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>{{goodsObj.price.pv}}</span><image style="width: 20rpx;" src="/static/icons/crystal-icon.png" mode="widthFix" />
</span> </span>
</view> </view>
<!-- <view class="sales">累计交易{{goodsObj.sales}}次</view> -->
</view>
<view class="coupon" v-if="couponSee.length > 0" @click="couponsOpne"> <view class="coupon" v-if="couponSee.length > 0" @click="couponsOpne">
<view class="coupon-list" v-for="(item, index) in couponSee" :key="index"> <view class="coupon-list" v-for="(item, index) in couponSee" :key="index">
<view class="coupon-label"> <view class="coupon-label">
@@ -413,7 +414,9 @@
font-weight: bold; font-weight: bold;
color: $text-price; color: $text-price;
font-size: $title-size + 14; font-size: $title-size + 14;
.shuijing{
font-size: 26rpx;color: #999;font-weight: normal;padding-left: 20rpx;
}
text { text {
font-size: 70%; font-size: 70%;
} }

View File

@@ -1,56 +1,40 @@
<template> <template>
<view class="content"> <view class="content">
<!-- 商品基本信息 -->
<view class="form-block"> <view class="form-block">
<view class="form-upd"> <block v-for="item in createInfo" :key='item.id'>
<view class="form-title">产品实物图片<text>点击预览长按删除</text></view> <!-- text -->
<view class="form-imgs"> <view class="form-box inputs-flex" v-if="item.type === 1">
<view <label class="form-label"><span v-if='item.required'>*</span>{{item.title}}</label>
class="item" <input type="text" @input='inputT(item.name,$event)' v-model="createAddInfo[item.name]" :placeholder="`请输入${item.title}`" />
v-if="extendCover.length > 0"
@click="openImg"
@longpress="extendCover = []"
>
<image class="item-cover" :src="extendCover[0].showpath" mode="aspectFill"></image>
</view> </view>
<view class="item item-add" v-else @click="updCover">
<!-- images -->
<view class="form-upd" v-if="item.type === 2">
<view class="form-title"><span v-if='item.required'>*</span>{{item.title}}<text>点击预览长按删除</text></view>
<view class="form-imgs">
<view class="item" v-if="createAddInfo[item.name].showpath" @click="openImg(item.name)"
@longpress="delImg(item.name)">
<image class="item-cover" :src="createAddInfo[item.name].showpath" mode="aspectFill"></image>
</view>
<view class="item item-add" v-else @click="updCover(item.name)">
<image class="item-cover" src="@/static/icons/add-icon.png" mode="aspectFill"></image> <image class="item-cover" src="@/static/icons/add-icon.png" mode="aspectFill"></image>
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- 商品基本信息 --> <!-- date -->
<view class="form-block"> <view class="form-box picker-flex" v-if="item.type === 3">
<view class="form-box picker-flex"> <label class="form-label"><span v-if='item.required'>*</span>{{item.title}}</label>
<label class="form-label">生产日期</label> <picker mode="date" :value="createAddInfo[item.name]" @change="pickerChange($event, item.name)">
<picker mode="date" :value="productedAt" @change="pickerChange($event, 'productedAt')">
<view class="picker-text"> <view class="picker-text">
{{productedAt || '选择商品生产日期'}} {{createAddInfo[item.name] || `选择${item.title}`}}
<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons> <uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view> </view>
</picker> </picker>
</view> </view>
<view class="form-box picker-flex">
<label class="form-label">过期时间</label>
<picker mode="date" :value="expiriedAt" @change="pickerChange($event, 'expiriedAt')">
<view class="picker-text">
{{expiriedAt || '选择商品过期时间'}}
<uni-icons class="picker-icon" type="arrowright" color="#999"></uni-icons>
</view>
</picker>
</view>
<view class="form-box inputs-flex">
<label class="form-label">生产商名称</label>
<input type="text" v-model="productName" placeholder="输入商品生产商名称"/>
</view>
<view class="form-box inputs-flex">
<label class="form-label">生产许可证号</label>
<input type="text" v-model="lisence" placeholder="输入商品生产许可证号"/>
</view>
<view class="form-box inputs-flex"> </block>
<label class="form-label">生产商地址</label>
<input type="text" v-model="productAddress" placeholder="输入商品生产商地址"/>
</view>
</view> </view>
<!-- 安全区 --> <!-- 安全区 -->
<view class="ios-bottom"></view> <view class="ios-bottom"></view>
@@ -63,95 +47,120 @@
</template> </template>
<script> <script>
import { managesGoodsAuth, managesGoodsExtends } from '@/apis/interfaces/goods' import {
import { uploads } from '@/apis/interfaces/uploading' managesGoodsAuth,
managesGoodsExtends,
goodsExtendsCreate
} from '@/apis/interfaces/goods'
import {
uploads
} from '@/apis/interfaces/uploading'
export default { export default {
data() { data() {
return { return {
productedAt : '', // 生产日期 createAddInfo: {}, // suoyou
expiriedAt : '', // 过期时间 createInfo: [], // 认证信息可以活的
lisence : '', // 生产许可证号
productName : '', // 生产商名称
productAddress : '', // 生产商地址
extendCover : [] // 实物图片
}; };
}, },
created() { created() {
if(this.$Route.query.edit === 'true' || this.$Route.query.edit ){ goodsExtendsCreate(this.$Route.query.id).then(res => {
this.createInfo = res.length > 0 ? res : []
res.filter(item => {
if (item.type === 2) {
this.$set(this.createAddInfo, item.name, {
path: '',
showpath: ''
})
} else {
this.$set(this.createAddInfo, item.name, '')
}
})
if (this.$Route.query.edit === 'true' || this.$Route.query.edit) {
managesGoodsExtends(this.$Route.query.id).then(res => { managesGoodsExtends(this.$Route.query.id).then(res => {
this.productedAt = res.producted_at console.log(res)
this.expiriedAt = res.expiried_at this.createAddInfo = res
this.lisence = res.lisence
this.productName = res.product_name
this.productAddress = res.product_address
this.extendCover = [{...res.cover}]
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
} }
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none'
})
})
}, },
methods: { methods: {
// 输入框txt 分别赋值给text
inputT(key, e) {
this.$set(this.createAddInfo, key, e.detail.value)
},
// picker选择 // picker选择
pickerChange(e, key){ pickerChange(e, key) {
this[key] = e.detail.value this.$set(this.createAddInfo, key, e.detail.value)
}, },
// 图片预览 // 图片预览
openImg(){ openImg(key) {
let paths = this.extendCover.map(val => { console.log(key)
return val.showpath
})
uni.previewImage({ uni.previewImage({
urls : paths, urls: [this.createAddInfo[key].showpath],
current : 0, current: 0,
indicator: 'number' indicator: 'number'
}) })
}, },
delImg(key){
this.$set(this.createAddInfo, key, {
path: '',
showpath:''
})
},
// 上传图片 // 上传图片
updCover(){ updCover(key) {
uni.chooseImage({ uni.chooseImage({
count : 1, count: 1,
success : res => { success: res => {
uploads([{ uploads([{
uri : res.tempFilePaths[0] uri: res.tempFilePaths[0]
}]).then(updRes => { }]).then(updRes => {
this.extendCover.push({ this.$nextTick(() => {
path : updRes.path[0], this.$set(this.createAddInfo, key, {
path: updRes.path[0],
showpath: updRes.url[0] showpath: updRes.url[0]
}) })
})
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
} }
}) })
}, },
// 发布产品 // 发布产品
submitAdd(){ submitAdd() {
let submitData = { let submitData = this.createAddInfo
producted_at : this.productedAt, this.createInfo.filter(item => {
expiried_at : this.expiriedAt, if (item.type === 2) {
lisence : this.lisence, submitData[item.name] = this.createAddInfo[item.name].path
product_name : this.productName,
product_address : this.productAddress,
extend_cover : this.extendCover[0].path
} }
})
let submitFund = managesGoodsAuth(this.$Route.query.id, submitData) let submitFund = managesGoodsAuth(this.$Route.query.id, submitData)
submitFund.then(res => { submitFund.then(res => {
uni.setStorageSync('refresh',true) uni.setStorageSync('refresh', true)
uni.showModal({ uni.showModal({
title : '提示', title: '提示',
content : '商品权证认证信息已提交,请耐心等待平台审核', content: '商品权证认证信息已提交,请耐心等待平台审核',
showCancel : false, showCancel: false,
success : res => { success: res => {
if(res.confirm){ if (res.confirm) {
if(this.$Route.query.type == 'goodsAdd'){ if (this.$Route.query.type == 'goodsAdd') {
this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 3) this.$Router.back(this.$Route.query.edit == 'true' ? 2 : 3)
}else{ } else {
this.$Router.back() this.$Router.back()
} }
} }
@@ -160,7 +169,7 @@
}).catch(err => { }).catch(err => {
uni.showToast({ uni.showToast({
title: err.message, title: err.message,
icon : 'none' icon: 'none'
}) })
}) })
} }
@@ -169,20 +178,23 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.content{ .content {
padding-bottom: 150rpx; padding-bottom: 150rpx;
} }
// 表单 // 表单
.form-block{ .form-block {
background: white; background: white;
margin-top: $margin - 10; margin-top: $margin - 10;
.form-box{
.form-box {
position: relative; position: relative;
padding-left: 240rpx; padding-left: 240rpx;
padding-right: $padding; padding-right: $padding;
font-size: $title-size-lg; font-size: $title-size-lg;
min-height: 80rpx; min-height: 80rpx;
&::after{
&::after {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
left: $margin; left: $margin;
@@ -191,26 +203,35 @@
content: " "; content: " ";
background: $border-color; background: $border-color;
} }
&:last-child::after{
&:last-child::after {
display: none; display: none;
} }
.form-label{
.form-label {
position: absolute; position: absolute;
left: $margin; left: $margin;
line-height: 80rpx; line-height: 80rpx;
top: 0; top: 0;
width: calc(240rpx - #{$margin}); width: calc(240rpx - #{$margin});
span{
color: #f00;
padding-right: $padding * .2;
} }
} }
.inputs-flex{ }
input{
.inputs-flex {
input {
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
} }
} }
.input-unit{
.input-unit {
padding-right: 200rpx; padding-right: 200rpx;
.units{
.units {
position: absolute; position: absolute;
right: 0; right: 0;
top: 0; top: 0;
@@ -222,49 +243,61 @@
box-sizing: border-box; box-sizing: border-box;
} }
} }
.picker-flex{
.picker-text{ .picker-flex {
.picker-text {
position: relative; position: relative;
line-height: 80rpx; line-height: 80rpx;
min-height: 80rpx; min-height: 80rpx;
padding-right: 80rpx; padding-right: 80rpx;
@extend .nowrap; @extend .nowrap;
.picker-icon{
.picker-icon {
right: 0; right: 0;
position: absolute; position: absolute;
} }
} }
.picker-switch{
.picker-switch {
line-height: 80rpx; line-height: 80rpx;
min-height: 80rpx; min-height: 80rpx;
text-align: right; text-align: right;
margin-right: -15rpx; margin-right: -15rpx;
switch{
transform:scale(0.7) switch {
transform: scale(0.7)
} }
} }
} }
.form-upd{
.form-title{ .form-upd {
.form-title {
font-size: $title-size-lg; font-size: $title-size-lg;
line-height: 80rpx; line-height: 80rpx;
padding: 0 $padding; padding: 0 $padding;
text{ span{
color: #f00;
padding-right: $padding * .2;
}
text {
font-size: 80%; font-size: 80%;
color: $text-gray; color: $text-gray;
} }
} }
.form-imgs{
.form-imgs {
margin-top: -($margin/3); margin-top: -($margin/3);
padding: 0 20rpx 20rpx; padding: 0 20rpx 20rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.item{
.item {
width: calc(20% - 14rpx); width: calc(20% - 14rpx);
padding-top: calc(20% - 14rpx); padding-top: calc(20% - 14rpx);
margin: 7rpx; margin: 7rpx;
position: relative; position: relative;
.item-cover{
.item-cover {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
@@ -272,10 +305,12 @@
height: 100%; height: 100%;
} }
} }
.item-add{
.item-add {
border: dashed 2rpx $border-color; border: dashed 2rpx $border-color;
box-sizing: border-box; box-sizing: border-box;
.item-cover{
.item-cover {
top: calc(15% - 2rpx); top: calc(15% - 2rpx);
left: calc(15% - 2rpx); left: calc(15% - 2rpx);
width: 70%; width: 70%;
@@ -285,8 +320,9 @@
} }
} }
} }
// 发布 // 发布
.footer{ .footer {
background: white; background: white;
position: fixed; position: fixed;
bottom: 0; bottom: 0;
@@ -295,7 +331,8 @@
padding: 20rpx $padding; padding: 20rpx $padding;
box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02); box-shadow: 0 0 4rpx 4rpx rgba($color: #000000, $alpha: .02);
z-index: 9; z-index: 9;
.footer-btn{
.footer-btn {
border: none; border: none;
border-radius: 0; border-radius: 0;
background: $text-price; background: $text-price;
@@ -304,62 +341,75 @@
font-weight: bold; font-weight: bold;
font-size: $title-size; font-size: $title-size;
color: white; color: white;
&::after{
&::after {
border: none; border: none;
} }
} }
} }
// 可选服务 // 可选服务
.category-popup{ .category-popup {
background: #F5F5F5; background: #F5F5F5;
padding: 0 $padding * 2 $padding * 2 $padding * 2; padding: 0 $padding * 2 $padding * 2 $padding * 2;
.header{
.header {
padding: $padding*2 0; padding: $padding*2 0;
box-sizing: border-box; box-sizing: border-box;
@extend .vertical; @extend .vertical;
.title{
.title {
text-align: center; text-align: center;
font-size: $title-size + 14; font-size: $title-size + 14;
font-weight: bold; font-weight: bold;
line-height: 90rpx; line-height: 90rpx;
} }
.subtitle{
.subtitle {
font-size: $title-size-m; font-size: $title-size-m;
color: $text-gray; color: $text-gray;
text-align: center; text-align: center;
} }
} }
.category-flex{
.category-flex {
max-height: 50vh; max-height: 50vh;
overflow-y: scroll; overflow-y: scroll;
.category-flex-item{
.category-flex-item {
margin-bottom: $margin; margin-bottom: $margin;
padding: $padding; padding: $padding;
background: white; background: white;
border:solid 1rpx white; border: solid 1rpx white;
box-sizing: border-box; box-sizing: border-box;
.category-name{
.category-name {
padding-bottom: $padding/2; padding-bottom: $padding/2;
font-weight: bold; font-weight: bold;
font-size: $title-size-lg; font-size: $title-size-lg;
} }
.category-content{
.category-content {
font-size: $title-size-sm; font-size: $title-size-sm;
color: $text-gray; color: $text-gray;
@extend .ellipsis; @extend .ellipsis;
} }
&.show{
&.show {
color: $text-price; color: $text-price;
border:solid 1rpx $text-price; border: solid 1rpx $text-price;
} }
&:last-child{
&:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
} }
} }
.btns{
.btns {
padding-top: $padding * 2; padding-top: $padding * 2;
button{
button {
background: $text-price; background: $text-price;
border-radius: 0; border-radius: 0;
height: 90rpx; height: 90rpx;
@@ -367,7 +417,8 @@
font-size: $title-size; font-size: $title-size;
color: white; color: white;
font-weight: bold; font-weight: bold;
&::after{
&::after {
border: none; border: none;
} }
} }

View File

@@ -194,6 +194,13 @@
// 移出删除商品 // 移出删除商品
goodsRemove(id){ goodsRemove(id){
let index = this.goods.findIndex(val => val.goods_id == id) let index = this.goods.findIndex(val => val.goods_id == id)
uni.showModal({
title : '温馨提示',
content : '是否确认删除该商品权证,删除后无法恢复',
confirmText : '确认',
cancelText : '再想想',
success : res => {
if(res.confirm){
managesGoodsDelete(id).then(res => { managesGoodsDelete(id).then(res => {
this.goods.splice(index,1) this.goods.splice(index,1)
if(this.goods.length === 0) this.getList() if(this.goods.length === 0) this.getList()
@@ -208,6 +215,9 @@
}) })
}) })
} }
}
})
}
}, },
onNavigationBarButtonTap() { onNavigationBarButtonTap() {
this.$Router.push({name: 'goodsaddClassify'}) this.$Router.push({name: 'goodsaddClassify'})

View File

@@ -1,10 +1,10 @@
<template> <template>
<view class="GoodsAuthentication"> <view class="GoodsAuthentication">
<view class="authenticationTop" v-if='list.length>0'>区块链溯源码:{{info.token}}</view> <view class="authenticationTop" v-if='list.length>0'>权证溯源码:{{info.token}}</view>
<!-- 进度条 --> <!-- 进度条 -->
<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>{{index === list.length - 1?item.note:'权证交易'}}</span>{{item.blockTime}}</view> <view class="left-box-top"><span>{{item.title}}</span>{{item.blocked_at}}</view>
<!-- 左边 --> <!-- 左边 -->
<view class="line" :class="{active:true,none:index==(list.length-1)}"> <view class="line" :class="{active:true,none:index==(list.length-1)}">
<!-- 中线 --> <!-- 中线 -->
@@ -24,18 +24,26 @@
<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">{{index === list.length - 1?'初始发行量':'交易数量'}}</view> <view class="title">{{item.type}}数量</view>
<view class="content">{{item.amount}}</view> <view class="content">{{item.amount}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem">
<view class="title">区块链高度:</view> <view class="title">区块链高度:</view>
<view class="content">{{item.height}}</view> <view class="content">{{item.height}}</view>
</view> </view>
<view class="authenticationItemcontentItem"> <view class="authenticationItemcontentItem" v-if="item.from_user.nickname">
<view class="title">交易哈希</view> <view class="title">HashFrom</view>
<view class="content">{{item.hash}}</view> <view class="content"><image :src="item.from_user.avatar" mode="widthFix"/> {{item.from_user.nickname}}</view>
</view> </view>
<view class="zhushi">注释:{{item.note}}</view> <view class="authenticationItemcontentItem">
<view class="title">Hash</view>
<view class="content hash ellipsis">{{item.hash}}</view>
</view>
<view class="authenticationItemcontentItem" v-if="item.to_user.nickname">
<view class="title">HashTo</view>
<view class="content"><image :src="item.to_user.avatar" mode="widthFix"/>{{item.to_user.nickname}}</view>
</view>
<view class="zhushi">注释:{{item.remark}}</view>
</view> </view>
</view> </view>
</view> </view>
@@ -50,29 +58,39 @@
<script> <script>
import { import {
managesTracedTo, managesTracedTo
checkmessage
} from '@/apis/interfaces/goods' } from '@/apis/interfaces/goods'
export default { export default {
data() { data() {
return { return {
list: '', list: [],
info: '' info: {},
has_more:true,
page:1
} }
}, },
created() { created() {
managesTracedTo(this.$Route.query.id).then(res1 => { this.getList()
console.log(res1) },
this.list= res1.list onReachBottom(){
this.info = res1 if(this.has_more){
checkmessage(this.$Route.query.id).then(res => { this.getList()
this.list.push(res) }else{
uni.showToast({
title:'没有更多',
icon:'none',
mask:true
}) })
}
})
}, },
methods: { methods: {
getList(){
managesTracedTo(this.$Route.query.id,this.page).then(res1 => {
this.list= this.list.concat(res1.logs.data)
this.info = res1
this.has_more = res1.logs.page.has_more
})
},
priveImg(img) { priveImg(img) {
uni.previewImage({ uni.previewImage({
current: img, // 当前显示图片的http链接 current: img, // 当前显示图片的http链接
@@ -207,11 +225,24 @@
.title { .title {
width: 160rpx; width: 160rpx;
} }
.hash{
.content {
text-overflow: ellipsis;
width: calc(100% - 180rpx); width: calc(100% - 180rpx);
word-wrap: break-word; word-break: break-word;
}
.content {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
box-sizing: border-box;
color: #999;
width: calc(100% - 180rpx);
image{
width: 40rpx;
height: 40rpx;
border-radius: 50%;
margin-right: $padding * .3;
}
} }
.img { .img {