| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <view>
- <uni-popup ref="popupTime" type="bottom">
- <view class="pop-address box-border-box p-24">
- <view class="text-align-center fs-36 fw-600 box-title mb-32">
- 选择预计送达时间
- <uni-icons @click="closeCoupon" class="box-close" type="closeempty" size="20"></uni-icons>
- </view>
-
- <view class="scroll-view-css flex-justify-space">
- <view class="time-left">
- <view class="item-box" :class="type == item.type?'bgc-f':''"
- v-for="(item,i) in list" :key="i" @click="select(1,item)">
- {{item.name}}
- </view>
- </view>
- <view class="time-right flex-1">
- <view class="item-box b-b-F9F9F9" :class="time == item.name?'fc-41ABF5':''"
- v-for="(item,i) in timeList" :key="i" @click="select(2,item)">
- {{item.name}}
- </view>
- </view>
- </view>
-
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- export default {
- data(){
- return{
- list:[
- {
- type:1,
- name:'今日',
- timeList:[
- {name:'10:30'},{name:'11:00'},{name:'11:30'},{name:'12:00'},
- {name:'12:30'},{name:'13:00'},{name:'13:30'},{name:'14:00'},
- {name:'14:30'},{name:'15:00'},{name:'15:30'},{name:'16:00'},
- ]
- },
- {
- type:2,
- name:'明日',
- timeList:[
- {name:'10:00'},{name:'10:30'},{name:'11:00'},{name:'11:30'},{name:'12:00'},
- ]
- }
- ],
- timeList:[],
- type:'',
- time:'',
- }
- },
- methods:{
- getList(){
- this.openPop();
- this.timeList = this.list[0].timeList;
- this.type = this.list[0].type;
- this.time = this.timeList[0].name;
- },
- openPop(){
- this.$refs.popupTime.open();
- },
- closeCoupon(){
- this.$refs.popupTime.close();
- },
- select(type,item){
- if(type === 1){
- if(this.type != item.type){
- this.type = item.type;
- this.time = '';
- }
- }else{
- this.time = item.name
- }
- }
- },
- }
- </script>
- <style scoped lang="scss">
- .pop-address{
- width: 100%;
- height: 50vh;
- background-color: #fff;
- border-radius: 24rpx 24rpx 0rpx 0rpx;
- padding-top: 32rpx !important;
- display: flex;
- flex-direction: column;
- .box-title{
- position: relative;
- .box-close{
- position: absolute;
- right: 22rpx;
- }
- }
-
- .time-left{
- width: 240rpx;
- height: auto;
- background-color: #F7F8FA;
- }
- .time-right{
- overflow-y: scroll;
- }
- .item-box{
- width: 100%;
- height: 104rpx;
- line-height: 104rpx;
- font-size: 28rpx;
- font-weight: 400;
- text-align: center;
-
- }
- }
- </style>
|