Compare commits

..

2 Commits

Author SHA1 Message Date
chen 5792a433b1 提交 2021-09-03 19:14:01 +08:00
chen 7b12aef6c2 提交 2021-09-03 19:12:51 +08:00
2 changed files with 13 additions and 5 deletions

View File

@ -2,7 +2,7 @@ var host = "https://carbonneutral.bjfs.org.cn";//线上
// var host = "https://carbon.my-footprint.cn";//线上域名2 // var host = "https://carbon.my-footprint.cn";//线上域名2
// var host = "https://tanzhonghe-admin.com";//本地 // var host = "https://tanzhonghe-admin.com";//本地
// var host = "https://carbon.scdxtc.cn";//大向天诚服务器
var config = { var config = {
host: host, host: host,

View File

@ -60,11 +60,11 @@ Page({
casesChange(event) { casesChange(event) {
if(this.data.threeList[event.detail.value].type=='forest_management'){ if(this.data.threeList[event.detail.value].type=='forest_management'){
this.setData({ this.setData({
isXiangm:true isXiangm:true,
}) })
} else { } else {
this.setData({ this.setData({
isXiangm:false isXiangm:false,
}) })
} }
this.setData({ this.setData({
@ -79,6 +79,11 @@ Page({
carbon_neutralization: 0, carbon_neutralization: 0,
carbon_efficiency: "0.00", carbon_efficiency: "0.00",
}) })
if(this.data.senList[event.detail.value].name=='补植补造'){
this.setData({
newDo_type:'afforestation',
})
}
if (event.detail.value == 1) { if (event.detail.value == 1) {
this.setData({ this.setData({
newDo_type: this.data.senList[this.data.senIndex].type, newDo_type: this.data.senList[this.data.senIndex].type,
@ -86,7 +91,7 @@ Page({
}) })
} else { } else {
this.setData({ this.setData({
newDo_type: this.data.threeList[this.data.curCaseIndex].type, newDo_type: this.data.senList[this.data.curCaseIndex].type,
cases_position_id:this.data.threeList[this.data.curCaseIndex].address[0].id cases_position_id:this.data.threeList[this.data.curCaseIndex].address[0].id
}) })
} }
@ -167,6 +172,7 @@ Page({
}) })
}, },
setMoney: function(e) { setMoney: function(e) {
console.log('e',e);
//数量= 排放量 / 植物的碳汇量基数 //数量= 排放量 / 植物的碳汇量基数
// ,价格 = 每棵树价格 * 数量 // ,价格 = 每棵树价格 * 数量
var that = this var that = this
@ -278,7 +284,8 @@ Page({
that.setData({ that.setData({
threeList: threeList, threeList: threeList,
newDo_type: threeList[that.data.curCaseIndex].type, newDo_type: threeList[that.data.curCaseIndex].type,
cases_position_id: threeList[that.data.curCaseIndex].address[that.data.addressIndex].id cases_position_id: threeList[that.data.curCaseIndex].address[that.data.addressIndex].id,
newDo_type:that.data.senList[0].type,
//TODO 这里赋值应该用数组 //TODO 这里赋值应该用数组
// curThreeCode: [JSON.parse(res.data.data).trees[0].coding], // curThreeCode: [JSON.parse(res.data.data).trees[0].coding],
// carbon:JSON.parse(res.data.data).trees[0].carbon_base, // carbon:JSON.parse(res.data.data).trees[0].carbon_base,
@ -329,6 +336,7 @@ Page({
var that = this var that = this
var tree_items = [] var tree_items = []
var management_items = [] var management_items = []
console.log(this.data.newDo_type);
if (this.data.newDo_type == 'afforestation') { if (this.data.newDo_type == 'afforestation') {
for (var p in this.data.priceList) { for (var p in this.data.priceList) {
tree_items.push({ tree_items.push({