@@ -79,7 +79,7 @@ Page({ | |||||
}).then(res => { | }).then(res => { | ||||
const keys = Object.keys(res.data) | const keys = Object.keys(res.data) | ||||
if (keys.length > 0) { | if (keys.length > 0) { | ||||
const mallList = [] | |||||
const list = [] | |||||
let i = 0 | let i = 0 | ||||
keys.forEach(item => { | keys.forEach(item => { | ||||
const arr = item.split('|') | const arr = item.split('|') | ||||
@@ -92,11 +92,20 @@ Page({ | |||||
if (i == 0) { | if (i == 0) { | ||||
obj.expand = true | obj.expand = true | ||||
} | } | ||||
mallList.push(obj) | |||||
list.push(obj) | |||||
i++ | i++ | ||||
}) | }) | ||||
const mallList = [] | |||||
// 过滤商管商户 | |||||
list[0].merchantVoList.forEach(item => { | |||||
if (!item.isAdmin) { | |||||
mallList.push(item) | |||||
} | |||||
}) | |||||
that.setData({ | that.setData({ | ||||
mallList: mallList[0].merchantVoList | |||||
mallList | |||||
}) | }) | ||||
console.log(that.data.mallList, 'mallList'); | console.log(that.data.mallList, 'mallList'); | ||||
@@ -115,6 +124,9 @@ Page({ | |||||
// 获取适用门店所在的城市list | // 获取适用门店所在的城市list | ||||
getCityList(couponChannelId) { | getCityList(couponChannelId) { | ||||
tt.showLoading({ | |||||
title: '加载中...', | |||||
}) | |||||
const that = this | const that = this | ||||
Http.get({ | Http.get({ | ||||
url: config.api.couponMerchantCity, | url: config.api.couponMerchantCity, | ||||
@@ -140,6 +152,7 @@ Page({ | |||||
}) | }) | ||||
console.log(tagArr, 'tagArr'); | console.log(tagArr, 'tagArr'); | ||||
console.log(cityArr, 'cityArr'); | console.log(cityArr, 'cityArr'); | ||||
tt.hideLoading(); | |||||
}).catch(err => { | }).catch(err => { | ||||
console.log(err, 'err'); | console.log(err, 'err'); | ||||
}) | }) | ||||
@@ -320,12 +333,38 @@ Page({ | |||||
}, | }, | ||||
goSetShop(e) { | goSetShop(e) { | ||||
if (e.target.id == "goMap") return | |||||
const item = e.currentTarget.dataset.item | const item = e.currentTarget.dataset.item | ||||
console.log(item, 'item'); | console.log(item, 'item'); | ||||
app.globalData.shopItem = item | app.globalData.shopItem = item | ||||
tt.navigateBack(); | tt.navigateBack(); | ||||
}, | }, | ||||
//跳转地图页面 | |||||
goMap(e) { | |||||
const item = e.currentTarget.dataset.item | |||||
const latitude = Number(item.latitude) | |||||
const longitude = Number(item.longitude) | |||||
if (!latitude && !latitude) { | |||||
tt.showToast({ | |||||
title: '抱歉,该门店暂不支持!', | |||||
}); | |||||
return | |||||
} | |||||
tt.openLocation({ | |||||
latitude, | |||||
longitude, | |||||
scale: 18, | |||||
success() { | |||||
console.log("打开地图成功"); | |||||
}, | |||||
fail(err) { | |||||
console.log("打开地图失败:", err.errMsg); | |||||
}, | |||||
}); | |||||
}, | |||||
goFindShop(e) { | goFindShop(e) { | ||||
const name = e.currentTarget.dataset.name | const name = e.currentTarget.dataset.name | ||||
this.setData({ | this.setData({ | ||||
@@ -34,13 +34,14 @@ page { | |||||
margin: auto; | margin: auto; | ||||
.item { | .item { | ||||
position: relative; | |||||
display: flex; | display: flex; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
width: 95%; | width: 95%; | ||||
margin: auto; | margin: auto; | ||||
color: #ffffff; | color: #ffffff; | ||||
margin-bottom: 30rpx; | margin-bottom: 30rpx; | ||||
padding: 20rpx 25rpx; | |||||
padding: 20rpx 25rpx 50rpx 25rpx; | |||||
box-sizing: border-box !important; | box-sizing: border-box !important; | ||||
background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%); | background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%); | ||||
border-radius: 12rpx; | border-radius: 12rpx; | ||||
@@ -88,6 +89,15 @@ page { | |||||
text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
} | } | ||||
} | } | ||||
.mapBtn { | |||||
position: absolute; | |||||
bottom: 15rpx; | |||||
right: 15rpx; | |||||
padding: 7rpx 12rpx; | |||||
border-radius: 15rpx; | |||||
background-color: #f76767; | |||||
} | |||||
} | } | ||||
.takeingPlace { | .takeingPlace { | ||||
@@ -21,6 +21,9 @@ | |||||
<view class="infoItem">{{ item.merchantName }}</view> | <view class="infoItem">{{ item.merchantName }}</view> | ||||
<view class="infoItem">地址:{{ item.addr }}</view> | <view class="infoItem">地址:{{ item.addr }}</view> | ||||
</view> | </view> | ||||
<view tt:if="{{ isLocation }}" id="goMap" class="mapBtn" bindtap="goMap" data-item="{{ item }}">去这里 | |||||
</view> | |||||
</view> | </view> | ||||
</view> | </view> | ||||
@@ -31,13 +31,14 @@ page .continer .selectShop .shopList { | |||||
margin: auto; | margin: auto; | ||||
} | } | ||||
page .continer .selectShop .shopList .item { | page .continer .selectShop .shopList .item { | ||||
position: relative; | |||||
display: flex; | display: flex; | ||||
justify-content: space-between; | justify-content: space-between; | ||||
width: 95%; | width: 95%; | ||||
margin: auto; | margin: auto; | ||||
color: #ffffff; | color: #ffffff; | ||||
margin-bottom: 30rpx; | margin-bottom: 30rpx; | ||||
padding: 20rpx 25rpx; | |||||
padding: 20rpx 25rpx 50rpx 25rpx; | |||||
box-sizing: border-box !important; | box-sizing: border-box !important; | ||||
background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%); | background-image: linear-gradient(to top, #48c6ef 0%, #6f86d6 100%); | ||||
border-radius: 12rpx; | border-radius: 12rpx; | ||||
@@ -80,6 +81,14 @@ page .continer .selectShop .shopList .item .infoBox2 .infoItem { | |||||
overflow: hidden; | overflow: hidden; | ||||
text-overflow: ellipsis; | text-overflow: ellipsis; | ||||
} | } | ||||
page .continer .selectShop .shopList .item .mapBtn { | |||||
position: absolute; | |||||
bottom: 15rpx; | |||||
right: 15rpx; | |||||
padding: 7rpx 12rpx; | |||||
border-radius: 15rpx; | |||||
background-color: #f76767; | |||||
} | |||||
page .continer .selectShop .shopList .takeingPlace { | page .continer .selectShop .shopList .takeingPlace { | ||||
text-align: center; | text-align: center; | ||||
margin-top: 30rpx; | margin-top: 30rpx; | ||||