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

223 lines
5.7 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="byc-container" :style="{paddingTop: 'calc(150rpx + ' + statusBarHeight + 'px)'}">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar" :style="{paddingTop: statusBarHeight + 'px'}">
  5. <view class="back" @tap="goBack">
  6. <uni-icons type="left" size="20" color="#fff"></uni-icons>
  7. </view>
  8. <text class="nav-title">包邮服务城市</text>
  9. <view class="nav-icons">
  10. <!-- 占位元素保持布局对称 -->
  11. </view>
  12. </view>
  13. <!-- 蓝色banner卡片 -->
  14. <view class="byc-banner">
  15. <image class="byc-banner-img" src="https://oss.budingxiaoshuo.com/upload/已开通包邮服务的城市-banner_1748252607736.png" mode="widthFix" />
  16. </view>
  17. <!-- 主内容卡片 -->
  18. <view class="byc-main-card">
  19. <view class="byc-main-title">已开通包邮服务的城市</view>
  20. <view class="byc-main-desc">
  21. 我们很高兴为以下城市的用户提供一键包邮的便捷服务进一步简化旧衣回收流程降低参与环保行动的门槛期待未来能将这一服务拓展至更多地区邀请全国人民共同投身于旧衣回收的环保事业中
  22. </view>
  23. <view class="byc-dashed-line"></view>
  24. <view class="byc-province-list">
  25. <view class="byc-province-item" v-for="(province, idx) in cityList" :key="province.id">
  26. <view class="byc-province-name">{{ province.name }}</view>
  27. <view class="byc-city-group" v-for="(city, cidx) in (province.children || [])" :key="city.id">
  28. <view class="byc-city-name">{{ city.name }}</view>
  29. <view class="byc-district-list" v-if="city.children && city.children.length > 0">
  30. <text v-for="(district, didx) in city.children" :key="district.id" class="byc-district">
  31. <text v-if="didx !== 0" class="byc-dot">·</text>{{ district.name }}
  32. </text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. data() {
  43. return {
  44. statusBarHeight: 0,
  45. navBarHeight: 88, // 默认
  46. menuButtonInfo: null,
  47. cityList: [],
  48. bannerTop: 0 // banner距离顶部距离
  49. }
  50. },
  51. onLoad() {
  52. const sysInfo = uni.getSystemInfoSync()
  53. this.statusBarHeight = sysInfo.statusBarHeight
  54. let menuButtonInfo = null
  55. try {
  56. menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  57. } catch (e) {}
  58. this.menuButtonInfo = menuButtonInfo
  59. if (menuButtonInfo && menuButtonInfo.height) {
  60. // 导航栏高度 = 胶囊 bottom + top - 状态栏高度
  61. this.navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - sysInfo.statusBarHeight
  62. } else {
  63. this.navBarHeight = 88 // 兜底
  64. }
  65. this.bannerTop = this.statusBarHeight + this.navBarHeight
  66. this.$api('getFreeCityList', {}, res => {
  67. if (res && res.success && Array.isArray(res.result)) {
  68. this.cityList = res.result.filter(item => item.open === 'Y');
  69. // console.log(this.cityList);
  70. }
  71. });
  72. },
  73. computed: {
  74. city_desc() {
  75. const item = getApp().globalData.configData.find(i => i.keyName === 'city_desc')
  76. return item ? item.keyContent : ''
  77. },
  78. },
  79. methods: {
  80. goBack() {
  81. uni.navigateBack()
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .byc-container {
  88. min-height: 100vh;
  89. background: #f8f8f8;
  90. padding-bottom: env(safe-area-inset-bottom);
  91. }
  92. .nav-bar {
  93. display: flex;
  94. align-items: center;
  95. height: calc(150rpx + var(--status-bar-height));
  96. padding: 0 32rpx;
  97. background: #2486f6;
  98. position: fixed;
  99. top: 0;
  100. left: 0;
  101. right: 0;
  102. z-index: 999;
  103. box-sizing: border-box;
  104. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  105. .back {
  106. padding: 20rpx;
  107. margin-left: -20rpx;
  108. }
  109. .nav-title {
  110. flex: 1;
  111. text-align: center;
  112. font-size: 32rpx;
  113. font-weight: 500;
  114. color: #fff;
  115. }
  116. .nav-icons {
  117. display: flex;
  118. align-items: center;
  119. gap: 12px;
  120. }
  121. }
  122. .byc-banner {
  123. margin: -60rpx 0 0 0;
  124. overflow: hidden;
  125. box-shadow: 0 4rpx 24rpx rgba(60, 167, 250, 0.10);
  126. background: none;
  127. position: relative;
  128. z-index: 1;
  129. max-height: 400rpx;
  130. }
  131. .byc-banner-left {
  132. flex: 1;
  133. }
  134. .byc-banner-title {
  135. color: #fff;
  136. font-size: 44rpx;
  137. font-weight: bold;
  138. margin-bottom: 16rpx;
  139. text-shadow: 0 4rpx 12rpx rgba(0,0,0,0.12);
  140. }
  141. .byc-banner-desc {
  142. color: #e3f2fd;
  143. font-size: 28rpx;
  144. margin-top: 4rpx;
  145. }
  146. .byc-banner-img {
  147. width: 100%;
  148. height: 100%;
  149. max-height: 400rpx;
  150. display: block;
  151. object-fit: cover;
  152. }
  153. .byc-main-card {
  154. background: #fff;
  155. border-radius: 36rpx;
  156. margin: -40rpx 0 0 0;
  157. box-shadow: 0 8rpx 32rpx rgba(60, 167, 250, 0.08);
  158. padding: 48rpx 32rpx 32rpx 32rpx;
  159. position: relative;
  160. z-index: 2;
  161. }
  162. .byc-main-title {
  163. font-size: 36rpx;
  164. font-weight: bold;
  165. color: #222;
  166. margin-bottom: 24rpx;
  167. }
  168. .byc-main-desc {
  169. color: #888;
  170. font-size: 28rpx;
  171. line-height: 1.7;
  172. margin-bottom: 32rpx;
  173. }
  174. .byc-dashed-line {
  175. border-bottom: 2rpx dashed #e5e5e5;
  176. margin-bottom: 32rpx;
  177. }
  178. .byc-province-list {
  179. .byc-province-item {
  180. margin-bottom: 36rpx;
  181. &:last-child { margin-bottom: 0; }
  182. }
  183. .byc-province-name {
  184. font-size: 32rpx;
  185. font-weight: bold;
  186. color: #222;
  187. margin-bottom: 12rpx;
  188. }
  189. .byc-city-group {
  190. margin-bottom: 20rpx;
  191. padding-left: 16rpx;
  192. border-left: 3rpx solid #e5e5e5;
  193. &:last-child { margin-bottom: 0; }
  194. }
  195. .byc-city-name {
  196. font-size: 30rpx;
  197. font-weight: 600;
  198. color: #333;
  199. margin-bottom: 8rpx;
  200. }
  201. .byc-district-list {
  202. display: flex;
  203. flex-wrap: wrap;
  204. font-size: 26rpx;
  205. color: #666;
  206. line-height: 1.6;
  207. padding-left: 20rpx;
  208. }
  209. .byc-district {
  210. margin-right: 16rpx;
  211. margin-bottom: 6rpx;
  212. display: flex;
  213. align-items: center;
  214. }
  215. .byc-dot {
  216. margin-right: 6rpx;
  217. color: #bbb;
  218. font-size: 24rpx;
  219. }
  220. }
  221. </style>