fix: 权益中心页面字段名改为C# API返回的camelCase格式
This commit is contained in:
parent
4480981848
commit
50e0e544b0
|
|
@ -94,10 +94,10 @@
|
||||||
<view class="task-item" v-for="(item, i) in taskList" :key="i">
|
<view class="task-item" v-for="(item, i) in taskList" :key="i">
|
||||||
<view class="task-l">
|
<view class="task-l">
|
||||||
<view class="title">{{ item.title }}<text
|
<view class="title">{{ item.title }}<text
|
||||||
class="ml10">({{ item.ywc_count }}/{{ item.number }})</text></view>
|
class="ml10">({{ item.ywcCount }}/{{ item.number }})</text></view>
|
||||||
|
|
||||||
<view class="num">欧气值
|
<view class="num">欧气值
|
||||||
<text>+{{ item.z_number }}</text>
|
<text>+{{ item.zNumber }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- <view class="progress">
|
<!-- <view class="progress">
|
||||||
|
|
@ -109,16 +109,16 @@
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="task-r">
|
<view class="task-r">
|
||||||
<view v-if="item.is_complete == 0" class="btn act" @click="toPage(item.id)">
|
<view v-if="item.isComplete == 0" class="btn act" @click="toPage(item.id)">
|
||||||
<text>去完成</text>
|
<text>去完成</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="item.is_complete == 1" class="btn" style="background-color: #333333; color: #D8FD24;"
|
<view v-if="item.isComplete == 1" class="btn" style="background-color: #333333; color: #D8FD24;"
|
||||||
@click="completeTask(item)">
|
@click="completeTask(item)">
|
||||||
<text>待领取</text>
|
<text>待领取</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-if="item.is_complete == 2" class="btn dis">
|
<view v-if="item.isComplete == 2" class="btn dis">
|
||||||
<text>已领取</text>
|
<text>已领取</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -282,15 +282,7 @@
|
||||||
try {
|
try {
|
||||||
const res = await getTaskList(this.tabList[this.tabCur].id);
|
const res = await getTaskList(this.tabList[this.tabCur].id);
|
||||||
if (res.status == 1) {
|
if (res.status == 1) {
|
||||||
// 兼容驼峰和下划线命名
|
this.taskList = res.data.taskList
|
||||||
const list = res.data.taskList || res.data.task_list || [];
|
|
||||||
// 转换字段名为下划线格式
|
|
||||||
this.taskList = list.map(item => ({
|
|
||||||
...item,
|
|
||||||
z_number: item.zNumber || item.z_number,
|
|
||||||
ywc_count: item.ywcCount || item.ywc_count,
|
|
||||||
is_complete: item.isComplete !== undefined ? item.isComplete : item.is_complete
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('获取任务列表失败:', error);
|
console.error('获取任务列表失败:', error);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user