爱简收旧衣按件回收前端代码仓库
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.

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