@@ -92,7 +92,8 @@ Page({ | |||||
const index = e.detail.value | const index = e.detail.value | ||||
this.setData({ | this.setData({ | ||||
currentIndex: index, | currentIndex: index, | ||||
merchantId: this.data.mallList[index].id | |||||
merchantId: this.data.mallList[index].id, | |||||
reservationMerchantName: '' | |||||
}) | }) | ||||
console.log(this.data.currentIndex, this.data.merchantId); | console.log(this.data.currentIndex, this.data.merchantId); | ||||
}, | }, | ||||
@@ -316,7 +317,7 @@ Page({ | |||||
data.id = this.data.id | data.id = this.data.id | ||||
} | } | ||||
if (this.data.status == 1) { | |||||
if (this.data.status == 1 || this.data.status == '-1') { | |||||
data.status = 0 | data.status = 0 | ||||
} | } | ||||
@@ -418,16 +419,16 @@ Page({ | |||||
that.setData({ | that.setData({ | ||||
pickedAddress: res.data.userAddress || '请选择地址', | pickedAddress: res.data.userAddress || '请选择地址', | ||||
pickedAddressDetail: res.data.detailedAddress, | pickedAddressDetail: res.data.detailedAddress, | ||||
pickedDate: util.timestampToTime(res.data.startDate, 'YYYY-MM-DD'), | |||||
pickedStartTime: util.timestampToTime(res.data.startDate, 'hh:mm'), | |||||
pickedEndTime: util.timestampToTime(res.data.endDate, 'hh:mm'), | |||||
pickedDate: util.timestampToTime(res.data.startDate, 'YYYY-MM-DD') || '请选择日期', | |||||
pickedStartTime: util.timestampToTime(res.data.startDate, 'hh:mm') || '请选择', | |||||
pickedEndTime: util.timestampToTime(res.data.endDate, 'hh:mm') || '请选择', | |||||
describeStr: res.data.describeStr, | describeStr: res.data.describeStr, | ||||
status, | status, | ||||
appointmentText: res.data.status == 1 ? "重新预约" : "修改预约", | appointmentText: res.data.status == 1 ? "重新预约" : "修改预约", | ||||
merchantId: res.data.reservationMerchantId, | merchantId: res.data.reservationMerchantId, | ||||
reservationMerchantName: res.data.reservationMerchantName | reservationMerchantName: res.data.reservationMerchantName | ||||
}) | }) | ||||
if (status == 0 || status == 1 || status == 2 || status == 3) { | |||||
if (status == 0 || status == 1 || status == 2 || status == 3 || status == '-1') { | |||||
that.setData({ | that.setData({ | ||||
isShowBtns: true | isShowBtns: true | ||||
}) | }) | ||||
@@ -65,6 +65,6 @@ | |||||
<block tt:if="{{isShowBtns}}"> | <block tt:if="{{isShowBtns}}"> | ||||
<button class="confirm" type="primary" bindtap="confirm">{{ appointmentText }}</button> | <button class="confirm" type="primary" bindtap="confirm">{{ appointmentText }}</button> | ||||
<button tt:if="{{ id && status != 1 }}" type="primary" bindtap="cancel">取消预约</button> | |||||
<!-- <button tt:if="{{ id && status != 1}}" type="primary" bindtap="cancel">取消预约</button> --> | |||||
</block> | </block> | ||||
</view> | </view> |
@@ -548,8 +548,9 @@ Page({ | |||||
setTimeout(() => { | setTimeout(() => { | ||||
const isAppointment = that.data.isAppointment | const isAppointment = that.data.isAppointment | ||||
const appointmentStatus = that.data.appointmentStatus | |||||
const Appointment = tt.getStorageSync('appointment'); | const Appointment = tt.getStorageSync('appointment'); | ||||
if (Appointment && !isAppointment) { | |||||
if (Appointment && (!isAppointment || appointmentStatus == '-1')) { | |||||
tt.showModal({ | tt.showModal({ | ||||
title: "提示", | title: "提示", | ||||
content: "是否立即填写预约信息?", | content: "是否立即填写预约信息?", | ||||
@@ -568,7 +569,7 @@ Page({ | |||||
} | } | ||||
}); | }); | ||||
} | } | ||||
}, 2000); | |||||
}, 1000); | |||||
} | } | ||||
that.setData({ | that.setData({ | ||||
@@ -121,7 +121,7 @@ | |||||
<text tt:if="{{ !isAppointment }}" class="fr" style="color: #d4a971;">点击预约</text> | <text tt:if="{{ !isAppointment }}" class="fr" style="color: #d4a971;">点击预约</text> | ||||
<text tt:if="{{ isAppointment && appointmentStatus == 0 }}" class="fr" | <text tt:if="{{ isAppointment && appointmentStatus == 0 }}" class="fr" | ||||
style="color: #d4a971;">{{appointStart}}-{{appointEnd}}</text> | |||||
style="color: #d4a971">{{appointStart}}-{{appointEnd}}</text> | |||||
<text | <text | ||||
tt:if="{{ isAppointment && ( appointmentStatus == 1 || appointmentStatus == 2 || appointmentStatus == 3 ) }}" | tt:if="{{ isAppointment && ( appointmentStatus == 1 || appointmentStatus == 2 || appointmentStatus == 3 ) }}" | ||||
class="fr" style="color: #d4a971;">预约已取消 | class="fr" style="color: #d4a971;">预约已取消 | ||||