You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

276 lines
5.8 KiB

2 years ago
<template>
<view>
<u-popup v-model="show" mode="bottom">
<view class="date">
<view class="date-title">
1 year ago
<view>发货时间</view>
2 years ago
<view @click="closePop">
2 years ago
<u-icon name="close-circle-fill" color="#f0efed" size="32"></u-icon>
</view>
</view>
1 year ago
<!-- <view class="date-express">
2 years ago
<view v-for="(item,index) in express">
<view @click="chooseExpress(index,item)"
:class="{'date-express-item':true,'date-express-item_active':expressIndex==index}"
1 year ago
v-if="item.name">{{item.name}}</view>
2 years ago
</view>
1 year ago
</view> -->
3 months ago
<view class="date-stitle">{{getTimeTips}}</view>
2 years ago
<view class="date-list">
<view class="date-list-left">
<view v-for="(item,index) in data">
<view @click="chooseDate(index,item)"
:class="{'date-list-item':true,'date-list-item_active':dateIndex==index}" v-if="item">
{{item.ymd}}[{{item.week}}]
</view>
</view>
</view>
<view class="date-list-right">
1 year ago
<view class="lunarData" v-if="dateObj.lunarData">
2 years ago
{{dateObj.lunarData?dateObj.lunarData:''}}
1 year ago
<!-- <view>今日剩余可提货量{{dateObj.canUse.quantity - dateObj.canUse.booked}}</view> -->
<view>余量充足</view>
2 years ago
</view>
1 year ago
<!-- <view class="hh">
1 year ago
<view @click="chooseHh(index,item)"
:class="{'hh-item':true,'hh-item_active':hhIndex==index}"
2 years ago
v-for="(item,index) in hhList">
{{item}}
</view>
1 year ago
</view> -->
2 years ago
</view>
</view>
<view class="date-btn">
<view @click="confirmPop"></view>
2 years ago
</view>
</view>
</u-popup>
</view>
</template>
1 year ago
<script>
import {
isEmptyObject,
isNull,
toast
} from "@/common/util.js"
2 years ago
export default {
props: {
// 日期
data: {
type: Array,
default () {
return []
}
3 months ago
},
getTimeTips:{
type: String,
default () {
return '非到货时间预计发货后48小时左右可到货。'
}
}
1 year ago
// // 快递
// express: {
// type: Array,
// default () {
// return []
// }
// }
2 years ago
},
data() {
return {
2 years ago
show: false,
1 year ago
// expressIndex: -1,
// expressObj: {},
2 years ago
dateIndex: -1,
3 months ago
dateObj: {},
1 year ago
// hhList: ['09:00-15:00', '15:00-21:00'],
// hhIndex: -1,
1 year ago
2 years ago
}
2 years ago
},
methods: {
1 year ago
// chooseExpress(index, item) {
// this.expressObj = item
// this.expressIndex = index
// },
2 years ago
chooseDate(index, item) {
this.dateIndex = index
this.dateObj = item
},
1 year ago
// chooseHh(index, item) {
// this.hhTime = item
// this.hhIndex = index
// },
1 year ago
closePop() {
this.show = false
},
confirmPop() {
if (isEmptyObject(this.dateObj)) {
1 year ago
toast('请选择发货时间')
1 year ago
return
}
1 year ago
// if (isEmptyObject(this.expressObj)) {
// toast('请选择快递')
// return
// }
// if (isNull(this.hhTime)) {
// toast('请选择时间')
// return
// }
1 year ago
// 将对象A的值插入到对象B中
1 year ago
// for (const key in this.expressObj) {
// if (this.expressObj.hasOwnProperty(key)) {
// this.dateObj[`express${key}`] = this.expressObj[key];
// }
// }
// this.dateObj.hhtime = this.hhTime
1 year ago
this.$emit('refresh', this.dateObj)
this.show = false
console.log("this.dateObj", this.dateObj)
2 years ago
},
2 years ago
}
}
</script>
2 years ago
<style lang="scss" scoped>
.u-drawer-content-visible {
border-radius: 30rpx 30rpx 0 0;
2 years ago
}
2 years ago
2 years ago
.date {
padding: 35rpx 0;
padding-right: 35rpx;
2 years ago
padding-bottom: 0;
2 years ago
&-title {
font-size: 32rpx;
color: #000;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 35rpx;
1 year ago
padding-bottom: 10rpx;
2 years ago
}
&-express {
padding-left: 35rpx;
display: flex;
align-items: center;
margin-top: 35rpx;
margin-bottom: 15rpx;
&-item {
font-size: 24rpx;
color: #000;
background-color: #f0efed;
height: 57rpx;
line-height: 55rpx;
text-align: center;
min-width: 180rpx;
border: 1px solid transparent;
border-radius: 30rpx;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
&-item_active {
color: #ba8b45;
background-color: #fef8ee;
border: 1px solid #ba8b45;
}
}
&-stitle {
font-size: 24rpx;
1 year ago
color: #787877;
2 years ago
padding-left: 35rpx;
1 year ago
margin-bottom: 20rpx;
color:#b62828;
2 years ago
}
&-list {
display: flex;
height: 510rpx;
&-left {
width: 235rpx;
height: 510rpx;
overflow-y: scroll;
font-size: 0;
}
&-item {
font-size: 24rpx;
color: #787877;
background-color: #f0efed;
width: 235rpx;
height: 72rpx;
text-align: center;
line-height: 72rpx;
}
&-item_active {
background-color: #fff;
color: #000;
}
&-right {
width: calc(100% - 235rpx);
padding-top: 15rpx;
padding-left: 75rpx;
font-size: 24rpx;
color: #000;
.lunarData {
1 year ago
line-height: 45rpx;
margin-bottom: 20rpx;
2 years ago
}
.hh {
&-item {
border: 1px solid #f4f4f4;
border-radius: 10rpx;
height: 80rpx;
line-height: 80rpx;
width: 80%;
padding-left: 45rpx;
margin-bottom: 20rpx;
background-color: #fff;
}
&-item_active {
border: 1px solid #d1b384;
color: #ba8b45;
background-color: #fef8ee;
box-shadow: 0px 0px 8rpx #d1b384;
}
}
}
}
&-btn {
width: calc(100% + 35rpx);
text-align: center;
display: flex;
justify-content: center;
padding: 30rpx 0;
>view {
color: #f0efed;
font-size: 30rpx;
text-align: center;
width: 70%;
height: 75rpx;
line-height: 75rpx;
background-color: #ba8b45;
border-radius: 36rpx;
}
2 years ago
}
}
</style>