|
|
@ -3,7 +3,7 @@ |
|
|
|
<!-- 固定顶部区域 --> |
|
|
|
<view class="fixed-header"> |
|
|
|
<!-- 顶部渐变导航栏 --> |
|
|
|
<view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}"> |
|
|
|
<view class="nav-bar" :style="{ height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px' }"> |
|
|
|
<view class="nav-bar-inner"> |
|
|
|
<view class="back-icon" @tap="navigateBack"> |
|
|
|
<uni-icons type="left" size="22" color="#fff" /> |
|
|
@ -20,37 +20,33 @@ |
|
|
|
<view class="feature-tags"> |
|
|
|
<view class="tag" v-for="(t, i) in featureTags" :key="i"> |
|
|
|
<text class="check">✓</text> |
|
|
|
<text class="text">{{t}}</text> |
|
|
|
<text class="text">{{ t }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<!-- 主内容区(卡片悬浮覆盖打钩区) --> |
|
|
|
<scroll-view |
|
|
|
scroll-y |
|
|
|
class="main-content" |
|
|
|
enhanced |
|
|
|
:show-scrollbar="false" |
|
|
|
|
|
|
|
> |
|
|
|
<!-- 主内容区(卡片悬浮覆盖打钩区) --> |
|
|
|
<scroll-view scroll-y class="main-content" enhanced :show-scrollbar="false"> |
|
|
|
<view class="content-wrapper"> |
|
|
|
<view v-if="showQualified && goodsList.length" class="inspection-card"> |
|
|
|
<view class="report-title">质检合格</view> |
|
|
|
<view class="goods-list"> |
|
|
|
<view class="goods-item" v-for="(item, i) in displayedGoodsList" :key="i" @tap="goToInspectionDetail('qualified', item)"> |
|
|
|
<view class="goods-item" v-for="(item, i) in displayedGoodsList" :key="i" |
|
|
|
@tap="goToInspectionDetail('qualified', item)"> |
|
|
|
<image class="goods-img" :src="item.img" mode="aspectFit" /> |
|
|
|
<view class="goods-info"> |
|
|
|
<view class="goods-row"> |
|
|
|
<view class="goods-name">{{item.name}}</view> |
|
|
|
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /></view> |
|
|
|
<view class="goods-name">{{ item.name }}</view> |
|
|
|
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="goods-desc">{{item.desc}}</view> --> |
|
|
|
<view class="goods-bottom-row"> |
|
|
|
<view class="goods-price-row"> |
|
|
|
<text class="goods-price" v-if="item.price">¥{{(item.price / item.count).toFixed(2)}}</text> |
|
|
|
<text class="goods-unit" v-if="item.price && item.unit">/{{item.unit}}</text> |
|
|
|
<text class="goods-count">x{{item.count}}</text> |
|
|
|
<text class="goods-price" v-if="item.price">¥{{ (item.price / item.count).toFixed(2) }}</text> |
|
|
|
<text class="goods-unit" v-if="item.price && item.unit">/{{ item.unit }}</text> |
|
|
|
<text class="goods-count">x{{ item.count }}</text> |
|
|
|
</view> |
|
|
|
<!-- <view class="goods-total">¥{{item.total}}</view> --> |
|
|
|
</view> |
|
|
@ -62,26 +58,29 @@ |
|
|
|
<uni-icons :type="qualifiedCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" /> |
|
|
|
</view> |
|
|
|
<view class="summary-row"> |
|
|
|
<text>件数:<text class="highlight">{{totalCount}}</text> 件</text> |
|
|
|
<text>结算金额:<text class="highlight">¥{{totalAmount}}</text></text> |
|
|
|
<text>件数:<text class="highlight">{{ totalCount }}</text> 件</text> |
|
|
|
<text>结算金额:<text class="highlight">¥{{ totalAmount }}</text></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="showProblem && problemList.length" class="inspection-card problem-card"> |
|
|
|
<view class="report-title">质量问题</view> |
|
|
|
<view class="goods-list"> |
|
|
|
<view class="goods-item" v-for="(item, i) in displayedProblemList" :key="i" @tap="goToInspectionDetail('problem', item)"> |
|
|
|
<image class="goods-img" :src="item.img" mode="aspectFit" /> |
|
|
|
<view class="goods-item" v-for="(item, i) in displayedProblemList" :key="i" |
|
|
|
@tap="goToInspectionDetail('problem', item)"> |
|
|
|
<image class="goods-img" :src="item.img || bkhs_image" mode="aspectFit" /> |
|
|
|
|
|
|
|
<view class="goods-info"> |
|
|
|
<view class="goods-row"> |
|
|
|
<view class="goods-name">{{item.name}}</view> |
|
|
|
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /></view> |
|
|
|
<view class="goods-name">{{ item.name }}</view> |
|
|
|
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="goods-desc">{{item.desc}}</view> --> |
|
|
|
<view class="goods-bottom-row"> |
|
|
|
<view class="goods-price-row problem-price-row"> |
|
|
|
<text class="goods-price" v-if="item.price">¥{{(item.price / item.count).toFixed(2)}}</text> |
|
|
|
<text class="goods-price" v-if="item.price">¥{{ (item.price / item.count).toFixed(2) }}</text> |
|
|
|
<text class="goods-unit" v-if="item.price">/件</text> |
|
|
|
<text class="goods-count">x{{item.count}}</text> |
|
|
|
<text class="goods-count">x{{ item.count }}</text> |
|
|
|
</view> |
|
|
|
<!-- <view class="goods-total">¥{{item.total}}</view> --> |
|
|
|
</view> |
|
|
@ -93,39 +92,43 @@ |
|
|
|
<uni-icons :type="problemCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" /> |
|
|
|
</view> |
|
|
|
<view class="summary-row"> |
|
|
|
<text>件数:<text class="highlight">{{problemCount}}</text> 件</text> |
|
|
|
<text>结算金额:<text class="highlight">¥{{problemAmount}}</text></text> |
|
|
|
<text>件数:<text class="highlight">{{ problemCount }}</text> 件</text> |
|
|
|
<text>结算金额:<text class="highlight">¥{{ problemAmount }}</text></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="showUnrecyclable && unrecyclableList.length" class="inspection-card problem-card"> |
|
|
|
<view class="report-title">不可回收</view> |
|
|
|
<view class="goods-list"> |
|
|
|
<view class="goods-item" v-for="(item, i) in displayedUnrecyclableList" :key="i" @tap="goToInspectionDetail('unrecyclable', item)"> |
|
|
|
<image class="goods-img" :src="item.img" mode="aspectFit" /> |
|
|
|
<view class="goods-item" v-for="(item, i) in displayedUnrecyclableList" :key="i" |
|
|
|
@tap="goToInspectionDetail('unrecyclable', item)"> |
|
|
|
<image class="goods-img" :src="item.img || bkhs_image" mode="aspectFit" /> |
|
|
|
|
|
|
|
<view class="goods-info"> |
|
|
|
<view class="goods-row"> |
|
|
|
<view class="goods-name">{{item.name}}</view> |
|
|
|
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /></view> |
|
|
|
<view class="goods-name">{{ item.name }}</view> |
|
|
|
<view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<!-- <view class="goods-desc">{{item.desc}}</view> --> |
|
|
|
<view class="goods-bottom-row"> |
|
|
|
<view class="goods-price-row problem-price-row"> |
|
|
|
<text class="goods-price" v-if="item.price">¥{{(item.price / item.count).toFixed(2)}}</text> |
|
|
|
<text class="goods-price" v-if="item.price">¥{{ (item.price / item.count).toFixed(2) }}</text> |
|
|
|
<text class="goods-unit" v-if="item.price">/件</text> |
|
|
|
<text class="goods-count">x{{item.count}}</text> |
|
|
|
<text class="goods-count">x{{ item.count }}</text> |
|
|
|
</view> |
|
|
|
<!-- <view class="goods-total">¥{{item.total}}</view> --> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view v-if="unrecyclableList.length > 2" class="collapse-btn" @tap="unrecyclableCollapsed = !unrecyclableCollapsed"> |
|
|
|
<view v-if="unrecyclableList.length > 2" class="collapse-btn" |
|
|
|
@tap="unrecyclableCollapsed = !unrecyclableCollapsed"> |
|
|
|
<text>{{ unrecyclableCollapsed ? '展开(共' + unrecyclableList.length + '件)' : '收起' }}</text> |
|
|
|
<uni-icons :type="unrecyclableCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" /> |
|
|
|
</view> |
|
|
|
<view class="summary-row"> |
|
|
|
<text>件数:<text class="highlight">{{unrecyclableCount}}</text> 件</text> |
|
|
|
<text>结算金额:<text class="highlight">¥{{unrecyclableAmount}}</text></text> |
|
|
|
<text>件数:<text class="highlight">{{ unrecyclableCount }}</text> 件</text> |
|
|
|
<text>结算金额:<text class="highlight">¥{{ unrecyclableAmount }}</text></text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@ -151,11 +154,12 @@ export default { |
|
|
|
showQualified: false, |
|
|
|
showProblem: false, |
|
|
|
showUnrecyclable: false, |
|
|
|
orderId : 0, |
|
|
|
orderId: 0, |
|
|
|
fixedHeaderHeight: 0, // 固定头部的高度 |
|
|
|
qualifiedCollapsed: true, |
|
|
|
problemCollapsed: true, |
|
|
|
unrecyclableCollapsed: true, |
|
|
|
isSelf: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
@ -194,6 +198,14 @@ export default { |
|
|
|
displayedUnrecyclableList() { |
|
|
|
return this.unrecyclableCollapsed ? this.unrecyclableList.slice(0, 2) : this.unrecyclableList; |
|
|
|
}, |
|
|
|
bkhs_image() {//不可回收图片 |
|
|
|
const item = getApp().globalData.configData.find(i => i.keyName === 'bkhs_image') |
|
|
|
return item ? item.keyContent : '' |
|
|
|
}, |
|
|
|
zlwt_image() {//质量问题图片 |
|
|
|
const item = getApp().globalData.configData.find(i => i.keyName === 'zlwt_image') |
|
|
|
return item ? item.keyContent : '' |
|
|
|
}, |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
const sysInfo = uni.getSystemInfoSync() |
|
|
@ -201,8 +213,10 @@ export default { |
|
|
|
this.navBarHeight = 14 |
|
|
|
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight |
|
|
|
// 获取 orderId |
|
|
|
const orderId = options.orderId |
|
|
|
this.orderId = orderId |
|
|
|
const orderId = options.orderId |
|
|
|
this.isSelf = options.isSelf |
|
|
|
|
|
|
|
this.orderId = orderId |
|
|
|
if (orderId) { |
|
|
|
this.fetchQualityReport(orderId) |
|
|
|
} |
|
|
@ -210,9 +224,9 @@ export default { |
|
|
|
methods: { |
|
|
|
async fetchQualityReport(orderId) { |
|
|
|
// 调用订单详情接口 |
|
|
|
this.$api && this.$api('getOrderDetail', { |
|
|
|
orderId : this.orderId |
|
|
|
}, res => { |
|
|
|
this.$api && this.$api('getOrderDetail', { |
|
|
|
orderId: this.orderId |
|
|
|
}, res => { |
|
|
|
if (res && res.code === 200 && res.result) { |
|
|
|
this.reportData = res.result |
|
|
|
// 解析嵌套的订单数据 |
|
|
@ -220,7 +234,7 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
parseOrderData(orderData) { |
|
|
|
this.goodsList = [] |
|
|
|
this.problemList = [] |
|
|
@ -249,7 +263,7 @@ export default { |
|
|
|
// 质量问题 |
|
|
|
if (sub.testingStatus == 1) { |
|
|
|
this.problemList.push({ |
|
|
|
img: item.image || '/static/default-goods.png', |
|
|
|
img: item.image, |
|
|
|
name: item.title || '未知品类', |
|
|
|
desc: item.pinName ? `${item.pinName}` : '', |
|
|
|
price: item.price || 0, |
|
|
@ -265,7 +279,7 @@ export default { |
|
|
|
// 不可回收 |
|
|
|
if (sub.testingStatus == 2) { |
|
|
|
this.unrecyclableList.push({ |
|
|
|
img: item.image || '/static/default-goods.png', |
|
|
|
img: item.image, |
|
|
|
name: item.title || '未知品类', |
|
|
|
desc: item.pinName ? `${item.pinName}` : '', |
|
|
|
price: item.price || 0, |
|
|
@ -299,8 +313,15 @@ export default { |
|
|
|
if (!item) return; |
|
|
|
const userId = this.reportData && this.reportData.userId; |
|
|
|
const data = { ...item, userId }; |
|
|
|
let url = `/pages/subcomponent/inspection-detail?status=${status}&data=${encodeURIComponent(JSON.stringify(data))}` |
|
|
|
|
|
|
|
if (this.isSelf) { |
|
|
|
console.log(this.isSelf, 'this.isSelf'); |
|
|
|
url += `&isSelf=true` |
|
|
|
} |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
url: `/pages/subcomponent/inspection-detail?status=${status}&data=${encodeURIComponent(JSON.stringify(data))}` |
|
|
|
url |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -326,7 +347,8 @@ export default { |
|
|
|
.nav-bar { |
|
|
|
width: 100vw; |
|
|
|
background: #422525; |
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.03); |
|
|
|
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.03); |
|
|
|
|
|
|
|
.nav-bar-inner { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
@ -335,7 +357,9 @@ export default { |
|
|
|
width: 100vw; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
.back-icon, .nav-bar-right { |
|
|
|
|
|
|
|
.back-icon, |
|
|
|
.nav-bar-right { |
|
|
|
width: 44px; |
|
|
|
height: 44px; |
|
|
|
display: flex; |
|
|
@ -344,8 +368,15 @@ export default { |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
} |
|
|
|
.back-icon { left: 0; } |
|
|
|
.nav-bar-right { right: 0; } |
|
|
|
|
|
|
|
.back-icon { |
|
|
|
left: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.nav-bar-right { |
|
|
|
right: 0; |
|
|
|
} |
|
|
|
|
|
|
|
.nav-bar-title { |
|
|
|
flex: 1; |
|
|
|
text-align: center; |
|
|
@ -367,7 +398,7 @@ export default { |
|
|
|
|
|
|
|
.feature-area { |
|
|
|
margin: 0 32rpx; |
|
|
|
background:#422525; |
|
|
|
background: #422525; |
|
|
|
border-radius: 32rpx; |
|
|
|
padding: 18rpx 24rpx 18rpx 24rpx; |
|
|
|
display: flex; |
|
|
@ -387,11 +418,11 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.feature-tags { |
|
|
|
// margin: 0 32rpx; |
|
|
|
// margin: 0 32rpx; |
|
|
|
background: #533030; |
|
|
|
border-radius: 12rpx; |
|
|
|
box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08); |
|
|
|
// padding: 0 24rpx; |
|
|
|
// padding: 0 24rpx; |
|
|
|
width: 100%; |
|
|
|
height: 80rpx; |
|
|
|
display: flex; |
|
|
@ -404,6 +435,7 @@ export default { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
.check { |
|
|
|
width: 36rpx; |
|
|
|
height: 36rpx; |
|
|
@ -416,8 +448,9 @@ export default { |
|
|
|
color: #422525; |
|
|
|
font-weight: bold; |
|
|
|
margin-right: 10rpx; |
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08); |
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08); |
|
|
|
} |
|
|
|
|
|
|
|
.text { |
|
|
|
color: #fff; |
|
|
|
font-size: 28rpx; |
|
|
@ -456,6 +489,7 @@ export default { |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
flex-shrink: 0; |
|
|
|
|
|
|
|
.report-title { |
|
|
|
font-size: 32rpx; |
|
|
|
font-weight: bold; |
|
|
@ -463,6 +497,7 @@ export default { |
|
|
|
text-align: center; |
|
|
|
margin-bottom: 12rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-list { |
|
|
|
.goods-item { |
|
|
|
display: flex; |
|
|
@ -472,6 +507,7 @@ export default { |
|
|
|
box-shadow: 0 2rpx 8rpx rgba(60, 167, 250, 0.04); |
|
|
|
padding: 24rpx 20rpx; |
|
|
|
margin-bottom: 20rpx; |
|
|
|
|
|
|
|
.goods-img { |
|
|
|
width: 80rpx; |
|
|
|
height: 80rpx; |
|
|
@ -479,19 +515,23 @@ export default { |
|
|
|
margin-right: 20rpx; |
|
|
|
background: #f5f5f5; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-info { |
|
|
|
flex: 1; |
|
|
|
display: flex; |
|
|
|
flex-direction: column; |
|
|
|
|
|
|
|
.goods-row { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
.goods-name { |
|
|
|
font-size: 28rpx; |
|
|
|
color: #222; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
|
|
|
|
.detail-link { |
|
|
|
font-size: 24rpx; |
|
|
|
color: #bbb; |
|
|
@ -499,29 +539,35 @@ export default { |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.goods-desc { |
|
|
|
font-size: 24rpx; |
|
|
|
color: #bbb; |
|
|
|
margin-bottom: 8rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-bottom-row { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: flex-end; |
|
|
|
margin-top: 8rpx; |
|
|
|
|
|
|
|
.goods-price-row { |
|
|
|
display: flex; |
|
|
|
align-items: baseline; |
|
|
|
|
|
|
|
.goods-price { |
|
|
|
font-size: 26rpx; |
|
|
|
color: #bbb; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-unit { |
|
|
|
font-size: 24rpx; |
|
|
|
color: #bbb; |
|
|
|
margin-left: 2rpx; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-count { |
|
|
|
font-size: 22rpx; |
|
|
|
color: #bbb; |
|
|
@ -529,6 +575,7 @@ export default { |
|
|
|
font-weight: normal; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.goods-total { |
|
|
|
font-size: 28rpx; |
|
|
|
color: #222; |
|
|
@ -538,8 +585,12 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.goods-item:last-child { margin-bottom: 0; } |
|
|
|
|
|
|
|
.goods-item:last-child { |
|
|
|
margin-bottom: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.summary-row { |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
@ -547,6 +598,7 @@ export default { |
|
|
|
margin-top: 24rpx; |
|
|
|
font-size: 28rpx; |
|
|
|
color: #222; |
|
|
|
|
|
|
|
.highlight { |
|
|
|
color: #f79400; |
|
|
|
font-weight: bold; |
|
|
@ -567,7 +619,7 @@ export default { |
|
|
|
color: #13ac47; |
|
|
|
font-weight: bold; |
|
|
|
margin-right: 10rpx; |
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08); |
|
|
|
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.08); |
|
|
|
} |
|
|
|
|
|
|
|
.problem-card { |
|
|
@ -590,4 +642,4 @@ export default { |
|
|
|
justify-content: center; |
|
|
|
gap: 8rpx; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |