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

406 lines
12 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">{{item.title}}</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.toString().padStart(2, '0')}}</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. testingTime: '',
  106. testingImages: [],
  107. statusBarHeight: 0,
  108. navBarHeight: 44,
  109. navBarTotalHeight: 44,
  110. // 质量问题示例数据
  111. problemList: [
  112. {
  113. title: '大面积破损',
  114. images: [
  115. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
  116. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
  117. ]
  118. },
  119. {
  120. title: '大面积破损',
  121. images: [
  122. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
  123. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
  124. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
  125. ]
  126. },
  127. {
  128. title: '大面积破损',
  129. images: [
  130. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png',
  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. ]
  135. }
  136. ],
  137. // 合格图片示例
  138. qualifiedImages: [
  139. 'https://oss.budingxiaoshuo.com/upload/组46584_1747804049771.png'
  140. ]
  141. }
  142. },
  143. onLoad(options) {
  144. // 适配顶部安全区
  145. const sysInfo = uni.getSystemInfoSync()
  146. this.statusBarHeight = sysInfo.statusBarHeight
  147. this.navBarHeight = 44
  148. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
  149. // 可通过 options.status = 'problem'/'qualified' 控制状态
  150. if (options && options.status) {
  151. this.status = options.status
  152. }
  153. if (options.testingStatus) {
  154. this.testingStatus = options.testingStatus
  155. }
  156. // 处理 testingInstructions,转换为数组
  157. let testingInstructionsArray = []
  158. if (options.testingInstructions) {
  159. const instructionsStr = decodeURIComponent(options.testingInstructions)
  160. if (instructionsStr && instructionsStr.trim()) {
  161. // 按逗号分割成数组,并过滤空值
  162. testingInstructionsArray = instructionsStr.split(',').filter(item => item.trim() !== '')
  163. }
  164. }
  165. if (options.testingTime) {
  166. this.testingTime = decodeURIComponent(options.testingTime)
  167. }
  168. if (options.testingImages) {
  169. // 逗号分割为数组
  170. this.testingImages = decodeURIComponent(options.testingImages).split(',').filter(item => item.trim() !== '')
  171. }
  172. // 可根据 status 动态设置 problemList/qualifiedImages
  173. if (this.status === 'problem') {
  174. // 根据 testingInstructions 数组创建对应的问题列表
  175. if (testingInstructionsArray.length > 0) {
  176. this.problemList = testingInstructionsArray.map((instruction, index) => ({
  177. title: instruction || '质量问题',
  178. images: this.testingImages // 所有问题共享图片,如果需要分别对应可以进一步处理
  179. }))
  180. } else {
  181. // 如果没有具体说明,创建默认的问题项
  182. this.problemList = [
  183. {
  184. title: '质量问题',
  185. images: this.testingImages
  186. }
  187. ]
  188. }
  189. } else if (this.status === 'qualified') {
  190. this.qualifiedImages = this.testingImages
  191. }
  192. },
  193. methods: {
  194. navigateBack() {
  195. uni.navigateBack()
  196. }
  197. }
  198. }
  199. </script>
  200. <style lang="scss" scoped>
  201. .inspection-detail-page {
  202. min-height: 100vh;
  203. background: #f7f7f7;
  204. box-sizing: border-box;
  205. display: flex;
  206. flex-direction: column;
  207. align-items: center;
  208. }
  209. .nav-bar {
  210. position: fixed;
  211. left: 0;
  212. top: 0;
  213. right: 0;
  214. z-index: 1000;
  215. background: #fff;
  216. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  217. display: flex;
  218. align-items: center;
  219. justify-content: space-between;
  220. height: 100rpx;
  221. padding: 0 24rpx;
  222. .nav-bar-left, .nav-bar-right {
  223. display: flex;
  224. align-items: center;
  225. min-width: 60rpx;
  226. }
  227. .nav-bar-title {
  228. flex: 1;
  229. text-align: center;
  230. font-size: 34rpx;
  231. font-weight: bold;
  232. color: #222;
  233. }
  234. max-width: 750rpx;
  235. margin: 0 auto;
  236. width: 100%;
  237. box-sizing: border-box;
  238. }
  239. .main-content {
  240. padding: 32rpx 0 0 0;
  241. width: 100%;
  242. max-width: 750rpx;
  243. margin: 0 auto;
  244. box-sizing: border-box;
  245. display: flex;
  246. flex-direction: column;
  247. align-items: center;
  248. overflow: hidden;
  249. }
  250. .safe-area-inset-bottom {
  251. padding-bottom: constant(safe-area-inset-bottom);
  252. padding-bottom: env(safe-area-inset-bottom);
  253. }
  254. .card {
  255. margin: 0 24rpx;
  256. border-radius: 32rpx;
  257. padding: 32rpx 32rpx 24rpx 32rpx;
  258. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
  259. background: #fff;
  260. max-width: 700rpx;
  261. width: 100%;
  262. box-sizing: border-box;
  263. position: relative;
  264. }
  265. .card-problem {
  266. background: linear-gradient(180deg, #fff7e6 0%, #fff 40%);
  267. }
  268. .card-qualified {
  269. background: linear-gradient(180deg, #e8ffe0 0%, #fff 100%);
  270. }
  271. .card-header {
  272. display: flex;
  273. align-items: center;
  274. margin-bottom: 12rpx;
  275. }
  276. .dot {
  277. width: 16rpx;
  278. height: 16rpx;
  279. border-radius: 50%;
  280. margin-right: 12rpx;
  281. &.dot-orange { background: #ffa800; }
  282. &.dot-green { background: #13ac47; }
  283. &.gray { background: #bbb; }
  284. }
  285. .card-title {
  286. font-size: 30rpx;
  287. font-weight: bold;
  288. }
  289. .card-title-orange { color: #ffa800; }
  290. .card-title-green { color: #13ac47; }
  291. .card-desc {
  292. font-size: 24rpx;
  293. color: #888;
  294. margin-bottom: 24rpx;
  295. line-height: 1.7;
  296. margin-left: 32rpx + 16rpx;
  297. }
  298. .card-desc-orange { color: #888; }
  299. .card-desc-green { color: #888; }
  300. .timeline {
  301. position: relative;
  302. margin-left: 0;
  303. padding-left: 0;
  304. }
  305. .timeline:before {
  306. content: '';
  307. position: absolute;
  308. left: 8rpx;
  309. top: 0;
  310. bottom: 0;
  311. width: 2rpx;
  312. background: #eee;
  313. z-index: 0;
  314. }
  315. .timeline-item {
  316. display: flex;
  317. align-items: flex-start;
  318. margin-bottom: 32rpx;
  319. position: relative;
  320. }
  321. .timeline-dot {
  322. width: 16rpx;
  323. height: 16rpx;
  324. border-radius: 50%;
  325. background: #bbb;
  326. margin-right: 16rpx;
  327. margin-top: 8rpx;
  328. flex-shrink: 0;
  329. position: relative;
  330. z-index: 1;
  331. }
  332. .timeline-dot.dot-orange { background: #ffa800; }
  333. .timeline-dot.dot-green { background: #13ac47; }
  334. .timeline-dot.gray { background: #bbb; }
  335. .timeline-content {
  336. flex: 1;
  337. min-width: 0;
  338. }
  339. .timeline-title-row {
  340. display: flex;
  341. align-items: center;
  342. margin-bottom: 12rpx;
  343. }
  344. .timeline-title {
  345. font-size: 26rpx;
  346. color: #222;
  347. font-weight: bold;
  348. margin-right: 16rpx;
  349. }
  350. .timeline-time {
  351. font-size: 22rpx;
  352. color: #bbb;
  353. }
  354. .problem-block {
  355. background: #f7f8fa;
  356. border-radius: 20rpx;
  357. padding: 24rpx 20rpx 16rpx 20rpx;
  358. margin-bottom: 20rpx;
  359. max-width: 100%;
  360. box-sizing: border-box;
  361. }
  362. .problem-index {
  363. font-size: 22rpx;
  364. color: #bbb;
  365. margin-bottom: 6rpx;
  366. }
  367. .problem-title {
  368. font-size: 26rpx;
  369. color: #222;
  370. font-weight: bold;
  371. margin-bottom: 8rpx;
  372. }
  373. .problem-divider {
  374. border-bottom: 2rpx dashed #ddd;
  375. margin: 12rpx 0 10rpx 0;
  376. }
  377. .problem-label {
  378. font-size: 22rpx;
  379. color: #bbb;
  380. margin-bottom: 8rpx;
  381. }
  382. .problem-images {
  383. display: flex;
  384. flex-wrap: wrap;
  385. gap: 12rpx;
  386. max-width: 100%;
  387. }
  388. .problem-img {
  389. width: 120rpx;
  390. height: 120rpx;
  391. border-radius: 12rpx;
  392. background: #eee;
  393. max-width: 40vw;
  394. max-height: 40vw;
  395. }
  396. .timeline-desc {
  397. font-size: 24rpx;
  398. color: #888;
  399. margin-top: 8rpx;
  400. line-height: 1.7;
  401. }
  402. </style>