...
|
...
|
@@ -70,7 +70,7 @@ Page({ |
|
|
},
|
|
|
getPost(url,params,header) {
|
|
|
app.post(url,params,header).then((res) => {
|
|
|
// console.log('三级分类', res);
|
|
|
console.log('三级分类', res);
|
|
|
this.setData({
|
|
|
portal_three: res,
|
|
|
// postImg: postImg
|
...
|
...
|
@@ -90,11 +90,19 @@ Page({ |
|
|
};
|
|
|
self.getPost(url,params,header)
|
|
|
}else {
|
|
|
if(self.data.currentPortalOne === 2 || self.data.currentPortalOne === 3) {
|
|
|
let params = {
|
|
|
id: self.data.portal_two.category[self.data.value[0]].id,
|
|
|
};
|
|
|
console.log(('2-3'));
|
|
|
self.getPost(url,params,header)
|
|
|
}else {
|
|
|
let params = {
|
|
|
id: self.data.portal_two.category[self.data.value[1]].id,
|
|
|
};
|
|
|
self.getPost(url,params,header)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
//点击一级分类
|
|
|
choosePortalOne(e) {
|
...
|
...
|
@@ -111,10 +119,28 @@ Page({ |
|
|
},
|
|
|
// 滑动picker
|
|
|
bindChangePicker(e) {
|
|
|
console.log(e);
|
|
|
if(this.data.currentPortalOne === 2 || this.data.currentPortalOne === 3) {
|
|
|
if(e.detail.value[0] !== this.data.value[0] || e.detail.value[0] === this.data.value[0]) {
|
|
|
console.log('id',this.data.portal_two.category[this.data.value[0]].id);
|
|
|
this.getPortalThree()
|
|
|
}
|
|
|
}
|
|
|
this.setData({value: e.detail.value});
|
|
|
if(this.data.currentPortalOne !== 6 && this.data.currentPortalOne !== 7) {
|
|
|
console.log(e.detail.value);
|
|
|
if(this.data.currentPortalOne !== 6 && this.data.currentPortalOne !== 7 &&
|
|
|
this.data.currentPortalOne !== 2 && this.data.currentPortalOne !== 3
|
|
|
) {
|
|
|
this.getPortalThree()
|
|
|
}
|
|
|
// if(this.data.currentPortalOne === 2 || this.data.currentPortalOne === 3) {
|
|
|
// console.log(this.data.portal_two.category[this.data.value[0]].name);
|
|
|
// var name = this.data.portal_two.category[this.data.value[0]].name;
|
|
|
// if(name === '招租' || name === '求租') {
|
|
|
// console.log('调接口');
|
|
|
// this.getPortalThree()
|
|
|
// }
|
|
|
// }
|
|
|
},
|
|
|
//确定提交picker
|
|
|
submitPicker() {
|
...
|
...
|
@@ -165,7 +191,7 @@ Page({ |
|
|
this.data.currentPortalOne === 4|| this.data.currentPortalOne === 5){
|
|
|
this.setData({
|
|
|
last_category_id:this.data.portal_three.category[this.data.value[1]].id,
|
|
|
select_id: this.data.portal_two.category[this.data.value[0]].id
|
|
|
select_id: this.data.portal_two.select[this.data.value[0]].id
|
|
|
});
|
|
|
}else {
|
|
|
this.setData({
|
...
|
...
|
@@ -324,7 +350,7 @@ Page({ |
|
|
let header = {
|
|
|
"XX-Token": wx.getStorageSync('token')
|
|
|
};
|
|
|
// console.log(self.data.last_category_id, self.data.select_id,self.data.images);
|
|
|
console.log(self.data,self.data.last_category_id, self.data.select_id,self.data.images);
|
|
|
let params = {
|
|
|
category_id: self.data.last_category_id,//最后选的分类的id
|
|
|
type: self.data.select_id !== ''?self.data.select_id: '',//select_id,没有不传
|
...
|
...
|
|