Commit 1fa9916b by zhangzhen

功能优化

parent 616a7ffc
......@@ -35,7 +35,7 @@
</view>
<view class="flex-row part-1">
<text>备注:</text>
<text>{{item.remark}}</text>
<text>{{item.remark||'无'}}</text>
</view>
</view>
</view>
......
......@@ -48,7 +48,7 @@
<view class="title titleStyle">
<text class="text-title">房间预览</text>
</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)">
<view class="itemRow listStyle">
<view class="relative part-top">
......@@ -93,8 +93,16 @@
</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>
<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>
</scroll-view>
......@@ -130,13 +138,15 @@
systemConfig
} from "@/api/index.js";
import {
getListStore
getListStore,
listSortDistance
} from "@/api/store";
import config from "@/config/index.config"
import ToolBox from "@/components/toolBox/toolBox"
import {
getDictItem
} from "@/utils/tools.js"
import moment from '@/common/moment';
export default {
components: {
......@@ -146,6 +156,11 @@
LoginPop
},
data() {
let h = new Date().getHours();
let list = []
for(let i=0;i<24;i++){
list.push(h+i)
}
return {
scrollTop: 0,
storeId: '',
......@@ -197,7 +212,10 @@
roomTypeEnum:{},
roomStatusEnum:{},
show: true,
timer: null
timer: null,
roomVoList:[],
list,
objListDate:[]
}
},
onShow() {
......@@ -236,7 +254,6 @@
this.facilitieList = getDictItem(dicts, "indoor_facilities");
this.roomTypeEnum = getDictItem(dicts, "store_room_type");
this.roomStatusEnum = getDictItem(dicts, "store_room_status");
this.onGetListStore();
})
},
onLoading() {
......@@ -251,11 +268,11 @@
this.longitude = res.longitude;
uni.setStorageSync("latitude", res.latitude)
uni.setStorageSync("longitude", res.longitude)
this.onGetListStore()
} else{
this.$refs.popup.open()
uni.hideLoading()
}
this.onGetListStore()
}
})
},
......@@ -277,16 +294,43 @@
}
that.storeInfo = {
...obj,
distance:obj.distance? Number(obj.distance.substr(0,8)).toFixed(2):0,
roomVoList:obj.roomVoList && obj.roomVoList.length? obj.roomVoList.map(item => {
distance:obj.distance? Number(obj.distance.substr(0,8)).toFixed(2):0
}
if(obj.roomVoList && obj.roomVoList.length){
that.roomVoList = obj.roomVoList.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) : []
}
})
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 @@
width: 100%;
display: flex;
flex-direction: row;
padding: 20upx 0;
padding: 20upx 0 16upx;
// 容器
.part-top{
display: flex;
......@@ -952,4 +996,19 @@
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>
\ No newline at end of file
......@@ -52,18 +52,6 @@
<view class="part-1">
<text class="text-title text-lg text-bold">套餐选择:</text>
</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" >
<view class="flex-row package-box">
<view v-for="(item,index) in packageMode" :key="index" class="flex-col item"
......@@ -99,7 +87,7 @@
</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">
<text class="text-title text-lg text-bold">时长选择:</text>
</view>
......@@ -152,7 +140,7 @@
<view class="flex-1 flex-row">
<view class="round-box pink">
</view>
<text>已选时段</text>
<text>当前选择时段</text>
</view>
<view class="flex-1 flex-row">
<view class="round-box blank">
......@@ -214,13 +202,6 @@
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text>
</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 class="pay-content-box">
<view class="flex-row">
......@@ -231,7 +212,7 @@
</view>
</view>
<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>
<button class="cu-btn cu-btn-2 " @tap="onOrderConfirm">{{orderType===1?'预约':'续单'}} </button>
</view>
......@@ -527,7 +508,7 @@
.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.index = 1;
this.modeIndex = 0;
......
......@@ -31,7 +31,7 @@
</view>
<view class="flex-row">
<view class="part-img">
<image :src="hostUrl+orderInfo.roomImages[0]" mode="heightFix"></image>
<image :src="hostUrl+orderInfo.roomImages[0]" mode="aspectFill"></image>
</view>
<view class="flex-1 flex-col">
<view class="info">
......@@ -52,14 +52,14 @@
</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">
<text class="text-gray ">订单编号</text>
<text class="text-title ">{{orderInfo.orderNo||'-'}}</text>
</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">
<text class="text-gray">支付方式</text>
<text class="text-title">{{orderInfo.payType==1?'微信支付':'其他支付'}}</text>
......@@ -68,10 +68,7 @@
<text class="text-gray">优惠券抵扣</text>
<text class="text-title">{{orderInfo.couponName}}</text>
</view>
<view class="flex-between">
<text class="text-gray">支付时间</text>
<text class="text-title">{{orderInfo.payTime||'-'}}</text>
</view>
<view class="flex-between">
<text class="text-gray">实付金额</text>
<view class="flex-row" style="align-items: center;">
......@@ -79,6 +76,10 @@
<text style="margin-left: 4upx;"></text>
</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">
<text class="text-gray">取消时间</text>
<text class="text-title">{{orderInfo.refundReasonTime}}</text>
......@@ -97,7 +98,7 @@
<button class="cu-btn block round bg-pink lg" :class="openDoorStatus?'bg-gray':'bg-pink'" @tap="onOpenDoor">进店开门</button>
</view>
<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 v-if="orderInfo.status === 1" class="part">
<button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button>
......@@ -167,7 +168,7 @@
},
onShareAppMessage() {
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}`
}
},
......@@ -203,8 +204,12 @@
})
},
onNavToShare(){
uni.navigateTo({
url:"/pages/share/share?orderNo="+this.orderNo
// uni.navigateTo({
// url:"/pages/share/share?orderNo="+this.orderNo
// })
wx.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
})
},
onOpenDoor(){
......@@ -362,9 +367,9 @@
}
.part-img{
display: flex;
margin: 20upx 20upx 20upx 0;
width: 180upx;
height: 220upx;
margin: 10upx 12upx 10upx 0;
width: 200upx;
height: 200upx;
border-radius: 12upx;
overflow: hidden;
>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