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

306 lines
7.1 KiB

1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
5 days ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
1 week ago
  1. <template>
  2. <view class="container">
  3. <!-- 顶部导航栏 -->
  4. <view class="nav-bar" :style="{height: (statusBarHeight + 88) + 'rpx', paddingTop: statusBarHeight + 'px'}">
  5. <view class="back" @tap="goBack">
  6. <uni-icons type="left" size="25" color="#fff"></uni-icons>
  7. </view>
  8. <text class="title">钱包流水</text>
  9. </view>
  10. <!-- banner -->
  11. <view class="banner" :style="{marginTop: (statusBarHeight + 88) + 'rpx', height: (bannerBaseHeight + statusBarHeight + 88) + 'rpx'}">
  12. <image class="banner-bg" src="/static/my/钱包流水.png" mode="aspectFill"></image>
  13. <!-- <view class="banner-content">
  14. <image class="wallet-icon" src="/static/wallet/wallet-3d.png" mode="aspectFit"></image>
  15. </view> -->
  16. </view>
  17. <!-- 账户余额 -->
  18. <view class="balance-card">
  19. <view class="balance-info">
  20. <text class="label">账户</text>
  21. <view class="amount">
  22. <text class="symbol">¥</text>
  23. <text class="value">8848</text>
  24. </view>
  25. </view>
  26. <button class="withdraw-btn" @tap="withdraw">提现</button>
  27. </view>
  28. <!-- 记录切换标签 -->
  29. <view class="record-tabs">
  30. <view
  31. class="tab-item"
  32. :class="{ active: currentTab === 'settlement' }"
  33. @tap="switchTab('settlement')"
  34. >
  35. 结算日志
  36. </view>
  37. <view
  38. class="tab-item"
  39. :class="{ active: currentTab === 'withdrawal' }"
  40. @tap="switchTab('withdrawal')"
  41. >
  42. 提现记录
  43. </view>
  44. </view>
  45. <!-- 记录列表 -->
  46. <scroll-view class="record-list" scroll-y>
  47. <template v-if="currentTab === 'settlement'">
  48. <view class="record-item" v-for="(item, index) in settlementRecords" :key="index">
  49. <view class="record-info">
  50. <text class="type">{{ item.type }}</text>
  51. <text class="amount">¥{{ item.amount }}</text>
  52. </view>
  53. <text class="date">{{ item.date }}</text>
  54. </view>
  55. </template>
  56. <template v-else>
  57. <view class="record-item" v-for="(item, index) in withdrawalRecords" :key="index">
  58. <view class="record-info">
  59. <text class="type">{{ item.type }}</text>
  60. <text class="amount">¥{{ item.amount }}</text>
  61. </view>
  62. <text class="date">{{ item.date }}</text>
  63. </view>
  64. </template>
  65. </scroll-view>
  66. </view>
  67. </template>
  68. <script>
  69. import pullRefreshMixin from '@/pages/mixins/pullRefreshMixin.js'
  70. export default {
  71. mixins: [pullRefreshMixin],
  72. data() {
  73. return {
  74. statusBarHeight: 0,
  75. bannerBaseHeight: 300,
  76. currentTab: 'settlement',
  77. settlementRecords: [
  78. { type: '回收结算', date: '04-27', amount: '100.24' },
  79. { type: '回收结算', date: '04-23', amount: '171.42' },
  80. { type: '回收结算', date: '04-17', amount: '122.02' },
  81. { type: '回收结算', date: '04-12', amount: '128.87' },
  82. { type: '回收结算', date: '04-12', amount: '106.37' },
  83. { type: '佣金结算', date: '04-09', amount: '119.90' },
  84. { type: '佣金结算', date: '04-09', amount: '160.76' },
  85. { type: '佣金结算', date: '04-07', amount: '132.02' },
  86. { type: '佣金结算', date: '03-29', amount: '172.29' }
  87. ],
  88. withdrawalRecords: [
  89. { type: '提现记录', date: '04-27', amount: '10' },
  90. { type: '提现记录', date: '04-23', amount: '60' },
  91. { type: '提现记录', date: '04-17', amount: '10' },
  92. { type: '提现记录', date: '04-12', amount: '110' },
  93. { type: '提现记录', date: '04-12', amount: '180' },
  94. { type: '提现记录', date: '04-09', amount: '30' },
  95. { type: '提现记录', date: '04-09', amount: '130' },
  96. { type: '提现记录', date: '04-07', amount: '160' },
  97. { type: '提现记录', date: '03-29', amount: '170' }
  98. ]
  99. }
  100. },
  101. onLoad() {
  102. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
  103. },
  104. methods: {
  105. async onRefresh() {
  106. // 模拟刷新数据
  107. await new Promise(resolve => setTimeout(resolve, 1000))
  108. uni.stopPullRefresh()
  109. },
  110. goBack() {
  111. uni.navigateBack()
  112. },
  113. switchTab(tab) {
  114. this.currentTab = tab
  115. },
  116. withdraw() {
  117. uni.navigateTo({
  118. url: '/pages/subcomponent/withdraw'
  119. })
  120. }
  121. }
  122. }
  123. </script>
  124. <style lang="scss" scoped>
  125. .container {
  126. min-height: 100vh;
  127. background: #fff;
  128. }
  129. .nav-bar {
  130. display: flex;
  131. align-items: center;
  132. background: linear-gradient(to right, #f68240 0%, #fc8940 10%);
  133. position: fixed;
  134. top: 0;
  135. left: 0;
  136. right: 0;
  137. z-index: 999;
  138. }
  139. .back {
  140. padding: 20rpx;
  141. margin-left: -20rpx;
  142. }
  143. .title {
  144. flex: 1;
  145. text-align: center;
  146. font-size: 34rpx;
  147. font-weight: 500;
  148. color: #fff;
  149. }
  150. .banner {
  151. position: relative;
  152. background: linear-gradient(to right, #f78b49, #fc8940);
  153. overflow: hidden;
  154. border-radius: 0 0 30rpx 30rpx;
  155. margin-top: 0;
  156. }
  157. .banner-bg {
  158. position: absolute;
  159. width: 100%;
  160. height: 100%;
  161. // opacity: 0.8;
  162. }
  163. .banner-content {
  164. position: relative;
  165. z-index: 1;
  166. height: 100%;
  167. display: flex;
  168. justify-content: center;
  169. align-items: center;
  170. .wallet-icon {
  171. width: 240rpx;
  172. height: 240rpx;
  173. }
  174. }
  175. .balance-card {
  176. margin: -60rpx 30rpx 0;
  177. padding: 30rpx;
  178. background: #fff;
  179. border-radius: 20rpx;
  180. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  181. display: flex;
  182. justify-content: space-between;
  183. align-items: center;
  184. position: relative;
  185. z-index: 2;
  186. .balance-info {
  187. .label {
  188. font-size: 28rpx;
  189. color: #666;
  190. }
  191. .amount {
  192. margin-top: 8rpx;
  193. display: flex;
  194. align-items: baseline;
  195. .symbol {
  196. font-size: 32rpx;
  197. color: #333;
  198. }
  199. .value {
  200. font-size: 48rpx;
  201. font-weight: bold;
  202. color: #333;
  203. margin-left: 4rpx;
  204. }
  205. }
  206. }
  207. .withdraw-btn {
  208. width: 160rpx;
  209. height: 70rpx;
  210. background: #FFB74D;
  211. color: #fff;
  212. font-size: 28rpx;
  213. border-radius: 35rpx;
  214. display: flex;
  215. align-items: center;
  216. justify-content: center;
  217. border: none;
  218. &::after {
  219. border: none;
  220. }
  221. }
  222. }
  223. .record-tabs {
  224. display: flex;
  225. padding: 20rpx 0;
  226. border-bottom: 1rpx solid #f5f5f5;
  227. .tab-item {
  228. position: relative;
  229. padding: 16rpx 0;
  230. font-size: 28rpx;
  231. color: #666;
  232. flex: 1;
  233. text-align: center;
  234. &.active {
  235. color: #333;
  236. font-weight: 500;
  237. &::after {
  238. content: '';
  239. position: absolute;
  240. left: 50%;
  241. transform: translateX(-50%);
  242. bottom: -21rpx;
  243. width: 48rpx;
  244. height: 2rpx;
  245. background: #FFB74D;
  246. }
  247. }
  248. }
  249. }
  250. .record-list {
  251. height: calc(100vh - 88rpx - 300rpx + 60rpx - 120rpx - 71rpx);
  252. .record-item {
  253. display: flex;
  254. flex-direction: column;
  255. padding: 30rpx;
  256. border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
  257. .record-info {
  258. display: flex;
  259. justify-content: space-between;
  260. align-items: center;
  261. margin-bottom: 12rpx;
  262. .type {
  263. font-size: 28rpx;
  264. color: #333;
  265. }
  266. .amount {
  267. font-size: 28rpx;
  268. color: #333;
  269. }
  270. }
  271. .date {
  272. font-size: 24rpx;
  273. color: #999;
  274. }
  275. }
  276. }
  277. </style>