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