Commit 56dfddfc by zhangzhen

细节优化

parent 68c98580
...@@ -77,11 +77,27 @@ ...@@ -77,11 +77,27 @@
</view> </view>
</view> </view>
<view class="facilitie-box"> <view class="facilitie-box">
<view v-for="(val,i) in item.facilities" :key="i" class='cu-tag radius bg-brown'> <view v-for="(val,i) in item.facilities" :key="i" v-if="i<7" class='cu-tag radius bg-brown'>
<text>{{facilitieList[val]}}</text> <text>{{facilitieList[val]}}</text>
</view> </view>
</view> </view>
<view class="item-Go">
<view class="flex-row room-type">
<view class="flex-col">
<view v-for="(val,i) in item.packList" :key="i" v-if="i<2" class="item">
<view class="part-1">
<text></text>
</view>
<view class="part-2">
<text>{{val.duration}}小时套餐:</text>
<text class="text-red text-bold text-lg">{{val.price}}/场</text>
</view>
</view>
</view>
</view>
</view>
<view class="flex-between confirm-box"> <view class="flex-between confirm-box">
<view class="flex-priceBox"> <view class="flex-priceBox">
<text style="color: #e70486;margin-left: -6rpx;"></text><text class="text-pink">{{ item.price }}</text><text>/小时</text> <text style="color: #e70486;margin-left: -6rpx;"></text><text class="text-pink">{{ item.price }}</text><text>/小时</text>
...@@ -93,8 +109,8 @@ ...@@ -93,8 +109,8 @@
</view> </view>
</view> </view>
</view> </view>
<view class="item-line"></view> <!-- <view class="item-line"></view> -->
<view class="item-Go"> <!-- <view class="item-Go">
<view class="flex-row room-type"> <view class="flex-row room-type">
<view class="flex-wrap"> <view class="flex-wrap">
<view v-for="(val,i) in item.packList" :key="i" class="item"> <view v-for="(val,i) in item.packList" :key="i" class="item">
...@@ -104,16 +120,13 @@ ...@@ -104,16 +120,13 @@
<view class="part-2"> <view class="part-2">
<text>{{val.duration}}小时套餐{{val.price}}</text> <text>{{val.duration}}小时套餐{{val.price}}</text>
</view> </view>
<!-- <view class="part-3">
<text>{{(val.price/val.duration).toFixed(2)}}/小时</text>
</view> -->
</view> </view>
</view> </view>
<view class=""> <view class="">
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -800,16 +813,6 @@ ...@@ -800,16 +813,6 @@
} }
} }
} }
.facilitie-box {
display: flex;
flex: 1;
flex-wrap: wrap;
padding: 12rpx 0 12rpx 20rpx;
.cu-tag{
}
}
.location-box{ .location-box{
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -871,12 +874,12 @@ ...@@ -871,12 +874,12 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 200rpx; width: 240rpx;
height: 280upx; // height: 280upx;
overflow: hidden; overflow: hidden;
.room-img{ .room-img{
width: inherit; width: inherit;
height: 94%; height: 96%;
border-radius: 12rpx !important; border-radius: 12rpx !important;
} }
} }
...@@ -902,11 +905,17 @@ ...@@ -902,11 +905,17 @@
} }
// 标签 // 标签
.facilitie-box{ .facilitie-box{
padding: 8rpx 0 ; display: flex;
flex-wrap: wrap;
padding: 0;
align-items: center;
min-height: 88upx;
.bg-brown{ .bg-brown{
color: #c98d35; color: #c98d35;
background-color: #f8eddd; background-color: #f8eddd;
margin: 8upx; margin: 4upx;
padding: 0 8upx;
height: 36upx;
} }
} }
// 价格 // 价格
...@@ -931,6 +940,7 @@ ...@@ -931,6 +940,7 @@
} }
// 栏目下 // 栏目下
.item-Go{ .item-Go{
display: flex;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -939,14 +949,15 @@ ...@@ -939,14 +949,15 @@
display: flex; display: flex;
flex: 1; flex: 1;
align-items: center; align-items: center;
text { // text {
color: #9e9e9e; // color: #9e9e9e;
font-size: 28rpx; // font-size: 28rpx;
} // }
.flex-wrap{ .flex-wrap{
display: flex; display: flex;
flex: 1; flex: 1;
flex-wrap: wrap; // flex-wrap: wrap;
flex-direction: column;
} }
// .item { // .item {
// display: flex; // display: flex;
...@@ -969,17 +980,18 @@ ...@@ -969,17 +980,18 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
padding: 20upx 0; >.flex-col{
width: 100%;
}
.item { .item {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
width: 48%; // width: 80%;
height: 44rpx; // height: 44rpx;
background: #FFFFFF; // background: #FFFFFF;
border-radius: 8upx; // border: 2rpx solid #fc3f21;
border: 2rpx solid #fc3f21; margin: 6upx 1%;
margin: 8upx 1%;
overflow: hidden; overflow: hidden;
.part-1{ .part-1{
...@@ -987,16 +999,18 @@ ...@@ -987,16 +999,18 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
padding: 8upx; padding: 4upx 6upx;
background: #fc3f21; background: #fc3f21;
border-radius: 8upx;
text{ text{
font-size: 24upx;
color: #ffffff; color: #ffffff;
} }
} }
.part-2{ .part-2{
display: flex; display: flex;
flex: 1; flex: 1;
justify-content: center; // justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
padding: 8upx; padding: 8upx;
...@@ -1009,10 +1023,10 @@ ...@@ -1009,10 +1023,10 @@
height: 100%; height: 100%;
padding: 8upx; padding: 8upx;
} }
text { // text {
font-size: 25upx; // font-size: 25upx;
color: #fc3f21; // color: #fc3f21;
} // }
} }
} }
......
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
<text class="text-black text-left">优惠券</text> <text class="text-black text-left">优惠券</text>
<view class="flex-row" @tap="onNavToSelectCoupon"> <view class="flex-row" @tap="onNavToSelectCoupon">
<text class="" :class="useCouponList.length?'text-pink':'text-gray'"> <text class="" :class="useCouponList.length?'text-pink':'text-gray'">
{{useCouponList.length? useCouponList[selectCouponIndex].name: '暂无可用'}}</text> {{selectCouponIndex === -1 ? '请选择' : useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: '暂无可用'}}</text>
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text> <text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</view> </view>
</view> </view>
...@@ -722,8 +722,12 @@ ...@@ -722,8 +722,12 @@
url: "/pages/useCoupon/index", url: "/pages/useCoupon/index",
events: { events: {
getSelectData(data) { getSelectData(data) {
that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data if(data.couponId){
.couponId) that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data.couponId)
}else{
that.selectCouponIndex = -1
}
} }
}, },
success(res) { success(res) {
...@@ -733,7 +737,7 @@ ...@@ -733,7 +737,7 @@
orderMode: that.orderTypeList[that.index].type, orderMode: that.orderTypeList[that.index].type,
preStartDate: dateObj.startDate, preStartDate: dateObj.startDate,
preEndDate: dateObj.endDate, preEndDate: dateObj.endDate,
selectId: that.useCouponList[that.selectCouponIndex].id selectId: that.selectCouponIndex >= 0 ? that.useCouponList[that.selectCouponIndex].id :''
}) })
} }
}) })
...@@ -749,7 +753,7 @@ ...@@ -749,7 +753,7 @@
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
buyType: this.orderTypeList[this.index].type, buyType: this.orderTypeList[this.index].type,
couponId: this.useCouponList.length ? this.useCouponList[this.selectCouponIndex].id : '', couponId: this.useCouponList.length && this.selectCouponIndex >= 0 ? this.useCouponList[this.selectCouponIndex].id : '',
orderType: this.orderType, orderType: this.orderType,
preStartDate: dateObj.startDate, preStartDate: dateObj.startDate,
preEndDate: dateObj.endDate, preEndDate: dateObj.endDate,
...@@ -911,7 +915,7 @@ ...@@ -911,7 +915,7 @@
orderType: this.orderType, orderType: this.orderType,
buyType: this.orderTypeList[this.index].type, buyType: this.orderTypeList[this.index].type,
payType: 1, payType: 1,
couponId: this.useCouponList.length ? this.useCouponList[this.selectCouponIndex].id : '', couponId: this.useCouponList.length && this.selectCouponIndex >=0 ? this.useCouponList[this.selectCouponIndex].id : '',
preStartDate: dateObj.startDate, preStartDate: dateObj.startDate,
preEndDate: dateObj.endDate, preEndDate: dateObj.endDate,
totalFee: Number(this.roomInfo.price) * this.duration, totalFee: Number(this.roomInfo.price) * this.duration,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</view> </view>
<view class="flex-between part-1"> <view class="flex-between part-1">
<text>{{item.createTime}}</text> <text>{{item.createTime}}</text>
<text>{{payTypeEnum[item.payType||'1']}}</text> <text>{{item.payType}}</text>
</view> </view>
</view> </view>
</view> </view>
......
<template> <template>
<view class="coupon-list-box"> <view class="coupon-list-box">
<view v-for="(item,index) in list" :key="index" class="coupon-item" :class="{active: selectId === item.id }"
<view v-for="(item,index) in list" :key="index" class="coupon-item" :class="{active: current === index}"
@tap="onSelect(item,index)"> @tap="onSelect(item,index)">
<view class="part-left"> <view class="part-left">
<image :src="item.isAvailable === 0? '../../static/coupon_icon.png':'../../static/coupon_icon_gray.png'" <image :src="item.isAvailable === 0? assetsPath + '/coupon_icon.png':assetsPath+'/coupon_icon_gray.png'"
mode="widthFix"></image> mode="widthFix"></image>
</view> </view>
<view class="part-right"> <view class="part-right">
...@@ -41,12 +40,13 @@ ...@@ -41,12 +40,13 @@
<view class="box-content"> <view class="box-content">
<button class="cu-btn round bg-gray " @tap="onCancle">返回</button> <button class="cu-btn round bg-gray " @tap="onCancle">返回</button>
<button class="cu-btn round bg-pink " @tap="onConfirm">选择</button> <button class="cu-btn round bg-pink " @tap="onConfirm">确定</button>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import config from "@/config/index.config"
import indexConfig from "@/config/index.config"; import indexConfig from "@/config/index.config";
import FixedHeader from "@/components/fixedHeader/index"; import FixedHeader from "@/components/fixedHeader/index";
import { import {
...@@ -57,8 +57,8 @@ ...@@ -57,8 +57,8 @@
data() { data() {
return { return {
scrollTop: 0, scrollTop: 0,
current: undefined,
hostUrl: indexConfig.hostUrl, hostUrl: indexConfig.hostUrl,
assetsPath: config.assetsPath,
statusBarHeight: this.statusBarHeight, statusBarHeight: this.statusBarHeight,
titleBarHeight: this.titleBarHeight, titleBarHeight: this.titleBarHeight,
list: [], list: [],
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
this.eventChannel.on('sendData', (data) => { this.eventChannel.on('sendData', (data) => {
this.selectId = data.selectId || '' this.selectId = data.selectId || ''
console.log(this.selectId,909090)
this.onLoading(data); this.onLoading(data);
}) })
}, },
...@@ -95,21 +96,24 @@ ...@@ -95,21 +96,24 @@
if (res.statusCode == 200) { if (res.statusCode == 200) {
if (res.data && res.data.data.length) { if (res.data && res.data.data.length) {
this.list = res.data.data.sort((a, b) => b.subPrice - a.subPrice); this.list = res.data.data.sort((a, b) => b.subPrice - a.subPrice);
this.current = this.selectId? this.list.findIndex(item=>item.id === this.selectId) : 0
} }
} }
}) })
}, },
onSelect(item, i) { onSelect(item) {
if (item.isAvailable !== 0 || this.current === i) return if (item.isAvailable !== 0) return
this.current = i if(this.selectId === item.id){
this.selectId = ''
}else{
this.selectId = item.id
}
}, },
onCancle() { onCancle() {
uni.navigateBack() uni.navigateBack()
}, },
onConfirm() { onConfirm() {
this.eventChannel.emit('getSelectData', { this.eventChannel.emit('getSelectData', {
couponId: this.list[this.current].id couponId: this.selectId
}); });
this.onCancle(); this.onCancle();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment