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

397 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" @tap="isSelf && previewImage(img, i)">
  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" @tap="isSelf && previewImage(img, i)">
  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. previewImage(img, i) {
  160. uni.previewImage({
  161. current: img,
  162. urls: this.imagesArr
  163. })
  164. }
  165. }
  166. }
  167. </script>
  168. <style lang="scss" scoped>
  169. .inspection-detail-page {
  170. min-height: 100vh;
  171. background: #f7f7f7;
  172. box-sizing: border-box;
  173. display: flex;
  174. flex-direction: column;
  175. align-items: center;
  176. }
  177. .nav-bar {
  178. position: fixed;
  179. left: 0;
  180. top: 0;
  181. right: 0;
  182. z-index: 1000;
  183. background: #fff;
  184. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  185. display: flex;
  186. align-items: center;
  187. justify-content: space-between;
  188. height: 100rpx;
  189. padding: 0 24rpx;
  190. .nav-bar-left, .nav-bar-right {
  191. display: flex;
  192. align-items: center;
  193. min-width: 60rpx;
  194. }
  195. .nav-bar-title {
  196. flex: 1;
  197. text-align: center;
  198. font-size: 34rpx;
  199. font-weight: bold;
  200. color: #222;
  201. }
  202. max-width: 750rpx;
  203. margin: 0 auto;
  204. width: 100%;
  205. box-sizing: border-box;
  206. }
  207. .main-content {
  208. padding: 32rpx 0 0 0;
  209. width: 100%;
  210. max-width: 750rpx;
  211. margin: 0 auto;
  212. box-sizing: border-box;
  213. display: flex;
  214. flex-direction: column;
  215. align-items: center;
  216. overflow: hidden;
  217. }
  218. .safe-area-inset-bottom {
  219. padding-bottom: constant(safe-area-inset-bottom);
  220. padding-bottom: env(safe-area-inset-bottom);
  221. }
  222. .card {
  223. margin: 0 24rpx;
  224. border-radius: 32rpx;
  225. padding: 32rpx 32rpx 24rpx 32rpx;
  226. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
  227. background: #fff;
  228. max-width: 700rpx;
  229. width: 100%;
  230. box-sizing: border-box;
  231. position: relative;
  232. }
  233. .card-problem {
  234. background: linear-gradient(180deg, #fff7e6 0%, #fff 40%);
  235. }
  236. .card-qualified {
  237. background: linear-gradient(180deg, #e8ffe0 0%, #fff 100%);
  238. }
  239. .card-header {
  240. display: flex;
  241. align-items: center;
  242. margin-bottom: 12rpx;
  243. }
  244. .dot {
  245. width: 16rpx;
  246. height: 16rpx;
  247. border-radius: 50%;
  248. margin-right: 12rpx;
  249. &.dot-orange { background: #ffa800; }
  250. &.dot-green { background: #13ac47; }
  251. &.gray { background: #bbb; }
  252. }
  253. .card-title {
  254. font-size: 30rpx;
  255. font-weight: bold;
  256. }
  257. .card-title-orange { color: #ffa800; }
  258. .card-title-green { color: #13ac47; }
  259. .card-desc {
  260. font-size: 24rpx;
  261. color: #888;
  262. margin-bottom: 24rpx;
  263. line-height: 1.7;
  264. margin-left: 32rpx + 16rpx;
  265. }
  266. .card-desc-orange { color: #888; }
  267. .card-desc-green { color: #888; }
  268. .timeline {
  269. position: relative;
  270. margin-left: 0;
  271. padding-left: 0;
  272. }
  273. .timeline:before {
  274. content: '';
  275. position: absolute;
  276. left: 8rpx;
  277. top: 0;
  278. bottom: 0;
  279. width: 2rpx;
  280. background: #eee;
  281. z-index: 0;
  282. }
  283. .timeline-item {
  284. display: flex;
  285. align-items: flex-start;
  286. margin-bottom: 32rpx;
  287. position: relative;
  288. }
  289. .timeline-dot {
  290. width: 16rpx;
  291. height: 16rpx;
  292. border-radius: 50%;
  293. background: #bbb;
  294. margin-right: 16rpx;
  295. margin-top: 8rpx;
  296. flex-shrink: 0;
  297. position: relative;
  298. z-index: 1;
  299. }
  300. .timeline-dot.dot-orange { background: #ffa800; }
  301. .timeline-dot.dot-green { background: #13ac47; }
  302. .timeline-dot.gray { background: #bbb; }
  303. .timeline-content {
  304. flex: 1;
  305. min-width: 0;
  306. }
  307. .timeline-title-row {
  308. display: flex;
  309. align-items: center;
  310. margin-bottom: 12rpx;
  311. }
  312. .timeline-title {
  313. font-size: 26rpx;
  314. color: #222;
  315. font-weight: bold;
  316. margin-right: 16rpx;
  317. }
  318. .timeline-time {
  319. font-size: 22rpx;
  320. color: #bbb;
  321. }
  322. .problem-block {
  323. background: #f7f8fa;
  324. border-radius: 20rpx;
  325. padding: 24rpx 20rpx 16rpx 20rpx;
  326. margin-bottom: 20rpx;
  327. max-width: 100%;
  328. box-sizing: border-box;
  329. }
  330. .problem-index {
  331. font-size: 22rpx;
  332. color: #bbb;
  333. margin-bottom: 6rpx;
  334. }
  335. .problem-title {
  336. font-size: 26rpx;
  337. color: #222;
  338. font-weight: bold;
  339. margin-bottom: 8rpx;
  340. }
  341. .problem-divider {
  342. border-bottom: 2rpx dashed #ddd;
  343. margin: 12rpx 0 10rpx 0;
  344. }
  345. .problem-label {
  346. font-size: 22rpx;
  347. color: #bbb;
  348. margin-bottom: 8rpx;
  349. }
  350. .problem-images {
  351. display: flex;
  352. flex-wrap: wrap;
  353. gap: 12rpx;
  354. max-width: 100%;
  355. }
  356. .problem-img {
  357. width: 120rpx;
  358. height: 120rpx;
  359. border-radius: 12rpx;
  360. background: #eee;
  361. max-width: 40vw;
  362. max-height: 40vw;
  363. }
  364. .timeline-desc {
  365. font-size: 24rpx;
  366. color: #888;
  367. margin-top: 8rpx;
  368. line-height: 1.7;
  369. }
  370. .img-lock-wrap {
  371. position: relative;
  372. display: inline-block;
  373. }
  374. .img-lock-mask {
  375. position: absolute;
  376. left: 0; top: 0; right: 0; bottom: 0;
  377. background: rgba(0,0,0,0.45);
  378. display: flex;
  379. flex-direction: column;
  380. align-items: center;
  381. justify-content: center;
  382. border-radius: 12rpx;
  383. z-index: 2;
  384. }
  385. .lock-icon {
  386. width: 48rpx;
  387. height: 48rpx;
  388. margin-bottom: 8rpx;
  389. }
  390. .lock-tip {
  391. color: #fff;
  392. font-size: 20rpx;
  393. text-align: center;
  394. padding: 0 8rpx;
  395. }
  396. </style>