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

372 lines
9.2 KiB

5 days ago
  1. <template>
  2. <view class="inspection-page">
  3. <!-- 顶部渐变导航栏 -->
  4. <view class="nav-bar" :style="{height: navBarTotalHeight + 'px', paddingTop: statusBarHeight + 'px'}">
  5. <view class="nav-bar-inner">
  6. <view class="back-icon" @tap="navigateBack">
  7. <uni-icons type="left" size="22" color="#fff" />
  8. </view>
  9. <view class="nav-bar-title">质检报告</view>
  10. <view class="nav-bar-right">
  11. <uni-icons type="more-filled" size="22" color="#fff" />
  12. </view>
  13. </view>
  14. </view>
  15. <!-- 打钩标签区及说明 -->
  16. <view class="feature-area" :style="{marginTop: navBarTotalHeight+statusBarHeight + 'px'}">
  17. <view class="feature-desc">该报告由瀚海回收质检查验出具</view>
  18. <view class="feature-tags">
  19. <view class="tag" v-for="(t, i) in featureTags" :key="i">
  20. <text class="check"></text>
  21. <text class="text">{{t}}</text>
  22. </view>
  23. </view>
  24. </view>
  25. <!-- 主内容区卡片悬浮覆盖打钩区 -->
  26. <view class="main-content">
  27. <view class="inspection-card">
  28. <view class="report-title">质检合格</view>
  29. <view class="goods-list">
  30. <view class="goods-item" v-for="(item, i) in goodsList" :key="i">
  31. <image class="goods-img" :src="item.img" mode="aspectFit" />
  32. <view class="goods-info">
  33. <view class="goods-row">
  34. <view class="goods-name">{{item.name}}</view>
  35. <view v-if="item.detail" class="detail-link">查看详情 <uni-icons type="right" size="16" color="#bbb" /></view>
  36. </view>
  37. <view class="goods-desc">{{item.desc}}</view>
  38. <view class="goods-bottom-row">
  39. <view class="goods-price-row">
  40. <text class="goods-price">{{item.price}}</text>
  41. <text class="goods-unit">/</text>
  42. <text class="goods-count">x{{item.count}}</text>
  43. </view>
  44. <view class="goods-total">{{item.total}}</view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="summary-row">
  50. <text>件数<text class="highlight">{{totalCount}}</text> </text>
  51. <text>结算金额<text class="highlight">{{totalAmount}}</text></text>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. </template>
  57. <script>
  58. import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
  59. export default {
  60. mixins: [pullRefreshMixin],
  61. data() {
  62. return {
  63. statusBarHeight: 0,
  64. navBarHeight: 14,
  65. navBarTotalHeight: 14,
  66. featureTags: ['透明检', '专业验', '公正评', '逐件验'],
  67. goodsList: [
  68. {
  69. img: '/static/goods1.png',
  70. name: '羽绒服',
  71. desc: '允许脏破烂,160码以上',
  72. price: 8,
  73. count: 8,
  74. total: 64
  75. },
  76. {
  77. img: '/static/goods2.png',
  78. name: '品牌羽绒服',
  79. desc: '允许脏破烂,160码以上',
  80. price: 10,
  81. count: 1,
  82. total: 8,
  83. detail: true
  84. }
  85. ]
  86. }
  87. },
  88. computed: {
  89. totalCount() {
  90. return this.goodsList.reduce((sum, item) => sum + item.count, 0)
  91. },
  92. totalAmount() {
  93. return this.goodsList.reduce((sum, item) => sum + item.total, 0).toFixed(1)
  94. }
  95. },
  96. onLoad() {
  97. const sysInfo = uni.getSystemInfoSync()
  98. this.statusBarHeight = sysInfo.statusBarHeight
  99. this.navBarHeight = 14
  100. this.navBarTotalHeight = this.statusBarHeight + this.navBarHeight
  101. },
  102. methods: {
  103. async onRefresh() {
  104. // 模拟刷新数据
  105. await new Promise(resolve => setTimeout(resolve, 1000))
  106. this.stopPullRefresh()
  107. },
  108. navigateBack() {
  109. uni.navigateBack()
  110. }
  111. }
  112. }
  113. </script>
  114. <style lang="scss" scoped>
  115. .inspection-page {
  116. min-height: 100vh;
  117. background: #422525;
  118. // padding-bottom: calc(env(safe-area-inset-bottom) + 120rpx);
  119. }
  120. .nav-bar {
  121. position: fixed;
  122. top: 0;
  123. left: 0;
  124. right: 0;
  125. z-index: 1000;
  126. width: 100vw;
  127. background: #422525;
  128. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.03);
  129. .nav-bar-inner {
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. height: 44px;
  134. width: 100vw;
  135. position: relative;
  136. }
  137. .back-icon, .nav-bar-right {
  138. width: 44px;
  139. height: 44px;
  140. display: flex;
  141. align-items: center;
  142. justify-content: center;
  143. position: absolute;
  144. top: 0;
  145. }
  146. .back-icon { left: 0; }
  147. .nav-bar-right { right: 0; }
  148. .nav-bar-title {
  149. flex: 1;
  150. text-align: center;
  151. font-size: 36rpx;
  152. font-weight: bold;
  153. color: #fff;
  154. letter-spacing: 2rpx;
  155. line-height: 44px;
  156. font-family: DingTalk JinBuTi;
  157. font-weight: 400;
  158. font-style: italic;
  159. font-size: 28px;
  160. line-height: 100%;
  161. letter-spacing: 0%;
  162. text-align: center;
  163. // vertical-align: bottom;
  164. }
  165. }
  166. .feature-area {
  167. margin: 0 32rpx;
  168. margin-top: 0;
  169. margin-bottom: 0;
  170. background:#422525;
  171. border-radius: 32rpx;
  172. // box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
  173. padding: 18rpx 24rpx 18rpx 24rpx;
  174. display: flex;
  175. flex-direction: column;
  176. align-items: stretch;
  177. }
  178. .feature-desc {
  179. text-align: center;
  180. font-size: 22rpx;
  181. color: #fff;
  182. font-weight: 500;
  183. margin-bottom: 10rpx;
  184. margin-top: 18rpx;
  185. letter-spacing: 1rpx;
  186. }
  187. .feature-tags {
  188. margin: 0 32rpx;
  189. background: #533030;
  190. border-radius: 12rpx;
  191. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.08);
  192. // padding: 0 24rpx;
  193. width: 100%;
  194. height: 80rpx;
  195. display: flex;
  196. flex-direction: row;
  197. justify-content: space-between;
  198. align-items: center;
  199. .tag {
  200. flex: 1;
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. .check {
  205. width: 36rpx;
  206. height: 36rpx;
  207. background: #fff;
  208. border-radius: 50%;
  209. display: flex;
  210. align-items: center;
  211. justify-content: center;
  212. font-size: 28rpx;
  213. color: #422525;
  214. font-weight: bold;
  215. margin-right: 10rpx;
  216. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  217. }
  218. .text {
  219. color: #fff;
  220. font-size: 28rpx;
  221. font-weight: bold;
  222. }
  223. }
  224. }
  225. .main-content {
  226. margin-top: 20rpx;
  227. padding-top: 88rpx;
  228. background: linear-gradient(180deg, #fef7e6 0%, #fff 50%);
  229. min-height: 100vh;
  230. width: 100vw;
  231. box-sizing: border-box;
  232. position: relative;
  233. z-index: 11;
  234. border-radius: 40rpx 40rpx 0 0;
  235. overflow: hidden;
  236. display: flex;
  237. flex-direction: column;
  238. align-items: center;
  239. }
  240. .inspection-card {
  241. background: #fff;
  242. border-radius: 32rpx;
  243. box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.08);
  244. padding: 40rpx 32rpx 32rpx 32rpx;
  245. margin: -60rpx auto 0 auto;
  246. width: calc(100vw - 64rpx);
  247. max-width: 700rpx;
  248. display: flex;
  249. flex-direction: column;
  250. .report-title {
  251. font-size: 32rpx;
  252. font-weight: bold;
  253. color: #222;
  254. text-align: center;
  255. margin-bottom: 12rpx;
  256. }
  257. .goods-list {
  258. .goods-item {
  259. display: flex;
  260. align-items: center;
  261. background: #fff;
  262. border-radius: 20rpx;
  263. box-shadow: 0 2rpx 8rpx rgba(60, 167, 250, 0.04);
  264. padding: 24rpx 20rpx;
  265. margin-bottom: 20rpx;
  266. .goods-img {
  267. width: 80rpx;
  268. height: 80rpx;
  269. border-radius: 16rpx;
  270. margin-right: 20rpx;
  271. background: #f5f5f5;
  272. }
  273. .goods-info {
  274. flex: 1;
  275. display: flex;
  276. flex-direction: column;
  277. .goods-row {
  278. display: flex;
  279. justify-content: space-between;
  280. align-items: center;
  281. .goods-name {
  282. font-size: 28rpx;
  283. color: #222;
  284. font-weight: bold;
  285. }
  286. .detail-link {
  287. font-size: 24rpx;
  288. color: #bbb;
  289. display: flex;
  290. align-items: center;
  291. }
  292. }
  293. .goods-desc {
  294. font-size: 24rpx;
  295. color: #bbb;
  296. margin-bottom: 8rpx;
  297. }
  298. .goods-bottom-row {
  299. display: flex;
  300. justify-content: space-between;
  301. align-items: flex-end;
  302. margin-top: 8rpx;
  303. .goods-price-row {
  304. display: flex;
  305. align-items: baseline;
  306. .goods-price {
  307. font-size: 26rpx;
  308. color: #f79400;
  309. font-weight: bold;
  310. }
  311. .goods-unit {
  312. font-size: 24rpx;
  313. color: #f79400;
  314. margin-left: 2rpx;
  315. }
  316. .goods-count {
  317. font-size: 22rpx;
  318. color: #bbb;
  319. margin-left: 8rpx;
  320. font-weight: normal;
  321. }
  322. }
  323. .goods-total {
  324. font-size: 28rpx;
  325. color: #222;
  326. font-weight: bold;
  327. margin-left: 24rpx;
  328. }
  329. }
  330. }
  331. }
  332. .goods-item:last-child { margin-bottom: 0; }
  333. }
  334. .summary-row {
  335. display: flex;
  336. justify-content: space-between;
  337. align-items: center;
  338. margin-top: 24rpx;
  339. font-size: 28rpx;
  340. color: #222;
  341. .highlight {
  342. color: #f79400;
  343. font-weight: bold;
  344. font-size: 30rpx;
  345. }
  346. }
  347. }
  348. .check {
  349. width: 36rpx;
  350. height: 36rpx;
  351. background: #fff;
  352. border-radius: 50%;
  353. display: flex;
  354. align-items: center;
  355. justify-content: center;
  356. font-size: 28rpx;
  357. color: #13ac47;
  358. font-weight: bold;
  359. margin-right: 10rpx;
  360. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.08);
  361. }
  362. </style>