仅代理商能够进入分享推广和我的用户

This commit is contained in:
WindowBird 2025-08-22 10:13:19 +08:00
parent e0bad237cb
commit d23f45f84a
2 changed files with 39 additions and 8 deletions

View File

@ -59,3 +59,15 @@ export function getAgentAgreement() {
export function getServiceAreas() {
return get('/app/region')
}
/**
* 获取是否是代理商
* @returns {Promise} 返回是ture or false
*/
export function isAgent(params) {
return request({
url: '/app/agent',
method: 'GET',
params,
})
}

View File

@ -129,6 +129,7 @@
<script>
import { commonEnum } from '@/enum/commonEnum.js'
import { getUserInfo, getUserFinancialData, getAgentCount } from '@/api/user/user.js'
import { isAgent } from '@/api/agents.js'
export default {
name: 'ProfilePage',
@ -347,15 +348,33 @@ export default {
url: '/pages/requestWithdrawal/requestWithdrawal',
})
},
goToUserList() {
uni.navigateTo({
url: '/pages/useList/useList',
})
async goToUserList() {
const response = await isAgent()
if (response.data) {
uni.navigateTo({
url: '/pages/useList/useList',
})
} else {
uni.showToast({
title: '请先申请代理',
icon: 'none',
})
}
},
goToSharePromotion() {
uni.navigateTo({
url: '/pages/agents/requestAgent',
})
async goToSharePromotion() {
const response = await isAgent()
if (response.data) {
uni.navigateTo({
url: '/pages/agents/requestAgent',
})
} else {
uni.showToast({
title: '请先申请代理',
icon: 'none',
})
}
},
//