startInteractPopup.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <template>
  2. <popup
  3. v-model:show="showValue"
  4. round
  5. class="start-interact-popup"
  6. teleport="body"
  7. z-index="9999"
  8. >
  9. <div class="popup-content">
  10. <!-- 头部区域 -->
  11. <div class="popup-header">
  12. <img class="expert-logo" src="@/assets/img/home/bird.png" alt="" />
  13. <!-- <img class="expert-logo" :src="popupData?.expertAvatar" alt="" /> -->
  14. <!-- <el-avatar :size="26" :src="popupData?.expertAvatar" /> -->
  15. <div class="expert-info">
  16. <!-- <span>{{ popupData?.expertName || "韦帮稳" }}专家</span> -->
  17. <span>飞鸟</span>
  18. <span class="invite-text">邀请您进行农情互动</span>
  19. </div>
  20. </div>
  21. <div class="popup-tips">为了将农事方案与您的品种匹配,请您录入品种信息</div>
  22. <!-- 标题 -->
  23. <div class="popup-title">农情互动</div>
  24. <!-- 异常信息区域 -->
  25. <div class="abnormal-info">
  26. 完善作物品种以及物候信息,精准匹配种植方案,实现精细化管理
  27. </div>
  28. <!-- 图片区域 -->
  29. <img src="@/assets/img/home/start.png" alt="农事执行图片" class="execute-image" />
  30. <!-- 按钮区域 -->
  31. <div class="popup-buttons">
  32. <div class="btn-executed" @click="handleExecuted">
  33. 开始采集
  34. </div>
  35. </div>
  36. </div>
  37. </popup>
  38. </template>
  39. <script setup>
  40. import { Popup } from "vant";
  41. import { ref } from "vue";
  42. import { useRouter } from "vue-router";
  43. const router = useRouter();
  44. const popupData = ref({
  45. expertName: "",
  46. expertAvatar: "",
  47. });
  48. const showValue = ref(false);
  49. // 开始采集
  50. const handleExecuted = () => {
  51. showValue.value = false;
  52. router.push("/interaction?subjectId=" + localStorage.getItem("selectedFarmId"));
  53. };
  54. const getPhenologyInitOrConfirmStatus = async () => {
  55. const { data } = await VE_API.farm_v3.phenologyInitOrConfirmStatus({ subjectId: localStorage.getItem("selectedFarmId") });
  56. if (!data?.farms ||!data.farms.length) {
  57. // showValue.value = false;
  58. return;
  59. }
  60. popupData.value = data.farms[0];
  61. showValue.value = true;
  62. }
  63. defineExpose({
  64. getPhenologyInitOrConfirmStatus,
  65. });
  66. </script>
  67. <style scoped lang="scss">
  68. .start-interact-popup {
  69. width: 100%;
  70. padding: 13px 16px;
  71. border-radius: 12px;
  72. .popup-content {
  73. display: flex;
  74. flex-direction: column;
  75. }
  76. .popup-tips{
  77. color: #000;
  78. font-size: 16px;
  79. margin-bottom: 5px;
  80. }
  81. .popup-header {
  82. margin-bottom: 5px;
  83. display: flex;
  84. align-items: center;
  85. gap: 6px;
  86. .expert-logo {
  87. width: 22px;
  88. height: 22px;
  89. border-radius: 50%;
  90. object-fit: cover;
  91. }
  92. .expert-info {
  93. font-size: 12px;
  94. color: #000;
  95. .invite-text {
  96. margin-left: 6px;
  97. color: rgba(0, 0, 0, 0.4);
  98. }
  99. }
  100. }
  101. .popup-title {
  102. font-size: 24px;
  103. margin-bottom: 6px;
  104. font-family: "PangMenZhengDao";
  105. color: #0785E8;
  106. }
  107. .abnormal-info {
  108. padding: 12px;
  109. color: #2199f8;
  110. background: rgba(33, 153, 248, 0.1);
  111. padding: 3px 9px 9px;
  112. border-radius: 8px;
  113. position: relative;
  114. margin-top: 5px;
  115. // 三角形小尖尖
  116. &::before {
  117. content: "";
  118. position: absolute;
  119. top: -7.5px;
  120. left: 20px;
  121. width: 0;
  122. height: 0;
  123. border-left: 15px solid transparent;
  124. border-right: 2px solid transparent;
  125. border-bottom: 8px solid rgba(33, 153, 248, 0.1);
  126. }
  127. }
  128. .execute-image {
  129. width: 100%;
  130. height: 170px;
  131. border-radius: 5px;
  132. object-fit: cover;
  133. margin: 11px 0 13px 0;
  134. }
  135. .popup-buttons {
  136. display: flex;
  137. gap: 13px;
  138. .btn-later,
  139. .btn-executed {
  140. flex: 1;
  141. padding: 8px;
  142. border-radius: 4px;
  143. font-size: 16px;
  144. text-align: center;
  145. }
  146. .btn-later {
  147. border: 1px solid #d7d7d7;
  148. color: #9d9d9d;
  149. }
  150. .btn-executed {
  151. background: #2199f8;
  152. color: #ffffff;
  153. border: 1px solid #2199f8;
  154. }
  155. }
  156. }
  157. </style>