爱简收旧衣按件回收前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

391 lines
11 KiB

  1. <template>
  2. <view class="inspection-detail-page">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}">
  5. <view class="nav-bar-left" @tap="navigateBack">
  6. <uni-icons type="left" size="22" color="#222" />
  7. </view>
  8. <view class="nav-bar-title">质检详情</view>
  9. <view class="nav-bar-right">
  10. <uni-icons type="more-filled" size="22" color="#222" />
  11. <uni-icons type="camera" size="22" color="#222" style="margin-left: 12rpx;" />
  12. </view>
  13. </view>
  14. <view class="main-content safe-area-inset-bottom" :style="{marginTop: navBarTotalHeight + 'px'}">
  15. <view v-if="(status === 'problem' || status === 'unrecyclable') && item" class="card card-problem">
  16. <view class="card-header">
  17. <view class="dot dot-orange"></view>
  18. <text class="card-title card-title-orange">质检有问题不可回收</text>
  19. </view>
  20. <view class="card-desc card-desc-orange">
  21. 感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣并完成质检经平台专业质检员严格查验发现商品存在质量问题
  22. </view>
  23. <view class="timeline">
  24. <view class="timeline-item">
  25. <view class="timeline-dot"></view>
  26. <view class="timeline-content">
  27. <view class="timeline-title-row">
  28. <text class="timeline-title">质检说明</text>
  29. <text class="timeline-time">{{item.testingTime}}</text>
  30. </view>
  31. <view v-for="(desc, idx) in problemDescArr.length ? problemDescArr : [item.problemDesc]" :key="idx" class="problem-block">
  32. <view class="problem-index">{{(idx+1).toString().padStart(2, '0')}} / {{problemDescArr.length.toString().padStart(2, '0')}}</view>
  33. <view class="problem-title">{{desc || '质量问题'}}</view>
  34. <view class="problem-divider"></view>
  35. <view class="problem-label">质量问题实拍</view>
  36. <view class="problem-images">
  37. <view v-for="(img, i) in imagesArr" :key="i" class="img-lock-wrap">
  38. <image :src="img" class="problem-img" mode="aspectFill" />
  39. <view v-if="!isSelf" class="img-lock-mask">
  40. <image src="/static/lock.png" class="lock-icon" />
  41. <view class="lock-tip">为保护用户隐私衣物照片仅本人可见您无权限查看</view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="timeline-item">
  49. <view class="timeline-dot gray"></view>
  50. <view class="timeline-content">
  51. <view class="timeline-title-row">
  52. <text class="timeline-title">开始查验质检</text>
  53. <text class="timeline-time">{{item.testingTime}}</text>
  54. </view>
  55. <view class="timeline-desc">
  56. 感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. <view v-else-if="status === 'qualified' && item" class="card card-qualified">
  63. <view class="card-header">
  64. <view class="dot dot-green"></view>
  65. <text class="card-title card-title-green">质检合格</text>
  66. </view>
  67. <view class="card-desc card-desc-green">
  68. 感谢您参与旧衣回收活动支持环保事业\n经平台专业质检员严格查验商品合格
  69. </view>
  70. <view class="timeline">
  71. <view class="timeline-item">
  72. <view class="timeline-dot"></view>
  73. <view class="timeline-content">
  74. <view class="timeline-title-row">
  75. <text class="timeline-title">质检说明</text>
  76. <text class="timeline-time">{{item.testingTime}}</text>
  77. </view>
  78. <view class="problem-block">
  79. <view class="problem-index">01 / {{imagesArr.length.toString().padStart(2, '0')}}</view>
  80. <view class="problem-title">质检图片</view>
  81. <view class="problem-divider"></view>
  82. <view class="problem-images">
  83. <view v-for="(img, i) in imagesArr" :key="i" class="img-lock-wrap">
  84. <image :src="img" class="problem-img" mode="aspectFill" />
  85. <view v-if="!isSelf" class="img-lock-mask">
  86. <image src="/static/lock.png" class="lock-icon" />
  87. <view class="lock-tip">为保护用户隐私衣物照片仅本人可见您无权限查看</view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. <view class="timeline-item">
  95. <view class="timeline-dot gray"></view>
  96. <view class="timeline-content">
  97. <view class="timeline-title-row">
  98. <text class="timeline-title">开始查验质检</text>
  99. <text class="timeline-time">{{item.testingTime}}</text>
  100. </view>
  101. <view class="timeline-desc">
  102. 感谢您参与旧衣回收活动支持环保事业\n我们已收到您的旧衣正在进行逐件查验
  103. </view>
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. export default {
  113. data() {
  114. return {
  115. status: 'problem', // 'problem' or 'qualified' or 'unrecyclable'
  116. statusBarHeight: 0,
  117. navBarHeight: 44,
  118. navBarTotalHeight: 44,
  119. item: null,
  120. problemDescArr: [],
  121. imagesArr: [],
  122. isSelf: true,
  123. }
  124. },
  125. onLoad(options) {
  126. // 适配顶部安全区
  127. const sysInfo = uni.getSystemInfoSync()
  128. this.statusBarHeight = sysInfo.statusBarHeight
  129. this.navBarHeight = 44
  130. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
  131. if (options && options.status) {
  132. this.status = options.status
  133. }
  134. if (options.data) {
  135. this.item = JSON.parse(decodeURIComponent(options.data))
  136. // 获取当前登录用户id
  137. const myUserId = uni.getStorageSync('userInfo')?.id
  138. const orderUserId = this.item.userId
  139. this.isSelf = myUserId && orderUserId && String(myUserId) === String(orderUserId)
  140. // 处理图片数组
  141. if (this.item.testingImages) {
  142. console.log(this.item.testingImages, 'this.item.testingImages')
  143. this.imagesArr = String(this.item.testingImages).split(',').filter(i => i)
  144. } else {
  145. this.imagesArr = []
  146. }
  147. // 处理问题描述数组
  148. if (this.item.problemDesc) {
  149. this.problemDescArr = String(this.item.problemDesc).split(',').filter(i => i)
  150. } else {
  151. this.problemDescArr = []
  152. }
  153. }
  154. },
  155. methods: {
  156. navigateBack() {
  157. uni.navigateBack()
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .inspection-detail-page {
  164. min-height: 100vh;
  165. background: #f7f7f7;
  166. box-sizing: border-box;
  167. display: flex;
  168. flex-direction: column;
  169. align-items: center;
  170. }
  171. .nav-bar {
  172. position: fixed;
  173. left: 0;
  174. top: 0;
  175. right: 0;
  176. z-index: 1000;
  177. background: #fff;
  178. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  179. display: flex;
  180. align-items: center;
  181. justify-content: space-between;
  182. height: 100rpx;
  183. padding: 0 24rpx;
  184. .nav-bar-left, .nav-bar-right {
  185. display: flex;
  186. align-items: center;
  187. min-width: 60rpx;
  188. }
  189. .nav-bar-title {
  190. flex: 1;
  191. text-align: center;
  192. font-size: 34rpx;
  193. font-weight: bold;
  194. color: #222;
  195. }
  196. max-width: 750rpx;
  197. margin: 0 auto;
  198. width: 100%;
  199. box-sizing: border-box;
  200. }
  201. .main-content {
  202. padding: 32rpx 0 0 0;
  203. width: 100%;
  204. max-width: 750rpx;
  205. margin: 0 auto;
  206. box-sizing: border-box;
  207. display: flex;
  208. flex-direction: column;
  209. align-items: center;
  210. overflow: hidden;
  211. }
  212. .safe-area-inset-bottom {
  213. padding-bottom: constant(safe-area-inset-bottom);
  214. padding-bottom: env(safe-area-inset-bottom);
  215. }
  216. .card {
  217. margin: 0 24rpx;
  218. border-radius: 32rpx;
  219. padding: 32rpx 32rpx 24rpx 32rpx;
  220. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
  221. background: #fff;
  222. max-width: 700rpx;
  223. width: 100%;
  224. box-sizing: border-box;
  225. position: relative;
  226. }
  227. .card-problem {
  228. background: linear-gradient(180deg, #fff7e6 0%, #fff 40%);
  229. }
  230. .card-qualified {
  231. background: linear-gradient(180deg, #e8ffe0 0%, #fff 100%);
  232. }
  233. .card-header {
  234. display: flex;
  235. align-items: center;
  236. margin-bottom: 12rpx;
  237. }
  238. .dot {
  239. width: 16rpx;
  240. height: 16rpx;
  241. border-radius: 50%;
  242. margin-right: 12rpx;
  243. &.dot-orange { background: #ffa800; }
  244. &.dot-green { background: #13ac47; }
  245. &.gray { background: #bbb; }
  246. }
  247. .card-title {
  248. font-size: 30rpx;
  249. font-weight: bold;
  250. }
  251. .card-title-orange { color: #ffa800; }
  252. .card-title-green { color: #13ac47; }
  253. .card-desc {
  254. font-size: 24rpx;
  255. color: #888;
  256. margin-bottom: 24rpx;
  257. line-height: 1.7;
  258. margin-left: 32rpx + 16rpx;
  259. }
  260. .card-desc-orange { color: #888; }
  261. .card-desc-green { color: #888; }
  262. .timeline {
  263. position: relative;
  264. margin-left: 0;
  265. padding-left: 0;
  266. }
  267. .timeline:before {
  268. content: '';
  269. position: absolute;
  270. left: 8rpx;
  271. top: 0;
  272. bottom: 0;
  273. width: 2rpx;
  274. background: #eee;
  275. z-index: 0;
  276. }
  277. .timeline-item {
  278. display: flex;
  279. align-items: flex-start;
  280. margin-bottom: 32rpx;
  281. position: relative;
  282. }
  283. .timeline-dot {
  284. width: 16rpx;
  285. height: 16rpx;
  286. border-radius: 50%;
  287. background: #bbb;
  288. margin-right: 16rpx;
  289. margin-top: 8rpx;
  290. flex-shrink: 0;
  291. position: relative;
  292. z-index: 1;
  293. }
  294. .timeline-dot.dot-orange { background: #ffa800; }
  295. .timeline-dot.dot-green { background: #13ac47; }
  296. .timeline-dot.gray { background: #bbb; }
  297. .timeline-content {
  298. flex: 1;
  299. min-width: 0;
  300. }
  301. .timeline-title-row {
  302. display: flex;
  303. align-items: center;
  304. margin-bottom: 12rpx;
  305. }
  306. .timeline-title {
  307. font-size: 26rpx;
  308. color: #222;
  309. font-weight: bold;
  310. margin-right: 16rpx;
  311. }
  312. .timeline-time {
  313. font-size: 22rpx;
  314. color: #bbb;
  315. }
  316. .problem-block {
  317. background: #f7f8fa;
  318. border-radius: 20rpx;
  319. padding: 24rpx 20rpx 16rpx 20rpx;
  320. margin-bottom: 20rpx;
  321. max-width: 100%;
  322. box-sizing: border-box;
  323. }
  324. .problem-index {
  325. font-size: 22rpx;
  326. color: #bbb;
  327. margin-bottom: 6rpx;
  328. }
  329. .problem-title {
  330. font-size: 26rpx;
  331. color: #222;
  332. font-weight: bold;
  333. margin-bottom: 8rpx;
  334. }
  335. .problem-divider {
  336. border-bottom: 2rpx dashed #ddd;
  337. margin: 12rpx 0 10rpx 0;
  338. }
  339. .problem-label {
  340. font-size: 22rpx;
  341. color: #bbb;
  342. margin-bottom: 8rpx;
  343. }
  344. .problem-images {
  345. display: flex;
  346. flex-wrap: wrap;
  347. gap: 12rpx;
  348. max-width: 100%;
  349. }
  350. .problem-img {
  351. width: 120rpx;
  352. height: 120rpx;
  353. border-radius: 12rpx;
  354. background: #eee;
  355. max-width: 40vw;
  356. max-height: 40vw;
  357. }
  358. .timeline-desc {
  359. font-size: 24rpx;
  360. color: #888;
  361. margin-top: 8rpx;
  362. line-height: 1.7;
  363. }
  364. .img-lock-wrap {
  365. position: relative;
  366. display: inline-block;
  367. }
  368. .img-lock-mask {
  369. position: absolute;
  370. left: 0; top: 0; right: 0; bottom: 0;
  371. background: rgba(0,0,0,0.45);
  372. display: flex;
  373. flex-direction: column;
  374. align-items: center;
  375. justify-content: center;
  376. border-radius: 12rpx;
  377. z-index: 2;
  378. }
  379. .lock-icon {
  380. width: 48rpx;
  381. height: 48rpx;
  382. margin-bottom: 8rpx;
  383. }
  384. .lock-tip {
  385. color: #fff;
  386. font-size: 20rpx;
  387. text-align: center;
  388. padding: 0 8rpx;
  389. }
  390. </style>