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

285 lines
7.0 KiB

2 weeks ago
5 days ago
2 weeks ago
2 weeks ago
2 weeks ago
5 days ago
2 weeks ago
5 days ago
2 weeks ago
2 weeks 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" v-if="apply.status === '待审批'">
  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. if (!this.apply.id) {
  98. uni.showToast({ title: '缺少申请ID', icon: 'none' });
  99. return;
  100. }
  101. this.$api && this.$api('rejectPromotionApply', { id: this.apply.id }, res => {
  102. if (res && res.code === 200) {
  103. uni.showToast({ title: '已驳回', icon: 'none' });
  104. this.apply.status = '已驳回';
  105. } else {
  106. uni.showToast({ title: '操作失败', icon: 'none' });
  107. }
  108. });
  109. },
  110. approve() {
  111. if (!this.apply.id) {
  112. uni.showToast({ title: '缺少申请ID', icon: 'none' });
  113. return;
  114. }
  115. console.log(this.apply)
  116. this.$api && this.$api('passPromotionApply', { id: this.apply.id }, res => {
  117. if (res && res.code === 200) {
  118. uni.showToast({ title: '已通过', icon: 'none' });
  119. this.apply.status = '已确认';
  120. } else {
  121. uni.showToast({ title: '操作失败', icon: 'none' });
  122. }
  123. });
  124. },
  125. refreshData() {
  126. // TODO: 实现推广官申请详情刷新逻辑,如重新请求接口
  127. },
  128. async onRefresh() {
  129. await this.refreshData && this.refreshData()
  130. }
  131. },
  132. onPullDownRefresh() {
  133. this.refreshData && this.refreshData()
  134. uni.stopPullDownRefresh()
  135. }
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. .tui-apply-detail-container {
  140. min-height: 100vh;
  141. background: #f7f7f7;
  142. padding-bottom: 160rpx;
  143. }
  144. .navbar {
  145. position: fixed;
  146. top: 0;
  147. left: 0;
  148. width: 100vw;
  149. height: 100rpx;
  150. background: #fff;
  151. z-index: 10;
  152. display: flex;
  153. align-items: flex-end;
  154. justify-content: space-between;
  155. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  156. padding: 0 32rpx;
  157. .nav-left {
  158. flex: 0 0 48rpx;
  159. display: flex;
  160. align-items: center;
  161. height: 100%;
  162. }
  163. .nav-title {
  164. flex: 1;
  165. text-align: center;
  166. font-size: 36rpx;
  167. font-weight: bold;
  168. color: #222;
  169. line-height: 100rpx;
  170. }
  171. .nav-right {
  172. flex: 0 0 80rpx;
  173. display: flex;
  174. align-items: center;
  175. justify-content: flex-end;
  176. height: 100%;
  177. }
  178. }
  179. .main-content {
  180. margin-top: 120rpx;
  181. margin-bottom: 40rpx;
  182. }
  183. .info-card {
  184. background: #fff;
  185. border-radius: 40rpx;
  186. margin: 0 32rpx 32rpx 32rpx;
  187. padding: 40rpx 36rpx 36rpx 36rpx;
  188. box-shadow: 0 2rpx 8rpx rgba(0,0,0,0.03);
  189. position: relative;
  190. }
  191. .card-title-row {
  192. display: flex;
  193. align-items: center;
  194. margin-bottom: 32rpx;
  195. }
  196. .card-title {
  197. font-size: 32rpx;
  198. font-weight: bold;
  199. color: #222;
  200. margin-right: 18rpx;
  201. }
  202. .status-tag {
  203. font-size: 28rpx;
  204. border-radius: 0 20rpx 0 0;
  205. padding: 8rpx 32rpx;
  206. font-weight: 400;
  207. position: absolute;
  208. right: 0;
  209. top: 0;
  210. &.orange {
  211. background: #fff7e6;
  212. color: #ffb400;
  213. }
  214. &.red {
  215. background: #ffeaea;
  216. color: #ff4d4f;
  217. }
  218. &.gray {
  219. background: #f5f5f5;
  220. color: #999;
  221. }
  222. }
  223. .info-row {
  224. display: flex;
  225. align-items: center;
  226. min-height: 60rpx;
  227. margin-bottom: 0;
  228. .label {
  229. font-size: 26rpx;
  230. color: #b3b3b3;
  231. width: 180rpx;
  232. font-weight: 400;
  233. }
  234. .value {
  235. font-size: 30rpx;
  236. color: #222;
  237. font-weight: 500;
  238. flex: 1;
  239. word-break: break-all;
  240. }
  241. }
  242. .divider {
  243. height: 2rpx;
  244. background: #f3f3f3;
  245. margin: 18rpx 0 18rpx 0;
  246. border: none;
  247. }
  248. .bottom-bar {
  249. position: fixed;
  250. left: 0;
  251. right: 0;
  252. bottom: 0;
  253. display: flex;
  254. justify-content: center;
  255. align-items: center;
  256. background: #f7f7f7;
  257. padding-bottom: env(safe-area-inset-bottom);
  258. padding-top: 24rpx;
  259. padding-bottom: 24rpx;
  260. z-index: 20;
  261. gap: 32rpx;
  262. }
  263. .action-btn {
  264. flex: 1;
  265. height: 80rpx;
  266. border-radius: 40rpx;
  267. font-size: 30rpx;
  268. font-weight: 500;
  269. border: 2rpx solid #ffd36d;
  270. background: #fffbe6;
  271. color: #ffb800;
  272. box-shadow: 0 2rpx 8rpx rgba(255, 156, 0, 0.03);
  273. }
  274. .action-btn.primary {
  275. color: #fff;
  276. border: none;
  277. background: linear-gradient(90deg, #FFD36D 0%, #FFA800 100%);
  278. }
  279. .action-btn.danger {
  280. color: #ffb800;
  281. border: 2rpx solid #ffd36d;
  282. background: #fffbe6;
  283. }
  284. </style>