Commit ab7fc926 authored by 李智书's avatar 李智书

1.提交更新;

parent 94b4e340
......@@ -490,7 +490,7 @@
// 日消费趋势图表数据
dailyConsumptionData: [],
dailyConsumptionDate: [],
consumptionPreferencesData: {}, // 消费偏好数据
consumptionPreferencesData: [], // 消费偏好数据
}
},
computed: {
......@@ -589,7 +589,52 @@
})
},
// 查询周要点,消费金额
async queryWeekConsumerAmout() {
let this_ = this
try {
await new Promise((resolve, reject) => {
$.ajax({
url: gHost + '/report-push/student-consumer-report/queryWeekConsumerAmout',
type: 'get',
dataType: 'json',
contentType: 'application/x-www-form-urlencoded',
data: {
userId: this_.specifiedConsumerInfo.id || "",
schoolId: this_.specifiedConsumerInfo.schoolid || "",
startDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_
.dataRangeArr[this_.dataRangeIndex].startDate : "",
endDate: this_.dataRangeArr[this_.dataRangeIndex] ? this_.dataRangeArr[
this_.dataRangeIndex].endDate : "",
},
success: function(res) {
if (res.code == 200) {
this_.dayConsumerTrend = res.obj
this_.dailyConsumptionData = Object.values(this_
.dayConsumerTrend
.dayConsumerMap).reverse()
this_.dailyConsumptionDate = Object.keys(this_.dayConsumerTrend
.dayConsumerMap).map(element => element.substr(5)
.replace(
'-',
'/')).reverse()
resolve()
return
}
reject(res.message)
},
error: function(error) {
reject(error)
}
})
})
} catch (e) {
console.warn(e)
//TODO handle the exception
uni.showModal({
content: e.message
})
}
},
// 日消费趋势
async queryDayConsumerTrend() {
let this_ = this
......@@ -638,8 +683,8 @@
}
},
// 消费偏好百分比
consumerPreferencePercent(num){
return (Math.round(num/this.consumptionPreferencesData.grossAmount*10000)/100).toFixed(1)+'%'
consumerPreferencePercent(num) {
return (Math.round(num / this.consumptionPreferencesData.grossAmount * 10000) / 100).toFixed(1) + '%'
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment