Commit d1ad73fd by zhangzhen

细节优化

parent 10b043b7
......@@ -3839,6 +3839,10 @@ scroll-view.cu-steps .cu-item {
color: #fbbd08;
}
.text-yellow2{
color: #e6ab07;
}
.text-olive,
.line-olive,
.lines-olive {
......
......@@ -22,15 +22,19 @@
</view> -->
</view>
<view v-if="val.orderTimeType > 0" class="part-title">
<text class="text-pink text-lg">{{val.orderTime || 1}}{{orderTimeTypeEnum[val.orderTimeType]}}</text>
<text class="text-pink">前有人预定</text>
<view class="part-title-box" style="display: flex; align-items: flex-end; height: 42upx;">
<view v-if="val.orderTimeType > 0" class="part-title text-bold">
<text
class="text-yellow2 text-sm">{{val.orderTime || 1}}{{orderTimeTypeEnum[val.orderTimeType]}}</text>
<text class="text-yellow2 text-sm">前有人预定</text>
</view>
</view>
<view class="flex-between part-title">
<view class='cu-tag radius line-pink'>距离{{Number(val.distance).toFixed(2)}}km</view>
<view class='cu-tag radius line-pink sm'>距离{{Number(val.distance).toFixed(2)}}km</view>
<view class="location">
<button class="cu-btn bg-pink" >去预定</button>
<button class="cu-btn bg-pink">去预定</button>
</view>
</view>
</view>
......@@ -58,10 +62,10 @@
return {
assetsPath: config.assetsPath,
list: [],
storeTypeEnum:{},
orderTimeTypeEnum:{
1:"分钟",
2:"小时"
storeTypeEnum: {},
orderTimeTypeEnum: {
1: "分钟",
2: "小时"
}
};
},
......@@ -75,16 +79,16 @@
},
mounted() {
let dicts = JSON.parse(uni.getStorageSync('dicts'))
this.storeTypeEnum = getDictItem(dicts,"store_type");
this.storeTypeEnum = getDictItem(dicts, "store_type");
},
methods: {
onLoading() {
this.list = this.value;
},
onNavToHome(val){
uni.setStorageSync("storeId",val.id)
onNavToHome(val) {
uni.setStorageSync("storeId", val.id)
uni.switchTab({
url:`/pages/index/index?storeId=${val.id}`
url: `/pages/index/index?storeId=${val.id}`
})
},
onPreview(item) {
......@@ -99,12 +103,12 @@
longitude: Number(val.longitude),
scale: 18,
name: val.address,
address:val.address,
address: val.address,
success: (res) => {
console.log(res)
},
complete: (res) => {
console.log(res, 909090)
}
})
}
......@@ -117,6 +121,7 @@
display: flex;
flex-direction: column;
width: 100%;
>.flex-col {
display: flex;
flex-direction: column;
......@@ -135,6 +140,7 @@
border-radius: 12upx;
overflow: hidden;
margin: 0 20upx;
image {
height: 100%;
}
......@@ -210,12 +216,14 @@
}
}
}
.nav-icon{
.nav-icon {
display: flex;
justify-content: center;
align-items: center;
width: 80upx;
image{
image {
display: block;
width: 100%;
height: auto;
......
......@@ -115,7 +115,7 @@
}else{
uni.showToast({
icon:"none",
title:"无使用中的订单,无法单哦!"
title:"无使用中的订单,无法单哦!"
})
}
......
......@@ -62,8 +62,22 @@
<view class="room-box">
<view v-for="(val,k) in item.roolList" :key='k' class="room-item" :class="{marginLeft: k%4 == 0, marginRight: k%4 == 3}" @tap='onNavSearch(val)'>
<view class="room-stauts">
<view class="flex-row">
<text :style="{color: colorEnum[val.colorStatus]}">{{statusEnum[val.colorStatus]}}</text>
<text v-if="val.facilities.length" class="text-yellow2 text-sm">({{val.facilities[0]}})</text>
</view>
<view class="order-info-box" style="width: 100%;">
<image class="img" :src="assetsPath+'/avatar_no.png'" mode="widthFix"></image>
<view v-if="val.orderList&&val.orderList.length" class="list">
<view class="flex-row text-red text-bold text-sm" v-for="(orderItem,oIndex) in val.orderList" :key="oIndex">
<text>{{orderItem.preStartDate}}</text>
<text>-</text>
<text>{{orderItem.preEndDate}}</text>
</view>
</view>
</view>
<view class="end-time-box">
<text v-if="val.recordsTime && val.status==1" :style="{color: colorEnum[val.colorStatus] }">{{val.recordsTime|setTime}} 结束</text>
</view>
......@@ -144,7 +158,8 @@ import moment from "@/common/moment";
}
],
cleanStatusEnum:{},
userInfo:{}
userInfo:{},
facilitieList:{}
};
},
filters:{
......@@ -161,12 +176,14 @@ import moment from "@/common/moment";
let dicts = []
if (uni.getStorageSync('dicts')) {
dicts = JSON.parse(uni.getStorageSync('dicts'))
this.facilitieList = getDictItem(dicts, "indoor_facilities");
this.cleanStatusEnum = getDictItem(dicts, "clean_records_status");
this.onLoading()
} else {
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.facilitieList = getDictItem(dicts, "indoor_facilities");
this.cleanStatusEnum = getDictItem(dicts, "clean_records_status");
this.onLoading()
})
......@@ -182,6 +199,14 @@ import moment from "@/common/moment";
roolList: item.roolList && item.roolList.length ? item.roolList.map(val=>{
return {
...val,
orderList: val.orderList && val.orderList.length? val.orderList.map(oItem=>{
return {
...oItem,
preStartDate:moment(oItem.preStartDate).format("HH:mm"),
preEndDate: moment(oItem.preEndDate).format("HH:mm")
}
}):[],
facilities: val.facilities.split(",").map(fItem=> this.facilitieList[fItem]).filter(fVal => fVal.includes('窗')),
colorStatus: val.roomStat ===3? 2 : val.roomStat ===2? 6: val.isDirtyRoom>=1 && val.recordsStatus===0 ? 5 : val.recordsStatus>=0&& val.recordsStatus=== 0? 3: val.recordsStatus >= 0&& val.recordsStatus=== 1? 4: val.status
}
}):[]
......@@ -212,7 +237,7 @@ import moment from "@/common/moment";
scale: 18,
name: val.address,
complete: (res) => {
console.log(res)
}
})
},
......@@ -401,4 +426,21 @@ import moment from "@/common/moment";
font-size: 24upx;
}
}
.order-info-box{
position: relative;
display: flex;
width: 100%;
justify-content: center;
.list{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
}
</style>
......@@ -294,8 +294,18 @@
},
onShow() {
this.onGetSysConfig();
this.list = [];
this.onGetListStore();
this.timerLocation = setInterval(()=>{
uni.removeStorageSync("storeId")
this.onLoading();
},2*60*1000)
},
onHide() {
if(this.timerLocation){
clearInterval(this.timerLocation)
this.timerLocation = null;
}
},
onReachBottom() {
if (this.status == 'loadmore') {
......@@ -307,20 +317,12 @@
},
onLoad(option) {
this.list = [];
this.onGetDicts();
this.onSetShowPoint();
// 隐藏原生的tabbar
uni.hideTabBar();
this.$refs.loginPop.open();
if(this.timerLocation){
clearInterval(this.timerLocation)
this.timerLocation = null;
}
this.timerLocation = setInterval(()=>{
uni.removeStorageSync("storeId")
this.onLoading();
},2*60*1000)
},
methods: {
onStoreChage(id){
......@@ -472,7 +474,6 @@
that.roomVoList = list;
let l = that.roomVoList.filter(item=>item.sortNum === 1)
console.log(l.length,99999)
if(l.length<=0){
that.$refs.popupStoreList.open();
}
......@@ -612,7 +613,7 @@
current: 0,
urls: val,
complete: (res) => {
console.log(res, "预览图片")
}
})
}
......
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