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

@ -17,10 +17,17 @@ const isShowTimePop = ref(false)
const isShowAddressPop = ref(false) const isShowAddressPop = ref(false)
const isShowSitePop = ref(false) const isShowSitePop = ref(false)
const addressLabel = ref('取件地址') //
const recycleAddress = ref('')
const appointmentTime = ref('') const appointmentTime = ref('')
const siteLabel = ref('回收站点') const siteLabel = ref('')
const recycleStationId = ref('') const recycleStationId = ref('521632060801030597')
//
const isBooking = computed(()=>{
return appointmentTime.value && recycleAddress.value && siteLabel.value
})
// //
const leiList = [ const leiList = [
@ -152,7 +159,7 @@ const handleTimePopChange = (val) => {
} }
const handleAddressPopChange = (val) => { const handleAddressPopChange = (val) => {
isShowAddressPop.value = false isShowAddressPop.value = false
addressLabel.value ='收货地址: ' + val recycleAddress.value = val
} }
const handleSitePopChange = (obj) => { const handleSitePopChange = (obj) => {
isShowSitePop.value = false isShowSitePop.value = false
@ -162,10 +169,13 @@ const handleSitePopChange = (obj) => {
// //
const handleBooking = async () => { const handleBooking = async () => {
if (isBooking) {
return
}
const arr = appointmentTime.value.split(' ') const arr = appointmentTime.value.split(' ')
const yymmdd = arr[0] const yymmdd = arr[0]
const appointmentTimeStart = yymmdd + arr[1].split('-')[0] const appointmentTimeStart = yymmdd + ' ' + arr[1].split('-')[1]
const appointmentTimeEnd = yymmdd + arr[1].split('-')[1] const appointmentTimeEnd = yymmdd + ' ' + arr[1].split('-')[0]
const params = { const params = {
appointmentTimeStart, appointmentTimeStart,
appointmentTimeEnd, appointmentTimeEnd,
@ -173,8 +183,8 @@ const handleBooking = async () => {
longitude: longitude.value, longitude: longitude.value,
latitude: latitude.value, latitude: latitude.value,
}, },
recycleAddress: "xxx市yyy区", recycleAddress: recycleAddress.value,
recycleStationId: recycleStationId.value || 521632060801030597 recycleStationId: recycleStationId.value
} }
const res = await postBookingAPI(params) const res = await postBookingAPI(params)
if (res.code == 200) { if (res.code == 200) {
@ -211,8 +221,8 @@ const handleBooking = async () => {
<view class="module-title">取件信息</view> <view class="module-title">取件信息</view>
<view class="list"> <view class="list">
<button hover-class="none" class="item arrow" @click="openTimePop"> {{appointmentTime}}</button> <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="openAddressPop">{{recycleAddress}}</button>
<button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button> <button hover-class="none" class="item arrow" @click="openSitePop">{{siteLabel}}</button>
</view> </view>
<view class="weight"> <view class="weight">
<view class="weight-title" <view class="weight-title"
@ -230,11 +240,11 @@ const handleBooking = async () => {
</view> </view>
</view> </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" /> <address-popup v-if="isShowAddressPop" @change="handleAddressPopChange" />
<site-popup v-if="isShowSitePop" @change="handleSitePopChange" /> <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 class="toolbar-height" safe-area-inset-bottom></view>
</view> </view>
@ -374,6 +384,10 @@ page {
font-size: 32rpx; font-size: 32rpx;
color: #fff; color: #fff;
background: linear-gradient(119deg, #fd815f 7%, #f1484a 95%); 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 emit = defineEmits(['change'])
const props = defineProps<{
propsTime: string
}>()
const jmhDay = ref('') const jmhDay = ref('')
const sendTime = ref('') const sendTime = ref('')
const sRightDate = ref('') const sRightDate = ref('')
@ -65,7 +70,6 @@ const selectRDate = (item) => {
} }
sRightDate.value = item.time; sRightDate.value = item.time;
sendTime.value = sLDate.value +' ' +item.time; sendTime.value = sLDate.value +' ' +item.time;
debugger
popup.value?.close?.() popup.value?.close?.()
emit('change', sendTime.value) emit('change', sendTime.value)
} }

@ -48,8 +48,8 @@ const onAvatarChange = () => {
const uploadFile = (file: string) => { const uploadFile = (file: string) => {
// //
uni.uploadFile({ uni.uploadFile({
url: '/member/profile/avatar', url: '/file/uploadImg',
name: 'file', name: 'avatar',
filePath: file, filePath: file,
success: (res) => { success: (res) => {
if (res.statusCode === 200) { if (res.statusCode === 200) {

Loading…
Cancel
Save