diff --git a/index/user.ttml b/index/user.ttml index 570055b..9ec2e43 100644 --- a/index/user.ttml +++ b/index/user.ttml @@ -83,7 +83,7 @@ - Version 2.8.3 + Version 2.8.6 diff --git a/pages/coupon/confirmation/confirmation.js b/pages/coupon/confirmation/confirmation.js index fb541ac..b3bb64a 100644 --- a/pages/coupon/confirmation/confirmation.js +++ b/pages/coupon/confirmation/confirmation.js @@ -21,7 +21,9 @@ Page({ currentIndex: "", mallList: [], latitude: "", - longitude: "" + longitude: "", + merOrderId: "", + shopItem: null }, onLoad: function (options) { console.log(options, 'options!!!!!!!'); @@ -37,7 +39,13 @@ Page({ } console.log(this.data.mallTenantId, 'mallTenantId'); - this.getCouponMerchant(options.merOrderId) + if (options.merOrderId) { + this.setData({ + merOrderId: options.merOrderId + }) + } + + // this.getCouponMerchant(options.merOrderId) tt.showLoading({ title: "加载中..." @@ -1174,7 +1182,27 @@ Page({ }) }, + goSelectShop() { + const data = this.data + const isOrder = true + const merOrderId = data.merOrderId + + tt.navigateTo({ + url: `/pages2/shopSelect/shopSelect?isOrder=${isOrder}&merOrderId=${merOrderId}`, + }); + }, + onShow() { this.getIm() + const shopItem = app.globalData.shopItem + if (shopItem) { + this.setData({ + shopItem, + merchantId: shopItem.id, + reservationMerchantName: "" + }) + console.log(this.data.shopItem, 'shopItem'); + app.globalData.shopItem = null + } } }) \ No newline at end of file diff --git a/pages/coupon/confirmation/confirmation.ttml b/pages/coupon/confirmation/confirmation.ttml index c4c2b23..c2341cb 100644 --- a/pages/coupon/confirmation/confirmation.ttml +++ b/pages/coupon/confirmation/confirmation.ttml @@ -35,7 +35,7 @@ - + + + + 选择可用商户: + + + 请选择 + + + + + 选择可用商户:{{ reservationMerchantName + }} + + 选择可用商户:{{ + shopItem.merchantName }} {{shopItem.distance_str }} \ No newline at end of file diff --git a/pages2/appointment/appointment.js b/pages2/appointment/appointment.js index 62198c8..b2a8c8c 100644 --- a/pages2/appointment/appointment.js +++ b/pages2/appointment/appointment.js @@ -527,7 +527,6 @@ Page({ onShow() { const shopItem = app.globalData.shopItem if (shopItem) { - console.log('Yes!!!'); this.setData({ shopItem, merchantId: shopItem.id, diff --git a/pages2/appointment/appointment.ttml b/pages2/appointment/appointment.ttml index 0d2c0e8..a575910 100644 --- a/pages2/appointment/appointment.ttml +++ b/pages2/appointment/appointment.ttml @@ -61,7 +61,7 @@ --> - 选择可用商户(Beta): + 选择可用商户: 请选择 @@ -69,7 +69,7 @@ - 选择可用商户(Beta):{{ reservationMerchantName + 选择可用商户:{{ reservationMerchantName }} 选择可用商户:{{ diff --git a/pages2/shopSelect/shopSelect.js b/pages2/shopSelect/shopSelect.js index 128826c..4bc0ffc 100644 --- a/pages2/shopSelect/shopSelect.js +++ b/pages2/shopSelect/shopSelect.js @@ -10,14 +10,13 @@ Page({ isShop: true, position: 0, tagArr: [], + cityArr: [], mallList: [], currentTag: "", currentCity: "", - id: "", - orderId: "", + isLocation: false, + isOrder: "", merOrderId: "", - startTime: "", - endTime: "", latitude: "", longitude: "", toView: "A" @@ -35,21 +34,17 @@ Page({ }) } - const tagArr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] - this.setData({ - tagArr - }) + // const tagArr = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] + // this.setData({ + // tagArr + // }) this.setData({ - id: options.id || '', - orderId: options.orderId || '', + isOrder: options.isOrder || false, merOrderId: options.merOrderId || '', - startTime: options.startTime || '', - endTime: options.endTime || '', }) this.getLocation() - }, @@ -72,6 +67,7 @@ Page({ //获取适用门店 getCouponMerchant(couponChannelId, flag) { + console.log(flag, 'flag'); const that = this Http.get({ url: config.api.couponMerchant, @@ -119,6 +115,7 @@ Page({ // 获取适用门店所在的城市list getCityList(couponChannelId) { + const that = this Http.get({ url: config.api.couponMerchantCity, data: { @@ -126,6 +123,23 @@ Page({ } }).then(res => { console.log(res, 'res'); + const tagArr = Object.keys(res.data) + tagArr.sort(function (a, b) { + if (a < b) { + return -1; + } + if (a > b) { + return 1; + } + return 0; + }); + const cityArr = res.data + that.setData({ + tagArr, + cityArr + }) + console.log(tagArr, 'tagArr'); + console.log(cityArr, 'cityArr'); }).catch(err => { console.log(err, 'err'); }) @@ -145,16 +159,29 @@ Page({ that.setData({ latitude: res.latitude, longitude: res.longitude, + isLocation: true, currentCity: res.city }) - that.getCouponChannelId(true) - + if (that.data.isOrder) { + const merOrderId = that.data.merOrderId + that.getCouponMerchant(merOrderId, true) + that.getCityList(merOrderId) + } else { + that.getCouponChannelId(true) + } }, // 拒绝提供定位权限 fail: error => { - // that.getCouponChannelId(false) + if (that.data.isOrder) { + const merOrderId = that.data.merOrderId + that.getCouponMerchant(merOrderId, false) + that.getCityList(merOrderId) + } else { + that.getCouponChannelId(false) + } that.setData({ isShop: false, + isLocation: false, mallList: [] }) tt.hideLoading(); @@ -290,8 +317,6 @@ Page({ currentTag: id, toView: id }) - - }, goSetShop(e) { @@ -311,6 +336,15 @@ Page({ tt.showLoading({ title: '加载中...', }); - this.getCouponChannelId(false) + + const isLocation = this.data.isLocation + if (this.data.isOrder) { + const merOrderId = this.data.merOrderId + this.getCouponMerchant(merOrderId, isLocation) + this.getCityList(merOrderId) + } else { + this.getCouponChannelId(isLocation) + } + }, }) \ No newline at end of file diff --git a/pages2/shopSelect/shopSelect.ttml b/pages2/shopSelect/shopSelect.ttml index 04df0b4..b1ac699 100644 --- a/pages2/shopSelect/shopSelect.ttml +++ b/pages2/shopSelect/shopSelect.ttml @@ -43,12 +43,8 @@ upper-threshold="{{50}}" lower-threshold="{{50}}" scroll-into-view="{{toView}}"> {{ item }} - 北京市 - 武汉市 - 天津市 - 石家庄市 - 济南市 - 长沙市 + {{ city }}