Commit 1fa9916b by zhangzhen

功能优化

parent 616a7ffc
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</view> </view>
<view class="flex-row part-1"> <view class="flex-row part-1">
<text>备注:</text> <text>备注:</text>
<text>{{item.remark}}</text> <text>{{item.remark||'无'}}</text>
</view> </view>
</view> </view>
</view> </view>
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<view class="title titleStyle"> <view class="title titleStyle">
<text class="text-title">房间预览</text> <text class="text-title">房间预览</text>
</view> </view>
<view v-for="(item,index) in storeInfo.roomVoList" :key="index" class="list-item-box" <view v-for="(item,index) in roomVoList" :key="index" class="list-item-box"
@tap="onNavToOrder(item)"> @tap="onNavToOrder(item)">
<view class="itemRow listStyle"> <view class="itemRow listStyle">
<view class="relative part-top"> <view class="relative part-top">
...@@ -93,8 +93,16 @@ ...@@ -93,8 +93,16 @@
</view> </view>
</view> </view>
</view> </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="objListDate.length&&objListDate[index][k].status==1?'bg-pink':'bg-gray'">
</view>
<text class="text-gray text-sm">{{val>=24? val-24:val}}</text>
</view>
</view> </view>
<u-empty v-if="!storeInfo.roomVoList || storeInfo.roomVoList.lenght <= 0 " text="门店暂无可使用房间" textColor='#C1C1C1'></u-empty> </view>
<u-empty v-if="!roomVoList ||roomVoList.lenght <= 0 " text="门店暂无可使用房间" textColor='#C1C1C1'></u-empty>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -130,13 +138,15 @@ ...@@ -130,13 +138,15 @@
systemConfig systemConfig
} from "@/api/index.js"; } from "@/api/index.js";
import { import {
getListStore getListStore,
listSortDistance
} 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"
import { import {
getDictItem getDictItem
} from "@/utils/tools.js" } from "@/utils/tools.js"
import moment from '@/common/moment';
export default { export default {
components: { components: {
...@@ -146,6 +156,11 @@ ...@@ -146,6 +156,11 @@
LoginPop LoginPop
}, },
data() { data() {
let h = new Date().getHours();
let list = []
for(let i=0;i<24;i++){
list.push(h+i)
}
return { return {
scrollTop: 0, scrollTop: 0,
storeId: '', storeId: '',
...@@ -197,7 +212,10 @@ ...@@ -197,7 +212,10 @@
roomTypeEnum:{}, roomTypeEnum:{},
roomStatusEnum:{}, roomStatusEnum:{},
show: true, show: true,
timer: null timer: null,
roomVoList:[],
list,
objListDate:[]
} }
}, },
onShow() { onShow() {
...@@ -236,7 +254,6 @@ ...@@ -236,7 +254,6 @@
this.facilitieList = getDictItem(dicts, "indoor_facilities"); this.facilitieList = getDictItem(dicts, "indoor_facilities");
this.roomTypeEnum = getDictItem(dicts, "store_room_type"); this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.roomStatusEnum = getDictItem(dicts, "store_room_status"); this.roomStatusEnum = getDictItem(dicts, "store_room_status");
this.onGetListStore();
}) })
}, },
onLoading() { onLoading() {
...@@ -251,11 +268,11 @@ ...@@ -251,11 +268,11 @@
this.longitude = res.longitude; this.longitude = res.longitude;
uni.setStorageSync("latitude", res.latitude) uni.setStorageSync("latitude", res.latitude)
uni.setStorageSync("longitude", res.longitude) uni.setStorageSync("longitude", res.longitude)
this.onGetListStore()
} else{ } else{
this.$refs.popup.open() this.$refs.popup.open()
uni.hideLoading() uni.hideLoading()
} }
this.onGetListStore()
} }
}) })
}, },
...@@ -277,16 +294,43 @@ ...@@ -277,16 +294,43 @@
} }
that.storeInfo = { that.storeInfo = {
...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
roomVoList:obj.roomVoList && obj.roomVoList.length? obj.roomVoList.map(item => { }
if(obj.roomVoList && obj.roomVoList.length){
that.roomVoList = obj.roomVoList.map(item => {
return { return {
...item, ...item,
facilities: item.facilities ? item.facilities.split(",") : [], facilities: item.facilities ? item.facilities.split(",") : [],
images: item.images ? item.images images: item.images ? item.images.split(",").map(val => this.hostUrl + val) : []
.split(",").map(val => this.hostUrl + val) : [] }
})
console.log(that.roomVoList,"that.roomVoList")
that.onGetSortDistance(0);
}
} }
}):[] })
},
onGetSortDistance(i = 0){
listSortDistance({
storeId: this.storeInfo.id,
roomId: this.roomVoList[i].id,
day: moment().format("YYYY-MM-DD"),
orderType:1
}).then(res=>{
if(res.data.code == 200 && i <= this.roomVoList.length-1){
this.objListDate[i] = res.data.data;
i+=1
if(i >= this.roomVoList.length){
this.objListDate = this.objListDate.map(item=>{
return this.list.map(val=>item[val])
})
console.log(this.objListDate,"this.objListDate")
}else{
this.onGetSortDistance(i)
} }
} }
}) })
}, },
...@@ -765,7 +809,7 @@ ...@@ -765,7 +809,7 @@
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
padding: 20upx 0; padding: 20upx 0 16upx;
// 容器 // 容器
.part-top{ .part-top{
display: flex; display: flex;
...@@ -952,4 +996,19 @@ ...@@ -952,4 +996,19 @@
margin-right: 4upx; margin-right: 4upx;
} }
} }
.list-point-box{
width: 100%;
margin-bottom: 20upx;
.flex-col{
text-align: center;
}
.box{
margin: 0 4upx 6upx;
height: 20upx;
border-radius: 8upx;
}
.text-sm{
font-size: 20upx;
}
}
</style> </style>
\ No newline at end of file
...@@ -52,18 +52,6 @@ ...@@ -52,18 +52,6 @@
<view class="part-1"> <view class="part-1">
<text class="text-title text-lg text-bold">套餐选择:</text> <text class="text-title text-lg text-bold">套餐选择:</text>
</view> </view>
<!-- <view class="flex-1 package-box">
<view v-for="(item,index) in packageMode" v-if="index<=3" :key="index" class="flex-col item"
:class="{active: modeIndex===index,'item-3':packageMode.length<3,'item-n':packageMode.length>=3}"
@tap="onChangeMode(index)">
<text class="text-title">{{item.duration}}小时套餐</text>
<view class="flex-row" style="margin-top: 12upx;">
<text style="margin-bottom: 4upx;"></text>
<text class="text-title text-bold text-xl">{{item.price}}</text>
</view>
</view>
</view> -->
<scroll-view scroll-x="true" class="scroll-view" > <scroll-view scroll-x="true" class="scroll-view" >
<view class="flex-row package-box"> <view class="flex-row package-box">
<view v-for="(item,index) in packageMode" :key="index" class="flex-col item" <view v-for="(item,index) in packageMode" :key="index" class="flex-col item"
...@@ -99,7 +87,7 @@ ...@@ -99,7 +87,7 @@
</view> </view>
</view> </view>
<view v-if="orderType ===2" class="flex-col distance-mode" style="margin: 40upx 20upx 40upx;"> <view v-if="orderType ===2 && index == 0" class="flex-col distance-mode" style="margin: 40upx 20upx 40upx;">
<view class="distance-title"> <view class="distance-title">
<text class="text-title text-lg text-bold">时长选择:</text> <text class="text-title text-lg text-bold">时长选择:</text>
</view> </view>
...@@ -152,7 +140,7 @@ ...@@ -152,7 +140,7 @@
<view class="flex-1 flex-row"> <view class="flex-1 flex-row">
<view class="round-box pink"> <view class="round-box pink">
</view> </view>
<text>已选时段</text> <text>当前选择时段</text>
</view> </view>
<view class="flex-1 flex-row"> <view class="flex-1 flex-row">
<view class="round-box blank"> <view class="round-box blank">
...@@ -214,13 +202,6 @@ ...@@ -214,13 +202,6 @@
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text> <text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text>
</view> </view>
</view> </view>
<!-- <view class="flex-between price">
<text class="text-title text-lg">账户余额</text>
<view class="flex-row text-pink">
<text class="text-title text-lg">¥0.00</text>
<button class="recharge-btn cu-btn round bg-pink sm" @tap="onNavRecharge">去充值</button>
</view>
</view> -->
</view> </view>
<view class="pay-content-box"> <view class="pay-content-box">
<view class="flex-row"> <view class="flex-row">
...@@ -231,7 +212,7 @@ ...@@ -231,7 +212,7 @@
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<button v-if="orderType===1" class="cu-btn cu-btn-1 margin-right" <button class="cu-btn cu-btn-1 margin-right"
@tap="onNavToCheckedCoupon">团购验券</button> @tap="onNavToCheckedCoupon">团购验券</button>
<button class="cu-btn cu-btn-2 " @tap="onOrderConfirm">{{orderType===1?'预约':'续单'}} </button> <button class="cu-btn cu-btn-2 " @tap="onOrderConfirm">{{orderType===1?'预约':'续单'}} </button>
</view> </view>
...@@ -527,7 +508,7 @@ ...@@ -527,7 +508,7 @@
.split(",").map(val => this.hostUrl + val) : [] .split(",").map(val => this.hostUrl + val) : []
} }
// 判断房间有没有绑定套餐 // 判断房间有没有绑定套餐
if (this.orderType === 1 && this.roomInfo.packList && this.roomInfo.packList.length) { if (this.roomInfo.packList && this.roomInfo.packList.length) {
this.packageMode = this.roomInfo.packList this.packageMode = this.roomInfo.packList
this.index = 1; this.index = 1;
this.modeIndex = 0; this.modeIndex = 0;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</view> </view>
<view class="flex-row"> <view class="flex-row">
<view class="part-img"> <view class="part-img">
<image :src="hostUrl+orderInfo.roomImages[0]" mode="heightFix"></image> <image :src="hostUrl+orderInfo.roomImages[0]" mode="aspectFill"></image>
</view> </view>
<view class="flex-1 flex-col"> <view class="flex-1 flex-col">
<view class="info"> <view class="info">
...@@ -52,14 +52,14 @@ ...@@ -52,14 +52,14 @@
</view> </view>
</view> </view>
</view> </view>
<view v-if="orderInfo.packName" class="flex-between">
<text class="text-gray ">套餐名称</text>
<text class="text-title ">{{orderInfo.packName||'-'}}</text>
</view>
<view class="flex-between"> <view class="flex-between">
<text class="text-gray ">订单编号</text> <text class="text-gray ">订单编号</text>
<text class="text-title ">{{orderInfo.orderNo||'-'}}</text> <text class="text-title ">{{orderInfo.orderNo||'-'}}</text>
</view> </view>
<view v-if="orderInfo.packName" class="flex-between">
<text class="text-gray ">购买套餐</text>
<text class="text-title ">{{orderInfo.packName||'-'}}</text>
</view>
<view class="flex-between"> <view class="flex-between">
<text class="text-gray">支付方式</text> <text class="text-gray">支付方式</text>
<text class="text-title">{{orderInfo.payType==1?'微信支付':'其他支付'}}</text> <text class="text-title">{{orderInfo.payType==1?'微信支付':'其他支付'}}</text>
...@@ -68,10 +68,7 @@ ...@@ -68,10 +68,7 @@
<text class="text-gray">优惠券抵扣</text> <text class="text-gray">优惠券抵扣</text>
<text class="text-title">{{orderInfo.couponName}}</text> <text class="text-title">{{orderInfo.couponName}}</text>
</view> </view>
<view class="flex-between">
<text class="text-gray">支付时间</text>
<text class="text-title">{{orderInfo.payTime||'-'}}</text>
</view>
<view class="flex-between"> <view class="flex-between">
<text class="text-gray">实付金额</text> <text class="text-gray">实付金额</text>
<view class="flex-row" style="align-items: center;"> <view class="flex-row" style="align-items: center;">
...@@ -79,6 +76,10 @@ ...@@ -79,6 +76,10 @@
<text style="margin-left: 4upx;"></text> <text style="margin-left: 4upx;"></text>
</view> </view>
</view> </view>
<view class="flex-between">
<text class="text-gray">支付时间</text>
<text class="text-title">{{orderInfo.payTime||'-'}}</text>
</view>
<view v-if="orderInfo.refundReasonTime" class="flex-between"> <view v-if="orderInfo.refundReasonTime" class="flex-between">
<text class="text-gray">取消时间</text> <text class="text-gray">取消时间</text>
<text class="text-title">{{orderInfo.refundReasonTime}}</text> <text class="text-title">{{orderInfo.refundReasonTime}}</text>
...@@ -97,7 +98,7 @@ ...@@ -97,7 +98,7 @@
<button class="cu-btn block round bg-pink lg" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoor">进店开门</button> <button class="cu-btn block round bg-pink lg" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoor">进店开门</button>
</view> </view>
<view class="part"> <view class="part">
<button class="cu-btn block round line-pink lg" @tap="onNavToShare">分享好友</button> <button class="cu-btn block round line-pink lg" open-type="share">分享好友</button>
</view> </view>
<view v-if="orderInfo.status === 1" class="part"> <view v-if="orderInfo.status === 1" class="part">
<button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button> <button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button>
...@@ -167,7 +168,7 @@ ...@@ -167,7 +168,7 @@
}, },
onShareAppMessage() { onShareAppMessage() {
return { return {
title: `${this.orderInfo.storeName}-${this.orderInfo.roomName}${roomTypeName}】`, title: `${this.orderInfo.storeName}-${this.orderInfo.roomName}${this.orderInfo.roomTypeName}】`,
path: `/pages/orderResult/orderResult?orderNo=${this.orderNo}` path: `/pages/orderResult/orderResult?orderNo=${this.orderNo}`
} }
}, },
...@@ -203,8 +204,12 @@ ...@@ -203,8 +204,12 @@
}) })
}, },
onNavToShare(){ onNavToShare(){
uni.navigateTo({ // uni.navigateTo({
url:"/pages/share/share?orderNo="+this.orderNo // url:"/pages/share/share?orderNo="+this.orderNo
// })
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
}) })
}, },
onOpenDoor(){ onOpenDoor(){
...@@ -362,9 +367,9 @@ ...@@ -362,9 +367,9 @@
} }
.part-img{ .part-img{
display: flex; display: flex;
margin: 20upx 20upx 20upx 0; margin: 10upx 12upx 10upx 0;
width: 180upx; width: 200upx;
height: 220upx; height: 200upx;
border-radius: 12upx; border-radius: 12upx;
overflow: hidden; overflow: hidden;
>image{ >image{
......
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