feat: 黄精粉前端功能集成 + 个人中心/资产/公排页面优化 + 去除admin copyright

主要改动:
- 个人中心: 去除HjfMemberBadge徽章, 会员等级改显示vip_name,
  "我的资产"/"公排查询"导航项改为与member-points一致风格
- 我的资产页面: 去除HjfMemberBadge, 美化卡片圆角和阴影
- 公排查询页面: 美化顶部渐变和订单卡片样式
- Admin登录页和后台布局: 彻底删除footer copyright信息
- 新增黄精粉业务页面/组件/API/Mock数据(Phase 1)
- 新增PHP环境配置文档和启动脚本

Made-with: Cursor
This commit is contained in:
apple
2026-03-13 00:49:22 +08:00
parent 21f9cc2c0a
commit f6227c0253
70 changed files with 23359 additions and 1176 deletions

View File

@@ -1,30 +1,68 @@
<template>
<view :style="colorStyle">
<view class='bill-details'>
<!-- 类型筛选导航 -->
<view class='nav acea-row'>
<view class='item' :class='type==0 ? "on":""' @click='changeType(0)'>全部</view>
<view class='item' :class='type==1 ? "on":""' @click='changeType(1)'>消费</view>
<view class='item' :class='type==2 ? "on":""' @click='changeType(2)'>储值</view>
<view
class='item'
:class='type == 0 ? "on" : ""'
@click='changeType(0)'
>全部</view>
<view
class='item'
:class='type == 1 ? "on" : ""'
@click='changeType(1)'
>消费</view>
<view
class='item'
:class='type == 2 ? "on" : ""'
@click='changeType(2)'
>储值</view>
<view
class='item'
:class='type == "queue_refund" ? "on" : ""'
@click='changeType("queue_refund")'
>公排退款</view>
</view>
<!-- 账单列表 -->
<view class='sign-record'>
<view class='list' v-for="(item,index) in userBillList" :key="index">
<view class='list' v-for="(item, index) in userBillList" :key="index">
<view class='item'>
<view class='data'>{{item.time}}</view>
<view class='data'>{{ item.time }}</view>
<view class='listn'>
<view class='itemn acea-row row-between-wrapper' v-for="(vo,indexn) in item.child" :key="indexn">
<view
class='itemn acea-row row-between-wrapper'
v-for="(vo, indexn) in item.child"
:key="indexn"
>
<view>
<view class='name line1'>{{vo.title}}</view>
<view>{{vo.add_time}}</view>
<view class='name line1'>
{{ vo.title }}
<!-- 公排退款标记 -->
<text
v-if="vo.type === 'queue_refund'"
class='queue-refund-tag'
>公排退款</text>
</view>
<view class='time-text'>{{ vo.add_time }}</view>
</view>
<view class='num' :class="vo.pm ? 'num-add' : 'num-sub'">
<text v-if="vo.pm">+{{ vo.number }}</text>
<text v-else>-{{ vo.number }}</text>
</view>
<view class='num' v-if="vo.pm">+{{vo.number}}</view>
<view class='num' v-else>-{{vo.number}}</view>
</view>
</view>
</view>
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="userBillList.length>0">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
<!-- 加载更多 -->
<view class='loadingicon acea-row row-center-wrapper' v-if="userBillList.length > 0">
<text class='loading iconfont icon-jiazai' :hidden='loading == false'></text>
{{ loadTitle }}
</view>
<!-- 空状态 -->
<view class="px-20 mt-20" v-if="userBillList.length == 0">
<emptyPage title="暂无记录~" src="/statics/images/noOrder.gif"></emptyPage>
</view>
@@ -35,18 +73,25 @@
</template>
<script>
import {
getCommissionInfo,
moneyList
} from '@/api/user.js';
import {
toLogin
} from '@/libs/login.js';
import {
mapGetters
} from "vuex";
import { moneyList } from '@/api/user.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from 'vuex';
import emptyPage from '@/components/emptyPage.vue';
import colors from "@/mixins/color";
import colors from '@/mixins/color';
/**
* 账单明细页
*
* 展示用户的账单流水,支持按类型筛选:
* - 0: 全部
* - 1: 消费
* - 2: 储值
* - "queue_refund": 公排退款type=queue_refund 时显示专属标记)
*
* 列表按日期分组,支持上拉分页加载。
*
* @module pages/users/user_bill/index
*/
export default {
components: {
emptyPage,
@@ -54,125 +99,116 @@
mixins: [colors],
data() {
return {
/** @type {string} 底部加载提示文字 */
loadTitle: '加载更多',
/** @type {boolean} 是否正在加载中(防止重复请求) */
loading: false,
/** @type {boolean} 是否已加载全部数据 */
loadend: false,
/** @type {number} 当前页码 */
page: 1,
/** @type {number} 每页条数 */
limit: 15,
/**
* 当前筛选类型
* 0=全部 1=消费 2=储值 "queue_refund"=公排退款
* @type {number|string}
*/
type: 0,
/** @type {Array<Object>} 按日期分组的账单列表 */
userBillList: [],
times:[],
isAuto: false, //没有授权的不会自动授权
isShowAuth: false //是否隐藏授权
/** @type {Array<string>} 已加载的日期键列表(用于去重分组) */
times: [],
};
},
computed: mapGetters(['isLogin']),
computed: {
...mapGetters(['isLogin']),
},
onShow() {
uni.removeStorageSync('form_type_cart');
if (this.isLogin) {
this.getUserBillList();
} else {
toLogin()
toLogin();
}
},
/**
* 生命周期函数--监听页面加载
* 生命周期函数监听页面加载
* @param {Object} options - 页面跳转参数
* @param {number|string} [options.type=0] - 初始筛选类型
*/
onLoad: function(options) {
onLoad(options) {
this.type = options.type || 0;
},
/**
* 页面上拉触底事件的处理函数
* 页面上拉触底 — 加载下一页
*/
onReachBottom: function() {
onReachBottom() {
this.getUserBillList();
},
onPageScroll(object) {
/**
* 页面滚动事件 — 广播 scroll 事件供子组件使用
*/
onPageScroll() {
uni.$emit('scroll');
},
methods: {
/**
* 授权回调
* 获取账单明细列表(分页追加)
*
* 请求 moneyList 接口,将返回数据按日期分组追加到 userBillList。
* 若 loading 或 loadend 为 true 则直接返回,防止重复/越界请求。
*
* @returns {void}
*/
onLoadFun: function() {
this.getUserBillList();
this.isShowAuth = false;
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
},
/**
* 获取账户明细
*/
getUserBillList: function() {
let that = this;
let page = that.page;
let limit = that.limit;
if (that.loading) return;
if (that.loadend) return;
that.loading = true;
that.loadTitle = '';
moneyList({
page: page,
limit: limit
},that.type).then(res => {
for (let i = 0; i < res.data.time.length; i++) {
if (!this.times.includes(res.data.time[i])) {
this.times.push(res.data.time[i])
this.userBillList.push({
time: res.data.time[i],
child: []
})
}
}
for (let x = 0; x < this.times.length; x++) {
for (let j = 0; j < res.data.list.length; j++) {
if (this.times[x] === res.data.list[j].time_key) {
this.userBillList[x].child.push(res.data.list[j])
getUserBillList() {
if (this.loading) return;
if (this.loadend) return;
this.loading = true;
this.loadTitle = '';
moneyList({ page: this.page, limit: this.limit }, this.type)
.then(res => {
const { time: timeKeys, list } = res.data;
// 按日期键建立分组(跨页去重)
timeKeys.forEach(key => {
if (!this.times.includes(key)) {
this.times.push(key);
this.userBillList.push({ time: key, child: [] });
}
}
}
let loadend = res.data.list.length < that.limit;
that.loadend = loadend;
that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
that.page += 1;
that.loading = false;
}).catch(err=>{
that.loading = false;
that.loadTitle = '加载更多';
})
});
// 将明细条目归入对应日期分组
this.times.forEach((key, idx) => {
list.forEach(item => {
if (item.time_key === key) {
this.userBillList[idx].child.push(item);
}
});
});
const loadend = list.length < this.limit;
this.loadend = loadend;
this.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
this.page += 1;
this.loading = false;
})
.catch(() => {
this.loading = false;
this.loadTitle = '加载更多';
});
},
// getUserBillList: function() {
// let that = this;
// if (that.loadend) return;
// if (that.loading) return;
// that.loading = true;
// that.loadTitle = "";
// let data = {
// page: that.page,
// limit: that.limit
// }
// getCommissionInfo(data, that.type).then(function(res) {
// let list = res.data,
// loadend = list.length < that.limit;
// that.userBillList = that.$util.SplitArray(list, that.userBillList);
// that.$set(that, 'userBillList', that.userBillList);
// that.loadend = loadend;
// that.loading = false;
// that.loadTitle = loadend ? "没有更多内容啦~" : "加载更多";
// that.page = that.page + 1;
// }, function(res) {
// that.loading = false;
// that.loadTitle = '加载更多';
// });
// },
/**
* 切换导航
* 切换账单筛选类型并重置列表
*
* @param {number|string} type - 目标类型0全部 1消费 2储值 "queue_refund"公排退款)
* @returns {void}
*/
changeType: function(type) {
changeType(type) {
if (this.type === type) return;
this.type = type;
this.loadend = false;
this.page = 1;
@@ -180,35 +216,71 @@
this.$set(this, 'userBillList', []);
this.getUserBillList();
},
}
}
},
};
</script>
<style scoped lang='scss'>
.sign-record .list .item .data{
.sign-record .list .item .data {
color: #999;
padding: 20rpx 30rpx 10rpx;
font-size: 26rpx;
}
.sign-record .list .item .listn{
.sign-record .list .item .listn {
width: 710rpx;
margin: 0 auto;
border-radius: 24rpx;
}
.sign-record .list .item .listn .itemn{
.sign-record .list .item .listn .itemn {
padding: 0;
margin: 0 30rpx;
height: 150rpx;
}
.sign-record .list .item .listn .itemn:nth-last-child(1){
.sign-record .list .item .listn .itemn:nth-last-child(1) {
border-bottom: 0;
}
.sign-record .list .item .listn .itemn .name{
.sign-record .list .item .listn .itemn .name {
color: #333;
font-size: 28rpx;
}
.sign-record .list .item .listn .itemn .num{
color: #333333;
.sign-record .list .item .listn .itemn .time-text {
color: #999;
font-size: 24rpx;
margin-top: 8rpx;
}
.sign-record .list .item .listn .itemn .num {
font-family: 'Regular';
font-size: 30rpx;
}
.num-add {
color: var(--view-theme);
}
.num-sub {
color: #333333;
}
/* 公排退款标记 */
.queue-refund-tag {
display: inline-block;
margin-left: 10rpx;
padding: 2rpx 12rpx;
border-radius: 20rpx;
font-size: 20rpx;
color: #fff;
background: var(--view-theme);
vertical-align: middle;
line-height: 1.6;
}
/* 顶部类型筛选导航 */
.bill-details .nav {
background-color: #fff;
height: 80rpx;
@@ -225,11 +297,11 @@
.bill-details .nav .item.on {
color: var(--view-theme);
/* border-bottom: 3rpx solid var(--view-theme); */
font-size: 30rpx;
position: relative;
}
.bill-details .nav .item.on::after{
.bill-details .nav .item.on::after {
position: absolute;
width: 64rpx;
height: 6rpx;
@@ -237,7 +309,7 @@
content: ' ';
background: var(--view-theme);
bottom: 0;
left:50%;
left: 50%;
margin-left: -32rpx;
}
</style>

View File

@@ -45,78 +45,89 @@
</view>
</view>
<view :hidden="currentTab != 0">
<form @submit="subCash">
<view class='list'>
<view class="itemCon">
<view class='item acea-row row-between-wrapper'>
<view class='name'>持卡人</view>
<view class='input'><input placeholder='请输入持卡人姓名' placeholder-class='placeholder'
name="name" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input></view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>卡号</view>
<view class='input'><input type='number' placeholder='请输入卡号' placeholder-class='placeholder'
name="cardnum"></input></view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>银行</view>
<view class='input'>
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="acea-row row-between-wrapper">
<text class='Bank'>{{array[index]}}</text>
<text class='iconfont icon-ic_rightarrow'></text>
</view>
</picker>
</view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input acea-row row-between-wrapper'>
<input @input='inputNum' :value='cashVal' :maxlength="moneyMaxLeng" :placeholder='"最低提现金额:¥"+minPrice' placeholder-class='placeholder'
name="money" type='digit'></input>
<view class="all" @click="allCash">全部提现</view>
</view>
<form @submit="subCash">
<view class='list'>
<view class="itemCon">
<view class='item acea-row row-between-wrapper'>
<view class='name'>持卡人</view>
<view class='input'><input placeholder='请输入持卡人姓名' placeholder-class='placeholder'
name="name" onKeypress="javascript:if(event.keyCode == 32)event.returnValue = false;"></input></view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>卡号</view>
<view class='input'><input type='number' placeholder='请输入卡号' placeholder-class='placeholder'
name="cardnum"></input></view>
</view>
<view class='item acea-row row-between-wrapper'>
<view class='name'>银行</view>
<view class='input'>
<picker @change="bindPickerChange" :value="index" :range="array">
<view class="acea-row row-between-wrapper">
<text class='Bank'>{{array[index]}}</text>
<text class='iconfont icon-ic_rightarrow'></text>
</view>
</picker>
</view>
</view>
<view class='tip'>
当前可提现金额: <text
class="price">{{userInfo.commissionCount}}</text>,冻结佣金{{userInfo.broken_commission}}
</view>
<view class='tip'>
提现手续费: <text class="price">{{withdraw_fee}}%</text>,实际到账:<text class="price">{{true_money}}</text>
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input acea-row row-between-wrapper'>
<input @input='inputNum' :value='cashVal' :maxlength="moneyMaxLeng" :placeholder='"最低提现金额:¥"+minPrice' placeholder-class='placeholder'
name="money" type='digit'></input>
<view class="all" @click="allCash">全部提现</view>
</view>
</view>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
<view class='tip'>
当前可提现金额: <text
class="price">{{userInfo.commissionCount}}</text>,冻结佣金{{userInfo.broken_commission}}
</view>
<view class='tip fee-breakdown'>
手续费<text class="fee-rate">{{withdraw_fee}}%</text><text class="price">¥{{feeAmount}}</text>
<text class="fee-sep"> | </text>实际到账<text class="price">¥{{actualAmount}}</text>
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
<view class='tip tip-warning'>
温馨提示: <text class="num">公排退款提现需收取 <text class="fee">{{withdraw_fee}}%</text> 手续费实际到账金额以扣除手续费后为准</text>
</view>
</view>
<view :hidden="currentTab != 1">
<form @submit="subCash">
<view class='list'>
<view class="itemCon">
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input acea-row row-between-wrapper'>
<input @input='inputNum' :value='cashVal' :maxlength="moneyMaxLeng" :placeholder='"最低提现金额:¥"+minPrice' placeholder-class='placeholder'
name="money" type='digit'></input>
<view class="all" @click="allCash">全部提现</view>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
</view>
<view :hidden="currentTab != 1">
<form @submit="subCash">
<view class='list'>
<view class="itemCon">
<view class='item acea-row row-between-wrapper'>
<view class='name'>提现</view>
<view class='input acea-row row-between-wrapper'>
<input @input='inputNum' :value='cashVal' :maxlength="moneyMaxLeng" :placeholder='"最低提现金额:¥"+minPrice' placeholder-class='placeholder'
name="money" type='digit'></input>
<view class="all" @click="allCash">全部提现</view>
</view>
</view>
<view class='tip'>
当前可提现金额: <text
class="price">{{userInfo.commissionCount}}</text>,冻结佣金{{userInfo.broken_commission}}
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
<view class='tip'>
当前可提现金额: <text
class="price">{{userInfo.commissionCount}}</text>,冻结佣金{{userInfo.broken_commission}}
</view>
<view class='tip fee-breakdown'>
手续费<text class="fee-rate">{{withdraw_fee}}%</text><text class="price">¥{{feeAmount}}</text>
<text class="fee-sep"> | </text>实际到账<text class="price">¥{{actualAmount}}</text>
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
<view class='tip tip-warning'>
温馨提示: <text class="num">公排退款提现需收取 <text class="fee">{{withdraw_fee}}%</text> 手续费实际到账金额以扣除手续费后为准</text>
</view>
</view>
<view :hidden="currentTab != 2">
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
</view>
<view :hidden="currentTab != 2">
<form @submit="subCash">
<view class='list'>
<view class="itemCon">
@@ -152,17 +163,21 @@
当前可提现金额: <text
class="price">{{userInfo.commissionCount}}</text>,冻结佣金{{userInfo.broken_commission}}
</view>
<view class='tip'>
提现手续费: <text class="price">{{withdraw_fee}}%</text>,实际到账:<text class="price">{{true_money}}</text>
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
<view class='tip fee-breakdown'>
手续费<text class="fee-rate">{{withdraw_fee}}%</text><text class="price">¥{{feeAmount}}</text>
<text class="fee-sep"> | </text>实际到账<text class="price">¥{{actualAmount}}</text>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
</view>
<view :hidden='currentTab != 3'>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
<view class='tip tip-warning'>
温馨提示: <text class="num">公排退款提现需收取 <text class="fee">{{withdraw_fee}}%</text> 手续费实际到账金额以扣除手续费后为准</text>
</view>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
</view>
<view :hidden='currentTab != 3'>
<form @submit="subCash">
<view class='list'>
<view class="itemCon">
@@ -204,18 +219,22 @@
当前可提现金额: <text
class="price">{{userInfo.commissionCount}}</text>,冻结佣金{{userInfo.broken_commission}}
</view>
<view class='tip'>
提现手续费: <text class="price">{{withdraw_fee}}%</text>,实际到账:<text class="price">{{true_money}}</text>
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
<view class='tip fee-breakdown'>
手续费<text class="fee-rate">{{withdraw_fee}}%</text><text class="price">¥{{feeAmount}}</text>
<text class="fee-sep"> | </text>实际到账<text class="price">¥{{actualAmount}}</text>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
</view>
<view class='tip'>
说明: <text class="num">每笔佣金的冻结期为{{userInfo.broken_day}}到期后可提现</text>
</view>
<view class='tip tip-warning'>
温馨提示: <text class="num">公排退款提现需收取 <text class="fee">{{withdraw_fee}}%</text> 手续费实际到账金额以扣除手续费后为准</text>
</view>
</view>
<button formType="submit" class='bnt bg-color'>立即提现</button>
</form>
</view>
</view>
</view>
<home></home>
</view>
</template>
@@ -226,6 +245,7 @@
extractBank,
getUserInfo
} from '@/api/user.js';
import { getWithdrawInfo } from '@/api/hjfAssets.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
import colors from '@/mixins/color.js';
@@ -257,7 +277,12 @@
extract_wechat_type:0,
cashVal: '',
copyIndex:null,
platform: ''
platform: '',
/**
* 提现配置信息(来自 hjfAssets.getWithdrawInfo
* @type {{ now_money: string, min_extract: number, fee_rate: number, extract_bank: string[] }}
*/
withdrawInfo: {}
};
},
computed: {
@@ -269,6 +294,24 @@
// }else{
// return false
// }
},
/**
* 当前输入金额对应的手续费金额7%,保留两位小数)
* @returns {string}
*/
feeAmount() {
const val = parseFloat(this.cashVal) || 0;
const rate = parseFloat(this.withdraw_fee) || 7;
return (Math.floor(val * rate) / 100).toFixed(2);
},
/**
* 扣除手续费后实际到账金额(保留两位小数)
* @returns {string}
*/
actualAmount() {
const val = parseFloat(this.cashVal) || 0;
const fee = parseFloat(this.feeAmount) || 0;
return Math.max(0, val - fee).toFixed(2);
}
},
watch: {
@@ -298,6 +341,7 @@
})
this.getUserInfo();
this.getUserExtractBank();
this.loadWithdrawInfo();
} else {
toLogin()
}
@@ -365,8 +409,22 @@
onLoadFun: function() {
this.getUserInfo();
this.getUserExtractBank();
this.loadWithdrawInfo();
this.isShowAuth = false;
},
/**
* 加载提现配置信息(手续费率、最低提现额、可提现余额)
* 结果存入 withdrawInfo并将 withdraw_fee 同步为接口返回的 fee_rate默认 7%
* @returns {void}
*/
loadWithdrawInfo: function() {
getWithdrawInfo().then(res => {
this.withdrawInfo = res.data || {};
if (this.withdrawInfo.fee_rate !== undefined) {
this.withdraw_fee = String(this.withdrawInfo.fee_rate);
}
});
},
// 授权关闭
authColse: function(e) {
this.isShowAuth = e
@@ -856,6 +914,47 @@
}
}
.cash-withdrawal .wrapper .list .tip-warning {
color: #E6A23C;
background-color: #FDF6EC;
border-radius: 8rpx;
padding: 12rpx 16rpx;
margin-top: 12rpx;
line-height: 1.6;
.num{
margin-left: 8rpx;
}
.fee{
color: #E64340;
font-weight: 600;
}
}
.cash-withdrawal .wrapper .list .fee-breakdown {
background-color: #F0F9EB;
border-radius: 8rpx;
padding: 10rpx 16rpx;
margin-top: 12rpx;
color: #606266;
.fee-rate {
color: #E64340;
font-weight: 600;
}
.fee-sep {
color: #CCCCCC;
margin: 0 4rpx;
}
.price {
color: var(--view-theme);
margin: 0 4rpx;
}
}
.cash-withdrawal .wrapper .list .tip2 {
font-size: 26rpx;
color: #999;

View File

@@ -32,24 +32,28 @@
class='recharge'>储值</view>
<!-- #endif -->
</view>
<view class='cumulative acea-row row-middle'>
<!-- #ifdef APP-PLUS || H5 -->
<view class='item'>
<view>累计储值()</view>
<view class='money'>{{userInfo.recharge || 0}}</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class='item' v-if="recharge_switch">
<view>累计储值()</view>
<view class='money'>{{userInfo.recharge || 0}}</view>
</view>
<!-- #endif -->
<view class='item'>
<view>累计消费()</view>
<view class='money'>{{userInfo.orderStatusSum || 0}}</view>
</view>
<view class='cumulative acea-row row-middle'>
<!-- #ifdef APP-PLUS || H5 -->
<view class='item'>
<view>累计储值()</view>
<view class='money'>{{userInfo.recharge || 0}}</view>
</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class='item' v-if="recharge_switch">
<view>累计储值()</view>
<view class='money'>{{userInfo.recharge || 0}}</view>
</view>
<!-- #endif -->
<view class='item'>
<view>累计消费()</view>
<view class='money'>{{userInfo.orderStatusSum || 0}}</view>
</view>
<view class='item'>
<view>公排退款()</view>
<view class='money'>{{queueRefundedTotal}}</view>
</view>
</view>
<view class="pictrue">
<image :src="imgHost+'/statics/images/users/pig.png'"></image>
</view>
@@ -129,6 +133,7 @@
import {
mapGetters
} from "vuex";
import { getQueueStatus } from '@/api/hjfQueue.js';
import recommend from '@/components/recommend/index';
import colors from "@/mixins/color";
import {
@@ -148,6 +153,12 @@
userInfo: {
now_money: 0,
},
/**
* 公排累计退款金额(元)
* 由 getQueueStatus() 返回的 myOrders 中 status===1 的订单金额累加而来
* @type {number}
*/
queueRefundedTotal: 0,
hostProduct: [],
isClose: false,
recharge_switch: 0,
@@ -167,6 +178,7 @@
if (newV) {
this.getUserInfo();
this.get_activity();
this.getQueueRefundedTotal();
}
},
deep: true
@@ -179,6 +191,7 @@
if (this.isLogin) {
this.getUserInfo();
this.get_activity();
this.getQueueRefundedTotal();
} else {
toLogin()
}
@@ -222,6 +235,23 @@
that.$set(that, "activity", res.data);
})
},
/**
* 获取公排累计退款金额
* 调用 getQueueStatus(),将 myOrders 中 status===1已退款的订单金额累加
* 结果保存到 queueRefundedTotal保留两位小数单位
* @see docs/frontend-new-pages-spec.md 6.1.4
* @returns {void}
*/
getQueueRefundedTotal: function() {
let that = this;
getQueueStatus().then(res => {
const orders = (res.data && res.data.myOrders) || [];
const total = orders
.filter(order => order.status === 1)
.reduce((sum, order) => sum + Number(order.amount || 0), 0);
that.queueRefundedTotal = total.toFixed(2);
});
},
/**
* 获取我的推荐
*/

View File

@@ -1,62 +1,91 @@
<template>
<view :style="colorStyle">
<view class='commission-details'>
<!-- 团队收益统计卡片5.1.7 -->
<view class="team-stats-card">
<view class="team-stats-title">团队业绩统计</view>
<view class="team-stats-row">
<view class="team-stats-item">
<view class="team-stats-num">{{ teamData.direct_count }}</view>
<view class="team-stats-label">直推人数</view>
</view>
<view class="team-stats-divider"></view>
<view class="team-stats-item">
<view class="team-stats-num">{{ teamData.umbrella_count }}</view>
<view class="team-stats-label">伞下人数</view>
</view>
<view class="team-stats-divider"></view>
<view class="team-stats-item">
<view class="team-stats-num text-primary">{{ teamData.umbrella_orders }}</view>
<view class="team-stats-label">团队订单数</view>
</view>
</view>
</view>
<view class='search acea-row row-between-wrapper' v-if="recordType != 1 && recordType != 4">
<view class='input'>
<text class="iconfont icon-ic_search"></text>
<input placeholder='搜索用户名称' placeholder-class='placeholder' v-model="keyword" @confirm="submitForm"
confirm-type='search' name="search"></input>
<input
placeholder='搜索用户名称'
placeholder-class='placeholder'
v-model="keyword"
@confirm="submitForm"
confirm-type='search'
name="search"
></input>
</view>
</view>
<timeSlot @changeTime="changeTime"></timeSlot>
<view class='sign-record'>
<view class="top_num" v-if="recordType != 4 && recordList.length">
支出¥{{expend || 0}} &nbsp;&nbsp;&nbsp; 收入¥{{income || 0}}
</view>
<view class="box">
<block v-for="(item,index) in recordList" :key="index" v-if="recordList.length>0">
<block v-for="(item, index) in recordList" :key="index" v-if="recordList.length > 0">
<view class='list'>
<view class='item'>
<!-- <view class='data'>{{item.time}}</view> -->
<view class='listn'>
<!-- <block v-for="(child,indexn) in item.child" :key="indexn"> -->
<view class='itemn1 flex justify-between'>
<view>
<view class='name line1'>
{{item.title}}
<!-- <text class="status_badge success" v-if="recordType == 4 && item.status == 1">审核通过</text> -->
<text class="status_badge default" v-if="recordType == 4 && item.status == 0">待审核</text>
<text class="status_badge error" v-if="recordType == 4 && item.status == 2">审核未通过</text>
<!-- 提现记录 0 待审核 1 通过 2 未通过 -->
</view>
</view>
<!-- 积分来源标签直推 / 伞下 -->
<view class="income-type-tag" v-if="item.type">
<text class="tag-direct" v-if="item.type === 'direct'">直推奖励</text>
<text class="tag-umbrella" v-else-if="item.type === 'umbrella'">伞下奖励</text>
</view>
<view class="mark" v-if="item.extract_status == -1">原因{{item.extract_msg}}</view>
<view>{{item.add_time}}</view>
<view v-if="item.is_frozen && item.is_frozen == 1">佣金冻结中解冻时间{{item.frozen_time}}</view>
</view>
<view>
<view class='num' :class="recordType == 4 && item.status == 0?'on':''"
v-if="item.pm == 1">+{{item.number}}</view>
<view class='num' v-else>-{{item.number}}</view>
<!-- 积分数量展示不带 ¥ 6.1.5 §2 -->
<view class='num' :class="recordType == 4 && item.status == 0 ? 'on' : ''"
v-if="item.pm == 1">+{{item.points !== undefined ? item.points : item.number}}</view>
<view class='num' v-else>-{{item.points !== undefined ? item.points : item.number}}</view>
<view class="fail" v-if="item.extract_status == -1 && item.type == 'extract'">审核未通过</view>
<view class="wait" v-if="item.extract_status == 0 && item.type == 'extract'">待审核</view>
<view class="wait" v-if="item.is_frozen == 1">冻结中</view>
<view class="w-154 h-56 rd-30rpx flex-center mt-16 bg-color fs-24 text--w111-fff"
v-if="item.extract_status == 0 && item.type == 'extract'"
@tap="extractCancel(item.link_id)"
>取消提现</view>
v-if="item.extract_status == 0 && item.type == 'extract'"
@tap="extractCancel(item.link_id)">取消提现</view>
<!-- #ifdef MP-WEIXIN -->
<view class="w-154 h-56 rd-30rpx flex-center mt-16 ml-12 bg-color fs-24 text--w111-fff"
v-if="item.wechat_state == 1 && item.type == 'extract'"
v-if="item.wechat_state == 1 && item.type == 'extract'"
@tap="jumpPath('/pages/users/user_spread_money/receiving?type=1&id=' + item.extract_order_id)">立即收款</view>
<!-- #endif -->
<!-- #ifdef H5 -->
<view class="w-154 h-56 rd-30rpx flex-center mt-16 ml-12 bg-color fs-24 text--w111-fff"
v-if="item.wechat_state == 1 && item.type == 'extract' && isWeixin"
v-if="item.wechat_state == 1 && item.type == 'extract' && isWeixin"
@tap="jumpPath('/pages/users/user_spread_money/receiving?type=1&id=' + item.extract_order_id)">立即收款</view>
<!-- #endif -->
</view>
</view>
<!-- </block> -->
</view>
</view>
</view>
@@ -64,7 +93,7 @@
</view>
<view class='loadingicon acea-row row-center-wrapper' v-if="recordList.length">
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
<text class='loading iconfont icon-jiazai' :hidden='loading == false'></text>{{loadTitle}}
</view>
<view class="empty" v-if="!recordList.length">
<emptyPage title='暂无数据~' src="/statics/images/noOrder.gif"></emptyPage>
@@ -76,21 +105,21 @@
</template>
<script>
import { moneyList, getSpreadInfo, extractCancelApi } from '@/api/user.js';
import { moneyList, getSpreadInfo, spreadCount, extractCancelApi } from '@/api/user.js';
import { getTeamData, getTeamIncome } from '@/api/hjfMember.js';
import { toLogin } from '@/libs/login.js';
import { mapGetters } from "vuex";
import emptyPage from '@/components/emptyPage.vue'
import { mapGetters } from 'vuex';
import emptyPage from '@/components/emptyPage.vue';
import colors from '@/mixins/color.js';
import timeSlot from '../components/timeSlot/index.vue';
// #ifdef H5
import Auth from '@/libs/wechat';
// #endif
export default {
components: {
emptyPage,
timeSlot
},
components: { emptyPage, timeSlot },
mixins: [colors],
data() {
return {
name: '',
@@ -111,12 +140,33 @@
income: '',
expend: '',
disabled: false,
/**
* 团队概况数据
* @type {{ direct_count: number, umbrella_count: number, umbrella_orders: number }}
*/
teamData: {
direct_count: 0,
umbrella_count: 0,
umbrella_orders: 0,
},
/**
* 团队收益明细列表(来自 getTeamIncome
* @type {Array<{ id: number, title: string, type: string, points: number, from_nickname: string, add_time: string }>}
*/
teamIncome: [],
// #ifdef H5
isWeixin: Auth.isWeixin(),
//#endif
// #endif
};
},
computed: mapGetters(['isLogin']),
computed: {
...mapGetters(['isLogin']),
},
onLoad(options) {
if (this.isLogin) {
this.type = options.type;
@@ -124,7 +174,8 @@
toLogin();
}
},
onShow: function() {
onShow() {
uni.removeStorageSync('form_type_cart');
this.page = 1;
this.limit = 20;
@@ -133,25 +184,22 @@
this.status = false;
this.$set(this, 'recordList', []);
this.$set(this, 'times', []);
let type = this.type;
this.loadTeamData();
const type = this.type;
if (type == 1) {
uni.setNavigationBarTitle({
title: "佣金记录"
});
uni.setNavigationBarTitle({ title: '推荐收益' });
this.name = '提现总额';
this.recordType = 3;
this.getRecordList();
} else if (type == 2) {
uni.setNavigationBarTitle({
title: "佣金记录"
});
this.name = '佣金明细';
uni.setNavigationBarTitle({ title: '推荐收益' });
this.name = '推荐收益明细';
this.recordType = 3;
this.getRecordList();
} else if (type == 4) {
uni.setNavigationBarTitle({
title: "提现记录"
});
uni.setNavigationBarTitle({ title: '提现记录' });
this.name = '提现明细';
this.recordType = 4;
this.getRecordList();
@@ -161,23 +209,44 @@
icon: 'none',
duration: 1000,
mask: true,
success: function(res) {
setTimeout(function() {
success() {
setTimeout(() => {
// #ifndef H5
uni.navigateBack({
delta: 1,
});
uni.navigateBack({ delta: 1 });
// #endif
// #ifdef H5
history.back();
// #endif
}, 1200)
}, 1200);
},
});
}
},
methods: {
/**
* 加载团队概况和收益明细,统一在 onShow 调用
* @returns {void}
*/
loadTeamData() {
getTeamData().then(res => {
const d = (res && res.data) || {};
this.teamData = {
direct_count: d.direct_count || 0,
umbrella_count: d.umbrella_count || 0,
umbrella_orders: d.umbrella_orders || 0,
};
}).catch(() => {});
getTeamIncome({ page: 1, limit: this.limit }).then(res => {
this.teamIncome = (res && res.data && res.data.list) || [];
}).catch(() => {});
},
/**
* 搜索框确认时重置并重新加载列表
* @returns {void}
*/
submitForm() {
this.page = 1;
this.limit = 20;
@@ -188,98 +257,166 @@
this.$set(this, 'times', []);
this.getRecordList();
},
/**
* 时间筛选回调
* @param {{ start: number, stop: number }} time - 筛选时间段
* @returns {void}
*/
changeTime(time) {
this.start = time.start
this.stop = time.stop
this.start = time.start;
this.stop = time.stop;
this.page = 1;
this.loadend = false;
this.$set(this, 'recordList', []);
this.getRecordList();
},
getRecordList: function() {
let that = this;
let page = that.page;
let limit = that.limit;
let recordType = that.recordType;
if (that.loading) return;
if (that.loadend) return;
/**
* 加载收益流水列表(分页追加)
* @returns {void}
*/
getRecordList() {
const that = this;
const { page, limit, recordType } = that;
if (that.loading || that.loadend) return;
that.loading = true;
that.loadTitle = '';
moneyList({
keyword: this.keyword,
start: this.start,
stop: this.stop,
page: page,
limit: limit
page,
limit,
}, recordType).then(res => {
this.expend = res.data.expend;
this.income = res.data.income;
// for (let i = 0; i < res.data.time.length; i++) {
// // if (!this.times.includes(res.data.time[i])) {
// this.times.push(res.data.time[i])
// this.recordList.push({
// time: res.data.time[i],
// child: []
// })
// // }
// }
// // for (let x = 0; x < this.times.length; x++) {
// for (let j = 0; j < res.data.list.length; j++) {
// // if (this.times[x] === res.data.list[j].time_key) {
// // }
// this.recordList[j].child.push(res.data.list[j])
// }
// // }
this.recordList = this.recordList.concat(res.data.list)
let loadend = res.data.list.length < that.limit;
this.recordList = this.recordList.concat(res.data.list);
const loadend = res.data.list.length < that.limit;
that.loadend = loadend;
that.loadTitle = loadend ? '没有更多内容啦~' : '加载更多';
that.page += 1;
that.loading = false;
}).catch(err => {
}).catch(() => {
that.loading = false;
that.loadTitle = '加载更多';
})
},
getRecordListCount: function() {
let that = this;
getSpreadInfo().then(res => {
that.recordCount = res.data.commissionCount;
that.extractCount = res.data.extractCount;
});
},
jumpPath(url){
uni.navigateTo({
url
})
/**
* 页面内跳转
* @param {string} url - 目标路由
* @returns {void}
*/
jumpPath(url) {
uni.navigateTo({ url });
},
extractCancel(id){
if(this.disabled) return
/**
* 取消提现申请
* @param {number|string} id - 提现订单 ID
* @returns {void}
*/
extractCancel(id) {
if (this.disabled) return;
this.disabled = true;
extractCancelApi(id).then(res=>{
extractCancelApi(id).then(res => {
this.disabled = false;
this.changeTime({start:0,stop: 0});
return this.$util.Tips({
title: res.msg
});
}).catch(err=>{
return this.$util.Tips({
title: err
});
})
}
this.changeTime({ start: 0, stop: 0 });
return this.$util.Tips({ title: res.msg });
}).catch(err => {
this.disabled = false;
return this.$util.Tips({ title: err });
});
},
},
onReachBottom: function() {
onReachBottom() {
this.getRecordList();
}
}
},
};
</script>
<style scoped lang="scss">
.empty{
.empty {
margin: 0 20rpx 20rpx 20rpx;
}
/* ===== 团队统计卡片 ===== */
.team-stats-card {
background: linear-gradient(135deg, #4e9f3d 0%, #1e5128 100%);
border-radius: 20rpx;
margin: 20rpx 20rpx 0;
padding: 30rpx 20rpx 24rpx;
color: #fff;
}
.team-stats-title {
font-size: 28rpx;
font-weight: 600;
margin-bottom: 24rpx;
opacity: 0.92;
}
.team-stats-row {
display: flex;
align-items: center;
justify-content: space-around;
}
.team-stats-item {
flex: 1;
text-align: center;
}
.team-stats-num {
font-size: 40rpx;
font-weight: bold;
line-height: 1.2;
}
.team-stats-num.text-primary {
color: #ffe082;
}
.team-stats-label {
font-size: 24rpx;
opacity: 0.8;
margin-top: 8rpx;
}
.team-stats-divider {
width: 1rpx;
height: 56rpx;
background: rgba(255, 255, 255, 0.3);
}
/* ===== 积分来源标签 ===== */
.income-type-tag {
margin-bottom: 8rpx;
}
.tag-direct,
.tag-umbrella {
display: inline-block;
height: 36rpx;
border-radius: 6rpx;
font-size: 22rpx;
line-height: 36rpx;
padding: 0 10rpx;
}
.tag-direct {
background: rgba(78, 159, 61, 0.12);
color: #4e9f3d;
}
.tag-umbrella {
background: rgba(24, 144, 255, 0.1);
color: #1890ff;
}
/* ===== 搜索框 ===== */
.commission-details .search {
width: 100%;
background-color: #fff;
@@ -301,12 +438,6 @@
padding-left: 70rpx;
}
.box {
border-radius: 24rpx;
margin: 0 20rpx;
overflow: hidden;
}
.commission-details .search .input .placeholder {
color: #bbb;
}
@@ -320,12 +451,15 @@
transform: translateY(-50%);
}
/* ===== 列表区 ===== */
.sign-record {
margin-top: 20rpx;
}
.commission-details .promoterHeader .headerCon .money {
font-size: 36rpx;
.box {
border-radius: 24rpx;
margin: 0 20rpx;
overflow: hidden;
}
.top_num {
@@ -337,24 +471,47 @@
.radius15 {
border-radius: 14rpx 14rpx 0 0;
}
.sign-record .list .item .listn .itemn1{border-bottom:1rpx solid #eee;padding:22rpx 24rpx;}
.sign-record .list .item .listn .itemn1 .name{width:390rpx;font-size:28rpx;color:#333;margin-bottom:12rpx;}
.sign-record .list .item .listn .itemn1 .num{font-size:36rpx;color:#333333;font-family:'Regular';text-align: right;}
.sign-record .list .item .listn .itemn1 .num.font-color{color:#e93323!important;}
.sign-record .list .item .listn .itemn1 .fail{
.sign-record .list .item .listn .itemn1 {
border-bottom: 1rpx solid #eee;
padding: 22rpx 24rpx;
}
.sign-record .list .item .listn .itemn1 .name {
width: 390rpx;
font-size: 28rpx;
color: #333;
margin-bottom: 12rpx;
}
.sign-record .list .item .listn .itemn1 .num {
font-size: 36rpx;
color: #333333;
font-family: 'Regular';
text-align: right;
}
.sign-record .list .item .listn .itemn1 .num.font-color {
color: #e93323 !important;
}
.sign-record .list .item .listn .itemn1 .fail {
color: #E93323;
margin-top: 14rpx;
text-align: right;
}
.sign-record .list .item .listn .itemn1 .wait{
.sign-record .list .item .listn .itemn1 .wait {
color: #FFB200;
margin-top: 14rpx;
text-align: right;
}
.mark{
.mark {
margin-bottom: 10rpx;
}
.status_badge{
.status_badge {
display: inline-block;
height: 40rpx;
border-radius: 8rpx;
@@ -362,18 +519,21 @@
line-height: 40rpx;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
margin-left:16rpx;
padding:0 12rpx 0;
margin-left: 16rpx;
padding: 0 12rpx 0;
}
.success{
.success {
background: rgba(24, 144, 255, .1);
color: #1890FF;
}
.default{
.default {
background: #FFF1E5;
color: #FF7D00;
}
.error{
.error {
background: #FDEBEB;
color: #F53F3F;
}