Commit 718b8cb1 by zhangzhen

细节优化

parent fa7436f0
......@@ -2,8 +2,8 @@ const CONFIG = {
// 开发环境配置
development: {
// assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
// assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
assetsPath: 'http://10.24.5.63:8211/static', // 静态资源路径
assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
// assetsPath: 'http://10.24.5.63:8211/static', // 静态资源路径
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
hostUrl: 'http://coujiao.pseer.com:8888/prod-api', // H5地址(前端运行地址)
......@@ -15,12 +15,12 @@ const CONFIG = {
},
// 生产环境配置
production: {
// assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
// baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
// hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
assetsPath: 'http://coujiao.pseer.com:8888/wechat_static', // 静态资源路径
// assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://coujiao.pseer.com/front-api', // 后台接口请求地址
// baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://coujiao.pseer.com/prod-api', // H5地址(前端运行地址)
// hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid
codeHeadUrl:"",
......
......@@ -61,20 +61,21 @@
</view>
<view v-for="(item,k) in dateList" :key="k" class="flex-1 flex-col date-item"
:class="{active:dateIndex === k}" @tap="onDateChange(k)">
<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">
<image :src="assetsPath+'/xx2.png'" mode="widthFix"></image>
</view>
</view>
<text class="text-title text-bold" style="margin-top: 12upx;">{{ item.date}}</text>
<view v-if="dateIndex === k && activityDate[item.readDate]" class="absolute-right">
<image :src="assetsPath+'/xx2.png'" mode="widthFix"></image>
</view>
</view>
</view>
</view>
......@@ -87,26 +88,32 @@
<view class="flex-row package-box">
<view v-if="roomLabelList.length" class="room-label-list">
<view v-for="(item,index) in roomLabelList" :key="index" class="room-label-box"
@tap="onChangePackage(index)">
<view class="item" :class="allDayUseStatus? 'gray': modeIndex===index?'active':''">
@tap="onChangePackage(index)">
<view class="item" :class="allDayUseStatus? 'gray': modeIndex===index?'active':''">
<text>{{item.labelName}}</text>
</view>
<view v-if="item.openPack==1 || (activityDate[dateList[dateIndex].readDate] && activityDate[dateList[dateIndex].readDate].labelIds.includes(item.labelId))" class="pre-icon">
<image :src="
<view
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].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 v-if="packageMode.length" class="flex-col package-list">
<view v-for="(item,index) in packageMode" :key="index" class="package-list-box"
@tap="onChangePackage2(index,item)">
@tap="onChangePackage2(index,item)">
<view class="item" :class=" !item.show? 'gray': modeIndex2===index?'active':''">
<text>{{item.name}}</text>
</view>
<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>
......@@ -169,22 +176,22 @@
:class=" item.status==2?'checked': item.tagStatus === 0 ?'free':item.tagStatus===1?'used':'error'">
</view>
<text class="text-gray">{{item.hour>=24? item.hour-24 : item.hour}}</text>
<view v-if="item.hour == 24" class="absolute">
<view class="flex-col">
<view class="saojiao">
</view>
<view class="line">
</view>
<view class="text-sm">
<text>次日</text>
</view>
</view>
</view>
</view>
</view>
</view>
......@@ -213,8 +220,38 @@
<text>/小时</text>
</view>
</view>
<view v-if="userInfo && (secondaryCardList.length || monthlyCardList.length)" class="flex-col card-use">
<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 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 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 class="flex-col card-use">
<view class="flex-between" @tap="onShowMorePayWay">
<text class="text-black text-left">钱包支付</text>
<view class="flex-row-center">
......@@ -222,128 +259,106 @@
</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 class="flex-1 flex-between">
<view class="flex-row-center">
<text>余额: <text class="text-pink text-bold">{{computePriceInfo.availableBalance}}</text> 可用</text>
</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" >
<radio class='pink radio' :class="radioChecked=='availableBalance'?'checked':''" value="availableBalance" :checked="radioChecked == 'availableBalance'?true:false" style="transform:scale(0.7)" />
</view>
</label > -->
<label v-if="monthlyCardList.length" class="flex-between" @tap="onRadioChange('monthlyCard')">
<radio-group class="radio-group">
<label v-if="monthlyCardList.length" class="flex-between" @tap="onRadioChange('monthlyCard')">
<view class="flex-row-center">
<text>{{monthlyCardList[0].confName}}:</text>
<text class="text-pink text-bold">{{monthlyCardList[0].freeDuration}}</text>
<text>小时可用</text>
</view>
<view class="flex-row-center">
<radio class='pink radio' :class="radioChecked=='monthlyCard'?'checked':''"
value="monthlyCard" :checked="radioChecked == 'monthlyCard'?true:false"
style="transform:scale(0.7)" />
</view>
</label>
<label v-if="secondaryCardList.length" class="flex-between" @tap="onRadioChange('secondaryCard')">
<view class="flex-row-center">
<text>{{secondaryCard.name}}:剩 <text
class="text-pink text-bold">{{secondaryCard.number}}</text> 次可用</text>
</view>
<view class="flex-row-center">
<radio class='pink radio' :class="radioChecked=='secondaryCard'?'checked':''"
value="secondaryCard" :checked="radioChecked=='secondaryCard'?true:false"
style="transform:scale(0.7)" />
</view>
</label>
<label class="flex-between" >
<view class="flex-1 flex-between">
<view class="flex-row-center">
<text>{{monthlyCardList[0].confName}}:</text>
<text class="text-pink text-bold">{{monthlyCardList[0].freeDuration}}</text>
<text>小时可用</text>
<text>可用余额: </text>
<text class="text-pink text-bold">{{computePriceInfo.availableBalance}}</text>
</view>
<view class="flex-row-center" >
<!-- <text>请选择</text> -->
<radio class='pink radio' :class="radioChecked=='monthlyCard'?'checked':''" value="monthlyCard" :checked="radioChecked == 'monthlyCard'?true:false" style="transform:scale(0.7)" />
<view class="flex-row-center margin-right-sm">
<!-- <text>{{userInfo.memberConfig.levelName}}: <textclass="text-pink text-bold">{{userInfo.memberConfig.discountRatio}}</text></text> -->
</view>
</label >
<label v-if="secondaryCardList.length" class="flex-between" @tap="onRadioChange('secondaryCard')">
</view>
<view class="flex-row-center">
<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>
</label>
<label v-if="computePriceInfo && computePriceInfo.availableDuration" class="flex-between" >
<view class="flex-1 flex-between">
<view class="flex-row-center">
<text>{{secondaryCard.name}}:剩 <text class="text-pink text-bold">{{secondaryCard.number}}</text> 次可用</text>
</view>
<view class="flex-row-center" >
<!-- <text>请选择</text> -->
<radio class='pink radio' :class="radioChecked=='secondaryCard'?'checked':''" value="secondaryCard" :checked="radioChecked=='secondaryCard'?true:false" style="transform:scale(0.7)" />
<text>可用时长: </text>
<text class="text-pink text-bold">{{Number(computePriceInfo.availableDuration).toFixed(1)}}小时</text>
</view>
</label >
<!-- <label v-if="computePriceInfo && computePriceInfo.availableDuration" class="flex-between" @tap="onRadioChange('availableDuration')">
<view class="flex-1 flex-between">
<view class="flex-row-center">
<text>时长: <text class="text-pink text-bold">{{Number(computePriceInfo.availableDuration).toFixed(1)}}</text>小时可用</text>
</view>
</view>
<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)" />
</view>
</label > -->
</radio-group>
</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>
</view>
</view>
<view class="flex-between price use-coupon-box">
<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>
</view>
<view class="flex-1 flex-row" @tap="onNavToSelectCoupon">
<text class="" :class="useCouponList.length?'text-pink':'text-gray'">
{{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: useCouponList.length? '请选择':'暂无可用'}}</text>
<text class="cuIcon-right " :class="useCouponList.length?'text-pink':'text-gray'"></text>
</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>
<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>
</view>
</view>
<view v-if="userInfo && computePriceInfo.duration" class="flex-between price">
</view> -->
<!-- <view v-if="userInfo && computePriceInfo.duration" class="flex-between price">
<text class="text-black text-left">时长抵扣</text>
<view class="flex-row">
<text class="text-pink text-lg text-bold">{{ Number(computePriceInfo.duration).toFixed(1)}}</text>
<text>小时</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 v-if="computePriceInfo.availableBalance" class="flex-between price">
</view> -->
<!-- <view v-if="computePriceInfo.availableBalance" class="flex-between price">
<text class="text-black text-left">可用余额</text>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.availableBalance}}</text>
</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>
<view class="flex-row">
<text class="text-pink"></text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.balance}}</text>
</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="flex-row">
......@@ -401,8 +416,8 @@
</view>
</view>
</uni-popup>
<uni-popup ref="popupActivite" type="center" isMaskClick="false">
<uni-popup ref="popupActivite" type="center" :isMaskClick="false">
<view class="flex-col">
<view class="activite-box">
<image :src="assetsPath+'/activite_1.jpg'" mode="widthFix"></image>
......@@ -412,6 +427,40 @@
</view>
</view>
</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">
<view class="confirm-pop">
......@@ -424,7 +473,7 @@
<view class="info-store">
<text class="text-title">凑角{{roomInfo.storeName|| ''}}</text>
</view>
<view class="flex-row time-box">
<view class="part-1">
<!-- <image :src="assetsPath+'/time_bg_icon.png'" mode="widthFix"></image> -->
......@@ -440,38 +489,40 @@
</view>
</view>
</view>
<view class="info flex-row-center">
<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 v-if="Number(computePriceInfo.balance) > 0" class="info flex-row-center">
<text class="text-black text-bold text-lg">余额抵扣:</text>
<text class="margin-left text-lg"></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 class="info flex-row-center">
<text class="text-black text-bold text-lg">待支付:</text>
<text class="margin-left text-lg"></text>
<text class=" text-xl ">{{Number(computePriceInfo.payFee).toFixed(2)}}</text>
</view>
</view>
<view class="footer-btn-box">
<button class="cu-btn block btn-close" @tap="onCancle">关闭</button>
<button class="cu-btn block btn-confirm" @tap="onOrder">确定</button>
</view>
</view>
</view>
......@@ -480,11 +531,14 @@
<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 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>
</view>
</template>
......@@ -497,7 +551,8 @@
dictList
} from "@/api/index.js";
import {
getDictItem,getSysConfigValue
getDictItem,
getSysConfigValue
} from "@/utils/tools.js"
import {
getStoreActivity,
......@@ -514,7 +569,10 @@
orderCancelPay,
queryCardUse
} from "@/api/order"
import {
rechargeConf
} from "@/api/recharge.js";
export default {
components: {
LoginPop
......@@ -530,7 +588,7 @@
images: [],
status: 0
},
userInfo: uni.getStorageSync("userInfo")||'',
userInfo: uni.getStorageSync("userInfo") || '',
startTime: moment().format("HH:mm"),
endTime: '',
dateIndex: 0,
......@@ -591,7 +649,7 @@
],
durationIndex2: [0],
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: {
1: "预定",
2: "续费",
......@@ -628,41 +686,43 @@
0: "待保洁",
1: "保洁中"
},
formatAllData:{
list:[]
formatAllData: {
list: []
},
orderInfo:{},
tempPackageIndex:0,
orderInfo: {},
tempPackageIndex: 0,
// 临时存放开始时间 结束时间 时长
tempDateObj:{},
orderDateDes:"",
orderWeekDes:"",
orderWeeEnum:{
1:"周一",
2:"周二",
3:"周三",
4:"周四",
5:"周五",
6:"周六",
0:"周日",
tempDateObj: {},
orderDateDes: "",
orderWeekDes: "",
orderWeeEnum: {
1: "周一",
2: "周二",
3: "周三",
4: "周四",
5: "周五",
6: "周六",
0: "周日",
},
allDayUseStatus: false, // 当日无可预约时段,true 无法预约,false 可预约
tipContent: "当前条件下无可预约的时段,请手动选择合适的空闲时段",
tipErrMsg: '',
warnTip:'',
activityDate:{},
storeCleanDuration: getSysConfigValue('StoreCleanDuration')? Number(getSysConfigValue('StoreCleanDuration')):30,
radioChecked:'',
monthlyCardList:[],
secondaryCardList:[],
secondaryCard:{
warnTip: '',
activityDate: {},
storeCleanDuration: getSysConfigValue('StoreCleanDuration') ? Number(getSysConfigValue(
'StoreCleanDuration')) : 30,
radioChecked: '',
monthlyCardList: [],
secondaryCardList: [],
secondaryCard: {
status: 0,
number: 0,
name:'次卡'
name: '次卡'
},
submitBtnStatus:false,
submitBtnStatus: false,
showMorePayWay: true,
couponExpireTip:false,//是否进行优惠券过期提醒
couponExpireTip: false, //是否进行优惠券过期提醒
rechargeConfList: [],
};
},
filters: {
......@@ -685,7 +745,7 @@
}
},
onLoad(option) {
if(!uni.getStorageSync('activite')){
if (!uni.getStorageSync('activite')) {
this.$refs.popupActivite.open()
}
uni.showLoading({
......@@ -696,7 +756,7 @@
this.onGetDicts();
this.id = option.roomId;
if (option.orderNo) {
if(option.modeIndex){
if (option.modeIndex) {
this.modeIndex = Number(option.modeIndex);
}
this.orderType = 2;
......@@ -710,22 +770,43 @@
this.onLoading()
this.distanceIndex = 0
}
this.onGetRechargeConf();
},
onShow() {
if(this.rechargeConfList.length){
this.userInfo = uni.getStorageSync("userInfo") || '';
this.onComputePrice();
}
},
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
},
onActiviteClose(){
onActiviteClose() {
this.$refs.popupActivite.close();
uni.setStorageSync('activite',true)
uni.setStorageSync('activite', true)
},
onRadioChange(e){
if(this.radioChecked === e){
onRadioChange(e) {
if (this.radioChecked === e) {
this.radioChecked = ''
if(this.useCouponList && this.useCouponList.length){
if (this.useCouponList && this.useCouponList.length) {
this.selectCouponIndex = 0;
}
}else{
} else {
this.radioChecked = e
this.selectCouponIndex = -1;
}
......@@ -733,9 +814,9 @@
},
// 日期切换
onDateChange(k) {
if (this.dateIndex === k || this.orderType ==2) return;
if (this.dateIndex === k || this.orderType == 2) return;
this.dateIndex = k;
if(this.modeIndex<0){
if (this.modeIndex < 0) {
this.modeIndex = 0;
this.modeIndex2 = -1;
}
......@@ -743,17 +824,17 @@
this.onGetSortDistance()
},
// 小时标签切换
onChangePackage(index){
if(this.modeIndex == index || this.allDayUseStatus) return;
onChangePackage(index) {
if (this.modeIndex == index || this.allDayUseStatus) return;
let startDateTime = ''
if(this.orderType ==2){
if (this.orderType == 2) {
startDateTime = this.orderInfo.endDate
if(this.orderInfo.status ==2){
if (this.orderInfo.status == 2) {
startDateTime = moment().format("YYYY-MM-DD HH:mm:00")
}
}
this.modeIndex = index
this.modeIndex2 = -1
this.formatAllData = this.onTransiteForDate({
......@@ -762,93 +843,101 @@
duration: this.roomLabelList[this.modeIndex].labelDuration,
});
},
onPackageCheck(){
onPackageCheck() {
this.onCancleTip();
this.modeIndex = -1
this.modeIndex2 = this.tempPackageIndex
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: this.tempDateObj.startDate,
duration: this.tempDateObj.duration,
durationType:this.tempDateObj.durationType
durationType: this.tempDateObj.durationType
});
},
// 套餐校验,检查当前套餐是否可用
onCheckPackageUse(valData){
let useStatus = true;
let startStr = `${this.dateList[this.dateIndex].readDate} ${Number(valData.packaStartPeriod)>= 10 ?valData.packaStartPeriod: '0'+valData.packaStartPeriod}:00:00`
onCheckPackageUse(valData) {
let useStatus = true;
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 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");
// 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段
let pointDateForm = moment(this.dateList[this.dateIndex].readDate).format("YYYY-MM-DD 11:00:00");
let dateTimeObj = {};
if(moment(endDate).valueOf() < moment(pointDateForm).valueOf()){
if(this.orderType == 2){
if (moment(endDate).valueOf() < moment(pointDateForm).valueOf()) {
if (this.orderType == 2) {
// 1.确定续套餐的结束时间
let orderEndDate = ''
if(this.orderInfo.status ==1){
if (this.orderInfo.status == 1) {
orderEndDate = moment(this.orderInfo.endDate).valueOf()
} else{
} else {
orderEndDate = moment().valueOf()
}
startDate = moment(orderEndDate).format(`YYYY-MM-DD 0${valData.packaStartPeriod}:00:00`);
endDate = moment(orderEndDate).format(`YYYY-MM-DD 0${valData.packaEndPeriod}:00:00`);
endDate = moment(orderEndDate).format(`YYYY-MM-DD 0${valData.packaEndPeriod}:00:00`);
// 续夜宵套餐时的开始时间必须在设定的开始和结束时间内
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;
}
}else{
} else {
//通宵套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate);
dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 实际时长小于原时长的60%则选择明天的时间
// 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf()
if( actualTime < originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate, 4)) {
// 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if(this.dateIndex != 0){
if (this.dateIndex != 0) {
useStatus = false;
return
}
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")
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate);
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")
dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 实际时间
actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf()
if( actualTime < originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){
useStatus = false;
actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate,
4)) {
useStatus = false;
return
}
}
}
}
} else {
if(this.orderType == 2){
if(!(moment(this.orderInfo.endDate).valueOf() >= moment(startDate).valueOf() && moment(this.orderInfo.endDate).valueOf() <= moment(endDate).valueOf())){
if (this.orderType == 2) {
if (!(moment(this.orderInfo.endDate).valueOf() >= moment(startDate).valueOf() && moment(this
.orderInfo.endDate).valueOf() <= moment(endDate).valueOf())) {
useStatus = false;
}
return
}
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
// 闲时套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate);
dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf()
if( actualTime < originTime*0.6 || this.onCheckPackUse(startDate,endDate)){
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
if (actualTime < originTime * 0.6 || this.onCheckPackUse(startDate, endDate)) {
useStatus = false;
return
}
......@@ -856,219 +945,241 @@
return useStatus
},
// 套餐切换
onChangePackage2(index,val){
if(this.modeIndex2 == index || !val.show) return;
onChangePackage2(index, val) {
if (this.modeIndex2 == index || !val.show) return;
this.tempPackageIndex = index;
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 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");
// 如果此套餐的结束时间在11点前,则为通宵套餐,会在当天及明天进行找合适的时间段,否则则没有合适的套餐时段
let pointDateForm = moment(this.dateList[this.dateIndex].readDate).format("YYYY-MM-DD 11:00:00");
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")
if(this.orderInfo.status ==1){
if (this.orderInfo.status == 1) {
orderEndDate = this.orderInfo.endDate
}
startDate = moment(orderEndDate).format(`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`);
startDate = moment(orderEndDate).format(
`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( moment(endDate).valueOf() - moment(orderEndDate).valueOf()>=3*60*60*1000 && moment(endDate).valueOf()-moment(orderEndDate).valueOf() < 4*60*60*1000){
if (b1) {
if (moment(endDate).valueOf() - moment(orderEndDate).valueOf() >= 3 * 60 * 60 * 1000 && moment(
endDate).valueOf() - moment(orderEndDate).valueOf() < 4 * 60 * 60 * 1000) {
this.tempDateObj = {
startDate: orderEndDate,
endDate: endDate,
duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf())/60000,
durationType:2
endDate: endDate,
duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf()) / 60000,
durationType: 2
}
this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open();
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.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({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: orderEndDate,
endDateTime: endDate,
duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf())/60000,
durationType:2
duration: (moment(endDate).valueOf() - moment(orderEndDate).valueOf()) / 60000,
durationType: 2
});
}else{
} else {
}
}
}else{
//否则是订单
// 通宵套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate);
// 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf()
// 原时长是9个小时,减去4个小时, 低于5个小时,则时长不足
if( actualTime< originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){
// 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if(this.dateIndex != 0 ){
uni.showToast({
icon:"none",
title:'可使用时长不足,请选择其他日期'
})
}else{
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");
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate);
// 实际时间
actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf()
if( actualTime < originTime - 4*60*60*1000 || this.onCheckPackUse(startDate,endDate,4)){
uni.showToast({
icon:"none",
title:'可使用时长不足,请选择其他日期'
})
return
}else if(actualTime < originTime - 3*60*60*1000 && actualTime >= originTime - 4*60*60*1000){
this.tempDateObj = {
startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate,
duration: actualTime/60000,
durationType:2
} else {
//否则是订单
// 通宵套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
// 原时长是9个小时,减去4个小时, 低于5个小时,则时长不足
if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate, 4)) {
// 实际时长小于原时长的60%则选择明天的时间
// 加一天时间重新计算
if (this.dateIndex != 0) {
uni.showToast({
icon: "none",
title: '可使用时长不足,请选择其他日期'
})
} else {
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");
dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 实际时间
actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
if (actualTime < originTime - 4 * 60 * 60 * 1000 || this.onCheckPackUse(startDate, endDate,
4)) {
uni.showToast({
icon: "none",
title: '可使用时长不足,请选择其他日期'
})
return
} else if (actualTime < originTime - 3 * 60 * 60 * 1000 && actualTime >= originTime - 4 *
60 * 60 * 1000) {
this.tempDateObj = {
startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate,
duration: actualTime / 60000,
durationType: 2
}
this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open();
return
} else {
this.modeIndex = -1
this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj
.tempStartDate).valueOf()) / 1000 / 60;
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate,
duration,
durationType: 2
});
}
this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open();
return
}else{
this.modeIndex = -1
this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf()-moment(dateTimeObj.tempStartDate).valueOf())/1000/60;
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate,
duration,
durationType:2
});
}
} else if (actualTime < originTime - 3 * 60 * 60 * 1000 && actualTime >= originTime - 4 * 60 * 60 *
1000) {
this.tempDateObj = {
startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate,
duration: actualTime / 60000,
durationType: 2
}
this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open();
return
} else {
this.modeIndex = -1
this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()) / 1000 / 60;
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate,
duration,
durationType: 2
});
}
} else if( actualTime < originTime - 3*60*60*1000 && actualTime >= originTime - 4*60*60*1000){
this.tempDateObj = {
startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate,
duration: actualTime/60000,
durationType:2
}
this.warnTip = '通宵套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open();
return
}else{
this.modeIndex = -1
this.modeIndex2 = index
let duration = (moment(dateTimeObj.tempEndDate).valueOf()-moment(dateTimeObj.tempStartDate).valueOf())/1000/60;
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate,
duration,
durationType:2
});
}
}
} else {
// 如果此套餐的结束时间在12点后,则为闲时套餐,仅查看今日日否有合适的套餐
dateTimeObj = this.onComputeStartDateAndEndDate(startDate,endDate);
dateTimeObj = this.onComputeStartDateAndEndDate(startDate, endDate);
// 原时间
let originTime = moment(endDate).valueOf() - moment(startDate).valueOf()
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate).valueOf()
if( actualTime< originTime*0.6 || this.onCheckPackUse(startDate,endDate)){
// 实际时间
let actualTime = moment(dateTimeObj.tempEndDate).valueOf() - moment(dateTimeObj.tempStartDate)
.valueOf()
if (actualTime < originTime * 0.6 || this.onCheckPackUse(startDate, endDate)) {
uni.showToast({
icon:"none",
title:'可使用时长不足,请选择其他日期'
icon: "none",
title: '可使用时长不足,请选择其他日期'
})
return
} else if(actualTime < originTime*0.8 && actualTime >= originTime*0.6){
} else if (actualTime < originTime * 0.8 && actualTime >= originTime * 0.6) {
this.tempDateObj = {
startDate: dateTimeObj.tempStartDate,
endDate: dateTimeObj.tempEndDate,
duration: actualTime/60000,
durationType:2
endDate: dateTimeObj.tempEndDate,
duration: actualTime / 60000,
durationType: 2
}
this.warnTip = '闲时套餐,不足4小时,是否预定?'
this.$refs.popupDialog.open();
return
}else{
} else {
this.modeIndex = -1
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({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: dateTimeObj.tempStartDate,
endDateTime: dateTimeObj.tempEndDate,
duration,
durationType:2
durationType: 2
});
}
}
},
// 通过指定时间在当前时间段内查询合适的时间段
onComputeStartDateAndEndDate(startDate,endDate){
onComputeStartDateAndEndDate(startDate, endDate) {
//重新设置开始时间和结束时间
let tempStartDate = '';
let tempEndDate = '';
let startNeedChange = 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 end = moment(moment(item.timeHour).format("YYYY-MM-DD HH:59:59")).valueOf()
if( start < moment(endDate).valueOf() && start >= moment(startDate).valueOf()){
if(tempStartDate && !startNeedChange){
if(item.status ==0 && endNeedChange){
if (start < moment(endDate).valueOf() && start >= moment(startDate).valueOf()) {
if (tempStartDate && !startNeedChange) {
if (item.status == 0 && endNeedChange) {
endNeedChange = true;
tempEndDate = moment(item.timeHour+':59:00').add(1,"m").format("YYYY-MM-DD HH:mm:00")
} else if(item.status ==1 && endNeedChange){
tempEndDate = moment(item.timeHour + ':59:00').add(1, "m").format(
"YYYY-MM-DD HH:mm:00")
} else if (item.status == 1 && endNeedChange) {
endNeedChange = false;
tempEndDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00")
}
}else{
if(item.status == 0 && startNeedChange){
} else {
if (item.status == 0 && startNeedChange) {
tempStartDate = moment(item.timeHour).format("YYYY-MM-DD HH:00:00")
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;
tempStartDate = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00")).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")
}else if(item.status ==1 && !this.onCheckHourUse(item.startHoldTime,item.endHoldTime) && startNeedChange){
tempStartDate = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00"))
.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")
} else if (item.status == 1 && !this.onCheckHourUse(item.startHoldTime, item
.endHoldTime) && startNeedChange) {
startNeedChange = false;
let tempStart = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00")).format("YYYY-MM-DD HH:mm:00")
tempStartDate = this.orderType ==1? moment(tempStart).add(1,'m') : tempStart
let tempStart = moment(moment(item.endHoldTime).format("YYYY-MM-DD HH:mm:00"))
.format("YYYY-MM-DD HH:mm:00")
tempStartDate = this.orderType == 1 ? moment(tempStart).add(1, 'm') : tempStart
}
}
}
......@@ -1080,80 +1191,84 @@
}
},
// 通过指定时长在当前时间段内查询合适的时间段
onComputeByDuration(duration,durationType=1){
onComputeByDuration(duration, durationType = 1) {
//重新设置开始时间和结束时间
let m = Number(duration)*60;
let m = Number(duration) * 60;
if (durationType === 2) {
m = Number(duration)
}
// 把时长计算成毫秒数
let timeStampLong = m*60*1000;
let timeStampLong = m * 60 * 1000;
let tempStartDate = '';
let tempEndDate = '';
let startNeedChange = true;
let endNeedChange = true;
this.dateIntervalList.forEach((item,k) => {
if(k<24){
if(item.status == 1 && startNeedChange && this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){
tempStartDate = moment(item.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00")
this.dateIntervalList.forEach((item, k) => {
if (k < 24) {
if (item.status == 1 && startNeedChange && this.onCheckHourUse(item.startHoldTime, item
.endHoldTime)) {
tempStartDate = moment(item.endHoldTime).add(1, 'm').format("YYYY-MM-DD HH:mm:00")
startNeedChange = true
endNeedChange = true;
}
if(item.status == 1 && startNeedChange && !this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){
tempStartDate = moment(item.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00")
if (item.status == 1 && startNeedChange && !this.onCheckHourUse(item.startHoldTime, item
.endHoldTime)) {
tempStartDate = moment(item.endHoldTime).add(1, 'm').format("YYYY-MM-DD HH:mm:00")
startNeedChange = false
endNeedChange = true;
}
if(item.status == 0 && startNeedChange){
if (item.status == 0 && startNeedChange) {
tempStartDate = moment(item.timeHour).format("YYYY-MM-DD HH:00:00")
startNeedChange = false
endNeedChange = true;
}
}
}
if(item.status == 1 && endNeedChange && tempStartDate){
let endDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00")
if( moment(endDate).valueOf() >= moment(tempStartDate).valueOf()){
tempEndDate = endDate
if( moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong){
if (item.status == 1 && endNeedChange && tempStartDate) {
let endDate = moment(item.startHoldTime).format("YYYY-MM-DD HH:mm:00")
if (moment(endDate).valueOf() >= moment(tempStartDate).valueOf()) {
tempEndDate = endDate
if (moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong) {
startNeedChange = false;
endNeedChange = false;
} else {
if (k < 24) {
tempStartDate = moment(item.endHoldTime).add(1, 'm').format(
"YYYY-MM-DD HH:mm:00")
startNeedChange = true;
} else {
startNeedChange = false;
endNeedChange = false;
}else{
if(k <24 ){
tempStartDate = moment(item.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00")
startNeedChange = true;
}else{
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")
if( moment(endDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong){
endNeedChange = false;
tempEndDate = moment(moment(tempStartDate).valueOf()+timeStampLong).format("YYYY-MM-DD HH:mm:00")
}else{
if (moment(endDate).valueOf() - moment(tempStartDate).valueOf() >= timeStampLong) {
endNeedChange = false;
tempEndDate = moment(moment(tempStartDate).valueOf() + timeStampLong).format(
"YYYY-MM-DD HH:mm:00")
} else {
endNeedChange = true;
}
}
})
let params = {
startDateTime:tempStartDate,
startDateTime: tempStartDate,
endDateTime: tempEndDate,
useStatus: moment(tempEndDate).valueOf() - moment(tempStartDate).valueOf() < timeStampLong
}
if(this.modeIndex == 0 && params.useStatus){
if (this.modeIndex == 0 && params.useStatus) {
// 当前日期,全天可用状态 true 不可用,false 还有可用时段;
this.allDayUseStatus = true;
this.tipErrMsg = "当前日期,空闲时间不足,请选择其他日期"
......@@ -1219,30 +1334,30 @@
onGetOrderInfo() {
getOrderInfoByNo(this.preOrderNo).then(res => {
if (res.data.code == 200) {
this.orderInfo = res.data.data;
this.orderInfo = res.data.data;
this.id = this.orderInfo.roomId;
this.onLoading();
}
})
},
onGetStoreActivity(){
onGetStoreActivity() {
getStoreActivity({
storeId: this.id
}).then(res=>{
if(res.data.code ==200 && res.data.data){
}).then(res => {
if (res.data.code == 200 && 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")
if(obj[key] && obj[key].length){
if (obj[key] && obj[key].length) {
this.activityDate[key2] = {
labelIds: obj[key].filter(item=> item.labelId).map(val => val.labelId),
packIds: obj[key].filter(item=> item.packId).map(val => val.packId),
labelIds: obj[key].filter(item => item.labelId).map(val => val.labelId),
packIds: obj[key].filter(item => item.packId).map(val => val.packId),
}
}else{
} else {
this.activityDate[key2] = false
}
}
}
})
......@@ -1268,7 +1383,7 @@
this.packageMode = [];
this.packList = this.roomInfo.packList;
// this.modeIndex = 0;
}
}
if (this.roomInfo.roomLabelList && this.roomInfo.roomLabelList.length) {
this.roomLabelList = this.roomInfo.roomLabelList
}
......@@ -1285,13 +1400,13 @@
roomId: this.roomInfo.id,
day: this.dateList[this.dateIndex].readDate,
orderType: this.orderType,
orderId: this.orderType==2? this.orderInfo.id : ""
orderId: this.orderType == 2 ? this.orderInfo.id : ""
}).then(res => {
uni.hideLoading()
this.dateIntervalList = res.data.data.map((item, index) => {
let status = item.status;
if(status ==1){
if(!this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){
if (status == 1) {
if (!this.onCheckHourUse(item.startHoldTime, item.endHoldTime)) {
status = 0
}
}
......@@ -1301,18 +1416,18 @@
hour: index
}
})
this.packageMode = this.packList.map(item=>{
this.packageMode = this.packList.map(item => {
return {
...item,
show: this.onCheckPackageUse(item)
}
})
let startDateTime = ''
if(this.orderType ==2){
if (this.orderType == 2) {
startDateTime = this.orderInfo.endDate
if(this.orderInfo.status ==2){
if (this.orderInfo.status == 2) {
startDateTime = moment().format("YYYY-MM-DD HH:mm:00")
}
}
......@@ -1331,26 +1446,30 @@
preStartDate: p != null ? p.startDateTime : this.formatAllData.startDateTime,
preEndDate: p != null ? p.endDateTime : this.formatAllData.endDateTime,
orderType: this.orderType,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex>=0 && this.roomLabelList.length && this.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 : '',
orderMode: this.modeIndex2 >= 0 || (this.modeIndex >= 0 && this.roomLabelList.length && this
.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 : ''
}).then(res => {
this.couponExpireTip = false;
if (res.data.code == 200) {
if (res.data && res.data.data.length) {
this.useCouponList = res.data.data ;
this.useCouponList = res.data.data;
let i = this.useCouponList.findIndex(item => {
if(item.isAvailable ===0){
if(moment(item.endDate).valueOf() - moment().valueOf() < 7*24*3600*1000){
if (item.isAvailable === 0) {
if (moment(item.endDate).valueOf() - moment().valueOf() < 7 * 24 *
3600 * 1000) {
this.couponExpireTip = true
}
}
return item.isAvailable ===0
return item.isAvailable === 0
})
this.selectCouponIndex = i>=0? i: -1;
}else{
this.selectCouponIndex = i >= 0 ? i : -1;
} else {
this.selectCouponIndex = -1;
}
this.onQueryCardUse();
......@@ -1367,7 +1486,8 @@
events: {
getSelectData(data) {
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 = ''
} else {
that.selectCouponIndex = -1
......@@ -1380,104 +1500,122 @@
orderType: that.orderType,
storeId: that.roomInfo.storeId,
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,
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 : '',
roomLabelId: that.modeIndex >= 0 ? that.roomLabelList[that.modeIndex].id : '',
selectId: that.selectCouponIndex >= 0 && that.useCouponList.length ? that.useCouponList[that.selectCouponIndex].id : ''
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 : '',
roomLabelId: that.modeIndex >= 0 ? that.roomLabelList[that.modeIndex].id :
'',
selectId: that.selectCouponIndex >= 0 && that.useCouponList.length ? that
.useCouponList[that.selectCouponIndex].id : ''
})
}
})
}
},
onQueryCardUse(){
if(this.userInfo && (this.userInfo.monthlyCardList || this.userInfo.secondaryCardList)){
onQueryCardUse() {
if (this.userInfo && (this.userInfo.monthlyCardList || this.userInfo.secondaryCardList)) {
let params = {
storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id,
orderType: this.orderType,
storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id,
orderType: this.orderType,
preStartDate: this.formatAllData.startDateTime,
preEndDate: this.formatAllData.endDateTime,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1)? 1 : 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 : '',
roomLabelId : this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '',
}
preEndDate: this.formatAllData.endDateTime,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex >= 0 && this.roomLabelList.length && this
.roomLabelList[this.modeIndex].openPack == 1) ? 1 : 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 : '',
roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : '',
}
queryCardUse(params).then(res => {
if(res.data.code == 200){
if(res.data.data && res.data.data.consumerMonthlyCard && res.data.data.consumerMonthlyCard.length){
if (res.data.code == 200) {
if (res.data.data && res.data.data.consumerMonthlyCard && res.data.data
.consumerMonthlyCard.length) {
this.radioChecked = "monthlyCard";
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.selectCouponIndex = -1;
}else{
} else {
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
}else{
} else {
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
if(this.secondaryCardList && this.secondaryCardList.length){
if (this.secondaryCardList && this.secondaryCardList.length) {
this.secondaryCard.status = 1;
let num = 0;
this.secondaryCardList.forEach(val => {
num+=val.number;
num += val.number;
this.secondaryCard.name = val.confName;
})
this.secondaryCard.number = num;
}
}else{
} else {
this.secondaryCardList = [];
}
this.onComputePrice();
}
})
}else{
} else {
this.onComputePrice();
}
},
//计算支付金额
onComputePrice() {
let params = {
storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id,
buyType: this.orderTypeList[this.index].type,
couponId: this.useCouponList.length && this.selectCouponIndex >= 0 && !this.radioChecked ? this.useCouponList[this.selectCouponIndex].id : '',
orderType: this.orderType,
preStartDate:this.formatAllData.startDateTime,
preEndDate: this.formatAllData.endDateTime,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex>=0 && this.roomLabelList.length && this.roomLabelList[this.modeIndex].openPack==1)? 1 : 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 : '',
roomLabelId :this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : ''
}
if(this.radioChecked == "secondaryCard" && this.secondaryCardList.length){
storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id,
buyType: this.orderTypeList[this.index].type,
couponId: this.useCouponList.length && this.selectCouponIndex >= 0 && !this.radioChecked ? this
.useCouponList[this.selectCouponIndex].id : '',
orderType: this.orderType,
preStartDate: this.formatAllData.startDateTime,
preEndDate: this.formatAllData.endDateTime,
orderMode: this.modeIndex2 >= 0 || (this.modeIndex >= 0 && this.roomLabelList.length && this
.roomLabelList[this.modeIndex].openPack == 1) ? 1 : 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 : '',
roomLabelId: this.modeIndex >= 0 ? this.roomLabelList[this.modeIndex].id : ''
}
if (this.radioChecked == "secondaryCard" && this.secondaryCardList.length) {
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
}
computePrice(params).then(res => {
// uni.hideLoading()
if (res.data.code == 200) {
let obj = res.data.data
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();
if(discountText.length ==2){
if (discountText.length == 2) {
discountText = obj.discount;
}
}
......@@ -1506,50 +1644,50 @@
},
// 开始选择时间
onSelectDate() {
if(this.orderType==1 && this.modeIndex >= 0 && !this.allDayUseStatus){
this.hourList = [
"00",
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23"
];
if (this.dateIndex === 0) {
let h = Number(moment().format("HH"))
this.hourList = this.hourList.filter(item => Number(item) >= Number(h));
}
this.checkedDateList = this.formatAllData.startTime.split(":").map((item,index) => {
let n = 0
if(index == 0){
n = this.hourList.findIndex(val => Number(val) == Number(item))
} else if(index ==1 && Number(item)%5 == 0) {
n = this.minuteList.findIndex(val => Number(val) == Number(item))
}
return n
})
this.$refs.popup.open();
}
if (this.orderType == 1 && this.modeIndex >= 0 && !this.allDayUseStatus) {
this.hourList = [
"00",
"01",
"02",
"03",
"04",
"05",
"06",
"07",
"08",
"09",
"10",
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23"
];
if (this.dateIndex === 0) {
let h = Number(moment().format("HH"))
this.hourList = this.hourList.filter(item => Number(item) >= Number(h));
}
this.checkedDateList = this.formatAllData.startTime.split(":").map((item, index) => {
let n = 0
if (index == 0) {
n = this.hourList.findIndex(val => Number(val) == Number(item))
} else if (index == 1 && Number(item) % 5 == 0) {
n = this.minuteList.findIndex(val => Number(val) == Number(item))
}
return n
})
this.$refs.popup.open();
}
},
// 切换时间
......@@ -1564,8 +1702,8 @@
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: `${this.dateList[this.dateIndex].readDate} ${startTime}:00`,
duration: this.roomLabelList[this.modeIndex].labelDuration
},false);
duration: this.roomLabelList[this.modeIndex].labelDuration
}, false);
this.$forceUpdate();
this.onHideModal();
},
......@@ -1598,18 +1736,24 @@
this.submitBtnStatus = false
},
onOrderConfirmBefore() {
if(this.formatAllData.useStatus){
if (this.formatAllData.useStatus) {
uni.showToast({
icon:"none",
title:"所选时段有被占用,请选择其他空闲时段"
icon: "none",
title: "所选时段有被占用,请选择其他空闲时段"
})
return;
}
if(this.submitBtnStatus) return
if (this.submitBtnStatus) return
this.submitBtnStatus = true;
if(this.orderType ===1 && !uni.getStorageSync('rechargeTip')) {
this.$refs.popupRecharge.open();
return
}
wx.requestSubscribeMessage({
tmplIds: [
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg',
......@@ -1622,6 +1766,21 @@
}
})
},
onNavToCreateOrder(){
this.$refs.popupRecharge.close();
uni.setStorageSync('rechargeTip',true)
wx.requestSubscribeMessage({
tmplIds: [
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg',
],
success: (res) => {
},
complete: (res) => {
this.onOrderConfirm();
}
})
},
onOrderConfirm() {
if (this.roomInfo.roomStat >= 3) {
uni.showToast({
......@@ -1641,7 +1800,7 @@
let nowDate = moment().valueOf();
let setDate = moment(this.formatAllData.startDateTime).valueOf();
// 如果当前时间大于开始时间,则不允许下单
if ( this.orderType == 1 && nowDate > setDate ) {
if (this.orderType == 1 && nowDate > setDate) {
uni.showToast({
icon: "none",
title: "当前时间晚于预约开始时间,请重新选择预约时间"
......@@ -1658,7 +1817,7 @@
this.submitBtnStatus = false;
return
}
this.orderDateDes = moment(this.formatAllData.startDateTime).format("YYYY年MM月DD日")
this.orderWeekDes = moment(this.formatAllData.startDateTime).days();
this.$refs.confirmPop.open();
......@@ -1690,18 +1849,23 @@
orderType: this.orderType,
buyType: this.orderTypeList[this.index].type,
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,
preEndDate: this.formatAllData.endDateTime,
totalFee: this.computePriceInfo.totalFee || 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 : '',
discountRatio: this.computePriceInfo.discountRatio,
balance: this.computePriceInfo.balance,
duration: this.computePriceInfo.duration,
secondaryCardId: this.userInfo && this.userInfo.secondaryCardList && this.secondaryCardList.length && this.radioChecked==='secondaryCard' ? this.secondaryCardList[0].id:'',
monthlyCardId: this.userInfo && this.userInfo.monthlyCardList && this.monthlyCardList.length && this.radioChecked==='monthlyCard'? this.monthlyCardList[0].id:''
secondaryCardId: this.userInfo && this.userInfo.secondaryCardList && this.secondaryCardList
.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) {
params.preOrderNo = this.preOrderNo
......@@ -1801,7 +1965,7 @@
})
},
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) {
uni.showToast({
icon: "none",
......@@ -1810,10 +1974,10 @@
return
}
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")
}else if(val.endHoldTime && !this.onCheckHourUse(val.startHoldTime, val.endHoldTime)){
startDate = moment(val.endHoldTime).add(1,'m').format("YYYY-MM-DD HH:mm:00")
} else if (val.endHoldTime && !this.onCheckHourUse(val.startHoldTime, val.endHoldTime)) {
startDate = moment(val.endHoldTime).add(1, 'm').format("YYYY-MM-DD HH:mm:00")
} else {
startDate = moment(val.timeHour).format("YYYY-MM-DD HH:00:00")
}
......@@ -1821,63 +1985,69 @@
this.formatAllData = this.onTransiteForDate({
list: JSON.parse(JSON.stringify(this.dateIntervalList)),
startDateTime: startDate,
duration:this.formatAllData.duration,
durationType:2
},false);
duration: this.formatAllData.duration,
durationType: 2
}, false);
this.$forceUpdate();
},
// 通过开始时间和时长计算时段有无占用
onUseByStartAndDuration(startDate,duration,durationType=1){
// 通过开始时间和时长计算时段有无占用
onUseByStartAndDuration(startDate, duration, durationType = 1) {
let useStatus = false;
let m = Number(duration)*60;
let m = Number(duration) * 60;
if (durationType === 2) {
m = Number(duration)
}
let stempLong = m*60000;
let stempLong = m * 60000;
let startStemp = moment(startDate).valueOf();
let endStemp = startStemp + stempLong;
if(this.orderType == 2){
endStemp = endStemp + this.storeCleanDuration*60*1000
let endStemp = startStemp + stempLong;
if (this.orderType == 2) {
endStemp = endStemp + this.storeCleanDuration * 60 * 1000
}
let nextStatus = false;
this.dateIntervalList.forEach((item,k) =>{
if(nextStatus) return;
let start = moment(item.timeHour+':00:00').valueOf();
let end = moment(item.timeHour+':59:59').valueOf();
if( end > startStemp && start < endStemp){
if(item.status ==1){
if(this.onCheckHourUse(item.startHoldTime,item.endHoldTime)){
this.dateIntervalList.forEach((item, k) => {
if (nextStatus) return;
let start = moment(item.timeHour + ':00:00').valueOf();
let end = moment(item.timeHour + ':59:59').valueOf();
if (end > startStemp && start < endStemp) {
if (item.status == 1) {
if (this.onCheckHourUse(item.startHoldTime, item.endHoldTime)) {
useStatus = true;
nextStatus = true;
}else{
if(this.orderType == 1){
if( startStemp >= moment(item.startHoldTime).valueOf() && startStemp < moment(item.endHoldTime).valueOf()){
} else {
if (this.orderType == 1) {
if (startStemp >= moment(item.startHoldTime).valueOf() && startStemp < moment(
item.endHoldTime).valueOf()) {
useStatus = 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;
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;
nextStatus = true;
}
} else if(this.orderType == 2){
if( startStemp > moment(item.startHoldTime).valueOf() && startStemp < moment(item.endHoldTime).valueOf()){
useStatus = true;
nextStatus = true;
} else if(startStemp < moment(item.endHoldTime).valueOf() && endStemp >= moment(item.startHoldTime).valueOf()){
useStatus = true;
nextStatus = true;
} else if( endStemp >= moment(item.startHoldTime).valueOf() && endStemp <= moment(item.endHoldTime).valueOf()){
useStatus = true;
nextStatus = true;
}
} else if (this.orderType == 2) {
if (startStemp > moment(item.startHoldTime).valueOf() && startStemp < moment(
item.endHoldTime).valueOf()) {
useStatus = true;
nextStatus = true;
} else if (startStemp < moment(item.endHoldTime).valueOf() && endStemp >=
moment(item.startHoldTime).valueOf()) {
useStatus = true;
nextStatus = true;
} else if (endStemp >= moment(item.startHoldTime).valueOf() && endStemp <=
moment(item.endHoldTime).valueOf()) {
useStatus = true;
nextStatus = true;
}
}
}
......@@ -1899,112 +2069,112 @@
//startTime(HH:mm): 开始时间,显示使用
//endTime(HH:mm): 结束时间,显示使用
//duration(Number): 时长,仅分钟
onTransiteForDate(params,dayChange = true) {
onTransiteForDate(params, dayChange = true) {
// 计算出时长,使用分钟计算
if(!params.duration){
if (!params.duration) {
return {
errMsg:"选择时长错误"
errMsg: "选择时长错误"
}
}
let m = Number(params.duration)*60;
let m = Number(params.duration) * 60;
if (params.durationType === 2) {
m = Number(params.duration)
}
let startStamp = moment().valueOf();
let endStamp = moment().valueOf() + m*60000;
let endStamp = moment().valueOf() + m * 60000;
let dateObj = {
useStatus: false
};
this.tipErrMsg = "";
if(params.startDateTime){
if (params.startDateTime) {
// 开始和结束时间的毫秒数
startStamp = moment(params.startDateTime).valueOf();
endStamp = startStamp + m*60000;
dateObj.useStatus = this.onUseByStartAndDuration(params.startDateTime,m,2)
} else if(params.duration){
dateObj = this.onComputeByDuration(m,2);
endStamp = startStamp + m * 60000;
dateObj.useStatus = this.onUseByStartAndDuration(params.startDateTime, m, 2)
} else if (params.duration) {
dateObj = this.onComputeByDuration(m, 2);
startStamp = moment(dateObj.startDateTime).valueOf();
endStamp = moment(dateObj.endDateTime).valueOf();
}
// 获取开始时间的当前小时
let list = params.list.map((item, index) => {
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();
if( endH >= startStamp && endH < endStamp){
item.status = 2
}
if(this.orderType == 2 && startStamp>= startH && endStamp <= endH ){
item.status = 2
}
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();
if (endH >= startStamp && endH < endStamp) {
item.status = 2
}
if (this.orderType == 2 && startStamp >= startH && endStamp <= endH) {
item.status = 2
}
return item
})
if(dateObj.useStatus){
if (dateObj.useStatus) {
this.$refs.popupMessage.open();
}
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"),
startTime: moment(startStamp).format("HH:mm"),
endDateTime: moment(endStamp).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(endStamp).format("HH:mm"),
duration: m,
useStatus:dateObj.useStatus,
useStatus: dateObj.useStatus,
durationType: 2,
}
if(dayChange){
if (dayChange) {
// 获取用户可用优化券
this.onGetUseCoupon(paramsData)
}
return paramsData
},
onCancleTip(){
onCancleTip() {
this.$refs.popupMessage.close();
this.$refs.popupDialog.close();
},
// 检查当前小时段是否被全部占用 true 完全占用 false 部分占用
onCheckHourUse(startDate,endDate) {
let timeStamp = moment(endDate).valueOf()-moment(startDate).valueOf();
onCheckHourUse(startDate, endDate) {
let timeStamp = moment(endDate).valueOf() - moment(startDate).valueOf();
return timeStamp >= 3599000
},
//检查套餐后半段60%的时间内是否有被占用,有被占用,则无法预定,d为小时
onCheckPackUse(startDate,endDate,d = 0) {
onCheckPackUse(startDate, endDate, d = 0) {
let useStatus = false;
let startStemp = moment(startDate).valueOf();
let endStemp = moment(endDate).valueOf();
let timeStamp = moment(endDate).valueOf()-moment(startDate).valueOf();
if(d){
startStemp = startStemp + d*3600*1000;
}else{
startStemp = startStemp + timeStamp*0.4;
let endStemp = moment(endDate).valueOf();
let timeStamp = moment(endDate).valueOf() - moment(startDate).valueOf();
if (d) {
startStemp = startStemp + d * 3600 * 1000;
} else {
startStemp = startStemp + timeStamp * 0.4;
}
this.dateIntervalList.forEach(item=>{
let start = moment(item.timeHour+':00:00').valueOf();
let end = moment(item.timeHour+':59:59').valueOf();
if(end > startStemp && start < endStemp){
if(item.status == 1){
this.dateIntervalList.forEach(item => {
let start = moment(item.timeHour + ':00:00').valueOf();
let end = moment(item.timeHour + ':59:59').valueOf();
if (end > startStemp && start < endStemp) {
if (item.status == 1) {
useStatus = true;
}
}
})
return useStatus
}
}
......@@ -2197,22 +2367,26 @@
.text-first {
letter-spacing: 4upx;
}
.relative{
.absolute-right{
.relative {
.absolute-right {
position: absolute;
top: -12upx;
right: -16upx;
image{
image {
width: 32upx;
max-height: 30upx;
}
}
}
.absolute-right{
.absolute-right {
position: absolute;
top: -8upx;
right: -4upx;
image{
image {
width: 38upx;
max-height: 34upx;
}
......@@ -2254,9 +2428,9 @@
margin: 30upx;
}
.package-box {
.room-label-list{
.room-label-list {
display: flex;
flex-wrap: wrap;
width: 60%;
......@@ -2264,35 +2438,41 @@
margin-left: 20upx;
border-radius: 12upx;
padding: 10upx 6upx;
.room-label-box{
.room-label-box {
position: relative;
display: flex;
justify-content: center;
align-items: center;
width: 33.33%;
padding: 10upx 6upx;
.item {
padding: 8upx 20upx;
}
.gray{
.gray {
background: #c3c3c3;
color: #f5f5f5;
}
.pre-icon{
.pre-icon {
position: absolute;
top: -8upx;
right: -10upx;
display: flex;
width: 64upx;
z-index: 6;
image{
image {
width: 100%;
max-height: 64upx;
}
}
}
}
.package-list{
.package-list {
display: flex;
flex-direction: column;
height: 100%;
......@@ -2300,30 +2480,36 @@
border-radius: 12upx;
margin-left: 20upx;
padding: 10upx 6upx;
.package-list-box{
.package-list-box {
position: relative;
padding: 10upx 6upx;
.item{
.item {
padding: 8rpx 20rpx;
}
.gray{
.gray {
background: #c3c3c3;
color: #f5f5f5;
}
.pre-icon{
.pre-icon {
position: absolute;
top: -8upx;
right: -10upx;
display: flex;
width: 64upx;
z-index: 6;
image{
image {
width: 100%;
max-height: 64upx;
}
}
}
}
.item {
display: flex;
justify-content: center;
......@@ -2333,10 +2519,11 @@
border-radius: 12upx;
border: 1px solid #CCD1DB;
}
.active{
.active {
border: 1px solid #e1419b;
color: #FFFFFF;
background: linear-gradient(to right,#e03997,#ff375d);
background: linear-gradient(to right, #e03997, #ff375d);
box-shadow: 0 0 8upx #ffffff inset;
}
}
......@@ -2405,13 +2592,16 @@
.line-black::after {
border-color: transparent;
}
.line-gray{
.line-gray {
border: 2px solid #c5c5c5;
color: #c5c5c5;
}
.line-gray::after {
border-color: transparent;
}
.line-pink {
display: flex;
align-items: center;
......@@ -2505,21 +2695,25 @@
text-align: center;
}
}
.relative{
.relative {
position: relative;
.absolute{
.absolute {
position: absolute;
top: -1upx;
left: 0upx;
height: 100%;
.flex-col{
.flex-col {
position: absolute;
left: 0;
bottom: 0;
height: 150%;
display: flex;
flex-direction: column;
.saojiao{
.saojiao {
position: absolute;
top: -10px;
left: -15upx;
......@@ -2532,7 +2726,8 @@
border-left-color: transparent;
border-right-color: transparent;
}
.line{
.line {
position: absolute;
top: 0;
left: 0;
......@@ -2540,12 +2735,14 @@
height: 100%;
background: linear-gradient(180deg, #EFD12C, #DDC01E);
}
.text-sm{
.text-sm {
position: absolute;
top: -4px;
left: 10px;
width: 46upx;
text{
text {
font-size: 20upx;
color: #DFC224;
}
......@@ -2566,7 +2763,8 @@
padding: 0 0 15upx;
overflow: hidden;
align-items: center;
.logo-box{
.logo-box {
position: absolute;
top: 0;
left: 0;
......@@ -2576,15 +2774,18 @@
justify-content: center;
align-items: center;
z-index: 0;
image{
image {
width: 402upx;
height: 322upx;
}
}
.flex-between{
.flex-between {
position: relative;
z-index: 3;
}
.text-left {
width: 120upx;
text-align-last: justify;
......@@ -2611,18 +2812,20 @@
.flex-row {
align-items: center;
}
.vip-tag-box{
.vip-tag-box {
display: flex;
justify-content: 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;
font-size: 16upx;
height: 34upx;
border-radius: 18upx;
padding: 0 12upx;
margin-left: 6upx;
image{
image {
width: 22upx;
max-height: 22upx;
margin-right: 4upx;
......@@ -2671,7 +2874,8 @@
flex-direction: row;
align-items: center;
color: #000000;
.amount{
.amount {
color: #e03997;
}
}
......@@ -2706,13 +2910,15 @@
}
}
.select-datetime-box{
display: flex;
flex-direction: column;
.bg-white{
border-bottom: 1px solid #e5e5e5;
.select-datetime-box {
display: flex;
flex-direction: column;
.bg-white {
border-bottom: 1px solid #e5e5e5;
}
}
}
.select-box {
height: 420upx;
background-color: #f1f1f1;
......@@ -2735,13 +2941,14 @@
.confirm-pop {
width: 100vw;
.pop-content-box {
display: flex;
flex-direction: column;
width: 100%;
// height: 700upx;
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;
.info-box {
......@@ -2755,7 +2962,8 @@
background: #FFFFFF;
border-radius: 16rpx;
border: 2px solid #8C8C8C;
.info-store{
.info-store {
margin-top: -30upx;
width: 308upx;
height: 60upx;
......@@ -2764,33 +2972,38 @@
align-items: center;
z-index: 44;
background: #FFFFFF;
.text-title{
.text-title {
font-weight: 600;
font-size: 36rpx;
// color: #E03997;
color: #333333;
}
}
.time-box{
.time-box {
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
align-items: center;
margin: 30upx 0;
.part-1{
.part-1 {
position: relative;
display: flex;
flex: 1;
margin: 0 24upx;
height: 90upx;
image{
image {
width: 100%;
height: 100%;
}
.absolute{
.absolute {
position: absolute;
top:0;
top: 0;
left: 0;
width: 100%;
height: 100%;
......@@ -2799,7 +3012,8 @@
align-items: center;
border: 6upx solid #E03997;
border-radius: 47upx;
text{
text {
font-weight: 600;
font-size: 60upx;
// color: #333333;
......@@ -2807,17 +3021,20 @@
}
}
}
text{
text {
font-weight: 600;
font-size: 30rpx;
color: #333333;
}
}
.info {
width: 100%;
padding: 12upx 30upx;
font-size: 20upx;
text{
text {
// font-weight: 600;
// font-size: 32rpx;
// color: #333333;
......@@ -2831,12 +3048,13 @@
align-items: center;
width: 100%;
padding: 32upx 28upx;
text{
text {
font-weight: 600;
font-size: 36upx;
color: #333333;
}
}
.flex-1 {
......@@ -2867,25 +3085,27 @@
width: 100%;
padding: 0 5%;
margin: 40upx 0;
.btn-close{
.btn-close {
width: 240upx;
height: 64upx;
border: 2upx solid;
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;
margin: 0 12upx;
margin: 0 12upx;
font-weight: 600;
font-size: 32upx;
color: #333333;
border-radius: 6upx;
opacity: 0.95;
}
.btn-confirm{
.btn-confirm {
width: 240upx;
height: 64upx;
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;
opacity: 0.95;
margin: 0 12upx;
......@@ -2893,7 +3113,7 @@
font-size: 32rpx;
color: #FFFFFF;
}
}
}
......@@ -2947,56 +3167,162 @@
}
}
}
.card-use{
.card-use {
display: flex;
flex-direction: column;
width: 100%;
padding: 15upx 30upx;
.radio-group-box{
.radio-group-box {
width: 100%;
height: 0;
margin-top: 15upx;
border-radius: 4upx;
padding: 0 24upx;
border: 1upx solid transparent;
box-shadow: 0 0 12upx transparent inset;
transition: all 0.5s;
overflow: hidden;
.radio-group{
.radio-group {
width: 100%;
margin: 20upx 0;
label{
height: 32px;
}
.margin-right-sm{
margin-right: 14upx;
}
}
}
.radio-group-box-height{
.radio-group-box-height {
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;
}
.cuIcon-right{
.cuIcon-right {
transition: all 0.5s;
}
}
.activite-box{
.activite-box {
width: 92vw;
border-radius: 20upx;
overflow: hidden;
image{
image {
display: block;
width: 100%;
min-height: 960upx;
}
}
.close-btn{
.close-btn {
display: flex;
justify-content: center;
margin-top: 24upx;
.text-pink{
.text-pink {
font-size: 80upx;
}
}
.show-more-pay-way{
.show-more-pay-way {
transform-origin: center center;
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>
\ 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