123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308 |
- <template>
- <view class="safeArea">
- <view class="appointment">
- <view class="appointmentItem">
- <view class="title">考试地点:</view>
- <view class="place" @click="showAddress">
- <view class="name">{{addressName}}</view>
- <view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
- </view>
- </view>
- <view class="appointmentItem">
- <view class="title">考试时间:</view>
- <view class="main">
- <view v-for="(item,index) in list" class="item" :key="index" @click="choItem(index)">
- <view class="checkbox"><u-checkbox v-if="item.status===1" v-model="item.checked" shape="circle"></u-checkbox></view>
- <view class="box">
- <view :class="['time',{'active':item.checked},{'no':item.status!==1}]">{{item.time}}</view>
- <view class="statusInfo" v-if="item.status !==1">
- <template v-if="item.status===2">预约名额已满</template>
- <template v-if="item.status===3">此时段您已经有其他考试预约</template>
- </view>
- </view>
- <view class="num">已报:{{item.appoint}}/{{item.total}}</view>
- </view>
- </view>
- </view>
- <view class="btnMain">
- <view class="return">上一步</view>
- <view class="sure" @click="sureOppoint">确定预约</view>
- </view>
- </view>
- <!-- 弹框-->
- <u-popup v-model="address_show" mode="bottom" class="addModel">
- <view class="tipBox safeArea">
- <view class="line"></view>
- <view class="title">温馨提示</view>
- <u-line color="#EEEEEE" />
- <scroll-view class="addressList" :scroll-y="true">
- <view class="item" v-for="(item,index) in addressList" :key="index" @click="choAddress(index)">
- <u-checkbox class="checkbox" v-model="item.checked" shape="circle"></u-checkbox>
- <view :class="['address',{'active': item.checked}]">{{item.address}}</view>
- </view>
- </scroll-view>
- <u-line color="#EEEEEE" />
- <view class="btn" @click="sureAddress">确认</view>
- </view>
- </u-popup>
- </view>
- </template>
- <script>
- import { mapGetters } from 'vuex';
- export default {
- data() {
- return {
- address_show: false,
- addressName: '广州市天可区燕岭路建设大厦3楼',
- addressList:[{checked:true,address: '广州市天可区燕岭路建设大厦3楼'},{checked:false,address: '广州市海珠区广州塔3楼'},{checked:false,address: '深圳市企鹅大厦附近的写字楼'}],
- list: [{
- time: '2021/10/23 10:00 ~ 11:00',
- total: 100,
- appoint: 100,
- checked: true,
- status: 1, // 1:可报 2:预约名额已满 3:此时段您已经有其他考试预约
- },
- {
- time: '2021/10/23 10:00 ~ 11:00',
- total: 100,
- appoint: 20,
- status: 2,
- },
- {
- time: '2021/10/23 10:00 ~ 11:00',
- total: 100,
- appoint: 20,
- status: 3
- },
- {
- time: '2021/10/23 10:00 ~ 11:00',
- total: 100,
- appoint: 20,
- status: 1
- }
- ]
- };
- },
- onLoad(option) {},
- methods: {
- showAddress(){
- this.address_show = true
- },
- choAddress(index){
- this.addressList.forEach((item,idx)=>{
- item.checked = false
- this.$set(item, 'checked',false)
- if(idx === index){
- this.$set(item, 'checked',true)
- }
- })
- },
- sureAddress(){
- const index = this.addressList.findIndex(item => item.checked)
- this.addressName = this.addressList[index].address
- this.address_show = false
- },
- choItem(index){
- const item = this.list[index]
- if(item.status!==1){
- return
- }
- this.list.forEach((item,idx)=>{
- item.checked = false
- if(idx === index){
- item.checked = true
- }
- })
- },
- sureOppoint(){
- this.$navTo.togo('/pages2/order/confirm_list');
- }
- },
- };
- </script>
- <style >
- page{
- background-color: #EAEEF1;
- }
- .addModel .u-drawer-bottom{
- box-shadow: 0px 0px 16px 4px rgba(145, 156, 178, 0.1);
- border-radius: 32rpx 32rpx 0px 0px;
- }
- </style>
- <style scoped lang="scss">
- .appointment{
- padding:0 8rpx;
- .appointmentItem{
- margin: 24rpx 0 40rpx;
- .title{
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 1;
- margin-bottom: 16rpx;
- padding-left: 24rpx;
- }
- .place{
- height: 80rpx;
- background: #FFFFFF;
- border-radius: 16rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 24rpx;
- }
- }
- .main{
- background: #FFFFFF;
- border-radius: 16rpx;
- padding: 32rpx 16rpx;
- .item{
- display: flex;
- align-items: center;
- margin-bottom: 16rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- .statusInfo{
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FF3B30;
- padding-left:24rpx;
- }
- .checkbox {
- width:32rpx;
- height:32rpx;
- display: flex;
- align-items: center;
- }
- .time{
- width: 430rpx;
- height: 80rpx;
- line-height: 80rpx;
- background: #F5F5F5;
- border: 2rpx solid #F5F5F5;
- border-radius: 16rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- text-align: center;
- color: #333333;
- margin: 0 18rpx 0 8rpx;
- &.active{
- background: #EBF5FF;
- border: 2px solid #007AFF;
- }
- &.no{
- background: #FFDDDB;
- border: 2px solid #FFDDDB;
- }
- }
- }
- }
- .btnMain{
- display: flex;
- justify-content: center;
- text-align: center;
- .return{
- width: 200rpx;
- height: 80rpx;
- line-height: 80rpx;
- background: #F5F5F5;
- border-radius: 40rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #007AFF;
- }
- .sure{
- width: 438rpx;
- height: 80rpx;
- line-height: 80rpx;
- background: #007AFF;
- border-radius: 40rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- margin-left:24rpx;
- }
- }
- }
- .tipBox{
- width: 100%;
- font-family: PingFang SC;
- .line{
- width: 80rpx;
- height: 8rpx;
- background: #999999;
- border-radius: 4rpx;
- margin: 8rpx auto;
- }
- .title{
- text-align: center;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- margin: 15rpx 0;
- }
- .main{
- font-size: 30rpx;
- font-weight: 500;
- color: #666666;
- line-height: 48rpx;
- margin-bottom: 40rpx;
- }
- .addressList{
- height: 500rpx;
- padding-top:24rpx;
- .item{
- display: flex;
- align-items: center;
- padding: 0 24rpx;
- margin-bottom: 24rpx;
- .checkbox{
- width:32rpx;
- height:32rpx;
- display: flex;
- align-items: center;
- margin-right: 8rpx;
- }
- .address{
- width: 654rpx;
- height: 80rpx;
- line-height: 80rpx;
- background: #F5F5F5;
- border-radius: 16rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- padding: 0 24rpx;
- &.active{
- background: #EBF5FF;
- border: 2rpx solid #007AFF;
- }
- }
- }
- }
- .btn{
- width: 200rpx;
- height: 64rpx;
- line-height: 64rpx;
- background: linear-gradient(0deg, #015EEA, #00C0FA);
- border-radius: 32rpx;
- margin: 17rpx auto;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- text-align: center;
- color: #FFFFFF;
- }
- }
- </style>
|