个人中心-自愿委托出售
This commit is contained in:
2025-09-09 10:36:34 +08:00
parent 4f890c8b7f
commit acfb4c3c8d

View File

@@ -209,6 +209,17 @@ export default {
// 处理默认自动匹配状态变化
const handleDistributeChange = async (value) => {
try {
// 判断融豆状态为0提示其余正常
if (accountInfo.value.balance==0){
ElMessageBox.alert(
'请获取融豆后,可开通此服务', '',{
confirmButtonText: 'OK',
}
)
accountInfo.value.is_distribute = !value;
return
}
// 检查是否为第一次勾选
const isFirstTimeCheck = localStorage.getItem('hasCheckedDistribute') !== 'true';
@@ -258,7 +269,6 @@ export default {
const response = await api.put(`/user/${userStore.user.id}/distribute`, {
is_distribute: value
});
if (response.data.success) {
ElMessage.success('默认自动匹配状态更新成功');
// 如果是关闭状态,不需要标记为已勾选过
@@ -268,7 +278,7 @@ export default {
} else {
// 如果更新失败,恢复原状态
accountInfo.value.is_distribute = !value;
ElMessage.error(response.data.message || '默认自动匹配状态更新失败');
ElMessage.error(response.data.message);
}
} catch (error) {
if (error === 'cancel') {