forked from angelo/web-retail-h5
feat(bonus): 奖金明细调整,添加今日实发
This commit is contained in:
parent
3dc92c5f2c
commit
57c315b8a4
|
@ -1,6 +1,5 @@
|
||||||
const http = uni.$u.http
|
const http = uni.$u.http
|
||||||
|
|
||||||
// 登录
|
|
||||||
export const queryBonusTotal = data =>
|
export const queryBonusTotal = data =>
|
||||||
http.post('/bonus/api/bonus/query-bonus-total', data)
|
http.post('/bonus/api/bonus/query-bonus-total', data)
|
||||||
//新人礼包详情
|
//新人礼包详情
|
||||||
|
|
|
@ -116,6 +116,13 @@
|
||||||
"navigationBarBackgroundColor": "#fff"
|
"navigationBarBackgroundColor": "#fff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/bonus/menu",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "奖金查询",
|
||||||
|
"navigationBarBackgroundColor": "#fff"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/userData/index",
|
"path": "pages/userData/index",
|
||||||
"style": {
|
"style": {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="bonus-detail-page">
|
<view class="bonus-detail-page">
|
||||||
<view class="header-section">
|
<view class="header-section">
|
||||||
<!-- <view class="summary-bar">
|
<view class="summary-bar">
|
||||||
<text class="summary-text"
|
<text class="summary-text"
|
||||||
>今日实发合计:
|
>今日实发合计:
|
||||||
<text class="summary-amount">{{ realIncomeTotal }}</text></text
|
<text class="summary-amount">{{ realIncomeTotal }}</text></text
|
||||||
>
|
>
|
||||||
</view> -->
|
</view>
|
||||||
|
|
||||||
<!-- 日期筛选 -->
|
<!-- 日期筛选 -->
|
||||||
<view class="date-filter">
|
<view class="date-filter">
|
||||||
|
@ -108,8 +108,8 @@ export default {
|
||||||
loading: false,
|
loading: false,
|
||||||
hasMore: true,
|
hasMore: true,
|
||||||
BONUS_FIELD_MAP: {
|
BONUS_FIELD_MAP: {
|
||||||
repurRangeIncome: '复购级差收益',
|
|
||||||
retailRangeIncome: '直推级差收益',
|
retailRangeIncome: '直推级差收益',
|
||||||
|
repurRangeIncome: '复购级差收益',
|
||||||
retailAreaIncome: '复购配送收益',
|
retailAreaIncome: '复购配送收益',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -117,19 +117,17 @@ export default {
|
||||||
onLoad() {
|
onLoad() {
|
||||||
this.setDefaultDateRange()
|
this.setDefaultDateRange()
|
||||||
this.handleSearch()
|
this.handleSearch()
|
||||||
// this.getBonusTotal()
|
this.getBonusTotal()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
setDefaultDateRange() {
|
setDefaultDateRange() {
|
||||||
const end = new Date()
|
const end = dayjs().subtract(1, 'day')
|
||||||
const start = new Date()
|
const start = dayjs().subtract(61, 'day')
|
||||||
end.setDate(end.getDate() - 1)
|
this.startDate = start.format('YYYY-MM-DD')
|
||||||
start.setDate(end.getDate() - 60) // 默认查询最近15天
|
this.endDate = end.format('YYYY-MM-DD')
|
||||||
|
|
||||||
this.startDate = this.formatDate(start)
|
this.startDateValue = Number(start.toDate())
|
||||||
this.endDate = this.formatDate(end)
|
this.endDateValue = Number(end.toDate())
|
||||||
this.startDateValue = Number(start)
|
|
||||||
this.endDateValue = Number(end)
|
|
||||||
},
|
},
|
||||||
formatDate(date) {
|
formatDate(date) {
|
||||||
return dayjs(date).format('YYYY-MM-DD')
|
return dayjs(date).format('YYYY-MM-DD')
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
<template>
|
||||||
|
<view class="content">
|
||||||
|
<view
|
||||||
|
@click="goRouter(item.path)"
|
||||||
|
class="kuaibox"
|
||||||
|
v-for="(item, index) in selfServiceList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
|
<view class="">
|
||||||
|
{{ item.name }}
|
||||||
|
</view>
|
||||||
|
<image class="kuaiimg" :src="item.url" mode=""></image>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import * as sel from '@/config/selfService.js'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['user']),
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selfServiceList: [
|
||||||
|
// {
|
||||||
|
// name: '实时奖金',
|
||||||
|
// url: '../../static/images/bonus-record.svg',
|
||||||
|
// path: '/pages/bonus/real-time',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
name: '奖金明细',
|
||||||
|
url: '../../static/images/mark2.png',
|
||||||
|
path: '/pages/bonus/index',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
userInfo: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onShow() {
|
||||||
|
this.userInfo = uni.getStorageSync('User')
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
goRouter(path) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: path,
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.content {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
padding: 4rpx 21rpx 500rpx 21rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.kuaibox {
|
||||||
|
width: 40%;
|
||||||
|
// height: 150rpx;
|
||||||
|
border-radius: 20rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
padding: 60rpx 40rpx 60rpx 22rpx;
|
||||||
|
margin: 13rpx 0rpx;
|
||||||
|
background-color: #ffffff;
|
||||||
|
font-size: 24rpx;
|
||||||
|
font-family: Source Han Sans CN;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #666666;
|
||||||
|
|
||||||
|
.kuaiimg {
|
||||||
|
width: 52rpx;
|
||||||
|
height: 53rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,229 @@
|
||||||
|
<template>
|
||||||
|
<view class="container">
|
||||||
|
<!-- 总览卡片 -->
|
||||||
|
<view class="summary-card">
|
||||||
|
<view class="summary-title-container">
|
||||||
|
<view class="summary-icon"></view>
|
||||||
|
<text class="summary-title">今日实发合计</text>
|
||||||
|
</view>
|
||||||
|
<view class="summary-amount">
|
||||||
|
<text class="currency-symbol">¥</text>
|
||||||
|
<text>{{ bonusData.realIncomeTotal || '0.00' }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 奖金明细列表 -->
|
||||||
|
<view class="details-card">
|
||||||
|
<view class="detail-item">
|
||||||
|
<text class="detail-label">奖金日期</text>
|
||||||
|
<text class="detail-value date">{{
|
||||||
|
bonusData.settleDate || formatDate
|
||||||
|
}}</text>
|
||||||
|
</view>
|
||||||
|
<template v-for="(label, key) in detailLabels">
|
||||||
|
<view v-if="key === 'repurRangeIncome'">
|
||||||
|
<view
|
||||||
|
v-if="bonusData.repurRangeIncome"
|
||||||
|
class="detail-item"
|
||||||
|
:key="key"
|
||||||
|
>
|
||||||
|
<text class="detail-label">{{ label }}</text>
|
||||||
|
<text class="detail-value">
|
||||||
|
<text class="currency-symbol-small">¥</text>
|
||||||
|
{{ bonusData[key] || '0.00' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view v-else class="detail-item" :key="key">
|
||||||
|
<text class="detail-label">{{ label }}</text>
|
||||||
|
<text class="detail-value">
|
||||||
|
<text class="currency-symbol-small">¥</text>
|
||||||
|
{{ bonusData[key] || '0.00' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<!-- 分割线 -->
|
||||||
|
<view class="divider"></view>
|
||||||
|
<!-- 小计 -->
|
||||||
|
<view class="detail-item total">
|
||||||
|
<text class="detail-label total-label">小计(¥)</text>
|
||||||
|
<text class="detail-value total-value">
|
||||||
|
<text class="currency-symbol-small">¥</text>
|
||||||
|
{{ bonusData.retailRealSubtotal || '0.00' }}
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { realTimeBonus } from '@/config/bonus.js'
|
||||||
|
import dayjs from 'dayjs'
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 使用截图中的数据作为示例
|
||||||
|
bonusData: {
|
||||||
|
totalIssued: 0,
|
||||||
|
date: '',
|
||||||
|
retailRangeIncome: 0,
|
||||||
|
retailSameLevelIncome: 0.0,
|
||||||
|
retailAreaIncome: 0.0,
|
||||||
|
// welfareLevelDifferenceIncome: 0.0,
|
||||||
|
// welfareDividendIncome: 0.0,
|
||||||
|
backPoints: 0,
|
||||||
|
subtotal: 0,
|
||||||
|
},
|
||||||
|
detailLabels: {
|
||||||
|
retailRangeIncome: '直推收益(¥)',
|
||||||
|
retailSameLevelIncome: '平级收益(¥)',
|
||||||
|
retailAreaIncome: '区域收益(¥)',
|
||||||
|
repurRangeIncome: '复购级差收益(¥)',
|
||||||
|
// welfareLevelDifferenceIncome: '福利级差收益(¥)',
|
||||||
|
// welfareDividendIncome: '福利分红收益(¥)',
|
||||||
|
backPoints: '重消收益(¥)',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onLoad() {},
|
||||||
|
onShow() {
|
||||||
|
this.getRealTimeBonus()
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formatDate() {
|
||||||
|
return dayjs(new Date()).format('YYYY-MM-DD')
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getRealTimeBonus() {
|
||||||
|
realTimeBonus().then(res => {
|
||||||
|
this.bonusData = res.rows?.[0] || {}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* 主题色 */
|
||||||
|
:root {
|
||||||
|
--primary-color: #005bac;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
background-color: #f7f8fa;
|
||||||
|
min-height: 100vh;
|
||||||
|
padding: 12px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
font-family:
|
||||||
|
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
|
||||||
|
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-card {
|
||||||
|
background: linear-gradient(45deg, #005bac, #0077d9);
|
||||||
|
color: #ffffff;
|
||||||
|
padding: 24px;
|
||||||
|
border-radius: 16px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 91, 172, 0.2);
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-title-container {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-icon {
|
||||||
|
width: 4px;
|
||||||
|
height: 16px;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 2px;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-title {
|
||||||
|
font-size: 16px;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.summary-amount {
|
||||||
|
font-size: 38px;
|
||||||
|
font-weight: 700;
|
||||||
|
display: flex;
|
||||||
|
align-items: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-symbol {
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.currency-symbol-small {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #666;
|
||||||
|
margin-right: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.details-card {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 8px 20px;
|
||||||
|
border-radius: 16px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-item {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 18px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.divider {
|
||||||
|
height: 1px;
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-label {
|
||||||
|
font-size: 15px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-value {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #333;
|
||||||
|
font-weight: 500;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail-value.date {
|
||||||
|
color: #999;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total {
|
||||||
|
padding-top: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-label {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-value {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: var(--primary-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
.total-value .currency-symbol-small {
|
||||||
|
color: var(--primary-color);
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -308,7 +308,7 @@ export default {
|
||||||
ifshow: false,
|
ifshow: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: '/pages/bonus/index',
|
url: '/pages/bonus/menu',
|
||||||
name: '奖金明细',
|
name: '奖金明细',
|
||||||
imgurl: '../../static/images/mark2.png',
|
imgurl: '../../static/images/mark2.png',
|
||||||
menuKey: 'incomeDetail',
|
menuKey: 'incomeDetail',
|
||||||
|
|
Loading…
Reference in New Issue