master
王文杰 8 months ago
parent d658017ff8
commit 9d3cab7f06

@ -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 () => {
<view class="module-title">取件信息</view>
<view class="list">
<button hover-class="none" class="item arrow" @click="openTimePop"> {{appointmentTime}}</button>
<button hover-class="none" class="item arrow" @click="openAddressPop">{{addressLabel}}</button>
<button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button>
<button hover-class="none" class="item arrow" @click="openAddressPop">{{recycleAddress}}</button>
<button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button>
</view>
<view class="weight">
<view class="weight-title"
@ -230,11 +240,11 @@ const handleBooking = async () => {
</view>
</view>
</view>
<time-popup v-if="isShowTimePop" @change="handleTimePopChange" />
<time-popup :props-time="appointmentTime" v-if="isShowTimePop" @change="handleTimePopChange" />
<address-popup v-if="isShowAddressPop" @change="handleAddressPopChange" />
<site-popup v-if="isShowSitePop" @change="handleSitePopChange" />
<view class="submit" @click="handleBooking"></view>
<view :class="[isBooking? '':'disabled','submit']" @click="handleBooking"></view>
<!-- 底部占位空盒子 -->
<view class="toolbar-height" safe-area-inset-bottom></view>
</view>
@ -374,6 +384,10 @@ page {
font-size: 32rpx;
color: #fff;
background: linear-gradient(119deg, #fd815f 7%, #f1484a 95%);
&.disabled {
background: #d4caca;
color: #F2F2FA;
}
}
}
//

@ -5,6 +5,11 @@ const popup = ref<UniHelper.UniPopupInstance>()
//
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)
}

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

Loading…
Cancel
Save