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

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