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

262 lines
6.2 KiB

1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="tui-apply-detail-container">
  3. <!-- 顶部导航栏 -->
  4. <view class="navbar" :style="navbarStyle">
  5. <view class="nav-left" @tap="goBack">
  6. <uni-icons type="back" size="24" color="#222" />
  7. </view>
  8. <view class="nav-title">申请详情</view>
  9. <view class="nav-right">
  10. <!-- <uni-icons type="more-filled" size="24" color="#222" style="margin-right: 16rpx;" />
  11. <uni-icons type="scan" size="24" color="#222" /> -->
  12. </view>
  13. </view>
  14. <view class="main-content" :style="{marginTop: navBarRealHeight + 'px'}">
  15. <view class="info-card info-card-apply">
  16. <view class="card-title-row">
  17. <view class="card-title">申请信息</view>
  18. <view v-if="apply.status==='待审批'" class="status-tag orange">待审批</view>
  19. <view v-else-if="apply.status==='已驳回'" class="status-tag red">已驳回</view>
  20. <view v-else-if="apply.status==='已确认'" class="status-tag gray">已确认</view>
  21. </view>
  22. <view class="info-row">
  23. <text class="label">姓名</text>
  24. <text class="value">{{ apply.name }}</text>
  25. </view>
  26. <view class="divider"></view>
  27. <view class="info-row">
  28. <text class="label">电话</text>
  29. <text class="value">{{ apply.phone }}</text>
  30. </view>
  31. <view class="divider"></view>
  32. <view class="info-row">
  33. <text class="label">每日可花推广时间</text>
  34. <text class="value">{{ apply.time }}</text>
  35. </view>
  36. <view class="divider"></view>
  37. <view class="info-row">
  38. <text class="label">申请时间</text>
  39. <text class="value">{{ apply.applyTime }}</text>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="bottom-bar">
  44. <button class="action-btn danger" @tap="reject">驳回</button>
  45. <button class="action-btn primary" @tap="approve">通过</button>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import pullRefreshMixin from '../mixins/pullRefreshMixin.js'
  51. export default {
  52. mixins: [pullRefreshMixin],
  53. data() {
  54. return {
  55. apply: {
  56. name: '周小艺',
  57. phone: '18899102278',
  58. time: '6小时',
  59. applyTime: '2025-03-20 11:00',
  60. status: '待审批',
  61. },
  62. statusBarHeight: 0,
  63. navBarRealHeight: 0,
  64. }
  65. },
  66. computed: {
  67. navbarStyle() {
  68. return `padding-top: ${this.statusBarHeight}px;`;
  69. }
  70. },
  71. onLoad(options) {
  72. uni.getSystemInfo({
  73. success: (res) => {
  74. this.statusBarHeight = res.statusBarHeight || 20;
  75. }
  76. });
  77. this.$nextTick(() => {
  78. uni.createSelectorQuery().select('.navbar').boundingClientRect(rect => {
  79. if (rect) {
  80. this.navBarRealHeight = rect.height;
  81. }
  82. }).exec();
  83. });
  84. // eventChannel 传递申请信息
  85. const eventChannel = this.getOpenerEventChannel && this.getOpenerEventChannel();
  86. if (eventChannel) {
  87. eventChannel.on('applyDetail', (apply) => {
  88. this.apply = Object.assign({}, this.apply, apply);
  89. });
  90. }
  91. },
  92. methods: {
  93. goBack() {
  94. uni.navigateBack();
  95. },
  96. reject() {
  97. uni.showToast({ title: '已驳回', icon: 'none' });
  98. },
  99. approve() {
  100. uni.showToast({ title: '已通过', icon: 'none' });
  101. },
  102. refreshData() {
  103. // TODO: 实现推广官申请详情刷新逻辑,如重新请求接口
  104. },
  105. async onRefresh() {
  106. await this.refreshData && this.refreshData()
  107. }
  108. },
  109. onPullDownRefresh() {
  110. this.refreshData && this.refreshData()
  111. uni.stopPullDownRefresh()
  112. }
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. .tui-apply-detail-container {
  117. min-height: 100vh;
  118. background: #f7f7f7;
  119. padding-bottom: 160rpx;
  120. }
  121. .navbar {
  122. position: fixed;
  123. top: 0;
  124. left: 0;
  125. width: 100vw;
  126. height: 100rpx;
  127. background: #fff;
  128. z-index: 10;
  129. display: flex;
  130. align-items: flex-end;
  131. justify-content: space-between;
  132. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  133. padding: 0 32rpx;
  134. .nav-left {
  135. flex: 0 0 48rpx;
  136. display: flex;
  137. align-items: center;
  138. height: 100%;
  139. }
  140. .nav-title {
  141. flex: 1;
  142. text-align: center;
  143. font-size: 36rpx;
  144. font-weight: bold;
  145. color: #222;
  146. line-height: 100rpx;
  147. }
  148. .nav-right {
  149. flex: 0 0 80rpx;
  150. display: flex;
  151. align-items: center;
  152. justify-content: flex-end;
  153. height: 100%;
  154. }
  155. }
  156. .main-content {
  157. margin-top: 120rpx;
  158. margin-bottom: 40rpx;
  159. }
  160. .info-card {
  161. background: #fff;
  162. border-radius: 40rpx;
  163. margin: 0 32rpx 32rpx 32rpx;
  164. padding: 40rpx 36rpx 36rpx 36rpx;
  165. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  166. position: relative;
  167. }
  168. .card-title-row {
  169. display: flex;
  170. align-items: center;
  171. margin-bottom: 32rpx;
  172. }
  173. .card-title {
  174. font-size: 32rpx;
  175. font-weight: bold;
  176. color: #222;
  177. margin-right: 18rpx;
  178. }
  179. .status-tag {
  180. font-size: 28rpx;
  181. border-radius: 0 20rpx 0 0;
  182. padding: 8rpx 32rpx;
  183. font-weight: 400;
  184. position: absolute;
  185. right: 0;
  186. top: 0;
  187. &.orange {
  188. background: #fff7e6;
  189. color: #ffb400;
  190. }
  191. &.red {
  192. background: #ffeaea;
  193. color: #ff4d4f;
  194. }
  195. &.gray {
  196. background: #f5f5f5;
  197. color: #999;
  198. }
  199. }
  200. .info-row {
  201. display: flex;
  202. align-items: center;
  203. min-height: 60rpx;
  204. margin-bottom: 0;
  205. .label {
  206. font-size: 26rpx;
  207. color: #b3b3b3;
  208. width: 180rpx;
  209. font-weight: 400;
  210. }
  211. .value {
  212. font-size: 30rpx;
  213. color: #222;
  214. font-weight: 500;
  215. flex: 1;
  216. word-break: break-all;
  217. }
  218. }
  219. .divider {
  220. height: 2rpx;
  221. background: #f3f3f3;
  222. margin: 18rpx 0 18rpx 0;
  223. border: none;
  224. }
  225. .bottom-bar {
  226. position: fixed;
  227. left: 0;
  228. right: 0;
  229. bottom: 0;
  230. display: flex;
  231. justify-content: center;
  232. align-items: center;
  233. background: #f7f7f7;
  234. padding-bottom: env(safe-area-inset-bottom);
  235. padding-top: 24rpx;
  236. padding-bottom: 24rpx;
  237. z-index: 20;
  238. gap: 32rpx;
  239. }
  240. .action-btn {
  241. flex: 1;
  242. height: 80rpx;
  243. border-radius: 40rpx;
  244. font-size: 30rpx;
  245. font-weight: 500;
  246. border: 2rpx solid #ffd36d;
  247. background: #fffbe6;
  248. color: #ffb800;
  249. box-shadow: 0 2rpx 8rpx rgba(255, 156, 0, 0.03);
  250. }
  251. .action-btn.primary {
  252. color: #fff;
  253. border: none;
  254. background: linear-gradient(90deg, #FFD36D 0%, #FFA800 100%);
  255. }
  256. .action-btn.danger {
  257. color: #ffb800;
  258. border: 2rpx solid #ffd36d;
  259. background: #fffbe6;
  260. }
  261. </style>