withdraw-detail.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="detail-container">
  3. <view class="status-card" :class="statusClassMap[detail.status]">
  4. <view class="status-icon">
  5. <image :src="currentStatusIcon" mode="aspectFit"></image>
  6. </view>
  7. <view class="status-text">{{statusText}}</view>
  8. <view class="amount">-¥{{formatMoney(detail.amount)}}</view>
  9. </view>
  10. <view class="info-card">
  11. <view class="info-item">
  12. <text class="label">提现单号</text>
  13. <text class="value">{{detail.id}}</text>
  14. </view>
  15. <view class="info-item">
  16. <text class="label">申请时间</text>
  17. <text class="value">{{formatTime(detail.createTime)}}</text>
  18. </view>
  19. <view class="info-item" v-if="detail.auditTime">
  20. <text class="label">审核时间</text>
  21. <text class="value">{{formatTime(detail.auditTime)}}</text>
  22. </view>
  23. <view class="info-item" v-if="detail.paymentTime">
  24. <text class="label">打款时间</text>
  25. <text class="value">{{formatTime(detail.paymentTime)}}</text>
  26. </view>
  27. <view class="info-item">
  28. <text class="label">提现银行</text>
  29. <text class="value">{{detail.bankName}}</text>
  30. </view>
  31. <view class="info-item">
  32. <text class="label">银行卡号</text>
  33. <text class="value">{{formatBankAccount(detail.bankAccount)}}</text>
  34. </view>
  35. <view class="info-item">
  36. <text class="label">开户人</text>
  37. <text class="value">{{detail.accountHolder}}</text>
  38. </view>
  39. </view>
  40. <view class="remark-card" v-if="detail.auditRemark || detail.paymentRemark">
  41. <view class="card-title">备注信息</view>
  42. <view class="remark-item" v-if="detail.auditRemark">
  43. <text class="label">审核备注:</text>
  44. <text class="value">{{detail.auditRemark}}</text>
  45. </view>
  46. <view class="remark-item" v-if="detail.paymentRemark">
  47. <text class="label">打款备注:</text>
  48. <text class="value">{{detail.paymentRemark}}</text>
  49. </view>
  50. </view>
  51. <button class="contact-btn" v-if="detail.status === 2" @click="contactService">
  52. 联系客服
  53. </button>
  54. </view>
  55. </template>
  56. <script>
  57. import { mapState } from 'vuex';
  58. export default {
  59. data() {
  60. return {
  61. detail: {}
  62. };
  63. },
  64. computed: {
  65. ...mapState(['token']),
  66. statusText() {
  67. const statusMap = {
  68. 0: '提现申请已提交',
  69. 1: '提现审核通过',
  70. 2: '提现审核拒绝',
  71. 3: '提现已打款'
  72. };
  73. return statusMap[this.detail.status] || '未知状态';
  74. },
  75. statusClassMap() {
  76. return {
  77. 0: 'pending',
  78. 1: 'approved',
  79. 2: 'rejected',
  80. 3: 'paid'
  81. };
  82. },
  83. currentStatusIcon() {
  84. const iconMap = {
  85. 0: require('@/static/icons/withdraw-pending.png'),
  86. 1: require('@/static/icons/withdraw-success.png'),
  87. 2: require('@/static/icons/withdraw-failed.png'),
  88. 3: require('@/static/icons/withdraw-success.png')
  89. };
  90. return iconMap[this.detail.status] || '';
  91. }
  92. },
  93. onLoad(options) {
  94. if (options.id) {
  95. this.loadDetail(options.id);
  96. }
  97. },
  98. methods: {
  99. loadDetail(id) {
  100. uni.showLoading({ title: '加载中...' });
  101. this.request("get", `rider/withdrawal/detail/${id}`, this.token)
  102. .then(res => {
  103. if (res.code === 200) {
  104. this.detail = res.data;
  105. }
  106. })
  107. .finally(() => {
  108. uni.hideLoading();
  109. });
  110. },
  111. formatMoney(amount) {
  112. const num = Number(amount || 0);
  113. return num.toFixed(2);
  114. },
  115. formatTime(time) {
  116. if (!time) return '';
  117. return time.replace('T', ' ').substring(0, 16);
  118. },
  119. formatBankAccount(account) {
  120. if (!account) return '';
  121. return account.replace(/(\d{4})(?=\d)/g, '$1 ');
  122. },
  123. contactService() {
  124. uni.makePhoneCall({
  125. phoneNumber: '400-123-4567'
  126. });
  127. }
  128. }
  129. };
  130. </script>
  131. <style lang="scss" scoped>
  132. .detail-container {
  133. padding: 20rpx;
  134. min-height: 100vh;
  135. background-color: #f7f7f7;
  136. padding-bottom: 40rpx;
  137. }
  138. .status-card {
  139. padding: 60rpx 0;
  140. margin-bottom: 20rpx;
  141. border-radius: 16rpx;
  142. background-color: #fff;
  143. display: flex;
  144. flex-direction: column;
  145. align-items: center;
  146. box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.05);
  147. &.pending {
  148. .status-icon image {
  149. filter: hue-rotate(180deg);
  150. }
  151. }
  152. &.approved {
  153. .status-icon image {
  154. filter: hue-rotate(120deg);
  155. }
  156. }
  157. &.rejected {
  158. .status-icon image {
  159. filter: hue-rotate(300deg);
  160. }
  161. }
  162. &.paid {
  163. .status-icon image {
  164. filter: hue-rotate(240deg);
  165. }
  166. }
  167. .status-icon {
  168. width: 120rpx;
  169. height: 120rpx;
  170. margin-bottom: 30rpx;
  171. image {
  172. width: 100%;
  173. height: 100%;
  174. }
  175. }
  176. .status-text {
  177. font-size: 32rpx;
  178. color: #333;
  179. margin-bottom: 20rpx;
  180. }
  181. .amount {
  182. font-size: 48rpx;
  183. font-weight: bold;
  184. color: #333;
  185. }
  186. }
  187. .info-card {
  188. background-color: #fff;
  189. border-radius: 16rpx;
  190. margin-bottom: 20rpx;
  191. padding: 0 30rpx;
  192. box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.05);
  193. .info-item {
  194. display: flex;
  195. justify-content: space-between;
  196. padding: 25rpx 0;
  197. border-bottom: 1rpx solid #f0f0f0;
  198. &:last-child {
  199. border-bottom: none;
  200. }
  201. .label {
  202. font-size: 28rpx;
  203. color: #666;
  204. }
  205. .value {
  206. font-size: 28rpx;
  207. color: #333;
  208. }
  209. }
  210. }
  211. .remark-card {
  212. background-color: #fff;
  213. border-radius: 16rpx;
  214. padding: 30rpx;
  215. box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.05);
  216. .card-title {
  217. font-size: 30rpx;
  218. font-weight: bold;
  219. color: #333;
  220. margin-bottom: 20rpx;
  221. }
  222. .remark-item {
  223. margin-bottom: 20rpx;
  224. &:last-child {
  225. margin-bottom: 0;
  226. }
  227. .label {
  228. font-size: 28rpx;
  229. color: #666;
  230. }
  231. .value {
  232. font-size: 28rpx;
  233. color: #333;
  234. }
  235. }
  236. }
  237. .contact-btn {
  238. margin: 40rpx 30rpx 0;
  239. height: 80rpx;
  240. line-height: 80rpx;
  241. border-radius: 40rpx;
  242. background-color: #437CE8;
  243. color: #fff;
  244. font-size: 32rpx;
  245. }
  246. </style>