diff --git a/src/pages/booking/booking.vue b/src/pages/booking/booking.vue index 842b7cc..4ec7139 100644 --- a/src/pages/booking/booking.vue +++ b/src/pages/booking/booking.vue @@ -17,10 +17,17 @@ const isShowTimePop = ref(false) const isShowAddressPop = ref(false) const isShowSitePop = ref(false) -const addressLabel = ref('取件地址') +// 回收地址、回收时间、 回收站点 +const recycleAddress = ref('') const appointmentTime = ref('') -const siteLabel = ref('回收站点') -const recycleStationId = ref('') +const siteLabel = ref('') +const recycleStationId = ref('521632060801030597') + +// 是否可以预约 +const isBooking = computed(()=>{ + return appointmentTime.value && recycleAddress.value && siteLabel.value +}) + // 获取订单列表 const leiList = [ @@ -152,7 +159,7 @@ const handleTimePopChange = (val) => { } const handleAddressPopChange = (val) => { isShowAddressPop.value = false - addressLabel.value ='收货地址: ' + val + recycleAddress.value = val } const handleSitePopChange = (obj) => { isShowSitePop.value = false @@ -162,10 +169,13 @@ const handleSitePopChange = (obj) => { // 预约回收 const handleBooking = async () => { + if (isBooking) { + return + } const arr = appointmentTime.value.split(' ') const yymmdd = arr[0] - const appointmentTimeStart = yymmdd + arr[1].split('-')[0] - const appointmentTimeEnd = yymmdd + arr[1].split('-')[1] + const appointmentTimeStart = yymmdd + ' ' + arr[1].split('-')[1] + const appointmentTimeEnd = yymmdd + ' ' + arr[1].split('-')[0] const params = { appointmentTimeStart, appointmentTimeEnd, @@ -173,8 +183,8 @@ const handleBooking = async () => { longitude: longitude.value, latitude: latitude.value, }, - recycleAddress: "xxx市yyy区", - recycleStationId: recycleStationId.value || 521632060801030597 + recycleAddress: recycleAddress.value, + recycleStationId: recycleStationId.value } const res = await postBookingAPI(params) if (res.code == 200) { @@ -211,8 +221,8 @@ const handleBooking = async () => { 取件信息 - - + + { - + - 立即预约回收 + 立即预约回收 @@ -374,6 +384,10 @@ page { font-size: 32rpx; color: #fff; background: linear-gradient(119deg, #fd815f 7%, #f1484a 95%); + &.disabled { + background: #d4caca; + color: #F2F2FA; + } } } // 底部占位空盒子 diff --git a/src/pages/booking/components/timePopup.vue b/src/pages/booking/components/timePopup.vue index d3d6f5a..6f6e609 100644 --- a/src/pages/booking/components/timePopup.vue +++ b/src/pages/booking/components/timePopup.vue @@ -5,6 +5,11 @@ const popup = ref() // 定义返回给父组件的方法 const emit = defineEmits(['change']) +const props = defineProps<{ + propsTime: string +}>() + + const jmhDay = ref('') const sendTime = ref('') const sRightDate = ref('') @@ -65,7 +70,6 @@ const selectRDate = (item) => { } sRightDate.value = item.time; sendTime.value = sLDate.value +' ' +item.time; - debugger popup.value?.close?.() emit('change', sendTime.value) } diff --git a/src/pagesMember/profile/profile.vue b/src/pagesMember/profile/profile.vue index 8d3a31e..db4d4df 100644 --- a/src/pagesMember/profile/profile.vue +++ b/src/pagesMember/profile/profile.vue @@ -48,8 +48,8 @@ const onAvatarChange = () => { const uploadFile = (file: string) => { // 文件上传 uni.uploadFile({ - url: '/member/profile/avatar', - name: 'file', + url: '/file/uploadImg', + name: 'avatar', filePath: file, success: (res) => { if (res.statusCode === 200) {