Commit 0e472f79 by zhangzhen

细节优化

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