Commit e99b3168 by 胡悦

fix: 修复升级计数在获取数据前被设置的问题

确保在获取订单数据后再设置升级计数,避免潜在的未定义错误
1 parent c09b49a1
...@@ -68,7 +68,6 @@ const orderInfo = ref({ ...@@ -68,7 +68,6 @@ const orderInfo = ref({
const upgradeCount = ref('0') const upgradeCount = ref('0')
const month = ref(`${new Date().getMonth() + 1}月份`) const month = ref(`${new Date().getMonth() + 1}月份`)
const getInfo = async () => { const getInfo = async () => {
upgradeCount.value = convertToChinaNum(orderInfo.value.orderNum);
window.fetch(global.baseUrl + '/open/report/data/' + query.msgId, { window.fetch(global.baseUrl + '/open/report/data/' + query.msgId, {
method: 'GET', method: 'GET',
headers: { headers: {
...@@ -76,6 +75,7 @@ const getInfo = async () => { ...@@ -76,6 +75,7 @@ const getInfo = async () => {
} }
}).then(res => res.json()).then(json => { }).then(res => res.json()).then(json => {
orderInfo.value = json.data orderInfo.value = json.data
upgradeCount.value = convertToChinaNum(orderInfo.value.orderNum);
console.log(json) console.log(json)
}) })
}; };
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!