Commit 718b8cb1 by zhangzhen

细节优化

parent fa7436f0
...@@ -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: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径 assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
assetsPath: 'http://10.24.5.63:8211/static', // 静态资源路径 // assetsPath: 'http://10.24.5.63: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', // 后台接口请求地址
hostUrl: 'http://coujiao.pseer.com:8888/prod-api', // H5地址(前端运行地址) hostUrl: 'http://coujiao.pseer.com:8888/prod-api', // H5地址(前端运行地址)
...@@ -15,12 +15,12 @@ const CONFIG = { ...@@ -15,12 +15,12 @@ const CONFIG = {
}, },
// 生产环境配置 // 生产环境配置
production: { production: {
// assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径 assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径 // assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
// baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址 baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址 // baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
// hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址) hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址) // hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid weixinAppId: '', // 微信公众号appid
codeHeadUrl:"", codeHeadUrl:"",
......
...@@ -63,7 +63,8 @@ ...@@ -63,7 +63,8 @@
:class="{active:dateIndex === k}" @tap="onDateChange(k)"> :class="{active:dateIndex === k}" @tap="onDateChange(k)">
<view class="relative"> <view class="relative">
<text class="text-title text-bold text-first ">{{ k === 0 && item.readDate === toDayDate? '今天' : item.weekday}}</text> <text
class="text-title text-bold text-first ">{{ k === 0 && item.readDate === toDayDate? '今天' : item.weekday}}</text>
<view v-if="dateIndex !== k && activityDate[item.readDate]" class="absolute-right"> <view v-if="dateIndex !== k && activityDate[item.readDate]" class="absolute-right">
<image :src="assetsPath+'/xx2.png'" mode="widthFix"></image> <image :src="assetsPath+'/xx2.png'" mode="widthFix"></image>
</view> </view>
...@@ -91,11 +92,15 @@ ...@@ -91,11 +92,15 @@
<view class="item" :class="allDayUseStatus? 'gray': modeIndex===index?'active':''"> <view class="item" :class="allDayUseStatus? 'gray': modeIndex===index?'active':''">
<text>{{item.labelName}}</text> <text>{{item.labelName}}</text>
</view> </view>
<view v-if="item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))" class="pre-icon"> <view
<image :src=" v-if="item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))"
class="pre-icon">
<image
:src="
(item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId) && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) || (item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId) && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) ||
(item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) || (item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.packId)) ||
(!item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId)) ? assetsPath+'/pre_icon_2.png': assetsPath+'/pre_icon.png'" mode="widthFix"></image> (!item.packId && activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId)) ? assetsPath+'/pre_icon_2.png': assetsPath+'/pre_icon.png'"
mode="widthFix"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -106,7 +111,9 @@ ...@@ -106,7 +111,9 @@
<text>{{item.name}}</text> <text>{{item.name}}</text>
</view> </view>
<view class="pre-icon"> <view class="pre-icon">
<image :src=" activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.id)? assetsPath+'/pre_icon_2.png' : assetsPath+'/pre_icon.png'" mode="widthFix"></image> <image
:src=" activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].packIds.includes(item.id)? assetsPath+'/pre_icon_2.png' : assetsPath+'/pre_icon.png'"
mode="widthFix"></image>
</view> </view>
</view> </view>
</view> </view>
...@@ -213,63 +220,96 @@ ...@@ -213,63 +220,96 @@
<text>/小时</text> <text>/小时</text>
</view> </view>
</view> </view>
<view v-if="computePriceInfo.totalFeeNow" class="flex-between price">
<view v-if="userInfo && (secondaryCardList.length || monthlyCardList.length)" class="flex-col card-use"> <text class="text-black text-left">应付金额</text>
<view class="flex-between" @tap="onShowMorePayWay"> <view class="flex-row">
<text class="text-black text-left">钱包支付</text> <!-- <text class="text-pink text-sm text-bold" style="margin-bottom: 3upx;">{{computePriceInfo.couponFee>0?'-':''}}</text> -->
<view class="flex-row-center"> <text class="text-pink"></text>
<text class="cuIcon-right" :class="showMorePayWay? 'show-more-pay-way':''"></text> <text class="text-pink text-lg text-bold">{{computePriceInfo.totalFeeNow||0}}</text>
</view>
</view>
<view v-if="computePriceInfo.remainingBalance" class="flex-between price">
<text class="text-black text-left">支付策略</text>
<view class="flex-row">
<text class="text-pink">优先使用钱包余额</text>
</view> </view>
</view> </view>
<view class="radio-group-box" :class="showMorePayWay? 'radio-group-box-height':''">
<radio-group class="radio-group">
<!-- <label v-if="Number(computePriceInfo.availableBalance)" class="flex-between" @tap="onRadioChange('availableBalance')"> <view v-if="computePriceInfo.discount > 0 && computePriceInfo.discount < 100" class="flex-between price">
<view class="flex-1 flex-between">
<view class="flex-row-center"> <view class="flex-row-center">
<text>余额: <text class="text-pink text-bold">{{computePriceInfo.availableBalance}}</text> 可用</text> <text class="text-black text-left">会员折扣</text>
<view class="vip-tag-box">
<image :src="assetsPath+'/huiyuan.png'" mode="widthFix"></image>
<text>会员日{{computePriceInfo.discountText || computePriceInfo.discount}}</text>
</view> </view>
<view class="flex-row-center margin-right-sm">
<text>{{userInfo.memberConfig.levelName}}: <text class="text-pink text-bold">{{userInfo.memberConfig.discountRatio}}</text></text>
</view> </view>
<view class="flex-row-center">
<text class="text-pink text-xl text-bold" style="margin-right: 6upx;">-</text>
<text class="text-pink text-bold"></text>
<text class="text-pink text-lg text-bold">{{(computePriceInfo.memberDiscount).toFixed(2)}}</text>
</view> </view>
<view class="flex-row-center" >
<radio class='pink radio' :class="radioChecked=='availableBalance'?'checked':''" value="availableBalance" :checked="radioChecked == 'availableBalance'?true:false" style="transform:scale(0.7)" />
</view> </view>
</label > -->
<view class="flex-col card-use">
<view class="flex-between" @tap="onShowMorePayWay">
<text class="text-black text-left">钱包支付</text>
<view class="flex-row-center">
<text class="cuIcon-right" :class="showMorePayWay? 'show-more-pay-way':''"></text>
</view>
</view>
<view class="radio-group-box" :class="showMorePayWay? 'radio-group-box-height':''">
<radio-group class="radio-group">
<label v-if="monthlyCardList.length" class="flex-between" @tap="onRadioChange('monthlyCard')"> <label v-if="monthlyCardList.length" class="flex-between" @tap="onRadioChange('monthlyCard')">
<view class="flex-row-center"> <view class="flex-row-center">
<text>{{monthlyCardList[0].confName}}:</text> <text>{{monthlyCardList[0].confName}}:</text>
<text class="text-pink text-bold">{{monthlyCardList[0].freeDuration}}</text> <text class="text-pink text-bold">{{monthlyCardList[0].freeDuration}}</text>
<text>小时可用</text> <text>小时可用</text>
</view> </view>
<view class="flex-row-center" > <view class="flex-row-center">
<!-- <text>请选择</text> --> <radio class='pink radio' :class="radioChecked=='monthlyCard'?'checked':''"
<radio class='pink radio' :class="radioChecked=='monthlyCard'?'checked':''" value="monthlyCard" :checked="radioChecked == 'monthlyCard'?true:false" style="transform:scale(0.7)" /> value="monthlyCard" :checked="radioChecked == 'monthlyCard'?true:false"
style="transform:scale(0.7)" />
</view> </view>
</label > </label>
<label v-if="secondaryCardList.length" class="flex-between" @tap="onRadioChange('secondaryCard')"> <label v-if="secondaryCardList.length" class="flex-between" @tap="onRadioChange('secondaryCard')">
<view class="flex-row-center"> <view class="flex-row-center">
<text>{{secondaryCard.name}}:剩 <text class="text-pink text-bold">{{secondaryCard.number}}</text> 次可用</text> <text>{{secondaryCard.name}}:剩 <text
class="text-pink text-bold">{{secondaryCard.number}}</text> 次可用</text>
</view> </view>
<view class="flex-row-center" > <view class="flex-row-center">
<!-- <text>请选择</text> --> <radio class='pink radio' :class="radioChecked=='secondaryCard'?'checked':''"
<radio class='pink radio' :class="radioChecked=='secondaryCard'?'checked':''" value="secondaryCard" :checked="radioChecked=='secondaryCard'?true:false" style="transform:scale(0.7)" /> value="secondaryCard" :checked="radioChecked=='secondaryCard'?true:false"
style="transform:scale(0.7)" />
</view> </view>
</label > </label>
<!-- <label v-if="computePriceInfo && computePriceInfo.availableDuration" class="flex-between" @tap="onRadioChange('availableDuration')"> <label class="flex-between" >
<view class="flex-1 flex-between"> <view class="flex-1 flex-between">
<view class="flex-row-center"> <view class="flex-row-center">
<text>时长: <text class="text-pink text-bold">{{Number(computePriceInfo.availableDuration).toFixed(1)}}</text>小时可用</text> <text>可用余额: </text>
<text class="text-pink text-bold">{{computePriceInfo.availableBalance}}</text>
</view>
<view class="flex-row-center margin-right-sm">
<!-- <text>{{userInfo.memberConfig.levelName}}: <textclass="text-pink text-bold">{{userInfo.memberConfig.discountRatio}}</text></text> -->
</view> </view>
</view> </view>
<view class="flex-row-center" > <view class="flex-row-center">
<radio class='pink radio' :class="radioChecked=='availableDuration'?'checked':''" value="availableDuration" :checked="radioChecked == 'availableDuration'?true:false" style="transform:scale(0.7)" /> <text v-if="computePriceInfo.availableBalance" class="text-pink text-lg text-bold margin-right-sm">{{computePriceInfo.balance || 0}}</text>
<button v-else class="cu-btn bg-pink sm" @tap="onNavToRecharge">充值</button>
</view> </view>
</label > --> </label>
<label v-if="computePriceInfo && computePriceInfo.availableDuration" class="flex-between" >
<view class="flex-1 flex-between">
<view class="flex-row-center">
<text>可用时长: </text>
<text class="text-pink text-bold">{{Number(computePriceInfo.availableDuration).toFixed(1)}}小时</text>
</view>
</view>
<view class="flex-row-center">
<text class="text-pink text-bold margin-right-sm">{{Number(computePriceInfo.duration)? '-'+Number(computePriceInfo.duration).toFixed(1) : 0}}</text>
</view>
</label>
</radio-group> </radio-group>
</view> </view>
...@@ -277,7 +317,8 @@ ...@@ -277,7 +317,8 @@
<view class="flex-between price use-coupon-box"> <view class="flex-between price use-coupon-box">
<view class="flex-row-center"> <view class="flex-row-center">
<text class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text> <text
class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text>
<text v-if="couponExpireTip && selectCouponIndex < 0" class="text-red">(有即将过期券待使用)</text> <text v-if="couponExpireTip && selectCouponIndex < 0" class="text-red">(有即将过期券待使用)</text>
</view> </view>
...@@ -287,62 +328,36 @@ ...@@ -287,62 +328,36 @@
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text> <text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</view> </view>
</view> </view>
<view v-if="userInfo && computePriceInfo.availableDuration" class="flex-between price"> <!-- <view v-if="userInfo && computePriceInfo.availableDuration" class="flex-between price">
<text class="text-black text-left">可用时长</text> <text class="text-black text-left">可用时长</text>
<view class="flex-row"> <view class="flex-row">
<text class="text-pink text-lg text-bold">{{computePriceInfo && computePriceInfo.availableDuration? Number(computePriceInfo.availableDuration).toFixed(1) : 0}}</text> <text class="text-pink text-lg text-bold">{{computePriceInfo && computePriceInfo.availableDuration? Number(computePriceInfo.availableDuration).toFixed(1) : 0}}</text>
<text class="text-pink">小时</text> <text class="text-pink">小时</text>
</view> </view>
</view> </view> -->
<view v-if="userInfo && computePriceInfo.duration" class="flex-between price"> <!-- <view v-if="userInfo && computePriceInfo.duration" class="flex-between price">
<text class="text-black text-left">时长抵扣</text> <text class="text-black text-left">时长抵扣</text>
<view class="flex-row"> <view class="flex-row">
<text class="text-pink text-lg text-bold">{{ Number(computePriceInfo.duration).toFixed(1)}}</text> <text class="text-pink text-lg text-bold">{{ Number(computePriceInfo.duration).toFixed(1)}}</text>
<text>小时</text> <text>小时</text>
</view> </view>
</view> </view> -->
<view v-if="computePriceInfo.remainingBalance" class="flex-between price">
<text class="text-black text-left">支付策略</text> <!-- <view v-if="computePriceInfo.availableBalance" class="flex-between price">
<view class="flex-row">
<text class="text-pink">优先使用钱包余额</text>
</view>
</view>
<!-- <view v-if="computePriceInfo.availableBalance" class="flex-between price">
<text class="text-black text-left">可用余额</text> <text class="text-black text-left">可用余额</text>
<view class="flex-row"> <view class="flex-row">
<text class="text-pink"></text> <text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.availableBalance}}</text> <text class="text-pink text-lg text-bold">{{computePriceInfo.availableBalance}}</text>
</view> </view>
</view> --> </view> -->
<view v-if="computePriceInfo.balance" class="flex-between price"> <!-- <view v-if="computePriceInfo.balance" class="flex-between price">
<text class="text-black text-left">余额抵扣</text> <text class="text-black text-left">余额抵扣</text>
<view class="flex-row"> <view class="flex-row">
<text class="text-pink"></text> <text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.balance}}</text> <text class="text-pink text-lg text-bold">{{computePriceInfo.balance}}</text>
</view> </view>
</view> </view> -->
<view v-if="computePriceInfo.discount > 0 && computePriceInfo.discount < 100" class="flex-between price">
<view class="flex-row-center">
<text class="text-black text-left">会员折扣</text>
<view class="vip-tag-box">
<image :src="assetsPath+'/huiyuan.png'" mode="widthFix"></image>
<text>会员日{{computePriceInfo.discountText || computePriceInfo.discount}}</text>
</view>
</view>
<view class="flex-row-center">
<text class="text-pink text-xl text-bold" style="margin-right: 6upx;">-</text>
<text class="text-pink text-bold"></text>
<text class="text-pink text-lg text-bold">{{(computePriceInfo.memberDiscount).toFixed(2)}}</text>
</view>
</view>
<view v-if="computePriceInfo.totalFeeNow" class="flex-between price">
<text class="text-black text-left">应付金额</text>
<view class="flex-row">
<!-- <text class="text-pink text-sm text-bold" style="margin-bottom: 3upx;">{{computePriceInfo.couponFee>0?'-':''}}</text> -->
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.totalFeeNow||0}}</text>
</view>
</view>
</view> </view>
<view class="pay-content-box"> <view class="pay-content-box">
...@@ -402,7 +417,7 @@ ...@@ -402,7 +417,7 @@
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="popupActivite" type="center" isMaskClick="false"> <uni-popup ref="popupActivite" type="center" :isMaskClick="false">
<view class="flex-col"> <view class="flex-col">
<view class="activite-box"> <view class="activite-box">
<image :src="assetsPath+'/activite_1.jpg'" mode="widthFix"></image> <image :src="assetsPath+'/activite_1.jpg'" mode="widthFix"></image>
...@@ -413,6 +428,40 @@ ...@@ -413,6 +428,40 @@
</view> </view>
</uni-popup> </uni-popup>
<uni-popup ref="popupRecharge" type="center" :isMaskClick="false">
<view class="popup-recharge">
<view class="recharge-content">
<view class="close-btn" @click="onNavToCreateOrder">
<text class="cuIcon-close text-gray text-bold"> </text>
</view>
<view class="header-part">
<text class="text-title text-black margin-top text-xl">充值会员</text>
<text class="text-gray">享受每次订房最低打95折,最高打88折</text>
</view>
<view class="content-part">
<view v-for="(item,k) in rechargeConfList" :key="k" class="flex-row-center list-item">
<image class="recharge-icon" :src="assetsPath+'/recharge_icon.png'" mode="widthFix"></image>
<text class="text-title">{{item.rechargeAmount}}元送</text>
<text class="text-pink">{{item.giveAmount}}</text>
<text class="text-title">元余额={{Number(item.rechargeAmount)+Number(item.giveAmount)}}</text>
</view>
<view class="text-des-box">
<text class="text-des">充值会员后,每一次消费的积分可自动 累计,用于升级订房折扣,最高打88折</text>
</view>
<button class="cu-btn" @tap="onNavToRecharge">
立即充值
</button>
</view>
</view>
</view>
</uni-popup>
<uni-popup ref="confirmPop" type="bottom" :isMaskClick="false"> <uni-popup ref="confirmPop" type="bottom" :isMaskClick="false">
<view class="confirm-pop"> <view class="confirm-pop">
<view class="pop-content-box"> <view class="pop-content-box">
...@@ -443,7 +492,8 @@ ...@@ -443,7 +492,8 @@
<view class="info flex-row-center"> <view class="info flex-row-center">
<text class="text-black text-bold text-lg">房间:</text> <text class="text-black text-bold text-lg">房间:</text>
<text class=" margin-left text-lg ">{{roomInfo.name}}{{roomTypeEnum[roomInfo.roomType]}}</text> <text class=" margin-left text-lg ">{{roomInfo.name}}
{{roomTypeEnum[roomInfo.roomType]}}</text>
</view> </view>
...@@ -452,7 +502,8 @@ ...@@ -452,7 +502,8 @@
<text class="margin-left text-lg"></text> <text class="margin-left text-lg"></text>
<text class=" text-xl">{{Number(computePriceInfo.balance).toFixed(2)}}</text> <text class=" text-xl">{{Number(computePriceInfo.balance).toFixed(2)}}</text>
<text class="text-lg margin-left-sm"> (余额账户: ¥{{Number(userInfo.consumerWallet.balance).toFixed(2)}})</text> <text class="text-lg margin-left-sm"> (余额账户:
{{Number(userInfo.consumerWallet.balance).toFixed(2)}})</text>
</view> </view>
<view class="info flex-row-center"> <view class="info flex-row-center">
...@@ -480,11 +531,14 @@ ...@@ -480,11 +531,14 @@
<uni-popup ref="popupMessage" type="dialog"> <uni-popup ref="popupMessage" type="dialog">
<uni-popup-dialog type="warn" mode="base" title="提示" :showClose="false" :content="tipErrMsg|| tipContent" :duration="2000" :before-close="true" @close="onCancleTip" @confirm="onCancleTip"></uni-popup-dialog> <uni-popup-dialog type="warn" mode="base" title="提示" :showClose="false" :content="tipErrMsg|| tipContent"
:duration="2000" :before-close="true" @close="onCancleTip" @confirm="onCancleTip"></uni-popup-dialog>
</uni-popup> </uni-popup>
<uni-popup ref="popupDialog" type="dialog"> <uni-popup ref="popupDialog" type="dialog">
<uni-popup-dialog type="warn" mode="base" title="提示" :content=" warnTip || packageMode[tempPackageIndex].name + '时长不足,是否接受预定?'" :duration="2000" :before-close="true" @close="onCancleTip" @confirm="onPackageCheck"></uni-popup-dialog> <uni-popup-dialog type="warn" mode="base" title="提示"
:content=" warnTip || packageMode[tempPackageIndex].name + '时长不足,是否接受预定?'" :duration="2000"
:before-close="true" @close="onCancleTip" @confirm="onPackageCheck"></uni-popup-dialog>
</uni-popup> </uni-popup>
</view> </view>
</template> </template>
...@@ -497,7 +551,8 @@ ...@@ -497,7 +551,8 @@
dictList dictList
} from "@/api/index.js"; } from "@/api/index.js";
import { import {
getDictItem,getSysConfigValue getDictItem,
getSysConfigValue
} from "@/utils/tools.js" } from "@/utils/tools.js"
import { import {
getStoreActivity, getStoreActivity,
...@@ -514,6 +569,9 @@ ...@@ -514,6 +569,9 @@
orderCancelPay, orderCancelPay,
queryCardUse queryCardUse
} from "@/api/order" } from "@/api/order"
import {
rechargeConf
} from "@/api/recharge.js";
export default { export default {
components: { components: {
...@@ -530,7 +588,7 @@ ...@@ -530,7 +588,7 @@
images: [], images: [],
status: 0 status: 0
}, },
userInfo: uni.getStorageSync("userInfo")||'', userInfo: uni.getStorageSync("userInfo") || '',
startTime: moment().format("HH:mm"), startTime: moment().format("HH:mm"),
endTime: '', endTime: '',
dateIndex: 0, dateIndex: 0,
...@@ -591,7 +649,7 @@ ...@@ -591,7 +649,7 @@
], ],
durationIndex2: [0], durationIndex2: [0],
hourList2: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], hourList2: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
minuteList: ['00', "05", "10", "15", "20", "25",'30', "35", "40", "45", "50", "55"], minuteList: ['00', "05", "10", "15", "20", "25", '30', "35", "40", "45", "50", "55"],
orderTypeEnum: { orderTypeEnum: {
1: "预定", 1: "预定",
2: "续费", 2: "续费",
...@@ -628,41 +686,43 @@ ...@@ -628,41 +686,43 @@
0: "待保洁", 0: "待保洁",
1: "保洁中" 1: "保洁中"
}, },
formatAllData:{ formatAllData: {
list:[] list: []
}, },
orderInfo:{}, orderInfo: {},
tempPackageIndex:0, tempPackageIndex: 0,
// 临时存放开始时间 结束时间 时长 // 临时存放开始时间 结束时间 时长
tempDateObj:{}, tempDateObj: {},
orderDateDes:"", orderDateDes: "",
orderWeekDes:"", orderWeekDes: "",
orderWeeEnum:{ orderWeeEnum: {
1:"周一", 1: "周一",
2:"周二", 2: "周二",
3:"周三", 3: "周三",
4:"周四", 4: "周四",
5:"周五", 5: "周五",
6:"周六", 6: "周六",
0:"周日", 0: "周日",
}, },
allDayUseStatus: false, // 当日无可预约时段,true 无法预约,false 可预约 allDayUseStatus: false, // 当日无可预约时段,true 无法预约,false 可预约
tipContent: "当前条件下无可预约的时段,请手动选择合适的空闲时段", tipContent: "当前条件下无可预约的时段,请手动选择合适的空闲时段",
tipErrMsg: '', tipErrMsg: '',
warnTip:'', warnTip: '',
activityDate:{}, activityDate: {},
storeCleanDuration: getSysConfigValue('StoreCleanDuration')? Number(getSysConfigValue('StoreCleanDuration')):30, storeCleanDuration: getSysConfigValue('StoreCleanDuration') ? Number(getSysConfigValue(
radioChecked:'', 'StoreCleanDuration')) : 30,
monthlyCardList:[], radioChecked: '',
secondaryCardList:[], monthlyCardList: [],
secondaryCard:{ secondaryCardList: [],
secondaryCard: {
status: 0, status: 0,
number: 0, number: 0,
name:'次卡' name: '次卡'
}, },
submitBtnStatus:false, submitBtnStatus: false,
showMorePayWay: true, showMorePayWay: true,
couponExpireTip:false,//是否进行优惠券过期提醒 couponExpireTip: false, //是否进行优惠券过期提醒
rechargeConfList: [],
}; };
}, },
filters: { filters: {
...@@ -685,7 +745,7 @@ ...@@ -685,7 +745,7 @@
} }
}, },
onLoad(option) { onLoad(option) {
if(!uni.getStorageSync('activite')){ if (!uni.getStorageSync('activite')) {
this.$refs.popupActivite.open() this.$refs.popupActivite.open()
} }
uni.showLoading({ uni.showLoading({
...@@ -696,7 +756,7 @@ ...@@ -696,7 +756,7 @@
this.onGetDicts(); this.onGetDicts();
this.id = option.roomId; this.id = option.roomId;
if (option.orderNo) { if (option.orderNo) {
if(option.modeIndex){ if (option.modeIndex) {
this.modeIndex = Number(option.modeIndex); this.modeIndex = Number(option.modeIndex);
} }
this.orderType = 2; this.orderType = 2;
...@@ -710,22 +770,43 @@ ...@@ -710,22 +770,43 @@
this.onLoading() this.onLoading()
this.distanceIndex = 0 this.distanceIndex = 0
} }
this.onGetRechargeConf();
},
onShow() {
if(this.rechargeConfList.length){
this.userInfo = uni.getStorageSync("userInfo") || '';
this.onComputePrice();
}
}, },
methods: { methods: {
onShowMorePayWay(){ onGetRechargeConf() {
rechargeConf().then(res => {
if (res.data.code == 200 && res.data.rows) {
this.rechargeConfList = res.data.rows
}
})
},
onNavToRecharge(){
uni.switchTab({
url:'/pages/vipCreate/vipCreate'
})
},
onShowMorePayWay() {
this.showMorePayWay = !this.showMorePayWay this.showMorePayWay = !this.showMorePayWay
}, },
onActiviteClose(){ onActiviteClose() {
this.$refs.popupActivite.close(); this.$refs.popupActivite.close();
uni.setStorageSync('activite',true) uni.setStorageSync('activite', true)
}, },
onRadioChange(e){ onRadioChange(e) {
if(this.radioChecked === e){ if (this.radioChecked === e) {
this.radioChecked = '' this.radioChecked = ''
if(this.useCouponList && this.useCouponList.length){ if (this.useCouponList && this.useCouponList.length) {
this.selectCouponIndex = 0; this.selectCouponIndex = 0;
} }
}else{ } else {
this.radioChecked = e this.radioChecked = e
this.selectCouponIndex = -1; this.selectCouponIndex = -1;
} }
...@@ -733,9 +814,9 @@ ...@@ -733,9 +814,9 @@
}, },
// 日期切换 // 日期切换
onDateChange(k) { onDateChange(k) {
if (this.dateIndex === k || this.orderType ==2) return; if (this.dateIndex === k || this.orderType == 2) return;
this.dateIndex = k; this.dateIndex = k;
if(this.modeIndex<0){ if (this.modeIndex < 0) {
this.modeIndex = 0; this.modeIndex = 0;
this.modeIndex2 = -1; this.modeIndex2 = -1;
} }
...@@ -743,13 +824,13 @@ ...@@ -743,13 +824,13 @@
this.onGetSortDistance() this.onGetSortDistance()
}, },
// 小时标签切换 // 小时标签切换
onChangePackage(index){ onChangePackage(index) {
if(this.modeIndex == index || this.allDayUseStatus) return; if (this.modeIndex == index || this.allDayUseStatus) return;
let startDateTime = '' let startDateTime = ''
if(this.orderType ==2){ if (this.orderType == 2) {
startDateTime = this.orderInfo.endDate startDateTime = this.orderInfo.endDate
if(this.orderInfo.status ==2){ if (this.orderInfo.status == 2) {
startDateTime = moment().format("YYYY-MM-DD HH:mm:00") startDateTime = moment().format("YYYY-MM-DD HH:mm:00")
} }
} }
...@@ -762,7 +843,7 @@ ...@@ -762,7 +843,7 @@
duration: this.roomLabelList[this.modeIndex].labelDuration, duration: this.roomLabelList[this.modeIndex].labelDuration,
}); });
}, },
onPackageCheck(){ onPackageCheck() {
this.onCancleTip(); this.onCancleTip();
this.modeIndex = -1 this.modeIndex = -1
this.modeIndex2 = this.tempPackageIndex this.modeIndex2 = this.tempPackageIndex
...@@ -771,29 +852,31 @@ ...@@ -771,29 +852,31 @@
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: this.tempDateObj.startDate, startDateTime: this.tempDateObj.startDate,
duration: this.tempDateObj.duration, duration: this.tempDateObj.duration,
durationType:this.tempDateObj.durationType durationType: this.tempDateObj.durationType
}); });
}, },
// 套餐校验,检查当前套餐是否可用 // 套餐校验,检查当前套餐是否可用
onCheckPackageUse(valData){ onCheckPackageUse(valData) {
let useStatus = true; let useStatus = true;
let startStr = `${this.dateList[this.dateIndex].readDate} ${Number(valData.packaStartPeriod)>= 10 ?valData.packaStartPeriod: '0'+valData.packaStartPeriod}:00:00` let startStr =
`${this.dateList[this.dateIndex].readDate} ${Number(valData.packaStartPeriod)>= 10 ?valData.packaStartPeriod: '0'+valData.packaStartPeriod}:00:00`
let startDate = moment(moment().format(startStr)).format("YYYY-MM-DD HH:00:00"); let startDate = moment(moment().format(startStr)).format("YYYY-MM-DD HH:00:00");
let endStr = `${this.dateList[this.dateIndex].readDate} ${Number(valData.packaEndPeriod)>= 10 ?valData.packaEndPeriod: '0'+valData.packaEndPeriod}:00:00` let endStr =
`${this.dateList[this.dateIndex].readDate} ${Number(valData.packaEndPeriod)>= 10 ?valData.packaEndPeriod: '0'+valData.packaEndPeriod}:00:00`
let endDate = moment(moment().format(endStr)).format("YYYY-MM-DD HH:00:00"); let endDate = moment(moment().format(endStr)).format("YYYY-MM-DD HH:00:00");
// 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段 // 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段
let pointDateForm = moment(this.dateList[this.dateIndex].readDate).format("YYYY-MM-DD 11:00:00"); let pointDateForm = moment(this.dateList[this.dateIndex].readDate).format("YYYY-MM-DD 11:00:00");
let dateTimeObj = {}; let dateTimeObj = {};
if(moment(endDate).valueOf() < moment(pointDateForm).valueOf()){ if (moment(endDate).valueOf() < moment(pointDateForm).valueOf()) {
if(this.orderType == 2){ if (this.orderType == 2) {
// 1.确定续套餐的结束时间 // 1.确定续套餐的结束时间
let orderEndDate = '' let orderEndDate = ''
if(this.orderInfo.status ==1){ if (this.orderInfo.status == 1) {
orderEndDate = moment(this.orderInfo.endDate).valueOf() orderEndDate = moment(this.orderInfo.endDate).valueOf()
} else{ } else {
orderEndDate = moment().valueOf() orderEndDate = moment().valueOf()
} }
startDate = moment(orderEndDate).format(`YYYY-MM-DD 0${valData.packaStartPeriod}:00:00`); startDate = moment(orderEndDate).format(`YYYY-MM-DD 0${valData.packaStartPeriod}:00:00`);
...@@ -801,54 +884,60 @@ ...@@ -801,54 +884,60 @@
// 续夜宵套餐时的开始时间必须在设定的开始和结束时间内 // 续夜宵套餐时的开始时间必须在设定的开始和结束时间内
let b1 = orderEndDate >= moment(startDate).valueOf() && orderEndDate <= moment(endDate).valueOf(); let b1 = orderEndDate >= moment(startDate).valueOf() && orderEndDate <= moment(endDate).valueOf();
// 续夜宵套餐的开始时间必须在设定的开始时间和开始时间四个小时内 // 续夜宵套餐的开始时间必须在设定的开始时间和开始时间四个小时内
let b2 = orderEndDate >= moment(startDate).valueOf() && orderEndDate <= moment(startDate).valueOf()+4*60*60*1000; let b2 = orderEndDate >= moment(startDate).valueOf() && orderEndDate <= moment(startDate)
.valueOf() + 4 * 60 * 60 * 1000;
if(!(b1&&b2) || this.onCheckPackUse(startDate,endDate,4)){ if (!(b1 && b2) || this.onCheckPackUse(startDate, endDate, 4)) {
useStatus = false; useStatus = false;
} }
}else{ } else {
//通宵套餐 //通宵套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate); dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 实际时长小于原时长的60%则选择明天的时间 // 实际时长小于原时长的60%则选择明天的时间
// 原时间 // 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf() let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间 // 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf() let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
if( actualTime < originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){ .valueOf()
if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate, 4)) {
// 实际时长小于原时长的60%则选择明天的时间 // 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算 // 加一天时间重新计算
if(this.dateIndex != 0){ if (this.dateIndex != 0) {
useStatus = false; useStatus = false;
return return
} }
startDate = moment(startDate).add(1,"d").format("YYYY-MM-DD HH:00:00"); startDate = moment(startDate).add(1, "d").format("YYYY-MM-DD HH:00:00");
endDate = moment(endDate).add(1,"d").format("YYYY-MM-DD HH:00:00") endDate = moment(endDate).add(1, "d").format("YYYY-MM-DD HH:00:00")
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate); dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 实际时间 // 实际时间
actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf() actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
if( actualTime < originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){ .valueOf()
if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate,
4)) {
useStatus = false; useStatus = false;
return return
} }
} }
} }
} else { } else {
if(this.orderType == 2){ if (this.orderType == 2) {
if(!(moment(this.orderInfo.endDate).valueOf() >= moment(startDate).valueOf() && moment(this.orderInfo.endDate).valueOf() <= moment(endDate).valueOf())){ if (!(moment(this.orderInfo.endDate).valueOf() >= moment(startDate).valueOf() && moment(this
.orderInfo.endDate).valueOf() <= moment(endDate).valueOf())) {
useStatus = false; useStatus = false;
} }
return return
} }
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐 // 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
// 闲时套餐 // 闲时套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate); dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 原时间 // 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf() let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间 // 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf() let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
if( actualTime < originTime*0.6 || this.onCheckPackUse(startDate,endDate)){ .valueOf()
if (actualTime < originTime * 0.6 || this.onCheckPackUse(startDate, endDate)) {
useStatus = false; useStatus = false;
return return
} }
...@@ -856,219 +945,241 @@ ...@@ -856,219 +945,241 @@
return useStatus return useStatus
}, },
// 套餐切换 // 套餐切换
onChangePackage2(index,val){ onChangePackage2(index, val) {
if(this.modeIndex2 == index || !val.show) return; if (this.modeIndex2 == index || !val.show) return;
this.tempPackageIndex = index; this.tempPackageIndex = index;
let hStartStr = this.packageMode[this.tempPackageIndex].packaStartPeriod let hStartStr = this.packageMode[this.tempPackageIndex].packaStartPeriod
let startStr = `${this.dateList[this.dateIndex].readDate} ${Number(hStartStr)>= 10 ?hStartStr:'0'+hStartStr}:00:00` let startStr =
`${this.dateList[this.dateIndex].readDate} ${Number(hStartStr)>= 10 ?hStartStr:'0'+hStartStr}:00:00`
let startDate = moment(moment().format(startStr)).format("YYYY-MM-DD HH:00:00"); let startDate = moment(moment().format(startStr)).format("YYYY-MM-DD HH:00:00");
let hEndtStr = this.packageMode[this.tempPackageIndex].packaEndPeriod let hEndtStr = this.packageMode[this.tempPackageIndex].packaEndPeriod
let endStr = `${this.dateList[this.dateIndex].readDate} ${Number(hEndtStr)>= 10 ?hEndtStr:'0'+hEndtStr}:00:00` let endStr =
`${this.dateList[this.dateIndex].readDate} ${Number(hEndtStr)>= 10 ?hEndtStr:'0'+hEndtStr}:00:00`
let endDate = moment(moment().format(endStr)).format("YYYY-MM-DD HH:00:00"); let endDate = moment(moment().format(endStr)).format("YYYY-MM-DD HH:00:00");
// 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段 // 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段
let pointDateForm = moment(this.dateList[this.dateIndex].readDate).format("YYYY-MM-DD 11:00:00"); let pointDateForm = moment(this.dateList[this.dateIndex].readDate).format("YYYY-MM-DD 11:00:00");
let dateTimeObj = {}; let dateTimeObj = {};
if(moment(endDate).valueOf() < moment(pointDateForm).valueOf()){ if (moment(endDate).valueOf() < moment(pointDateForm).valueOf()) {
// 如果是续单 // 如果是续单
if(this.orderType ==2){ if (this.orderType == 2) {
let orderEndDate = moment().format("YYYY-MM-DD HH:mm:ss") let orderEndDate = moment().format("YYYY-MM-DD HH:mm:ss")
if(this.orderInfo.status ==1){ if (this.orderInfo.status == 1) {
orderEndDate = this.orderInfo.endDate orderEndDate = this.orderInfo.endDate
} }
startDate = moment(orderEndDate).format(`YYYY-MM-DD 0${this.packageMode[this.tempPackageIndex].packaStartPeriod}:00:00`); startDate = moment(orderEndDate).format(
endDate = moment(orderEndDate).format(`YYYY-MM-DD 0${this.packageMode[this.tempPackageIndex].packaEndPeriod}:00:00`); `YYYY-MM-DD 0${this.packageMode[this.tempPackageIndex].packaStartPeriod}:00:00`);
endDate = moment(orderEndDate).format(
`YYYY-MM-DD 0${this.packageMode[this.tempPackageIndex].packaEndPeriod}:00:00`);
// 续夜宵套餐时的开始时间必须在设定的开始和结束时间内 // 续夜宵套餐时的开始时间必须在设定的开始和结束时间内
let b1 =moment(orderEndDate).valueOf() >= moment(startDate).valueOf() && moment(orderEndDate).valueOf() <= moment(endDate).valueOf(); let b1 = moment(orderEndDate).valueOf() >= moment(startDate).valueOf() && moment(orderEndDate)
.valueOf() <= moment(endDate).valueOf();
if(b1){ if (b1) {
if( moment(endDate).valueOf() - moment(orderEndDate).valueOf()>=3*60*60*1000 && moment(endDate).valueOf()-moment(orderEndDate).valueOf() < 4*60*60*1000){ if (moment(endDate).valueOf() - moment(orderEndDate).valueOf() >= 3 * 60 * 60 * 1000 && moment(
endDate).valueOf() - moment(orderEndDate).valueOf() < 4 * 60 * 60 * 1000) {
this.tempDateObj = { this.tempDateObj = {
startDate: orderEndDate, startDate: orderEndDate,
endDate: endDate, endDate: endDate,
duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf())/60000, duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf()) / 60000,
durationType:2 durationType: 2
} }
this.warnTip = '通宵套餐,不足4小时,是否预定?' this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open(); this.$refs.popupDialog.open();
return return
}else if(moment(endDate).valueOf()- moment(orderEndDate).valueOf() > 4*60*60*1000){ } else if (moment(endDate).valueOf() - moment(orderEndDate).valueOf() > 4 * 60 * 60 * 1000) {
this.modeIndex = -1 this.modeIndex = -1
this.modeIndex2 = index this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf()-moment(dateTimeObj.tempStartDate).valueOf())/1000/60; let duration = (moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj
.tempStartDate).valueOf()) / 1000 / 60;
this.formatAllData = this.onTransiteForDate({ this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: orderEndDate, startDateTime: orderEndDate,
endDateTime: endDate, endDateTime: endDate,
duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf())/60000, duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf()) / 60000,
durationType:2 durationType: 2
}); });
}else{ } else {
} }
} }
}else{ } else {
//否则是订单 //否则是订单
// 通宵套餐 // 通宵套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate); dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 原时间 // 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf() let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间 // 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf() let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
// 原时长是9个小时,减去4个小时, 低于5个小时,则时长不足 // 原时长是9个小时,减去4个小时, 低于5个小时,则时长不足
if( actualTime< originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){ if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate, 4)) {
// 实际时长小于原时长的60%则选择明天的时间 // 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算 // 加一天时间重新计算
if(this.dateIndex != 0 ){ if (this.dateIndex != 0) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:'可使用时长不足,请选择其他日期' title: '可使用时长不足,请选择其他日期'
}) })
}else{ } else {
startDate = moment(startDate).add(1,"d").format("YYYY-MM-DD HH:00:00"); startDate = moment(startDate).add(1, "d").format("YYYY-MM-DD HH:00:00");
endDate = moment(endDate).add(1,"d").format("YYYY-MM-DD HH:00:00"); endDate = moment(endDate).add(1, "d").format("YYYY-MM-DD HH:00:00");
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate); dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 实际时间 // 实际时间
actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf() actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
if( actualTime < originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){ if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate,
4)) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:'可使用时长不足,请选择其他日期' title: '可使用时长不足,请选择其他日期'
}) })
return return
}else if(actualTime < originTime - 3*60*60*1000 && actualTime >= originTime - 4*60*60*1000){ } else if (actualTime < originTime - 3 * 60 * 60 * 1000 && actualTime >= originTime - 4 *
60 * 60 * 1000) {
this.tempDateObj = { this.tempDateObj = {
startDate: dateTimeObj.tempStartDate, startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate, endDate: dateTimeObj.tempEndDate,
duration: actualTime/60000, duration: actualTime / 60000,
durationType:2 durationType: 2
} }
this.warnTip = '通宵套餐,不足4小时,是否预定?' this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open(); this.$refs.popupDialog.open();
return return
}else{ } else {
this.modeIndex = -1 this.modeIndex = -1
this.modeIndex2 = index this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf()-moment(dateTimeObj.tempStartDate).valueOf())/1000/60; let duration = (moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj
.tempStartDate).valueOf()) / 1000 / 60;
this.formatAllData = this.onTransiteForDate({ this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate, startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate, endDateTime: dateTimeObj.tempEndDate,
duration, duration,
durationType:2 durationType: 2
}); });
} }
} }
} else if( actualTime < originTime - 3*60*60*1000 && actualTime >= originTime - 4*60*60*1000){ } else if (actualTime < originTime - 3 * 60 * 60 * 1000 && actualTime >= originTime - 4 * 60 * 60 *
1000) {
this.tempDateObj = { this.tempDateObj = {
startDate: dateTimeObj.tempStartDate, startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate, endDate: dateTimeObj.tempEndDate,
duration: actualTime/60000, duration: actualTime / 60000,
durationType:2 durationType: 2
} }
this.warnTip = '通宵套餐,不足4小时,是否预定?' this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open(); this.$refs.popupDialog.open();
return return
}else{ } else {
this.modeIndex = -1 this.modeIndex = -1
this.modeIndex2 = index this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf()-moment(dateTimeObj.tempStartDate).valueOf())/1000/60; let duration = (moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()) / 1000 / 60;
this.formatAllData = this.onTransiteForDate({ this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate, startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate, endDateTime: dateTimeObj.tempEndDate,
duration, duration,
durationType:2 durationType: 2
}); });
} }
} }
} else { } else {
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐 // 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate); dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 原时间 // 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf() let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间 // 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf() let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
if( actualTime< originTime*0.6 || this.onCheckPackUse(startDate,endDate)){ .valueOf()
if (actualTime < originTime * 0.6 || this.onCheckPackUse(startDate, endDate)) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:'可使用时长不足,请选择其他日期' title: '可使用时长不足,请选择其他日期'
}) })
return return
} else if(actualTime < originTime*0.8 && actualTime >= originTime*0.6){ } else if (actualTime < originTime * 0.8 && actualTime >= originTime * 0.6) {
this.tempDateObj = { this.tempDateObj = {
startDate: dateTimeObj.tempStartDate, startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate, endDate: dateTimeObj.tempEndDate,
duration: actualTime/60000, duration: actualTime / 60000,
durationType:2 durationType: 2
} }
this.warnTip = '闲时套餐,不足4小时,是否预定?' this.warnTip = '闲时套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open(); this.$refs.popupDialog.open();
return return
}else{ } else {
this.modeIndex = -1 this.modeIndex = -1
this.modeIndex2 = index this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf()-moment(dateTimeObj.tempStartDate).valueOf())/1000/60; let duration = (moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()) / 1000 / 60;
this.formatAllData = this.onTransiteForDate({ this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate, startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate, endDateTime: dateTimeObj.tempEndDate,
duration, duration,
durationType:2 durationType: 2
}); });
} }
} }
}, },
// 通过指定时间在当前时间段内查询合适的时间段 // 通过指定时间在当前时间段内查询合适的时间段
onComputeStartDateAndEndDate(startDate,endDate){ onComputeStartDateAndEndDate(startDate, endDate) {
//重新设置开始时间和结束时间 //重新设置开始时间和结束时间
let tempStartDate = ''; let tempStartDate = '';
let tempEndDate = ''; let tempEndDate = '';
let startNeedChange = true; let startNeedChange = true;
let endNeedChange = true; let endNeedChange = true;
this.dateIntervalList.forEach(item=>{ this.dateIntervalList.forEach(item => {
// 检查时段在开始时间和结束时间内 // 检查时段在开始时间和结束时间内
let start = moment(moment(item.timeHour).format("YYYY-MM-DD HH:00:00")).valueOf() let start = moment(moment(item.timeHour).format("YYYY-MM-DD HH:00:00")).valueOf()
let end = moment(moment(item.timeHour).format("YYYY-MM-DD HH:59:59")).valueOf() let end = moment(moment(item.timeHour).format("YYYY-MM-DD HH:59:59")).valueOf()
if( start < moment(endDate).valueOf() && start >= moment(startDate).valueOf()){ if (start < moment(endDate).valueOf() && start >= moment(startDate).valueOf()) {
if(tempStartDate && !startNeedChange){ if (tempStartDate && !startNeedChange) {
if(item.status ==0 && endNeedChange){ if (item.status == 0 && endNeedChange) {
endNeedChange = true; endNeedChange = true;
tempEndDate = moment(item.timeHour+':59:00').add(1,"m").format("YYYY-MM-DD HH:mm:00") tempEndDate = moment(item.timeHour + ':59:00').add(1, "m").format(
} else if(item.status ==1 && endNeedChange){ "YYYY-MM-DD HH:mm:00")
} else if (item.status == 1 && endNeedChange) {
endNeedChange = false; endNeedChange = false;
tempEndDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00") tempEndDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00")
} }
}else{ } else {
if(item.status == 0 && startNeedChange){ if (item.status == 0 && startNeedChange) {
tempStartDate = moment(item.timeHour).format("YYYY-MM-DD HH:00:00") tempStartDate = moment(item.timeHour).format("YYYY-MM-DD HH:00:00")
startNeedChange = false; startNeedChange = false;
}else if(item.status ==1 && this.onCheckHourUse(item.startHoldTime,item.endHoldTime) && startNeedChange){ } else if (item.status == 1 && this.onCheckHourUse(item.startHoldTime, item
.endHoldTime) && startNeedChange) {
startNeedChange = true; startNeedChange = true;
tempStartDate = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00")).format("YYYY-MM-DD HH:mm:00") tempStartDate = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00"))
tempEndDate = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00")).add(1,'m').format("YYYY-MM-DD HH:mm:00") .format("YYYY-MM-DD HH:mm:00")
}else if(item.status ==1 && !this.onCheckHourUse(item.startHoldTime,item.endHoldTime) && startNeedChange){ tempEndDate = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00")).add(1,
'm').format("YYYY-MM-DD HH:mm:00")
} else if (item.status == 1 && !this.onCheckHourUse(item.startHoldTime, item
.endHoldTime) && startNeedChange) {
startNeedChange = false; startNeedChange = false;
let tempStart = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00")).format("YYYY-MM-DD HH:mm:00") let tempStart = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00"))
tempStartDate = this.orderType ==1? moment(tempStart).add(1,'m') : tempStart .format("YYYY-MM-DD HH:mm:00")
tempStartDate = this.orderType == 1 ? moment(tempStart).add(1, 'm') : tempStart
} }
} }
} }
...@@ -1080,67 +1191,71 @@ ...@@ -1080,67 +1191,71 @@
} }
}, },
// 通过指定时长在当前时间段内查询合适的时间段 // 通过指定时长在当前时间段内查询合适的时间段
onComputeByDuration(duration,durationType=1){ onComputeByDuration(duration, durationType = 1) {
//重新设置开始时间和结束时间 //重新设置开始时间和结束时间
let m = Number(duration)*60; let m = Number(duration) * 60;
if (durationType === 2) { if (durationType === 2) {
m = Number(duration) m = Number(duration)
} }
// 把时长计算成毫秒数 // 把时长计算成毫秒数
let timeStampLong = m*60*1000; let timeStampLong = m * 60 * 1000;
let tempStartDate = ''; let tempStartDate = '';
let tempEndDate = ''; let tempEndDate = '';
let startNeedChange = true; let startNeedChange = true;
let endNeedChange = true; let endNeedChange = true;
this.dateIntervalList.forEach((item,k) => { this.dateIntervalList.forEach((item, k) => {
if(k<24){ if (k < 24) {
if(item.status == 1 && startNeedChange && this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){ if (item.status == 1 && startNeedChange && this.onCheckHourUse(item.startHoldTime, item
tempStartDate = moment(item.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00") .endHoldTime)) {
tempStartDate = moment(item.endHoldTime).add(1, 'm').format("YYYY-MM-DD HH:mm:00")
startNeedChange = true startNeedChange = true
endNeedChange = true; endNeedChange = true;
} }
if(item.status == 1 && startNeedChange && !this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){ if (item.status == 1 && startNeedChange && !this.onCheckHourUse(item.startHoldTime, item
tempStartDate = moment(item.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00") .endHoldTime)) {
tempStartDate = moment(item.endHoldTime).add(1, 'm').format("YYYY-MM-DD HH:mm:00")
startNeedChange = false startNeedChange = false
endNeedChange = true; endNeedChange = true;
} }
if(item.status == 0 && startNeedChange){ if (item.status == 0 && startNeedChange) {
tempStartDate = moment(item.timeHour).format("YYYY-MM-DD HH:00:00") tempStartDate = moment(item.timeHour).format("YYYY-MM-DD HH:00:00")
startNeedChange = false startNeedChange = false
endNeedChange = true; endNeedChange = true;
} }
} }
if(item.status == 1 && endNeedChange && tempStartDate){ if (item.status == 1 && endNeedChange && tempStartDate) {
let endDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00") let endDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00")
if( moment(endDate).valueOf() >= moment(tempStartDate).valueOf()){ if (moment(endDate).valueOf() >= moment(tempStartDate).valueOf()) {
tempEndDate = endDate tempEndDate = endDate
if( moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong){ if (moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong) {
startNeedChange = false; startNeedChange = false;
endNeedChange = false; endNeedChange = false;
}else{ } else {
if(k <24 ){ if (k < 24) {
tempStartDate = moment(item.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00") tempStartDate = moment(item.endHoldTime).add(1, 'm').format(
"YYYY-MM-DD HH:mm:00")
startNeedChange = true; startNeedChange = true;
}else{ } else {
startNeedChange = false; startNeedChange = false;
} }
endNeedChange = false; endNeedChange = false;
} }
} }
}else if(item.status == 0 && endNeedChange && tempStartDate){ } else if (item.status == 0 && endNeedChange && tempStartDate) {
let endDate = moment(item.timeHour).format("YYYY-MM-DD HH:59:00") let endDate = moment(item.timeHour).format("YYYY-MM-DD HH:59:00")
if( moment(endDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong){ if (moment(endDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong) {
endNeedChange = false; endNeedChange = false;
tempEndDate = moment(moment(tempStartDate).valueOf()+timeStampLong).format("YYYY-MM-DD HH:mm:00") tempEndDate = moment(moment(tempStartDate).valueOf() + timeStampLong).format(
}else{ "YYYY-MM-DD HH:mm:00")
} else {
endNeedChange = true; endNeedChange = true;
} }
} }
...@@ -1148,12 +1263,12 @@ ...@@ -1148,12 +1263,12 @@
let params = { let params = {
startDateTime:tempStartDate, startDateTime: tempStartDate,
endDateTime: tempEndDate, endDateTime: tempEndDate,
useStatus: moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() < timeStampLong useStatus: moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() < timeStampLong
} }
if(this.modeIndex == 0 && params.useStatus){ if (this.modeIndex == 0 && params.useStatus) {
// 当前日期,全天可用状态 true 不可用,false 还有可用时段; // 当前日期,全天可用状态 true 不可用,false 还有可用时段;
this.allDayUseStatus = true; this.allDayUseStatus = true;
this.tipErrMsg = "当前日期,空闲时间不足,请选择其他日期" this.tipErrMsg = "当前日期,空闲时间不足,请选择其他日期"
...@@ -1225,21 +1340,21 @@ ...@@ -1225,21 +1340,21 @@
} }
}) })
}, },
onGetStoreActivity(){ onGetStoreActivity() {
getStoreActivity({ getStoreActivity({
storeId: this.id storeId: this.id
}).then(res=>{ }).then(res => {
if(res.data.code ==200 && res.data.data){ if (res.data.code == 200 && res.data.data) {
let obj = res.data.data || {} let obj = res.data.data || {}
for(let key in obj){ for (let key in obj) {
let key2 = moment(key).format("YYYY-MM-DD") let key2 = moment(key).format("YYYY-MM-DD")
if(obj[key] && obj[key].length){ if (obj[key] && obj[key].length) {
this.activityDate[key2] = { this.activityDate[key2] = {
labelIds: obj[key].filter(item=> item.labelId).map(val => val.labelId), labelIds: obj[key].filter(item => item.labelId).map(val => val.labelId),
packIds: obj[key].filter(item=> item.packId).map(val => val.packId), packIds: obj[key].filter(item => item.packId).map(val => val.packId),
} }
}else{ } else {
this.activityDate[key2] = false this.activityDate[key2] = false
} }
...@@ -1285,13 +1400,13 @@ ...@@ -1285,13 +1400,13 @@
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
day: this.dateList[this.dateIndex].readDate, day: this.dateList[this.dateIndex].readDate,
orderType: this.orderType, orderType: this.orderType,
orderId: this.orderType==2? this.orderInfo.id : "" orderId: this.orderType == 2 ? this.orderInfo.id : ""
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
this.dateIntervalList = res.data.data.map((item, index) => { this.dateIntervalList = res.data.data.map((item, index) => {
let status = item.status; let status = item.status;
if(status ==1){ if (status == 1) {
if(!this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){ if (!this.onCheckHourUse(item.startHoldTime, item.endHoldTime)) {
status = 0 status = 0
} }
} }
...@@ -1302,7 +1417,7 @@ ...@@ -1302,7 +1417,7 @@
} }
}) })
this.packageMode = this.packList.map(item=>{ this.packageMode = this.packList.map(item => {
return { return {
...item, ...item,
show: this.onCheckPackageUse(item) show: this.onCheckPackageUse(item)
...@@ -1310,9 +1425,9 @@ ...@@ -1310,9 +1425,9 @@
}) })
let startDateTime = '' let startDateTime = ''
if(this.orderType ==2){ if (this.orderType == 2) {
startDateTime = this.orderInfo.endDate startDateTime = this.orderInfo.endDate
if(this.orderInfo.status ==2){ if (this.orderInfo.status == 2) {
startDateTime = moment().format("YYYY-MM-DD HH:mm:00") startDateTime = moment().format("YYYY-MM-DD HH:mm:00")
} }
} }
...@@ -1331,26 +1446,30 @@ ...@@ -1331,26 +1446,30 @@
preStartDate: p != null ? p.startDateTime : this.formatAllData.startDateTime, preStartDate: p != null ? p.startDateTime : this.formatAllData.startDateTime,
preEndDate: p != null ? p.endDateTime : this.formatAllData.endDateTime, preEndDate: p != null ? p.endDateTime : this.formatAllData.endDateTime,
orderType: this.orderType, orderType: this.orderType,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1)? 1 : 0, orderMode: this.modeIndex2 >= 0 || (this.modeIndex >= 0 && this.roomLabelList.length && this
packageId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1? this.roomLabelList[this.modeIndex].packId : '', .roomLabelList[this.modeIndex].openPack == 1) ? 1 : 0,
packageId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex >= 0 &&
this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack == 1 ? this
.roomLabelList[this.modeIndex].packId : '',
roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '' roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : ''
}).then(res => { }).then(res => {
this.couponExpireTip = false; this.couponExpireTip = false;
if (res.data.code == 200) { if (res.data.code == 200) {
if (res.data && res.data.data.length) { if (res.data && res.data.data.length) {
this.useCouponList = res.data.data ; this.useCouponList = res.data.data;
let i = this.useCouponList.findIndex(item => { let i = this.useCouponList.findIndex(item => {
if(item.isAvailable ===0){ if (item.isAvailable === 0) {
if(moment(item.endDate).valueOf() - moment().valueOf() < 7*24*3600*1000){ if (moment(item.endDate).valueOf() - moment().valueOf() < 7 * 24 *
3600 * 1000) {
this.couponExpireTip = true this.couponExpireTip = true
} }
} }
return item.isAvailable ===0 return item.isAvailable === 0
}) })
this.selectCouponIndex = i>=0? i: -1; this.selectCouponIndex = i >= 0 ? i : -1;
}else{ } else {
this.selectCouponIndex = -1; this.selectCouponIndex = -1;
} }
this.onQueryCardUse(); this.onQueryCardUse();
...@@ -1367,7 +1486,8 @@ ...@@ -1367,7 +1486,8 @@
events: { events: {
getSelectData(data) { getSelectData(data) {
if (data.couponId && that.useCouponList.length) { if (data.couponId && that.useCouponList.length) {
that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data.couponId); that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data
.couponId);
that.radioChecked = '' that.radioChecked = ''
} else { } else {
that.selectCouponIndex = -1 that.selectCouponIndex = -1
...@@ -1380,71 +1500,85 @@ ...@@ -1380,71 +1500,85 @@
orderType: that.orderType, orderType: that.orderType,
storeId: that.roomInfo.storeId, storeId: that.roomInfo.storeId,
roomId: that.roomInfo.id, roomId: that.roomInfo.id,
orderMode: that.modeIndex2 >= 0 || (that.modeIndex>=0 && that.roomLabelList.length && that.roomLabelList[that.modeIndex].openPack==1)? 1 : 0, orderMode: that.modeIndex2 >= 0 || (that.modeIndex >= 0 && that
.roomLabelList.length && that.roomLabelList[that.modeIndex]
.openPack == 1) ? 1 : 0,
preStartDate: that.formatAllData.startDateTime, preStartDate: that.formatAllData.startDateTime,
preEndDate: that.formatAllData.endDateTime, preEndDate: that.formatAllData.endDateTime,
packageId: that.modeIndex2 >= 0 ? that.packageMode[that.modeIndex2].id : that.modeIndex>=0 && that.roomLabelList.length && that.roomLabelList[that.modeIndex].openPack==1? that.roomLabelList[that.modeIndex].packId : '', packageId: that.modeIndex2 >= 0 ? that.packageMode[that.modeIndex2].id :
roomLabelId: that.modeIndex >= 0 ? that.roomLabelList[that.modeIndex].id : '', that.modeIndex >= 0 && that.roomLabelList.length && that.roomLabelList[
selectId: that.selectCouponIndex >= 0 && that.useCouponList.length ? that.useCouponList[that.selectCouponIndex].id : '' that.modeIndex].openPack == 1 ? that.roomLabelList[that.modeIndex]
.packId : '',
roomLabelId: that.modeIndex >= 0 ? that.roomLabelList[that.modeIndex].id :
'',
selectId: that.selectCouponIndex >= 0 && that.useCouponList.length ? that
.useCouponList[that.selectCouponIndex].id : ''
}) })
} }
}) })
} }
}, },
onQueryCardUse(){ onQueryCardUse() {
if(this.userInfo && (this.userInfo.monthlyCardList || this.userInfo.secondaryCardList)){ if (this.userInfo && (this.userInfo.monthlyCardList || this.userInfo.secondaryCardList)) {
let params = { let params = {
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
orderType: this.orderType, orderType: this.orderType,
preStartDate: this.formatAllData.startDateTime, preStartDate: this.formatAllData.startDateTime,
preEndDate: this.formatAllData.endDateTime, preEndDate: this.formatAllData.endDateTime,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1)? 1 : 0, orderMode: this.modeIndex2 >= 0 || (this.modeIndex >= 0 && this.roomLabelList.length && this
packId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1? this.roomLabelList[this.modeIndex].packId : '', .roomLabelList[this.modeIndex].openPack == 1) ? 1 : 0,
roomLabelId : this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '', packId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex >= 0 &&
this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack == 1 ? this
.roomLabelList[this.modeIndex].packId : '',
roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '',
} }
queryCardUse(params).then(res => { queryCardUse(params).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
if(res.data.data && res.data.data.consumerMonthlyCard && res.data.data.consumerMonthlyCard.length){ if (res.data.data && res.data.data.consumerMonthlyCard && res.data.data
.consumerMonthlyCard.length) {
this.radioChecked = "monthlyCard"; this.radioChecked = "monthlyCard";
this.selectCouponIndex = -1; this.selectCouponIndex = -1;
}else if(res.data.data && res.data.data.consumerSecondaryCard && res.data.data.consumerSecondaryCard.length){ } else if (res.data.data && res.data.data.consumerSecondaryCard && res.data.data
.consumerSecondaryCard.length) {
this.radioChecked = "secondaryCard"; this.radioChecked = "secondaryCard";
this.selectCouponIndex = -1; this.selectCouponIndex = -1;
}else{ } else {
this.radioChecked = "" this.radioChecked = ""
} }
if(res.data.data && res.data.data.consumerMonthlyCard && res.data.data.consumerMonthlyCard.length){ if (res.data.data && res.data.data.consumerMonthlyCard && res.data.data
.consumerMonthlyCard.length) {
this.monthlyCardList = res.data.data.consumerMonthlyCard this.monthlyCardList = res.data.data.consumerMonthlyCard
}else{ } else {
this.monthlyCardList = []; this.monthlyCardList = [];
} }
if(this.userInfo.secondaryCardList && res.data.data && res.data.data.consumerSecondaryCard && res.data.data.consumerSecondaryCard.length){ if (this.userInfo.secondaryCardList && res.data.data && res.data.data
.consumerSecondaryCard && res.data.data.consumerSecondaryCard.length) {
this.secondaryCardList = res.data.data.consumerSecondaryCard this.secondaryCardList = res.data.data.consumerSecondaryCard
if(this.secondaryCardList && this.secondaryCardList.length){ if (this.secondaryCardList && this.secondaryCardList.length) {
this.secondaryCard.status = 1; this.secondaryCard.status = 1;
let num = 0; let num = 0;
this.secondaryCardList.forEach(val => { this.secondaryCardList.forEach(val => {
num+=val.number; num += val.number;
this.secondaryCard.name = val.confName; this.secondaryCard.name = val.confName;
}) })
this.secondaryCard.number = num; this.secondaryCard.number = num;
} }
}else{ } else {
this.secondaryCardList = []; this.secondaryCardList = [];
} }
this.onComputePrice(); this.onComputePrice();
} }
}) })
}else{ } else {
this.onComputePrice(); this.onComputePrice();
} }
}, },
...@@ -1454,18 +1588,22 @@ ...@@ -1454,18 +1588,22 @@
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
buyType: this.orderTypeList[this.index].type, buyType: this.orderTypeList[this.index].type,
couponId: this.useCouponList.length && this.selectCouponIndex >= 0 && !this.radioChecked ? this.useCouponList[this.selectCouponIndex].id : '', couponId: this.useCouponList.length && this.selectCouponIndex >= 0 && !this.radioChecked ? this
.useCouponList[this.selectCouponIndex].id : '',
orderType: this.orderType, orderType: this.orderType,
preStartDate:this.formatAllData.startDateTime, preStartDate: this.formatAllData.startDateTime,
preEndDate: this.formatAllData.endDateTime, preEndDate: this.formatAllData.endDateTime,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1)? 1 : 0, orderMode: this.modeIndex2 >= 0 || (this.modeIndex >= 0 && this.roomLabelList.length && this
packId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1? this.roomLabelList[this.modeIndex].packId : '', .roomLabelList[this.modeIndex].openPack == 1) ? 1 : 0,
roomLabelId :this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '' packId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex >= 0 && this
.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack == 1 ? this.roomLabelList[
this.modeIndex].packId : '',
roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : ''
} }
if(this.radioChecked == "secondaryCard" && this.secondaryCardList.length){ if (this.radioChecked == "secondaryCard" && this.secondaryCardList.length) {
params.secondaryCardId = this.secondaryCardList[0].id params.secondaryCardId = this.secondaryCardList[0].id
}else if(this.radioChecked == "monthlyCard" && this.monthlyCardList.length){ } else if (this.radioChecked == "monthlyCard" && this.monthlyCardList.length) {
params.monthlyCardId = this.monthlyCardList[0].id params.monthlyCardId = this.monthlyCardList[0].id
} }
...@@ -1475,9 +1613,9 @@ ...@@ -1475,9 +1613,9 @@
let obj = res.data.data let obj = res.data.data
let discountText = obj.discount; let discountText = obj.discount;
if(obj.discount > 0 && obj.discount < 100){ if (obj.discount > 0 && obj.discount < 100) {
discountText = Number(obj.discount.toString().split('').reverse().join('')).toString(); discountText = Number(obj.discount.toString().split('').reverse().join('')).toString();
if(discountText.length ==2){ if (discountText.length == 2) {
discountText = obj.discount; discountText = obj.discount;
} }
} }
...@@ -1506,7 +1644,7 @@ ...@@ -1506,7 +1644,7 @@
}, },
// 开始选择时间 // 开始选择时间
onSelectDate() { onSelectDate() {
if(this.orderType==1 && this.modeIndex >= 0 && !this.allDayUseStatus){ if (this.orderType == 1 && this.modeIndex >= 0 && !this.allDayUseStatus) {
this.hourList = [ this.hourList = [
"00", "00",
"01", "01",
...@@ -1539,11 +1677,11 @@ ...@@ -1539,11 +1677,11 @@
this.hourList = this.hourList.filter(item => Number(item) >= Number(h)); this.hourList = this.hourList.filter(item => Number(item) >= Number(h));
} }
this.checkedDateList = this.formatAllData.startTime.split(":").map((item,index) => { this.checkedDateList = this.formatAllData.startTime.split(":").map((item, index) => {
let n = 0 let n = 0
if(index == 0){ if (index == 0) {
n = this.hourList.findIndex(val => Number(val) == Number(item)) n = this.hourList.findIndex(val => Number(val) == Number(item))
} else if(index ==1 && Number(item)%5 == 0) { } else if (index == 1 && Number(item) % 5 == 0) {
n = this.minuteList.findIndex(val => Number(val) == Number(item)) n = this.minuteList.findIndex(val => Number(val) == Number(item))
} }
return n return n
...@@ -1565,7 +1703,7 @@ ...@@ -1565,7 +1703,7 @@
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: `${this.dateList[this.dateIndex].readDate} ${startTime}:00`, startDateTime: `${this.dateList[this.dateIndex].readDate} ${startTime}:00`,
duration: this.roomLabelList[this.modeIndex].labelDuration duration: this.roomLabelList[this.modeIndex].labelDuration
},false); }, false);
this.$forceUpdate(); this.$forceUpdate();
this.onHideModal(); this.onHideModal();
}, },
...@@ -1598,18 +1736,39 @@ ...@@ -1598,18 +1736,39 @@
this.submitBtnStatus = false this.submitBtnStatus = false
}, },
onOrderConfirmBefore() { onOrderConfirmBefore() {
if(this.formatAllData.useStatus){ if (this.formatAllData.useStatus) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:"所选时段有被占用,请选择其他空闲时段" title: "所选时段有被占用,请选择其他空闲时段"
}) })
return; return;
} }
if(this.submitBtnStatus) return if (this.submitBtnStatus) return
this.submitBtnStatus = true; this.submitBtnStatus = true;
if(this.orderType ===1 && !uni.getStorageSync('rechargeTip')) {
this.$refs.popupRecharge.open();
return
}
wx.requestSubscribeMessage({
tmplIds: [
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg',
],
success: (res) => {
},
complete: (res) => {
this.onOrderConfirm();
}
})
},
onNavToCreateOrder(){
this.$refs.popupRecharge.close();
uni.setStorageSync('rechargeTip',true)
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: [ tmplIds: [
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg', 'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg',
...@@ -1641,7 +1800,7 @@ ...@@ -1641,7 +1800,7 @@
let nowDate = moment().valueOf(); let nowDate = moment().valueOf();
let setDate = moment(this.formatAllData.startDateTime).valueOf(); let setDate = moment(this.formatAllData.startDateTime).valueOf();
// 如果当前时间大于开始时间,则不允许下单 // 如果当前时间大于开始时间,则不允许下单
if ( this.orderType == 1 && nowDate > setDate ) { if (this.orderType == 1 && nowDate > setDate) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: "当前时间晚于预约开始时间,请重新选择预约时间" title: "当前时间晚于预约开始时间,请重新选择预约时间"
...@@ -1690,18 +1849,23 @@ ...@@ -1690,18 +1849,23 @@
orderType: this.orderType, orderType: this.orderType,
buyType: this.orderTypeList[this.index].type, buyType: this.orderTypeList[this.index].type,
payType: 1, payType: 1,
couponId: this.useCouponList.length && this.selectCouponIndex >= 0 ? this.useCouponList[this.selectCouponIndex].id : '', couponId: this.useCouponList.length && this.selectCouponIndex >= 0 ? this.useCouponList[this
.selectCouponIndex].id : '',
preStartDate: this.formatAllData.startDateTime, preStartDate: this.formatAllData.startDateTime,
preEndDate: this.formatAllData.endDateTime, preEndDate: this.formatAllData.endDateTime,
totalFee: this.computePriceInfo.totalFee || 0, totalFee: this.computePriceInfo.totalFee || 0,
payFee: this.computePriceInfo.payFee || 0, payFee: this.computePriceInfo.payFee || 0,
packId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1? this.roomLabelList[this.modeIndex].packId : '', packId: this.modeIndex2 >= 0 ? this.packageMode[this.modeIndex2].id : this.modeIndex >= 0 && this
.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack == 1 ? this.roomLabelList[
this.modeIndex].packId : '',
roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '', roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '',
discountRatio: this.computePriceInfo.discountRatio, discountRatio: this.computePriceInfo.discountRatio,
balance: this.computePriceInfo.balance, balance: this.computePriceInfo.balance,
duration: this.computePriceInfo.duration, duration: this.computePriceInfo.duration,
secondaryCardId: this.userInfo && this.userInfo.secondaryCardList && this.secondaryCardList.length && this.radioChecked==='secondaryCard' ? this.secondaryCardList[0].id:'', secondaryCardId: this.userInfo && this.userInfo.secondaryCardList && this.secondaryCardList
monthlyCardId: this.userInfo && this.userInfo.monthlyCardList && this.monthlyCardList.length && this.radioChecked==='monthlyCard'? this.monthlyCardList[0].id:'' .length && this.radioChecked === 'secondaryCard' ? this.secondaryCardList[0].id : '',
monthlyCardId: this.userInfo && this.userInfo.monthlyCardList && this.monthlyCardList.length &&
this.radioChecked === 'monthlyCard' ? this.monthlyCardList[0].id : ''
} }
if (this.orderType === 2 && this.preOrderNo) { if (this.orderType === 2 && this.preOrderNo) {
params.preOrderNo = this.preOrderNo params.preOrderNo = this.preOrderNo
...@@ -1801,7 +1965,7 @@ ...@@ -1801,7 +1965,7 @@
}) })
}, },
onSelectDatePoint(val, i) { onSelectDatePoint(val, i) {
if (this.orderType == 2 || this.modeIndex2>=0 || this.allDayUseStatus) return; if (this.orderType == 2 || this.modeIndex2 >= 0 || this.allDayUseStatus) return;
if (i >= 24) { if (i >= 24) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
...@@ -1810,10 +1974,10 @@ ...@@ -1810,10 +1974,10 @@
return return
} }
let startDate = ""; let startDate = "";
if(val.endHoldTime && this.onCheckHourUse(val.startHoldTime, val.endHoldTime)){ if (val.endHoldTime && this.onCheckHourUse(val.startHoldTime, val.endHoldTime)) {
startDate = moment(val.endHoldTime).format("YYYY-MM-DD HH:mm:00") startDate = moment(val.endHoldTime).format("YYYY-MM-DD HH:mm:00")
}else if(val.endHoldTime && !this.onCheckHourUse(val.startHoldTime, val.endHoldTime)){ } else if (val.endHoldTime && !this.onCheckHourUse(val.startHoldTime, val.endHoldTime)) {
startDate = moment(val.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00") startDate = moment(val.endHoldTime).add(1, 'm').format("YYYY-MM-DD HH:mm:00")
} else { } else {
startDate = moment(val.timeHour).format("YYYY-MM-DD HH:00:00") startDate = moment(val.timeHour).format("YYYY-MM-DD HH:00:00")
} }
...@@ -1821,59 +1985,65 @@ ...@@ -1821,59 +1985,65 @@
this.formatAllData = this.onTransiteForDate({ this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)), list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: startDate, startDateTime: startDate,
duration:this.formatAllData.duration, duration: this.formatAllData.duration,
durationType:2 durationType: 2
},false); }, false);
this.$forceUpdate(); this.$forceUpdate();
}, },
// 通过开始时间和时长计算时段有无占用 // 通过开始时间和时长计算时段有无占用
onUseByStartAndDuration(startDate,duration,durationType=1){ onUseByStartAndDuration(startDate, duration, durationType = 1) {
let useStatus = false; let useStatus = false;
let m = Number(duration)*60; let m = Number(duration) * 60;
if (durationType === 2) { if (durationType === 2) {
m = Number(duration) m = Number(duration)
} }
let stempLong = m*60000; let stempLong = m * 60000;
let startStemp = moment(startDate).valueOf(); let startStemp = moment(startDate).valueOf();
let endStemp = startStemp + stempLong; let endStemp = startStemp + stempLong;
if(this.orderType == 2){ if (this.orderType == 2) {
endStemp = endStemp + this.storeCleanDuration*60*1000 endStemp = endStemp + this.storeCleanDuration * 60 * 1000
} }
let nextStatus = false; let nextStatus = false;
this.dateIntervalList.forEach((item,k) =>{ this.dateIntervalList.forEach((item, k) => {
if(nextStatus) return; if (nextStatus) return;
let start = moment(item.timeHour+':00:00').valueOf(); let start = moment(item.timeHour + ':00:00').valueOf();
let end = moment(item.timeHour+':59:59').valueOf(); let end = moment(item.timeHour + ':59:59').valueOf();
if( end > startStemp && start < endStemp){ if (end > startStemp && start < endStemp) {
if(item.status ==1){ if (item.status == 1) {
if(this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){ if (this.onCheckHourUse(item.startHoldTime, item.endHoldTime)) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
}else{ } else {
if(this.orderType == 1){ if (this.orderType == 1) {
if( startStemp >= moment(item.startHoldTime).valueOf() && startStemp < moment(item.endHoldTime).valueOf()){ if (startStemp >= moment(item.startHoldTime).valueOf() && startStemp < moment(
item.endHoldTime).valueOf()) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
}else if( endStemp > moment(item.startHoldTime).valueOf() && endStemp <= moment(item.endHoldTime).valueOf()){ } else if (endStemp > moment(item.startHoldTime).valueOf() && endStemp <=
moment(item.endHoldTime).valueOf()) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
}else if(startStemp <= moment(item.endHoldTime).valueOf() && endStemp >= moment(item.startHoldTime).valueOf()){ } else if (startStemp <= moment(item.endHoldTime).valueOf() && endStemp >=
moment(item.startHoldTime).valueOf()) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
} }
} else if(this.orderType == 2){ } else if (this.orderType == 2) {
if( startStemp > moment(item.startHoldTime).valueOf() && startStemp < moment(item.endHoldTime).valueOf()){ if (startStemp > moment(item.startHoldTime).valueOf() && startStemp < moment(
item.endHoldTime).valueOf()) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
} else if(startStemp < moment(item.endHoldTime).valueOf() && endStemp >= moment(item.startHoldTime).valueOf()){ } else if (startStemp < moment(item.endHoldTime).valueOf() && endStemp >=
moment(item.startHoldTime).valueOf()) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
} else if( endStemp >= moment(item.startHoldTime).valueOf() && endStemp <= moment(item.endHoldTime).valueOf()){ } else if (endStemp >= moment(item.startHoldTime).valueOf() && endStemp <=
moment(item.endHoldTime).valueOf()) {
useStatus = true; useStatus = true;
nextStatus = true; nextStatus = true;
...@@ -1899,32 +2069,32 @@ ...@@ -1899,32 +2069,32 @@
//startTime(HH:mm): 开始时间,显示使用 //startTime(HH:mm): 开始时间,显示使用
//endTime(HH:mm): 结束时间,显示使用 //endTime(HH:mm): 结束时间,显示使用
//duration(Number): 时长,仅分钟 //duration(Number): 时长,仅分钟
onTransiteForDate(params,dayChange = true) { onTransiteForDate(params, dayChange = true) {
// 计算出时长,使用分钟计算 // 计算出时长,使用分钟计算
if(!params.duration){ if (!params.duration) {
return { return {
errMsg:"选择时长错误" errMsg: "选择时长错误"
} }
} }
let m = Number(params.duration)*60; let m = Number(params.duration) * 60;
if (params.durationType === 2) { if (params.durationType === 2) {
m = Number(params.duration) m = Number(params.duration)
} }
let startStamp = moment().valueOf(); let startStamp = moment().valueOf();
let endStamp = moment().valueOf() + m*60000; let endStamp = moment().valueOf() + m * 60000;
let dateObj = { let dateObj = {
useStatus: false useStatus: false
}; };
this.tipErrMsg = ""; this.tipErrMsg = "";
if(params.startDateTime){ if (params.startDateTime) {
// 开始和结束时间的毫秒数 // 开始和结束时间的毫秒数
startStamp = moment(params.startDateTime).valueOf(); startStamp = moment(params.startDateTime).valueOf();
endStamp = startStamp + m*60000; endStamp = startStamp + m * 60000;
dateObj.useStatus = this.onUseByStartAndDuration(params.startDateTime,m,2) dateObj.useStatus = this.onUseByStartAndDuration(params.startDateTime, m, 2)
} else if(params.duration){ } else if (params.duration) {
dateObj = this.onComputeByDuration(m,2); dateObj = this.onComputeByDuration(m, 2);
startStamp = moment(dateObj.startDateTime).valueOf(); startStamp = moment(dateObj.startDateTime).valueOf();
endStamp = moment(dateObj.endDateTime).valueOf(); endStamp = moment(dateObj.endDateTime).valueOf();
} }
...@@ -1934,11 +2104,11 @@ ...@@ -1934,11 +2104,11 @@
let startH = moment(moment(item.timeHour).format("YYYY-MM-DD HH:00:00")).valueOf(); let startH = moment(moment(item.timeHour).format("YYYY-MM-DD HH:00:00")).valueOf();
let endH = moment(moment(item.timeHour).format("YYYY-MM-DD HH:59:59")).valueOf(); let endH = moment(moment(item.timeHour).format("YYYY-MM-DD HH:59:59")).valueOf();
if( endH >= startStamp && endH < endStamp){ if (endH >= startStamp && endH < endStamp) {
item.status = 2 item.status = 2
} }
if(this.orderType == 2 && startStamp>= startH && endStamp <= endH ){ if (this.orderType == 2 && startStamp >= startH && endStamp <= endH) {
item.status = 2 item.status = 2
} }
...@@ -1946,59 +2116,59 @@ ...@@ -1946,59 +2116,59 @@
return item return item
}) })
if(dateObj.useStatus){ if (dateObj.useStatus) {
this.$refs.popupMessage.open(); this.$refs.popupMessage.open();
} }
let paramsData = { let paramsData = {
list: dateObj.useStatus? JSON.parse(JSON.stringify(this.dateIntervalList)) : list, list: dateObj.useStatus ? JSON.parse(JSON.stringify(this.dateIntervalList)) : list,
startDateTime: moment(startStamp).format("YYYY-MM-DD HH:mm:ss"), startDateTime: moment(startStamp).format("YYYY-MM-DD HH:mm:ss"),
startTime: moment(startStamp).format("HH:mm"), startTime: moment(startStamp).format("HH:mm"),
endDateTime: moment(endStamp).format("YYYY-MM-DD HH:mm:ss"), endDateTime: moment(endStamp).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(endStamp).format("HH:mm"), endTime: moment(endStamp).format("HH:mm"),
duration: m, duration: m,
useStatus:dateObj.useStatus, useStatus: dateObj.useStatus,
durationType: 2, durationType: 2,
} }
if(dayChange){ if (dayChange) {
// 获取用户可用优化券 // 获取用户可用优化券
this.onGetUseCoupon(paramsData) this.onGetUseCoupon(paramsData)
} }
return paramsData return paramsData
}, },
onCancleTip(){ onCancleTip() {
this.$refs.popupMessage.close(); this.$refs.popupMessage.close();
this.$refs.popupDialog.close(); this.$refs.popupDialog.close();
}, },
// 检查当前小时段是否被全部占用 true 完全占用 false 部分占用 // 检查当前小时段是否被全部占用 true 完全占用 false 部分占用
onCheckHourUse(startDate,endDate) { onCheckHourUse(startDate, endDate) {
let timeStamp = moment(endDate).valueOf()-moment(startDate).valueOf(); let timeStamp = moment(endDate).valueOf() - moment(startDate).valueOf();
return timeStamp >= 3599000 return timeStamp >= 3599000
}, },
//检查套餐后半段60%的时间内是否有被占用,有被占用,则无法预定,d为小时 //检查套餐后半段60%的时间内是否有被占用,有被占用,则无法预定,d为小时
onCheckPackUse(startDate,endDate,d = 0) { onCheckPackUse(startDate, endDate, d = 0) {
let useStatus = false; let useStatus = false;
let startStemp = moment(startDate).valueOf(); let startStemp = moment(startDate).valueOf();
let endStemp = moment(endDate).valueOf(); let endStemp = moment(endDate).valueOf();
let timeStamp = moment(endDate).valueOf()-moment(startDate).valueOf(); let timeStamp = moment(endDate).valueOf() - moment(startDate).valueOf();
if(d){ if (d) {
startStemp = startStemp + d*3600*1000; startStemp = startStemp + d * 3600 * 1000;
}else{ } else {
startStemp = startStemp + timeStamp*0.4; startStemp = startStemp + timeStamp * 0.4;
} }
this.dateIntervalList.forEach(item=>{ this.dateIntervalList.forEach(item => {
let start = moment(item.timeHour+':00:00').valueOf(); let start = moment(item.timeHour + ':00:00').valueOf();
let end = moment(item.timeHour+':59:59').valueOf(); let end = moment(item.timeHour + ':59:59').valueOf();
if(end > startStemp && start < endStemp){ if (end > startStemp && start < endStemp) {
if(item.status == 1){ if (item.status == 1) {
useStatus = true; useStatus = true;
} }
} }
...@@ -2197,22 +2367,26 @@ ...@@ -2197,22 +2367,26 @@
.text-first { .text-first {
letter-spacing: 4upx; letter-spacing: 4upx;
} }
.relative{
.absolute-right{ .relative {
.absolute-right {
position: absolute; position: absolute;
top: -12upx; top: -12upx;
right: -16upx; right: -16upx;
image{
image {
width: 32upx; width: 32upx;
max-height: 30upx; max-height: 30upx;
} }
} }
} }
.absolute-right{
.absolute-right {
position: absolute; position: absolute;
top: -8upx; top: -8upx;
right: -4upx; right: -4upx;
image{
image {
width: 38upx; width: 38upx;
max-height: 34upx; max-height: 34upx;
} }
...@@ -2256,7 +2430,7 @@ ...@@ -2256,7 +2430,7 @@
.package-box { .package-box {
.room-label-list{ .room-label-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
width: 60%; width: 60%;
...@@ -2264,35 +2438,41 @@ ...@@ -2264,35 +2438,41 @@
margin-left: 20upx; margin-left: 20upx;
border-radius: 12upx; border-radius: 12upx;
padding: 10upx 6upx; padding: 10upx 6upx;
.room-label-box{
.room-label-box {
position: relative; position: relative;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 33.33%; width: 33.33%;
padding: 10upx 6upx; padding: 10upx 6upx;
.item { .item {
padding: 8upx 20upx; padding: 8upx 20upx;
} }
.gray{
.gray {
background: #c3c3c3; background: #c3c3c3;
color: #f5f5f5; color: #f5f5f5;
} }
.pre-icon{
.pre-icon {
position: absolute; position: absolute;
top: -8upx; top: -8upx;
right: -10upx; right: -10upx;
display: flex; display: flex;
width: 64upx; width: 64upx;
z-index: 6; z-index: 6;
image{
image {
width: 100%; width: 100%;
max-height: 64upx; max-height: 64upx;
} }
} }
} }
} }
.package-list{
.package-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
...@@ -2300,30 +2480,36 @@ ...@@ -2300,30 +2480,36 @@
border-radius: 12upx; border-radius: 12upx;
margin-left: 20upx; margin-left: 20upx;
padding: 10upx 6upx; padding: 10upx 6upx;
.package-list-box{
.package-list-box {
position: relative; position: relative;
padding: 10upx 6upx; padding: 10upx 6upx;
.item{
.item {
padding: 8rpx 20rpx; padding: 8rpx 20rpx;
} }
.gray{
.gray {
background: #c3c3c3; background: #c3c3c3;
color: #f5f5f5; color: #f5f5f5;
} }
.pre-icon{
.pre-icon {
position: absolute; position: absolute;
top: -8upx; top: -8upx;
right: -10upx; right: -10upx;
display: flex; display: flex;
width: 64upx; width: 64upx;
z-index: 6; z-index: 6;
image{
image {
width: 100%; width: 100%;
max-height: 64upx; max-height: 64upx;
} }
} }
} }
} }
.item { .item {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -2333,10 +2519,11 @@ ...@@ -2333,10 +2519,11 @@
border-radius: 12upx; border-radius: 12upx;
border: 1px solid #CCD1DB; border: 1px solid #CCD1DB;
} }
.active{
.active {
border: 1px solid #e1419b; border: 1px solid #e1419b;
color: #FFFFFF; color: #FFFFFF;
background: linear-gradient(to right,#e03997,#ff375d); background: linear-gradient(to right, #e03997, #ff375d);
box-shadow: 0 0 8upx #ffffff inset; box-shadow: 0 0 8upx #ffffff inset;
} }
} }
...@@ -2405,13 +2592,16 @@ ...@@ -2405,13 +2592,16 @@
.line-black::after { .line-black::after {
border-color: transparent; border-color: transparent;
} }
.line-gray{
.line-gray {
border: 2px solid #c5c5c5; border: 2px solid #c5c5c5;
color: #c5c5c5; color: #c5c5c5;
} }
.line-gray::after { .line-gray::after {
border-color: transparent; border-color: transparent;
} }
.line-pink { .line-pink {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -2505,21 +2695,25 @@ ...@@ -2505,21 +2695,25 @@
text-align: center; text-align: center;
} }
} }
.relative{
.relative {
position: relative; position: relative;
.absolute{
.absolute {
position: absolute; position: absolute;
top: -1upx; top: -1upx;
left: 0upx; left: 0upx;
height: 100%; height: 100%;
.flex-col{
.flex-col {
position: absolute; position: absolute;
left: 0; left: 0;
bottom: 0; bottom: 0;
height: 150%; height: 150%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.saojiao{
.saojiao {
position: absolute; position: absolute;
top: -10px; top: -10px;
left: -15upx; left: -15upx;
...@@ -2532,7 +2726,8 @@ ...@@ -2532,7 +2726,8 @@
border-left-color: transparent; border-left-color: transparent;
border-right-color: transparent; border-right-color: transparent;
} }
.line{
.line {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
...@@ -2540,12 +2735,14 @@ ...@@ -2540,12 +2735,14 @@
height: 100%; height: 100%;
background: linear-gradient(180deg, #EFD12C, #DDC01E); background: linear-gradient(180deg, #EFD12C, #DDC01E);
} }
.text-sm{
.text-sm {
position: absolute; position: absolute;
top: -4px; top: -4px;
left: 10px; left: 10px;
width: 46upx; width: 46upx;
text{
text {
font-size: 20upx; font-size: 20upx;
color: #DFC224; color: #DFC224;
} }
...@@ -2566,7 +2763,8 @@ ...@@ -2566,7 +2763,8 @@
padding: 0 0 15upx; padding: 0 0 15upx;
overflow: hidden; overflow: hidden;
align-items: center; align-items: center;
.logo-box{
.logo-box {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
...@@ -2576,15 +2774,18 @@ ...@@ -2576,15 +2774,18 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 0; z-index: 0;
image{
image {
width: 402upx; width: 402upx;
height: 322upx; height: 322upx;
} }
} }
.flex-between{
.flex-between {
position: relative; position: relative;
z-index: 3; z-index: 3;
} }
.text-left { .text-left {
width: 120upx; width: 120upx;
text-align-last: justify; text-align-last: justify;
...@@ -2611,18 +2812,20 @@ ...@@ -2611,18 +2812,20 @@
.flex-row { .flex-row {
align-items: center; align-items: center;
} }
.vip-tag-box{
.vip-tag-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background: linear-gradient(to right, rgba(255,255,255,0.2), rgba(157,18,196,0.3)); background: linear-gradient(to right, rgba(255, 255, 255, 0.2), rgba(157, 18, 196, 0.3));
color: #9D1260; color: #9D1260;
font-size: 16upx; font-size: 16upx;
height: 34upx; height: 34upx;
border-radius: 18upx; border-radius: 18upx;
padding: 0 12upx; padding: 0 12upx;
margin-left: 6upx; margin-left: 6upx;
image{
image {
width: 22upx; width: 22upx;
max-height: 22upx; max-height: 22upx;
margin-right: 4upx; margin-right: 4upx;
...@@ -2671,7 +2874,8 @@ ...@@ -2671,7 +2874,8 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
color: #000000; color: #000000;
.amount{
.amount {
color: #e03997; color: #e03997;
} }
} }
...@@ -2706,13 +2910,15 @@ ...@@ -2706,13 +2910,15 @@
} }
} }
.select-datetime-box{ .select-datetime-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.bg-white{
.bg-white {
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
} }
.select-box { .select-box {
height: 420upx; height: 420upx;
background-color: #f1f1f1; background-color: #f1f1f1;
...@@ -2735,13 +2941,14 @@ ...@@ -2735,13 +2941,14 @@
.confirm-pop { .confirm-pop {
width: 100vw; width: 100vw;
.pop-content-box { .pop-content-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
// height: 700upx; // height: 700upx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0 2upx 38upx 0 rgba(0,0,0,0.27); box-shadow: 0 2upx 38upx 0 rgba(0, 0, 0, 0.27);
border-radius: 16upx 16upx 0rpx 0rpx; border-radius: 16upx 16upx 0rpx 0rpx;
.info-box { .info-box {
...@@ -2755,7 +2962,8 @@ ...@@ -2755,7 +2962,8 @@
background: #FFFFFF; background: #FFFFFF;
border-radius: 16rpx; border-radius: 16rpx;
border: 2px solid #8C8C8C; border: 2px solid #8C8C8C;
.info-store{
.info-store {
margin-top: -30upx; margin-top: -30upx;
width: 308upx; width: 308upx;
height: 60upx; height: 60upx;
...@@ -2764,33 +2972,38 @@ ...@@ -2764,33 +2972,38 @@
align-items: center; align-items: center;
z-index: 44; z-index: 44;
background: #FFFFFF; background: #FFFFFF;
.text-title{
.text-title {
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 36rpx;
// color: #E03997; // color: #E03997;
color: #333333; color: #333333;
} }
} }
.time-box{
.time-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
justify-content: center; justify-content: center;
width: 100%; width: 100%;
align-items: center; align-items: center;
margin: 30upx 0; margin: 30upx 0;
.part-1{
.part-1 {
position: relative; position: relative;
display: flex; display: flex;
flex: 1; flex: 1;
margin: 0 24upx; margin: 0 24upx;
height: 90upx; height: 90upx;
image{
image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.absolute{
.absolute {
position: absolute; position: absolute;
top:0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -2799,7 +3012,8 @@ ...@@ -2799,7 +3012,8 @@
align-items: center; align-items: center;
border: 6upx solid #E03997; border: 6upx solid #E03997;
border-radius: 47upx; border-radius: 47upx;
text{
text {
font-weight: 600; font-weight: 600;
font-size: 60upx; font-size: 60upx;
// color: #333333; // color: #333333;
...@@ -2807,17 +3021,20 @@ ...@@ -2807,17 +3021,20 @@
} }
} }
} }
text{
text {
font-weight: 600; font-weight: 600;
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
} }
} }
.info { .info {
width: 100%; width: 100%;
padding: 12upx 30upx; padding: 12upx 30upx;
font-size: 20upx; font-size: 20upx;
text{
text {
// font-weight: 600; // font-weight: 600;
// font-size: 32rpx; // font-size: 32rpx;
// color: #333333; // color: #333333;
...@@ -2831,7 +3048,8 @@ ...@@ -2831,7 +3048,8 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
padding: 32upx 28upx; padding: 32upx 28upx;
text{
text {
font-weight: 600; font-weight: 600;
font-size: 36upx; font-size: 36upx;
color: #333333; color: #333333;
...@@ -2867,12 +3085,13 @@ ...@@ -2867,12 +3085,13 @@
width: 100%; width: 100%;
padding: 0 5%; padding: 0 5%;
margin: 40upx 0; margin: 40upx 0;
.btn-close{
.btn-close {
width: 240upx; width: 240upx;
height: 64upx; height: 64upx;
border: 2upx solid; border: 2upx solid;
background: #F5F5F5; background: #F5F5F5;
box-shadow: 0 5upx 9upx 0 rgba(54,4,9,0.42); box-shadow: 0 5upx 9upx 0 rgba(54, 4, 9, 0.42);
border-image: linear-gradient(0deg, #9D9C9C, #DEDCDC) 2 2; border-image: linear-gradient(0deg, #9D9C9C, #DEDCDC) 2 2;
margin: 0 12upx; margin: 0 12upx;
font-weight: 600; font-weight: 600;
...@@ -2881,11 +3100,12 @@ ...@@ -2881,11 +3100,12 @@
border-radius: 6upx; border-radius: 6upx;
opacity: 0.95; opacity: 0.95;
} }
.btn-confirm{
.btn-confirm {
width: 240upx; width: 240upx;
height: 64upx; height: 64upx;
background: linear-gradient(97deg, #E5268B, #FD5661); background: linear-gradient(97deg, #E5268B, #FD5661);
box-shadow: 0 5upx 9upx 0 rgba(54,4,9,0.42); box-shadow: 0 5upx 9upx 0 rgba(54, 4, 9, 0.42);
border-radius: 6upx; border-radius: 6upx;
opacity: 0.95; opacity: 0.95;
margin: 0 12upx; margin: 0 12upx;
...@@ -2947,12 +3167,14 @@ ...@@ -2947,12 +3167,14 @@
} }
} }
} }
.card-use{
.card-use {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100%; width: 100%;
padding: 15upx 30upx; padding: 15upx 30upx;
.radio-group-box{
.radio-group-box {
width: 100%; width: 100%;
height: 0; height: 0;
margin-top: 15upx; margin-top: 15upx;
...@@ -2963,40 +3185,144 @@ ...@@ -2963,40 +3185,144 @@
box-shadow: 0 0 12upx transparent inset; box-shadow: 0 0 12upx transparent inset;
transition: all 0.5s; transition: all 0.5s;
overflow: hidden; overflow: hidden;
.radio-group{
.radio-group {
width: 100%; width: 100%;
margin: 20upx 0; margin: 20upx 0;
label{
height: 32px;
} }
.margin-right-sm{
margin-right: 14upx;
} }
.radio-group-box-height{ }
}
.radio-group-box-height {
height: auto; height: auto;
border-color: rgba(255, 170, 255, 0.8) ; border-color: rgba(255, 170, 255, 0.8);
box-shadow: 0 0 12upx rgba(255, 170, 255, 0.8) inset; box-shadow: 0 0 12upx rgba(255, 170, 255, 0.8) inset;
} }
.cuIcon-right{
.cuIcon-right {
transition: all 0.5s; transition: all 0.5s;
} }
} }
.activite-box{
.activite-box {
width: 92vw; width: 92vw;
border-radius: 20upx; border-radius: 20upx;
overflow: hidden; overflow: hidden;
image{
image {
display: block; display: block;
width: 100%; width: 100%;
min-height: 960upx; min-height: 960upx;
} }
} }
.close-btn{
.close-btn {
display: flex; display: flex;
justify-content: center; justify-content: center;
margin-top: 24upx; margin-top: 24upx;
.text-pink{
.text-pink {
font-size: 80upx; font-size: 80upx;
} }
} }
.show-more-pay-way{
.show-more-pay-way {
transform-origin: center center; transform-origin: center center;
transform: rotate(90deg); transform: rotate(90deg);
} }
.popup-recharge{
width: 540upx;
// height: 700upx;
background-color: #ffffff;
border-radius: 36upx;
overflow: hidden;
.recharge-content{
position: relative;
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
// height: 100%;
background: linear-gradient(0deg, rgba(255,255,255,0.65), rgba(255,214,241,0.43));
.close-btn{
position: absolute;
top: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
width: 42px;
height: 42px;
z-index: 10;
margin: 0;
.cuIcon-close{
font-size: 36upx;
}
}
.header-part{
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
padding-bottom: 32upx;
width: 470upx;
border-bottom: 1px dashed #C9CACA;
.text-title{
margin-top: 50upx;
font-size: 40upx;
}
.text-gray{
margin-top: 16upx;
font-size: 24upx;
}
}
.content-part{
display: flex;
flex-direction: column;
padding: 30upx 0 0;
width: 470upx;
.list-item{
margin: 14upx 0 14upx 18upx;
.recharge-icon{
display: block;
width: 44upx;
max-height: 46upx;
margin-right: 12upx;
}
.text-title{
color: #000000;
font-size: 30upx;
}
.text-pink{
color: #E40583;
font-size: 30upx;
}
}
.text-des-box{
display: flex;
justify-content: center;
align-items: center;
width: 423rpx;
font-size: 26upx;
color: #666666;
margin: 52upx auto 52upx;
}
.cu-btn{
width: 470upx;
height: 88upx;
background: #E40583;
border-radius: 44upx;
font-size: 38upx;
color: #FFFFFF;
font-weight: bold;
margin-bottom: 36upx;
}
}
}
}
</style> </style>
\ No newline at end of file
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