解决登录显示、首页显示bug
This commit is contained in:
69
pages/mall/delivery/records/detail.uvue
Normal file
69
pages/mall/delivery/records/detail.uvue
Normal file
@@ -0,0 +1,69 @@
|
||||
<template>
|
||||
<ServicePageScaffold title="记录详情" fallback-url="/pages/mall/delivery/records/index">
|
||||
<ServicePanel title="执行留痕" subtitle="展示轨迹摘要、证据材料、验收与结算状态。">
|
||||
<text v-if="order != null" class="row-text">工单号:{{ order.orderNo }}</text>
|
||||
<text v-if="order != null" class="row-text">服务总结:{{ order.serviceSummary }}</text>
|
||||
<text v-if="order != null" class="row-text">验收状态:{{ order.statusText }}</text>
|
||||
<text v-if="order != null" class="row-text">结算状态:{{ order.settlementStatus }}</text>
|
||||
<text v-if="order != null" class="row-text">轨迹点数量:{{ order.trackPoints.length }}</text>
|
||||
</ServicePanel>
|
||||
<ServicePanel title="证据材料" subtitle="第一阶段展示图片证据,音视频先预留。">
|
||||
<view v-if="order != null && order.evidenceList.length == 0" class="empty-box"><text class="empty-text">暂无证据材料</text></view>
|
||||
<view v-if="order != null" v-for="item in order.evidenceList" :key="item.id" class="evidence-card">
|
||||
<text class="row-text">{{ item.phase }} / {{ item.name }}</text>
|
||||
<text class="row-text">状态:{{ item.status }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import type { DeliveryOrderType } from '@/types/delivery.uts'
|
||||
import { getDeliveryOrderDetail } from '@/services/deliveryService.uts'
|
||||
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
import { getDeliveryRouteParam } from '@/utils/deliveryRoute.uts'
|
||||
|
||||
const orderId = ref('')
|
||||
const order = ref<DeliveryOrderType | null>(null)
|
||||
|
||||
async function loadData() {
|
||||
const authResult = await requireDeliveryAuth({ redirectOnFail: true, toastOnFail: true })
|
||||
if (!authResult.ok || orderId.value == '') {
|
||||
return
|
||||
}
|
||||
order.value = await getDeliveryOrderDetail(orderId.value)
|
||||
}
|
||||
|
||||
onLoad((options) => {
|
||||
if (options != null) {
|
||||
orderId.value = getDeliveryRouteParam(options as UTSJSONObject, 'id')
|
||||
}
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.row-text,
|
||||
.empty-text {
|
||||
display: block;
|
||||
margin-bottom: 12rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.evidence-card {
|
||||
padding: 18rpx;
|
||||
margin-bottom: 14rpx;
|
||||
border-radius: 18rpx;
|
||||
background: #f8fbfc;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
padding: 24rpx;
|
||||
}
|
||||
</style>
|
||||
70
pages/mall/delivery/records/index.uvue
Normal file
70
pages/mall/delivery/records/index.uvue
Normal file
@@ -0,0 +1,70 @@
|
||||
<template>
|
||||
<ServicePageScaffold title="服务记录" fallback-url="/pages/mall/delivery/home/index">
|
||||
<ServicePanel title="历史记录" subtitle="展示服务留痕、验收结果、评价与结算状态。">
|
||||
<view v-if="records.length == 0" class="empty-box"><text class="empty-text">暂无服务记录</text></view>
|
||||
<view v-for="item in records" :key="item.id" class="record-card" @click="goDetail(item.orderId)">
|
||||
<text class="row-title">{{ item.orderNo }} · {{ item.serviceName }}</text>
|
||||
<text class="row-text">服务对象:{{ item.elderNameMasked }}</text>
|
||||
<text class="row-text">状态:{{ item.statusText }}</text>
|
||||
<text class="row-text">时间:{{ item.actualStartTime }} ~ {{ item.actualEndTime }}</text>
|
||||
<text class="row-text">结算:{{ item.settlementStatus }} · 评价:{{ item.ratingText }}</text>
|
||||
</view>
|
||||
</ServicePanel>
|
||||
</ServicePageScaffold>
|
||||
</template>
|
||||
|
||||
<script setup lang="uts">
|
||||
import { ref } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import ServicePageScaffold from '@/components/homeService/ServicePageScaffold.uvue'
|
||||
import ServicePanel from '@/components/homeService/ServicePanel.uvue'
|
||||
import type { DeliveryRecordType } from '@/types/delivery.uts'
|
||||
import { getDeliveryRecords } from '@/services/deliveryService.uts'
|
||||
import { requireDeliveryAuth } from '@/utils/deliveryAuth.uts'
|
||||
|
||||
const records = ref([] as Array<DeliveryRecordType>)
|
||||
|
||||
async function loadData() {
|
||||
const authResult = await requireDeliveryAuth({ redirectOnFail: true, toastOnFail: true })
|
||||
if (!authResult.ok) {
|
||||
return
|
||||
}
|
||||
records.value = await getDeliveryRecords()
|
||||
}
|
||||
|
||||
function goDetail(orderId: string) {
|
||||
uni.navigateTo({ url: '/pages/mall/delivery/records/detail?id=' + orderId })
|
||||
}
|
||||
|
||||
onShow(() => {
|
||||
loadData()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.record-card {
|
||||
padding: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
border-radius: 20rpx;
|
||||
background: #f8fbfc;
|
||||
}
|
||||
|
||||
.row-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 700;
|
||||
color: #16324f;
|
||||
}
|
||||
|
||||
.row-text,
|
||||
.empty-text {
|
||||
display: block;
|
||||
margin-top: 12rpx;
|
||||
font-size: 24rpx;
|
||||
line-height: 36rpx;
|
||||
color: #5e758c;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
padding: 24rpx;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user