master
parent
b74e21e741
commit
3f8d558c04
|
@ -63,11 +63,19 @@ Page({
|
|||
},
|
||||
casesChange(event) {
|
||||
if(this.data.threeList[event.detail.value].type=='forest_management'){
|
||||
if(this.data.threeList[event.detail.value].default_type=='forest_management'){
|
||||
this.setData({
|
||||
isShif:true,
|
||||
isXiangm:true,
|
||||
senIndex: 1,
|
||||
})
|
||||
} else {
|
||||
this.setData({
|
||||
isShif:false,
|
||||
isXiangm:true,
|
||||
senIndex: 0,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
isShif:false,
|
||||
|
@ -77,8 +85,6 @@ Page({
|
|||
}
|
||||
this.setData({
|
||||
curCaseIndex: event.detail.value,
|
||||
isShif: this.data.threeList[event.detail.value].type=='forest_management'?true:false,
|
||||
senIndex: this.data.threeList[event.detail.value].type=='forest_management'?1:0,
|
||||
addressIndex:0,
|
||||
priceList: {},
|
||||
curThreeCode: [],
|
||||
|
@ -290,37 +296,39 @@ Page({
|
|||
'openid': wx.getStorageSync('openid')
|
||||
},
|
||||
success(res) {
|
||||
console.log(JSON.parse(res.data.data),777777777);
|
||||
if (res.data.result == 'success') {
|
||||
var threeList = JSON.parse(res.data.data).cases;
|
||||
if(threeList[0].type=='forest_management'){
|
||||
var dataList = JSON.parse(res.data.data).cases;
|
||||
if(dataList[0].type=='forest_management'){
|
||||
that.setData({
|
||||
isShif:true,
|
||||
isXiangm:true,
|
||||
senIndex:1
|
||||
})
|
||||
}
|
||||
let arr = that.data.senList
|
||||
arr.forEach((item,index)=>{
|
||||
if(item.type == threeList[that.data.curCaseIndex].default_type){
|
||||
let obj = arr[index];
|
||||
arr.splice(index,1)
|
||||
arr.unshift(obj)
|
||||
}
|
||||
})
|
||||
if(arr[0].type=='forest_management'){
|
||||
// let arr = that.data.senList
|
||||
// arr.forEach((item,index)=>{
|
||||
// if(item.type == dataList[that.data.curCaseIndex].default_type){
|
||||
// let obj = arr[index];
|
||||
// arr.splice(index,1)
|
||||
// arr.unshift(obj)
|
||||
// }
|
||||
// })
|
||||
// console.log(arr,666666);
|
||||
// if(arr[0].type=='forest_management'){
|
||||
// that.setData({
|
||||
// isShif:true,
|
||||
// isXiangm:false,
|
||||
// senIndex:1
|
||||
// })
|
||||
// }
|
||||
// that.setData({
|
||||
// senList:arr
|
||||
// })
|
||||
that.setData({
|
||||
isShif:true,
|
||||
isXiangm:false,
|
||||
senIndex:1
|
||||
})
|
||||
}
|
||||
that.setData({
|
||||
senList:arr
|
||||
})
|
||||
that.setData({
|
||||
threeList: threeList,
|
||||
cases_position_id: threeList[that.data.curCaseIndex].address[that.data.addressIndex].id,
|
||||
newDo_type:arr[0].type,
|
||||
threeList: dataList,
|
||||
cases_position_id: dataList[that.data.curCaseIndex].address[that.data.addressIndex].id,
|
||||
newDo_type:that.data.senList[0].type,
|
||||
//TODO 这里赋值应该用数组
|
||||
// curThreeCode: [JSON.parse(res.data.data).trees[0].coding],
|
||||
// carbon:JSON.parse(res.data.data).trees[0].carbon_base,
|
||||
|
|
Loading…
Reference in New Issue