作者 倪静楠

2/23

... ... @@ -10,6 +10,7 @@
top: 0;
left: 0;
width: 100%;
z-index: 100;
}
.mesText {
... ...
... ... @@ -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({
... ...
... ... @@ -276,9 +276,9 @@
if(this.btn){
let that=this
uni.requestSubscribeMessage({
tmplIds: ['_vyqUlQr3bCm0H9UJUpu7LfHQTUyMciK9YRPUg-adAE'],
tmplIds: ['4qUJug8414AUoPuJ13DPBRmLcC9blw6Vm4uRq59FSXU'],
success(res) {
if(res['_vyqUlQr3bCm0H9UJUpu7LfHQTUyMciK9YRPUg-adAE']=='accept'){
if(res['4qUJug8414AUoPuJ13DPBRmLcC9blw6Vm4uRq59FSXU']=='accept'){
request.get('/api/push/xianZhi',{
lat:that.latitude,
lng:that.longitude,
... ...
... ... @@ -353,8 +353,8 @@
border-radius: 50%;
background: #EE0A24;
position: absolute;
right: 0;
top: 0;
right: 26rpx;
top: 22rpx;
z-index: 99;
}
</style>
... ...