|
@@ -3,15 +3,9 @@
|
|
|
<custom-header name="服务详情"></custom-header>
|
|
<custom-header name="服务详情"></custom-header>
|
|
|
<div class="service-detail-content">
|
|
<div class="service-detail-content">
|
|
|
<farm-info-card
|
|
<farm-info-card
|
|
|
|
|
+ v-if="farmInfoData.farmName !== '' || farmInfoData.area !== '' || farmInfoData.variety !== '' || farmInfoData.address !== ''"
|
|
|
class="record-box"
|
|
class="record-box"
|
|
|
- :data="{
|
|
|
|
|
- farmName: farmDetail.name,
|
|
|
|
|
- area: farmDetail.mianji + '亩',
|
|
|
|
|
- variety: farmDetail.typeName,
|
|
|
|
|
- address: farmDetail.address,
|
|
|
|
|
- mapImage: '/map.png',
|
|
|
|
|
- maxWidth: '58px',
|
|
|
|
|
- }"
|
|
|
|
|
|
|
+ :data="farmInfoData"
|
|
|
>
|
|
>
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<div>在线沟通</div>
|
|
<div>在线沟通</div>
|
|
@@ -23,14 +17,14 @@
|
|
|
<span>农事服务</span>
|
|
<span>农事服务</span>
|
|
|
</div>
|
|
</div>
|
|
|
<stats-box :stats-data="serviceStatsData" />
|
|
<stats-box :stats-data="serviceStatsData" />
|
|
|
- <div v-for="(section, index) in detailList" :key="index" class="content-section">
|
|
|
|
|
|
|
+ <div v-for="(section, index) in detailList" :key="index" class="content-section" @click="handleClick(section)">
|
|
|
<record-item
|
|
<record-item
|
|
|
:record-item-data="section"
|
|
:record-item-data="section"
|
|
|
- :onlyRecipeName="true"
|
|
|
|
|
content-mode="serviceDetail"
|
|
content-mode="serviceDetail"
|
|
|
title-mode="default"
|
|
title-mode="default"
|
|
|
title-right-text="分享成果"
|
|
title-right-text="分享成果"
|
|
|
class="recipe-item"
|
|
class="recipe-item"
|
|
|
|
|
+ showFarmImage
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
<empty
|
|
<empty
|
|
@@ -49,12 +43,12 @@
|
|
|
import customHeader from "@/components/customHeader.vue";
|
|
import customHeader from "@/components/customHeader.vue";
|
|
|
import FarmInfoCard from "@/components/pageComponents/FarmInfoCard.vue";
|
|
import FarmInfoCard from "@/components/pageComponents/FarmInfoCard.vue";
|
|
|
import StatsBox from "@/components/pageComponents/StatsBox.vue";
|
|
import StatsBox from "@/components/pageComponents/StatsBox.vue";
|
|
|
-import { ref, onMounted } from "vue";
|
|
|
|
|
-import { useRoute } from "vue-router";
|
|
|
|
|
|
|
+import { ref, onMounted, computed } from "vue";
|
|
|
|
|
+import { useRoute, useRouter } from "vue-router";
|
|
|
import recordItem from "@/components/recordItem.vue";
|
|
import recordItem from "@/components/recordItem.vue";
|
|
|
import { Empty } from "vant";
|
|
import { Empty } from "vant";
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
-
|
|
|
|
|
|
|
+const router = useRouter();
|
|
|
const farmIdVal = ref(null);
|
|
const farmIdVal = ref(null);
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
farmIdVal.value = route.query.farmId;
|
|
farmIdVal.value = route.query.farmId;
|
|
@@ -70,6 +64,18 @@ const getFarmDetail = () => {
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
+// 计算属性,确保数据符合 FarmInfoCard 的验证要求
|
|
|
|
|
+const farmInfoData = computed(() => {
|
|
|
|
|
+ return {
|
|
|
|
|
+ farmName: farmDetail.value.name || '',
|
|
|
|
|
+ area: (farmDetail.value.mianji ? farmDetail.value.mianji + '亩' : ''),
|
|
|
|
|
+ variety: farmDetail.value.typeName || '',
|
|
|
|
|
+ address: farmDetail.value.address || '',
|
|
|
|
|
+ mapImage: '/map.png',
|
|
|
|
|
+ maxWidth: '58px',
|
|
|
|
|
+ };
|
|
|
|
|
+});
|
|
|
|
|
+
|
|
|
const serviceStatsData = ref([]);
|
|
const serviceStatsData = ref([]);
|
|
|
const getFarmPastServiceCost = () => {
|
|
const getFarmPastServiceCost = () => {
|
|
|
VE_API.user.getFarmPastServiceCost({ farmId: farmIdVal.value }).then(({ data }) => {
|
|
VE_API.user.getFarmPastServiceCost({ farmId: farmIdVal.value }).then(({ data }) => {
|
|
@@ -93,6 +99,10 @@ const getDetailList = () => {
|
|
|
detailList.value = data || [];
|
|
detailList.value = data || [];
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+const handleClick = (section) => {
|
|
|
|
|
+ router.push(`/review_work?json=${JSON.stringify({id:section.id})}`);
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|