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

313 lines
7.4 KiB

2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
1 month ago
2 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months 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="image" 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. computed: {
  102. image() {
  103. // console.log(getApp().globalData.bannerList,'getApp().globalData.bannerList')
  104. const item = getApp().globalData.bannerList.find(i => i.title === '我的-轮播图')
  105. return item ? item.image : ''
  106. },
  107. },
  108. onLoad() {
  109. this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight
  110. },
  111. methods: {
  112. async onRefresh() {
  113. // 模拟刷新数据
  114. await new Promise(resolve => setTimeout(resolve, 1000))
  115. uni.stopPullRefresh()
  116. },
  117. goBack() {
  118. uni.navigateBack()
  119. },
  120. switchTab(tab) {
  121. this.currentTab = tab
  122. },
  123. withdraw() {
  124. uni.navigateTo({
  125. url: '/pages/subcomponent/withdraw'
  126. })
  127. }
  128. }
  129. }
  130. </script>
  131. <style lang="scss" scoped>
  132. .container {
  133. min-height: 100vh;
  134. background: #fff;
  135. }
  136. .nav-bar {
  137. display: flex;
  138. align-items: center;
  139. background: linear-gradient(to right, #f68240 0%, #fc8940 10%);
  140. position: fixed;
  141. top: 0;
  142. left: 0;
  143. right: 0;
  144. z-index: 999;
  145. }
  146. .back {
  147. padding: 20rpx;
  148. margin-left: -20rpx;
  149. }
  150. .title {
  151. flex: 1;
  152. text-align: center;
  153. font-size: 34rpx;
  154. font-weight: 500;
  155. color: #fff;
  156. }
  157. .banner {
  158. position: relative;
  159. background: linear-gradient(to right, #f78b49, #fc8940);
  160. overflow: hidden;
  161. border-radius: 0 0 30rpx 30rpx;
  162. margin-top: 0;
  163. }
  164. .banner-bg {
  165. position: absolute;
  166. width: 100%;
  167. height: 100%;
  168. // opacity: 0.8;
  169. }
  170. .banner-content {
  171. position: relative;
  172. z-index: 1;
  173. height: 100%;
  174. display: flex;
  175. justify-content: center;
  176. align-items: center;
  177. .wallet-icon {
  178. width: 240rpx;
  179. height: 240rpx;
  180. }
  181. }
  182. .balance-card {
  183. margin: -60rpx 30rpx 0;
  184. padding: 30rpx;
  185. background: #fff;
  186. border-radius: 20rpx;
  187. box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.06);
  188. display: flex;
  189. justify-content: space-between;
  190. align-items: center;
  191. position: relative;
  192. z-index: 2;
  193. .balance-info {
  194. .label {
  195. font-size: 28rpx;
  196. color: #666;
  197. }
  198. .amount {
  199. margin-top: 8rpx;
  200. display: flex;
  201. align-items: baseline;
  202. .symbol {
  203. font-size: 32rpx;
  204. color: #333;
  205. }
  206. .value {
  207. font-size: 48rpx;
  208. font-weight: bold;
  209. color: #333;
  210. margin-left: 4rpx;
  211. }
  212. }
  213. }
  214. .withdraw-btn {
  215. width: 160rpx;
  216. height: 70rpx;
  217. background: #FFB74D;
  218. color: #fff;
  219. font-size: 28rpx;
  220. border-radius: 35rpx;
  221. display: flex;
  222. align-items: center;
  223. justify-content: center;
  224. border: none;
  225. &::after {
  226. border: none;
  227. }
  228. }
  229. }
  230. .record-tabs {
  231. display: flex;
  232. padding: 20rpx 0;
  233. border-bottom: 1rpx solid #f5f5f5;
  234. .tab-item {
  235. position: relative;
  236. padding: 16rpx 0;
  237. font-size: 28rpx;
  238. color: #666;
  239. flex: 1;
  240. text-align: center;
  241. &.active {
  242. color: #333;
  243. font-weight: 500;
  244. &::after {
  245. content: '';
  246. position: absolute;
  247. left: 50%;
  248. transform: translateX(-50%);
  249. bottom: -21rpx;
  250. width: 48rpx;
  251. height: 2rpx;
  252. background: #FFB74D;
  253. }
  254. }
  255. }
  256. }
  257. .record-list {
  258. height: calc(100vh - 88rpx - 300rpx + 60rpx - 120rpx - 71rpx);
  259. .record-item {
  260. display: flex;
  261. flex-direction: column;
  262. padding: 30rpx;
  263. border-bottom: 1rpx solid rgba(0, 0, 0, 0.05);
  264. .record-info {
  265. display: flex;
  266. justify-content: space-between;
  267. align-items: center;
  268. margin-bottom: 12rpx;
  269. .type {
  270. font-size: 28rpx;
  271. color: #333;
  272. }
  273. .amount {
  274. font-size: 28rpx;
  275. color: #333;
  276. }
  277. }
  278. .date {
  279. font-size: 24rpx;
  280. color: #999;
  281. }
  282. }
  283. }
  284. </style>