Browse Source

fix(质检报告): 修复质检详情页图片权限问题并优化样式

feat(订单详情): 添加isSelf参数控制质检图片查看权限
style: 统一格式化代码缩进和空格
refactor(质检报告): 使用全局配置图片作为默认质检图片
v1
前端-胡立永 4 weeks ago
parent
commit
5999aeff12
5 changed files with 214 additions and 87 deletions
  1. +1
    -1
      config.js
  2. +2
    -2
      pages/manager/inspect-result.vue
  3. +1
    -1
      pages/manager/order-detail.vue
  4. +102
    -27
      pages/subcomponent/inspection-detail.vue
  5. +108
    -56
      pages/subcomponent/inspection-report.vue

+ 1
- 1
config.js View File

@ -1,5 +1,5 @@
// config.js // config.js
const type = 'prod'
const type = 'local'
const config = { const config = {
local: { local: {


+ 2
- 2
pages/manager/inspect-result.vue View File

@ -98,8 +98,8 @@
<view class="info-row"> <view class="info-row">
<text class="info-label">订单编号</text> <text class="info-label">订单编号</text>
<text class="info-value copy-btn" <text class="info-value copy-btn"
@click="$utils.copyText(order?.ordeNo)"
>{{ order?.ordeNo }} 复制</text>
@click="$utils.copyText(order?.ordeNo)"
>{{ order?.ordeNo }} 复制</text>
</view> </view>
<view class="info-row"> <view class="info-row">
<text class="info-label">取件时间</text> <text class="info-label">取件时间</text>


+ 1
- 1
pages/manager/order-detail.vue View File

@ -343,7 +343,7 @@ export default {
goToInspection() { goToInspection() {
if (!this.order.id) return; if (!this.order.id) return;
uni.navigateTo({ uni.navigateTo({
url: `/pages/subcomponent/inspection-report?orderId=${this.order.id}`
url: `/pages/subcomponent/inspection-report?orderId=${this.order.id}&isSelf=true`
}) })
}, },
// estimatedPrice // estimatedPrice


+ 102
- 27
pages/subcomponent/inspection-detail.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="inspection-detail-page"> <view class="inspection-detail-page">
<!-- 顶部导航栏 --> <!-- 顶部导航栏 -->
<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-left" @tap="navigateBack"> <view class="nav-bar-left" @tap="navigateBack">
<uni-icons type="left" size="22" color="#222" /> <uni-icons type="left" size="22" color="#222" />
</view> </view>
@ -11,7 +11,7 @@
<uni-icons type="camera" size="22" color="#222" style="margin-left: 12rpx;" /> <uni-icons type="camera" size="22" color="#222" style="margin-left: 12rpx;" />
</view> </view>
</view> </view>
<view class="main-content safe-area-inset-bottom" :style="{marginTop: navBarTotalHeight + 'px'}">
<view class="main-content safe-area-inset-bottom" :style="{ marginTop: navBarTotalHeight + 'px' }">
<view v-if="(status === 'problem' || status === 'unrecyclable') && item" class="card card-problem"> <view v-if="(status === 'problem' || status === 'unrecyclable') && item" class="card card-problem">
<view class="card-header"> <view class="card-header">
<view class="dot dot-orange"></view> <view class="dot dot-orange"></view>
@ -26,15 +26,18 @@
<view class="timeline-content"> <view class="timeline-content">
<view class="timeline-title-row"> <view class="timeline-title-row">
<text class="timeline-title">质检说明</text> <text class="timeline-title">质检说明</text>
<text class="timeline-time">{{item.testingTime}}</text>
<text class="timeline-time">{{ item.testingTime }}</text>
</view> </view>
<view v-for="(desc, idx) in problemDescArr.length ? problemDescArr : [item.problemDesc]" :key="idx" class="problem-block">
<view class="problem-index">{{(idx+1).toString().padStart(2, '0')}} / {{problemDescArr.length.toString().padStart(2, '0')}}</view>
<view class="problem-title">{{desc || '质量问题'}}</view>
<view v-for="(desc, idx) in problemDescArr.length ? problemDescArr : [item.problemDesc]" :key="idx"
class="problem-block">
<view class="problem-index">{{ (idx + 1).toString().padStart(2, '0') }} /
{{ problemDescArr.length.toString().padStart(2, '0') }}</view>
<view class="problem-title">{{ desc || '质量问题' }}</view>
<view class="problem-divider"></view> <view class="problem-divider"></view>
<view class="problem-label">质量问题实拍</view> <view class="problem-label">质量问题实拍</view>
<view class="problem-images"> <view class="problem-images">
<view v-for="(img, i) in imagesArr" :key="i" class="img-lock-wrap" @tap="isSelf && previewImage(img, i)">
<view v-for="(img, i) in imagesArr" :key="i" class="img-lock-wrap"
@tap="isSelf && previewImage(img, i)">
<image :src="img" class="problem-img" mode="aspectFill" /> <image :src="img" class="problem-img" mode="aspectFill" />
<view v-if="!isSelf" class="img-lock-mask"> <view v-if="!isSelf" class="img-lock-mask">
<image src="/static/lock.png" class="lock-icon" /> <image src="/static/lock.png" class="lock-icon" />
@ -50,7 +53,7 @@
<view class="timeline-content"> <view class="timeline-content">
<view class="timeline-title-row"> <view class="timeline-title-row">
<text class="timeline-title">开始查验质检</text> <text class="timeline-title">开始查验质检</text>
<text class="timeline-time">{{item.testingTime}}</text>
<text class="timeline-time">{{ item.testingTime }}</text>
</view> </view>
<view class="timeline-desc"> <view class="timeline-desc">
感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验 感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验
@ -73,14 +76,15 @@
<view class="timeline-content"> <view class="timeline-content">
<view class="timeline-title-row"> <view class="timeline-title-row">
<text class="timeline-title">质检说明</text> <text class="timeline-title">质检说明</text>
<text class="timeline-time">{{item.testingTime}}</text>
<text class="timeline-time">{{ item.testingTime }}</text>
</view> </view>
<view class="problem-block"> <view class="problem-block">
<view class="problem-index">01 / {{imagesArr.length.toString().padStart(2, '0')}}</view>
<view class="problem-index">01 / {{ imagesArr.length.toString().padStart(2, '0') }}</view>
<view class="problem-title">质检图片</view> <view class="problem-title">质检图片</view>
<view class="problem-divider"></view> <view class="problem-divider"></view>
<view class="problem-images"> <view class="problem-images">
<view v-for="(img, i) in imagesArr" :key="i" class="img-lock-wrap" @tap="isSelf && previewImage(img, i)">
<view v-for="(img, i) in imagesArr" :key="i" class="img-lock-wrap"
@tap="isSelf && previewImage(img, i)">
<image :src="img" class="problem-img" mode="aspectFill" /> <image :src="img" class="problem-img" mode="aspectFill" />
<view v-if="!isSelf" class="img-lock-mask"> <view v-if="!isSelf" class="img-lock-mask">
<image src="/static/lock.png" class="lock-icon" /> <image src="/static/lock.png" class="lock-icon" />
@ -96,7 +100,7 @@
<view class="timeline-content"> <view class="timeline-content">
<view class="timeline-title-row"> <view class="timeline-title-row">
<text class="timeline-title">开始查验质检</text> <text class="timeline-title">开始查验质检</text>
<text class="timeline-time">{{item.testingTime}}</text>
<text class="timeline-time">{{ item.testingTime }}</text>
</view> </view>
<view class="timeline-desc"> <view class="timeline-desc">
感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验 感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验
@ -138,6 +142,10 @@ export default {
const myUserId = uni.getStorageSync('userInfo')?.id const myUserId = uni.getStorageSync('userInfo')?.id
const orderUserId = this.item.userId const orderUserId = this.item.userId
this.isSelf = myUserId && orderUserId && String(myUserId) === String(orderUserId) this.isSelf = myUserId && orderUserId && String(myUserId) === String(orderUserId)
if (options.isSelf) {
console.log(options.isSelf, 'options.isSelf管理员')
this.isSelf = true
}
// //
if (this.item.testingImages) { if (this.item.testingImages) {
console.log(this.item.testingImages, 'this.item.testingImages') console.log(this.item.testingImages, 'this.item.testingImages')
@ -176,6 +184,7 @@ export default {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
} }
.nav-bar { .nav-bar {
position: fixed; position: fixed;
left: 0; left: 0;
@ -183,17 +192,20 @@ export default {
right: 0; right: 0;
z-index: 1000; z-index: 1000;
background: #fff; background: #fff;
box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.03);
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
height: 100rpx; height: 100rpx;
padding: 0 24rpx; padding: 0 24rpx;
.nav-bar-left, .nav-bar-right {
.nav-bar-left,
.nav-bar-right {
display: flex; display: flex;
align-items: center; align-items: center;
min-width: 60rpx; min-width: 60rpx;
} }
.nav-bar-title { .nav-bar-title {
flex: 1; flex: 1;
text-align: center; text-align: center;
@ -201,11 +213,13 @@ export default {
font-weight: bold; font-weight: bold;
color: #222; color: #222;
} }
max-width: 750rpx; max-width: 750rpx;
margin: 0 auto; margin: 0 auto;
width: 100%; width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.main-content { .main-content {
padding: 32rpx 0 0 0; padding: 32rpx 0 0 0;
width: 100%; width: 100%;
@ -217,10 +231,12 @@ export default {
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
} }
.safe-area-inset-bottom { .safe-area-inset-bottom {
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
} }
.card { .card {
margin: 0 24rpx; margin: 0 24rpx;
border-radius: 32rpx; border-radius: 32rpx;
@ -232,32 +248,53 @@ export default {
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
.card-problem { .card-problem {
background: linear-gradient(180deg, #fff7e6 0%, #fff 40%); background: linear-gradient(180deg, #fff7e6 0%, #fff 40%);
} }
.card-qualified { .card-qualified {
background: linear-gradient(180deg, #e8ffe0 0%, #fff 100%); background: linear-gradient(180deg, #e8ffe0 0%, #fff 100%);
} }
.card-header { .card-header {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.dot { .dot {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
border-radius: 50%; border-radius: 50%;
margin-right: 12rpx; margin-right: 12rpx;
&.dot-orange { background: #ffa800; }
&.dot-green { background: #13ac47; }
&.gray { background: #bbb; }
&.dot-orange {
background: #ffa800;
}
&.dot-green {
background: #13ac47;
}
&.gray {
background: #bbb;
}
} }
.card-title { .card-title {
font-size: 30rpx; font-size: 30rpx;
font-weight: bold; font-weight: bold;
} }
.card-title-orange { color: #ffa800; }
.card-title-green { color: #13ac47; }
.card-title-orange {
color: #ffa800;
}
.card-title-green {
color: #13ac47;
}
.card-desc { .card-desc {
font-size: 24rpx; font-size: 24rpx;
color: #888; color: #888;
@ -265,13 +302,21 @@ export default {
line-height: 1.7; line-height: 1.7;
margin-left: 32rpx + 16rpx; margin-left: 32rpx + 16rpx;
} }
.card-desc-orange { color: #888; }
.card-desc-green { color: #888; }
.card-desc-orange {
color: #888;
}
.card-desc-green {
color: #888;
}
.timeline { .timeline {
position: relative; position: relative;
margin-left: 0; margin-left: 0;
padding-left: 0; padding-left: 0;
} }
.timeline:before { .timeline:before {
content: ''; content: '';
position: absolute; position: absolute;
@ -282,12 +327,14 @@ export default {
background: #eee; background: #eee;
z-index: 0; z-index: 0;
} }
.timeline-item { .timeline-item {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
margin-bottom: 32rpx; margin-bottom: 32rpx;
position: relative; position: relative;
} }
.timeline-dot { .timeline-dot {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
@ -299,28 +346,42 @@ export default {
position: relative; position: relative;
z-index: 1; z-index: 1;
} }
.timeline-dot.dot-orange { background: #ffa800; }
.timeline-dot.dot-green { background: #13ac47; }
.timeline-dot.gray { background: #bbb; }
.timeline-dot.dot-orange {
background: #ffa800;
}
.timeline-dot.dot-green {
background: #13ac47;
}
.timeline-dot.gray {
background: #bbb;
}
.timeline-content { .timeline-content {
flex: 1; flex: 1;
min-width: 0; min-width: 0;
} }
.timeline-title-row { .timeline-title-row {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.timeline-title { .timeline-title {
font-size: 26rpx; font-size: 26rpx;
color: #222; color: #222;
font-weight: bold; font-weight: bold;
margin-right: 16rpx; margin-right: 16rpx;
} }
.timeline-time { .timeline-time {
font-size: 22rpx; font-size: 22rpx;
color: #bbb; color: #bbb;
} }
.problem-block { .problem-block {
background: #f7f8fa; background: #f7f8fa;
border-radius: 20rpx; border-radius: 20rpx;
@ -329,32 +390,38 @@ export default {
max-width: 100%; max-width: 100%;
box-sizing: border-box; box-sizing: border-box;
} }
.problem-index { .problem-index {
font-size: 22rpx; font-size: 22rpx;
color: #bbb; color: #bbb;
margin-bottom: 6rpx; margin-bottom: 6rpx;
} }
.problem-title { .problem-title {
font-size: 26rpx; font-size: 26rpx;
color: #222; color: #222;
font-weight: bold; font-weight: bold;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.problem-divider { .problem-divider {
border-bottom: 2rpx dashed #ddd; border-bottom: 2rpx dashed #ddd;
margin: 12rpx 0 10rpx 0; margin: 12rpx 0 10rpx 0;
} }
.problem-label { .problem-label {
font-size: 22rpx; font-size: 22rpx;
color: #bbb; color: #bbb;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.problem-images { .problem-images {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 12rpx; gap: 12rpx;
max-width: 100%; max-width: 100%;
} }
.problem-img { .problem-img {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
@ -363,20 +430,26 @@ export default {
max-width: 40vw; max-width: 40vw;
max-height: 40vw; max-height: 40vw;
} }
.timeline-desc { .timeline-desc {
font-size: 24rpx; font-size: 24rpx;
color: #888; color: #888;
margin-top: 8rpx; margin-top: 8rpx;
line-height: 1.7; line-height: 1.7;
} }
.img-lock-wrap { .img-lock-wrap {
position: relative; position: relative;
display: inline-block; display: inline-block;
} }
.img-lock-mask { .img-lock-mask {
position: absolute; position: absolute;
left: 0; top: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.45);
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.45);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@ -384,15 +457,17 @@ export default {
border-radius: 12rpx; border-radius: 12rpx;
z-index: 2; z-index: 2;
} }
.lock-icon { .lock-icon {
width: 48rpx; width: 48rpx;
height: 48rpx; height: 48rpx;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.lock-tip { .lock-tip {
color: #fff; color: #fff;
font-size: 20rpx; font-size: 20rpx;
text-align: center; text-align: center;
padding: 0 8rpx; padding: 0 8rpx;
} }
</style>
</style>

+ 108
- 56
pages/subcomponent/inspection-report.vue View File

@ -3,7 +3,7 @@
<!-- 固定顶部区域 --> <!-- 固定顶部区域 -->
<view class="fixed-header"> <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="nav-bar-inner">
<view class="back-icon" @tap="navigateBack"> <view class="back-icon" @tap="navigateBack">
<uni-icons type="left" size="22" color="#fff" /> <uni-icons type="left" size="22" color="#fff" />
@ -20,37 +20,33 @@
<view class="feature-tags"> <view class="feature-tags">
<view class="tag" v-for="(t, i) in featureTags" :key="i"> <view class="tag" v-for="(t, i) in featureTags" :key="i">
<text class="check"></text> <text class="check"></text>
<text class="text">{{t}}</text>
<text class="text">{{ t }}</text>
</view> </view>
</view> </view>
</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 class="content-wrapper">
<view v-if="showQualified && goodsList.length" class="inspection-card"> <view v-if="showQualified && goodsList.length" class="inspection-card">
<view class="report-title">质检合格</view> <view class="report-title">质检合格</view>
<view class="goods-list"> <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" /> <image class="goods-img" :src="item.img" mode="aspectFit" />
<view class="goods-info"> <view class="goods-info">
<view class="goods-row"> <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>
<!-- <view class="goods-desc">{{item.desc}}</view> --> <!-- <view class="goods-desc">{{item.desc}}</view> -->
<view class="goods-bottom-row"> <view class="goods-bottom-row">
<view class="goods-price-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>
<!-- <view class="goods-total">{{item.total}}</view> --> <!-- <view class="goods-total">{{item.total}}</view> -->
</view> </view>
@ -62,26 +58,29 @@
<uni-icons :type="qualifiedCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" /> <uni-icons :type="qualifiedCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" />
</view> </view>
<view class="summary-row"> <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> </view>
<view v-if="showProblem && problemList.length" class="inspection-card problem-card"> <view v-if="showProblem && problemList.length" class="inspection-card problem-card">
<view class="report-title">质量问题</view> <view class="report-title">质量问题</view>
<view class="goods-list"> <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-info">
<view class="goods-row"> <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>
<!-- <view class="goods-desc">{{item.desc}}</view> --> <!-- <view class="goods-desc">{{item.desc}}</view> -->
<view class="goods-bottom-row"> <view class="goods-bottom-row">
<view class="goods-price-row problem-price-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-unit" v-if="item.price">/</text>
<text class="goods-count">x{{item.count}}</text>
<text class="goods-count">x{{ item.count }}</text>
</view> </view>
<!-- <view class="goods-total">{{item.total}}</view> --> <!-- <view class="goods-total">{{item.total}}</view> -->
</view> </view>
@ -93,39 +92,43 @@
<uni-icons :type="problemCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" /> <uni-icons :type="problemCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" />
</view> </view>
<view class="summary-row"> <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> </view>
<view v-if="showUnrecyclable && unrecyclableList.length" class="inspection-card problem-card"> <view v-if="showUnrecyclable && unrecyclableList.length" class="inspection-card problem-card">
<view class="report-title">不可回收</view> <view class="report-title">不可回收</view>
<view class="goods-list"> <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-info">
<view class="goods-row"> <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>
<!-- <view class="goods-desc">{{item.desc}}</view> --> <!-- <view class="goods-desc">{{item.desc}}</view> -->
<view class="goods-bottom-row"> <view class="goods-bottom-row">
<view class="goods-price-row problem-price-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-unit" v-if="item.price">/</text>
<text class="goods-count">x{{item.count}}</text>
<text class="goods-count">x{{ item.count }}</text>
</view> </view>
<!-- <view class="goods-total">{{item.total}}</view> --> <!-- <view class="goods-total">{{item.total}}</view> -->
</view> </view>
</view> </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> <text>{{ unrecyclableCollapsed ? '展开(共' + unrecyclableList.length + '件)' : '收起' }}</text>
<uni-icons :type="unrecyclableCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" /> <uni-icons :type="unrecyclableCollapsed ? 'arrowdown' : 'arrowup'" size="16" color="#bbb" />
</view> </view>
<view class="summary-row"> <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> </view>
</view> </view>
@ -151,11 +154,12 @@ export default {
showQualified: false, showQualified: false,
showProblem: false, showProblem: false,
showUnrecyclable: false, showUnrecyclable: false,
orderId : 0,
orderId: 0,
fixedHeaderHeight: 0, // fixedHeaderHeight: 0, //
qualifiedCollapsed: true, qualifiedCollapsed: true,
problemCollapsed: true, problemCollapsed: true,
unrecyclableCollapsed: true, unrecyclableCollapsed: true,
isSelf: false,
} }
}, },
computed: { computed: {
@ -194,6 +198,14 @@ export default {
displayedUnrecyclableList() { displayedUnrecyclableList() {
return this.unrecyclableCollapsed ? this.unrecyclableList.slice(0, 2) : this.unrecyclableList; 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) { onLoad(options) {
const sysInfo = uni.getSystemInfoSync() const sysInfo = uni.getSystemInfoSync()
@ -201,8 +213,10 @@ export default {
this.navBarHeight = 14 this.navBarHeight = 14
this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
// orderId // orderId
const orderId = options.orderId
this.orderId = orderId
const orderId = options.orderId
this.isSelf = options.isSelf
this.orderId = orderId
if (orderId) { if (orderId) {
this.fetchQualityReport(orderId) this.fetchQualityReport(orderId)
} }
@ -210,9 +224,9 @@ export default {
methods: { methods: {
async fetchQualityReport(orderId) { 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) { if (res && res.code === 200 && res.result) {
this.reportData = res.result this.reportData = res.result
// //
@ -220,7 +234,7 @@ export default {
} }
}) })
}, },
parseOrderData(orderData) { parseOrderData(orderData) {
this.goodsList = [] this.goodsList = []
this.problemList = [] this.problemList = []
@ -249,7 +263,7 @@ export default {
// //
if (sub.testingStatus == 1) { if (sub.testingStatus == 1) {
this.problemList.push({ this.problemList.push({
img: item.image || '/static/default-goods.png',
img: item.image,
name: item.title || '未知品类', name: item.title || '未知品类',
desc: item.pinName ? `${item.pinName}` : '', desc: item.pinName ? `${item.pinName}` : '',
price: item.price || 0, price: item.price || 0,
@ -265,7 +279,7 @@ export default {
// //
if (sub.testingStatus == 2) { if (sub.testingStatus == 2) {
this.unrecyclableList.push({ this.unrecyclableList.push({
img: item.image || '/static/default-goods.png',
img: item.image,
name: item.title || '未知品类', name: item.title || '未知品类',
desc: item.pinName ? `${item.pinName}` : '', desc: item.pinName ? `${item.pinName}` : '',
price: item.price || 0, price: item.price || 0,
@ -299,8 +313,15 @@ export default {
if (!item) return; if (!item) return;
const userId = this.reportData && this.reportData.userId; const userId = this.reportData && this.reportData.userId;
const data = { ...item, 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({ uni.navigateTo({
url: `/pages/subcomponent/inspection-detail?status=${status}&data=${encodeURIComponent(JSON.stringify(data))}`
url
}) })
} }
} }
@ -326,7 +347,8 @@ export default {
.nav-bar { .nav-bar {
width: 100vw; width: 100vw;
background: #422525; 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 { .nav-bar-inner {
display: flex; display: flex;
align-items: center; align-items: center;
@ -335,7 +357,9 @@ export default {
width: 100vw; width: 100vw;
position: relative; position: relative;
} }
.back-icon, .nav-bar-right {
.back-icon,
.nav-bar-right {
width: 44px; width: 44px;
height: 44px; height: 44px;
display: flex; display: flex;
@ -344,8 +368,15 @@ export default {
position: absolute; position: absolute;
top: 0; top: 0;
} }
.back-icon { left: 0; }
.nav-bar-right { right: 0; }
.back-icon {
left: 0;
}
.nav-bar-right {
right: 0;
}
.nav-bar-title { .nav-bar-title {
flex: 1; flex: 1;
text-align: center; text-align: center;
@ -367,7 +398,7 @@ export default {
.feature-area { .feature-area {
margin: 0 32rpx; margin: 0 32rpx;
background:#422525;
background: #422525;
border-radius: 32rpx; border-radius: 32rpx;
padding: 18rpx 24rpx 18rpx 24rpx; padding: 18rpx 24rpx 18rpx 24rpx;
display: flex; display: flex;
@ -387,11 +418,11 @@ export default {
} }
.feature-tags { .feature-tags {
// margin: 0 32rpx;
// margin: 0 32rpx;
background: #533030; background: #533030;
border-radius: 12rpx; border-radius: 12rpx;
box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08); box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
// padding: 0 24rpx;
// padding: 0 24rpx;
width: 100%; width: 100%;
height: 80rpx; height: 80rpx;
display: flex; display: flex;
@ -404,6 +435,7 @@ export default {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
.check { .check {
width: 36rpx; width: 36rpx;
height: 36rpx; height: 36rpx;
@ -416,8 +448,9 @@ export default {
color: #422525; color: #422525;
font-weight: bold; font-weight: bold;
margin-right: 10rpx; 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 { .text {
color: #fff; color: #fff;
font-size: 28rpx; font-size: 28rpx;
@ -456,6 +489,7 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex-shrink: 0; flex-shrink: 0;
.report-title { .report-title {
font-size: 32rpx; font-size: 32rpx;
font-weight: bold; font-weight: bold;
@ -463,6 +497,7 @@ export default {
text-align: center; text-align: center;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.goods-list { .goods-list {
.goods-item { .goods-item {
display: flex; display: flex;
@ -472,6 +507,7 @@ export default {
box-shadow: 0 2rpx 8rpx rgba(60, 167, 250, 0.04); box-shadow: 0 2rpx 8rpx rgba(60, 167, 250, 0.04);
padding: 24rpx 20rpx; padding: 24rpx 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
.goods-img { .goods-img {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
@ -479,19 +515,23 @@ export default {
margin-right: 20rpx; margin-right: 20rpx;
background: #f5f5f5; background: #f5f5f5;
} }
.goods-info { .goods-info {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.goods-row { .goods-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.goods-name { .goods-name {
font-size: 28rpx; font-size: 28rpx;
color: #222; color: #222;
font-weight: bold; font-weight: bold;
} }
.detail-link { .detail-link {
font-size: 24rpx; font-size: 24rpx;
color: #bbb; color: #bbb;
@ -499,29 +539,35 @@ export default {
align-items: center; align-items: center;
} }
} }
.goods-desc { .goods-desc {
font-size: 24rpx; font-size: 24rpx;
color: #bbb; color: #bbb;
margin-bottom: 8rpx; margin-bottom: 8rpx;
} }
.goods-bottom-row { .goods-bottom-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: flex-end; align-items: flex-end;
margin-top: 8rpx; margin-top: 8rpx;
.goods-price-row { .goods-price-row {
display: flex; display: flex;
align-items: baseline; align-items: baseline;
.goods-price { .goods-price {
font-size: 26rpx; font-size: 26rpx;
color: #bbb; color: #bbb;
font-weight: bold; font-weight: bold;
} }
.goods-unit { .goods-unit {
font-size: 24rpx; font-size: 24rpx;
color: #bbb; color: #bbb;
margin-left: 2rpx; margin-left: 2rpx;
} }
.goods-count { .goods-count {
font-size: 22rpx; font-size: 22rpx;
color: #bbb; color: #bbb;
@ -529,6 +575,7 @@ export default {
font-weight: normal; font-weight: normal;
} }
} }
.goods-total { .goods-total {
font-size: 28rpx; font-size: 28rpx;
color: #222; color: #222;
@ -538,8 +585,12 @@ export default {
} }
} }
} }
.goods-item:last-child { margin-bottom: 0; }
.goods-item:last-child {
margin-bottom: 0;
}
} }
.summary-row { .summary-row {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -547,6 +598,7 @@ export default {
margin-top: 24rpx; margin-top: 24rpx;
font-size: 28rpx; font-size: 28rpx;
color: #222; color: #222;
.highlight { .highlight {
color: #f79400; color: #f79400;
font-weight: bold; font-weight: bold;
@ -567,7 +619,7 @@ export default {
color: #13ac47; color: #13ac47;
font-weight: bold; font-weight: bold;
margin-right: 10rpx; 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 { .problem-card {
@ -590,4 +642,4 @@ export default {
justify-content: center; justify-content: center;
gap: 8rpx; gap: 8rpx;
} }
</style>
</style>

Loading…
Cancel
Save