feat(spec-3): complete section 3.1/3.2/3.3 activity verify settlement, role_flags, and distribution_relations
这个提交包含在:
@@ -267,12 +267,12 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import AppTabBar from '@/components/CustomTabBar.vue';
|
||||
import SkeletonScreen from '@/components/SkeletonScreen.vue';
|
||||
import PrivacyModal from '@/components/PrivacyModal.vue';
|
||||
import HomePopupModal from '@/components/HomePopupModal.vue';
|
||||
import { getCompanions, getBanners, getNavCategories } from '@/common/api.js';
|
||||
import { getCompanions, getBanners, getNavCategories, bindInviteCode } from '@/common/api.js';
|
||||
import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
@@ -403,6 +403,20 @@ const onThemeChanged = (key) => {
|
||||
applyThemeToNativeUI(key);
|
||||
};
|
||||
|
||||
onLoad((options) => {
|
||||
const rawInvite = options && (options.inviter_id || options.inviterId || options.code || options.scene);
|
||||
if (rawInvite) {
|
||||
const decoded = decodeURIComponent(String(rawInvite));
|
||||
uni.setStorageSync('PENDING_INVITER_CODE', decoded);
|
||||
const uid = uni.getStorageSync('userId');
|
||||
if (uid) {
|
||||
bindInviteCode(uid, decoded).then(() => {
|
||||
uni.removeStorageSync('PENDING_INVITER_CODE');
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
navInfo.value = getNavBarInfo();
|
||||
currentThemeKey.value = getCurrentThemeKey();
|
||||
|
||||
@@ -390,7 +390,7 @@ import { ICONS } from '@/common/icons.js';
|
||||
import { getCurrentThemeKey, setTheme, THEME_KEYS, applyThemeToNativeUI } from '@/common/theme.js';
|
||||
import { getCurrentRole, setCurrentRole, ROLE_TYPES, toggleRole as toggleUserRole, isExpertCertified, getExpertCertStatus, setExpertCertStatus, CERT_STATUS } from '@/common/role.js';
|
||||
import { getNavBarInfo } from '@/common/nav.js';
|
||||
import { getUserProfile, rechargeBalance, withdrawCommission, getUserFinanceRecords, updateUserProfile, uploadImage, getRechargeTiers, getPlatformConfigs, applyExpertCert, getUserWithdrawals, getFavorites, removeFavorite, getDistributionTeam, getDistributionRecords, getMyReports } from '@/common/api.js';
|
||||
import { getUserProfile, rechargeBalance, withdrawCommission, getUserFinanceRecords, updateUserProfile, uploadImage, getRechargeTiers, getPlatformConfigs, applyExpertCert, getUserWithdrawals, getFavorites, removeFavorite, getDistributionTeam, getDistributionRecords, getMyReports, bindInviteCode } from '@/common/api.js';
|
||||
|
||||
const DEFAULT_GUEST_AVATAR = 'https://images.unsplash.com/photo-1535713875002-d1d0cf377fde?w=200';
|
||||
const isLoggedIn = ref(true);
|
||||
@@ -624,6 +624,20 @@ const loadUserProfile = async (targetId) => {
|
||||
...(uni.getStorageSync('PW_USER_INFO') || {}),
|
||||
...user.value
|
||||
});
|
||||
// 若通过小程序太阳码海报进入带有待绑定的推荐人标识且当前尚未绑定上级,首次登录自动建立父子关联
|
||||
const pendingInviter = uni.getStorageSync('PENDING_INVITER_CODE');
|
||||
if (pendingInviter && !profile.inviterId) {
|
||||
bindInviteCode(uid, pendingInviter)
|
||||
.then((res) => {
|
||||
uni.removeStorageSync('PENDING_INVITER_CODE');
|
||||
if (res && res.inviterId) {
|
||||
user.value.inviterId = res.inviterId;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
uni.removeStorageSync('PENDING_INVITER_CODE');
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.warn('[User] 加载用户信息异常:', err.message);
|
||||
|
||||
在新工单中引用
屏蔽一个用户