index.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  1. <script lang="ts" setup>
  2. import { storeToRefs } from 'pinia'
  3. import { ref } from 'vue'
  4. import FilterTime from '@/components/FilterTime.vue'
  5. import { LOGIN_PAGE } from '@/router/config'
  6. import { useUserStore } from '@/store'
  7. import { useTokenStore } from '@/store/token'
  8. import { changtime, menuButtonInfo, safeAreaInsets, systemInfo } from '@/utils'
  9. definePage({
  10. style: {
  11. navigationBarTitleText: '提现明细',
  12. },
  13. })
  14. const userStore = useUserStore()
  15. const tokenStore = useTokenStore()
  16. // 使用storeToRefs解构userInfo
  17. const { userInfo } = storeToRefs(userStore)
  18. function menuClick(page: string) {
  19. uni.navigateTo({
  20. url: `/pages-A/${page}/index`,
  21. })
  22. }
  23. const show = ref(false)
  24. const filterValue = ref<string[]>([])
  25. function confirm() {
  26. // 函数实现
  27. show.value = false
  28. }
  29. function cancel() {
  30. show.value = false
  31. }
  32. function close() {
  33. show.value = false
  34. }
  35. function showTimeFilter() {
  36. show.value = true
  37. }
  38. // 处理时间选择变化
  39. function handleTimeChange(value: string[]) {
  40. console.log('时间选择变化', value)
  41. filterValue.value = value
  42. }
  43. // 格式化时间显示
  44. function formatTimeDisplay() {
  45. if (!filterValue.value || filterValue.value[0] === '' || filterValue.value[1] === '') {
  46. return '全部时间'
  47. }
  48. return `${filterValue.value[0]} 至 ${filterValue.value[1]}`
  49. }
  50. const wjsList = ref([
  51. {
  52. id: 1,
  53. nickName: '昵称1',
  54. name: '优惠券1',
  55. price: 1000,
  56. date: '2023-08-01 10:00:00',
  57. },
  58. {
  59. id: 2,
  60. nickName: '昵称2',
  61. name: '优惠券2',
  62. price: 1300,
  63. date: '2023-10-01 10:00:00',
  64. },
  65. ])
  66. const yjsList = ref([
  67. {
  68. id: 1,
  69. nickName: '昵称3',
  70. name: '优惠券3',
  71. price: 2300,
  72. date: '2023-10-01 10:00:00',
  73. },
  74. {
  75. id: 2,
  76. nickName: '昵称4',
  77. name: '优惠券4',
  78. price: 300,
  79. date: '2023-10-01 10:00:00',
  80. },
  81. ])
  82. const list = ref([])
  83. onLoad(() => {
  84. list.value = [...wjsList.value]
  85. })
  86. function goPage(page: string) {
  87. uni.navigateTo({
  88. url: `/pages-A/${page}/index`,
  89. })
  90. }
  91. const filterTimeRef = ref()
  92. function openDatePicker() {
  93. // 调用子组件的方法
  94. filterTimeRef.value.openPopup()
  95. }
  96. </script>
  97. <template>
  98. <view class="profile-container">
  99. <!-- 时间筛选 -->
  100. <view class="income-menu-time-filter">
  101. <view class="income-menu-time-filter-left">
  102. <view class="income-menu-time-filter-text" @click="showTimeFilter">
  103. <text>{{ formatTimeDisplay() }}</text>
  104. <up-icon name="arrow-down" color="#666666" size="14" />
  105. </view>
  106. <view>合计:¥4396.00</view>
  107. </view>
  108. <view class="income-menu-time-filter-right" @click="openDatePicker">
  109. 日期筛选
  110. </view>
  111. </view>
  112. <view class="income-header-menu">
  113. <!-- 优惠券列表 -->
  114. <view class="income-header-menu-list">
  115. <view v-for="item in list" :key="item.id" class="income-header-menu-item">
  116. <view class="income-header-menu-icon">
  117. <image src="@/static/images/income/tx-icon.png" mode="aspectFit" />
  118. <view class="income-header-menu-text">
  119. <view class="income-header-menu-text-nickname">
  120. 提现金额
  121. </view>
  122. <view>2025/10/29 12:44:26</view>
  123. </view>
  124. </view>
  125. <view class="income-header-menu-left">
  126. <view class="income-header-menu-left-amount">
  127. ¥{{ item.price }}
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. </view>
  133. <up-datetime-picker
  134. v-model="filterValue"
  135. mode="year-month"
  136. :show="show"
  137. close-on-click-overlay
  138. @confirm="confirm"
  139. @cancel="cancel"
  140. />
  141. <FilterTime ref="filterTimeRef" v-model="filterValue" @update:value="handleTimeChange" />
  142. </view>
  143. </template>
  144. <style lang="scss" scoped>
  145. .profile-container {
  146. font-family: Alibaba PuHuiTi;
  147. min-height: 100vh;
  148. background-color: #f5f5f5;
  149. line-height: 1;
  150. padding: 20rpx;
  151. .income-menu-time-filter {
  152. height: 83rpx;
  153. display: flex;
  154. justify-content: space-between;
  155. align-items: center;
  156. font-weight: 400;
  157. font-size: 24rpx;
  158. color: #333333;
  159. .income-menu-time-filter-left {
  160. display: flex;
  161. align-items: center;
  162. gap: 39rpx;
  163. .income-menu-time-filter-text {
  164. font-weight: 400;
  165. font-size: 26rpx;
  166. color: #000000;
  167. display: flex;
  168. align-items: center;
  169. gap: 12rpx;
  170. }
  171. }
  172. .income-menu-time-filter-right {
  173. font-weight: 400;
  174. font-size: 26rpx;
  175. color: #1777ff;
  176. display: flex;
  177. align-items: center;
  178. }
  179. }
  180. .income-header-menu {
  181. .income-header-menu-list {
  182. background: #ffffff;
  183. border-radius: 10rpx;
  184. .income-header-menu-item {
  185. height: 88rpx;
  186. display: flex;
  187. justify-content: space-between;
  188. align-items: center;
  189. border-bottom: 1px solid #eeeeee;
  190. padding: 32rpx 0 29rpx;
  191. margin: 0 26rpx;
  192. &:last-child {
  193. border-bottom: none;
  194. }
  195. .income-header-menu-icon {
  196. display: flex;
  197. justify-content: center;
  198. align-items: center;
  199. gap: 19rpx;
  200. image {
  201. width: 60rpx;
  202. height: 60rpx;
  203. }
  204. .income-header-menu-text {
  205. font-weight: 400;
  206. font-size: 24rpx;
  207. color: #888888;
  208. .income-header-menu-text-nickname {
  209. font-size: 28rpx;
  210. color: #222222;
  211. margin-bottom: 18rpx;
  212. }
  213. }
  214. }
  215. .income-header-menu-left {
  216. height: 100%;
  217. line-height: 100%;
  218. font-weight: 500;
  219. font-size: 24rpx;
  220. color: #888888;
  221. display: flex;
  222. align-items: center;
  223. .income-header-menu-left-amount {
  224. font-size: 30rpx;
  225. color: #222222;
  226. margin-bottom: 18rpx;
  227. }
  228. }
  229. }
  230. }
  231. }
  232. }
  233. </style>