|
|
|
@ -499,7 +499,10 @@ const getUser = async function (jwcode) { |
|
|
|
|
|
|
|
console.log("请求成功", result); |
|
|
|
|
|
|
|
if (result.code === 200 && result.data) { |
|
|
|
const { code, data } = result; |
|
|
|
const region = data && data.market; |
|
|
|
|
|
|
|
if (data && Object.keys(data).length > 0) { |
|
|
|
// 查询成功后,重置表单(保留精网号),防止上一个用户的数据干扰 |
|
|
|
const currentJwcode = addConsume.value.jwcode; |
|
|
|
resetForm(); |
|
|
|
@ -507,37 +510,47 @@ const getUser = async function (jwcode) { |
|
|
|
|
|
|
|
// 处理用户数据 |
|
|
|
user.value = { |
|
|
|
...result.data, |
|
|
|
...data, |
|
|
|
// 统一处理所有黄金数值,除以100 |
|
|
|
nowPermanentGold: result.data.nowPermanentGold, |
|
|
|
nowFreeGold: result.data.nowFreeGold, |
|
|
|
nowSumGold: result.data.nowSumGold, |
|
|
|
nowTaskGold: result.data.nowTaskGold, |
|
|
|
nowFreeJune: result.data.nowFreeJune, |
|
|
|
nowFreeDecember: result.data.nowFreeDecember, |
|
|
|
historySumGold: result.data.historySumGold, |
|
|
|
historyPermanentGold: result.data.historyPermanentGold, |
|
|
|
historyFreeGold: result.data.historyFreeGold, |
|
|
|
historyTaskGold: result.data.historyTaskGold |
|
|
|
nowPermanentGold: data.nowPermanentGold, |
|
|
|
nowFreeGold: data.nowFreeGold, |
|
|
|
nowSumGold: data.nowSumGold, |
|
|
|
nowTaskGold: data.nowTaskGold, |
|
|
|
nowFreeJune: data.nowFreeJune, |
|
|
|
nowFreeDecember: data.nowFreeDecember, |
|
|
|
historySumGold: data.historySumGold, |
|
|
|
historyPermanentGold: data.historyPermanentGold, |
|
|
|
historyFreeGold: data.historyFreeGold, |
|
|
|
historyTaskGold: data.historyTaskGold |
|
|
|
}; |
|
|
|
|
|
|
|
ElMessage.success(t('elmessage.searchSuccess')); |
|
|
|
if (code === 0 && region) { |
|
|
|
ElMessage.info({ |
|
|
|
message: t('elmessage.userRegionHint', { region }), |
|
|
|
customClass: 'custom-blue-message' |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
// 如果当前开启了红包模式,获取红包列表 |
|
|
|
if (addConsume.value.redMoney === 1) { |
|
|
|
if (code === 200) { |
|
|
|
ElMessage.success(t('elmessage.searchSuccess')); |
|
|
|
|
|
|
|
// 如果当前开启了红包模式,获取红包列表 |
|
|
|
if (addConsume.value.redMoney === 1) { |
|
|
|
getRedList() |
|
|
|
} |
|
|
|
|
|
|
|
// 验证输入 |
|
|
|
validateInput() |
|
|
|
} else { |
|
|
|
ElMessage.warning(result.msg || t('elmessage.checkQueryParams')); |
|
|
|
} |
|
|
|
|
|
|
|
// 验证输入 |
|
|
|
validateInput() |
|
|
|
|
|
|
|
} else if (!result.data) { |
|
|
|
} else { |
|
|
|
ElMessage.warning(t('elmessage.noUser')); |
|
|
|
user.value.jwcode = null |
|
|
|
addConsume.value.jwcode = null |
|
|
|
// resetForm(); // 重置表单 |
|
|
|
} else { |
|
|
|
ElMessage.warning(result.msg || t('elmessage.checkQueryParams')); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error("请求失败", error); |
|
|
|
|