...
|
...
|
@@ -3,6 +3,7 @@ const app = getApp() |
|
|
Page({
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* 页面的初始数据
|
|
|
*/
|
|
|
data: {
|
...
|
...
|
@@ -43,6 +44,8 @@ Page({ |
|
|
zhinengwrap: false,
|
|
|
citychose: false,
|
|
|
pricechose:false,
|
|
|
morechose:false,
|
|
|
fenchose:false,
|
|
|
use_id: '',
|
|
|
odor_id: '',
|
|
|
package_id: '',
|
...
|
...
|
@@ -55,7 +58,47 @@ Page({ |
|
|
zhinenglist: [],
|
|
|
page:1,
|
|
|
priceyuan:'0元',
|
|
|
pricevalue:0
|
|
|
pricevalue:'',
|
|
|
|
|
|
|
|
|
leftMin: '', //左边滑块最小值
|
|
|
rightMax:'', //右边滑块最大值
|
|
|
leftValue: '', //左边滑块默认值
|
|
|
rightValue: '', //右边滑块默认值
|
|
|
min:'',
|
|
|
max:'',
|
|
|
morelist:[],
|
|
|
morecan:[],
|
|
|
conetentarr:[],
|
|
|
low: 0,
|
|
|
heigh: 100,
|
|
|
number:'',
|
|
|
fenleftMin:'',
|
|
|
fenrightMax:'',
|
|
|
fenmin:'',
|
|
|
fenmax:'',
|
|
|
fennumber:'',
|
|
|
score:'',
|
|
|
pricezhi:'',
|
|
|
selectinfo:'',
|
|
|
|
|
|
// 智能筛选默认值
|
|
|
min: 0,
|
|
|
rmax: 100,
|
|
|
leftValue: 0,
|
|
|
rightValue: 100,
|
|
|
ppvalue: 100,
|
|
|
ppleft: 0,
|
|
|
totalLength: 0,
|
|
|
bigLength: 0,
|
|
|
ratio: 0.5,
|
|
|
sliderLength: 20,
|
|
|
containerLeft: 0, //标识整个组件,距离屏幕左边的距离
|
|
|
hideOption: '', //初始状态为显示组件
|
|
|
maxValue:0
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -68,10 +111,572 @@ Page({ |
|
|
})
|
|
|
|
|
|
|
|
|
this.getshaicontent()
|
|
|
// this.getshaicontent();
|
|
|
this.getmorenconetent();
|
|
|
|
|
|
// this.propertyLeftValueChange();
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
_propertyLeftValueChange: function () {
|
|
|
console.log(this.data.minValue);
|
|
|
console.log(this.data.max);
|
|
|
console.log(this.data.bigLength)
|
|
|
|
|
|
let minValue = this.data.minValue / this.data.max * this.data.bigLength;
|
|
|
console.log(minValue)
|
|
|
let min = this.data.min / this.data.max * this.data.bigLength;
|
|
|
console.log(min)
|
|
|
this.setData({
|
|
|
leftValue: minValue - min,
|
|
|
ppleft: minValue - min
|
|
|
})
|
|
|
|
|
|
console.log(this.data.ppleft)
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 设置右边滑块的值
|
|
|
*/
|
|
|
_propertyRightValueChange: function () {
|
|
|
let right = this.data.maxValue / this.data.max * this.data.bigLength + this.data.sliderLength
|
|
|
this.setData({
|
|
|
rightValue: right,
|
|
|
ppvalue: right
|
|
|
})
|
|
|
|
|
|
console.log(this.data.rightValue)
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取筛选内容
|
|
|
getshaicontent() {
|
|
|
let that = this;
|
|
|
let url = 'index/Filter/filter',
|
|
|
params = {
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
selectinfo: res
|
|
|
})
|
|
|
let newselectinfo=that.data.selectinfo
|
|
|
newselectinfo.price[0].realmin = newselectinfo.price[0].min;
|
|
|
newselectinfo.price[0].realmax = newselectinfo.price[0].max;
|
|
|
newselectinfo.score_list[0].realmin = newselectinfo.score_list[0].min;
|
|
|
newselectinfo.score_list[0].realmax = newselectinfo.score_list[0].max
|
|
|
|
|
|
that.setData({
|
|
|
selectinfo: newselectinfo
|
|
|
})
|
|
|
console.log(that.data.selectinfo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// that._propertyLeftValueChange()
|
|
|
// that._propertyRightValueChange()
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
//显示更多选项
|
|
|
|
|
|
mores(){
|
|
|
let that=this;
|
|
|
this.setData({
|
|
|
morechose:true,
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose: false,
|
|
|
conetentarr:[],
|
|
|
page:1,
|
|
|
zhinenglist:[]
|
|
|
})
|
|
|
|
|
|
let newmorelist = that.data.morelist;
|
|
|
for (var obj of newmorelist) {
|
|
|
obj.sel = false;
|
|
|
obj.contentarr = []
|
|
|
if (obj.basic_sort == 1) {
|
|
|
for (var p of obj.value_list) {
|
|
|
p.twsel = false;
|
|
|
|
|
|
}
|
|
|
} else if (obj.basic_sort == 2) {
|
|
|
|
|
|
obj.zmin = parseInt(obj.min) - parseInt(obj.number);
|
|
|
obj.zmax = parseInt(obj.max) + parseInt(obj.number);
|
|
|
obj.between = obj.realmin + '-' + obj.realmax + obj.unit;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
that.setData({
|
|
|
morelist: newmorelist
|
|
|
})
|
|
|
console.log(that.data.morelist)
|
|
|
|
|
|
|
|
|
|
|
|
// this.getmorecan()
|
|
|
},
|
|
|
//隐藏更多选项
|
|
|
hidemorechose(){
|
|
|
this.setData({
|
|
|
morechose: false,
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose: false,
|
|
|
fenchose: false
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
for (var obj of newnavarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
},
|
|
|
|
|
|
//隐藏评分
|
|
|
hidefen(){
|
|
|
this.setData({
|
|
|
morechose: false,
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose: false,
|
|
|
fenchose:false,
|
|
|
page: 1,
|
|
|
zhinenglist: []
|
|
|
})
|
|
|
console.log(9099090)
|
|
|
console.log(this.data.zhinenglist)
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[5].name = this.data.score
|
|
|
for (var obj of newnavarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
navarr: newnavarr,
|
|
|
|
|
|
})
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
},
|
|
|
|
|
|
//获取更多参数
|
|
|
getmorecan(){
|
|
|
let that = this;
|
|
|
let url = 'index/Filter/more', params = {
|
|
|
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
morelist:res.list
|
|
|
})
|
|
|
|
|
|
let newmorelist = that.data.morelist;
|
|
|
for (var obj of newmorelist) {
|
|
|
obj.sel = false;
|
|
|
obj.contentarr = []
|
|
|
if (obj.basic_sort == 1) {
|
|
|
for (var p of obj.value_list) {
|
|
|
p.twsel = false;
|
|
|
|
|
|
}
|
|
|
} else if (obj.basic_sort == 2) {
|
|
|
obj.realmin = obj.min;
|
|
|
obj.realmax = obj.max;
|
|
|
obj.zmin = parseInt(obj.min) - parseInt(obj.number);
|
|
|
obj.zmax = parseInt(obj.max) + parseInt(obj.number);
|
|
|
obj.between = obj.realmin + '-' + obj.realmax + obj.unit;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
that.setData({
|
|
|
morelist: newmorelist
|
|
|
})
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//更多参数向左滑动效果
|
|
|
lowValueChangeAction1(e){
|
|
|
let that = this;
|
|
|
let index = e.currentTarget.dataset.parindex;
|
|
|
console.log(index)
|
|
|
let id=e.currentTarget.dataset.id;
|
|
|
let basic_sort = e.currentTarget.dataset.basic_sort;
|
|
|
|
|
|
|
|
|
let newmorelist=that.data.morelist;
|
|
|
// newmorelist[index].min = e.detail.lowValue;
|
|
|
newmorelist[index].realmin = e.detail.lowValue
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (e.detail.lowValue < newmorelist[index].zmin + newmorelist[index].number && newmorelist[index].max <= newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
|
|
|
newmorelist[index].between = '<' + newmorelist[index].realmax + newmorelist[index].unit;
|
|
|
newmorelist[index].chuanbetween = 0 + '-' + newmorelist[index].realmax
|
|
|
|
|
|
|
|
|
} else if (e.detail.lowValue < newmorelist[index].zmin + newmorelist[index].number && newmorelist[index].max > newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
newmorelist[index].between = '不限';
|
|
|
newmorelist[index].chuanbetween = 0 + '-' +0
|
|
|
|
|
|
} else if (e.detail.lowValue >= newmorelist[index].zmin + newmorelist[index].number && newmorelist[index].max <= newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
|
|
|
newmorelist[index].between = newmorelist[index].realmin + newmorelist[index].unit + '-' + newmorelist[index].realmax + newmorelist[index].unit
|
|
|
newmorelist[index].chuanbetween = newmorelist[index].realmin + '-' + newmorelist[index].realmax
|
|
|
|
|
|
|
|
|
} else if (e.detail.lowValue >= newmorelist[index].zmin + newmorelist[index].number && newmorelist[index].max > newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
|
|
|
newmorelist[index].between = ">" + newmorelist[index].realmin + newmorelist[index].unit;
|
|
|
newmorelist[index].chuanbetween = newmorelist[index].realmax + '-'+0
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
morelist: newmorelist
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
let chuanobj = {};
|
|
|
let chuancontent = newmorelist[index].chuanbetween;
|
|
|
|
|
|
chuanobj.id = id;
|
|
|
chuanobj.basic_sort = basic_sort;
|
|
|
chuanobj.content = chuancontent;
|
|
|
let newmorecan = this.data.morecan;
|
|
|
newmorecan[index] = chuanobj;
|
|
|
// for (var i = 0; i < newmorecan.length;i++){
|
|
|
// if (newmorecan[i]==undefined){
|
|
|
// newmorecan.splice(i,1)
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
that.setData({
|
|
|
morecan: newmorecan
|
|
|
})
|
|
|
|
|
|
console.log(that.data.morecan)
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
//更多参数向右滑动
|
|
|
heighValueChangeAction1(e){
|
|
|
let that=this;
|
|
|
let index = e.currentTarget.dataset.parindex;
|
|
|
console.log(index)
|
|
|
let id = e.currentTarget.dataset.id;
|
|
|
let basic_sort = e.currentTarget.dataset.basic_sort;
|
|
|
console.log(index)
|
|
|
let newmorelist = that.data.morelist;
|
|
|
newmorelist[index].realmax = e.detail.heighValue
|
|
|
|
|
|
if (newmorelist[index].min < newmorelist[index].zmin + newmorelist[index].number && e.detail.heighValue <= newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
|
|
|
newmorelist[index].between = '<' + newmorelist[index].realmax + newmorelist[index].unit;
|
|
|
newmorelist[index].chuanbetween = 0 + '-' + newmorelist[index].realmax
|
|
|
|
|
|
} else if (newmorelist[index].min < newmorelist[index].zmin + newmorelist[index].number && e.detail.heighValue > newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
|
|
|
newmorelist[index].between = '不限';
|
|
|
newmorelist[index].chuanbetween = 0 + '-' + 0
|
|
|
|
|
|
} else if (newmorelist[index].min >= newmorelist[index].zmin + newmorelist[index].number && e.detail.heighValue <= newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
newmorelist[index].between = newmorelist[index].realmin + newmorelist[index].unit + '-' + newmorelist[index].realmax + newmorelist[index].unit;
|
|
|
newmorelist[index].chuanbetween = newmorelist[index].realmin + '-' + newmorelist[index].realmax
|
|
|
|
|
|
} else if (newmorelist[index].min >= newmorelist[index].zmin + newmorelist[index].number && e.detail.heighValue > newmorelist[index].zmax - newmorelist[index].number) {
|
|
|
newmorelist[index].between = ">" + newmorelist[index].realmin + newmorelist[index].unit,
|
|
|
newmorelist[index].chuanbetween = newmorelist[index].realmin + '-' + 0
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
morelist:newmorelist
|
|
|
})
|
|
|
|
|
|
|
|
|
let chuanobj = {};
|
|
|
let chuancontent = newmorelist[index].chuanbetween;
|
|
|
|
|
|
chuanobj.id = id;
|
|
|
chuanobj.basic_sort = basic_sort;
|
|
|
chuanobj.content = chuancontent;
|
|
|
let newmorecan = this.data.morecan;
|
|
|
newmorecan[index] = chuanobj;
|
|
|
that.setData({
|
|
|
morecan: newmorecan
|
|
|
})
|
|
|
console.log(that.data.morecan.length)
|
|
|
},
|
|
|
|
|
|
//获取更多参数的文字
|
|
|
selectmoreitem(e){
|
|
|
console.log(e)
|
|
|
let id=e.currentTarget.dataset.id;
|
|
|
let basic_sort = e.currentTarget.dataset.basic_sort;
|
|
|
let content=e.currentTarget.dataset.content;
|
|
|
let parentindex = e.currentTarget.dataset.parindex;
|
|
|
let childindex = e.currentTarget.dataset.childindex;
|
|
|
|
|
|
let conetentarr = this.data.conetentarr;
|
|
|
let newmorelist=this.data.morelist;
|
|
|
// let conetentarr = newmorelist[parentindex].contentarr;
|
|
|
console.log(conetentarr)
|
|
|
newmorelist[parentindex].value_list[childindex].twsel = !newmorelist[parentindex].value_list[childindex].twsel
|
|
|
this.setData({
|
|
|
morelist:newmorelist
|
|
|
})
|
|
|
|
|
|
if (newmorelist[parentindex].value_list[childindex].twsel==true){
|
|
|
conetentarr.push(content);
|
|
|
let newlsit = newmorelist[parentindex].value_list;
|
|
|
|
|
|
newmorelist[parentindex].contentarr.push(content);
|
|
|
|
|
|
// for (var i = 0; i < newlsit.length;i++){
|
|
|
// for (var j = 0; j < conetentarr.length;j++){
|
|
|
// if (newlsit[i].content != conetentarr[j]){
|
|
|
// conetentarr.splice(j,1)
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
}else{
|
|
|
console.log(334)
|
|
|
let newconetentarr = this.data.conetentarr;
|
|
|
console.log(childindex)
|
|
|
for (var i = 0; i < newmorelist[parentindex].contentarr.length;i++){
|
|
|
if (newmorelist[parentindex].value_list[childindex].content == newmorelist[parentindex].contentarr[i]){
|
|
|
newmorelist[parentindex].contentarr.splice(i, 1)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// this.setData({
|
|
|
// conetentarr: newconetentarr
|
|
|
// })
|
|
|
|
|
|
// console.log(this.data.conetentarr)
|
|
|
}
|
|
|
|
|
|
let chuancontent = '';
|
|
|
if (newmorelist[parentindex].contentarr.length>0){
|
|
|
|
|
|
newmorelist[parentindex].sel=true,
|
|
|
chuancontent = newmorelist[parentindex].contentarr.join(",")
|
|
|
|
|
|
}else{
|
|
|
chuancontent=''
|
|
|
newmorelist[parentindex].sel = false;
|
|
|
|
|
|
}
|
|
|
this.setData({
|
|
|
morelist: newmorelist
|
|
|
})
|
|
|
|
|
|
console.log(this.data.morelist)
|
|
|
let chuanobj={};
|
|
|
|
|
|
chuanobj.id=id;
|
|
|
chuanobj.basic_sort = basic_sort;
|
|
|
chuanobj.content = chuancontent;
|
|
|
let newmorecan=this.data.morecan;
|
|
|
newmorecan[parentindex] = chuanobj;
|
|
|
|
|
|
if (chuancontent==''){
|
|
|
console.log(newmorecan)
|
|
|
for (var i = 0; i < newmorecan.length;i++){
|
|
|
console.log(newmorecan[i])
|
|
|
if (newmorecan[i]!=undefined){
|
|
|
if (newmorecan[i].id == id) {
|
|
|
newmorecan.splice(i, 1)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
morecan: newmorecan
|
|
|
})
|
|
|
console.log(this.data.morecan);
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//向左移动
|
|
|
|
|
|
lowValueChangeAction: function (e) {
|
|
|
|
|
|
let newselectinfo=this.data.selectinfo
|
|
|
newselectinfo.price[0].realmin = e.detail.lowValue
|
|
|
let that=this;
|
|
|
this.setData({
|
|
|
leftMin: e.detail.lowValue,
|
|
|
selectinfo: newselectinfo
|
|
|
})
|
|
|
|
|
|
if (e.detail.lowValue < that.data.min + that.data.number && that.data.rightMax <= that.data.max - that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: '<' + that.data.rightMax + '元',
|
|
|
pricevalue: 0 + '-' + that.data.rightMax
|
|
|
})
|
|
|
} else if (e.detail.lowValue < that.data.min + that.data.number && that.data.rightMax > that.data.max - that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: '不限',
|
|
|
pricevalue: 0 + '-' + 0
|
|
|
})
|
|
|
} else if (e.detail.lowValue >= that.data.min + that.data.number && that.data.rightMax <= that.data.max - that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: that.data.leftMin + '元' + '-' + that.data.rightMax + '元',
|
|
|
pricevalue: that.data.leftMin + '-' + that.data.rightMax
|
|
|
})
|
|
|
} else if (e.detail.lowValue >= that.data.min + that.data.number && that.data.rightMax > that.data.max - that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: ">" + that.data.leftMin + '元',
|
|
|
pricevalue: that.data.rightMax + '-' + 0
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
},
|
|
|
//向右移动
|
|
|
heighValueChangeAction: function (e) {
|
|
|
let that=this;
|
|
|
let newselectinfo = this.data.selectinfo
|
|
|
newselectinfo.price[0].realmax = e.detail.heighValue
|
|
|
this.setData({
|
|
|
rightMax: e.detail.heighValue,
|
|
|
selectinfo:newselectinfo
|
|
|
})
|
|
|
|
|
|
console.log(e.detail.heighValue);
|
|
|
console.log(that.data.min + that.data.number);
|
|
|
console.log(that.data.max - that.data.number)
|
|
|
if (that.data.leftMin < that.data.min + that.data.number && e.detail.heighValue <= that.data.max-that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: '<' + that.data.rightMax + '元',
|
|
|
pricevalue: 0 + '-' + that.data.rightMax
|
|
|
})
|
|
|
} else if (that.data.leftMin < that.data.min + that.data.number && e.detail.heighValue > that.data.max-that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: '不限',
|
|
|
pricevalue: 0 + '-' + 0
|
|
|
})
|
|
|
} else if (that.data.leftMin >= that.data.min + that.data.number && e.detail.heighValue <= that.data.max-that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: that.data.leftMin + '元' + '-' + that.data.rightMax + '元',
|
|
|
pricevalue: that.data.leftMin + '-' + that.data.rightMax
|
|
|
})
|
|
|
} else if (that.data.leftMin >= that.data.min + that.data.number && e.detail.heighValue > that.data.max-that.data.number) {
|
|
|
that.setData({
|
|
|
priceyuan: ">" + that.data.leftMin + '元',
|
|
|
pricevalue: that.data.leftMin + '-' + 0
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//评分向左移动
|
|
|
fenlowValueChangeAction(e){
|
|
|
let that = this;
|
|
|
let newselectinfo = that.data.selectinfo
|
|
|
newselectinfo.score_list[0].realmin = e.detail.lowValue
|
|
|
that.setData({
|
|
|
fenleftMin: e.detail.lowValue,
|
|
|
selectinfo:newselectinfo
|
|
|
})
|
|
|
|
|
|
|
|
|
if (e.detail.lowValue < that.data.fenmin + that.data.fennumber && that.data.fenrightMax <= that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: '<' + that.data.fenrightMax + '分',
|
|
|
chuanscore: 0 + '-' + that.data.fenrightMax
|
|
|
})
|
|
|
} else if (e.detail.lowValue < that.data.fenmin + that.data.fennumber && that.data.fenrightMax > that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: '不限',
|
|
|
chuanscore: 0 + '-' + 0
|
|
|
})
|
|
|
} else if (e.detail.lowValue >= that.data.fenmin + that.data.fennumber && that.data.fenrightMax <= that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: that.data.fenleftMin + '分' + '-' + that.data.fenrightMax + '分',
|
|
|
chuanscore: that.data.fenleftMin + '-' + that.data.fenrightMax
|
|
|
})
|
|
|
} else if (e.detail.lowValue >= that.data.fenmin + that.data.fennumber && that.data.fenrightMax > that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: ">" + that.data.fenleftMin + '分',
|
|
|
chuanscore: that.data.fenrightMax + '-' + 0
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//评分向右移动
|
|
|
fenheighValueChangeAction: function (e) {
|
|
|
let that = this;
|
|
|
|
|
|
let newselectinfo = that.data.selectinfo
|
|
|
newselectinfo.score_list[0].realmax = e.detail.heighValue
|
|
|
this.setData({
|
|
|
fenrightMax: e.detail.heighValue,
|
|
|
selectinfo:newselectinfo
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
if (that.data.fenleftMin < that.data.fenmin + that.data.fennumber && e.detail.fenheighValue <= that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: '<' + that.data.fenrightMax + '分',
|
|
|
chuanscore: 0 + '-' + that.data.fenrightMax
|
|
|
})
|
|
|
} else if (that.data.fenleftMin < that.data.fenmin + that.data.fennumber && e.detail.heighValue > that.data.fenmax - that.data.fennumber) {
|
|
|
|
|
|
that.setData({
|
|
|
score: '不限',
|
|
|
chuanscore: 0 + '-' + 0
|
|
|
})
|
|
|
} else if (that.data.fenleftMin >= that.data.fenmin + that.data.fennumber && e.detail.heighValue <= that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: that.data.fenleftMin + '分' + '-' + that.data.fenrightMax + '分',
|
|
|
chuanscore: that.data.fenleftMin + '-' + that.data.fenrightMax
|
|
|
})
|
|
|
} else if (that.data.fenleftMin >= that.data.fenmin + that.data.fennumber && e.detail.heighValue > that.data.fenmax - that.data.fennumber) {
|
|
|
that.setData({
|
|
|
score: ">" + that.data.fenleftMin + '分',
|
|
|
chuanscore: that.data.fenleftMin + '-' + 0
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
|
|
|
select(e) {
|
|
|
|
|
|
let that = this;
|
...
|
...
|
@@ -80,11 +685,16 @@ Page({ |
|
|
let type = e.currentTarget.dataset.type;
|
|
|
this.setData({
|
|
|
type: type,
|
|
|
// page:1,
|
|
|
// zhinenglist:[]
|
|
|
|
|
|
})
|
|
|
|
|
|
console.log(that.data.zhinenglist)
|
|
|
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
|
|
|
for (var i = 0; i < newnavarr.length; i++) {
|
|
|
if (i == index) {
|
|
|
newnavarr[i].sel = !newnavarr[i].sel;
|
...
|
...
|
@@ -95,25 +705,56 @@ Page({ |
|
|
this.setData({
|
|
|
citychose: true,
|
|
|
zhinengwrap: false,
|
|
|
pricechose: false
|
|
|
pricechose: false,
|
|
|
morechose:false,
|
|
|
fenchose:false
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose: false
|
|
|
pricechose: false,
|
|
|
morechose: false,
|
|
|
fenchose: false
|
|
|
|
|
|
|
|
|
})
|
|
|
}
|
|
|
}else if(type==2){
|
|
|
if (newnavarr[i].sel == true) {
|
|
|
|
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose:true,
|
|
|
morechose: false,
|
|
|
fenchose: false
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose:false,
|
|
|
morechose: false,
|
|
|
fenchose: false
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else if(type==6){
|
|
|
if (newnavarr[i].sel == true) {
|
|
|
console.log(999)
|
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose:true
|
|
|
pricechose: false,
|
|
|
morechose: false,
|
|
|
fenchose: true
|
|
|
|
|
|
})
|
|
|
|
...
|
...
|
@@ -121,7 +762,9 @@ Page({ |
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose:false
|
|
|
pricechose: false,
|
|
|
morechose: false,
|
|
|
fenchose: false
|
|
|
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -131,7 +774,9 @@ Page({ |
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: true,
|
|
|
pricechose: false
|
|
|
pricechose: false,
|
|
|
morechose: false,
|
|
|
fenchose: false
|
|
|
|
|
|
|
|
|
})
|
...
|
...
|
@@ -140,7 +785,9 @@ Page({ |
|
|
this.setData({
|
|
|
citychose: false,
|
|
|
zhinengwrap: false,
|
|
|
pricechose: false
|
|
|
pricechose: false,
|
|
|
morechose: false,
|
|
|
fenchose: false
|
|
|
|
|
|
|
|
|
})
|
...
|
...
|
@@ -159,244 +806,242 @@ Page({ |
|
|
})
|
|
|
|
|
|
|
|
|
//筛选
|
|
|
|
|
|
this.getshaicontent();
|
|
|
this.getmorenconetent();
|
|
|
console.log(that.data.selectinfo)
|
|
|
|
|
|
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
console.log(342347)
|
|
|
console.log(that.data.type);
|
|
|
console.log(newzhinengarr1)
|
|
|
// for (var obj of newzhinengarr1) {
|
|
|
// if (that.data.type == 1) {
|
|
|
// console.log(this.data.use_id)
|
|
|
// if (obj.id = this.data.use_id) {
|
|
|
// obj.sel = true
|
|
|
// }
|
|
|
// this.setData({
|
|
|
// zhinengarr: newzhinengarr1
|
|
|
// })
|
|
|
// } else if (that.data.type == 3) {
|
|
|
// if (obj.id = this.data.package_id) {
|
|
|
// obj.sel = true
|
|
|
// }
|
|
|
// this.setData({
|
|
|
// zhinengarr: newzhinengarr1
|
|
|
// })
|
|
|
// } else if (that.data.type == 4) {
|
|
|
// if (obj.city = this.data.city) {
|
|
|
// obj.sel = true
|
|
|
// }
|
|
|
// this.setData({
|
|
|
// zhinengarr: newzhinengarr1
|
|
|
// })
|
|
|
// } else if (that.data.type == 5) {
|
|
|
// if (obj.id = this.data.odor_id) {
|
|
|
// obj.sel = true
|
|
|
// }
|
|
|
// this.setData({
|
|
|
// zhinengarr: newzhinengarr1
|
|
|
// })
|
|
|
// }
|
|
|
// }
|
|
|
if (that.data.type == 1) {
|
|
|
that.setData({
|
|
|
zhinengarr:that.data.selectinfo.use
|
|
|
})
|
|
|
|
|
|
},
|
|
|
//隐藏智能筛选
|
|
|
hidezhineng() {
|
|
|
this.setData({
|
|
|
zhinengwrap: false
|
|
|
})
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
for (var obj of newnavarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.id == that.data.use_id) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
},
|
|
|
hide() {
|
|
|
this.setData({
|
|
|
citychose: false
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
for (var obj of newnavarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
},
|
|
|
//获取筛选内容
|
|
|
getshaicontent() {
|
|
|
let that = this;
|
|
|
let url = 'index/Filter/filter',
|
|
|
params = {
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
} else if (that.data.type == 2) {
|
|
|
console.log(that.data.selectinfo)
|
|
|
|
|
|
|
|
|
if (that.data.type == 1) {
|
|
|
that.setData({
|
|
|
let middlevalue = '';
|
|
|
|
|
|
zhinengarr: res.use
|
|
|
})
|
|
|
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
that.setData({
|
|
|
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.id == that.data.use_id) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
}
|
|
|
leftMin: parseInt(that.data.selectinfo.price[0].realmin),
|
|
|
rightMax: parseInt(that.data.selectinfo.price[0].realmax),
|
|
|
|
|
|
min: parseInt(that.data.selectinfo.price[0].min) - parseInt(that.data.selectinfo.price[0].number),
|
|
|
max: parseInt(that.data.selectinfo.price[0].max) + parseInt(that.data.selectinfo.price[0].number),
|
|
|
priceyuan: that.data.selectinfo.price[0].realmin + '元' + '-' + that.data.selectinfo.price[0].realmax + '元',
|
|
|
pricevalue: that.data.selectinfo.price[0].realmin + '-' + that.data.selectinfo.price[0].realmax,
|
|
|
number: that.data.selectinfo.price[0].number
|
|
|
})
|
|
|
console.log(909080807070)
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
console.log(that.data.leftMin);
|
|
|
console.log(that.data.rightMax);
|
|
|
console.log(that.data.min)
|
|
|
console.log(that.data.max)
|
|
|
|
|
|
|
|
|
} else if (that.data.type == 2) {
|
|
|
that.setData({
|
|
|
zhinengarr: res.price
|
|
|
})
|
|
|
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
that.setData({
|
|
|
zhinengarr: that.data.selectinfo.price
|
|
|
})
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
|
|
|
} else if (that.data.type == 3) {
|
|
|
that.setData({
|
|
|
|
|
|
} else if (that.data.type == 3) {
|
|
|
that.setData({
|
|
|
|
|
|
zhinengarr: res.packages
|
|
|
})
|
|
|
zhinengarr: that.data.selectinfo.packages
|
|
|
})
|
|
|
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
|
|
|
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.id == that.data.package_id) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.id == that.data.package_id) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
} else if (that.data.type == 4) {
|
|
|
that.setData({
|
|
|
zhinengarr: res.city
|
|
|
})
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
} else if (that.data.type == 4) {
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: that.data.selectinfo.city
|
|
|
})
|
|
|
|
|
|
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
|
|
|
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.city == that.data.city) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.city == that.data.city) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
|
|
|
|
|
|
} else if (that.data.type == 5) {
|
|
|
that.setData({
|
|
|
|
|
|
zhinengarr: res.odor
|
|
|
})
|
|
|
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
} else if (that.data.type == 5) {
|
|
|
that.setData({
|
|
|
|
|
|
zhinengarr: that.data.selectinfo.odor
|
|
|
})
|
|
|
|
|
|
let newzhinengarr = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.id == that.data.odor_id) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
|
|
|
|
|
|
|
|
let newzhinengarr1 = that.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr1) {
|
|
|
if (obj.id == that.data.odor_id) {
|
|
|
obj.sel = true
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
that.setData({
|
|
|
zhinengarr: newzhinengarr1
|
|
|
})
|
|
|
|
|
|
} else if (that.data.type == 6) {
|
|
|
that.setData({
|
|
|
|
|
|
zhinengarr: res.score_list
|
|
|
})
|
|
|
}
|
|
|
} else if (that.data.type == 6) {
|
|
|
console.log(that.data.selectinfo)
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
zhinengarr: that.data.selectinfo.score_list
|
|
|
})
|
|
|
|
|
|
|
|
|
that.setData({
|
|
|
|
|
|
fenleftMin: parseInt(that.data.selectinfo.score_list[0].realmin),
|
|
|
fenrightMax: parseInt(that.data.selectinfo.score_list[0].realmax),
|
|
|
|
|
|
fenmin: parseInt(that.data.selectinfo.score_list[0].min) - parseInt(that.data.selectinfo.score_list[0].number),
|
|
|
fenmax: parseInt(that.data.selectinfo.score_list[0].max) + parseInt(that.data.selectinfo.score_list[0].number),
|
|
|
score: that.data.selectinfo.score_list[0].realmin + that.data.selectinfo.score_list[0].unit + '-' + that.data.selectinfo.score_list[0].realmax + that.data.selectinfo.score_list[0].unit,
|
|
|
chuanscore: that.data.selectinfo.score_list[0].realmin + '-' + that.data.selectinfo.score_list[0].realmax,
|
|
|
fennumber: that.data.selectinfo.score_list[0].number
|
|
|
})
|
|
|
|
|
|
console.log(that.data.fenmax)
|
|
|
|
|
|
console.log(that.data.fenleftMin);
|
|
|
console.log(that.data.fenrightMax)
|
|
|
}
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
this._propertyLeftValueChange();
|
|
|
this._propertyRightValueChange()
|
|
|
// that.getshaicontent();
|
|
|
|
|
|
|
|
|
// this.getmorenconetent();
|
|
|
|
|
|
// let newzhinengarr1 = that.data.zhinengarr;
|
|
|
},
|
|
|
//隐藏智能筛选
|
|
|
hidezhineng() {
|
|
|
this.setData({
|
|
|
zhinengwrap: false
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
for (var obj of newnavarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
|
|
|
},
|
|
|
hide() {
|
|
|
this.setData({
|
|
|
citychose: false
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
for (var obj of newnavarr) {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
this.setData({
|
|
|
navarr: newnavarr,
|
|
|
// page:1,
|
|
|
// zhinenglist:[]
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//选择种类
|
|
|
shosekind(e) {
|
|
|
let id = e.currentTarget.dataset.id;
|
|
|
console.log(this.data.type)
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
zhinenglist:[],
|
|
|
page:1
|
|
|
})
|
|
|
|
|
|
let newzhinengarr = this.data.zhinengarr;
|
|
|
for (var obj of newzhinengarr) {
|
...
|
...
|
@@ -404,6 +1049,7 @@ Page({ |
|
|
|
|
|
|
|
|
if (this.data.type == 1) {
|
|
|
console.log(111)
|
|
|
obj.sel = !obj.sel;
|
|
|
if (obj.sel == true) {
|
|
|
this.setData({
|
...
|
...
|
@@ -419,10 +1065,17 @@ Page({ |
|
|
this.setData({
|
|
|
use_id: ''
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[0].name = '用途';
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
|
|
|
} else if (this.data.type == 3) {
|
|
|
console.log(333)
|
|
|
obj.sel = !obj.sel;
|
|
|
if (obj.sel == true) {
|
|
|
this.setData({
|
...
|
...
|
@@ -438,10 +1091,17 @@ Page({ |
|
|
this.setData({
|
|
|
package_id: ''
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[2].name = '包装';
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
|
|
|
} else if (this.data.type == 5) {
|
|
|
console.log(555)
|
|
|
obj.sel = !obj.sel;
|
|
|
if (obj.sel == true) {
|
|
|
this.setData({
|
...
|
...
|
@@ -457,48 +1117,62 @@ Page({ |
|
|
this.setData({
|
|
|
odor_id: ''
|
|
|
})
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[4].name = '香型';
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
}
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
}
|
|
|
|
|
|
} else if (this.data.type == 4) {
|
|
|
console.log(444)
|
|
|
let cityname = e.currentTarget.dataset.name;
|
|
|
|
|
|
|
|
|
} else {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
if (this.data.type == 4) {
|
|
|
let cityname = e.currentTarget.dataset.name;
|
|
|
if (obj.city == cityname) {
|
|
|
obj.sel = !obj.sel
|
|
|
if (obj.sel == true) {
|
|
|
this.setData({
|
|
|
city: obj.city,
|
|
|
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[3].name = obj.city;
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
city: ''
|
|
|
})
|
|
|
|
|
|
if (obj.city == cityname) {
|
|
|
obj.sel = !obj.sel
|
|
|
if (obj.sel == true) {
|
|
|
this.setData({
|
|
|
city: obj.city,
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[3].name = '产区';
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
let newnavarr = this.data.navarr;
|
|
|
newnavarr[3].name = obj.city;
|
|
|
this.setData({
|
|
|
navarr: newnavarr
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
this.setData({
|
|
|
city: ''
|
|
|
})
|
|
|
|
|
|
obj.sel = false
|
|
|
}
|
|
|
} else {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
} else {
|
|
|
obj.sel = false
|
|
|
}
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
this.getmorenconetent()
|
|
|
|
|
|
this.setData({
|
|
|
zhinengarr: newzhinengarr
|
|
|
})
|
...
|
...
|
@@ -507,33 +1181,55 @@ Page({ |
|
|
},
|
|
|
//获取默认数据
|
|
|
getmorenconetent() {
|
|
|
|
|
|
let that = this;
|
|
|
console.log(that.data.pricevalues)
|
|
|
|
|
|
let nemore='';
|
|
|
let canarr=[];
|
|
|
if(that.data.morecan.length==0){
|
|
|
console.log(99000)
|
|
|
nemore=''
|
|
|
}else{
|
|
|
console.log(98000)
|
|
|
let pp = that.data.morecan
|
|
|
|
|
|
// console.log(nemore.length)
|
|
|
for (var i = 0; i < pp.length;i++){
|
|
|
console.log(typeof (pp[i]))
|
|
|
if (typeof (pp[i]) == 'object'){
|
|
|
canarr.push(pp[i])
|
|
|
// nemore.splice(i,1)
|
|
|
}
|
|
|
}
|
|
|
nemore = canarr
|
|
|
|
|
|
}
|
|
|
console.log(nemore)
|
|
|
|
|
|
let url = 'index/Filter/index',
|
|
|
params = {
|
|
|
use_id: that.data.use_id,
|
|
|
odor_id: that.data.odor_id,
|
|
|
price: that.data.pricevalues,
|
|
|
price: that.data.pricevalue,
|
|
|
package_id: that.data.package_id,
|
|
|
city: that.data.city,
|
|
|
score: that.data.score,
|
|
|
more: that.data.more,
|
|
|
score: that.data.chuanscore,
|
|
|
more: nemore,
|
|
|
page: that.data.page
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res);
|
|
|
that.setData({
|
|
|
zhinenglist: res.list
|
|
|
zhinenglist: this.data.zhinenglist.concat(res.list)
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
|
|
|
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
//收藏
|
|
|
collect(e) {
|
|
|
let that = this;
|
...
|
...
|
@@ -543,7 +1239,6 @@ Page({ |
|
|
params = {
|
|
|
sort: 1,
|
|
|
id: id
|
|
|
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
|
...
|
...
|
@@ -551,7 +1246,22 @@ Page({ |
|
|
title: res,
|
|
|
icon: 'none'
|
|
|
})
|
|
|
that.getmorenconetent()
|
|
|
|
|
|
let newzhinenglist = that.data.zhinenglist;
|
|
|
for(var obj of newzhinenglist){
|
|
|
if(obj.id==id){
|
|
|
if (obj.is_favorite==0){
|
|
|
obj.is_favorite=1
|
|
|
}else{
|
|
|
obj.is_favorite = 0
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
that.setData({
|
|
|
zhinenglist:newzhinenglist
|
|
|
})
|
|
|
// that.getmorenconetent()
|
|
|
|
|
|
|
|
|
}).catch((err) => {
|
...
|
...
|
@@ -559,7 +1269,7 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
changing(e){
|
|
|
console.log(e);
|
|
|
|
|
|
this.setData({
|
|
|
priceyuan:e.detail.value+'元',
|
|
|
pricevalue:e.detail.value
|
...
|
...
|
@@ -568,7 +1278,9 @@ Page({ |
|
|
|
|
|
hideprice(){
|
|
|
this.setData({
|
|
|
pricechose:false
|
|
|
pricechose:false,
|
|
|
page:1,
|
|
|
zhinenglist:[]
|
|
|
})
|
|
|
let newnavarr = this.data.navarr;
|
|
|
for (var obj of newnavarr) {
|
...
|
...
|
@@ -581,6 +1293,14 @@ Page({ |
|
|
|
|
|
this.getmorenconetent()
|
|
|
},
|
|
|
|
|
|
jumpbrand(e) {
|
|
|
let id = e.currentTarget.dataset.id
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/homeblock/jiuzidian/jiuzidian?id=' + id,
|
|
|
})
|
|
|
|
|
|
},
|
|
|
/**
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
*/
|
...
|
...
|
@@ -592,6 +1312,9 @@ Page({ |
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function() {
|
|
|
this.getshaicontent()
|
|
|
this.getmorecan()
|
|
|
// this.getshaicontent();
|
|
|
|
|
|
},
|
|
|
|
...
|
...
|
@@ -620,7 +1343,12 @@ Page({ |
|
|
* 页面上拉触底事件的处理函数
|
|
|
*/
|
|
|
onReachBottom: function() {
|
|
|
|
|
|
let page=this.data.page;
|
|
|
page++;
|
|
|
this.setData({
|
|
|
page:page
|
|
|
})
|
|
|
this.getmorenconetent()
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|