|
|
@ -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;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 底部占位空盒子
|
|
|
|
// 底部占位空盒子
|
|
|
|