|
@@ -10,10 +10,12 @@
|
|
:class="state.showMoney ? 'cicon-eye' : 'cicon-eye-off'" />
|
|
:class="state.showMoney ? 'cicon-eye' : 'cicon-eye-off'" />
|
|
</view>
|
|
</view>
|
|
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
|
<view class="ss-flex ss-row-between ss-col-center ss-m-t-30">
|
|
- <view class="money-num">{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****' }}</view>
|
|
|
|
|
|
+ <view class="money-num">{{ state.showMoney ? fen2yuan(state.summary.withdrawPrice || 0) : '*****' }}
|
|
|
|
+ </view>
|
|
<view class="ss-flex">
|
|
<view class="ss-flex">
|
|
<view class="ss-m-r-20">
|
|
<view class="ss-m-r-20">
|
|
- <button class="ss-reset-button withdraw-btn" @tap="sheep.$router.go('/pages/commission/withdraw')">
|
|
|
|
|
|
+ <button class="ss-reset-button withdraw-btn"
|
|
|
|
+ @tap="sheep.$router.go('/pages/commission/withdraw')">
|
|
提现
|
|
提现
|
|
</button>
|
|
</button>
|
|
</view>
|
|
</view>
|
|
@@ -27,14 +29,14 @@
|
|
<view class="loading-money">
|
|
<view class="loading-money">
|
|
<view class="loading-money-title">冻结佣金</view>
|
|
<view class="loading-money-title">冻结佣金</view>
|
|
<view class="loading-money-num">
|
|
<view class="loading-money-num">
|
|
- {{ state.showMoney ? fen2yuan(state.summary.frozenPrice || 0) : '*****' }}
|
|
|
|
- </view>
|
|
|
|
|
|
+ {{ state.showMoney ? fen2yuan(state.summary.frozenPrice || 0) : '*****' }}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="loading-money ss-m-l-100">
|
|
<view class="loading-money ss-m-l-100">
|
|
<view class="loading-money-title">可提现佣金</view>
|
|
<view class="loading-money-title">可提现佣金</view>
|
|
<view class="loading-money-num">
|
|
<view class="loading-money-num">
|
|
- {{ state.showMoney ? fen2yuan(state.summary.brokeragePrice || 0) : '*****' }}
|
|
|
|
- </view>
|
|
|
|
|
|
+ {{ state.showMoney ? fen2yuan(state.summary.brokeragePrice || 0) : '*****' }}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -51,7 +53,7 @@
|
|
</uni-datetime-picker>
|
|
</uni-datetime-picker>
|
|
|
|
|
|
<view class="total-box">
|
|
<view class="total-box">
|
|
- <!-- TODO 非繁人:这里暂时不考虑做 -->
|
|
|
|
|
|
+ <!-- TODO 非繁人:这里暂时不考虑做 -->
|
|
<!-- <view class="ss-m-b-10">总收入¥{{ state.pagination.income.toFixed(2) }}</view> -->
|
|
<!-- <view class="ss-m-b-10">总收入¥{{ state.pagination.income.toFixed(2) }}</view> -->
|
|
<!-- <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> -->
|
|
<!-- <view>总支出¥{{ (-state.pagination.expense).toFixed(2) }}</view> -->
|
|
</view>
|
|
</view>
|
|
@@ -60,7 +62,7 @@
|
|
</su-sticky>
|
|
</su-sticky>
|
|
<s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据"></s-empty>
|
|
<s-empty v-if="state.pagination.total === 0" icon="/static/data-empty.png" text="暂无数据"></s-empty>
|
|
|
|
|
|
- <!-- 转余额弹框 -->
|
|
|
|
|
|
+ <!-- 转余额弹框 -->
|
|
<su-popup :show="state.showModal" type="bottom" round="20" @close="state.showModal = false" showClose>
|
|
<su-popup :show="state.showModal" type="bottom" round="20" @close="state.showModal = false" showClose>
|
|
<view class="ss-p-x-20 ss-p-y-30">
|
|
<view class="ss-p-x-20 ss-p-y-30">
|
|
<view class="model-title ss-m-b-30 ss-m-l-20">转余额</view>
|
|
<view class="model-title ss-m-b-30 ss-m-l-20">转余额</view>
|
|
@@ -68,7 +70,7 @@
|
|
<view class="input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20">
|
|
<view class="input-box ss-flex ss-col-center border-bottom ss-m-b-70 ss-m-x-20">
|
|
<view class="unit">¥</view>
|
|
<view class="unit">¥</view>
|
|
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.price" type="number"
|
|
<uni-easyinput :inputBorder="false" class="ss-flex-1 ss-p-l-10" v-model="state.price" type="number"
|
|
- placeholder="请输入金额" />
|
|
|
|
|
|
+ placeholder="请输入金额" />
|
|
</view>
|
|
</view>
|
|
<button class="ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
|
|
<button class="ss-reset-button model-btn ui-BG-Main-Gradient ui-Shadow-Main" @tap="onConfirm">
|
|
确定
|
|
确定
|
|
@@ -100,33 +102,43 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
- import { computed, reactive } from 'vue';
|
|
|
|
- import { onLoad, onReachBottom } from '@dcloudio/uni-app';
|
|
|
|
|
|
+ import {
|
|
|
|
+ computed,
|
|
|
|
+ reactive
|
|
|
|
+ } from 'vue';
|
|
|
|
+ import {
|
|
|
|
+ onLoad,
|
|
|
|
+ onReachBottom
|
|
|
|
+ } from '@dcloudio/uni-app';
|
|
import sheep from '@/sheep';
|
|
import sheep from '@/sheep';
|
|
import dayjs from 'dayjs';
|
|
import dayjs from 'dayjs';
|
|
import _ from 'lodash';
|
|
import _ from 'lodash';
|
|
- import BrokerageApi from '@/sheep/api/trade/brokerage';
|
|
|
|
- import { fen2yuan } from '@/sheep/hooks/useGoods';
|
|
|
|
- import { resetPagination } from '@/sheep/util';
|
|
|
|
|
|
+ import BrokerageApi from '@/sheep/api/trade/brokerage';
|
|
|
|
+ import {
|
|
|
|
+ fen2yuan
|
|
|
|
+ } from '@/sheep/hooks/useGoods';
|
|
|
|
+ import {
|
|
|
|
+ resetPagination
|
|
|
|
+ } from '@/sheep/util';
|
|
|
|
|
|
const headerBg = sheep.$url.css('/static/img/shop/user/wallet_card_bg.png');
|
|
const headerBg = sheep.$url.css('/static/img/shop/user/wallet_card_bg.png');
|
|
|
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
- showMoney: false,
|
|
|
|
- summary: {}, // 分销信息
|
|
|
|
|
|
+ showMoney: false,
|
|
|
|
+ summary: {}, // 分销信息
|
|
|
|
|
|
- today: '',
|
|
|
|
- date: [],
|
|
|
|
|
|
+ today: '',
|
|
|
|
+ date: [],
|
|
currentTab: 0,
|
|
currentTab: 0,
|
|
pagination: {
|
|
pagination: {
|
|
- list: [],
|
|
|
|
- total: 0,
|
|
|
|
- pageNo: 1,
|
|
|
|
- pageSize: 1,
|
|
|
|
- },
|
|
|
|
|
|
+ list: [],
|
|
|
|
+ total: 0,
|
|
|
|
+ pageNo: 1,
|
|
|
|
+ pageSize: 1,
|
|
|
|
+ },
|
|
loadStatus: '',
|
|
loadStatus: '',
|
|
|
|
|
|
- price: undefined,
|
|
|
|
|
|
+ price: undefined,
|
|
showModal: false,
|
|
showModal: false,
|
|
});
|
|
});
|
|
|
|
|
|
@@ -150,19 +162,22 @@
|
|
|
|
|
|
async function getLogList() {
|
|
async function getLogList() {
|
|
state.loadStatus = 'loading';
|
|
state.loadStatus = 'loading';
|
|
- let { code, data } = await BrokerageApi.getBrokerageRecordPage({
|
|
|
|
|
|
+ let {
|
|
|
|
+ code,
|
|
|
|
+ data
|
|
|
|
+ } = await BrokerageApi.getBrokerageRecordPage({
|
|
pageSize: state.pagination.pageSize,
|
|
pageSize: state.pagination.pageSize,
|
|
pageNo: state.pagination.pageNo,
|
|
pageNo: state.pagination.pageNo,
|
|
- bizType: tabMaps[state.currentTab].value,
|
|
|
|
- 'createTime[0]': state.date[0] + ' 00:00:00',
|
|
|
|
- 'createTime[1]': state.date[1] + ' 23:59:59',
|
|
|
|
|
|
+ bizType: tabMaps[state.currentTab].value,
|
|
|
|
+ 'createTime[0]': state.date[0] + ' 00:00:00',
|
|
|
|
+ 'createTime[1]': state.date[1] + ' 23:59:59',
|
|
});
|
|
});
|
|
if (code !== 0) {
|
|
if (code !== 0) {
|
|
- return;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
- state.pagination.list = _.concat(state.pagination.list, data.list);
|
|
|
|
- state.pagination.total = data.total;
|
|
|
|
- state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
|
|
|
|
|
+ state.pagination.list = _.concat(state.pagination.list, data.list);
|
|
|
|
+ state.pagination.total = data.total;
|
|
|
|
+ state.loadStatus = state.pagination.list.length < state.pagination.total ? 'more' : 'noMore';
|
|
}
|
|
}
|
|
|
|
|
|
function onChangeTab(e) {
|
|
function onChangeTab(e) {
|
|
@@ -174,7 +189,7 @@
|
|
function onChangeTime(e) {
|
|
function onChangeTime(e) {
|
|
state.date[0] = e[0];
|
|
state.date[0] = e[0];
|
|
state.date[1] = e[e.length - 1];
|
|
state.date[1] = e[e.length - 1];
|
|
- resetPagination(state.pagination);
|
|
|
|
|
|
+ resetPagination(state.pagination);
|
|
getLogList();
|
|
getLogList();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -189,37 +204,42 @@
|
|
content: '确认把您的佣金转入到余额钱包中?',
|
|
content: '确认把您的佣金转入到余额钱包中?',
|
|
success: async function(res) {
|
|
success: async function(res) {
|
|
if (!res.confirm) {
|
|
if (!res.confirm) {
|
|
- return;
|
|
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const {
|
|
|
|
+ code
|
|
|
|
+ } = await BrokerageApi.createBrokerageWithdraw({
|
|
|
|
+ type: 1, // 钱包
|
|
|
|
+ price: state.price * 100,
|
|
|
|
+ });
|
|
|
|
+ if (code === 0) {
|
|
|
|
+ state.showModal = false;
|
|
|
|
+ await getAgentInfo();
|
|
|
|
+ onChangeTab({
|
|
|
|
+ index: 1
|
|
|
|
+ });
|
|
}
|
|
}
|
|
- const { code } = await BrokerageApi.createBrokerageWithdraw({
|
|
|
|
- type: 1, // 钱包
|
|
|
|
- price: state.price * 100,
|
|
|
|
- });
|
|
|
|
- if (code === 0) {
|
|
|
|
- state.showModal = false;
|
|
|
|
- await getAgentInfo();
|
|
|
|
- onChangeTab({
|
|
|
|
- index: 1
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
async function getAgentInfo() {
|
|
async function getAgentInfo() {
|
|
- const { code, data } = await BrokerageApi.getBrokerageUserSummary();
|
|
|
|
- if (code !== 0) {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- state.summary = data;
|
|
|
|
|
|
+ const {
|
|
|
|
+ code,
|
|
|
|
+ data
|
|
|
|
+ } = await BrokerageApi.getBrokerageUserSummary();
|
|
|
|
+ if (code !== 0) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ state.summary = data;
|
|
}
|
|
}
|
|
|
|
|
|
onLoad(async (options) => {
|
|
onLoad(async (options) => {
|
|
state.today = dayjs().format('YYYY-MM-DD');
|
|
state.today = dayjs().format('YYYY-MM-DD');
|
|
state.date = [state.today, state.today];
|
|
state.date = [state.today, state.today];
|
|
- if (options.type === 2) { // 切换到“提现” tab 下
|
|
|
|
- state.currentTab = 1;
|
|
|
|
- }
|
|
|
|
|
|
+ if (options.type === 2) { // 切换到“提现” tab 下
|
|
|
|
+ state.currentTab = 1;
|
|
|
|
+ }
|
|
getLogList();
|
|
getLogList();
|
|
getAgentInfo();
|
|
getAgentInfo();
|
|
});
|
|
});
|
|
@@ -228,8 +248,8 @@
|
|
if (state.loadStatus === 'noMore') {
|
|
if (state.loadStatus === 'noMore') {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- state.pagination.pageNo++;
|
|
|
|
- getLogList();
|
|
|
|
|
|
+ state.pagination.pageNo++;
|
|
|
|
+ getLogList();
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
|