|
@@ -5,11 +5,14 @@
|
|
|
<div class="weather-mask" v-show="isExpanded"></div>
|
|
<div class="weather-mask" v-show="isExpanded"></div>
|
|
|
<!-- 天气 -->
|
|
<!-- 天气 -->
|
|
|
<weather-info class="weather-info" @weatherExpanded="weatherExpanded" :isGarden="false"></weather-info>
|
|
<weather-info class="weather-info" @weatherExpanded="weatherExpanded" :isGarden="false"></weather-info>
|
|
|
- <div class="farm-monitor-container">
|
|
|
|
|
|
|
+ <div class="farm-monitor-container" :class="{ 'container-role': curRole == 2 }">
|
|
|
<div class="farm-monitor-left" @click="handleCardClick(monitorCards.left)">
|
|
<div class="farm-monitor-left" @click="handleCardClick(monitorCards.left)">
|
|
|
- <div class="title">{{ monitorCards.left.title }}</div>
|
|
|
|
|
|
|
+ <div class="title">
|
|
|
|
|
+ <span>{{ monitorCards.left.title }}</span>
|
|
|
|
|
+ <el-icon v-if="curRole == 2" class="icon"><ArrowRightBold /></el-icon>
|
|
|
|
|
+ </div>
|
|
|
<div class="content">{{ monitorCards.left.content }}</div>
|
|
<div class="content">{{ monitorCards.left.content }}</div>
|
|
|
- <div class="arrow">
|
|
|
|
|
|
|
+ <div class="arrow" v-if="curRole != 2">
|
|
|
<el-icon class="icon"><ArrowRightBold /></el-icon>
|
|
<el-icon class="icon"><ArrowRightBold /></el-icon>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -34,17 +37,19 @@
|
|
|
<!-- 创建农场弹窗 -->
|
|
<!-- 创建农场弹窗 -->
|
|
|
<popup v-model:show="showFarmPopup" round class="create-farm-popup">
|
|
<popup v-model:show="showFarmPopup" round class="create-farm-popup">
|
|
|
<template v-if="farmPopupType === 'create'">
|
|
<template v-if="farmPopupType === 'create'">
|
|
|
- <img class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
|
|
|
|
|
|
|
+ <img class="create-farm-icon" src="@/assets/img/home/create-farm-icon.png" alt="" />
|
|
|
<div class="create-farm-text">
|
|
<div class="create-farm-text">
|
|
|
<div>您当前还没有农场</div>
|
|
<div>您当前还没有农场</div>
|
|
|
<div>请先创建农场</div>
|
|
<div>请先创建农场</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else>
|
|
<template v-else>
|
|
|
- <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="">
|
|
|
|
|
|
|
+ <img class="farm-check-icon" src="@/assets/img/home/right.png" alt="" />
|
|
|
<div class="create-farm-text success-text">农场创建成功</div>
|
|
<div class="create-farm-text success-text">农场创建成功</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <div class="create-farm-btn" @click="handleBtn">{{ farmPopupType === 'create' ? '去创建农场' : '我知道了' }}</div>
|
|
|
|
|
|
|
+ <div class="create-farm-btn" @click="handleBtn">
|
|
|
|
|
+ {{ farmPopupType === "create" ? "去创建农场" : "我知道了" }}
|
|
|
|
|
+ </div>
|
|
|
</popup>
|
|
</popup>
|
|
|
<!-- 问题提醒 -->
|
|
<!-- 问题提醒 -->
|
|
|
<problem-reminder></problem-reminder>
|
|
<problem-reminder></problem-reminder>
|
|
@@ -59,7 +64,9 @@ import AgriculturalDynamics from "./components/AgriculturalDynamics.vue";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import wx from "weixin-js-sdk";
|
|
import wx from "weixin-js-sdk";
|
|
|
import problemReminder from "./components/problemReminder.vue";
|
|
import problemReminder from "./components/problemReminder.vue";
|
|
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
|
|
|
|
|
|
+const curRole = localStorage.getItem("SET_USER_CUR_ROLE");
|
|
|
const store = useStore();
|
|
const store = useStore();
|
|
|
const tabBarHeight = computed(() => store.state.home.tabBarHeight);
|
|
const tabBarHeight = computed(() => store.state.home.tabBarHeight);
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
@@ -92,46 +99,64 @@ const monitorCards = ref({
|
|
|
// 卡片点击事件
|
|
// 卡片点击事件
|
|
|
const handleCardClick = (card) => {
|
|
const handleCardClick = (card) => {
|
|
|
// showFarmPopup.value = true;
|
|
// showFarmPopup.value = true;
|
|
|
- if(card.route === "/pest"){
|
|
|
|
|
- const dropdownGardenItem = ref({
|
|
|
|
|
- organId:766,
|
|
|
|
|
- periodId:1,
|
|
|
|
|
- wktVal:'wktVal',
|
|
|
|
|
- address:'address',
|
|
|
|
|
- district:'district',
|
|
|
|
|
- name:'荔博园',
|
|
|
|
|
- });
|
|
|
|
|
- wx.miniProgram.navigateTo({
|
|
|
|
|
- url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
|
|
|
|
|
- });
|
|
|
|
|
- }else{
|
|
|
|
|
- if(card.route === "/chat_frame"){
|
|
|
|
|
- router.push(`/chat_frame?userId=91754&name=专家1`);
|
|
|
|
|
|
|
+ if (card.route === "/pest") {
|
|
|
|
|
+ if(curRole == 2){
|
|
|
|
|
+ ElMessage.warning("该功能正在升级中,敬请期待");
|
|
|
}else{
|
|
}else{
|
|
|
|
|
+ const dropdownGardenItem = ref({
|
|
|
|
|
+ organId: 766,
|
|
|
|
|
+ periodId: 1,
|
|
|
|
|
+ wktVal: "wktVal",
|
|
|
|
|
+ address: "address",
|
|
|
|
|
+ district: "district",
|
|
|
|
|
+ name: "荔博园",
|
|
|
|
|
+ });
|
|
|
|
|
+ wx.miniProgram.navigateTo({
|
|
|
|
|
+ url: `/pages/subPages/new_recognize/index?gardenData=${JSON.stringify(dropdownGardenItem.value)}`,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (card.route === "/chat_frame") {
|
|
|
|
|
+ router.push(`/chat_frame?userId=91754&name=专家1`);
|
|
|
|
|
+ } else {
|
|
|
router.push(card.route);
|
|
router.push(card.route);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const handleBtn = () => {
|
|
const handleBtn = () => {
|
|
|
- if(farmPopupType.value === 'create'){
|
|
|
|
|
|
|
+ if (farmPopupType.value === "create") {
|
|
|
router.push("/create_farm?isReload=true&from=home");
|
|
router.push("/create_farm?isReload=true&from=home");
|
|
|
}
|
|
}
|
|
|
showFarmPopup.value = false;
|
|
showFarmPopup.value = false;
|
|
|
-}
|
|
|
|
|
|
|
+};
|
|
|
|
|
|
|
|
onActivated(() => {
|
|
onActivated(() => {
|
|
|
// 检测是否从创建农场页面成功返回
|
|
// 检测是否从创建农场页面成功返回
|
|
|
- if (route.query.showSuccess === 'true') {
|
|
|
|
|
- farmPopupType.value = 'success';
|
|
|
|
|
|
|
+ if (route.query.showSuccess === "true") {
|
|
|
|
|
+ farmPopupType.value = "success";
|
|
|
showFarmPopup.value = true;
|
|
showFarmPopup.value = true;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 清除URL参数,避免刷新页面时再次显示弹窗
|
|
// 清除URL参数,避免刷新页面时再次显示弹窗
|
|
|
- router.replace({
|
|
|
|
|
- path: '/home',
|
|
|
|
|
- query: { reload: route.query.reload }
|
|
|
|
|
|
|
+ router.replace({
|
|
|
|
|
+ path: "/home",
|
|
|
|
|
+ query: { reload: route.query.reload },
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
+ if (curRole == 2) {
|
|
|
|
|
+ monitorCards.value.left = {
|
|
|
|
|
+ title: "新增客户",
|
|
|
|
|
+ content: "实时监测农场状态",
|
|
|
|
|
+ route: "/create_farm?type=client&isReload=true&from=home",
|
|
|
|
|
+ };
|
|
|
|
|
+ monitorCards.value.right = [
|
|
|
|
|
+ {
|
|
|
|
|
+ title: "病虫识别",
|
|
|
|
|
+ content: "精准识别病虫",
|
|
|
|
|
+ route: "/pest",
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const isExpanded = ref(false);
|
|
const isExpanded = ref(false);
|
|
@@ -230,6 +255,18 @@ const weatherExpanded = (isExpandedValue) => {
|
|
|
background: url("@/assets/img/home/farm-bg-3.png") no-repeat center center / 100% 100%;
|
|
background: url("@/assets/img/home/farm-bg-3.png") no-repeat center center / 100% 100%;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ &.container-role{
|
|
|
|
|
+ height: 104px;
|
|
|
|
|
+ .farm-monitor-left{
|
|
|
|
|
+ background: url("@/assets/img/home/farm-bg-4.png") no-repeat center center / 100% 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ .farm-monitor-right {
|
|
|
|
|
+ .right-item {
|
|
|
|
|
+ background: url("@/assets/img/home/farm-bg-5.png") no-repeat center center / 100% 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
.create-farm-popup {
|
|
.create-farm-popup {
|
|
@@ -239,33 +276,33 @@ const weatherExpanded = (isExpandedValue) => {
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
- .create-farm-icon{
|
|
|
|
|
|
|
+ .create-farm-icon {
|
|
|
width: 40px;
|
|
width: 40px;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
|
}
|
|
}
|
|
|
- .farm-check-icon{
|
|
|
|
|
|
|
+ .farm-check-icon {
|
|
|
width: 68px;
|
|
width: 68px;
|
|
|
height: 68px;
|
|
height: 68px;
|
|
|
margin-bottom: 12px;
|
|
margin-bottom: 12px;
|
|
|
}
|
|
}
|
|
|
- .create-farm-text{
|
|
|
|
|
|
|
+ .create-farm-text {
|
|
|
font-size: 18px;
|
|
font-size: 18px;
|
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
|
margin-bottom: 32px;
|
|
margin-bottom: 32px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
- &.success-text{
|
|
|
|
|
|
|
+ &.success-text {
|
|
|
font-size: 23px;
|
|
font-size: 23px;
|
|
|
font-weight: 400;
|
|
font-weight: 400;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- .create-farm-btn{
|
|
|
|
|
|
|
+ .create-farm-btn {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
|
padding: 8px;
|
|
padding: 8px;
|
|
|
border-radius: 25px;
|
|
border-radius: 25px;
|
|
|
font-size: 16px;
|
|
font-size: 16px;
|
|
|
- background: #2199F8;
|
|
|
|
|
|
|
+ background: #2199f8;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
}
|
|
}
|