fix(bonus-lx): 奖金明细页面调整优化 bug-149

This commit is contained in:
woody 2025-06-05 14:15:01 +08:00
parent 2ea0ff0f41
commit 8483914d0b
3 changed files with 682 additions and 587 deletions

View File

@ -1,4 +1,3 @@
<template>
<view class="main">
<view v-if="userInfo.pkCountry != 1" class="top">
@ -6,27 +5,33 @@
<view class="time-text">{{ '查询时间' }}</view>
<view class="time1">
<picker :value="query.startDate" mode="date" @change="bindDateChange">
<view v-if="query.startDate!=''" class="uni-input">{{query.startDate}}</view>
<view v-if="query.startDate != ''" class="uni-input">{{
query.startDate
}}</view>
<view v-else class="uni-input">{{ '开始日期' }}</view>
</picker>
</view>
<view class="text_s">{{ '至' }}</view>
<view class="time1">
<picker :value="query.endDate" mode="date" @change="bindDateChange1">
<view v-if="query.endDate!=''" class="uni-input">{{query.endDate}}</view>
<view v-if="query.endDate != ''" class="uni-input">{{
query.endDate
}}</view>
<view v-else class="uni-input">{{ '结束日期' }}</view>
</picker>
</view>
<view class="search-icons" @click="submit">
<image class="search-icon-s" src="../../static/images/search.png"></image>
<image
class="search-icon-s"
src="../../static/images/search.png"
></image>
</view>
</view>
</view>
<view class="search-content">
<view class="search-list">
<view v-for="item in dataList" class="search-view">
<view style="height: 20rpx;"></view>
<view style="height: 20rpx"></view>
<view class="flex_s">
<view class="data-left">
{{ '奖金日期' }}
@ -37,7 +42,7 @@
</view>
<view class="flex_s">
<view class="data-left">
{{'直推收益'}}({{ isLocaled() }})
{{ '直推收益' }}
</view>
<view class="data-right">
{{ item.directIncome | toThousandthAndKeepDecimal }}
@ -45,7 +50,7 @@
</view>
<view class="flex_s">
<view class="data-left">
{{'拓展收益'}}({{ isLocaled() }})
{{ '拓展收益' }}
</view>
<view class="data-right">
{{ item.expandIncome | toThousandthAndKeepDecimal }}
@ -53,7 +58,7 @@
</view>
<view class="flex_s">
<view class="data-left">
{{'辅导收益'}}({{ isLocaled() }})
{{ '辅导收益' }}
</view>
<view class="data-right">
{{ item.coachIncome | toThousandthAndKeepDecimal }}
@ -61,7 +66,7 @@
</view>
<!-- <view class="flex_s">
<view class="data-left">
{{'分红收益'}}({{ isLocaled() }})
{{'分红收益'}}
</view>
<view class="data-right">
{{item.shareIncome| toThousandthAndKeepDecimal}}
@ -69,23 +74,21 @@
</view> -->
<view class="flex_s" v-if="userInfo.pkCountry == 1">
<view class="data-left">
{{'服务补贴'}}({{ isLocaled() }})
{{ '服务补贴' }}
</view>
<view class="data-right">
{{ item.serviceIncome | toThousandthAndKeepDecimal }}
</view>
</view>
<view class="flex_s">
<view class="data-left">
级差收益({{ isLocaled() }})
</view>
<view class="data-left"> 级差收益 </view>
<view class="data-right">
{{ item.repurRangeIncome | toThousandthAndKeepDecimal }}
</view>
</view>
<view class="flex_s">
<view class="data-left">
{{$t('直推级差')}}({{ isLocaled() }})
{{ $t('直推级差') }}
</view>
<view class="data-right">
{{ item.globalPoints | toThousandthAndKeepDecimal }}
@ -93,7 +96,7 @@
</view>
<view class="flex_s" v-if="userInfo.pkCountry == 1">
<view class="data-left">
{{'重复消费'}}({{ isLocaled() }})
{{ '重复消费' }}
</view>
<view class="data-right">
{{ item.backPoints | toThousandthAndKeepDecimal }}
@ -101,7 +104,7 @@
</view>
<view class="flex_s" v-if="userInfo.pkCountry == 1">
<view class="data-left">
{{'平台服务费'}}({{ isLocaled() }})
{{ '平台服务费' }}
</view>
<view class="data-right">
{{ item.serviceSpend | toThousandthAndKeepDecimal }}
@ -109,7 +112,7 @@
</view>
<view class="flex_s">
<view class="data-left">
{{'实发小计'}}({{ isLocaled() }})
{{ '实发小计' }}
</view>
<view class="data-right">
{{ item.purRealSubtotal | toThousandthAndKeepDecimal }}
@ -120,8 +123,8 @@
{{'查看详情'}}
</view>
</view> -->
<view style="clear: both;"></view>
<view style="height: 20rpx;background-color: #fff;"></view>
<view style="clear: both"></view>
<view style="height: 20rpx; background-color: #fff"></view>
</view>
</view>
</view>
@ -130,13 +133,9 @@
<script>
import * as api from '@/config/login.js'
import {
setToken
} from '@/config/auth.js'
import { setToken } from '@/config/auth.js'
import store from '@/store'
import {
isLocaled
} from '@/util/numberToCurrency'
import { isLocaled } from '@/util/numberToCurrency'
export default {
data() {
@ -150,18 +149,16 @@
endDate: '',
sourceMemberCode: '',
sourceMemberName: '',
pkBonusItems: ''
pkBonusItems: '',
},
page: {
pageNum: 1,
pageSize: 50
}
pageSize: 50,
},
}
},
props: ["num", "checkRule"],
onLoad() {
},
props: ['num', 'checkRule'],
onLoad() {},
created() {
// this.getType()
this.userInfo = uni.getStorageSync('User')
@ -171,15 +168,18 @@
isLocaled,
urlTap() {
uni.navigateTo({
url: '/pages/bonusSource/index'
url: '/pages/bonusSource/index',
})
},
getInfo() {
api.getInfo().then(res => {
api
.getInfo()
.then(res => {
if (res) {
this.userInfo = res.data
}
}).catch(error => {
})
.catch(error => {
reject(error)
})
},
@ -187,11 +187,14 @@
this.getDataList()
},
getType() {
api.getBonusType().then(res => {
api
.getBonusType()
.then(res => {
if (res) {
this.getBonusTypeList = res.rows
}
}).catch(error => {
})
.catch(error => {
reject(error)
})
},
@ -205,17 +208,21 @@
this.query.endDate = e.detail.value
},
getDataList(num) {
api.queryBonusFirst(this.query, `?pageNum=${num||1}&pageSize=${this.page.pageSize}`).then(res => {
api
.queryBonusFirst(
this.query,
`?pageNum=${num || 1}&pageSize=${this.page.pageSize}`
)
.then(res => {
if (res) {
this.dataList.push(...res.rows)
}
}).catch(error => {
})
.catch(error => {
reject(error)
})
},
submit() {
},
submit() {},
},
}
</script>
@ -233,14 +240,14 @@
color: #fff;
font-size: 28rpx;
text-align: center;
background: #005BAC;
background: #005bac;
margin: 30rpx 0 0 0;
float: right;
border-radius: 24rpx;
}
.type {
color: #005BAC !important;
color: #005bac !important;
}
.flex_s {
@ -263,7 +270,7 @@
.search-view {
/* display: flex; */
/* justify-content: space-between; */
padding: 30rpx 20rpx 0 20rpx;
padding: 16rpx 20rpx 0 20rpx;
border-bottom: 20rpx solid #eee;
/* border-bottom: 1px solid #eee; */
margin: 0;
@ -291,7 +298,7 @@
.search-icons {
width: 47rpx;
height: 47rpx;
background: #005BAC;
background: #005bac;
border-radius: 50%;
margin-left: 20rpx;
display: flex;
@ -377,10 +384,12 @@
left: 30rpx;
top: 12rpx;
image {}
image {
}
}
.search-bg {}
.search-bg {
}
.top {
/* height: 200rpx; */
@ -400,7 +409,7 @@
.search-bg {
width: 432rpx;
height: 35rpx;
background: #F5F6F8;
background: #f5f6f8;
border-radius: 33rpx;
display: flex;
position: relative;

View File

@ -13,7 +13,7 @@ module.exports = vm => {
//#ifdef DEV_SERVER
console.log('DEV_SERVER')
config.baseURL = 'http://localhost:8080'
config.baseURL = 'http://t-app.beida413.com/prod-api'
//#endif
//#ifdef QA_SERVER

View File

@ -1,25 +1,57 @@
<template>
<view class="main">
<scroll-view class="left_scrol_style" scroll-x="false" scroll-y="true">
<view class="top-lists" v-if="navList.length > 0">
<view v-for="(item, index) in navList" v-show="item.menuKey!=''" :key="index"
:class="navIndex == item.path ? 'styles' : ''" class="nav-view" @click="clickHref(item.path)">
{{ item.name }}
<view class="totals-summary-bar">
<view class="total-item">
<text class="total-label">本月合计</text>
<text class="total-amount primary-amount">{{
formatCurrency(monthIncomeTotal)
}}</text>
</view>
<view class="total-separator"></view>
<view class="total-item">
<text class="total-label">昨日合计</text>
<text class="total-amount secondary-amount">{{
formatCurrency(toSum)
}}</text>
</view>
</scroll-view>
<view class="sum-val">
<view v-if="monthIncomeTotal" >本月合计: <span>{{monthIncomeTotal | toThousandthAndKeepDecimal}}</span></view>
<view>昨日合计: <span>{{toSum | toThousandthAndKeepDecimal}}</span></view>
</view>
<template>
<sgsy v-if="navIndex==0" ref="sgsyData" :checkRule="marketList[0].isShow" :num="page.pageNum" />
<fgsy v-if="navIndex==1" ref="sgsyData" :checkRule="marketList[0].isShow" />
<hignfsy v-if="navIndex==2" ref="sgsyData" :checkRule="marketList[0].isShow" />
<hfsy v-if="navIndex==3" ref="sgsyData" :checkRule="marketList[0].isShow" />
<sbydsy v-if="navIndex==4" ref="sgsyData" :checkRule="marketList[0].isShow" />
<fgqsy v-if="navIndex==5" ref="sgsyData" :checkRule="marketList[0].isShow" />
<ckkj v-if="navIndex==6" ref="sgsyData" :checkRule="marketList[0].isShow" />
<sgsy
v-if="navIndex == 0"
ref="sgsyData"
:checkRule="marketList[0].isShow"
:num="page.pageNum"
/>
<fgsy
v-if="navIndex == 1"
ref="sgsyData"
:checkRule="marketList[0].isShow"
/>
<hignfsy
v-if="navIndex == 2"
ref="sgsyData"
:checkRule="marketList[0].isShow"
/>
<hfsy
v-if="navIndex == 3"
ref="sgsyData"
:checkRule="marketList[0].isShow"
/>
<sbydsy
v-if="navIndex == 4"
ref="sgsyData"
:checkRule="marketList[0].isShow"
/>
<fgqsy
v-if="navIndex == 5"
ref="sgsyData"
:checkRule="marketList[0].isShow"
/>
<ckkj
v-if="navIndex == 6"
ref="sgsyData"
:checkRule="marketList[0].isShow"
/>
</template>
</view>
</template>
@ -28,9 +60,7 @@
import * as api from '@/config/login.js'
import * as apis from '@/config/market.js'
import * as api1 from '@/config/bonus.js'
import {
setToken
} from '@/config/auth.js'
import { setToken } from '@/config/auth.js'
import store from '@/store'
import sgsy from '@/components/bonus/sgsy.vue'
import fgsy from '@/components/bonus/fgsy.vue'
@ -45,43 +75,46 @@
toSum: 0,
index: null,
userInfo: [],
marketList: [{
marketList: [
{
text: '奖金来源',
id: 3,
path: "/marketDynamics",
path: '/marketDynamics',
name: 'bonusSource',
isShow: false,
}, ],
navList: [{
},
],
navList: [
{
name: '首购收益',
path: 0,
value: "firstPurchase",
menuKey: ''
value: 'firstPurchase',
menuKey: '',
},
{
name: '复购收益',
path: 1,
value: "repurchaseEarnings",
menuKey: ''
value: 'repurchaseEarnings',
menuKey: '',
},
{
name: '海粉收益',
path: 2,
value: "hignFans",
menuKey: ''
value: 'hignFans',
menuKey: '',
},
{
name: '海粉收益',
path: 3,
value: "seaFans",
menuKey: ''
value: 'seaFans',
menuKey: '',
},
// { name: '',path:4,value:"sbyd",menuKey:''},
{
name: '复购券收益',
path: 5,
value: "repurchaseTicket",
menuKey: ''
value: 'repurchaseTicket',
menuKey: '',
},
// {
// name: '',
@ -105,15 +138,15 @@
hfsy,
sbydsy,
fgqsy,
ckkj
ckkj,
},
onLoad() {
this.getMenuLists()
// this.getMenuLists()
this.getSum()
},
methods: {
getSum() {
api1.queryBonusTotal({}).then((res) => {
api1.queryBonusTotal({}).then(res => {
console.log(res, '....res====aa')
this.toSum = res.rows[0].realIncomeTotal
this.monthIncomeTotal = res.rows[0].monthIncomeTotal
@ -123,25 +156,35 @@
this.index = e.detail.value
},
clickHref(index) {
let that = this;
let that = this
this.navIndex = index
this.page.pageNum = 1
},
getMenuLists() {
api.menuList().then((res) => {
console.log(res, '....resmenu')
res.data.forEach((item) => {
this.navList.forEach((items) => {
if (item.menuKey == items.value) {
items.menuKey = item.menuKey
formatCurrency(value) {
let num = parseFloat(value)
if (isNaN(num)) {
num = 0
}
})
if (this.marketList[0].name == item.menuKey) {
this.marketList[0].isShow = true
}
})
})
const fixedNum = num.toFixed(2)
const parts = fixedNum.split('.')
parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',')
return parts.join('.')
},
// getMenuLists() {
// api.menuList().then(res => {
// console.log(res, '....resmenu')
// res.data.forEach(item => {
// this.navList.forEach(items => {
// if (item.menuKey == items.value) {
// items.menuKey = item.menuKey
// }
// })
// if (this.marketList[0].name == item.menuKey) {
// this.marketList[0].isShow = true
// }
// })
// })
// },
// async onReachBottom() {
// this.page.pageNum+1
// this.$refs.sgsyData.getDataList(this.page.pageNum+=1);
@ -150,6 +193,49 @@
}
</script>
<style lang="scss">
.totals-summary-bar {
display: flex;
justify-content: space-around;
align-items: center;
background-color: #ffffff;
padding: 24rpx 20rpx;
border-radius: 16rpx;
box-shadow: 0 6rpx 18rpx rgba(0, 0, 0, 0.06);
margin-top: 16rpx;
margin-bottom: 20rpx;
.total-item {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
.total-label {
font-size: 26rpx;
color: #777777;
margin-bottom: 8rpx;
}
.total-amount {
font-size: 36rpx;
font-weight: 600;
}
.primary-amount {
color: #005bac; // Theme color
}
.secondary-amount {
color: #333333;
}
}
.total-separator {
width: 1rpx;
height: 60rpx; // Adjust as needed
background-color: #e0e0e0;
}
}
.sum-val {
background-color: #fff;
// height: 100rpx;
@ -206,7 +292,7 @@
.styles {
border: none !important;
color: #fff !important;
background: #005BAC;
background: #005bac;
}
.top-lists {