From 3f478e2ce2ed22c5e7c514548d928c71694e9c29 Mon Sep 17 00:00:00 2001 From: Mrx <18278715334@163.com> Date: Wed, 11 Feb 2026 15:16:52 +0800 Subject: [PATCH] f --- README.md | 5 +- pages.config.js | 10 +- src/App.vue | 17 +- src/api/agent.js | 8 + src/components/PriceInputPopup.vue | 18 +- src/composables/useBindPhoneLogic.js | 82 ++++ src/composables/useWechatShare.js | 2 +- src/pages.json | 39 +- src/pages/agent/index.vue | 16 +- src/pages/agentSystemGuide/index.vue | 2 +- src/pages/agentUpgrade/index.vue | 2 +- src/pages/auth/index.vue | 326 ++++++++++++++ src/pages/index.vue | 34 +- src/pages/me/index.vue | 188 +------- src/pages/promote/index.vue | 292 ------------ src/pages/promote/reportList.vue | 198 ++++++++ src/pages/register/index.vue | 424 ------------------ src/pages/teamList/detail.vue | 297 ++++++++++++ src/pages/teamList/index.vue | 218 +++++---- src/static/index/01.jpg | Bin 0 -> 73586 bytes src/static/index/05.png | Bin 0 -> 33625 bytes src/static/index/06.png | Bin 0 -> 19211 bytes src/static/index/07.png | Bin 0 -> 15347 bytes src/static/index/08.png | Bin 0 -> 14773 bytes src/static/index/09.png | Bin 0 -> 9429 bytes src/static/index/10.png | Bin 0 -> 14878 bytes src/static/index/banner.png | Bin 39124 -> 0 bytes src/static/index/banner_1.png | Bin 0 -> 20483 bytes src/static/index/go_icon.png | Bin 272 -> 0 bytes src/static/index/n/01.jpg | Bin 77452 -> 0 bytes src/static/index/n/ycc_search.jpg | Bin 87734 -> 0 bytes src/static/index/ycc_search.jpg | Bin 0 -> 83577 bytes src/static/login/login_bg.png | Bin 75866 -> 0 bytes src/static/login/logo.png | Bin 118725 -> 0 bytes src/static/login/logo_title.png | Bin 16930 -> 0 bytes src/static/logo.png | Bin 0 -> 41004 bytes src/static/promote/backgroundcheck_bg.png | Bin 14287 -> 0 bytes src/static/promote/banner_1.png | Bin 23330 -> 0 bytes src/static/promote/bzzx.png | Bin 11432 -> 0 bytes src/static/promote/company_bg.png | Bin 37186 -> 0 bytes .../promote/consumer_finance_report_bg.png | Bin 25899 -> 0 bytes src/static/promote/housekeeping_risk_bg.png | Bin 22487 -> 0 bytes src/static/promote/marriage_risk_bg.png | Bin 20615 -> 0 bytes src/static/promote/personal_data_bg.png | Bin 23116 -> 0 bytes src/static/promote/tghb.png | Bin 88767 -> 0 bytes src/static/promote/wdxj.png | Bin 4175 -> 0 bytes src/static/promote/wytx.png | Bin 3575 -> 0 bytes src/static/promote/zc.png | Bin 3763 -> 0 bytes src/static/promote/zxkf.png | Bin 4173 -> 0 bytes uni-pages.d.ts | 7 +- 50 files changed, 1134 insertions(+), 1051 deletions(-) create mode 100644 src/composables/useBindPhoneLogic.js create mode 100644 src/pages/auth/index.vue delete mode 100644 src/pages/promote/index.vue create mode 100644 src/pages/promote/reportList.vue delete mode 100644 src/pages/register/index.vue create mode 100644 src/pages/teamList/detail.vue create mode 100644 src/static/index/01.jpg create mode 100644 src/static/index/05.png create mode 100644 src/static/index/06.png create mode 100644 src/static/index/07.png create mode 100644 src/static/index/08.png create mode 100644 src/static/index/09.png create mode 100644 src/static/index/10.png delete mode 100644 src/static/index/banner.png create mode 100644 src/static/index/banner_1.png delete mode 100644 src/static/index/go_icon.png delete mode 100644 src/static/index/n/01.jpg delete mode 100644 src/static/index/n/ycc_search.jpg create mode 100644 src/static/index/ycc_search.jpg delete mode 100644 src/static/login/login_bg.png delete mode 100644 src/static/login/logo.png delete mode 100644 src/static/login/logo_title.png create mode 100644 src/static/logo.png delete mode 100644 src/static/promote/backgroundcheck_bg.png delete mode 100644 src/static/promote/banner_1.png delete mode 100644 src/static/promote/bzzx.png delete mode 100644 src/static/promote/company_bg.png delete mode 100644 src/static/promote/consumer_finance_report_bg.png delete mode 100644 src/static/promote/housekeeping_risk_bg.png delete mode 100644 src/static/promote/marriage_risk_bg.png delete mode 100644 src/static/promote/personal_data_bg.png delete mode 100644 src/static/promote/tghb.png delete mode 100644 src/static/promote/wdxj.png delete mode 100644 src/static/promote/wytx.png delete mode 100644 src/static/promote/zc.png delete mode 100644 src/static/promote/zxkf.png diff --git a/README.md b/README.md index 9095ba7..5ef44d0 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,8 @@ ### TabBar 页面 1. ✅ `src/pages/index.vue` - 首页 -2. ✅ `src/pages/promote/index.vue` - 推广页 -3. ✅ `src/pages/agent/index.vue` - 数据页 -4. ✅ `src/pages/me/index.vue` - 我的页 +2. ✅ `src/pages/agent/index.vue` - 数据页 +3. ✅ `src/pages/me/index.vue` - 我的页 ### 其他页面 - ✅ `src/pages/help/index.vue` - 帮助中心 diff --git a/pages.config.js b/pages.config.js index 5bab320..a39aa9d 100644 --- a/pages.config.js +++ b/pages.config.js @@ -3,13 +3,11 @@ import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages' export default defineUniPages({ pages: [ { path: 'pages/index', type: 'home', layout: 'HomeLayout', style: { navigationBarTitleText: '一查查' } }, - { path: 'pages/promote/index', layout: 'HomeLayout', style: { navigationBarTitleText: '推广' } }, { path: 'pages/agent/index', layout: 'HomeLayout', style: { navigationBarTitleText: '数据' } }, { path: 'pages/me/index', layout: 'HomeLayout', style: { navigationBarTitleText: '我的' } }, { path: 'pages/help/index', layout: 'PageLayout', style: { navigationBarTitleText: '帮助中心' } }, { path: 'pages/help/detail', layout: 'PageLayout', style: { navigationBarTitleText: '帮助详情' } }, { path: 'pages/help/guide', layout: 'PageLayout', style: { navigationBarTitleText: '引导指南' } }, - { path: 'pages/register/index', layout: 'PageLayout', style: { navigationBarTitleText: '注册成为代理' } }, { path: 'pages/historyQuery/index', layout: 'PageLayout', style: { navigationBarTitleText: '历史查询' } }, { path: 'pages/report/index', layout: 'PageLayout', style: { navigationBarTitleText: '报告详情' } }, { path: 'pages/service/index', layout: 'PageLayout', style: { navigationBarTitleText: '客服' } }, @@ -18,10 +16,12 @@ export default defineUniPages({ { path: 'pages/privacyPolicy/index', layout: 'PageLayout', style: { navigationBarTitleText: '隐私政策' } }, { path: 'pages/agentManageAgreement/index', layout: 'PageLayout', style: { navigationBarTitleText: '代理管理协议' } }, { path: 'pages/teamList/index', layout: 'PageLayout', style: { navigationBarTitleText: '我的团队' } }, + { path: 'pages/teamList/detail', layout: 'PageLayout', style: { navigationBarTitleText: '下级详情' } }, { path: 'pages/agentUpgrade/index', layout: 'PageLayout', style: { navigationBarTitleText: '升级代理' } }, { path: 'pages/promoteDetails/index', layout: 'PageLayout', style: { navigationBarTitleText: '我的推广收益' } }, { path: 'pages/rewardsDetails/index', layout: 'PageLayout', style: { navigationBarTitleText: '下级推广收益' } }, { path: 'pages/invitation/index', layout: 'PageLayout', style: { navigationBarTitleText: '邀请下级代理' } }, + { path: 'pages/promote/reportList', layout: 'PageLayout', style: { navigationBarTitleText: '推广报告' } }, { path: 'pages/promote/report', layout: 'PageLayout', style: { navigationBarTitleText: '推广报告' } }, { path: 'pages/withdrawDetails/index', layout: 'PageLayout', style: { navigationBarTitleText: '提现记录' } }, // #ifdef MP-WEIXIN @@ -49,12 +49,6 @@ export default defineUniPages({ iconPath: '/static/homelayout/index.png', selectedIconPath: '/static/homelayout/index_active.png', }, - { - pagePath: 'pages/promote/index', - text: '推广', - iconPath: '/static/homelayout/promote.png', - selectedIconPath: '/static/homelayout/promote_active.png', - }, { pagePath: 'pages/agent/index', text: '数据', diff --git a/src/App.vue b/src/App.vue index 1bdc926..b9cea9f 100644 --- a/src/App.vue +++ b/src/App.vue @@ -58,7 +58,7 @@ const login = () => { console.log(`[登录] 获取code成功,第${loginRetryCount}次尝试`) - wxminiLogin({ code }).then((result) => { + wxminiLogin({ code }).then(async (result) => { // 检查网络请求是否失败 if (result.error.value) { console.error('[登录] 网络请求失败:', result.error.value) @@ -91,8 +91,19 @@ const login = () => { console.log('[登录] 登录成功') isLoggingIn = false loginRetryCount = 0 - getUser() - getAgentInformation() + try { + await getUser() + // 微信环境下未绑定手机号时,跳转绑定手机号页(与 BindPhoneDialog 逻辑一致) + // #ifdef MP-WEIXIN + if (!userStore.mobile) { + uni.reLaunch({ url: '/pages/auth/index' }) + return + } + // #endif + getAgentInformation() + } catch (e) { + console.error('[登录] 获取用户信息失败', e) + } } else { // 检查是否是 code 无效错误 const errorMsg = result.data.value.msg || '' diff --git a/src/api/agent.js b/src/api/agent.js index ad29a6b..38e9f5a 100644 --- a/src/api/agent.js +++ b/src/api/agent.js @@ -74,6 +74,14 @@ export function getTeamList(params) { return useApiFetch(`/agent/team/list${buildQueryString(params)}`).get().json() } +/** + * 获取下级贡献详情(订单/邀请列表) + * @param {object} params - { subordinate_id, page, page_size, tab_type: 'order'|'invite' } + */ +export function getSubordinateContributionDetail(params) { + return useApiFetch(`/agent/subordinate/contribution/detail${buildQueryString(params)}`).get().json() +} + export function getSubordinateList(params) { return useApiFetch(`/agent/subordinate/list${buildQueryString(params)}`).get().json() } diff --git a/src/components/PriceInputPopup.vue b/src/components/PriceInputPopup.vue index 5bfa149..b7014f6 100644 --- a/src/components/PriceInputPopup.vue +++ b/src/components/PriceInputPopup.vue @@ -11,20 +11,20 @@ :placeholder="pricePlaceholder" @blur="onBlurPrice" /> - - 推广收益为 - ¥ {{ promotionRevenue }} + + 推广收益为 {{ promotionRevenue }} - - 底价成本 ¥ {{ baseCost }} - 提价成本 ¥ {{ raiseCost }} + + 底价成本为 {{ baseCost }} + 提价成本为 {{ raiseCost }} 收益与成本说明 推广收益 = 客户查询价 - 我的成本 我的成本 = 实际底价 + 提价成本 - 设定范围:¥{{ productConfig?.price_range_min ?? 0 }} - ¥{{ productConfig?.price_range_max ?? 9999 }} + 提价成本:设置{{ productConfig?.price_threshold ?? 0 }}元以上的部分收取{{ rateFormat(productConfig?.price_fee_rate ?? 0) }}的提价成本 + 设定范围:{{ productConfig?.price_range_min ?? 0 }}元 - {{ productConfig?.price_range_max ?? 9999 }} 确认 @@ -63,6 +63,10 @@ watch( }, ) +function rateFormat(rate) { + return (Number(rate) || 0) * 100 + '%' +} + function safeTruncate(num, decimals = 2) { if (isNaN(num) || !isFinite(num)) return '0.00' const factor = 10 ** decimals diff --git a/src/composables/useBindPhoneLogic.js b/src/composables/useBindPhoneLogic.js new file mode 100644 index 0000000..8c06211 --- /dev/null +++ b/src/composables/useBindPhoneLogic.js @@ -0,0 +1,82 @@ +/** + * 绑定手机号登录逻辑,与 ycc-proxy-webview BindPhoneDialog.vue「已有平台账号」模式保持一致: + * - 发送验证码:auth/sendSms actionType='bindMobile' + * - 绑定:/user/bindMobile -> 存 token -> fetchUserInfo + fetchAgentStatus -> 按 isAgent 跳转 + */ +import useApiFetch from '@/composables/useApiFetch' +import { bindMobile } from '@/api/user' +import { useUserStore } from '@/stores/userStore' +import { useAgentStore } from '@/stores/agentStore' + +export function useBindPhoneLogic() { + const userStore = useUserStore() + const agentStore = useAgentStore() + + /** + * 发送绑定手机号验证码(与 BindPhoneDialog sendVerificationCode 一致) + * @param {string} mobile - 手机号 + * @returns {Promise<{ ok: boolean, msg?: string }>} + */ + async function sendBindSms(mobile) { + const { data, error } = await useApiFetch('/auth/sendSms') + .post({ mobile, actionType: 'bindMobile' }) + .json() + if (data.value && !error.value && data.value.code === 200) { + return { ok: true } + } + const msg = data.value?.msg || error.value || '发送失败' + return { ok: false, msg } + } + + /** + * 提交绑定手机号并完成登录后流程(与 BindPhoneDialog handleRegister 已有账号分支一致) + * - 调用 /user/bindMobile + * - 成功:存 token、refreshAfter、accessExpire,拉取用户与代理信息,返回 isAgent 供跳转 + * @param {string} mobile - 手机号 + * @param {string} code - 6 位验证码 + * @returns {Promise<{ success: boolean, isAgent?: boolean, msg?: string }>} + */ + async function submitBindMobile(mobile, code) { + const { data, error } = await bindMobile({ mobile, code }) + if (!data.value || error.value) { + return { success: false, msg: error.value || '绑定失败,请重试' } + } + if (data.value.code !== 200) { + const msg = data.value.msg || '绑定失败' + if (msg.includes('已绑定其他微信号')) { + return { success: false, msg: '该手机号已绑定其他微信号,一个微信只能绑定一个手机号' } + } + return { success: false, msg } + } + + const d = data.value.data + uni.setStorageSync('token', d.accessToken) + uni.setStorageSync('refreshAfter', d.refreshAfter) + uni.setStorageSync('accessExpire', d.accessExpire) + + await Promise.all([ + agentStore.fetchAgentStatus(), + userStore.fetchUserInfo(), + ]) + + const isAgent = agentStore.isAgent + return { success: true, isAgent } + } + + /** + * 绑定成功后按 isAgent 跳转(与 BindPhoneDialog 一致:代理 -> 数据页,否则 -> 首页) + */ + function redirectAfterBind(isAgent) { + if (isAgent) { + uni.switchTab({ url: '/pages/agent/index' }) + } else { + uni.switchTab({ url: '/pages/index' }) + } + } + + return { + sendBindSms, + submitBindMobile, + redirectAfterBind, + } +} diff --git a/src/composables/useWechatShare.js b/src/composables/useWechatShare.js index 5c8c01c..63b4bc2 100644 --- a/src/composables/useWechatShare.js +++ b/src/composables/useWechatShare.js @@ -8,7 +8,7 @@ const APP_NAME = import.meta.env?.VITE_APP_NAME || '一查查' export const defaultShareTitle = `${APP_NAME} - 专业大数据风控与查询服务` /** 默认分享图(5:4 比例,建议 500*400),不传则使用当前页截图 */ -export const defaultShareImageUrl = '/static/index/banner.png' +export const defaultShareImageUrl = '/static/index/01.jpg' /** * 获取「分享给好友」的配置 diff --git a/src/pages.json b/src/pages.json index a384229..a3a6547 100644 --- a/src/pages.json +++ b/src/pages.json @@ -59,6 +59,15 @@ "navigationBarTitleText": "升级代理" } }, + { + "path": "pages/auth/index", + "type": "page", + "layout": "PageLayout", + "style": { + "navigationBarTitleText": "绑定手机号", + "navigationStyle": "default" + } + }, { "path": "pages/help/detail", "type": "page", @@ -116,15 +125,15 @@ } }, { - "path": "pages/promote/index", + "path": "pages/promote/report", "type": "page", - "layout": "HomeLayout", + "layout": "PageLayout", "style": { - "navigationBarTitleText": "推广" + "navigationBarTitleText": "推广报告" } }, { - "path": "pages/promote/report", + "path": "pages/promote/reportList", "type": "page", "layout": "PageLayout", "style": { @@ -139,14 +148,6 @@ "navigationBarTitleText": "我的推广收益" } }, - { - "path": "pages/register/index", - "type": "page", - "layout": "PageLayout", - "style": { - "navigationBarTitleText": "注册成为代理" - } - }, { "path": "pages/report/index", "type": "page", @@ -171,6 +172,14 @@ "navigationBarTitleText": "客服" } }, + { + "path": "pages/teamList/detail", + "type": "page", + "layout": "PageLayout", + "style": { + "navigationBarTitleText": "下级详情" + } + }, { "path": "pages/teamList/index", "type": "page", @@ -218,12 +227,6 @@ "iconPath": "/static/homelayout/index.png", "selectedIconPath": "/static/homelayout/index_active.png" }, - { - "pagePath": "pages/promote/index", - "text": "推广", - "iconPath": "/static/homelayout/promote.png", - "selectedIconPath": "/static/homelayout/promote_active.png" - }, { "pagePath": "pages/agent/index", "text": "数据", diff --git a/src/pages/agent/index.vue b/src/pages/agent/index.vue index b62484e..12c6858 100644 --- a/src/pages/agent/index.vue +++ b/src/pages/agent/index.vue @@ -60,8 +60,8 @@ function toTeamList() { function toRegister() { const url = mobile.value - ? `/pages/register/index?mobile=${encodeURIComponent(mobile.value)}` - : '/pages/register/index' + ? `/pages/auth/index?mobile=${encodeURIComponent(mobile.value)}` + : '/pages/auth/index' uni.navigateTo({ url }) } @@ -136,19 +136,19 @@ function toRegister() {