HolyKnightIX 1 rok temu
rodzic
commit
54a905d239
7 zmienionych plików z 106 dodań i 32 usunięć
  1. +1
    -1
      index/user.ttml
  2. +30
    -2
      pages/coupon/confirmation/confirmation.js
  3. +18
    -1
      pages/coupon/confirmation/confirmation.ttml
  4. +0
    -1
      pages2/appointment/appointment.js
  5. +2
    -2
      pages2/appointment/appointment.ttml
  6. +53
    -19
      pages2/shopSelect/shopSelect.js
  7. +2
    -6
      pages2/shopSelect/shopSelect.ttml

+ 1
- 1
index/user.ttml Wyświetl plik

@@ -83,7 +83,7 @@
</navigator>
</view>
</view>
<view class="version">Version 2.8.3</view>
<view class="version">Version 2.8.6</view>
<phoem showBox="{{showPhoem}}" bind:hiePhoen="setPhone" bind:heiBox="setBox"></phoem>
</view>



+ 30
- 2
pages/coupon/confirmation/confirmation.js Wyświetl plik

@@ -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
}
}
})

+ 18
- 1
pages/coupon/confirmation/confirmation.ttml Wyświetl plik

@@ -35,7 +35,7 @@

<!-- 仅当可预约时 -->
<view tt:if="{{ data.type == 69 }}">
<view tt:if="{{ !merchantId }}" class="addressPickerFlex">
<!-- <view tt:if="{{ !merchantId }}" class="addressPickerFlex">
<text>选择可用商户:</text>
<picker style="display: inline-block;" mode="selector" value="{{index}}" range="{{mallList}}"
range-key="{{mallList[0].distanceName ? 'distanceName' : 'merchantName'}}" disabled="{{false}}"
@@ -55,5 +55,22 @@
class="distanceFoot">{{
mallList[currentIndex].distance_str }}</text></text></text>
</picker>
</view> -->

<view tt:if="{{ !shopItem && !reservationMerchantName }}" class="addressPickerFlex" bindtap="goSelectShop">
<text>选择可用商户:</text>

<view class="pickerInside">
请选择
</view>
</view>

<view tt:if="{{ shopItem || reservationMerchantName }}" class="addressPicker" bindtap="goSelectShop">
<text tt:if="{{ reservationMerchantName }}"> 选择可用商户:<text class="pickerInside">{{ reservationMerchantName
}}</text></text>

<text tt:else> 选择可用商户:<text class="pickerInside">{{
shopItem.merchantName }} <text tt:if="{{ shopItem.distance_str }}"
class="distanceFoot">{{shopItem.distance_str }}</text></text></text>
</view>
</view>

+ 0
- 1
pages2/appointment/appointment.js Wyświetl plik

@@ -527,7 +527,6 @@ Page({
onShow() {
const shopItem = app.globalData.shopItem
if (shopItem) {
console.log('Yes!!!');
this.setData({
shopItem,
merchantId: shopItem.id,


+ 2
- 2
pages2/appointment/appointment.ttml Wyświetl plik

@@ -61,7 +61,7 @@
</view> -->

<view tt:if="{{ !shopItem && !reservationMerchantName }}" class="addressPickerFlex" bindtap="goSelectShop">
<text>选择可用商户(Beta):</text>
<text>选择可用商户:</text>

<view class="pickerInside">
请选择
@@ -69,7 +69,7 @@
</view>

<view tt:if="{{ shopItem || reservationMerchantName }}" class="addressPicker" bindtap="goSelectShop">
<text tt:if="{{ reservationMerchantName }}"> 选择可用商户(Beta):<text class="pickerInside">{{ reservationMerchantName
<text tt:if="{{ reservationMerchantName }}"> 选择可用商户:<text class="pickerInside">{{ reservationMerchantName
}}</text></text>

<text tt:else> 选择可用商户:<text class="pickerInside">{{


+ 53
- 19
pages2/shopSelect/shopSelect.js Wyświetl plik

@@ -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)
}

},
})

+ 2
- 6
pages2/shopSelect/shopSelect.ttml Wyświetl plik

@@ -43,12 +43,8 @@
upper-threshold="{{50}}" lower-threshold="{{50}}" scroll-into-view="{{toView}}">
<view tt:for="{{ tagArr }}" tt:key="index" class="indexList" id="{{ item }}">
<view class="title">{{ item }}</view>
<view class="item" bindtap="goFindShop" data-name="北京市">北京市</view>
<view class="item" bindtap="goFindShop" data-name="武汉市">武汉市</view>
<view class="item" bindtap="goFindShop" data-name="天津市">天津市</view>
<view class="item" bindtap="goFindShop" data-name="石家庄市">石家庄市</view>
<view class="item" bindtap="goFindShop" data-name="济南市">济南市</view>
<view class="item" bindtap="goFindShop" data-name="长沙市">长沙市</view>
<view tt:for="{{ cityArr[item] }}" tt:for-item="city" tt:key="index" class="item" bindtap="goFindShop"
data-name="{{ city }}">{{ city }}</view>
</view>
</scroll-view>
</view>


Ładowanie…
Anuluj
Zapisz