Browse Source

上传文件至 ''

qw 6 tháng trước cách đây
mục cha
commit
54699df422

+ 34 - 0
AcidNeutralizationModel.js

@@ -0,0 +1,34 @@
+// pages/Calculation/Calculation.js
+Page({
+  data: {
+    // 数据绑定
+    initialPH: '', // 土壤初始 pH
+    targetPH: '', // 土壤目标 pH
+    materials: ['石灰石(粉)CaCO3', '生石灰(粉)', '纯CaO (粉)', '熟石灰(粉)', '白云石 (粉)', '硅钙钾镁肥', '其他含CaO和MgO材料'],
+    selectedMaterialIndex: 0, // 默认选中的碱性物料索引
+    selectedMaterial: '石灰石(粉)CaCO3', // 默认物料
+  },
+
+  // 处理土壤初始 pH 的输入
+  onInitialPHChange(e) {
+    this.setData({
+      initialPH: e.detail.value,
+    });
+  },
+
+  // 处理土壤目标 pH 的输入
+  onTargetPHChange(e) {
+    this.setData({
+      targetPH: e.detail.value,
+    });
+  },
+
+  // 处理碱性物料选择
+  onSelectMaterial(e) {
+    const index = e.detail.value;
+    this.setData({
+      selectedMaterialIndex: index,
+      selectedMaterial: this.data.materials[index],
+    });
+  }
+});

+ 5 - 0
AcidNeutralizationModel.json

@@ -0,0 +1,5 @@
+{
+  "navigationBarTitleText": "降酸模型", 
+  "navigationBarBackgroundColor": "#ffffff",  
+  "navigationBarTextStyle": "black"  
+}

+ 75 - 0
AcidNeutralizationModel.wxml

@@ -0,0 +1,75 @@
+<!-- pages/Calculation/Calculation.wxml -->
+<view class="page-body">
+  <view class="white-box">
+    <view class="page-section-title">土地质地:</view>
+    <radio-group name="soilType" bindchange="onSoilTypeChange" class="radio-group">
+      <label class="radio">
+        <radio value="r1" /> <text class="radio-text">壤土/黏质土</text>
+      </label>
+      <label class="radio">
+        <radio value="r2" /> <text class="radio-text">砂质土</text>
+      </label>
+    </radio-group>
+  </view>
+</view>
+
+<view class="page-body">
+  <view class="white-box">
+    <view class="page-section-title">有机质含量:</view>
+    <radio-group name="soilType" bindchange="onSoilTypeChange" class="radio-group">
+      <label class="radio">
+        <radio value="r3" />大于3%
+      </label>
+      <label class="radio">
+        <radio value="r4" />小于等于3%
+      </label>
+    </radio-group>
+  </view>
+</view>
+
+<view class="page-body">
+  <view class="white-box">
+    <view class="page-section-title">土壤初始 pH:</view>
+    <input 
+      class="input-field" 
+      type="text" 
+      placeholder="4.5~6.2" 
+      value="{{initialPH}}" 
+      bindinput="onInitialPHChange" 
+    />
+  </view>
+</view>
+
+<view class="page-body">
+  <view class="white-box">
+    <view class="page-section-title">土壤目标 pH:</view>
+    <input 
+      class="input-field" 
+      type="text" 
+      placeholder="4.5~7.0" 
+      value="{{targetPH}}" 
+      bindinput="onTargetPHChange" 
+    />
+  </view>
+</view>
+
+<view class="page-body">
+  <view class="white-box">
+    <view class="page-section-title">碱性物料:</view>
+    <picker mode="selector" range="{{materials}}" value="{{selectedMaterialIndex}}" bindchange="onSelectMaterial">
+      <view class="input-field bold-text">
+        {{selectedMaterial || '石灰石(粉)CaCO3'}}
+      </view>
+    </picker>
+  </view>
+</view>
+
+<view class="green-btn">
+  <button class="btn" bindtap="calculate">计算</button>
+</view>
+
+<view class="description-box">
+  <text class="bold-text">
+    建议:\n1. 选用Ca0(生石灰)作为碱性物料,每季施用量不宜超过150 kg/亩,当计算用量超过150 kg/亩时,建议分多季施用;建议翻耕时施用,施加后与耕作层土壤混匀,避免苗期施用导致烧苗;施加过程注意防护,避免灼烧眼睛和皮肤;\n 2. 在改良时间富裕,石灰质材料充足的条件下,建议优先选用石灰石粉末、白云石等温和型碱性物料;\n3. 当其它碱性物料计算用量超过500 kg/亩,建议分2季施用;\n 4. 建议每隔3-5年,追踪土壤pH变化,可根据土壤pH变化,追施少量石灰质材料;
+  </text>
+</view> 

