+
+
+
+
+
-
- {{ service.title }}
+
+ {{ personalDataService.title }}
-
- 立即推广
+
+ {{ formatSubtitle(personalDataService.subtitle) }}
+
+
+ GO
+
+
+
+
+
+
+
+
+
+
+
+ {{ marriageService.title }}
+
+
+ {{ formatSubtitle(marriageService.subtitle) }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ companyService.title }}
+
+
+ {{ formatSubtitle(companyService.subtitle) }}
+
+
+
+
+
+
+
+
+
+
+ {{ consumerFinanceService.title }}
+
+
+ {{ formatSubtitle(consumerFinanceService.subtitle) }}
+
+
+ GO
-
- {{ getCostPriceText(service) }}
+
+
+
+
+
+
+
+
+ {{ housekeepingService.title }}
+
+
+ {{ formatSubtitle(housekeepingService.subtitle) }}
+
+
+
+
+
+
+
+
+
+
+ {{ backgroundCheckService.title }}
+
+
+ {{ formatSubtitle(backgroundCheckService.subtitle) }}
+
+
+
+
+
+
diff --git a/src/views/PromotionInquire.vue b/src/views/PromotionInquire.vue
index 733968e..bc60c63 100644
--- a/src/views/PromotionInquire.vue
+++ b/src/views/PromotionInquire.vue
@@ -26,17 +26,21 @@ function isFinishPayment() {
const query = new URLSearchParams(window.location.search);
let orderNo = query.get("out_trade_no");
if (orderNo) {
- router.push({ path: "/report", query: { orderNo } });
+ console.log("🎯 Detected payment result, navigating to report with orderNo:", orderNo);
+ // 延迟跳转,确保页面已完全加载
+ setTimeout(() => {
+ router.push({ path: "/report", query: { orderNo } });
+ }, 100);
}
}
+import { getLinkData } from "@/api/agent";
+
async function getProduct() {
linkIdentifier.value = route.params.linkIdentifier;
- const { data: agentLinkData, error: agentLinkError } = await useApiFetch(
- `/agent/link?link_identifier=${linkIdentifier.value}`
- )
- .get()
- .json();
+ const { data: agentLinkData, error: agentLinkError } = await getLinkData(
+ linkIdentifier.value
+ );
if (agentLinkData.value && !agentLinkError.value) {
if (agentLinkData.value.code === 200) {
feature.value = agentLinkData.value.data.product_en;
diff --git a/src/views/Register.vue b/src/views/Register.vue
new file mode 100644
index 0000000..9fb0894
--- /dev/null
+++ b/src/views/Register.vue
@@ -0,0 +1,426 @@
+
+
+
+
+
+
+
+
+
+
一查查
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/Service.vue b/src/views/Service.vue
index e69d13a..f8cccf8 100644
--- a/src/views/Service.vue
+++ b/src/views/Service.vue
@@ -10,7 +10,7 @@
onMounted(() => {
(function (d, t) {
- const BASE_URL = "https://service.quannengcha.com";
+ const BASE_URL = "https://service.onecha.cn";
const g = d.createElement(t),
s = d.getElementsByTagName(t)[0];
g.src = BASE_URL + "/packs/js/sdk.js";
diff --git a/src/views/SubordinateDetail.vue b/src/views/SubordinateDetail.vue
index 3272c97..25e0c31 100644
--- a/src/views/SubordinateDetail.vue
+++ b/src/views/SubordinateDetail.vue
@@ -9,14 +9,27 @@ const refreshing = ref(false)
const finished = ref(false)
const page = ref(1)
const pageSize = 8
+const activeTab = ref('order') // 'order' 或 'invite'
-// 获取收益列表
-const fetchRewardDetails = async () => {
- if (loading.value || finished.value) return
+// 数据
+const userInfo = ref({})
+const orderStats = ref({})
+const rebateStats = ref({})
+const inviteStats = ref({})
+const orderList = ref([])
+const inviteList = ref([])
+const orderListTotal = ref(0)
+const inviteListTotal = ref(0)
+
+// 获取详情数据
+const fetchDetail = async () => {
+ if (loading.value) return
+ if (finished.value && page.value > 1) return
loading.value = true
+ const tabType = activeTab.value
const { data, error } = await useApiFetch(
- `/agent/subordinate/contribution/detail?subordinate_id=${route.params.id}&page=${page.value}&page_size=${pageSize}`
+ `/agent/subordinate/contribution/detail?subordinate_id=${route.params.id}&page=${page.value}&page_size=${pageSize}&tab_type=${tabType}`
)
.get()
.json()
@@ -30,201 +43,107 @@ const fetchRewardDetails = async () => {
level: data.value.data.level_name || '普通',
mobile: data.value.data.mobile,
}
- // 更新汇总数据
- summary.value = {
- totalReward: data.value.data.total_earnings,
- totalContribution: data.value.data.total_contribution,
- totalOrders: data.value.data.total_orders,
- }
- // 设置默认的统计类型
- statistics.value = [
- {
- type: 'descendant_promotion',
- amount: 0,
- count: 0,
- description: '推广奖励',
- },
- {
- type: 'cost',
- amount: 0,
- count: 0,
- description: '成本贡献',
- },
- {
- type: 'pricing',
- amount: 0,
- count: 0,
- description: '定价贡献',
- },
- {
- type: 'descendant_withdraw',
- amount: 0,
- count: 0,
- description: '提现收益',
- },
- {
- type: 'descendant_upgrade_vip',
- amount: 0,
- count: 0,
- description: '转化VIP奖励',
- },
- {
- type: 'descendant_upgrade_svip',
- amount: 0,
- count: 0,
- description: '转化SVIP奖励',
- },
- {
- type: 'descendant_new_active',
- amount: 0,
- count: 0,
- description: '新增活跃奖励',
- },
- {
- type: 'descendant_stay_active',
- amount: 0,
- count: 0,
- description: '月度活跃奖励',
- },
- ]
- // 如果有统计数据,更新对应的值
- if (data.value.data.stats) {
- const stats = data.value.data.stats
- // 更新推广奖励
- const platformStat = statistics.value.find(s => s.type === 'descendant_promotion')
- if (platformStat) {
- platformStat.amount = stats.descendant_promotion_amount || 0
- platformStat.count = stats.descendant_promotion_count || 0
- }
- // 更新成本贡献
- const costStat = statistics.value.find(s => s.type === 'cost')
- if (costStat) {
- costStat.amount = stats.cost_amount || 0
- costStat.count = stats.cost_count || 0
- }
- // 更新定价贡献
- const pricingStat = statistics.value.find(s => s.type === 'pricing')
- if (pricingStat) {
- pricingStat.amount = stats.pricing_amount || 0
- pricingStat.count = stats.pricing_count || 0
- }
- // 更新提现收益
- const withdrawStat = statistics.value.find(s => s.type === 'descendant_withdraw')
- if (withdrawStat) {
- withdrawStat.amount = stats.descendant_withdraw_amount || 0
- withdrawStat.count = stats.descendant_withdraw_count || 0
- }
- // 更新转化VIP奖励
- const conversionVipStat = statistics.value.find(s => s.type === 'descendant_upgrade_vip')
- if (conversionVipStat) {
- conversionVipStat.amount = stats.descendant_upgrade_vip_amount || 0
- conversionVipStat.count = stats.descendant_upgrade_vip_count || 0
- }
- // 更新转化SVIP奖励
- const conversionSvipStat = statistics.value.find(s => s.type === 'descendant_upgrade_svip')
- if (conversionSvipStat) {
- conversionSvipStat.amount = stats.descendant_upgrade_svip_amount || 0
- conversionSvipStat.count = stats.descendant_upgrade_svip_count || 0
- }
- // 更新活跃奖励
- const activeStat = statistics.value.find(s => s.type === 'descendant_new_active')
- if (activeStat) {
- activeStat.amount = stats.descendant_new_active_amount || 0
- activeStat.count = stats.descendant_new_active_count || 0
- }
- // 更新月度活跃奖励
- const monthlyActiveStat = statistics.value.find(s => s.type === 'descendant_stay_active')
- if (monthlyActiveStat) {
- monthlyActiveStat.amount = stats.descendant_stay_active_amount || 0
- monthlyActiveStat.count = stats.descendant_stay_active_count || 0
- }
- }
- rewardDetails.value = []
- }
- // 处理列表数据
- if (data.value.data.list) {
- if (page.value === 1) {
- rewardDetails.value = data.value.data.list
+ // 更新统计数据
+ orderStats.value = data.value.data.order_stats || {}
+ rebateStats.value = data.value.data.rebate_stats || {}
+ inviteStats.value = data.value.data.invite_stats || {}
+
+ // 清空列表
+ if (tabType === 'order') {
+ orderList.value = []
} else {
- rewardDetails.value.push(...data.value.data.list)
+ inviteList.value = []
+ }
+ }
+
+ // 处理列表数据
+ if (tabType === 'order') {
+ if (data.value.data.order_list) {
+ if (page.value === 1) {
+ orderList.value = data.value.data.order_list
+ } else {
+ orderList.value.push(...data.value.data.order_list)
+ }
+ orderListTotal.value = data.value.data.order_list_total || 0
+ finished.value = data.value.data.order_list.length < pageSize
+ if (!finished.value) {
+ page.value++
+ }
+ } else {
+ finished.value = true
}
- finished.value = data.value.data.list.length < pageSize
} else {
- finished.value = true
+ if (data.value.data.invite_list) {
+ if (page.value === 1) {
+ inviteList.value = data.value.data.invite_list
+ } else {
+ inviteList.value.push(...data.value.data.invite_list)
+ }
+ inviteListTotal.value = data.value.data.invite_list_total || 0
+ finished.value = data.value.data.invite_list.length < pageSize
+ if (!finished.value) {
+ page.value++
+ }
+ } else {
+ finished.value = true
+ }
}
}
}
loading.value = false
}
+// 切换标签页
+const switchTab = (tab) => {
+ if (activeTab.value === tab) return
+ activeTab.value = tab
+ page.value = 1
+ finished.value = false
+ loading.value = false
+ // 延迟一下确保tab切换完成
+ setTimeout(() => {
+ fetchDetail()
+ }, 100)
+}
+
// 下拉刷新
const onRefresh = () => {
finished.value = false
page.value = 1
- fetchRewardDetails().finally(() => {
+ fetchDetail().finally(() => {
refreshing.value = false
})
}
-const rewardDetails = ref([])
-const userInfo = ref({})
-const summary = ref({})
-const statistics = ref([])
-
-onMounted(() => {
- fetchRewardDetails()
-})
-
-// 获取收益类型样式
-const getRewardTypeClass = type => {
- const typeMap = {
- descendant_promotion: 'bg-blue-100 text-blue-600',
- cost: 'bg-green-100 text-green-600',
- pricing: 'bg-purple-100 text-purple-600',
- descendant_withdraw: 'bg-yellow-100 text-yellow-600',
- descendant_upgrade_vip: 'bg-red-100 text-red-600',
- descendant_upgrade_svip: 'bg-orange-100 text-orange-600',
- descendant_new_active: 'bg-indigo-100 text-indigo-600',
- descendant_stay_active: 'bg-pink-100 text-pink-600',
+// 获取等级标签样式
+const getLevelClass = (level) => {
+ const levelNum = typeof level === 'number' ? level : parseInt(level)
+ switch (levelNum) {
+ case 3:
+ return 'bg-purple-100 text-purple-600'
+ case 2:
+ return 'bg-yellow-100 text-yellow-600'
+ case 1:
+ default:
+ return 'bg-gray-100 text-gray-600'
}
- return typeMap[type] || 'bg-gray-100 text-gray-600'
}
-// 获取收益类型图标
-const getRewardTypeIcon = type => {
- const iconMap = {
- descendant_promotion: 'gift',
- cost: 'gold-coin',
- pricing: 'balance-pay',
- descendant_withdraw: 'cash-back-record',
- descendant_upgrade_vip: 'fire',
- descendant_upgrade_svip: 'fire',
- descendant_new_active: 'medal',
- descendant_stay_active: 'medal',
+// 获取等级显示名称
+const getLevelName = (level) => {
+ const levelNum = typeof level === 'number' ? level : parseInt(level)
+ const levelMap = {
+ 1: '普通',
+ 2: '黄金',
+ 3: '钻石'
}
- return iconMap[type] || 'balance-o'
-}
-
-// 获取收益类型描述
-const getRewardTypeDescription = type => {
- const descriptionMap = {
- descendant_promotion: '推广奖励',
- cost: '成本贡献',
- pricing: '定价贡献',
- descendant_withdraw: '提现收益',
- descendant_upgrade_vip: '转化VIP奖励',
- descendant_upgrade_svip: '转化SVIP奖励',
- descendant_new_active: '新增活跃奖励',
- descendant_stay_active: '月度活跃奖励',
- }
- return descriptionMap[type] || '未知类型'
+ return levelMap[levelNum] || '普通'
}
// 格式化时间
const formatTime = timeStr => {
if (!timeStr) return '-'
- const date = new Date(timeStr)
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`
+ return timeStr.split(' ')[0]
}
// 格式化金额
@@ -232,10 +151,14 @@ const formatNumber = num => {
if (!num) return '0.00'
return Number(num).toFixed(2)
}
+
+onMounted(() => {
+ fetchDetail()
+})
-
+
@@ -248,104 +171,136 @@ const formatNumber = num => {
成为下级代理时间:{{ formatTime(userInfo.createTime) }}
-
+
+
+
+
+
订单统计(仅统计有返佣的订单)
+
-
总推广单量
-
{{ summary.totalOrders }}
+
总订单量
+
{{ orderStats.total_orders || 0 }}
-
总收益
-
¥{{ formatNumber(summary.totalReward) }}
+
月订单
+
{{ orderStats.month_orders || 0 }}
-
总贡献
-
¥{{ formatNumber(summary.totalContribution) }}
+
今日订单
+
{{ orderStats.today_orders || 0 }}
-
+
-
贡献统计
-
-
-
-
-
- {{ item.description }}
-
-
-
{{ item.count }} 次
-
- ¥{{ formatNumber(item.amount) }}
-
-
+
返佣统计
+
+
+
总返佣金额
+
¥{{ formatNumber(rebateStats.total_rebate_amount) }}
+
+
+
月返佣金额
+
¥{{ formatNumber(rebateStats.month_rebate_amount) }}
+
+
+
今日返佣金额
+
¥{{ formatNumber(rebateStats.today_rebate_amount) }}
+
+
-
-
贡献记录
-
-
-
-
暂无贡献记录
-
-
-
-
-
-
-
{{ getRewardTypeDescription(item.type) }}
+
邀请统计
+
+
+
总邀请
+
{{ inviteStats.total_invites || 0 }}
+
+
+
月邀请
+
{{ inviteStats.month_invites || 0 }}
+
+
+
今日邀请
+
{{ inviteStats.today_invites || 0 }}
+
+
+
+
+
+
+
+
+
+
+
+
暂无订单记录
+
+
+
+
{{ item.product_name || '未知产品' }}
+
订单号:{{ item.order_no }}
{{ formatTime(item.create_time) }}
-
-
-
- ¥{{ formatNumber(item.amount) }}
+
+
订单金额
+
¥{{ formatNumber(item.order_amount) }}
+
+
返佣金额
+
¥{{ formatNumber(item.rebate_amount) }}
+
-
-
-
-
+
+
+
+
+
+
+
+
暂无邀请记录
+
+
+
+
{{ item.mobile }}
+
+ {{ item.level_name }}代理
+
+
+
{{ formatTime(item.create_time) }}
+
+
+
+
+
+
+
diff --git a/src/views/SubordinateList.vue b/src/views/SubordinateList.vue
index e10d353..66070c6 100644
--- a/src/views/SubordinateList.vue
+++ b/src/views/SubordinateList.vue
@@ -1,7 +1,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
加入团队时间:{{ item.create_time }}
+
+
+
+
+
返佣总金额
+
¥{{ formatNumber(item.total_rebate_amount || 0) }}
+
+
+
今日推广
+
{{ formatCount(item.today_queries || 0) }}
+
+
+
邀请总人数
+
{{ formatCount(item.total_invites || 0) }}
+
+
+
总推广量
+
{{ formatCount(item.total_queries || 0) }}
+
+
+
今日返佣
+
¥{{ formatNumber(item.today_rebate_amount || 0) }}
+
+
+
+
邀请今日
+
{{ formatCount(item.today_invites || 0) }}
+
+
+
+
+
+
+
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/UpgradeSubordinate.vue b/src/views/UpgradeSubordinate.vue
new file mode 100644
index 0000000..486bfd9
--- /dev/null
+++ b/src/views/UpgradeSubordinate.vue
@@ -0,0 +1,573 @@
+
+
+
+
+
+
+
+
+
+
+
调整说明
+
+ 仅可升级普通代理为黄金代理
+ 调整操作免费,无需支付费用
+
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
总查询量
+
{{ formatCount(item.total_queries || 0) }}
+
+
+
返佣总额
+
¥{{ formatNumber(item.total_rebate_amount || 0) }}
+
+
+
邀请人数
+
{{ formatCount(item.total_invites || 0) }}
+
+
+
+
+
+
+ 调整为黄金代理
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 确定要将 {{ currentUpgradeItem?.mobile }} 升级为黄金代理吗?
+
+
+
• 升级操作不可撤销
+
• 升级操作免费
+
+
+
+ 取消
+ 确认升级
+
+
+
+
+
+
+
+
+
diff --git a/src/views/UserAgreement.vue b/src/views/UserAgreement.vue
index ac2db97..d6aae14 100644
--- a/src/views/UserAgreement.vue
+++ b/src/views/UserAgreement.vue
@@ -206,7 +206,7 @@ const companyName = import.meta.env.VITE_COMPANY_NAME
八、违约
- 用户不得利用本服务进行任何损害海南省学宇思网络科技有限公司及其他第三方权益的行为,否则海南省学宇思网络科技有限公司有权立即终止为该用户提供本服务,并要求用户赔偿损失。由此产生的任何后果由用户自行承担,与海南省学宇思网络科技有限公司无关。
+ 用户不得利用本服务进行任何损害海南海宇大数据有限公司及其他第三方权益的行为,否则海南海宇大数据有限公司有权立即终止为该用户提供本服务,并要求用户赔偿损失。由此产生的任何后果由用户自行承担,与海南海宇大数据有限公司无关。
diff --git a/src/views/Withdraw.vue b/src/views/Withdraw.vue
index 5e30bef..83a7a8f 100644
--- a/src/views/Withdraw.vue
+++ b/src/views/Withdraw.vue
@@ -138,15 +138,15 @@
¥{{ amount }}
- 税收:
+ 预估税费:
- -¥{{ taxAmount.toFixed(2) }}
+ -¥{{ estimatedTaxAmount.toFixed(2) }}
- 实际到账:
- ¥{{ actualAmount.toFixed(2) }}
+ 预估到账:
+ ¥{{ estimatedActualAmount.toFixed(2) }}
@@ -261,6 +261,7 @@
import { ref, computed } from "vue";
import { showToast } from "vant";
import RealNameAuthDialog from "@/components/RealNameAuthDialog.vue";
+import { applyWithdrawal, getRevenueInfo } from "@/api/agent";
const agentStore = useAgentStore();
const dialogStore = useDialogStore();
@@ -271,24 +272,21 @@ const isSubmitting = ref(false);
const showStatusPopup = ref(false);
const showTaxConfirmPopup = ref(false);
-// 税务
-const taxFreeAmount = ref(0); // 免税额度
-const usedExemptionAmount = ref(0); // 已使用免税额度
-const remainingExemptionAmount = ref(0); // 剩余免税额度
-const taxRate = ref(0); // 税率
+// 税费信息(新系统由后端自动计算)
+const taxAmount = ref(0);
+const actualAmount = ref(0);
-// 计算扣税金额和实际到账金额
-const taxAmount = computed(() => {
+// 计算预估税费和实际到账金额(前端仅作展示,实际由后端计算)
+const estimatedTaxAmount = computed(() => {
if (!amount.value) return 0;
const withdrawAmount = Number(amount.value);
-
- // 统一收取6%手续费,不再有免税额度
+ // 预估税费:6%(实际以后端计算为准)
return withdrawAmount * 0.06;
});
-const actualAmount = computed(() => {
+const estimatedActualAmount = computed(() => {
if (!amount.value) return 0;
- return Number(amount.value) - taxAmount.value;
+ return Number(amount.value) - estimatedTaxAmount.value;
});
// 样式配置
@@ -334,18 +332,15 @@ const availableAmount = ref(null);
const realName = ref("");
const getData = async () => {
- const { data: res, error } = await useApiFetch("/agent/revenue")
- .get()
- .json();
+ const { data, error } = await getRevenueInfo();
- if (res.value?.code === 200 && !error.value) {
- availableAmount.value = res.value.data.balance;
+ if (data.value?.code === 200 && !error.value) {
+ availableAmount.value = data.value.data.balance;
}
};
onBeforeMount(() => {
getData();
- getTax();
});
// 表单验证
@@ -392,18 +387,7 @@ const openRealNameAuth = () => {
dialogStore.openRealNameAuth();
};
-// 获取税务
-const getTax = async () => {
- const { data, error } = await useApiFetch("/agent/withdrawal/tax/exemption")
- .get()
- .json();
- if (data.value?.code === 200 && !error.value) {
- taxFreeAmount.value = data.value.data.total_exemption_amount;
- usedExemptionAmount.value = data.value.data.used_exemption_amount;
- remainingExemptionAmount.value = data.value.data.remaining_exemption_amount;
- taxRate.value = data.value.data.tax_rate;
- }
-};
+// 注意:新系统中税费由后端自动计算,无需前端调用税务豁免接口
const handleSubmit = async () => {
// 检查实名认证状态
@@ -424,22 +408,22 @@ const handleSubmit = async () => {
const confirmWithdraw = async () => {
isSubmitting.value = true;
try {
- const { data, error } = await useApiFetch("/agent/withdrawal")
- .post({
- payee_account: alipayAccount.value,
- amount: amount.value,
- payee_name: realName.value,
- })
- .json();
- if (data.value?.code === 200) {
- status.value = data.value.data.status;
+ const { applyWithdrawal } = await import('@/api/agent');
+ const { data, error } = await applyWithdrawal({
+ payee_account: alipayAccount.value,
+ amount: Number(amount.value),
+ payee_name: realName.value,
+ });
+ if (data.value?.code === 200 && !error.value) {
+ status.value = 1; // 新系统:申请后状态为1(待审核)
showTaxConfirmPopup.value = false;
showStatusPopup.value = true;
- if (status.value === 3) {
- failMsg.value = data.value.data.fail_msg;
- }
+ } else {
+ showToast(data.value?.msg || '提现申请失败,请重试');
}
- } catch {
+ } catch (err) {
+ console.error('提现申请失败:', err);
+ showToast('提现申请失败,请重试');
} finally {
isSubmitting.value = false;
}
diff --git a/src/views/WithdrawDetails.vue b/src/views/WithdrawDetails.vue
index 9314162..a1dd248 100644
--- a/src/views/WithdrawDetails.vue
+++ b/src/views/WithdrawDetails.vue
@@ -1,41 +1,37 @@
-
-
+
+
{{
item.create_time || "-"
- }}
- {{ item.amount.toFixed(2) }}元
+ }}
+ {{ item.amount.toFixed(2) }}元
-
-
+
+
{{ statusToChinese(item.status) }}
-
+
收款账户:{{ maskName(item.payee_account) }}
+
+ 收款人:{{ item.payee_name }}
+
+
+ 税费:-¥{{ item.tax_amount.toFixed(2) }}
+
+
+ 实际到账:¥{{ item.actual_amount.toFixed(2) }}
+
+
+ 提现单号:{{ item.withdrawal_no }}
+
备注:{{ item.remark }}
@@ -44,10 +40,12 @@