acdr-ui/dist/dev/mp-weixin/modules/mall/commission/wallet.js.map

1 line
16 KiB
Plaintext

{"version":3,"file":"wallet.js","sources":["../../../../../../src/modules/mall/commission/wallet.vue","../../../../../../uniPage:/bW9kdWxlc1xtYWxsXGNvbW1pc3Npb25cd2FsbGV0LnZ1ZQ"],"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-30\">\r\n <view class=\"money-num\">\r\n {{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****' }}\r\n </view>\r\n <view class=\"ss-flex\">\r\n <view class=\"ss-m-r-20\">\r\n <button\r\n class=\"ss-reset-button withdraw-btn\"\r\n @tap=\"sheep.$router.go('/modules/mall/commission/withdraw')\"\r\n >\r\n 提现\r\n </button>\r\n </view>\r\n <button class=\"ss-reset-button balance-btn ss-m-l-20\" @tap=\"state.showModal = true\">\r\n 转余额\r\n </button>\r\n </view>\r\n </view>\r\n\r\n <view class=\"ss-flex\">\r\n <view class=\"loading-money\">\r\n <view class=\"loading-money-title\">冻结佣金</view>\r\n <view class=\"loading-money-num\">\r\n {{ state.showMoney ? fen2yuan(state.summary.frozenPrice || 0) : '*****' }}\r\n </view>\r\n </view>\r\n <view class=\"loading-money ss-m-l-100\">\r\n <view class=\"loading-money-title\">可提现佣金</view>\r\n <view class=\"loading-money-num\">\r\n {{ state.showMoney ? fen2yuan(state.summary.brokeragePrice || 0) : '*****' }}\r\n </view>\r\n </view>\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.date\"\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\" />\r\n </button>\r\n </uni-datetime-picker>\r\n\r\n <view class=\"total-box\">\r\n <!-- TODO 芋艿:这里暂时不考虑做 -->\r\n <!-- <view class=\"ss-m-b-10\">总收入¥{{ state.pagination.income.toFixed(2) }}</view> -->\r\n <!-- <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> -->\r\n </view>\r\n </view>\r\n <su-tabs\r\n :list=\"tabMaps\"\r\n @change=\"onChangeTab\"\r\n :scrollable=\"false\"\r\n :current=\"state.currentTab\"\r\n />\r\n </su-sticky>\r\n <s-empty\r\n v-if=\"state.pagination.total === 0\"\r\n icon=\"/static/data-empty.png\"\r\n text=\"暂无数据\"\r\n ></s-empty>\r\n\r\n <!-- 转余额弹框 -->\r\n <su-popup\r\n :show=\"state.showModal\"\r\n type=\"bottom\"\r\n round=\"20\"\r\n @close=\"state.showModal = false\"\r\n showClose\r\n >\r\n <view class=\"ss-p-x-20 ss-p-y-30\">\r\n <view class=\"model-title ss-m-b-30 ss-m-l-20\">转余额</view>\r\n <view class=\"model-subtitle ss-m-b-100 ss-m-l-20\">将您的佣金转到余额中继续消费</view>\r\n <view class=\"input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20\">\r\n <view class=\"unit\">¥</view>\r\n <uni-easyinput\r\n :inputBorder=\"false\"\r\n class=\"ss-flex-1 ss-p-l-10\"\r\n v-model=\"state.price\"\r\n type=\"number\"\r\n placeholder=\"请输入金额\"\r\n />\r\n </view>\r\n <button\r\n class=\"ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main\"\r\n @tap=\"onConfirm\"\r\n >\r\n 确定\r\n </button>\r\n </view>\r\n </su-popup>\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\">{{ item.title }}</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(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}\r\n </text>\r\n </view>\r\n </view>\r\n </view>\r\n\r\n <!-- <u-gap></u-gap> -->\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 BrokerageApi from '@/sheep/api/trade/brokerage'\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\nconst state = reactive({\r\n showMoney: false,\r\n summary: {}, // 分销信息\r\n\r\n today: '',\r\n date: [],\r\n currentTab: 0,\r\n pagination: {\r\n list: [],\r\n total: 0,\r\n pageNo: 1,\r\n pageSize: 1,\r\n },\r\n loadStatus: '',\r\n\r\n price: undefined,\r\n showModal: false,\r\n})\r\n\r\nconst tabMaps = [\r\n {\r\n name: '分佣',\r\n value: '1', // BrokerageRecordBizTypeEnum.ORDER\r\n },\r\n {\r\n name: '提现',\r\n value: '2', // BrokerageRecordBizTypeEnum.WITHDRAW\r\n },\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\nasync function getLogList() {\r\n state.loadStatus = 'loading'\r\n const { code, data } = await BrokerageApi.getBrokerageRecordPage({\r\n pageSize: state.pagination.pageSize,\r\n pageNo: state.pagination.pageNo,\r\n bizType: 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\nfunction onChangeTab(e) {\r\n resetPagination(state.pagination)\r\n state.currentTab = e.index\r\n getLogList()\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 resetPagination(state.pagination)\r\n getLogList()\r\n}\r\n\r\n// 确认操作(转账到余额)\r\nasync function onConfirm() {\r\n if (state.price <= 0) {\r\n sheep.$helper.toast('请输入正确的金额')\r\n return\r\n }\r\n uni.showModal({\r\n title: '提示',\r\n content: '确认把您的佣金转入到余额钱包中?',\r\n success: async function (res) {\r\n if (!res.confirm) {\r\n return\r\n }\r\n const { code } = await BrokerageApi.createBrokerageWithdraw({\r\n type: 1, // 钱包\r\n price: state.price * 100,\r\n })\r\n if (code === 0) {\r\n state.showModal = false\r\n await getAgentInfo()\r\n onChangeTab({\r\n index: 1,\r\n })\r\n }\r\n },\r\n })\r\n}\r\n\r\nasync function getAgentInfo() {\r\n const { code, data } = await BrokerageApi.getBrokerageUserSummary()\r\n if (code !== 0) {\r\n return\r\n }\r\n state.summary = data\r\n}\r\n\r\nonLoad(async (options) => {\r\n state.today = dayjs().format('YYYY-MM-DD')\r\n state.date = [state.today, state.today]\r\n if (options.type === 2) {\r\n // 切换到“提现” tab 下\r\n state.currentTab = 1\r\n }\r\n getLogList()\r\n getAgentInfo()\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: 24rpx;\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: 40rpx;\r\n font-weight: 500;\r\n line-height: normal;\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 .withdraw-btn {\r\n width: 120rpx;\r\n height: 60rpx;\r\n font-size: 24rpx;\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 .balance-btn {\r\n width: 120rpx;\r\n height: 60rpx;\r\n font-size: 24rpx;\r\n font-weight: 500;\r\n line-height: 60rpx;\r\n color: $white;\r\n border: 1px solid $white;\r\n border-radius: 30px;\r\n }\r\n }\r\n}\r\n\r\n.loading-money {\r\n margin-top: 56rpx;\r\n\r\n .loading-money-title {\r\n margin-bottom: 30rpx;\r\n font-size: 24rpx;\r\n font-weight: 400;\r\n line-height: normal;\r\n color: #ffffff;\r\n }\r\n\r\n .loading-money-num {\r\n font-family: OPPOSANS;\r\n font-size: 30rpx;\r\n font-weight: 500;\r\n color: #fefefe;\r\n }\r\n}\r\n\r\n// 筛选\r\n\r\n.filter-box {\r\n height: 120rpx;\r\n padding: 0 30rpx;\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// 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\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\r\n.model-title {\r\n font-size: 36rpx;\r\n font-weight: bold;\r\n color: #333333;\r\n}\r\n\r\n.model-subtitle {\r\n font-size: 26rpx;\r\n color: #c2c7cf;\r\n}\r\n\r\n.model-btn {\r\n width: 100%;\r\n height: 80rpx;\r\n font-size: 28rpx;\r\n font-weight: 500;\r\n line-height: normal;\r\n color: #ffffff;\r\n border-radius: 40rpx;\r\n}\r\n\r\n.input-box {\r\n height: 100rpx;\r\n\r\n .unit {\r\n font-size: 48rpx;\r\n font-weight: 500;\r\n line-height: normal;\r\n color: #333;\r\n }\r\n\r\n .uni-easyinput__placeholder-class {\r\n height: 40rpx;\r\n font-size: 30rpx;\r\n line-height: normal;\r\n }\r\n}\r\n</style>\r\n","import MiniProgramPage from 'D:/App/Work/addr/acdr-ui/src/modules/mall/commission/wallet.vue'\nwx.createPage(MiniProgramPage)"],"names":["sheep","reactive","computed","BrokerageApi","_","resetPagination","uni","onLoad","dayjs","onReachBottom"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6JA,UAAA,WAAAA,YAAA,MAAA,KAAA,IAAA,0CAAA;AAEA,UAAA,QAAAC,cAAAA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,SAAA,CAAA;AAAA;AAAA,MAEA,OAAA;AAAA,MACA,MAAA,CAAA;AAAA,MACA,YAAA;AAAA,MACA,YAAA;AAAA,QACA,MAAA,CAAA;AAAA,QACA,OAAA;AAAA,QACA,QAAA;AAAA,QACA,UAAA;AAAA,MACA;AAAA,MACA,YAAA;AAAA,MAEA,OAAA;AAAA,M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