Bläddra i källkod

预约功能完善

product
HolyKnightIX 1 år sedan
förälder
incheckning
6e95e2530f
4 ändrade filer med 12 tillägg och 10 borttagningar
  1. +7
    -6
      package2/pages/appointment/appointment.js
  2. +1
    -1
      package2/pages/appointment/appointment.ttml
  3. +3
    -2
      pages/order/detail/index.js
  4. +1
    -1
      pages/order/detail/index.ttml

+ 7
- 6
package2/pages/appointment/appointment.js Visa fil

@@ -92,7 +92,8 @@ Page({
const index = e.detail.value
this.setData({
currentIndex: index,
merchantId: this.data.mallList[index].id
merchantId: this.data.mallList[index].id,
reservationMerchantName: ''
})
console.log(this.data.currentIndex, this.data.merchantId);
},
@@ -316,7 +317,7 @@ Page({
data.id = this.data.id
}

if (this.data.status == 1) {
if (this.data.status == 1 || this.data.status == '-1') {
data.status = 0
}

@@ -418,16 +419,16 @@ Page({
that.setData({
pickedAddress: res.data.userAddress || '请选择地址',
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,
status,
appointmentText: res.data.status == 1 ? "重新预约" : "修改预约",
merchantId: res.data.reservationMerchantId,
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({
isShowBtns: true
})


+ 1
- 1
package2/pages/appointment/appointment.ttml Visa fil

@@ -65,6 +65,6 @@

<block tt:if="{{isShowBtns}}">
<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>
</view>

+ 3
- 2
pages/order/detail/index.js Visa fil

@@ -548,8 +548,9 @@ Page({

setTimeout(() => {
const isAppointment = that.data.isAppointment
const appointmentStatus = that.data.appointmentStatus
const Appointment = tt.getStorageSync('appointment');
if (Appointment && !isAppointment) {
if (Appointment && (!isAppointment || appointmentStatus == '-1')) {
tt.showModal({
title: "提示",
content: "是否立即填写预约信息?",
@@ -568,7 +569,7 @@ Page({
}
});
}
}, 2000);
}, 1000);
}

that.setData({


+ 1
- 1
pages/order/detail/index.ttml Visa fil

@@ -121,7 +121,7 @@

<text tt:if="{{ !isAppointment }}" class="fr" style="color: #d4a971;">点击预约</text>
<text tt:if="{{ isAppointment && appointmentStatus == 0 }}" class="fr"
style="color: #d4a971;">{{appointStart}}-{{appointEnd}}</text>
style="color: #d4a971">{{appointStart}}-{{appointEnd}}</text>
<text
tt:if="{{ isAppointment && ( appointmentStatus == 1 || appointmentStatus == 2 || appointmentStatus == 3 ) }}"
class="fr" style="color: #d4a971;">预约已取消


Laddar…
Avbryt
Spara