|
@@ -1,34 +0,0 @@
|
|
|
-// 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],
|
|
|
- });
|
|
|
- }
|
|
|
-});
|