diagnosisReport.vue 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348
  1. <template>
  2. <div
  3. class="diagnosis-report-page"
  4. :class="{ 'is-from-share': isFromShare }"
  5. v-loading="loading"
  6. element-loading-background="rgba(15, 15, 15, 0.55)"
  7. >
  8. <custom-header
  9. v-if="isFromShare"
  10. name="种植全析"
  11. :showHome="true"
  12. :isGoBack="false"
  13. />
  14. <div class="page-content">
  15. <div v-if="reportGenerating" class="report-progress">
  16. <div class="report-progress__content">
  17. <div>
  18. <el-progress :percentage="progressPercent" :stroke-width="15" :duration="30" status="warning"
  19. striped striped-flow />
  20. </div>
  21. <div class="report-progress__desc">
  22. 依据您的定位和作物品类,
  23. <div>正在生成专属报告,预计耗时2分钟...</div>
  24. </div>
  25. </div>
  26. </div>
  27. <template v-else>
  28. <div class="diagnosis-header">
  29. <div class="header-share" @click="handleShare">
  30. <Icon name="share" color="rgba(255,255,255,0.85)" />
  31. <span>转发</span>
  32. </div>
  33. <div class="diagnosis-header__title-row">
  34. <div class="diagnosis-header__title">
  35. <div>一份报告</div>
  36. <div>看懂你的农场</div>
  37. </div>
  38. <!-- <img class="diagnosis-header__icon" src="@/assets/img/report/star.png" alt="" /> -->
  39. </div>
  40. <div class="diagnosis-header__desc">{{ headerDesc }}</div>
  41. <!-- <div class="diagnosis-header__base">{{ headerBase }}</div> -->
  42. </div>
  43. <div class="diagnosis-content">
  44. <div class="variety-bar">
  45. <div class="variety-bar__tags">
  46. <div
  47. v-for="item in zoneList"
  48. :key="item.zone_id"
  49. class="variety-bar__tag"
  50. :class="{ active: String(item.zone_id) === String(selectedZoneId) }"
  51. @click="handleSelectZone(item)"
  52. >
  53. {{ item.zone_name }}
  54. </div>
  55. </div>
  56. <div class="variety-bar__add" @click="goAddVariety">
  57. <el-icon>
  58. <Plus />
  59. </el-icon>
  60. <span>新增品种</span>
  61. </div>
  62. </div>
  63. <div class="base-data">
  64. <!-- <div class="base-data__title">
  65. <span class="title-dot"></span>
  66. <span>基本信息</span>
  67. </div> -->
  68. <div class="base-data__body">
  69. <div v-if="!loading && !baseInfoList.length" class="base-data__empty">暂无基本信息</div>
  70. <div v-for="item in baseInfoList" :key="item.key" class="base-info-item">
  71. <div class="base-info-item__row">
  72. <span class="base-info-item__label">{{ item.label }}</span>
  73. <span class="base-info-item__value">{{ item.value }}</span>
  74. <!-- <span v-if="item.actionInline" class="base-info-action"
  75. @click="handleBaseAction(item.actionInline.key)">
  76. {{ item.actionInline.text }}
  77. <el-icon><Edit /></el-icon>
  78. </span> -->
  79. </div>
  80. <!-- <div v-if="item.actionBlock" class="base-info-action base-info-action--block"
  81. @click="handleBaseAction(item.actionBlock.key)">
  82. {{ item.actionBlock.text }}
  83. <el-icon><Edit /></el-icon>
  84. </div> -->
  85. </div>
  86. </div>
  87. </div>
  88. <div class="report-module">
  89. <div class="report-tabs">
  90. <div v-for="tab in reportTabs" :key="tab.key" class="report-tabs__item"
  91. :class="{ active: tab.key === activeReportTab }" @click="activeReportTab = tab.key">
  92. {{ tab.label }}
  93. </div>
  94. </div>
  95. <div class="report-panel">
  96. <template v-if="activeModule">
  97. <div v-if="activeModule.lead" class="core-card">
  98. <div class="core-card__head">
  99. <img class="core-card__star" src="@/assets/img/home/start-icon.png" alt="" />
  100. <span>核心结论</span>
  101. </div>
  102. <div class="core-card__body">{{ activeModule.lead }}</div>
  103. </div>
  104. <div v-for="(block, bi) in activeModule.blocks" :key="`${block.no}-${bi}`"
  105. class="point-block" :class="`point-block--s${bi % 3}`">
  106. <div class="point-block__head">
  107. <span class="point-block__no">{{ block.no }}</span>
  108. <span class="point-block__title">{{ block.title }}</span>
  109. </div>
  110. <div v-if="block.sub?.length" class="point-block__card">
  111. <div v-for="(sub, si) in block.sub" :key="`${bi}-${si}`" class="point-sub">
  112. <!-- 样式 0:金色描边标签 -->
  113. <template v-if="bi % 3 === 0">
  114. <span class="point-sub__badge">{{ sub.title }}</span>
  115. <div class="point-sub__text">{{ sub.text }}</div>
  116. </template>
  117. <!-- 样式 1:纯白标题 -->
  118. <template v-else-if="bi % 3 === 1">
  119. <div class="point-sub__plain">{{ sub.title }}</div>
  120. <div class="point-sub__text">{{ sub.text }}</div>
  121. </template>
  122. <!-- 样式 2:图标 + 标题 -->
  123. <template v-else>
  124. <div class="point-sub__icon-row">
  125. <span class="point-sub__icon">
  126. <el-icon size="16">
  127. <List />
  128. </el-icon>
  129. </span>
  130. <span class="point-sub__icon-title">{{ sub.title }}</span>
  131. </div>
  132. <div class="point-sub__text">{{ sub.text }}</div>
  133. </template>
  134. </div>
  135. </div>
  136. </div>
  137. </template>
  138. <div v-else class="report-panel__empty">暂无报告内容</div>
  139. </div>
  140. </div>
  141. </div>
  142. </template>
  143. </div>
  144. <adjustPhenologyPopup ref="adjustPhenologyPopupRef" @confirm="handlePhenologyConfirm" />
  145. <restingDatePopup ref="restingDatePopupRef" @confirm="handleRestingDateConfirm"
  146. @switchGrowing="handleSwitchGrowing" />
  147. <editPlantPointPopup ref="editPlantPointPopupRef" @confirm="handlePlantPointConfirm" />
  148. <!-- 暂无农场时不弹「完善农场信息」,逻辑保留备用
  149. <complete-farm-info-popup
  150. v-model:show="showCompleteFarmPopup"
  151. :image="completeFarmPopupImage"
  152. highlight-text="种植全析报告"
  153. @confirm="goCompleteFarmInfo"
  154. />
  155. -->
  156. <restore-planting-popup />
  157. </div>
  158. </template>
  159. <script setup>
  160. import { computed, onActivated, onDeactivated, onBeforeUnmount, ref } from "vue";
  161. import { useRoute, useRouter } from "vue-router";
  162. import { Icon } from "vant";
  163. // import { useStore } from "vuex";
  164. import { ElMessage } from "element-plus";
  165. import { Plus, Edit, List } from "@element-plus/icons-vue";
  166. import adjustPhenologyPopup from "../components/adjustPhenologyPopup.vue";
  167. import restingDatePopup from "../components/restingDatePopup.vue";
  168. import editPlantPointPopup from "../components/editPlantPointPopup.vue";
  169. // import completeFarmInfoPopup from "@/components/popup/completeFarmInfoPopup.vue";
  170. // import completeFarmPopupImage from "@/assets/img/common/empty-bg-3.png";
  171. import restorePlantingPopup from "@/components/popup/restorePlantingPopup.vue";
  172. import customHeader from "@/components/customHeader.vue";
  173. import { ensureFarmContext } from "@/utils/selectedFarm";
  174. import wx from "weixin-js-sdk";
  175. // ---------------------------------------------------------------------------
  176. // Props / Emits — 无
  177. // ---------------------------------------------------------------------------
  178. const route = useRoute();
  179. const router = useRouter();
  180. // const store = useStore();
  181. // ---------------------------------------------------------------------------
  182. // 常量
  183. // ---------------------------------------------------------------------------
  184. /** 报告未生成时轮询间隔(ms) */
  185. const REPORT_POLL_INTERVAL = 6000;
  186. /** exists=0 时进度条走满的模拟时长 */
  187. const PROGRESS_DURATION_MS = 2 * 60 * 1000;
  188. /** 按农场记进度;切页回来从该农场上次百分比接着走 */
  189. const PROGRESS_STORAGE_KEY = "DIAGNOSIS_REPORT_PROGRESS";
  190. const PROGRESS_MIN = 10;
  191. const PROGRESS_CAP = 99;
  192. const PROGRESS_NO_FARM_KEY = "nofarm";
  193. /** 无农场时默认作物编码:水稻 */
  194. const NO_FARM_CROP = "PAD";
  195. /** 无定位时的默认点位(与录入页一致) */
  196. const DEFAULT_POINT = "POINT(113.6142086995688 23.585836479509055)";
  197. /** 报告分模块:tab 文案取自各 module JSON 的 tab 字段 */
  198. const MODULE_DEFS = [
  199. { key: "weather", field: "module2_weather", fallbackLabel: "关键物候风险" },
  200. { key: "pest", field: "module3_pest", fallbackLabel: "病虫害风险" },
  201. { key: "input", field: "module5_input", fallbackLabel: "建议必要投入" },
  202. { key: "quality", field: "module4_quality", fallbackLabel: "潜力品质分析" },
  203. ];
  204. /** rows.label → 基本信息展示 */
  205. const BASE_ROW_LABEL_MAP = {
  206. 物候信息: { key: "phenology", label: "物候信息" },
  207. 物候期: { key: "phenology", label: "物候信息" },
  208. 土壤条件: { key: "soil", label: "土壤条件" },
  209. 地形条件: { key: "terrain", label: "地形条件" },
  210. };
  211. // ---------------------------------------------------------------------------
  212. // 页面状态
  213. // ---------------------------------------------------------------------------
  214. const loading = ref(false); // 接口尚未返回:只转圈,不带文字
  215. const reportGenerating = ref(false); // exists=0:模拟进度条,并继续轮询
  216. const progressPercent = ref(10);
  217. /** 分区列表(getZones) */
  218. const zoneList = ref([]);
  219. const selectedZoneId = ref(null);
  220. const headerDesc = ref("");
  221. const headerBase = ref("");
  222. const baseInfoList = ref([]);
  223. /** key → 解析后的模块对象 { id, tab, lead, blocks } */
  224. const moduleMap = ref({});
  225. const activeReportTab = ref("weather");
  226. const adjustPhenologyPopupRef = ref(null);
  227. const restingDatePopupRef = ref(null);
  228. const editPlantPointPopupRef = ref(null);
  229. // const showCompleteFarmPopup = ref(false); // 无农场时展示「完善农场信息」
  230. let pollTimer = null;
  231. let progressTimer = null;
  232. /** 当前进度条绑定的农场 key,切页时按它写回缓存 */
  233. let progressFarmKey = "";
  234. /** 当前轮询方式:farm | latlon */
  235. let pollMode = null;
  236. let pollParams = null;
  237. /** 离开页面或重新拉取时作废尚未结束的完成动画 */
  238. let viewToken = 0;
  239. // ---------------------------------------------------------------------------
  240. // 计算属性
  241. // ---------------------------------------------------------------------------
  242. const pageParams = computed(() => resolvePageParams());
  243. /** 通过分享进入:顶栏小房子回首页,且 App 侧隐藏底部菜单 */
  244. const isFromShare = computed(() => isTruthyFlag(pageParams.value?.fromShare));
  245. const shareFarmId = computed(
  246. () => pageParams.value.farm_id || pageParams.value.farmId || "",
  247. );
  248. const shareZoneId = computed(
  249. () => pageParams.value.zone_id || pageParams.value.zoneId || "",
  250. );
  251. const reportTabs = computed(() =>
  252. MODULE_DEFS.map((def) => {
  253. const mod = moduleMap.value[def.key];
  254. if (!mod) return null;
  255. return {
  256. key: def.key,
  257. label: mod.tab || def.fallbackLabel,
  258. };
  259. }).filter(Boolean),
  260. );
  261. const activeModule = computed(() => moduleMap.value[activeReportTab.value] || null);
  262. // ---------------------------------------------------------------------------
  263. // 工具函数
  264. // ---------------------------------------------------------------------------
  265. function isTruthyFlag(value) {
  266. return value === 1 || value === "1" || value === true || value === "true";
  267. }
  268. function parseMaybeJson(value) {
  269. if (value == null || value === "") return null;
  270. if (typeof value === "object") return value;
  271. try {
  272. return JSON.parse(value);
  273. } catch {
  274. return null;
  275. }
  276. }
  277. /**
  278. * 分享链路:dev_login 把整份登录 query 塞进 miniJson,
  279. * 真正的页面参数在 miniJson.paramsPage(farm_id / zone_id / fromShare)
  280. */
  281. function resolvePageParams() {
  282. const mini = parseMaybeJson(route.query.miniJson);
  283. if (mini) {
  284. const page = parseMaybeJson(mini.paramsPage) || {};
  285. return { ...mini, ...page };
  286. }
  287. const paramsPage = parseMaybeJson(route.query.paramsPage);
  288. if (paramsPage) {
  289. return { ...route.query, ...paramsPage };
  290. }
  291. return { ...(route.query || {}) };
  292. }
  293. function getSelectedFarm() {
  294. try {
  295. return JSON.parse(localStorage.getItem("selectedFarmData") || "{}");
  296. } catch {
  297. return {};
  298. }
  299. }
  300. /** 与 diagnosisReportPopup 同源:标记该农场/分区弹窗已读 */
  301. const DIAGNOSIS_POPUP_SHOWN_PREFIX = "DIAGNOSIS_REPORT_POPUP_SHOWN_";
  302. function markDiagnosisPopupShown(farmId, zoneId) {
  303. if (farmId == null || farmId === "") return;
  304. const key = `${DIAGNOSIS_POPUP_SHOWN_PREFIX}${farmId}_${zoneId ?? ""}`;
  305. localStorage.setItem(key, "1");
  306. }
  307. /** 无农场报告用点位:优先用户定位 */
  308. function getPointText() {
  309. return localStorage.getItem("MINI_USER_LOCATION_POINT") || DEFAULT_POINT;
  310. }
  311. /** report6_latlon:有 records[0] 即视为报告已生成 */
  312. function pickLatlonReport(res) {
  313. const records = res?.data?.records;
  314. if (Array.isArray(records) && records.length) return records[0];
  315. return null;
  316. }
  317. /** 模块字段可能是 JSON 字符串或对象 */
  318. function parseModuleJson(raw) {
  319. if (raw == null || raw === "") return null;
  320. if (typeof raw === "object") return raw;
  321. try {
  322. return JSON.parse(raw);
  323. } catch {
  324. return null;
  325. }
  326. }
  327. function normalizeModule(raw) {
  328. const data = parseModuleJson(raw);
  329. if (!data || typeof data !== "object") return null;
  330. const blocks = Array.isArray(data.blocks)
  331. ? data.blocks.map((block) => ({
  332. no: block?.no || "",
  333. title: block?.title || "",
  334. text: block?.text || "",
  335. sub: Array.isArray(block?.sub)
  336. ? block.sub.map((item) => ({
  337. title: item?.title || "",
  338. text: item?.text || "",
  339. }))
  340. : [],
  341. }))
  342. : [];
  343. return {
  344. id: data.id || "",
  345. tab: data.tab || "",
  346. lead: data.lead || "",
  347. blocks,
  348. };
  349. }
  350. function buildBaseInfoList(basic, report = {}) {
  351. const list = [];
  352. const crop = report.crop || "";
  353. const variety = basic?.variety || report.variety || "";
  354. const cropValue = [crop, variety].filter(Boolean).join("-");
  355. list.push({
  356. key: "crop",
  357. label: "种植作物",
  358. value: cropValue || "—",
  359. });
  360. const rows = Array.isArray(basic?.rows) ? basic.rows : [];
  361. rows.forEach((row, index) => {
  362. const labelText = String(row?.label || "").trim();
  363. const meta = BASE_ROW_LABEL_MAP[labelText] || {
  364. key: `row-${index}`,
  365. label: labelText ? `${labelText}:` : "信息:",
  366. };
  367. list.push({
  368. key: meta.key,
  369. label: meta.label,
  370. value: row?.text || "—",
  371. });
  372. });
  373. return list;
  374. }
  375. function applyReportData(report, farm) {
  376. const region = report.region || farm.rawAddress || farm.farm_address || farm.city || "";
  377. const farmName = farm.farm_name || farm.name || "";
  378. headerDesc.value = region ? `${region}的${farmName || "飞鸟智慧农业"}` : "飞鸟智慧农业";
  379. const basic = parseModuleJson(report.module1_basic) || {};
  380. baseInfoList.value = buildBaseInfoList(basic, report);
  381. const nextModules = {};
  382. MODULE_DEFS.forEach((def) => {
  383. const mod = normalizeModule(report[def.field]);
  384. if (mod) nextModules[def.key] = mod;
  385. });
  386. moduleMap.value = nextModules;
  387. const firstTab = MODULE_DEFS.find((def) => nextModules[def.key]);
  388. activeReportTab.value = firstTab?.key || "weather";
  389. }
  390. function resetReportView(farm = {}) {
  391. headerDesc.value = farm.rawAddress || farm.farm_address || farm.city
  392. ? `${farm.rawAddress || farm.farm_address || farm.city}的飞鸟智慧农业`
  393. : "飞鸟智慧农业";
  394. headerBase.value = farm.farm_name || farm.name || "我的基地";
  395. baseInfoList.value = [];
  396. moduleMap.value = {};
  397. }
  398. /** 拉取分区;优先分享 zone_id → 当前选中 → 农场缓存分区 */
  399. async function fetchZoneList(farmId) {
  400. if (farmId == null || farmId === "") {
  401. zoneList.value = [];
  402. selectedZoneId.value = null;
  403. return;
  404. }
  405. try {
  406. const res = await VE_API.questionnaire.getZones({ farm_id: farmId });
  407. const zones = Array.isArray(res?.data?.zones) ? res.data.zones : [];
  408. zoneList.value = zones;
  409. const farm = getSelectedFarm();
  410. const prefer =
  411. shareZoneId.value ||
  412. selectedZoneId.value ||
  413. farm.zone_id ||
  414. farm.zoneId;
  415. const matched = zones.find((z) => String(z.zone_id) === String(prefer));
  416. selectedZoneId.value = (matched || zones[0])?.zone_id ?? null;
  417. } catch (e) {
  418. console.warn("[diagnosisReport] getZones failed", e);
  419. zoneList.value = [];
  420. selectedZoneId.value = null;
  421. }
  422. }
  423. // ---------------------------------------------------------------------------
  424. // 业务逻辑:无农场弹窗 / 加载报告
  425. // ---------------------------------------------------------------------------
  426. /** 无果园信息时展示「完善农场信息」弹窗(暂不启用) */
  427. // async function checkCompleteFarmPopup() {
  428. // const id = getMiniUserId();
  429. // if (!id) {
  430. // showCompleteFarmPopup.value = false;
  431. // return;
  432. // }
  433. // try {
  434. // const res = await VE_API.questionnaire.getFarms({ id });
  435. // const list = Array.isArray(res?.data) ? res.data : [];
  436. // showCompleteFarmPopup.value = list.length === 0;
  437. // } catch (e) {
  438. // console.warn("[diagnosisReport] getFarms failed", e);
  439. // showCompleteFarmPopup.value = false;
  440. // }
  441. // }
  442. function stopReportPolling() {
  443. if (pollTimer) {
  444. clearInterval(pollTimer);
  445. pollTimer = null;
  446. }
  447. pollMode = null;
  448. pollParams = null;
  449. }
  450. function stopProgressTimer() {
  451. if (progressTimer) {
  452. clearInterval(progressTimer);
  453. progressTimer = null;
  454. }
  455. }
  456. /** 有农场用 farm_id;无农场共用 nofarm,避免互相覆盖 */
  457. function resolveProgressFarmKey(farm) {
  458. const farmId = farm?.farm_id ?? farm?.id;
  459. if (farmId != null && farmId !== "") return String(farmId);
  460. return PROGRESS_NO_FARM_KEY;
  461. }
  462. function readProgressStore() {
  463. try {
  464. const raw = JSON.parse(localStorage.getItem(PROGRESS_STORAGE_KEY) || "{}");
  465. return raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
  466. } catch {
  467. return {};
  468. }
  469. }
  470. function readProgressCache(farmKey = progressFarmKey) {
  471. if (!farmKey) return null;
  472. const percent = Number(readProgressStore()[farmKey]);
  473. if (!Number.isFinite(percent)) return null;
  474. return Math.min(PROGRESS_CAP, Math.max(PROGRESS_MIN, Math.floor(percent)));
  475. }
  476. function writeProgressCache(percent, farmKey = progressFarmKey) {
  477. if (!farmKey) return;
  478. const value = Math.min(PROGRESS_CAP, Math.max(PROGRESS_MIN, Math.floor(percent)));
  479. const store = readProgressStore();
  480. store[farmKey] = value;
  481. localStorage.setItem(PROGRESS_STORAGE_KEY, JSON.stringify(store));
  482. }
  483. function clearProgressCache(farmKey = progressFarmKey) {
  484. if (!farmKey) return;
  485. const store = readProgressStore();
  486. if (!(farmKey in store)) return;
  487. delete store[farmKey];
  488. localStorage.setItem(PROGRESS_STORAGE_KEY, JSON.stringify(store));
  489. }
  490. /** 切页时记下当前农场进度,回来不要从头走 */
  491. function saveProgressSnapshot() {
  492. if (!reportGenerating.value || !progressFarmKey) return;
  493. writeProgressCache(progressPercent.value || PROGRESS_MIN, progressFarmKey);
  494. }
  495. /** exists=0 才走进度条;按农场从 10% 或已记下的进度接着走到 99 */
  496. function beginProgress(farm) {
  497. progressFarmKey = resolveProgressFarmKey(farm);
  498. reportGenerating.value = true;
  499. if (progressTimer) return;
  500. const startPercent = readProgressCache(progressFarmKey) ?? PROGRESS_MIN;
  501. progressPercent.value = startPercent;
  502. writeProgressCache(startPercent, progressFarmKey);
  503. const span = PROGRESS_CAP - startPercent;
  504. const remainMs = ((PROGRESS_CAP - PROGRESS_MIN) > 0
  505. ? span / (PROGRESS_CAP - PROGRESS_MIN)
  506. : 0) * PROGRESS_DURATION_MS;
  507. if (remainMs <= 0) return;
  508. const farmKey = progressFarmKey;
  509. const startedAt = Date.now();
  510. progressTimer = setInterval(() => {
  511. const ratio = Math.min((Date.now() - startedAt) / remainMs, 1);
  512. const next = Math.min(PROGRESS_CAP, Math.floor(startPercent + span * ratio));
  513. progressPercent.value = next;
  514. writeProgressCache(next, farmKey);
  515. if (ratio >= 1) stopProgressTimer();
  516. }, 200);
  517. }
  518. /** 进度条进行中才先收到 100;首次就有报告则直接出正文 */
  519. async function revealReport(report, farm, token) {
  520. if (token !== viewToken) return;
  521. stopReportPolling();
  522. const showComplete = reportGenerating.value;
  523. const farmKey = progressFarmKey || resolveProgressFarmKey(farm);
  524. stopProgressTimer();
  525. clearProgressCache(farmKey);
  526. progressFarmKey = "";
  527. if (!showComplete) {
  528. reportGenerating.value = false;
  529. applyReportData(report || {}, farm);
  530. return;
  531. }
  532. progressPercent.value = 100;
  533. await new Promise((resolve) => setTimeout(resolve, 400));
  534. if (token !== viewToken) return;
  535. reportGenerating.value = false;
  536. applyReportData(report || {}, farm);
  537. }
  538. /** 有 exists 时以它为准;没有该字段时看是否已经有报告体 */
  539. function isReportPending(res, report) {
  540. const exists = res?.data?.exists;
  541. if (exists != null && exists !== "") return Number(exists) === 0;
  542. return !report;
  543. }
  544. /** 报告未就绪时保持 loading,并定时重试 */
  545. function startReportPolling(mode, params, token) {
  546. stopReportPolling();
  547. pollMode = mode;
  548. pollParams = params;
  549. pollTimer = setInterval(() => {
  550. if (token !== viewToken) return;
  551. if (pollMode === "farm") {
  552. pollFarmReport(pollParams, token);
  553. } else if (pollMode === "latlon") {
  554. pollLatlonReport(pollParams, token);
  555. }
  556. }, REPORT_POLL_INTERVAL);
  557. }
  558. async function pollFarmReport({ farmId, zoneId }, token) {
  559. try {
  560. const raw = await VE_API.questionnaire.checkReportGenerated({
  561. farm_id: farmId,
  562. zone_id: zoneId,
  563. });
  564. if (token !== viewToken) return;
  565. const res = Array.isArray(raw) ? raw[0] : raw;
  566. const report = res?.data?.report;
  567. if (res?.code === 200 && !isReportPending(res, report)) {
  568. // 进入报告页并拿到数据:标记该农场弹窗已读,避免再弹
  569. markDiagnosisPopupShown(farmId, zoneId);
  570. revealReport(report, getSelectedFarm(), token);
  571. }
  572. } catch (error) {
  573. console.warn("[diagnosisReport] farm poll failed", error);
  574. }
  575. }
  576. async function pollLatlonReport({ pointText, crop }, token) {
  577. try {
  578. const raw = await VE_API.report.report6Latlon({
  579. point_text: pointText,
  580. crop: '水稻',
  581. });
  582. if (token !== viewToken) return;
  583. const res = Array.isArray(raw) ? raw[0] : raw;
  584. const report = pickLatlonReport(res);
  585. if (res?.code === 200 && !isReportPending(res, report)) {
  586. revealReport(report, {}, token);
  587. }
  588. } catch (error) {
  589. console.warn("[diagnosisReport] latlon poll failed", error);
  590. }
  591. }
  592. /** 无农场:按定位点 + 水稻拉取 / 轮询六模块报告 */
  593. async function fetchLatlonReport(token) {
  594. const pointText = getPointText();
  595. const crop = NO_FARM_CROP;
  596. const params = { pointText, crop };
  597. loading.value = true;
  598. try {
  599. const raw = await VE_API.report.report6Latlon({
  600. point_text: pointText,
  601. crop: '水稻',
  602. });
  603. if (token !== viewToken) return;
  604. const res = Array.isArray(raw) ? raw[0] : raw;
  605. const report = pickLatlonReport(res);
  606. if (res?.code === 200 && !isReportPending(res, report)) {
  607. revealReport(report, {}, token);
  608. return;
  609. }
  610. resetReportView({});
  611. beginProgress({});
  612. startReportPolling("latlon", params, token);
  613. } catch (error) {
  614. if (token !== viewToken) return;
  615. console.error("fetchLatlonReport failed", error);
  616. resetReportView({});
  617. reportGenerating.value = false;
  618. stopProgressTimer();
  619. ElMessage.error("报告加载失败");
  620. } finally {
  621. if (token === viewToken) loading.value = false;
  622. }
  623. }
  624. async function fetchFarmReport(farm, token) {
  625. const farmId = farm.farm_id ?? farm.id;
  626. const zoneId = selectedZoneId.value ?? farm.zone_id ?? farm.zoneId;
  627. loading.value = true;
  628. try {
  629. const raw = await VE_API.questionnaire.checkReportGenerated({
  630. farm_id: farmId,
  631. zone_id: zoneId,
  632. });
  633. if (token !== viewToken) return;
  634. const res = Array.isArray(raw) ? raw[0] : raw;
  635. const report = res?.data?.report;
  636. if (res?.code === 200 && !isReportPending(res, report)) {
  637. markDiagnosisPopupShown(farmId, zoneId);
  638. revealReport(report, farm, token);
  639. return;
  640. }
  641. resetReportView(farm);
  642. beginProgress(farm);
  643. startReportPolling("farm", { farmId, zoneId }, token);
  644. } catch (error) {
  645. if (token !== viewToken) return;
  646. console.error("fetchFarmReport failed", error);
  647. resetReportView(farm);
  648. reportGenerating.value = false;
  649. stopProgressTimer();
  650. ElMessage.error("报告加载失败");
  651. } finally {
  652. if (token === viewToken) loading.value = false;
  653. }
  654. }
  655. async function fetchDiagnosisReport() {
  656. const farm = getSelectedFarm();
  657. viewToken += 1;
  658. const token = viewToken;
  659. stopReportPolling();
  660. saveProgressSnapshot();
  661. stopProgressTimer();
  662. reportGenerating.value = false;
  663. loading.value = true;
  664. const farmId = farm.farm_id ?? farm.id;
  665. if (farmId == null || farmId === "") {
  666. zoneList.value = [];
  667. selectedZoneId.value = null;
  668. await fetchLatlonReport(token);
  669. return;
  670. }
  671. await fetchZoneList(farmId);
  672. if (token !== viewToken) return;
  673. if (selectedZoneId.value == null || selectedZoneId.value === "") {
  674. resetReportView(farm);
  675. loading.value = false;
  676. return;
  677. }
  678. await fetchFarmReport(farm, token);
  679. }
  680. // ---------------------------------------------------------------------------
  681. // 事件处理 / 生命周期
  682. // ---------------------------------------------------------------------------
  683. /** 切换分区后按新 zone_id 重拉报告 */
  684. const handleSelectZone = (zone) => {
  685. if (!zone || String(zone.zone_id) === String(selectedZoneId.value)) return;
  686. selectedZoneId.value = zone.zone_id;
  687. viewToken += 1;
  688. const token = viewToken;
  689. stopReportPolling();
  690. saveProgressSnapshot();
  691. stopProgressTimer();
  692. reportGenerating.value = false;
  693. fetchFarmReport(getSelectedFarm(), token);
  694. };
  695. /** 与巡园面板一致:进入新增分区 */
  696. const goAddVariety = () => {
  697. router.push({
  698. path: "/add_zone",
  699. query: { type: "region", isSuccessPopup: "1" },
  700. });
  701. };
  702. /** 转发种植全析:带 farm_id / zone_id / fromShare */
  703. const handleShare = () => {
  704. const farm = getSelectedFarm();
  705. const farmId = farm.farm_id ?? farm.id ?? shareFarmId.value;
  706. const zoneId = selectedZoneId.value ?? shareZoneId.value;
  707. const farmName = farm.farmName || "我的农场";
  708. if (farmId == null || farmId === "" || zoneId == null || zoneId === "") {
  709. ElMessage.warning("当前农场或分区信息不全,暂无法转发");
  710. return;
  711. }
  712. const query = {
  713. askInfo: { title: "转发种植全析", content: "是否分享该报告给好友" },
  714. shareText: `【${farmName}】 种植全析报告已生成,请点击查看!`,
  715. targetUrl: "diagnosis_report",
  716. paramsPage: JSON.stringify({
  717. farm_id: farmId,
  718. zone_id: zoneId,
  719. fromShare: 1,
  720. }),
  721. imageUrl: "https://birdseye-img.sysuimars.com/farm-h5/report_cover.png",
  722. };
  723. wx.miniProgram.navigateTo({
  724. url: `/pages/subPages/share_page/index?pageParams=${JSON.stringify(query)}&type=sharePage`,
  725. });
  726. };
  727. const handleBaseAction = (key) => {
  728. if (key === "adjustPhenology") {
  729. adjustPhenologyPopupRef.value?.open();
  730. return;
  731. }
  732. if (key === "editLocation") {
  733. editPlantPointPopupRef.value?.open();
  734. return;
  735. }
  736. if (key === "soilSense") {
  737. router.push("/soil_sense");
  738. return;
  739. }
  740. console.log("base action:", key);
  741. };
  742. const handlePhenologyConfirm = (payload) => {
  743. restingDatePopupRef.value?.open(payload);
  744. };
  745. const handleSwitchGrowing = () => {
  746. adjustPhenologyPopupRef.value?.open();
  747. };
  748. const handleRestingDateConfirm = (payload) => {
  749. console.log("resting date confirm:", payload);
  750. };
  751. const handlePlantPointConfirm = (payload) => {
  752. console.log("plant point confirm:", payload);
  753. };
  754. // const goCompleteFarmInfo = () => {
  755. // router.push("/entry_information");
  756. // };
  757. // tabbar 切换时组件被 keep-alive 缓存,需在激活时重新拉报告 / 校验农场
  758. onActivated(async () => {
  759. // 分享进页:先按 farm_id / zone_id 切回分享上下文
  760. await ensureFarmContext({
  761. farmId: shareFarmId.value,
  762. zoneId: shareZoneId.value,
  763. });
  764. if (shareZoneId.value) {
  765. selectedZoneId.value = shareZoneId.value;
  766. }
  767. // checkCompleteFarmPopup(); // 暂无农场时不弹「完善农场信息」
  768. fetchDiagnosisReport();
  769. });
  770. onDeactivated(() => {
  771. viewToken += 1;
  772. saveProgressSnapshot();
  773. stopReportPolling();
  774. stopProgressTimer();
  775. });
  776. onBeforeUnmount(() => {
  777. viewToken += 1;
  778. saveProgressSnapshot();
  779. stopReportPolling();
  780. stopProgressTimer();
  781. });
  782. </script>
  783. <style lang="scss" scoped>
  784. .diagnosis-report-page {
  785. width: 100%;
  786. height: calc(100vh - 50px);
  787. overflow: auto;
  788. -webkit-overflow-scrolling: touch;
  789. box-sizing: border-box;
  790. padding-bottom: 20px;
  791. background: #060300;
  792. position: relative;
  793. &.is-from-share {
  794. height: 100vh;
  795. display: flex;
  796. flex-direction: column;
  797. padding-bottom: calc(2px + env(safe-area-inset-bottom));
  798. &::before {
  799. top: 36px;
  800. background: none;
  801. }
  802. .page-content {
  803. position: relative;
  804. &::before {
  805. content: "";
  806. height: 250px;
  807. width: 100%;
  808. position: absolute;
  809. top: 0;
  810. left: 0;
  811. background: #0a0a0a url("@/assets/img/agricultural/report-bg.png") no-repeat top center;
  812. background-size: 100% 250px;
  813. }
  814. }
  815. .page-content {
  816. flex: 1;
  817. min-height: 0;
  818. overflow: auto;
  819. -webkit-overflow-scrolling: touch;
  820. }
  821. }
  822. &::before {
  823. content: "";
  824. height: 250px;
  825. width: 100%;
  826. position: absolute;
  827. top: 0;
  828. left: 0;
  829. background: #0a0a0a url("@/assets/img/agricultural/report-bg.png") no-repeat top center;
  830. background-size: 100% 250px;
  831. }
  832. .page-content {
  833. position: relative;
  834. z-index: 2;
  835. }
  836. ::v-deep {
  837. .el-loading-spinner .path {
  838. stroke: rgba(255, 212, 137, 0.8);
  839. }
  840. }
  841. .report-progress {
  842. display: flex;
  843. align-items: center;
  844. min-height: calc(100vh - 70px);
  845. padding: 0 36px;
  846. box-sizing: border-box;
  847. :deep(.el-progress) {
  848. width: 100%;
  849. }
  850. :deep(.el-progress-bar__outer) {
  851. background: rgba(255, 255, 255, 0.08);
  852. }
  853. :deep(.el-progress__text) {
  854. display: none;
  855. color: #ffd489;
  856. }
  857. }
  858. .report-progress__content {
  859. width: 100%;
  860. }
  861. .report-progress__desc {
  862. margin-top: 16px;
  863. font-size: 16px;
  864. line-height: 20px;
  865. color: #A8A094;
  866. gap: 4px;
  867. display: flex;
  868. flex-direction: column;
  869. align-items: center;
  870. justify-content: center;
  871. }
  872. .diagnosis-header {
  873. padding: 42px 14px 8px;
  874. box-sizing: border-box;
  875. color: #fff;
  876. position: relative;
  877. .header-share {
  878. position: absolute;
  879. right: 16px;
  880. top: 20px;
  881. z-index: 2;
  882. display: inline-flex;
  883. align-items: center;
  884. gap: 4px;
  885. height: 28px;
  886. padding: 0 12px;
  887. border-radius: 14px;
  888. background: rgba(0, 0, 0, 0.6);
  889. border: 1px solid rgba(255, 255, 255, 0.12);
  890. color: rgba(255, 255, 255, 0.85);
  891. backdrop-filter: blur(4px);
  892. font-size: 12px;
  893. cursor: pointer;
  894. }
  895. &__title-row {
  896. display: flex;
  897. align-items: center;
  898. gap: 6px;
  899. }
  900. &__title {
  901. font-size: 25px;
  902. line-height: 31px;
  903. font-weight: 600;
  904. // background: linear-gradient(180deg, #ffe2ae 0%, #ffd489 100%);
  905. // -webkit-background-clip: text;
  906. // background-clip: text;
  907. // -webkit-text-fill-color: transparent;
  908. color: #F7ECD3;
  909. }
  910. &__icon {
  911. width: 24px;
  912. height: 24px;
  913. }
  914. &__desc {
  915. width: fit-content;
  916. margin-top: 9px;
  917. font-size: 12px;
  918. line-height: 20px;
  919. padding: 5px 8px;
  920. color: #A8A094;
  921. background: rgba(20, 16, 8, 0.89);
  922. border: 1px solid rgba(201, 164, 79, 0.6);
  923. border-radius: 10px;
  924. }
  925. &__base {
  926. margin-top: 2px;
  927. font-size: 12px;
  928. line-height: 18px;
  929. color: #ffd489;
  930. }
  931. }
  932. .diagnosis-content {
  933. padding: 12px 12px;
  934. background: #060300;
  935. position: relative;
  936. z-index: 2;
  937. background: linear-gradient(180deg, rgba(6, 3, 0, 0.1) 0%, rgba(6, 3, 0, 0.8) 2%, #060300 100%);
  938. .variety-bar {
  939. display: flex;
  940. align-items: center;
  941. // justify-content: space-between;
  942. &__tags {
  943. display: flex;
  944. align-items: center;
  945. flex-wrap: wrap;
  946. gap: 6px;
  947. }
  948. &__tag {
  949. padding: 5px 14px;
  950. border-radius: 30px;
  951. background: rgba(255, 255, 255, 0.05);
  952. color: rgba(255, 255, 255, 0.5);
  953. border: 1px solid rgba(255, 255, 255, 0.12);
  954. &.active {
  955. background: rgba(255, 255, 255, 0.1);
  956. // background: linear-gradient(90deg, #ffebc9 0%, #ffca6d 100%);
  957. color: rgba(255, 255, 255, 1);
  958. border-color: rgba(255, 255, 255, 0.4);
  959. font-weight: 500;
  960. }
  961. }
  962. &__add {
  963. display: flex;
  964. align-items: center;
  965. margin-left: 8px;
  966. border-radius: 30px;
  967. gap: 2px;
  968. padding: 5px 14px;
  969. background: rgba(255, 255, 255, 0.05);
  970. color: rgba(255, 255, 255, 0.6);
  971. border: 1px dashed rgba(255, 255, 255, 0.12);
  972. }
  973. }
  974. .base-data {
  975. margin: 10px 0;
  976. padding: 12px;
  977. min-height: auto;
  978. background: linear-gradient(180deg, #1a191d 0%, #121216 100%);
  979. border: 1px solid rgba(255, 255, 255, 0.1);
  980. border-radius: 12px;
  981. box-sizing: border-box;
  982. &__title {
  983. display: flex;
  984. align-items: center;
  985. gap: 6px;
  986. font-size: 17px;
  987. color: #fff;
  988. .title-dot {
  989. width: 2px;
  990. height: 16px;
  991. background: #FFD489;
  992. border-radius: 2px;
  993. margin-top: 2px;
  994. }
  995. }
  996. &__icon {
  997. width: 28px;
  998. height: 28px;
  999. }
  1000. &__body {
  1001. .base-data__empty {
  1002. padding: 20px 0;
  1003. text-align: center;
  1004. color: rgba(255, 255, 255, 0.45);
  1005. font-size: 13px;
  1006. }
  1007. .base-info-item {
  1008. margin-bottom: 8px;
  1009. &__row {
  1010. color: rgba(255, 255, 255, 0.88);
  1011. line-height: 22px;
  1012. }
  1013. &__label {
  1014. display: inline-block;
  1015. padding: 1px 6px;
  1016. background: rgba(204, 204, 204, 0.1);
  1017. border: 1px solid rgba(255, 255, 255, 0.16);
  1018. border-radius: 4px;
  1019. height: 19px;
  1020. line-height: 22px;
  1021. margin-right: 10px;
  1022. color: rgba(225, 225, 225, 1);
  1023. }
  1024. &__value {
  1025. color: rgba(255, 255, 255, 0.8);
  1026. line-height: 24px;
  1027. }
  1028. }
  1029. .base-info-action {
  1030. display: inline-flex;
  1031. align-items: center;
  1032. gap: 2px;
  1033. margin-left: 6px;
  1034. padding: 2px 8px;
  1035. border-radius: 20px;
  1036. background: rgba(255, 212, 137, 0.12);
  1037. color: #ffd489;
  1038. font-size: 12px;
  1039. .el-icon {
  1040. font-size: 12px;
  1041. }
  1042. &--block {
  1043. display: inline-flex;
  1044. margin: 8px 0 0;
  1045. }
  1046. }
  1047. }
  1048. }
  1049. .report-module {
  1050. margin-top: 4px;
  1051. }
  1052. .report-tabs {
  1053. display: flex;
  1054. align-items: center;
  1055. justify-content: space-between;
  1056. padding-bottom: 12px;
  1057. // gap: 6px;
  1058. // overflow-x: auto;
  1059. // -webkit-overflow-scrolling: touch;
  1060. // scrollbar-width: none;
  1061. &::-webkit-scrollbar {
  1062. display: none;
  1063. }
  1064. &__item {
  1065. flex: 0 0 auto;
  1066. width: 80px;
  1067. padding: 8px 12px;
  1068. border-radius: 8px;
  1069. font-size: 13px;
  1070. box-sizing: border-box;
  1071. line-height: 20px;
  1072. background: rgba(37, 37, 41, 0.8);
  1073. text-align: center;
  1074. color: #E1E1E1;
  1075. border: 1px solid transparent;
  1076. cursor: pointer;
  1077. &.active {
  1078. border: 1px solid rgba(255, 212, 137, 0.4);
  1079. background: #1E180E;
  1080. color: #FFD489;
  1081. font-weight: 500;
  1082. position: relative;
  1083. &::after {
  1084. content: "";
  1085. position: absolute;
  1086. left: 0;
  1087. right: 0;
  1088. width: 0;
  1089. height: 0;
  1090. bottom: -7px;
  1091. margin: 0 auto;
  1092. border-left: 8px solid transparent;
  1093. border-top: 7px solid #78633F;
  1094. border-bottom: 0px solid transparent;
  1095. border-right: 8px solid transparent;
  1096. }
  1097. }
  1098. }
  1099. }
  1100. .report-panel {
  1101. margin-top: 12px;
  1102. padding-bottom: 8px;
  1103. &__empty {
  1104. margin-top: 14px;
  1105. padding: 24px 0;
  1106. text-align: center;
  1107. color: rgba(255, 255, 255, 0.45);
  1108. font-size: 13px;
  1109. }
  1110. }
  1111. .core-card {
  1112. padding: 14px;
  1113. border-radius: 12px;
  1114. background: linear-gradient(90.51deg, #1A191D 0%, rgba(76, 68, 53, 0.4) 102.25%);
  1115. border: 1px solid rgba(255, 212, 137, 0.24);
  1116. &__head {
  1117. display: flex;
  1118. align-items: center;
  1119. gap: 6px;
  1120. font-size: 15px;
  1121. font-weight: 600;
  1122. color: #ffd489;
  1123. }
  1124. &__star {
  1125. width: 11px;
  1126. // height: 16px;
  1127. }
  1128. &__body {
  1129. margin-top: 10px;
  1130. font-size: 14px;
  1131. line-height: 22px;
  1132. color: rgba(255, 255, 255, 0.88);
  1133. word-break: break-word;
  1134. }
  1135. }
  1136. .point-block {
  1137. margin-top: 18px;
  1138. &__head {
  1139. display: flex;
  1140. align-items: baseline;
  1141. gap: 8px;
  1142. margin-bottom: 10px;
  1143. }
  1144. &__no {
  1145. flex-shrink: 0;
  1146. font-size: 16px;
  1147. font-weight: 600;
  1148. color: #ffd489;
  1149. font-variant-numeric: tabular-nums;
  1150. }
  1151. &__title {
  1152. font-size: 16px;
  1153. line-height: 22px;
  1154. color: #fff;
  1155. }
  1156. // 样式 0:整行标题金色
  1157. &--s0 &__title {
  1158. color: #ffd489;
  1159. }
  1160. &__card {
  1161. padding: 14px;
  1162. border-radius: 12px;
  1163. background: linear-gradient(180deg, #1A191D 0%, #121216 100%);
  1164. border: 1px solid rgba(255, 255, 255, 0.1);
  1165. }
  1166. }
  1167. .point-sub + .point-sub {
  1168. margin-top: 12px;
  1169. }
  1170. .point-sub {
  1171. &+& {
  1172. margin-top: 12px;
  1173. padding-top: 12px;
  1174. border-top: 1px solid rgba(255, 255, 255, 0.08);
  1175. }
  1176. &__badge {
  1177. display: inline-flex;
  1178. background: rgba(255, 212, 137, 0.1);
  1179. align-items: center;
  1180. padding: 1px 6px;
  1181. border-radius: 4px;
  1182. border: 1px solid rgba(255, 212, 137, 0.16);
  1183. font-size: 12px;
  1184. color: #FFD489;
  1185. }
  1186. &__plain {
  1187. font-size: 16px;
  1188. line-height: 22px;
  1189. color: #fff;
  1190. }
  1191. &__icon-row {
  1192. display: flex;
  1193. align-items: flex-start;
  1194. gap: 8px;
  1195. }
  1196. &__icon {
  1197. flex-shrink: 0;
  1198. width: 28px;
  1199. height: 28px;
  1200. border-radius: 6px;
  1201. border: 1px solid rgba(255, 212, 137, 0.55);
  1202. display: inline-flex;
  1203. align-items: center;
  1204. justify-content: center;
  1205. color: #ffd489;
  1206. font-size: 14px;
  1207. }
  1208. &__icon-title {
  1209. flex: 1;
  1210. font-size: 16px;
  1211. line-height: 22px;
  1212. color: #fff;
  1213. padding-top: 3px;
  1214. }
  1215. &__text {
  1216. margin-top: 8px;
  1217. font-size: 14px;
  1218. line-height: 20px;
  1219. color: #8A8580;
  1220. word-break: break-word;
  1221. }
  1222. }
  1223. }
  1224. }
  1225. </style>