Procházet zdrojové kódy

修复首页显示bug,修改单位和数据中文名称

DIng před 4 měsíci
rodič
revize
d05b72b404

+ 4 - 4
pages/Home/Home.wxml

@@ -1,18 +1,18 @@
 <view class="container">
   <view class="card" bindtap="SoilPro">
-    <image class="card-icon" src="/assets/taddar//介绍.png" />
+    <image class="card-icon" src="/assets/taddar/介绍.png" />
     <text class="card-title">软件简介</text>
   </view>
   <view class="card" bindtap="Overview">
-    <image class="card-icon" src="/assets/taddar//项目.png" />
+    <image class="card-icon" src="/assets/taddar/项目.png" />
     <text class="card-title">项目简介</text>
   </view>
   <view class="card" bindtap="ResearchFindings">
-    <image class="card-icon" src="/assets/taddar//成果1.png" />
+    <image class="card-icon" src="/assets/taddar/成果1.png" />
     <text class="card-title">研究成果</text>
   </view>
   <view class="card" bindtap="Unit_Team_Profile">
-    <image class="card-icon" src="/assets/taddar//团队介绍@1x.png" />
+    <image class="card-icon" src="/assets/taddar/团队介绍@1x.png" />
     <text class="card-title">承担单位团队信息</text>
   </view>
 </view>

+ 6 - 2
pages/Visualizatio/Visualizatio.js

@@ -22,8 +22,12 @@ Page({
     },
     // 中文表头内容,动态生成
     tableHeaders: [
-      "序号", "Q/ΔpH", "初始pH", "有机质含量", "氯离子含量",
-      "氢离子含量","铝离子含量"
+      "序号", "Q/ΔpH", "初始pH", "有机质含量", "土壤粘粒",
+      "交换性氢","交换性铝"
+    ],
+    unit: [
+      " ", " ", " ", "(g/kg)", "(g/kg)",
+      "(cmol/kg)", "(cmol/kg)"
     ]
   },
 

+ 3 - 0
pages/Visualizatio/Visualizatio.wxml

@@ -21,6 +21,9 @@
     <view class="table-header">
       <view class="table-cell" wx:for="{{tableHeaders}}" wx:key="index">{{item}}</view>
     </view>
+    <view class="table-header">
+      <view class="table-cell" wx:for="{{unit}}" wx:key="index">{{item}}</view>
+    </view>
 
     <block wx:for="{{filteredRows}}" wx:key="index">
       <view class="table-row" bindtap="onRowClick" data-index="{{index}}" data-row="{{item}}">

+ 6 - 2
pages/Visualization/Visualization.js

@@ -22,8 +22,12 @@ Page({
     },
     // 中文表头内容,动态生成
     tableHeaders: [
-      "序号", "有机质含量", "土壤粘粒重量", "阳离子交换量", "氢离子含量",
-      "硝态氮含量","铝离子含量", "酸碱差值",
+      "序号", "有机质含量", "土壤粘粒", "阳离子交换量", "交换性氢",
+      "水解氮","交换性铝", "ΔpH",
+    ],
+    unit: [
+      " ", "(g/kg)", "(g/kg)", "(cmol/kg)", "(cmol/kg)", 
+      "(g/kg)", "(cmol/kg)", " "
     ]
   },
 

+ 3 - 1
pages/Visualization/Visualization.wxml

@@ -21,7 +21,9 @@
     <view class="table-header">
       <view class="table-cell" wx:for="{{tableHeaders}}" wx:key="index">{{item}}</view>
     </view>
-
+    <view class="table-header">
+      <view class="table-cell" wx:for="{{unit}}" wx:key="index">{{item}}</view>
+    </view>
     <block wx:for="{{filteredRows}}" wx:key="index">
       <view class="table-row" bindtap="onRowClick" data-index="{{index}}" data-row="{{item}}">
         <view class='table-cell' wx:for="{{list}}" wx:key="item">

+ 1 - 1
pages/Visualization/Visualization.wxss

@@ -75,7 +75,7 @@
 /* 表格单元格样式 */
 .table-cell {
   flex: none;
-  width: 140rpx; /* 固定宽度 */
+  width: 170rpx; /* 固定宽度 */
   padding: 10rpx;
   text-align: center;
   font-size: 28rpx;

+ 0 - 4
shoping/AcidNeutralizationModel/AcidNeutralizationModel.js

@@ -85,10 +85,6 @@ calculate: function () {
         result: result,
         showModal: true, // 显示弹窗
       });