+ 84 - 0
AcidNeutralizationModel.wxss

@@ -0,0 +1,84 @@
+.page-body {
+  padding: 10rpx; /* 页面内容的内边距 */
+  background-color: #f8f8f8; /* 浅灰色背景 */
+}
+
+.white-box {
+  width: 90%; /* 宽度为父容器的 90% */
+  margin: 10rpx auto; /* 上下间距为 10rpx,水平居中 */
+  padding: 20rpx; /* 内边距 20rpx */
+  background-color: #fff; /* 背景颜色为白色 */
+  border-radius: 10rpx; /* 圆角效果 */
+  box-shadow: 0 4rpx 10rpx rgba(0, 0, 0, 0.1); /* 添加阴影效果 */
+}
+
+.page-section-title {
+  font-size: 30rpx; /* 标题字体大小 */
+  font-weight: bold; /* 字体加粗 */
+  color: #333; /* 字体颜色为深灰色 */
+  margin-bottom: 10rpx; /* 下边距 10rpx */
+}
+
+/* 设置 radio-group 为横向布局 */
+.radio-group {
+  display: flex;
+  justify-content: space-between;  /* 使两个 radio 按钮左右分开 */
+  align-items: center; /* 垂直居中对齐 */
+  width: 100%; /* 确保 radio-group 容器占满整个宽度 */
+}
+
+.radio {
+  font-size: 28rpx; /* 单选框文本字体大小 */
+  color: #666; /* 字体颜色为浅灰色 */
+  margin: 5rpx 0; /* 上下间距 5rpx */
+  margin-left: 70rpx; /* 控制间距,使两个选项之间更紧凑 */
+  margin-right: 70rpx; /* 控制间距,使两个选项之间更紧凑 */
+}
+
+.input-field {
+  width: 100%; /* 输入框宽度为父容器的 100% */
+  padding: 10rpx; /* 内边距 10rpx */
+  font-size: 28rpx; /* 字体大小为 28rpx */
+  color: #000; /* 字体颜色为深灰色 */
+  border: none; /* 无边框 */
+  border-bottom: 1px solid #ddd; /* 底部边框为浅灰色 */
+}
+
+.green-btn {
+  margin-top: 20rpx; /* 上边距 20rpx */
+  text-align: center; /* 文本居中 */
+}
+
+.btn {
+  width: 80%; /* 按钮宽度为父容器的 80% */
+  padding: 15rpx 0; /* 上下内边距为 15rpx */
+  background-color: #00af92; /* 按钮背景颜色为绿色 */
+  color: #fff; /* 按钮文字颜色为白色 */
+  font-size: 28rpx; /* 字体大小为 28rpx */
+  border-radius: 10rpx; /* 按钮圆角效果 */
+}
+
+.description-box {
+  width: 90%; /* 白色框的宽度为父容器的 90% */
+  margin: 10rpx auto; /* 上下间距 10rpx,水平居中 */
+  padding: 15rpx; /* 增加文字周围空间 */
+  background-color: #fff; /* 背景为白色 */
+}
+
+.bold-text {
+  font-size: 32rpx; /* 加粗字体大小 */
+  color: #000; /* 黑色字体 */
+}
+
+.description-box {
+  width: 90%; /* 输入框宽度为父容器的 100% */
+  background-color: #f8f8f8; /* 浅灰色背景 */
+}
+
+.bold-text {
+  font-weight: bold; /* 加粗字体 */
+  font-size: 26rpx; /* 缩小字体大小 */
+  line-height: 1.5; /* 调整行高,使文本更加紧凑 */
+  color: #333; /* 字体颜色为深灰色 */
+}
+