OrderList.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <div class="container">
  3. <!-- 导航栏 -->
  4. <div class="nav-bar">
  5. <div class="back-btn" @click="$router.back()">
  6. <i class="arrow-left"></i>
  7. </div>
  8. <div class="title">提现记录</div>
  9. </div>
  10. <!-- 记录列表 -->
  11. <div class="record-list">
  12. <div class="listItem" v-for="(item, index) in records" :key="index">
  13. <div class="flex listItemC">
  14. <div class="tr4">类型</div>
  15. <div class="money-col">金额</div>
  16. <div class="status-text">状态</div>
  17. <div class="remark">详情</div>
  18. <div class="right">日期</div>
  19. </div>
  20. <div class="flex listItemB">
  21. <div class="tr4">{{ getTypeText(item.type) }}</div>
  22. <div class="money-col money-text">{{ item.money }}</div>
  23. <div class="status-text">{{ getStatusText(item.stat, item) }}</div>
  24. <div class="remark">{{ item.remark || '-' }}</div>
  25. <div class="right gggg">
  26. <div>{{ item.addtime.split(' ')[0] }}</div>
  27. <div>{{ item.addtime.split(' ')[1] }}</div>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { getUserInfo } from '@/api/home';
  36. import { getWithdrawRecords } from '@/api/profile';
  37. export default {
  38. name: 'OrderList',
  39. data() {
  40. return {
  41. userInfo: {},
  42. records: []
  43. }
  44. },
  45. created() {
  46. this.getUserInfo();
  47. this.getRecords();
  48. },
  49. methods: {
  50. async getUserInfo() {
  51. try {
  52. const res = await getUserInfo();
  53. this.userInfo = res.data;
  54. } catch (error) {
  55. console.error('获取用户信息失败:', error);
  56. }
  57. },
  58. async getRecords() {
  59. try {
  60. const res = await getWithdrawRecords();
  61. this.records = res.data || [];
  62. } catch (error) {
  63. console.error('获取提现记录失败:', error);
  64. }
  65. },
  66. getStatusText(stat, item) {
  67. if (stat === 0 && item.type === 2) {
  68. // 获取提现日期
  69. const withdrawDate = new Date(item.addtime);
  70. const cutoffDate = new Date('2025-06-29 00:00:00');
  71. if (withdrawDate < cutoffDate) {
  72. return '审核已通过,7月20号到账您的银行卡';
  73. } else {
  74. // 计算到账日期:提现日期 + 21天
  75. const arrivalDate = new Date(withdrawDate);
  76. arrivalDate.setDate(withdrawDate.getDate() + 21);
  77. const month = arrivalDate.getMonth() + 1;
  78. const day = arrivalDate.getDate();
  79. return `审核已通过,${month}月${day}号到账您的银行卡`;
  80. }
  81. }
  82. const statusMap = {
  83. 0: '审核中',
  84. 1: '提现成功',
  85. 2: '提现失败'
  86. };
  87. return statusMap[stat] || '未知';
  88. },
  89. getTypeText(type) {
  90. const typeMap = {
  91. 1: '红旗资产',
  92. 2: '退休补贴',
  93. 3: '党员薪资',
  94. 4: '每日分红',
  95. 5: '原始股权'
  96. };
  97. return typeMap[type] || '未知';
  98. }
  99. }
  100. }
  101. </script>
  102. <style scoped>
  103. .container {
  104. min-height: 100vh;
  105. background: #f5f5f5;
  106. }
  107. .nav-bar {
  108. height: 44px;
  109. background-color: #fff;
  110. color: #000;
  111. display: flex;
  112. align-items: center;
  113. position: relative;
  114. padding: 0 15px;
  115. font-weight: bold;
  116. }
  117. .back-btn {
  118. width: 24px;
  119. height: 44px;
  120. display: flex;
  121. align-items: center;
  122. cursor: pointer;
  123. }
  124. .arrow-left {
  125. width: 12px;
  126. height: 12px;
  127. border-left: 2px solid #000;
  128. border-bottom: 2px solid #000;
  129. transform: rotate(45deg);
  130. }
  131. .title {
  132. position: absolute;
  133. left: 50%;
  134. transform: translateX(-50%);
  135. font-size: 16px;
  136. }
  137. .record-list {
  138. padding: 15px;
  139. }
  140. .listItem {
  141. background: #fff;
  142. border-radius: 8px;
  143. padding: 15px;
  144. margin-bottom: 10px;
  145. }
  146. .flex {
  147. display: flex;
  148. justify-content: space-between;
  149. align-items: center;
  150. }
  151. .listItemC {
  152. color: #999;
  153. font-size: 14px;
  154. margin-bottom: 10px;
  155. }
  156. .listItemB {
  157. color: #333;
  158. font-size: 14px;
  159. margin-bottom: 5px;
  160. }
  161. .tr4 {
  162. flex: 0 0 75px;
  163. display: flex;
  164. flex-direction: column;
  165. align-items: center;
  166. justify-content: center;
  167. text-align: center;
  168. gap: 2px;
  169. }
  170. .type-text {
  171. font-size: 13px;
  172. color: #666;
  173. }
  174. .money-col {
  175. flex: 0 0 70px;
  176. text-align: center;
  177. }
  178. .money-text {
  179. font-size: 16px;
  180. color: #222;
  181. font-weight: bold;
  182. }
  183. .right {
  184. flex: 0 0 132px;
  185. text-align: right;
  186. display: flex;
  187. flex-direction: column;
  188. align-items: flex-end;
  189. word-break: break-all;
  190. }
  191. .gggg {
  192. color: #999;
  193. }
  194. .status-row {
  195. width: 100%;
  196. justify-content: center;
  197. margin-top: 10px;
  198. }
  199. .status-text {
  200. color: #666;
  201. font-size: 14px;
  202. flex: 0 0 65px;
  203. }
  204. .remark {
  205. flex: 0 1 auto;
  206. min-width: 20px;
  207. max-width: 120px;
  208. text-align: left;
  209. color: #666;
  210. font-size: 13px;
  211. padding-left: 10px;
  212. word-break: break-all;
  213. }
  214. </style>