| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <template>
- <view>
- <uni-popup ref="chooseServiceTimePopup" :catchtouchmove="true" type="bottom">
- <view class="chooseServiceTimeView">
- <view class="chooseServiceTimeTitle">
- <text>选择服务时段</text>
- </view>
- <scroll-view class="scrollY" scroll-y>
- <u-grid :border="false" col="5">
- <u-grid-item v-for="(item,index) in periodDateList" :key="index" @click="selectPeriod(index)">
- <view class="flex-col justify-center timeItem" :class="{selectBack: index == selectIndex}">
- <view class="flex-row justify-center">
- <text class="time">{{item.label}}</text>
- </view>
- <view class="flex-row justify-center">
- <text class="price">¥{{item.price}}</text>
- </view>
- </view>
- </u-grid-item>
- </u-grid>
- </scroll-view>
- <view class="flex-row justify-between chooseServiceTeacherButton">
- <view class="chooseServiceTeacherButtonL" @click="closePopup">
- <text>取消</text>
- </view>
- <view class="chooseServiceTeacherButtonR" @click="submit">
- <text>确定</text>
- </view>
- </view>
- </view>
- </uni-popup>
- </view>
- </template>
- <script>
- export default {
- name: 'chooseServiceTime',
- props: {
- personId: {
- type: String,
- default () {
- return ''
- }
- },
- date: {
- type: String,
- default () {
- return ''
- }
- }
- },
- data() {
- return {
- selectIndex:0,
- periodDateList: []
- }
- },
- methods: {
- submit(){
- this.$emit("getPeriodDate",this.periodDateList[this.selectIndex])
- this.closePopup()
- },
- closePopup() {
- this.$refs.chooseServiceTimePopup.close()
- },
- selectPeriod(e){
- this.selectIndex = e
- },
- openPopup() {
- this.$refs.chooseServiceTimePopup.open()
- this.getServiceTime()
- },
- //获取门店排班时段
- getServiceTime(storeId, date) {
- this.$api.getServicePersonTime({
- personId: this.personId,
- date: this.date
- }).then(res => {
- this.periodDateList = res.data.data
- // if (this.periodTimeList.length === 0) {
- // uni.$u.toast('暂无排班时段')
- // }
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .chooseServiceTimeView {
- width: 750rpx;
- height: 850rpx;
- background: #FFFFFF;
- border-radius: 24rpx 24rpx 0rpx 0rpx;
- }
- .chooseServiceTimeTitle {
- font-size: 32rpx;
- font-weight: bold;
- color: #333333;
- line-height: 44rpx;
- margin-left: 34rpx;
- padding-top: 26rpx;
- }
- .scrollY {
- width: 730rpx;
- height: 604rpx;
- margin-top: 8rpx;
- margin-left: 10rpx;
- }
- .timeItem {
- width: 124rpx;
- height: 124rpx;
- background: #FAFAFA;
- border-radius: 16rpx;
- margin-top: 16rpx;
- }
- .time {
- font-size: 24rpx;
- color: #333333;
- line-height: 40rpx;
- }
- .price {
- font-size: 24rpx;
- color: #ED569F;
- line-height: 40rpx;
- }
- .chooseServiceTeacherButton {
- width: 686rpx;
- height: 80rpx;
- margin-left: 32rpx;
- margin-top: 32rpx;
- }
- .chooseServiceTeacherButtonL {
- width: 332rpx;
- height: 80rpx;
- background: #F5F5F5;
- border-radius: 54rpx;
- text-align: center;
- line-height: 80rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #666666;
- }
- .chooseServiceTeacherButtonR {
- width: 332rpx;
- height: 80rpx;
- background: #FFE05C;
- border-radius: 54rpx;
- text-align: center;
- line-height: 80rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #333333;
- }
- .serobV {
- width: 32rpx;
- height: 32rpx;
- position: absolute;
- top: 0;
- right: 0;
- }
- .serobVicon {
- width: 32rpx;
- height: 32rpx;
- }
- .selectBack {
- background: rgba(255, 224, 92, 0.1);
- border: 4rpx solid #FFE05C;
- }
- </style>
|