-      wx.showToast({
-        title: '计算完成!结果已更新',
-        icon: 'success',
-      });
     },
     fail: (error) => {
       console.error('请求失败:', error);

+ 2 - 2
shoping/AcidNeutralizationModel/AcidNeutralizationModel.wxml

@@ -53,7 +53,7 @@
 
   <view class="white-box">
     <view class="input-row">
-      <view class="page-section-title">氢离子含量(cmol/kg) H:</view>
+      <view class="page-section-title">交换性氢(cmol/kg) H+:</view>
       <input 
         class="input-field" 
         type="text" 
@@ -66,7 +66,7 @@
 
   <view class="white-box">
     <view class="input-row">
-      <view class="page-section-title">铝离子含量(cmol/kg) Al:</view>
+      <view class="page-section-title">交换性铝(cmol/kg) Al3+:</view>
       <input 
         class="input-field" 
         type="text" 

+ 3 - 3
shoping/Calculation/Calculation.wxml

@@ -47,7 +47,7 @@
 <view class="page-body">
   <view class="white-box">
     <view class="input-row">
-    <view class="page-section-title">氢离子含量(cmol/kg) H:</view>
+    <view class="page-section-title">交换性氢(cmol/kg) H+:</view>
     <input 
       class="input-field" 
       type="text" 
@@ -62,7 +62,7 @@
 <view class="page-body">
   <view class="white-box">
     <view class="input-row">
-    <view class="page-section-title">铵离子含量(cmol/kg) HN:</view>
+    <view class="page-section-title">水解氮(g/kg) N:</view>
     <input 
       class="input-field" 
       type="text" 
@@ -77,7 +77,7 @@
 <view class="page-body">
   <view class="white-box">
     <view class="input-row">
-    <view class="page-section-title">铝离子含量(cmol/kg) Al:</view>
+    <view class="page-section-title">交换性铝(cmol/kg) Al3+:</view>
     <input 
       class="input-field" 
       type="text" 

+ 19 - 5
shoping/Home/Home.wxml

@@ -1,7 +1,21 @@
 <view class="container">
-  <button class="full-width-button" bindtap="SoilPro">软件简介</button>
-  <button class="full-width-button" bindtap="Overview">项⽬简介</button>
-  <button class="full-width-button" bindtap="ResearchFindings">研究成果</button>
-  <button class="full-width-button" bindtap="Unit_Team_Profile">承担单位团队信息</button>
+  <view class="card" bindtap="SoilPro">
+    <image class="card-icon" src="/assets/taddar/介绍.png" />
+    <text class="card-title">软件简介</text>
+  </view>
+  <view class="card" bindtap="Overview">
+    <image class="card-icon" src="/assets/taddar/项目.png" />
+    <text class="card-title">项目简介</text>
+  </view>
+  <view class="card" bindtap="ResearchFindings">
+    <image class="card-icon" src="/assets/taddar/成果1.png" />
+    <text class="card-title">研究成果</text>
+  </view>
+  <view class="card" bindtap="Unit_Team_Profile">
+    <image class="card-icon" src="/assets/taddar/团队介绍@1x.png" />
+    <text class="card-title">承担单位团队信息</text>
+  </view>
 </view>
-<nav-tabar selected="{{selected}}"></nav-tabar> 
+
+<!-- 底部导航栏 -->
+<nav-tabar selected="{{selected}}"></nav-tabar>

+ 55 - 24
shoping/Home/Home.wxss

@@ -1,27 +1,58 @@
-/* 父容器样式 */
 .container {
   display: flex;
-  flex-direction: column; /* 垂直排列 */
-  align-items: center;    /* 居中对齐 */
-  padding: 20px 0;        /* 增加上下内边距 */
-  margin: 50px 20px 20px  20px;     /* 增加顶部外边距 */
-}
-
-/* 按钮样式 */
-.full-width-button {
-  width: 100%;            /* 按钮占满宽度 */
-  padding: 15px 0;        /* 按钮内边距,控制高度 */
-  margin: 15px 0;         /* 按钮间距 */
-  background-color: #3EC01E; /* 按钮背景颜色 */
-  color: white;           /* 按钮文字颜色 */
-  font-size: 18px;        /* 按钮文字大小 */
-  border: none;           /* 去除按钮边框 */
-  outline: none;          /* 去除焦点边框 */
-  text-align: center;     /* 文字居中 */
-  border-radius: 5px;     /* 圆角效果 */
-}
-
-/* 按钮点击效果 */
-.full-width-button:active {
-  background-color: #299A0C; /* 按下按钮时的颜色变化 */
+  flex-direction: column;
+  gap: 20px;
+  padding: 20px;
+  background-color: #f5f5f5;
+  margin-top: 60px;
+}
+
+.card {
+  display: flex; /* 使用 flexbox 布局 */
+  align-items: center;
+  width: 90%;
+  background-color: #ffffff;
+  padding: 20px;
+  border-radius: 12px;
+  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
+  transition: transform 0.2s ease;
+  cursor: pointer;
+}
+
+.card:hover {
+  transform: scale(1.05);
+}
+
+.card-icon {
+  width: 40px;
+  height: 40px;
+  margin-bottom: 20px;
+  margin-right: 90px; /* 与内容保持间距 */
+}
+
+.card-content {
+  flex: 1; /* 占据剩余空间,保证布局一致 */
+  text-align: center; /* 内容水平居中 */
+}
+
+.card-title {
+  font-size: 18px;
+  font-weight: bold;
+  color: #333;
+}
+
+.card:nth-child(1) {
+  background-color: #FFDDC1; /* 软件简介卡片颜色 */
+}
+
+.card:nth-child(2) {
+  background-color: #C1E1FF; /* 项目简介卡片颜色 */
+}
+
+.card:nth-child(3) {
+  background-color: #D4F4DD; /* 研究成果卡片颜色 */
+}
+
+.card:nth-child(4) {
+  background-color: #FFD700; /* 团队信息卡片颜色 */
 }

+ 7 - 7
shoping/ModelTrain/ModelTrain.js

@@ -2,12 +2,12 @@ Page({
   data: {
     rows: [], // 所有表格数据
     currentRow: null, // 当前选中的表格行
-    filteredRows: null, // 过滤后的表格数据
+    filteredRows: [], // 过滤后的表格数据,默认为空
     tableHeaders: [
       "数据集名称","数据条数","更新时间"
     ],
-    types: [{ name: 'all' }, { name: 'reduce' }, { name: 'reflux' }], // 数据种类
-    currentType: 'all', // 当前选中的数据种类
+    types: [{ name: 'reduce', display: '降酸模型' }, { name: 'reflux', display: '反酸模型' }], // 数据种类
+    currentType: '', // 当前选中的数据种类,默认为空字符串
   },
 
   // 页面加载时获取表格数据
@@ -17,7 +17,7 @@ Page({
 
   LoadData: function() {
     wx.request({
-      url: 'https://soilgd.com:5000/table',
+      url: 'https://soilgd.com:5000/table', 
       method: 'POST',
       header: {
         'Content-Type': 'application/json'
@@ -43,7 +43,7 @@ Page({
           console.log(rows);
           this.setData({
             rows: rows,
-            filteredRows: rows,
+            // 初始时不显示任何数据
           });
         } else {
           wx.showToast({
@@ -77,7 +77,7 @@ Page({
     const type = this.data.types[e.detail.value].name;
     this.setData({
       currentType: type,
-      filteredRows: type === 'all' ? this.data.rows : this.data.rows.filter(row => row.type === type)
+      filteredRows: this.data.rows.filter(row => row.type === type)
     });
   },
 
@@ -100,7 +100,7 @@ Page({
       dataset_id: id
     };
     wx.request({
-      url: 'https://soilgd.com:5000/train-and-save-model', // 假设这是你的接口地址
+      url: 'https://soilgd.com:5000/train-and-save-model', 
       method: 'POST',
       header: {
         'Content-Type': 'application/json'

+ 5 - 4
shoping/ModelTrain/ModelTrain.wxml

@@ -2,10 +2,10 @@
 <view class="picker-title">数据集种类:</view>
 
 <!-- 数据种类选择下拉框 -->
-<picker mode="selector" range="{{types}}" range-key="name" bindchange="onTypeChange">
+<picker mode="selector" range="{{types}}" range-key="display" bindchange="onTypeChange">
   <view class="picker-container">
     <view class="picker">
-      {{currentType === 'all' ? '全部数据' : currentType}}
+      {{currentType === '' ? '请选择' : (currentType === 'reduce' ? '降酸模型' : '反酸模型')}}
     </view>
     <view class="picker-arrow"></view> <!-- 三角形样式 -->
   </view>
@@ -17,10 +17,11 @@
   <view wx:if="{{loading}}" class="loading">数据加载中,请稍候...</view>
 
   <!-- 无数据提示 -->
-  <view wx:if="{{!loading && filteredRows.length === 0}}" class="no-data">暂无数据</view>
+  <view wx:if="{{!loading && filteredRows.length === 0 && currentType != ''}}" class="no-data">暂无数据</view>
 
   <!-- 表格 -->
-  <view class="table-body">
+  <view wx:if="{{filteredRows.length != 0}}"
+    class="table-body">
     <view class="table-header">
       <!-- 添加单选框 -->
       <view class="table-cell"></view>

+ 3 - 0
shoping/ResearchFindings/ResearchFindings.wxml

@@ -1,3 +1,6 @@
+<view class="green-box">
+    <text class="title-en">项目成果</text>
+</view>
 <view class="container">
   <view class="section">
     <text class="content">广东省典型区域土壤环境质量及农产品安全研究,在广东省典型区域率先系统地开展了土壤环境质量的探查研究,为新的国家土壤环境质量标准修订稿中有关有机污染物指标限值的确定提供了科广东省典型区域土壤环境质量及农产品安全研究,在广东省典型区域率先系统地开展了土壤环境质量的探查研究,为新的国土壤环境质量标准修订稿中有关有机污染物指标限值的确定提供了科学依据,并为全国开展土壤有机污染物调查提供了重要参考。相关成果获得2009年度⼴东省科学技术⼀等奖。</text>

+ 21 - 0
shoping/ResearchFindings/ResearchFindings.wxss

@@ -25,3 +25,24 @@
   width: 700rpx;  /* 设置图片的大小 */
   height: 400rpx;  /* 设置图片的大小 */
 }
+/* 页面整体背景 */
+.green-box {
+  background-color: #4caf50; /* 绿色背景 */
+  padding: 10px 20px;  /* 减小上下内边距,控制高度 */
+  text-align: center;
+  display: flex;
+  flex-direction: column; /* 设置垂直方向布局 */
+  justify-content: center;
+  align-items: center;
+  max-height: 100rpx; /* 限制最大高度 */
+  max-width: calc(100% - 10px); /* 宽度最大100%,两边各留5px */
+  margin-left: 15px;  /* 左边留5px */
+  margin-right: 15px; /* 右边留5px */
+  box-sizing: border-box; /* 确保 padding 和 margin 不影响宽度计算 */
+}
+
+.title-en {
+  font-size: 16px;
+  color: #fff;
+  display: block;
+}

+ 6 - 5
shoping/Soil Acidification/Soil Acidification.wxml

@@ -3,11 +3,12 @@
     <text class="sub-title">土壤反酸模型使用注意说明</text>
     感谢您选择使用“广东省生态环境与土壤研究所”研发的反酸模型。该模型基于土壤理化性质和机器学习算法,能够预测土壤反酸后的 pH 值。请注意以下事项:
 <text class="sub-title">1. 数据输入要求</text>
-<text class="sub-title"> \n土壤理化参数:</text>
-<text class="sub-title">\n土壤粘粒含量(%):</text>请确保输入数据经过实验室精确测量。
-<text class="sub-title">交换性铝离子浓度(cmol/kg):</text>建议使用标准土壤分析方法进行测定。
-<text class="sub-title">有机质含量(%):</text>数据应基于准确的土壤样品测试。
-<text class="sub-title">游离氧化铝(g/kg):</text>确保数据来源可靠,测定方法符合国家或行业标准。
+<text class="sub-title">\n土壤粘粒含量(g/kg)</text>
+<text class="sub-title">\n有机质含量(g/kg)</text>
+<text class="sub-title">\n阳离子交换量(cmol/kg)</text>
+<text class="sub-title">\n水解氮(g/kg)</text>
+<text class="sub-title">\n交换性铝(cmol/kg)</text>
+<text class="sub-title">\n交换性氢(cmol/kg)</text>
 输入值必须在合理范围内,不应有异常数据,避免影响预测结果的准确性。
 <text class="sub-title">2. 模型进化能力</text>
 <text class="sub-title">\n模型迭代:</text>我们的模型将会随着用户数据量的增加和多样化,逐步迭代进化,提升预测的准确性和泛化能力。

+ 2 - 2
shoping/Soil Deacidification/Soil Deacidification.wxml

@@ -4,8 +4,8 @@
 <text class="sub-title">1. 数据输入要求</text>
 <text class="sub-title"> \n必填参数:</text>
 <text class="sub-title">\n土壤起始 pH 值:</text>需通过实验室准确测定。
-<text class="sub-title">目标 pH 值:</text>根据土壤改良目标设置。
-<text class="sub-title">关键理化指标:</text>包括土壤质地、有机质含量等。
+<text class="sub-title">土壤目标 pH 值:</text>根据土壤改良目标设置。
+<text class="sub-title">关键理化指标:</text>包括离子含量、有机质含量等。
 输入数据必须符合实际测量值,避免因数据异常或错误导致计算结果偏差。
 <text class="sub-title">2. 模型进化能力</text>
 本模型将持续根据用户上传的真实数据优化和进化,提升预测精度和适用范围。