feat: 任务详情补充缺失字段
新增显示: - 状态标签(彩色文字:待抢单/待打卡/进行中/已完成) - 截止时间(expireTime) - 预计完成时间(preFinishTime,指派任务) - 上报人(createName,type 3/4 时显示) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -231,9 +231,41 @@ class TaskListFragment : BaseFragment<FragmentTaskListBinding>() {
|
|||||||
// 积分
|
// 积分
|
||||||
binding.tvPoints.text = detail.pointText
|
binding.tvPoints.text = detail.pointText
|
||||||
|
|
||||||
// 协作人(workTogether 列表)
|
// 状态标签
|
||||||
// TODO: workTogether 是 List<Any>,需要确认实际结构后解析
|
when (detail.status) {
|
||||||
binding.rowWorkers.visibility = View.GONE
|
2 -> { binding.tvStatus.text = "待抢单"; binding.tvStatus.setTextColor(requireContext().getColor(R.color.error)) }
|
||||||
|
3 -> { binding.tvStatus.text = "待打卡"; binding.tvStatus.setTextColor(requireContext().getColor(R.color.warning)) }
|
||||||
|
4 -> { binding.tvStatus.text = "进行中"; binding.tvStatus.setTextColor(requireContext().getColor(R.color.warning)) }
|
||||||
|
5, 6 -> { binding.tvStatus.text = "已完成"; binding.tvStatus.setTextColor(requireContext().getColor(R.color.success)) }
|
||||||
|
else -> { binding.tvStatus.text = "已结束"; binding.tvStatus.setTextColor(requireContext().getColor(R.color.text_secondary)) }
|
||||||
|
}
|
||||||
|
|
||||||
|
// 截止时间
|
||||||
|
if (!detail.expireTime.isNullOrEmpty()) {
|
||||||
|
binding.tvExpireTime.text = detail.expireTime
|
||||||
|
binding.rowExpire.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
binding.rowExpire.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
// 预计完成时间(指派任务 type=2)
|
||||||
|
if (!detail.preFinishTime.isNullOrEmpty()) {
|
||||||
|
binding.tvPreFinishTime.text = detail.preFinishTime
|
||||||
|
binding.rowPreFinish.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
binding.rowPreFinish.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
|
// 协作人
|
||||||
|
binding.rowWorkers.visibility = View.GONE // TODO: workTogether 结构待确认
|
||||||
|
|
||||||
|
// 上报人(用户上报 type=3/4 时显示)
|
||||||
|
if (detail.createName.isNotEmpty() && detail.taskType in listOf(3, 4)) {
|
||||||
|
binding.tvCreatorName.text = detail.createName
|
||||||
|
binding.rowCreator.visibility = View.VISIBLE
|
||||||
|
} else {
|
||||||
|
binding.rowCreator.visibility = View.GONE
|
||||||
|
}
|
||||||
|
|
||||||
// 描述
|
// 描述
|
||||||
if (detail.content.isNotEmpty()) {
|
if (detail.content.isNotEmpty()) {
|
||||||
|
|||||||
@@ -106,12 +106,40 @@
|
|||||||
android:textColor="@color/warning" />
|
android:textColor="@color/warning" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 状态标签 -->
|
||||||
|
<LinearLayout style="@style/ConfigRow">
|
||||||
|
<TextView style="@style/ConfigLabel" android:text="状态" />
|
||||||
|
<TextView android:id="@+id/tvStatus" style="@style/ConfigValue" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 截止时间 -->
|
||||||
|
<LinearLayout android:id="@+id/rowExpire" style="@style/ConfigRow"
|
||||||
|
android:visibility="gone">
|
||||||
|
<TextView style="@style/ConfigLabel" android:text="截止" />
|
||||||
|
<TextView android:id="@+id/tvExpireTime" style="@style/ConfigValue" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 预计完成时间(指派任务) -->
|
||||||
|
<LinearLayout android:id="@+id/rowPreFinish" style="@style/ConfigRow"
|
||||||
|
android:visibility="gone">
|
||||||
|
<TextView style="@style/ConfigLabel" android:text="要求完成" />
|
||||||
|
<TextView android:id="@+id/tvPreFinishTime" style="@style/ConfigValue" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 协作人 -->
|
||||||
<LinearLayout android:id="@+id/rowWorkers" style="@style/ConfigRow"
|
<LinearLayout android:id="@+id/rowWorkers" style="@style/ConfigRow"
|
||||||
android:visibility="gone">
|
android:visibility="gone">
|
||||||
<TextView style="@style/ConfigLabel" android:text="协作人" />
|
<TextView style="@style/ConfigLabel" android:text="协作人" />
|
||||||
<TextView android:id="@+id/tvWorkers" style="@style/ConfigValue" />
|
<TextView android:id="@+id/tvWorkers" style="@style/ConfigValue" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 上报人(用户上报/巡检上报任务) -->
|
||||||
|
<LinearLayout android:id="@+id/rowCreator" style="@style/ConfigRow"
|
||||||
|
android:visibility="gone">
|
||||||
|
<TextView style="@style/ConfigLabel" android:text="上报人" />
|
||||||
|
<TextView android:id="@+id/tvCreatorName" style="@style/ConfigValue" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- 任务描述 -->
|
<!-- 任务描述 -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvDescription"
|
android:id="@+id/tvDescription"
|
||||||
|
|||||||
Reference in New Issue
Block a user