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