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

328 lines
8.9 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="container">
  3. <!-- 顶部导航 -->
  4. <view class="nav-bar">
  5. <view class="back" @tap="goBack">
  6. <uni-icons type="left" size="25"></uni-icons>
  7. </view>
  8. <text class="title">回收规则</text>
  9. </view>
  10. <!-- 不支持回收提示 -->
  11. <view class="warning-section">
  12. <view class="warning-icon-wrap">
  13. <!-- <image src="/static/icons/red-cross.png" mode="aspectFit" class="cross-icon"></image> -->
  14. <uni-icons type="close" size="25"></uni-icons>
  15. </view>
  16. <text>以下不支持回收</text>
  17. </view>
  18. <!-- 不可回收列表 -->
  19. <view class="rule-list">
  20. <view class="rule-item" v-for="(item, index) in ruleList" :key="index" @tap="showDetail(item)">
  21. <view class="item-left">
  22. <image :src="item.icon" mode="aspectFit" class="item-icon"></image>
  23. <view class="item-info">
  24. <text class="item-title">{{ item.title }}</text>
  25. <text class="item-desc">{{ item.desc }}</text>
  26. </view>
  27. </view>
  28. <uni-icons type="right" size="25"></uni-icons>
  29. </view>
  30. </view>
  31. <!-- 详情弹窗 -->
  32. <view class="detail-popup" v-if="showPopup" @tap="closePopup">
  33. <view class="popup-mask"></view>
  34. <view class="popup-content" @tap.stop>
  35. <view class="popup-title">{{ currentItem.title }}</view>
  36. <view class="popup-desc">{{ currentItem.detailDesc }}</view>
  37. <image :src="currentItem.detailImage" mode="aspectFit" class="detail-image"></image>
  38. <view class="popup-btn" @tap="closePopup">我知道了</view>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
  45. export default {
  46. mixins: [pullRefreshMixin],
  47. data() {
  48. return {
  49. showPopup: false,
  50. currentItem: null,
  51. ruleList: [
  52. {
  53. title: '破损衣服',
  54. desc: '品相较好的旧衣更适合进行二次流转或制作其他产品',
  55. detailDesc: '品相较好的旧衣更适合进行二次流转制作成其他产品。破损衣物可能无法满足是利用的标准,还请您谅解。',
  56. icon: '/static/rules/broken-clothes.png',
  57. detailImage: '/static/rules/broken-clothes-detail.png'
  58. },
  59. {
  60. title: '潮湿异味',
  61. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  62. icon: '/static/rules/wet-clothes.png',
  63. detailImage: '/static/rules/wet-clothes-detail.png',
  64. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  65. },
  66. {
  67. title: '单只鞋靴',
  68. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  69. icon: '/static/rules/single-shoe.png',
  70. detailImage: '/static/rules/single-shoe-detail.png',
  71. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  72. }, {
  73. title: '单只鞋靴',
  74. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  75. icon: '/static/rules/single-shoe.png',
  76. detailImage: '/static/rules/single-shoe-detail.png',
  77. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  78. }, {
  79. title: '单只鞋靴',
  80. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  81. icon: '/static/rules/single-shoe.png',
  82. detailImage: '/static/rules/single-shoe-detail.png',
  83. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  84. }, {
  85. title: '单只鞋靴',
  86. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  87. icon: '/static/rules/single-shoe.png',
  88. detailImage: '/static/rules/single-shoe-detail.png',
  89. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  90. }, {
  91. title: '单只鞋靴',
  92. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  93. icon: '/static/rules/single-shoe.png',
  94. detailImage: '/static/rules/single-shoe-detail.png',
  95. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  96. }, {
  97. title: '单只鞋靴',
  98. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  99. icon: '/static/rules/single-shoe.png',
  100. detailImage: '/static/rules/single-shoe-detail.png',
  101. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  102. }, {
  103. title: '单只鞋靴',
  104. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  105. icon: '/static/rules/single-shoe.png',
  106. detailImage: '/static/rules/single-shoe-detail.png',
  107. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  108. }, {
  109. title: '单只鞋靴',
  110. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  111. icon: '/static/rules/single-shoe.png',
  112. detailImage: '/static/rules/single-shoe-detail.png',
  113. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  114. }, {
  115. title: '单只鞋靴',
  116. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  117. icon: '/static/rules/single-shoe.png',
  118. detailImage: '/static/rules/single-shoe-detail.png',
  119. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  120. }, {
  121. title: '单只鞋靴',
  122. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  123. icon: '/static/rules/single-shoe.png',
  124. detailImage: '/static/rules/single-shoe-detail.png',
  125. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  126. }, {
  127. title: '单只鞋靴',
  128. desc: '这类衣物易滋生细菌霉菌,可能传播疾病',
  129. icon: '/static/rules/single-shoe.png',
  130. detailImage: '/static/rules/single-shoe-detail.png',
  131. detailDesc: '这类衣物易滋生细菌霉菌,可能传播疾病。'
  132. },
  133. ]
  134. }
  135. },
  136. methods: {
  137. async onRefresh() {
  138. // 模拟刷新数据
  139. await new Promise(resolve => setTimeout(resolve, 1000))
  140. uni.stopPullRefresh()
  141. },
  142. goBack() {
  143. uni.navigateBack()
  144. },
  145. showDetail(item) {
  146. this.currentItem = item
  147. this.showPopup = true
  148. },
  149. closePopup() {
  150. this.showPopup = false
  151. }
  152. }
  153. }
  154. </script>
  155. <style lang="scss" scoped>
  156. .container {
  157. min-height: 100vh;
  158. background: #FFF1F0;
  159. }
  160. .nav-bar {
  161. display: flex;
  162. align-items: center;
  163. height: 88rpx;
  164. background: #fff;
  165. padding: 0 30rpx;
  166. .back {
  167. padding: 20rpx;
  168. margin-left: -20rpx;
  169. }
  170. .title {
  171. flex: 1;
  172. text-align: center;
  173. font-size: 34rpx;
  174. font-weight: 500;
  175. }
  176. .right-btns {
  177. display: flex;
  178. align-items: center;
  179. gap: 30rpx;
  180. .more, .target {
  181. font-size: 40rpx;
  182. color: #333;
  183. }
  184. }
  185. }
  186. .warning-section {
  187. display: flex;
  188. align-items: center;
  189. padding: 30rpx;
  190. gap: 16rpx;
  191. .warning-icon-wrap {
  192. width: 40rpx;
  193. height: 40rpx;
  194. display: flex;
  195. align-items: center;
  196. justify-content: center;
  197. .cross-icon {
  198. width: 32rpx;
  199. height: 32rpx;
  200. }
  201. }
  202. text {
  203. color: #333;
  204. font-size: 32rpx;
  205. font-weight: bold;
  206. }
  207. }
  208. .rule-list {
  209. padding: 0 30rpx;
  210. .rule-item {
  211. background: #fff;
  212. border-radius: 16rpx;
  213. padding: 30rpx;
  214. margin-bottom: 20rpx;
  215. display: flex;
  216. align-items: center;
  217. justify-content: space-between;
  218. .item-left {
  219. display: flex;
  220. align-items: center;
  221. gap: 20rpx;
  222. .item-icon {
  223. width: 100rpx;
  224. height: 100rpx;
  225. border-radius: 8rpx;
  226. }
  227. .item-info {
  228. .item-title {
  229. font-size: 30rpx;
  230. color: #333;
  231. margin-bottom: 8rpx;
  232. display: block;
  233. }
  234. .item-desc {
  235. font-size: 24rpx;
  236. color: #999;
  237. }
  238. }
  239. }
  240. .arrow {
  241. color: #999;
  242. font-size: 32rpx;
  243. }
  244. }
  245. }
  246. .detail-popup {
  247. position: fixed;
  248. top: 0;
  249. left: 0;
  250. right: 0;
  251. bottom: 0;
  252. z-index: 999;
  253. .popup-mask {
  254. position: absolute;
  255. top: 0;
  256. left: 0;
  257. right: 0;
  258. bottom: 0;
  259. background: rgba(0, 0, 0, 0.6);
  260. }
  261. .popup-content {
  262. position: absolute;
  263. left: 50%;
  264. top: 50%;
  265. transform: translate(-50%, -50%);
  266. width: 600rpx;
  267. background: #fff;
  268. border-radius: 20rpx;
  269. padding: 40rpx;
  270. text-align: center;
  271. .popup-title {
  272. font-size: 36rpx;
  273. font-weight: bold;
  274. color: #333;
  275. margin-bottom: 20rpx;
  276. }
  277. .popup-desc {
  278. font-size: 28rpx;
  279. color: #666;
  280. line-height: 1.5;
  281. margin-bottom: 30rpx;
  282. }
  283. .detail-image {
  284. width: 400rpx;
  285. height: 400rpx;
  286. margin-bottom: 30rpx;
  287. }
  288. .popup-btn {
  289. height: 88rpx;
  290. background: #FFB74D;
  291. color: #fff;
  292. font-size: 32rpx;
  293. border-radius: 44rpx;
  294. display: flex;
  295. align-items: center;
  296. justify-content: center;
  297. }
  298. }
  299. }
  300. </style>