浏览代码

upload

product
HolyKnightIX 1年前
父节点
当前提交
54a905d239
共有 7 个文件被更改,包括 106 次插入32 次删除
  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 查看文件

@@ -83,7 +83,7 @@
</navigator> </navigator>
</view> </view>
</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> <phoem showBox="{{showPhoem}}" bind:hiePhoen="setPhone" bind:heiBox="setBox"></phoem>
</view> </view>




+ 30
- 2
pages/coupon/confirmation/confirmation.js 查看文件

@@ -21,7 +21,9 @@ Page({
currentIndex: "", currentIndex: "",
mallList: [], mallList: [],
latitude: "", latitude: "",
longitude: ""
longitude: "",
merOrderId: "",
shopItem: null
}, },
onLoad: function (options) { onLoad: function (options) {
console.log(options, 'options!!!!!!!'); console.log(options, 'options!!!!!!!');
@@ -37,7 +39,13 @@ Page({
} }
console.log(this.data.mallTenantId, 'mallTenantId'); console.log(this.data.mallTenantId, 'mallTenantId');


this.getCouponMerchant(options.merOrderId)
if (options.merOrderId) {
this.setData({
merOrderId: options.merOrderId
})
}

// this.getCouponMerchant(options.merOrderId)


tt.showLoading({ tt.showLoading({
title: "加载中..." 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() { onShow() {
this.getIm() 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 查看文件

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


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

+ 0
- 1
pages2/appointment/appointment.js 查看文件

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


+ 2
- 2
pages2/appointment/appointment.ttml 查看文件

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


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


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


<view tt:if="{{ shopItem || reservationMerchantName }}" class="addressPicker" bindtap="goSelectShop"> <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></text>


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


+ 53
- 19
pages2/shopSelect/shopSelect.js 查看文件

@@ -10,14 +10,13 @@ Page({
isShop: true, isShop: true,
position: 0, position: 0,
tagArr: [], tagArr: [],
cityArr: [],
mallList: [], mallList: [],
currentTag: "", currentTag: "",
currentCity: "", currentCity: "",
id: "",
orderId: "",
isLocation: false,
isOrder: "",
merOrderId: "", merOrderId: "",
startTime: "",
endTime: "",
latitude: "", latitude: "",
longitude: "", longitude: "",
toView: "A" 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({ this.setData({
id: options.id || '',
orderId: options.orderId || '',
isOrder: options.isOrder || false,
merOrderId: options.merOrderId || '', merOrderId: options.merOrderId || '',
startTime: options.startTime || '',
endTime: options.endTime || '',
}) })


this.getLocation() this.getLocation()

}, },




@@ -72,6 +67,7 @@ Page({


//获取适用门店 //获取适用门店
getCouponMerchant(couponChannelId, flag) { getCouponMerchant(couponChannelId, flag) {
console.log(flag, 'flag');
const that = this const that = this
Http.get({ Http.get({
url: config.api.couponMerchant, url: config.api.couponMerchant,
@@ -119,6 +115,7 @@ Page({


// 获取适用门店所在的城市list // 获取适用门店所在的城市list
getCityList(couponChannelId) { getCityList(couponChannelId) {
const that = this
Http.get({ Http.get({
url: config.api.couponMerchantCity, url: config.api.couponMerchantCity,
data: { data: {
@@ -126,6 +123,23 @@ Page({
} }
}).then(res => { }).then(res => {
console.log(res, '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 => { }).catch(err => {
console.log(err, 'err'); console.log(err, 'err');
}) })
@@ -145,16 +159,29 @@ Page({
that.setData({ that.setData({
latitude: res.latitude, latitude: res.latitude,
longitude: res.longitude, longitude: res.longitude,
isLocation: true,
currentCity: res.city 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 => { 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({ that.setData({
isShop: false, isShop: false,
isLocation: false,
mallList: [] mallList: []
}) })
tt.hideLoading(); tt.hideLoading();
@@ -290,8 +317,6 @@ Page({
currentTag: id, currentTag: id,
toView: id toView: id
}) })


}, },


goSetShop(e) { goSetShop(e) {
@@ -311,6 +336,15 @@ Page({
tt.showLoading({ tt.showLoading({
title: '加载中...', 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 查看文件

@@ -43,12 +43,8 @@
upper-threshold="{{50}}" lower-threshold="{{50}}" scroll-into-view="{{toView}}"> upper-threshold="{{50}}" lower-threshold="{{50}}" scroll-into-view="{{toView}}">
<view tt:for="{{ tagArr }}" tt:key="index" class="indexList" id="{{ item }}"> <view tt:for="{{ tagArr }}" tt:key="index" class="indexList" id="{{ item }}">
<view class="title">{{ item }}</view> <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> </view>
</scroll-view> </scroll-view>
</view> </view>


正在加载...
取消
保存