Commit b01256ba by zhangzhen

功能优化

parent 383821af
...@@ -16,5 +16,14 @@ export const couponChecked=(data)=>{ ...@@ -16,5 +16,14 @@ export const couponChecked=(data)=>{
return http.get(url,data) return http.get(url,data)
} }
export const getStoreListByCouponCode=(data)=>{
let url=`/chessCards/queryshop`
return http.get(url,data)
}
export const getCouponByCode=(data)=>{
let url=`/consumerCoupon/queryCode`
return http.get(url,data)
}
<template>
<view class="store-list-content">
<scroll-view class="scroll-view" scroll-y="true">
<view class="store-list">
<view class="flex-col" v-for="(val,i) in list" :key="i" @tap.stop="onNavToHome(val)">
<view class="flex-row">
<view class="room-img-box">
<image :src="val.images[0]" mode="aspectFill" @tap.stop="onPreview(val)"></image>
</view>
<view class="flex-1 part-right">
<view class="part-title">
<view class='cu-tag radius sm bg-pink'>{{storeTypeEnum[val.storeType]}}</view>
<text class="text-title text-lg text-bold">{{val.name}}</text>
</view>
<view class="flex-between">
<view class="flex-row part-title">
<text class="cuIcon-location text-pink margin-right"></text>
<view class="flex-1">
<text class="text-gray text-sm">{{val.address}}</text>
</view>
</view>
<!-- <view class="nav-icon" @tap.stop="onNavToMap(val)">
<image :src="assetsPath+'/map_icon.png'" mode="widthFix"></image>
</view> -->
</view>
<view class="flex-between part-title">
<view class='cu-tag radius line-pink'>距离{{Number(val.distance).toFixed(2)}}km</view>
<view class="location">
<button class="cu-btn bg-pink">选择</button>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
</view>
</template>
<script>
import config from "@/config/index.config"
import {
getDictItem
} from "@/utils/tools.js"
export default {
name: "storeList",
props: {
value: {
type: Array,
default: []
}
},
data() {
return {
assetsPath: config.assetsPath,
list: [],
storeTypeEnum: {},
};
},
watch: {
value: {
deep: true,
handler(val, oldVal) {
this.onLoading()
}
}
},
mounted() {
let dicts = JSON.parse(uni.getStorageSync('dicts'))
this.storeTypeEnum = getDictItem(dicts, "store_type");
},
methods: {
onLoading() {
this.list = this.value;
},
onNavToHome(val) {
this.$emit("change", val.id)
},
onPreview(item) {
uni.previewImage({
urls: item.images,
current: 0
})
},
onNavToMap(val) {
uni.openLocation({
latitude: Number(val.latitude),
longitude: Number(val.longitude),
scale: 18,
name: val.address,
address: val.address,
success: (res) => {
console.log(res)
},
complete: (res) => {
console.log(res, 909090)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.store-list-content{
width: 100%;
height: 100%;
}
.scroll-view {
position: relative;
width: 100%;
height: 100%;
}
.store-list {
position: absolute;
top: 0;
left: 2%;
display: flex;
flex-direction: column;
width: 96%;
>.flex-col {
display: flex;
flex-direction: column;
width: 100%;
background: #ffffff;
box-shadow: 0 4upx 8upx rgba(0, 0, 0, 0.1);
border-radius: 12upx;
overflow: hidden;
padding: 12upx;
margin: 12upx 0;
.room-img-box {
display: flex;
width: 200upx;
height: 240upx;
border-radius: 12upx;
overflow: hidden;
margin: 0 20upx 0 0;
image {
height: 100%;
}
}
.part-right {
display: flex;
flex-direction: column;
width: 100%;
padding: 0 10upx 0 0;
.part-title {
display: flex;
flex: 1;
align-items: center;
width: 100%;
.margin-right {
margin-right: 6upx;
margin-top: 4upx;
}
.location {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.cu-btn {
padding: 12upx 20upx;
height: auto;
}
}
}
.part-tag-box {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 10upx 12upx;
.part-tag {
display: flex;
flex-wrap: wrap;
width: 96%;
.cu-tag {
margin: 4upx 1%;
}
}
}
}
.part-bottom-box {
display: flex;
width: 100%;
justify-content: space-between;
height: 100upx;
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
margin-left: 20upx;
font-size: 32upx;
}
.nav-use {
display: flex;
align-items: flex-end;
}
}
}
}
.nav-icon {
display: flex;
justify-content: center;
align-items: center;
width: 80upx;
image {
display: block;
width: 100%;
height: auto;
}
}
</style>
\ No newline at end of file
<template> <template>
<view class="tool-box" > <view class="tool-box" >
<view v-for="(item, index) in toolList" :key="index" class="tool-item" :class="{active:!show}" :style="{transitionDuration: dNum+'s' }" @tap.stop="onHandle(item,index)"> <view v-for="(item, index) in toolList" :key="index" class="tool-item" :class="{active:!show}" :style="{transitionDuration: dNum+'s' }" @tap.stop="onHandle(item)">
<!-- <text class="text-white text-bold text-xl">{{item.name}}</text> --> <!-- <text class="text-white text-bold text-xl">{{item.name}}</text> -->
<image v-if="show" class="image" :src="item.url" mode="scaleToFill"></image> <image v-if="show" class="image" :src="item.url" mode="scaleToFill"></image>
...@@ -26,29 +26,34 @@ ...@@ -26,29 +26,34 @@
dNum:0.4, dNum:0.4,
toolList:[ toolList:[
{ {
name:"验券",
url:config.assetsPath+'/tool_3.png',
imgUrl: config.assetsPath+'/scan_code_icon.png',
sortName:"验",
routePath:"/pages/couponCheck/couponCheck",
value:1
},
{
name:"开门", name:"开门",
url:config.assetsPath+'/tool_1.png', url:config.assetsPath+'/tool_1.png',
imgUrl: config.assetsPath+'/open_door_icon.png', imgUrl: config.assetsPath+'/open_door_icon.png',
sortName:"开" sortName:"开",
value:2
}, },
{ {
name:"续单", name:"续单",
url:config.assetsPath+'/tool_2.png', url:config.assetsPath+'/tool_2.png',
imgUrl: config.assetsPath+'/order_2_icon.png', imgUrl: config.assetsPath+'/order_2_icon.png',
sortName:"续" sortName:"续",
}, value:3
{
name:"验券",
url:config.assetsPath+'/tool_3.png',
imgUrl: config.assetsPath+'/scan_code_icon.png',
sortName:"验",
routePath:"/pages/couponCheck/couponCheck"
}, },
{ {
name:"客服", name:"咨询",
url:config.assetsPath+'/tool_4.png', url:config.assetsPath+'/tool_4.png',
imgUrl: config.assetsPath+'/zcpt.png', imgUrl: config.assetsPath+'/zcpt.png',
sortName:"客" sortName:"客",
value:4
} }
], ],
timer:null, timer:null,
...@@ -86,13 +91,13 @@ ...@@ -86,13 +91,13 @@
}) })
} }
}, },
onHandle(val,index){ onHandle(val){
if(index===3){ if(val.value===4){
this.onGetSysConfig() this.onGetSysConfig()
return return
}; };
if([0,1].includes(index)){ if([2,3].includes(val.value)){
this.onGetOrderByAvailable(index) this.onGetOrderByAvailable(val.value)
return return
} }
if(val.routePath){ if(val.routePath){
...@@ -106,7 +111,7 @@ ...@@ -106,7 +111,7 @@
if(res.data.code === 200){ if(res.data.code === 200){
if(res.data.data&&res.data.data.length===1){ if(res.data.data&&res.data.data.length===1){
this.orderInfo = res.data.data[0]; this.orderInfo = res.data.data[0];
if(i === 1){ if(i === 3){
if(this.orderInfo.status ==1){ if(this.orderInfo.status ==1){
// 去续单 // 去续单
uni.navigateTo({ uni.navigateTo({
...@@ -118,8 +123,6 @@ ...@@ -118,8 +123,6 @@
title:"无使用中的订单,无法续单哦!" title:"无使用中的订单,无法续单哦!"
}) })
} }
}else{ }else{
// 去开门 // 去开门
this.onOpenDoor() this.onOpenDoor()
...@@ -131,7 +134,7 @@ ...@@ -131,7 +134,7 @@
if(list.length ===1){ if(list.length ===1){
this.orderInfo = list[0]; this.orderInfo = list[0];
if(i === 1){ if(i === 3){
// 去续单 // 去续单
uni.navigateTo({ uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}` url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
...@@ -187,8 +190,8 @@ ...@@ -187,8 +190,8 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 50px; width: 60px;
height: 44px; height: 54px;
border-radius: 20upx 0 0 20upx; border-radius: 20upx 0 0 20upx;
background: rgba(255, 255, 255, 0.72); background: rgba(255, 255, 255, 0.72);
// border-top: 1px solid #E40583; // border-top: 1px solid #E40583;
...@@ -210,8 +213,8 @@ ...@@ -210,8 +213,8 @@
} }
} }
.active{ .active{
width: 30px; width: 36px;
height:26px; height:32px;
border-radius: 12upx 0 0 12upx; border-radius: 12upx 0 0 12upx;
opacity: 0.9; opacity: 0.9;
} }
......
...@@ -2,8 +2,8 @@ const CONFIG = { ...@@ -2,8 +2,8 @@ const CONFIG = {
// 开发环境配置 // 开发环境配置
development: { development: {
// assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径 // assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径 // assetsPath: 'https://coujiao.pseer.com/wechat_static', // 静态资源路径
// assetsPath: 'http://localhost:8211/static', // 静态资源路径 assetsPath: 'http://localhost:8211/static', // 静态资源路径
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址 // baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址 baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
// baseUrl: 'http://10.24.3.185:8883/front-api', // baseUrl: 'http://10.24.3.185:8883/front-api',
......
...@@ -31,6 +31,29 @@ ...@@ -31,6 +31,29 @@
<text>3.核销验券之后的券会进入到我的优惠券当中,可去门店预约时自动抵扣使用,若显示无法使用团购券,请核验团购券的可用门店、可用时间段。团购券过期后自动作废,不退款不更换不延期,请尽快使用。</text> <text>3.核销验券之后的券会进入到我的优惠券当中,可去门店预约时自动抵扣使用,若显示无法使用团购券,请核验团购券的可用门店、可用时间段。团购券过期后自动作废,不退款不更换不延期,请尽快使用。</text>
</view> </view>
</view> </view>
<uni-popup ref="popupStoreList" type="center">
<view class="flex-col pop-store-list">
<!-- <image style="width: 699upx;" :src="assetsPath +'/pop_bg.png'" mode="widthFix"></image> -->
<view class="flex-col absolute">
<view class="content-box">
<view class="title margin-left-lg">
<text style="color: #512C19;" class="text-xl text-bold">温馨提示</text>
</view>
<view class="close-box text-xxl margin-right" @tap="onStoreClose(true)">
<text class="cuIcon-roundclosefill" style="color: #bf9e62;"></text>
</view>
</view>
<view class="tip-text">
<text class="text-title" style="color: #512C19;">当前优惠券适用以下门店,请选择即将预定的门店:</text>
</view>
<!-- 展示所有房间列表 -->
<view class="store-box">
<StoreList style="width: 100%;" v-model="popStoreList" @change="onStoreChage"></StoreList>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="popup" type="center"> <uni-popup ref="popup" type="center">
<view class="content-box"> <view class="content-box">
<view class="content"> <view class="content">
...@@ -62,12 +85,17 @@ ...@@ -62,12 +85,17 @@
<script> <script>
import config from "@/config/index.config" import config from "@/config/index.config"
import {couponChecked} from "@/api/coupon.js"; import {couponChecked,getStoreListByCouponCode,getCouponByCode} from "@/api/coupon.js";
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
import StoreList from "@/components/storeList/couponStoreList"
export default { export default {
components: {
StoreList
},
data() { data() {
return { return {
hostUrl: config.hostUrl,
assetsPath:config.assetsPath, assetsPath:config.assetsPath,
code:"", code:"",
openShopUuid:'', openShopUuid:'',
...@@ -81,9 +109,12 @@ ...@@ -81,9 +109,12 @@
name:"抖音" name:"抖音"
} }
], ],
storeId:'',
couponInfo:'', couponInfo:'',
eventChannel:null, eventChannel:null,
orderPage:false orderPage:false,
popStoreList:[],
qrCode:''
}; };
}, },
filters:{ filters:{
...@@ -97,8 +128,10 @@ ...@@ -97,8 +128,10 @@
console.log(data,99999) console.log(data,99999)
if(data.orderPage){ if(data.orderPage){
this.orderPage = true this.orderPage = true
this.storeId = data.storeId
}else{ }else{
this.orderPage = false this.orderPage = false
this.storeId = ''
} }
}) })
}, },
...@@ -112,21 +145,70 @@ ...@@ -112,21 +145,70 @@
}) })
return return
} }
this.qrCode = this.code.split(" ").join("")
if(/http/g.test(this.qrCode)){
this.code = ""
}
uni.showLoading({ uni.showLoading({
title:"券码核验中" title:'加载中...'
}) })
getStoreListByCouponCode({
code: this.qrCode,
longitude:uni.getStorageSync("longitude"),
latitude:uni.getStorageSync("latitude")
}).then(res=>{
uni.hideLoading();
console.log(res,9999)
if(res.data.code ==200 && res.data.data.length){
this.popStoreList = res.data.data.map(item => {
return {
...item,
images: item.images ? item.images.split(",").map(val => this.hostUrl +
val) : []
}
});
if(this.orderPage){
this.onExchangeCoupon(this.qrCode,this.storeId)
}else{
this.$refs.popupStoreList.open();
}
let qrCode = this.code.split(" ").join("") }else{
if(/http/g.test(qrCode)){ uni.showToast({
this.code = "" icon:"none",
title:res.data.msg
})
} }
})
},
onStoreChage(val){
console.log(val,90909)
let info = this.popStoreList.find(item=>item.id === val)
if(info.status ==1){
this.$refs.popupStoreList.close();
this.storeId = val;
this.onExchangeCoupon(this.qrCode,this.storeId)
} else{
uni.showToast({
icon:"none",
title:"门店维护中,请选择其他门店"
})
}
},
onExchangeCoupon(code,storeId){
let that = this;
uni.showLoading({
title:"券码核验中"
})
couponChecked({ couponChecked({
code: qrCode, code,
storeId:uni.getStorageSync('storeId') storeId
}).then(res=>{ }).then(res=>{
uni.hideLoading() uni.hideLoading()
if(res.data.code === 200){ if(res.data.code === 200){
this.couponInfo = res.data.data
uni.showToast({ uni.showToast({
icon:"success", icon:"success",
title:"核验成功", title:"核验成功",
...@@ -134,13 +216,18 @@ ...@@ -134,13 +216,18 @@
setTimeout(()=>{ setTimeout(()=>{
if(that.orderPage){ if(that.orderPage){
that.eventChannel.emit('acceptData', {data: true}); that.eventChannel.emit('acceptData', {data: true});
}
uni.navigateBack() uni.navigateBack()
}else{
getCouponByCode({
code: that.qrCode
}).then(result =>{
that.couponInfo = res.data.data;
that.$refs.popup.open();
})
}
},1000) },1000)
} }
}) })
// this.$refs.popup.open()
}else{ }else{
uni.showToast({ uni.showToast({
icon:"none", icon:"none",
...@@ -162,6 +249,7 @@ ...@@ -162,6 +249,7 @@
}) })
}, },
onNavHome(){ onNavHome(){
uni.setStorageSync("storeId",this.storeId)
uni.switchTab({ uni.switchTab({
url:"/pages/index/index" url:"/pages/index/index"
}) })
...@@ -303,4 +391,41 @@ ...@@ -303,4 +391,41 @@
} }
} }
} }
.pop-store-list {
position: relative;
display: flex;
flex-direction: column;
width: 92vw;
height: 78vh;
background-color: #ffffff;
border-radius: 20upx;
box-shadow: 0 6upx 16upx rgba(255, 0, 255, 0.34);
padding-bottom: 20upx;
overflow: hidden;
.content-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
height: 9%;
width: 100%;
padding-top: 1%;
.close-box {}
}
.tip-text {
width: 90%;
margin: 0 auto 10px;
}
.store-box {
display: flex;
flex: 1;
width: 100%;
overflow-y: auto;
padding: 0 2% 3%;
}
}
</style> </style>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<image :src="assetsPath +'/banner2.png'" mode="widthFix"></image> <image :src="assetsPath +'/banner2.png'" mode="widthFix"></image>
</view> </view>
<view class="flex-col list-box"> <view class="flex-col list-box">
<!-- <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 roomVoList" :key="index" class="list-item-box" <view v-for="(item,index) in roomVoList" :key="index" class="list-item-box"
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
<view class="price"> <view class="price">
<!-- <text v-if="item.recordsTime" class="text-sm text-orange text-bold">{{item.recordsTime}} 结束</text> --> <!-- <text v-if="item.recordsTime" class="text-sm text-orange text-bold">{{item.recordsTime}} 结束</text> -->
<!-- <view class=""> <!-- <view class="">
<view class='cu-tag radius line-orange' v-if="item.roomStat >= 3"> <view class='cu-tag radius line-orange' v-if="item.roomStat >= 3">
维护 维护
</view> </view>
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
</view> </view>
</view> </view>
<!-- <view class="flex-between confirm-box"> <!-- <view class="flex-between confirm-box">
<view class="flex-priceBox"></view> <view class="flex-priceBox"></view>
<view class="confirm"> <view class="confirm">
<button class="cu-btn">预定</button> <button class="cu-btn">预定</button>
...@@ -174,22 +174,26 @@ ...@@ -174,22 +174,26 @@
<uni-popup ref="popupStoreList" type="center"> <uni-popup ref="popupStoreList" type="center">
<view class="flex-col pop-store-list"> <view class="flex-col pop-store-list">
<view class="flex-col content-box"> <!-- <image style="width: 699upx;" :src="assetsPath +'/pop_bg.png'" mode="widthFix"></image> -->
<view class="title"> <view class="flex-col absolute">
<text class="text-black text-xl text-bold">温馨提示</text> <view class="content-box">
<view class="title margin-left-lg">
<text style="color: #512C19;" class="text-xl text-bold">温馨提示</text>
</view> </view>
<view class="close-box text-xxl" @tap="onStoreClose(true)"> <view class="close-box text-xxl margin-right" @tap="onStoreClose(true)">
<text class="cuIcon-roundclosefill text-pink"></text> <text class="cuIcon-roundclosefill" style="color: #bf9e62;"></text>
</view> </view>
</view> </view>
<view class="tip-text"> <view class="tip-text">
<text class="text-title text-lg">本店当前时段所有包厢已被预定,您可以预约本店的其他时段,或者预定凑角附近的其它门店。</text> <text class="text-title" style="color: #512C19;">本店当前时段所有包厢已被占用,您可以预约本店的其它时段,或者预订凑角附近的其它门店。</text>
</view> </view>
<!-- 展示所有房间列表 --> <!-- 展示所有房间列表 -->
<view class="store-box"> <view class="store-box">
<StoreList style="width: 100%;" v-model="popStoreList" @change="onStoreChage"></StoreList> <StoreList style="width: 100%;" v-model="popStoreList" @change="onStoreChage"></StoreList>
</view> </view>
</view> </view>
</view>
</uni-popup> </uni-popup>
...@@ -289,20 +293,20 @@ ...@@ -289,20 +293,20 @@
list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23], list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23],
objListDate: [], objListDate: [],
timer2: null, timer2: null,
timerLocation:null timerLocation: null
} }
}, },
onShow() { onShow() {
this.onGetSysConfig(); this.onGetSysConfig();
this.onGetListStore(); this.onGetListStore();
this.timerLocation = setInterval(()=>{ this.timerLocation = setInterval(() => {
uni.removeStorageSync("storeId") uni.removeStorageSync("storeId")
this.onLoading(); this.onLoading();
},2*60*1000) }, 2 * 60 * 1000)
}, },
onHide() { onHide() {
if(this.timerLocation){ if (this.timerLocation) {
clearInterval(this.timerLocation) clearInterval(this.timerLocation)
this.timerLocation = null; this.timerLocation = null;
} }
...@@ -325,12 +329,12 @@ ...@@ -325,12 +329,12 @@
this.$refs.loginPop.open(); this.$refs.loginPop.open();
}, },
methods: { methods: {
onStoreChage(id){ onStoreChage(id) {
uni.setStorageSync("storeId", id); uni.setStorageSync("storeId", id);
this.onStoreClose(false); this.onStoreClose(false);
setTimeout(()=>{ setTimeout(() => {
this.onGetListStore(); this.onGetListStore();
},200) }, 200)
}, },
onSetShowPoint() { onSetShowPoint() {
let h = new Date().getHours(); let h = new Date().getHours();
...@@ -392,7 +396,7 @@ ...@@ -392,7 +396,7 @@
setTimeout(() => { setTimeout(() => {
uni.removeStorageSync('storeId'); uni.removeStorageSync('storeId');
let aaa = uni.getStorageSync('storeId')? true:false; let aaa = uni.getStorageSync('storeId') ? true : false;
console.log(aaa, "是否删除数据") console.log(aaa, "是否删除数据")
this.onGetListStore() this.onGetListStore()
}, 10) }, 10)
...@@ -447,21 +451,22 @@ ...@@ -447,21 +451,22 @@
let list = res.data.data.map(item => { let list = res.data.data.map(item => {
let sortNum = 1; let sortNum = 1;
if(item.roomStat ===3){ if (item.roomStat === 3) {
sortNum = 5 sortNum = 5
} else if(item.recordsStatus === 0){ } else if (item.recordsStatus === 0) {
sortNum = 4 sortNum = 4
} else if(item.recordsStatus === 1){ } else if (item.recordsStatus === 1) {
sortNum = 3 sortNum = 3
} else if(item.status ===1){ } else if (item.status === 1) {
sortNum = 2 sortNum = 2
}else if(item.status ===0){ } else if (item.status === 0) {
sortNum = 1 sortNum = 1
} }
return { return {
...item, ...item,
sortNum, sortNum,
recordsTime: item.recordsTime? moment(item.recordsTime).format("HH:mm") : "", recordsTime: item.recordsTime ? moment(item.recordsTime).format("HH:mm") :
"",
facilities: item.facilities ? item.facilities.split(",") : [], facilities: item.facilities ? item.facilities.split(",") : [],
images: item.images ? item.images.split(",").map(val => this.hostUrl + images: item.images ? item.images.split(",").map(val => this.hostUrl +
val) : [], val) : [],
...@@ -475,12 +480,12 @@ ...@@ -475,12 +480,12 @@
} }
}) })
list.sort((a,b)=>a.sortNum-b.sortNum); list.sort((a, b) => a.sortNum - b.sortNum);
that.roomVoList = list; that.roomVoList = list;
let l = that.roomVoList.filter(item=>item.sortNum === 1) let l = that.roomVoList.filter(item => item.sortNum === 1)
if(l.length<=0){ if (l.length <= 0) {
if(!uni.getStorageSync("storePopShow")){ if (!uni.getStorageSync("storePopShow")) {
that.$refs.popupStoreList.open(); that.$refs.popupStoreList.open();
} }
} }
...@@ -604,8 +609,8 @@ ...@@ -604,8 +609,8 @@
this.$refs.popup.close() this.$refs.popup.close()
}, },
onStoreClose(storePopShow = true){ onStoreClose(storePopShow = true) {
uni.setStorageSync("storePopShow",storePopShow) uni.setStorageSync("storePopShow", storePopShow)
this.$refs.popupStoreList.close() this.$refs.popupStoreList.close()
}, },
onNavToSet() { onNavToSet() {
...@@ -672,6 +677,7 @@ ...@@ -672,6 +677,7 @@
min-height: 280upx; min-height: 280upx;
backdrop-filter: blur(5px); backdrop-filter: blur(5px);
background-color: #E40583; background-color: #E40583;
image { image {
display: block; display: block;
width: 100%; width: 100%;
...@@ -862,7 +868,7 @@ ...@@ -862,7 +868,7 @@
width: 100%; width: 100%;
// min-height: 314upx; // min-height: 314upx;
// background-color: #FBF6EE; // background-color: #FBF6EE;
background: linear-gradient(to bottom, rgba(229,38,139,0.08),#ffffff); background: linear-gradient(to bottom, rgba(229, 38, 139, 0.08), #ffffff);
border-radius: 14upx; border-radius: 14upx;
overflow: hidden; overflow: hidden;
margin: 0 0 20upx 0; margin: 0 0 20upx 0;
...@@ -1044,7 +1050,8 @@ ...@@ -1044,7 +1050,8 @@
.room-img { .room-img {
height: 100%; height: 100%;
} }
.absolute{
.absolute {
position: absolute; position: absolute;
top: auto; top: auto;
left: 0; left: 0;
...@@ -1054,24 +1061,29 @@ ...@@ -1054,24 +1061,29 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 60upx; height: 60upx;
.status-bg{
.status-bg {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.bg-gray{
.bg-gray {
background: rgba(136, 136, 136, 0.96); background: rgba(136, 136, 136, 0.96);
color: #ffffff; color: #ffffff;
} }
.bg-pink{
.bg-pink {
background: rgba(230, 58, 159, 0.8); background: rgba(230, 58, 159, 0.8);
} }
.bg-green{
background: rgba(57,181,74, 0.8); .bg-green {
background: rgba(57, 181, 74, 0.8);
} }
.bg-red{
.bg-red {
background: rgba(229, 77, 66, 0.8); background: rgba(229, 77, 66, 0.8);
} }
} }
...@@ -1108,19 +1120,21 @@ ...@@ -1108,19 +1120,21 @@
align-items: center; align-items: center;
min-height: 88upx; min-height: 88upx;
margin-top: 10upx; margin-top: 10upx;
.bg-brown { .bg-brown {
color: rgba(185,75,112, 0.9); color: rgba(185, 75, 112, 0.9);
background-color: transparent; background-color: transparent;
border: 1upx solid rgba(185,75,112, 0.9); border: 1upx solid rgba(185, 75, 112, 0.9);
margin: 4upx; margin: 4upx;
padding: 0 8upx; padding: 0 8upx;
height: 36upx; height: 36upx;
} }
} }
.records-time{ .records-time {
margin-top: 10upx; margin-top: 10upx;
} }
// 价格 // 价格
.flex-priceBox { .flex-priceBox {
padding: 0 6rpx; padding: 0 6rpx;
...@@ -1190,6 +1204,7 @@ ...@@ -1190,6 +1204,7 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.item { .item {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -1280,11 +1295,12 @@ ...@@ -1280,11 +1295,12 @@
// background-color: #fad2bb; // background-color: #fad2bb;
} }
.bg-gray{ .bg-gray {
// background-color: rgba(229, 229, 229, 0.9); // background-color: rgba(229, 229, 229, 0.9);
background-color: transparent; background-color: transparent;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
} }
.flex-col { .flex-col {
align-items: center; align-items: center;
} }
...@@ -1300,38 +1316,40 @@ ...@@ -1300,38 +1316,40 @@
font-size: 20upx; font-size: 20upx;
} }
} }
.pop-store-list{
.pop-store-list {
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 90vw; width: 92vw;
height: 68vh; height: 74vh;
background-color: #ffffff; background-color: #ffffff;
border-radius: 20upx; border-radius: 20upx;
box-shadow: 0 6upx 16upx rgba(255, 0, 255, 0.34); box-shadow: 0 6upx 16upx rgba(255, 0, 255, 0.34);
padding-bottom: 20upx; padding-bottom: 20upx;
overflow: hidden; overflow: hidden;
.content-box{
position: relative; .content-box {
display: flex; display: flex;
justify-content: center; justify-content: space-between;
align-items: center; align-items: center;
height: 10%; height: 9%;
.close-box{ padding-top: 1%;
position: absolute;
top: 30upx; .close-box {}
right: 30upx;
}
} }
.tip-text{
.tip-text {
width: 90%; width: 90%;
margin: 0 auto 10px; margin: 0 auto 10px;
} }
.store-box{
.store-box {
display: flex; display: flex;
flex: 1; flex: 1;
width: 100%; width: 100%;
overflow-y: auto; overflow-y: auto;
padding: 0 2%; padding: 0 2% 3%;
} }
} }
</style> </style>
\ No newline at end of file
...@@ -665,6 +665,8 @@ ...@@ -665,6 +665,8 @@
this.duration = Number(this.distanceMode[this.distanceIndex].duration); this.duration = Number(this.distanceMode[this.distanceIndex].duration);
} }
let startDateTime = moment().format("YYYY-MM-DD HH:mm:ss")
this.onTransiteForDate(res.data.data,startDateTime,this.duration)
this.dateIntervalList = res.data.data.map((item, index) => { this.dateIntervalList = res.data.data.map((item, index) => {
return { return {
...item, ...item,
...@@ -1374,7 +1376,10 @@ ...@@ -1374,7 +1376,10 @@
uni.navigateTo({ uni.navigateTo({
url: "/pages/couponCheck/couponCheck?openShopUuid=" + this.roomInfo.openShopUuid, url: "/pages/couponCheck/couponCheck?openShopUuid=" + this.roomInfo.openShopUuid,
success: (res) => { success: (res) => {
res.eventChannel.emit('acceptDataFromOpenerPage', { orderPage:true }) res.eventChannel.emit('acceptDataFromOpenerPage', {
orderPage:true ,
storeId: that.roomInfo.storeId
})
}, },
events: { events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
...@@ -1485,8 +1490,58 @@ ...@@ -1485,8 +1490,58 @@
} }
return obj; return obj;
}, },
onCheckDate() {
//list(Array):当前日期的时间占用情况
//startDateTime(YYYY-MM-DD HH:mm:ss): 开始时间
//duration(Number||String): 时长,小时或分钟
//durationType(Number) : 时长类型,1:小时,2:分钟
// 返回值
// list,当前日期的时间占用情况,已被预定、已选择、可预定
//startDateTime(YYYY-MM-DD HH:mm:ss): 开始详细时间
//endDateTime(YYYY-MM-DD HH:mm:ss): 结束详细时间
//startTime(HH:mm): 开始时间,显示使用
//endTime(HH:mm): 结束时间,显示使用
//duration(Number): 时长,仅分钟
onTransiteForDate(list=[],startDateTime,duration,durationType=1){
console.log(list,"数据列表")
// 计算出时长,使用分钟计算
let m = duration
if(durationType==1){
m = duration*60
}
// 开始时间的毫秒数
let startStamp = moment(startDateTime).valueOf();
let endStamp = startStamp+ m*60*1000;
console.log(startStamp,endStamp)
console.log(endStamp-startStamp)
// 记录可开始的时间点
let startPoint = '';
let endPoint = ''
list.forEach((item,index)=>{
console.log(item)
// 如果开始时间有,则需要计算可预定的时长
if(startPoint){
if(item.status ===0){
endPoint = moment(item.timeHour).format("YYYY-MM-DD HH:59:59")
}else{
endPoint = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:ss")
}
}else{
// 如果开始时间没有,则需要赋值开始时间
if(item.status ===0){
startPoint = moment(item.timeHour).format("YYYY-MM-DD HH:mm:ss")
}else{
// 当前小时时间是被占用状态且低于59分钟
let mm = moment(item.endHoldTime).format("mm")
if(mm<59){
startPoint = moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:ss")
}
}
}
})
},
onCheckDate() {
// 今天可连续选择的时段 // 今天可连续选择的时段
let selectNum = 0; let selectNum = 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