1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
{"version":3,"file":"money.js","sources":["../../../../../../../src/modules/mall/user/wallet/money.vue","../../../../../../../uniPage:/bW9kdWxlc1xtYWxsXHVzZXJcd2FsbGV0XG1vbmV5LnZ1ZQ"],"sourcesContent":["<!-- 我的钱包 -->\r\n<template>\r\n <s-layout class=\"wallet-wrap\" title=\"钱包\">\r\n <!-- 钱包卡片 -->\r\n <view class=\"header-box ss-flex ss-row-center ss-col-center\">\r\n <view class=\"card-box ui-BG-Main ui-Shadow-Main\">\r\n <view class=\"card-head ss-flex ss-col-center\">\r\n <view class=\"card-title ss-m-r-10\">钱包余额(元)</view>\r\n <view\r\n @tap=\"state.showMoney = !state.showMoney\"\r\n class=\"ss-eye-icon\"\r\n :class=\"state.showMoney ? 'cicon-eye' : 'cicon-eye-off'\"\r\n />\r\n </view>\r\n <view class=\"ss-flex ss-row-between ss-col-center ss-m-t-64\">\r\n <view class=\"money-num\">\r\n {{ state.showMoney ? fen2yuan(userWallet.balance) : '*****' }}\r\n </view>\r\n <button\r\n class=\"ss-reset-button topup-btn\"\r\n @tap=\"sheep.$router.go('/modules/mall/pay/recharge')\"\r\n >\r\n 充值\r\n </button>\r\n </view>\r\n </view>\r\n </view>\r\n\r\n <su-sticky>\r\n <!-- 统计 -->\r\n <view class=\"filter-box ss-p-x-30 ss-flex ss-col-center ss-row-between\">\r\n <uni-datetime-picker\r\n v-model=\"state.data\"\r\n type=\"daterange\"\r\n @change=\"onChangeTime\"\r\n :end=\"state.today\"\r\n >\r\n <button class=\"ss-reset-button date-btn\">\r\n <text>{{ dateFilterText }}</text>\r\n <text class=\"cicon-drop-down ss-seldate-icon\"></text>\r\n </button>\r\n </uni-datetime-picker>\r\n <view class=\"total-box\">\r\n <view class=\"ss-m-b-10\">总收入¥{{ fen2yuan(state.summary.totalIncome) }}</view>\r\n <view>总支出¥{{ fen2yuan(state.summary.totalExpense) }}</view>\r\n </view>\r\n </view>\r\n <su-tabs\r\n :list=\"tabMaps\"\r\n @change=\"onChange\"\r\n :scrollable=\"false\"\r\n :current=\"state.currentTab\"\r\n ></su-tabs>\r\n </su-sticky>\r\n <s-empty v-if=\"state.pagination.total === 0\" text=\"暂无数据\" icon=\"/static/data-empty.png\" />\r\n\r\n <!-- 钱包记录 -->\r\n <view v-if=\"state.pagination.total > 0\">\r\n <view\r\n class=\"wallet-list ss-flex border-bottom\"\r\n v-for=\"item in state.pagination.list\"\r\n :key=\"item.id\"\r\n >\r\n <view class=\"list-content\">\r\n <view class=\"title-box ss-flex ss-row-between ss-m-b-20\">\r\n <text class=\"title ss-line-1\">\r\n {{ item.title }}\r\n </text>\r\n <view class=\"money\">\r\n <text v-if=\"item.price >= 0\" class=\"add\">+{{ fen2yuan(item.price) }}</text>\r\n <text v-else class=\"minus\">{{ fen2yuan(item.price) }}</text>\r\n </view>\r\n </view>\r\n <text class=\"time\">\r\n {{ sheep.$helper.timeFormat(state.createTime, 'yyyy-mm-dd hh:MM:ss') }}\r\n </text>\r\n </view>\r\n </view>\r\n </view>\r\n <uni-load-more\r\n v-if=\"state.pagination.total > 0\"\r\n :status=\"state.loadStatus\"\r\n :content-text=\"{\r\n contentdown: '上拉加载更多',\r\n }\"\r\n />\r\n </s-layout>\r\n</template>\r\n\r\n<script setup>\r\nimport { computed, reactive } from 'vue'\r\nimport { onLoad, onReachBottom } from '@dcloudio/uni-app'\r\nimport sheep from '@/sheep'\r\nimport dayjs from 'dayjs'\r\nimport _ from 'lodash-es'\r\nimport PayWalletApi from '@/sheep/api/pay/wallet'\r\nimport { fen2yuan } from '@/sheep/hooks/useGoods'\r\nimport { resetPagination } from '@/sheep/util'\r\n\r\nconst headerBg = sheep.$url.css('/static/img/shop/user/wallet_card_bg.png')\r\n\r\n// 数据\r\nconst state = reactive({\r\n showMoney: false,\r\n date: [], // 筛选的时间段\r\n currentTab: 0,\r\n pagination: {\r\n list: [],\r\n total: 0,\r\n pageNo: 1,\r\n pageSize: 8,\r\n },\r\n summary: {\r\n totalIncome: 0,\r\n totalExpense: 0,\r\n },\r\n loadStatus: '',\r\n today: '',\r\n})\r\n\r\nconst tabMaps = [\r\n {\r\n name: '全部',\r\n value: '',\r\n },\r\n {\r\n name: '收入',\r\n value: '1',\r\n },\r\n {\r\n name: '支出',\r\n value: '2',\r\n },\r\n]\r\n\r\nconst userWallet = computed(() => sheep.$store('user').userWallet)\r\n\r\n// 格式化时间段\r\nconst dateFilterText = computed(() => {\r\n if (state.date[0] === state.date[1]) {\r\n return state.date[0]\r\n } else {\r\n return state.date.join('~')\r\n }\r\n})\r\n\r\n// 获得钱包记录分页\r\nasync function getLogList() {\r\n state.loadStatus = 'loading'\r\n const { data, code } = await PayWalletApi.getWalletTransactionPage({\r\n pageNo: state.pagination.pageNo,\r\n pageSize: state.pagination.pageSize,\r\n type: tabMaps[state.currentTab].value,\r\n 'createTime[0]': state.date[0] + ' 00:00:00',\r\n 'createTime[1]': state.date[1] + ' 23:59:59',\r\n })\r\n if (code !== 0) {\r\n return\r\n }\r\n state.pagination.list = _.concat(state.pagination.list, data.list)\r\n state.pagination.total = data.total\r\n state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore'\r\n}\r\n\r\n// 获得钱包统计\r\nasync function getSummary() {\r\n const { data, code } = await PayWalletApi.getWalletTransactionSummary({\r\n createTime: [state.date[0] + ' 00:00:00', state.date[1] + ' 23:59:59'],\r\n })\r\n if (code !== 0) {\r\n return\r\n }\r\n state.summary = data\r\n}\r\n\r\nonLoad(() => {\r\n state.today = dayjs().format('YYYY-MM-DD')\r\n state.date = [state.today, state.today]\r\n getLogList()\r\n getSummary()\r\n // 刷新钱包的缓存\r\n sheep.$store('user').getWallet()\r\n})\r\n\r\n// 处理 tab 切换\r\nfunction onChange(e) {\r\n state.currentTab = e.index\r\n // 重新加载列表\r\n resetPagination(state.pagination)\r\n getLogList()\r\n getSummary()\r\n}\r\n\r\n// 处理时间筛选\r\nfunction onChangeTime(e) {\r\n state.date[0] = e[0]\r\n state.date[1] = e[e.length - 1]\r\n // 重新加载列表\r\n resetPagination(state.pagination)\r\n getLogList()\r\n getSummary()\r\n}\r\n\r\nonReachBottom(() => {\r\n if (state.loadStatus === 'noMore') {\r\n return\r\n }\r\n state.pagination.pageNo++\r\n getLogList()\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n \r\n// 钱包\r\n.header-box {\r\n padding: 30rpx;\r\n background-color: $white;\r\n\r\n .card-box {\r\n position: relative;\r\n z-index: 1;\r\n box-sizing: border-box;\r\n width: 100%;\r\n min-height: 300rpx;\r\n padding: 40rpx;\r\n overflow: hidden;\r\n background-size: 100% 100%;\r\n border-radius: 30rpx;\r\n\r\n &::after {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n z-index: 2;\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n pointer-events: none;\r\n content: '';\r\n background: v-bind(headerBg) no-repeat;\r\n }\r\n\r\n .card-head {\r\n font-size: 30rpx;\r\n color: $white;\r\n }\r\n\r\n .ss-eye-icon {\r\n font-size: 40rpx;\r\n color: $white;\r\n }\r\n\r\n .money-num {\r\n font-family: OPPOSANS;\r\n font-size: 70rpx;\r\n font-weight: 500;\r\n line-height: 70rpx;\r\n color: $white;\r\n }\r\n\r\n .reduce-num {\r\n font-size: 26rpx;\r\n font-weight: 400;\r\n color: $white;\r\n }\r\n\r\n .topup-btn {\r\n width: 120rpx;\r\n height: 60rpx;\r\n font-size: 26rpx;\r\n font-weight: 500;\r\n line-height: 60rpx;\r\n color: var(--ui-BG-Main);\r\n background-color: $white;\r\n border-radius: 30px;\r\n }\r\n }\r\n}\r\n\r\n// 筛选\r\n\r\n.filter-box {\r\n height: 114rpx;\r\n background-color: $bg-page;\r\n\r\n .total-box {\r\n font-size: 24rpx;\r\n font-weight: 500;\r\n color: $dark-9;\r\n }\r\n\r\n .date-btn {\r\n padding: 0 20rpx;\r\n font-size: 24rpx;\r\n font-weight: 500;\r\n line-height: 54rpx;\r\n color: $dark-6;\r\n background-color: $white;\r\n border-radius: 27rpx;\r\n\r\n .ss-seldate-icon {\r\n font-size: 50rpx;\r\n color: $dark-9;\r\n }\r\n }\r\n}\r\n\r\n.tabs-box {\r\n background: $white;\r\n border-bottom: 2rpx solid #eeeeee;\r\n}\r\n\r\n// tab\r\n.wallet-tab-card {\r\n .tab-item {\r\n position: relative;\r\n height: 80rpx;\r\n\r\n .tab-title {\r\n font-size: 30rpx;\r\n }\r\n\r\n .cur-tab-title {\r\n font-weight: $font-weight-bold;\r\n }\r\n\r\n .tab-line {\r\n position: absolute;\r\n bottom: 2rpx;\r\n left: 50%;\r\n width: 60rpx;\r\n height: 6rpx;\r\n background-color: var(--ui-BG-Main);\r\n border-radius: 6rpx;\r\n transform: translateX(-50%);\r\n }\r\n }\r\n}\r\n\r\n// 钱包记录\r\n.wallet-list {\r\n padding: 30rpx;\r\n background-color: #ffff;\r\n\r\n .head-img {\r\n width: 70rpx;\r\n height: 70rpx;\r\n background: $gray-c;\r\n border-radius: 50%;\r\n }\r\n\r\n .list-content {\r\n flex: 1;\r\n align-items: flex-start;\r\n justify-content: space-between;\r\n\r\n .title {\r\n width: 400rpx;\r\n font-size: 28rpx;\r\n color: $dark-3;\r\n }\r\n\r\n .time {\r\n font-size: 22rpx;\r\n color: $gray-c;\r\n }\r\n }\r\n\r\n .money {\r\n font-family: OPPOSANS;\r\n font-size: 28rpx;\r\n font-weight: bold;\r\n .add {\r\n color: var(--ui-BG-Main);\r\n }\r\n\r\n .minus {\r\n color: $dark-3;\r\n }\r\n }\r\n}\r\n</style>\r\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/modules/mall/user/wallet/money.vue'\nwx.createPage(MiniProgramPage)"],"names":["sheep","reactive","computed","PayWalletApi","_","onLoad","dayjs","resetPagination","onReachBottom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,UAAA,WAAAA,YAAA,MAAA,KAAA,IAAA,0CA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