|
|
@@ -0,0 +1,337 @@
|
|
|
+<template>
|
|
|
+ <div class="soil-sense-page">
|
|
|
+ <custom-header name="土壤感知" :isGoBack="true" @goback="handleBack" />
|
|
|
+ <div class="soil-sense-body">
|
|
|
+ <div class="soil-hero">
|
|
|
+ <div class="soil-hero__top">
|
|
|
+ <div class="soil-hero__main">
|
|
|
+ <div class="soil-hero__title-row">
|
|
|
+ <span class="soil-hero__title">{{ theme }}</span>
|
|
|
+ <span class="soil-hero__tag soil-hero__tag--level">
|
|
|
+ <el-icon><BellFilled /></el-icon>
|
|
|
+ {{ level }}
|
|
|
+ </span>
|
|
|
+ <span class="soil-hero__tag soil-hero__tag--zone">{{ zoneName }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="soil-hero__reason">{{ subtitle }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="soil-hero__share" @click="handleShare">
|
|
|
+ <Icon name="share" />
|
|
|
+ <span>{{ t("agriFile.forward") }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-for="(block, index) in soilBlocks"
|
|
|
+ :key="block.key"
|
|
|
+ class="soil-main"
|
|
|
+ :class="{ 'soil-main--follow': index > 0 }"
|
|
|
+ >
|
|
|
+ <div class="soil-section-title">
|
|
|
+ <img class="soil-section-title__icon" src="@/assets/img/report/qust-icon.png" alt="" />
|
|
|
+ <span>{{ block.title }}</span>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="interact-box">
|
|
|
+ <div class="interact-box__head">
|
|
|
+ <span class="interact-box__badge">{{ t("agriFile.interactQuestion") }}</span>
|
|
|
+ <span class="interact-box__question">{{ block.question }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="interact-box__options">
|
|
|
+ <div
|
|
|
+ v-for="item in block.options"
|
|
|
+ :key="item.id"
|
|
|
+ class="soil-option"
|
|
|
+ :class="{ selected: block.selectedId === item.id }"
|
|
|
+ @click="block.selectedId = item.id"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="guide-block">
|
|
|
+ <div class="guide-title">{{ t("agriFile.patrolGuide") }}</div>
|
|
|
+ <photo-provider :photo-closable="true">
|
|
|
+ <photo-consumer :src="block.guideImage">
|
|
|
+ <img class="guide-block__img" :src="block.guideImage" alt="" />
|
|
|
+ </photo-consumer>
|
|
|
+ </photo-provider>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref } from "vue";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
+import { Icon } from "vant";
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
+import { BellFilled } from "@element-plus/icons-vue";
|
|
|
+import customHeader from "@/components/customHeader.vue";
|
|
|
+import { useI18n } from "@/i18n";
|
|
|
+
|
|
|
+const { t } = useI18n();
|
|
|
+const router = useRouter();
|
|
|
+
|
|
|
+const theme = ref(t("agriFile.interactTheme"));
|
|
|
+const subtitle = ref("互动小标题");
|
|
|
+const level = ref(t("agriFile.riskLevel2"));
|
|
|
+const zoneName = ref(t("agriFile.zoneOne"));
|
|
|
+const defaultGuideImage = require("@/assets/img/agricultural/patrol-guide.png");
|
|
|
+
|
|
|
+/** 土壤感知模块:后续可替换为接口 */
|
|
|
+const soilBlocks = ref([
|
|
|
+ {
|
|
|
+ key: "texture",
|
|
|
+ title: "土壤质地判断",
|
|
|
+ question: "请选择您的土壤质地",
|
|
|
+ selectedId: 2,
|
|
|
+ guideImage: defaultGuideImage,
|
|
|
+ options: [
|
|
|
+ { id: 1, name: "砂土" },
|
|
|
+ { id: 2, name: "砂壤土" },
|
|
|
+ { id: 3, name: "壤土" },
|
|
|
+ { id: 4, name: "黏壤土" },
|
|
|
+ { id: 5, name: "黏土" }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: "ph",
|
|
|
+ title: "土壤酸碱度判断",
|
|
|
+ question: "请选择您的土壤酸碱度",
|
|
|
+ selectedId: 2,
|
|
|
+ guideImage: defaultGuideImage,
|
|
|
+ options: [
|
|
|
+ { id: 1, name: "过酸" },
|
|
|
+ { id: 2, name: "弱酸" },
|
|
|
+ { id: 3, name: "中性" },
|
|
|
+ { id: 4, name: "弱碱性" },
|
|
|
+ { id: 5, name: "过碱" }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+]);
|
|
|
+
|
|
|
+const handleBack = () => {
|
|
|
+ router.back();
|
|
|
+};
|
|
|
+
|
|
|
+const handleShare = () => {
|
|
|
+ ElMessage.info(t("agriFile.forwardTip"));
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.soil-sense-page {
|
|
|
+ width: 100%;
|
|
|
+ height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ background: #f5f5f5;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ .soil-sense-body {
|
|
|
+ flex: 1;
|
|
|
+ overflow-y: auto;
|
|
|
+ -webkit-overflow-scrolling: touch;
|
|
|
+ padding-bottom: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .soil-hero {
|
|
|
+ padding: 18px 10px 38px;
|
|
|
+ background: #2199f8;
|
|
|
+ color: #fff;
|
|
|
+
|
|
|
+ &__top {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__title-row {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__title {
|
|
|
+ font-size: 28px;
|
|
|
+ font-family: "PangMenZhengDao", "pangmenzhengdao", sans-serif;
|
|
|
+ margin-top: -5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__reason {
|
|
|
+ margin-top: 10px;
|
|
|
+ padding: 4px 10px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 100%);
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__tag {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 4px;
|
|
|
+ padding: 1px 4px;
|
|
|
+ border-radius: 2px;
|
|
|
+ background: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__tag--level {
|
|
|
+ color: #ff6a6a;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__tag--zone {
|
|
|
+ color: #2199f8;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__share {
|
|
|
+ flex: none;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 4px;
|
|
|
+ padding: 4px 14px;
|
|
|
+ border-radius: 25px;
|
|
|
+ background: rgba(19, 125, 209, 0.5);
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .soil-main {
|
|
|
+ position: relative;
|
|
|
+ z-index: 1;
|
|
|
+ margin: -24px 10px 0;
|
|
|
+ padding: 14px 12px 16px;
|
|
|
+ border-radius: 10px;
|
|
|
+ background: #fff;
|
|
|
+
|
|
|
+ &--follow {
|
|
|
+ margin: 10px 10px 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .soil-section-title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ gap: 6px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ border-bottom: 1px solid rgba(0, 0, 0, 0.08);
|
|
|
+ color: #2199f8;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+
|
|
|
+ &__icon {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .interact-box {
|
|
|
+ padding: 12px;
|
|
|
+ border-radius: 8px;
|
|
|
+ background: rgba(33, 153, 248, 0.1);
|
|
|
+
|
|
|
+ &__head {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ gap: 8px;
|
|
|
+ margin-bottom: 12px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__badge {
|
|
|
+ display: inline-flex;
|
|
|
+ align-items: center;
|
|
|
+ padding: 2px 8px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #2199f8;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
+ line-height: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__question {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #1d2129;
|
|
|
+ }
|
|
|
+
|
|
|
+ &__options {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(3, 1fr);
|
|
|
+ gap: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .soil-option {
|
|
|
+ position: relative;
|
|
|
+ height: 36px;
|
|
|
+ line-height: 36px;
|
|
|
+ text-align: center;
|
|
|
+ border-radius: 6px;
|
|
|
+ background: #fff;
|
|
|
+ border: 1px solid transparent;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #666;
|
|
|
+ box-sizing: border-box;
|
|
|
+
|
|
|
+ &.selected {
|
|
|
+ color: #2199f8;
|
|
|
+ border-color: #2199f8;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ top: -1px;
|
|
|
+ right: -1px;
|
|
|
+ width: 18px;
|
|
|
+ height: 14px;
|
|
|
+ background: url("@/assets/img/home/checked-bg-top.png") no-repeat bottom right / 18px 13px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .guide-block {
|
|
|
+ margin-top: 10px;
|
|
|
+ border: 1px solid rgba(33, 153, 248, 0.2);
|
|
|
+ background: linear-gradient(360deg, #FFFFFF 90.33%, #ABD8FC 116.61%, #2199F8 148.55%);
|
|
|
+ border-radius: 8px;
|
|
|
+ padding: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .guide-title {
|
|
|
+ position: relative;
|
|
|
+ z-index: 1;
|
|
|
+ display: inline-block;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #1d2129;
|
|
|
+
|
|
|
+ &::after {
|
|
|
+ content: "";
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ bottom: 2px;
|
|
|
+ z-index: -1;
|
|
|
+ width: 90px;
|
|
|
+ height: 6px;
|
|
|
+ border-radius: 25px;
|
|
|
+ background: linear-gradient(90deg, #2199f8 0%, rgba(255, 255, 255, 0.37) 100%);
|
|
|
+ opacity: 0.4;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .guide-block__img {
|
|
|
+ display: block;
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 8px;
|
|
|
+ border-radius: 8px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|