Commit 56dfddfc by zhangzhen

细节优化

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