...
|
...
|
@@ -66,6 +66,9 @@ |
|
|
}
|
|
|
}
|
|
|
},
|
|
|
onShow() {
|
|
|
this.goodData()
|
|
|
},
|
|
|
created() {
|
|
|
this.firstClassify()
|
|
|
let that = this;
|
...
|
...
|
@@ -77,8 +80,13 @@ |
|
|
this.indexs = index
|
|
|
this.secndClassify(ids)
|
|
|
if (this.secondList.length !== 0) {
|
|
|
this.show = true;
|
|
|
this.secondIndex = 0;
|
|
|
if(this.indexs!==0){
|
|
|
this.show = true;
|
|
|
this.secondIndex = 0;
|
|
|
}else{
|
|
|
this.show = false;
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
this.show = !this.show;
|
|
|
}
|
...
|
...
|
@@ -88,9 +96,10 @@ |
|
|
firstClassify() {
|
|
|
request.get('/api/index/fen', {}).then(res => {
|
|
|
this.list = res.data.info
|
|
|
this.list.unshift({id:-1,name:'全部'})
|
|
|
this.secndClassify(this.list[0].id)
|
|
|
}).catch(err => {
|
|
|
|
|
|
|
|
|
})
|
|
|
},
|
|
|
//二级分类
|
...
|
...
|
@@ -113,29 +122,48 @@ |
|
|
//商品
|
|
|
goodData() {
|
|
|
let that = this
|
|
|
request.get('/api/index/cang', {
|
|
|
sort2_id: this.secondId
|
|
|
}).then(res => {
|
|
|
that.goodListLength = res.data.length
|
|
|
let tempData = res.data;
|
|
|
that.goodList = res.data;
|
|
|
that.covers = [];
|
|
|
for (let obj of tempData) {
|
|
|
let tempInfo = JSON.parse(JSON.stringify(that.obj));
|
|
|
tempInfo.id = Number(obj.goods_id);
|
|
|
tempInfo.callout.content = obj.goods_name;
|
|
|
tempInfo.latitude = obj.lat;
|
|
|
tempInfo.longitude = obj.lng;
|
|
|
that.covers.push(tempInfo)
|
|
|
}
|
|
|
|
|
|
|
|
|
}).catch(err => {
|
|
|
|
|
|
})
|
|
|
if(this.indexs==0){
|
|
|
request.get('/api/index/cang', {
|
|
|
sort2_id:''
|
|
|
}).then(res => {
|
|
|
that.goodListLength = res.data.length
|
|
|
let tempData = res.data;
|
|
|
that.goodList = res.data;
|
|
|
that.covers = [];
|
|
|
for (let obj of tempData) {
|
|
|
let tempInfo = JSON.parse(JSON.stringify(that.obj));
|
|
|
tempInfo.id = Number(obj.goods_id);
|
|
|
tempInfo.callout.content = obj.goods_name;
|
|
|
tempInfo.latitude = obj.lat;
|
|
|
tempInfo.longitude = obj.lng;
|
|
|
that.covers.push(tempInfo)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
|
|
|
})
|
|
|
}else{
|
|
|
request.get('/api/index/cang', {
|
|
|
sort2_id: this.secondId
|
|
|
}).then(res => {
|
|
|
that.goodListLength = res.data.length
|
|
|
let tempData = res.data;
|
|
|
that.goodList = res.data;
|
|
|
that.covers = [];
|
|
|
for (let obj of tempData) {
|
|
|
let tempInfo = JSON.parse(JSON.stringify(that.obj));
|
|
|
tempInfo.id = Number(obj.goods_id);
|
|
|
tempInfo.callout.content = obj.goods_name;
|
|
|
tempInfo.latitude = obj.lat;
|
|
|
tempInfo.longitude = obj.lng;
|
|
|
that.covers.push(tempInfo)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
|
|
|
})
|
|
|
}
|
|
|
|
|
|
},
|
|
|
tap(e) {
|
|
|
console.log(e)
|
|
|
var id = e.markerId
|
|
|
var tempId = this.covers[id - 1]
|
|
|
uni.navigateTo({
|
...
|
...
|
|