Commit 0e472f79 by zhangzhen

细节优化

parent 6c13eee2
import http from "@/common/vmeitime-http/index.js"
// 获取门店及房间信息
// 获取门店
export const getListStore=(data)=>{
let url=`/store/listVo`
return http.get(url,data)
}
export const getRoomList=(data)=>{
let url=`/room/list`
return http.get(url,data)
}
export const roomInfo=(data)=>{
let url=`/room/info`
return http.get(url,data)
......
......@@ -95,7 +95,7 @@
</view>
<view class="flex-row list-point-box">
<view v-for="(val,k) in list" :key="k" class="flex-1 flex-col">
<view class="box" :class="item.list && item.list[val].status==1 && item.list[val].m>=59?'bg-pink':'bg-gray'">
<view class="box" :class="item.roomStatusList && item.roomStatusList[val].status==1 && item.roomStatusList[val].m>=59?'bg-pink':'bg-gray'">
</view>
<text class="text-gray text-sm">{{val==24?'次日':val>24?val-24:val}}</text>
......@@ -139,7 +139,8 @@
} from "@/api/index.js";
import {
getListStore,
listSortDistance
listSortDistance,
getRoomList
} from "@/api/store";
import config from "@/config/index.config"
import ToolBox from "@/components/toolBox/toolBox"
......@@ -278,7 +279,6 @@
uni.setStorageSync("longitude", res.longitude)
} else{
this.$refs.popup.open()
uni.hideLoading()
}
this.onGetListStore()
}
......@@ -292,10 +292,9 @@
nowLongitude: this.longitude
}).then(res => {
if (res.data.code == 200 && res.data.data.length) {
this.storeList = res.data.data;
let obj = {}
if(uni.getStorageSync("storeId")){
obj = this.storeList.find(item=>item.id === uni.getStorageSync("storeId"))
obj = res.data.data.find(item=>item.id === uni.getStorageSync("storeId"))
}else{
obj = res.data.data[0];
}
......@@ -303,18 +302,31 @@
...obj,
distance:obj.distance? Number(obj.distance.substr(0,8)).toFixed(2):0
}
if(obj.roomVoList && obj.roomVoList.length){
that.roomVoList = obj.roomVoList.map(item => {
that.onGetRoomList(obj.id)
}
})
},
onGetRoomList(storeId){
let that = this;
getRoomList({storeId}).then(res=>{
if(res.data.code == 200 && res.data.data.length){
that.roomVoList = res.data.data.map(item => {
return {
...item,
facilities: item.facilities ? item.facilities.split(",") : [],
images: item.images ? item.images.split(",").map(val => this.hostUrl + val) : []
images: item.images ? item.images.split(",").map(val => this.hostUrl + val) : [],
roomStatusList: item.roomStatusList.map(val =>{
return {
...val,
m: val.endHoldTime? Number(moment(val.endHoldTime).format("mm")):0
}
})
uni.hideLoading()
that.onGetSortDistance(0);
}
})
}else{
that.roomVoList = []
}
uni.hideLoading()
})
},
onGetSortDistance(i = 0){
......
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