裂变星小程序-25.03.04
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.

308 lines
6.4 KiB

  1. <template>
  2. <view>
  3. <navbar title="我的钱包" leftClick @leftClick="$utils.navigateBack" />
  4. <view class="content">
  5. <view class="card overview">
  6. <image class="bg" src="../static/center/overview-bg.png"></image>
  7. <view class="overview-info">
  8. <view class="flex user-info">
  9. <!-- todo: 换回接口提供的 -->
  10. <image class="avatar" src="../static/temp-avatar.png"></image>
  11. <!-- todo: 换回接口提供的 -->
  12. <text class="nick-name">裂变星1号</text>
  13. </view>
  14. <view class="account">
  15. <!-- todo: 换回接口提供的 -->
  16. <view class="account-count">{{ `${100.0}` }}</view>
  17. <view class="account-desc">可提现余额</view>
  18. </view>
  19. </view>
  20. <button class="flex btn-withdraw" @click="$utils.navigateTo('/pages_order/mine/withdraw')">
  21. <text>去提现</text>
  22. <image class="btn-withdraw-arrow" src="../static/center/arrow.png"></image>
  23. </button>
  24. <view class="flex overview-summary">
  25. <!-- todo: 换回接口提供的 -->
  26. <view>总收益<text class="highlight">{{ `${276.0}` }}</text></view>
  27. <view>已提现<text class="highlight">{{ `${176.0}` }}</text></view>
  28. </view>
  29. </view>
  30. <view class="detail">
  31. <view class="flex detail-header">
  32. <view class="detail-title">
  33. <image class="bg" src="../static/center/title-bg.png"></image>
  34. <text class="text">收支明细</text>
  35. </view>
  36. <view class="detail-tools">
  37. <uv-calendars ref="calendars" @confirm="onSelectDate" />
  38. <button class="flex btn-calendar" @click="openCalendars">
  39. <text>日期选择</text>
  40. <image class="btn-calendar-arrow" src="../static/center/down.png"></image>
  41. </button>
  42. </view>
  43. </view>
  44. <view class="detail-list">
  45. <view class="card detail-list-item"
  46. v-for="item in detailList"
  47. :key="item.id"
  48. >
  49. <view class="flex detail-list-item-row highlight">
  50. <text>{{ item.title }}</text>
  51. <template v-if="item.type === 'in'">
  52. <text class="count count-in">{{ `+${item.count}` }}</text>
  53. </template>
  54. <template v-else>
  55. <text class="count count-out">{{ `-${item.count}` }}</text>
  56. </template>
  57. </view>
  58. <view class="flex detail-list-item-row">
  59. <text>{{ item.createTime }}</text>
  60. <text>{{ `余额:${item.account}` }}</text>
  61. </view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. detailList: [
  73. {
  74. id: '001',
  75. title: '提现-微信',
  76. type: 'out',
  77. count: '88.0',
  78. account: '100.0',
  79. createTime: '2025年2月15日 12:56:48',
  80. },
  81. {
  82. id: '002',
  83. title: '活动奖励',
  84. type: 'in',
  85. count: '12.8',
  86. account: '188.0',
  87. createTime: '2025年2月14日 12:56:48',
  88. },
  89. {
  90. id: '003',
  91. title: '提现-微信',
  92. type: 'out',
  93. count: '88.0',
  94. account: '263.2',
  95. createTime: '2025年2月13日 12:56:48',
  96. },
  97. ]
  98. }
  99. },
  100. onShow() {
  101. // todo
  102. // fetch user-info
  103. // fetch detail
  104. },
  105. onReachBottom() {
  106. // todo
  107. // fetch more detail
  108. },
  109. methods: {
  110. openCalendars() {
  111. this.$refs.calendars.open();
  112. },
  113. onSelectDate(e) {
  114. console.log('--onSelectDate', e)
  115. // todo
  116. // fetch detail
  117. }
  118. },
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .content {
  123. padding: 20rpx;
  124. }
  125. .overview {
  126. position: relative;
  127. border-radius: 14rpx;
  128. padding: 0;
  129. height: 462rpx;
  130. width: 100%;
  131. color: #04D6A3;
  132. .bg {
  133. width: 100%;
  134. height: 374rpx;
  135. }
  136. &-info {
  137. position: absolute;
  138. width: 100%;
  139. top: 0;
  140. left: 0;
  141. padding: 43rpx 0 0 54rpx;
  142. }
  143. .user-info {
  144. justify-content: flex-start;
  145. }
  146. .avatar {
  147. width: 80rpx;
  148. height: 80rpx;
  149. border-radius: 40rpx;
  150. }
  151. .nick-name {
  152. font-size: 32rpx;
  153. font-weight: 700;
  154. margin-left: 20rpx;
  155. }
  156. .account {
  157. margin-top: 44rpx;
  158. &-count {
  159. font-size: 78rpx;
  160. font-weight: 900;
  161. margin-left: -8rpx;
  162. }
  163. &-desc {
  164. font-size: 24rpx;
  165. }
  166. }
  167. .btn-withdraw {
  168. position: absolute;
  169. top: 223rpx;
  170. right: 0;
  171. background-color: #04D6A3;
  172. line-height: 1;
  173. font-size: 32rpx;
  174. padding: 20rpx 6rpx 20rpx 30rpx;
  175. border-top-left-radius: 42rpx;
  176. border-bottom-left-radius: 42rpx;
  177. &-arrow {
  178. width: 28rpx;
  179. height: 28rpx;
  180. margin-left: 22rpx;
  181. }
  182. }
  183. &-summary {
  184. position: absolute;
  185. left: 0;
  186. bottom: 0;
  187. width: 100%;
  188. padding: 28rpx 48rpx;
  189. box-sizing: border-box;
  190. justify-content: space-between;
  191. color: #1B1B1B;
  192. font-size: 24rpx;
  193. .highlight {
  194. color: #04D6A3;
  195. }
  196. }
  197. }
  198. .detail {
  199. &-header {
  200. align-items: flex-start;
  201. justify-content: space-between;
  202. margin-top: 20rpx;
  203. }
  204. &-title {
  205. position: relative;
  206. .bg {
  207. width: 139rpx;
  208. height: 13rpx;
  209. vertical-align: text-bottom;
  210. }
  211. .text {
  212. color: #1B1B1B;
  213. font-size: 36rpx;
  214. font-weight: 900;
  215. position: absolute;
  216. top: 0;
  217. left: 0;
  218. }
  219. }
  220. &-tools {
  221. .btn-calendar {
  222. display: inline-block;
  223. width: auto;
  224. height: auto;
  225. background-color: #FFFFFF;
  226. border: none;
  227. padding: 21rpx 19rpx;
  228. box-sizing: border-box;
  229. margin: 0;
  230. line-height: 1;
  231. font-size: 24rpx;
  232. color: #999999;
  233. border-radius: 33rpx;
  234. &-arrow {
  235. width: 26rpx;
  236. height: 12rpx;
  237. margin-left: 10rpx;
  238. }
  239. }
  240. }
  241. &-list {
  242. margin-top: 25rpx;
  243. &-item {
  244. color: #999999;
  245. font-size: 24rpx;
  246. & + & {
  247. margin-top: 11rpx;
  248. }
  249. .highlight {
  250. color: #1B1B1B;
  251. font-size: 32rpx;
  252. font-weight: 700;
  253. }
  254. &-row {
  255. justify-content: space-between;
  256. }
  257. .count {
  258. &-in {
  259. color: #FF2020;
  260. }
  261. }
  262. }
  263. }
  264. }
  265. </style>