Commit 3c801558 by zhangzhen

细节优化,加订阅消息提示

parent eebca2b1
...@@ -5,13 +5,14 @@ ...@@ -5,13 +5,14 @@
<text class="tips"><text class="text-bold">预定须知:</text> 预定成功后,请按预约时间及时到店消费,若无法及时到店消费,可提前取消订单</text> <text class="tips"><text class="text-bold">预定须知:</text> 预定成功后,请按预约时间及时到店消费,若无法及时到店消费,可提前取消订单</text>
</view> </view>
<view class="part-right"> <view class="part-right">
<text class="text-title text-xl text-bold">{{roomInfo.name||'一帆风顺'}}{{roomInfo.roomType?'【'+roomTypeEnum[roomInfo.roomType]+'】':''}}</text> <text
<view class="status-icon-box"> class="text-title text-xl text-bold">{{roomInfo.name||'一帆风顺'}}{{roomInfo.roomType?'【'+roomTypeEnum[roomInfo.roomType]+'】':''}}</text>
<view class="status-box" :class="'status-box-'+roomInfo.status"> <view class="status-icon-box">
<text>{{roomStatusEnum[roomInfo.status]}}</text> <view class="status-box" :class="'status-box-'+roomInfo.status">
</view> <text>{{roomStatusEnum[roomInfo.status]}}</text>
<image class="img" :src="assetsPath+'/fa_icon_'+roomInfo.status+'.png'" mode="widthFix"></image>
</view> </view>
<image class="img" :src="assetsPath+'/fa_icon_'+roomInfo.status+'.png'" mode="widthFix"></image>
</view>
</view> </view>
<view class="part-left"> <view class="part-left">
<image :src="roomInfo.images.length?roomInfo.images[0]:'../../static/blank2.jpg'" mode="widthFix"> <image :src="roomInfo.images.length?roomInfo.images[0]:'../../static/blank2.jpg'" mode="widthFix">
...@@ -25,7 +26,7 @@ ...@@ -25,7 +26,7 @@
@tap="onTypeChange(i)"> @tap="onTypeChange(i)">
<text class="text-gray text-xl text-bold">{{item.label}}</text> <text class="text-gray text-xl text-bold">{{item.label}}</text>
<view class="line"> <view class="line">
</view> </view>
</view> </view>
</view> </view>
...@@ -45,115 +46,118 @@ ...@@ -45,115 +46,118 @@
</view> </view>
</view> </view>
</view> </view>
<view class="flex-col data-content-box"> <view class="flex-col data-content-box">
<view v-show="index==1" class="flex-col package-mode"> <view v-show="index==1" class="flex-col package-mode">
<view class="part-1"> <view class="part-1">
<text class="text-title text-lg text-bold">套餐选择:</text> <text class="text-title text-lg text-bold">套餐选择:</text>
</view> </view>
<view class="flex-1 package-box"> <view class="flex-1 package-box">
<view v-for="(item,index) in packageMode" :key="index" class="flex-col item" <view v-for="(item,index) in packageMode" :key="index" class="flex-col item"
:class="{active: modeIndex===index,'item-3':packageMode.length<3,'item-n':packageMode.length>=3}" @tap="onChangeMode(index)"> :class="{active: modeIndex===index,'item-3':packageMode.length<3,'item-n':packageMode.length>=3}"
<text class="text-title">{{item.name}}</text> @tap="onChangeMode(index)">
<view class="flex-row" style="margin-top: 12upx;"> <text class="text-title">{{item.name}}</text>
<text style="margin-bottom: 4upx;"></text> <view class="flex-row" style="margin-top: 12upx;">
<text class="text-title text-bold text-xl">{{item.price}}</text> <text style="margin-bottom: 4upx;"></text>
<text class="text-title text-bold text-xl">{{item.price}}</text>
</view>
</view> </view>
</view> </view>
</view> </view>
</view>
<view v-show="orderType ===1 && index == 0" class="flex-col distance-mode"> <view v-show="orderType ===1 && index == 0" class="flex-col distance-mode">
<view class="distance-title"> <view class="distance-title">
<text class="text-title text-lg text-bold">时长选择:</text> <text class="text-title text-lg text-bold">时长选择:</text>
</view>
<view class="flex-1 distance-box">
<view v-for="(item,index) in distanceMode" :key="index" class="flex-col" style="margin: 0 12upx;"
@tap="onDurationChange(index)">
<view class="cu-tag radius" :class="index===distanceIndex? 'line-black':'line-gray'">
<text>{{ index >= distanceMode.length-1 && !editDuration.length ? item.duration: item.duration+'小时'}}</text>
<text v-if="index >= distanceMode.length-1" class="cuIcon-edit text-lg"></text>
</view>
</view> </view>
</view> <view class="flex-1 distance-box">
</view> <view v-for="(item,index) in distanceMode" :key="index" class="flex-col"
style="margin: 0 12upx;" @tap="onDurationChange(index)">
<view v-if="orderType ===2" class="flex-col distance-mode" style="margin: 40upx 20upx 40upx;"> <view class="cu-tag radius" :class="index===distanceIndex? 'line-black':'line-gray'">
<view class="distance-title"> <text>{{ index >= distanceMode.length-1 && !editDuration.length ? item.duration: item.duration+'小时'}}</text>
<text class="text-title text-lg text-bold">时长选择:</text> <text v-if="index >= distanceMode.length-1" class="cuIcon-edit text-lg"></text>
</view> </view>
<view class="flex-1 distance-box">
<view v-for="(item,index) in distanceMode2" :key="index" class="flex-col" style="margin: 0 6upx;"
@tap="onDurationChange2(index)">
<view class="cu-tag radius" :class="index===distanceIndex? 'line-black':'line-gray'">
<text>{{item.duration<1?'半小时': item.duration+'小时'}}</text>
</view> </view>
</view> </view>
</view> </view>
</view>
<view v-if="orderType ===2" class="flex-col distance-mode" style="margin: 40upx 20upx 40upx;">
<view class="flex-col date-mode"> <view class="distance-title">
<view class="flex-row date-box"> <text class="text-title text-lg text-bold">时长选择:</text>
<view class="part-1">
<text class="text-title">开始时间</text>
</view>
<view class="part-2">
</view> </view>
<view class="flex-1 distance-box">
<view class="part-1 part-3"> <view v-for="(item,index) in distanceMode2" :key="index" class="flex-col"
<text class="text-title">结束时间</text> style="margin: 0 6upx;" @tap="onDurationChange2(index)">
<view class="cu-tag radius" :class="index===distanceIndex? 'line-black':'line-gray'">
<text>{{item.duration<1?'半小时': item.duration+'小时'}}</text>
</view>
</view>
</view> </view>
</view> </view>
<view class="flex-row date-box">
<view class="part-1"> <view class="flex-col date-mode">
<button class="cu-btn round" :class="orderType===1?'line-black':'line-gray'" @tap="onSelectDate"> <view class="flex-row date-box">
<text>{{startTime}}</text> <view class="part-1">
<text class="cuIcon-edit"></text> <text class="text-title">开始时间</text>
</button> </view>
</view> <view class="part-2">
<view class="part-2">
<text class=" text-black text-lg"></text> </view>
<view class="part-1 part-3">
<text class="text-title">结束时间</text>
</view>
</view> </view>
<view class="flex-row date-box">
<view class="part-1 part-3"> <view class="part-1">
<button class="cu-btn round line-gray"> <button class="cu-btn round" :class="orderType===1?'line-black':'line-gray'"
<text>{{endTime}}</text> @tap="onSelectDate">
</button> <text>{{startTime}}</text>
<text class="cuIcon-edit"></text>
</button>
</view>
<view class="part-2">
<text class=" text-black text-lg"></text>
</view>
<view class="part-1 part-3">
<button class="cu-btn round line-gray">
<text>{{endTime}}</text>
</button>
</view>
</view> </view>
</view> </view>
</view> <view class="date-interval">
<view class="date-interval"> <view class="flex-1 flex-row">
<view class="flex-1 flex-row"> <view class="round-box pink">
<view class="round-box pink"> </view>
<text>已选时段</text>
</view> </view>
<text>已选时段</text> <view class="flex-1 flex-row">
</view> <view class="round-box blank">
<view class="flex-1 flex-row">
<view class="round-box blank">
</view>
<text>可选时段</text>
</view> </view>
<text>可选时段</text> <view class="flex-1 flex-row">
</view> <view class="round-box gray">
<view class="flex-1 flex-row"> </view>
<view class="round-box gray"> <text>不可选时段</text>
</view> </view>
<text>不可选时段</text>
</view> </view>
</view> <view class="date-point-box">
<view class="date-point-box"> <view v-for="(item,k) in intervalList" :key="k" class="date-point-item"
<view v-for="(item,k) in intervalList" :key="k" class="date-point-item" @tap="onSelectDatePoint(item,k)"> @tap="onSelectDatePoint(item,k)">
<view class="date-point" <view class="date-point"
:class="item.status === 0?'free':item.status==1?'used': item.status==2?'checked':'error'"> :class="item.status === 0?'free':item.status==1?'used': item.status==2?'checked':'error'">
</view>
<text class="text-gray">{{item.hour}}</text>
</view> </view>
<text class="text-gray">{{item.hour}}</text>
</view> </view>
</view> </view>
</view>
</view> </view>
<view class="flex-col count-price"> <view class="flex-col count-price">
<view class="flex-between original-price"> <view class="flex-between original-price">
...@@ -186,11 +190,12 @@ ...@@ -186,11 +190,12 @@
<view class="flex-between price"> <view 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-sm text-bold" style="margin-bottom: 3upx;">{{computePriceInfo.couponFee>0?'-':''}}</text> <text class="text-pink text-sm text-bold"
style="margin-bottom: 3upx;">{{computePriceInfo.couponFee>0?'-':''}}</text>
<text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text> <text class="text-pink text-lg text-bold">{{computePriceInfo.couponFee}}</text>
</view> </view>
</view> </view>
<!-- <view class="flex-between price"> <!-- <view class="flex-between price">
<text class="text-title text-lg">账户余额</text> <text class="text-title text-lg">账户余额</text>
<view class="flex-row text-pink"> <view class="flex-row text-pink">
<text class="text-title text-lg">¥0.00</text> <text class="text-title text-lg">¥0.00</text>
...@@ -207,7 +212,8 @@ ...@@ -207,7 +212,8 @@
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<button v-if="orderType===1" class="cu-btn cu-btn-1 margin-right" @tap="onNavToCheckedCoupon">团购验券</button> <button v-if="orderType===1" class="cu-btn cu-btn-1 margin-right"
@tap="onNavToCheckedCoupon">团购验券</button>
<button class="cu-btn cu-btn-2 " @tap="onOrderConfirm">{{orderType===1?'预约':'续单'}} </button> <button class="cu-btn cu-btn-2 " @tap="onOrderConfirm">{{orderType===1?'预约':'续单'}} </button>
</view> </view>
</view> </view>
...@@ -263,7 +269,8 @@ ...@@ -263,7 +269,8 @@
</view> </view>
<view class="info-box"> <view class="info-box">
<view class="info"> <view class="info">
<text class="text-black text-lg">{{orderType==1? '预约':'续单'}}门店:{{roomInfo.storeName|| ''}}</text> <text
class="text-black text-lg">{{orderType==1? '预约':'续单'}}门店:{{roomInfo.storeName|| ''}}</text>
</view> </view>
<view class="info"> <view class="info">
<text class="text-black text-lg">{{orderType==1? '预约':'续单'}}包间:{{roomInfo.name}}</text> <text class="text-black text-lg">{{orderType==1? '预约':'续单'}}包间:{{roomInfo.name}}</text>
...@@ -281,7 +288,7 @@ ...@@ -281,7 +288,7 @@
<text class="text-red text-bold text-xl">客户须知</text> <text class="text-red text-bold text-xl">客户须知</text>
</view> </view>
<view class="flex-col text-red"> <view class="flex-col text-red">
<text >1.预定的订单将全时段保留,迟到不可顺延和退款。</text> <text>1.预定的订单将全时段保留,迟到不可顺延和退款。</text>
<text>2.若订单时段前包厢无使用.可提前开始订单.但订单总时长不变。</text> <text>2.若订单时段前包厢无使用.可提前开始订单.但订单总时长不变。</text>
<text>3.订单开始前0小时内取消订单需核收xx%退单费请合理规划您的时间。</text> <text>3.订单开始前0小时内取消订单需核收xx%退单费请合理规划您的时间。</text>
</view> </view>
...@@ -292,13 +299,14 @@ ...@@ -292,13 +299,14 @@
<button class="cu-btn round block line-pink lg" @tap="onCancle">返回修改</button> <button class="cu-btn round block line-pink lg" @tap="onCancle">返回修改</button>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<button class="cu-btn round block bg-pink lg" @tap="onOrderCreate">立即{{orderType==1? '预约':'续单'}}</button> <button class="cu-btn round block bg-pink lg"
@tap="onOrderCreate">立即{{orderType==1? '预约':'续单'}}</button>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</uni-popup> </uni-popup>
<LoginPop ref="loginPop" @success='onLoading' /> <LoginPop ref="loginPop" @success='onLoading' />
</view> </view>
</template> </template>
...@@ -306,8 +314,12 @@ ...@@ -306,8 +314,12 @@
import LoginPop from "@/components/login/login" import LoginPop from "@/components/login/login"
import config from "@/config/index.config" import config from "@/config/index.config"
import moment from "@/common/moment_zh_cn.js"; import moment from "@/common/moment_zh_cn.js";
import {dictList} from "@/api/index.js"; import {
import {getDictItem} from "@/utils/tools.js" dictList
} from "@/api/index.js";
import {
getDictItem
} from "@/utils/tools.js"
import { import {
listSortDistance, listSortDistance,
roomInfo roomInfo
...@@ -360,8 +372,7 @@ ...@@ -360,8 +372,7 @@
], ],
// 时长选择 // 时长选择
distanceIndex: 0, distanceIndex: 0,
distanceMode: [ distanceMode: [{
{
duration: 4 duration: 4
}, },
{ {
...@@ -374,8 +385,7 @@ ...@@ -374,8 +385,7 @@
duration: '其他', duration: '其他',
} }
], ],
distanceMode2:[ distanceMode2: [{
{
duration: 0.5 duration: 0.5
}, },
{ {
...@@ -437,9 +447,9 @@ ...@@ -437,9 +447,9 @@
totalFee: '', totalFee: '',
}, },
dateObj: {}, dateObj: {},
preOrderNo:'', preOrderNo: '',
roomStatusEnum:{}, roomStatusEnum: {},
roomTypeEnum:{} roomTypeEnum: {}
}; };
}, },
onLoad(option) { onLoad(option) {
...@@ -448,17 +458,17 @@ ...@@ -448,17 +458,17 @@
}) })
this.onGetDicts(); this.onGetDicts();
this.id = option.roomId || 106; this.id = option.roomId || 106;
if(option.orderNo){ if (option.orderNo) {
this.orderType = 2; this.orderType = 2;
this.preOrderNo = option.orderNo; this.preOrderNo = option.orderNo;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:'房间续单' title: '房间续单'
}) })
this.onGetOrderInfo() this.onGetOrderInfo()
}else{ } else {
this.onLoading() this.onLoading()
} }
}, },
methods: { methods: {
onGetDicts() { onGetDicts() {
...@@ -489,25 +499,25 @@ ...@@ -489,25 +499,25 @@
.split(",").map(val => this.hostUrl + val) : [] .split(",").map(val => this.hostUrl + val) : []
} }
// 判断房间有没有绑定套餐 // 判断房间有没有绑定套餐
if (this.orderType ===1 && this.roomInfo.packList && this.roomInfo.packList.length) { if (this.orderType === 1 && this.roomInfo.packList && this.roomInfo.packList.length) {
this.packageMode = this.roomInfo.packList this.packageMode = this.roomInfo.packList
this.index = 1; this.index = 1;
this.modeIndex = 0; this.modeIndex = 0;
}else{ } else {
this.index = 0; this.index = 0;
this.orderTypeList = this.orderTypeList.filter(item=>item.type==1) this.orderTypeList = this.orderTypeList.filter(item => item.type == 1)
} }
this.onGetSortDistance() this.onGetSortDistance()
} }
}) })
}, },
onGetOrderInfo(){ onGetOrderInfo() {
getOrderInfoByNo(this.preOrderNo).then(res=>{ getOrderInfoByNo(this.preOrderNo).then(res => {
if(res.data.code == 200){ if (res.data.code == 200) {
let endDate = res.data.data.endDate || res.data.data.preEndDate; let endDate = res.data.data.endDate || res.data.data.preEndDate;
this.startTime = moment(endDate).format("HH:mm"); this.startTime = moment(endDate).format("HH:mm");
let date = moment(endDate).format("YYYY-MM-DD") let date = moment(endDate).format("YYYY-MM-DD")
this.dateIndex = this.dateList.findIndex(item=> item.readDate === date) this.dateIndex = this.dateList.findIndex(item => item.readDate === date)
this.onLoading() this.onLoading()
} }
}) })
...@@ -550,29 +560,29 @@ ...@@ -550,29 +560,29 @@
}).join(":") }).join(":")
} else { } else {
// 小时模式 // 小时模式
if(this.orderType ===1){ if (this.orderType === 1) {
this.duration = Number(this.distanceMode[this.distanceIndex].duration); this.duration = Number(this.distanceMode[this.distanceIndex].duration);
}else if(this.orderType ===2){ } else if (this.orderType === 2) {
this.duration = Number(this.distanceMode2[this.distanceIndex].duration); this.duration = Number(this.distanceMode2[this.distanceIndex].duration);
} }
if(this.orderType === 2 && this.duration<1){ if (this.orderType === 2 && this.duration < 1) {
let startDateArr = this.startTime.split(":").map(item=>Number(item)) let startDateArr = this.startTime.split(":").map(item => Number(item))
// 分钟 // 分钟
let m = startDateArr[1]+60*this.duration let m = startDateArr[1] + 60 * this.duration
if(m>=60){ if (m >= 60) {
startDateArr[0]+=1 startDateArr[0] += 1
if(startDateArr[0]>23){ if (startDateArr[0] > 23) {
startDateArr[0] = startDateArr[0]-23 startDateArr[0] = startDateArr[0] - 23
} }
startDateArr[1] = m-60 startDateArr[1] = m - 60
}else{ } else {
startDateArr[1] = m startDateArr[1] = m
} }
this.endTime = startDateArr.map(num => num >= 10 ? num : `0${num}` ).join(':'); this.endTime = startDateArr.map(num => num >= 10 ? num : `0${num}`).join(':');
}else{ } else {
this.endTime = this.startTime.split(":").map((item, k) => { this.endTime = this.startTime.split(":").map((item, k) => {
let num = '' let num = ''
if (k == 0) { if (k == 0) {
...@@ -582,7 +592,7 @@ ...@@ -582,7 +592,7 @@
num = Number(item) + this.duration num = Number(item) + this.duration
} }
} else { } else {
num = Number(item) num = Number(item)
} }
return num >= 10 ? num : `0${num}` return num >= 10 ? num : `0${num}`
...@@ -596,14 +606,14 @@ ...@@ -596,14 +606,14 @@
// 更新时间的选取状态 // 更新时间的选取状态
onUpdateIntervalList() { onUpdateIntervalList() {
this.useDateStatus = true this.useDateStatus = true
let start = Number(this.startTime.split(":")[0]) let start = Number(this.startTime.split(":")[0])
let startM = Number(this.startTime.split(":")[1]) let startM = Number(this.startTime.split(":")[1])
let end = Number(this.endTime.split(":")[0]) let end = Number(this.endTime.split(":")[0])
let endM = Number(this.endTime.split(":")[1]) let endM = Number(this.endTime.split(":")[1])
if (end < start) { if (end < start) {
end += 24 end += 24
} }
...@@ -613,10 +623,10 @@ ...@@ -613,10 +623,10 @@
] ]
for (start; start <= end; start++) { for (start; start <= end; start++) {
// 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前 // 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前
if (this.dateIntervalList[start].status === 1 if (this.dateIntervalList[start].status === 1 &&
&& startM < moment(this.dateIntervalList[start].endHoldTime).format("mm") startM < moment(this.dateIntervalList[start].endHoldTime).format("mm") &&
&& endM >= moment(this.dateIntervalList[start].startHoldTime).format("mm") endM >= moment(this.dateIntervalList[start].startHoldTime).format("mm")
) { ) {
// 表示时间点被占用,无法选择 // 表示时间点被占用,无法选择
this.useDateStatus = false this.useDateStatus = false
this.intervalList[start] = { this.intervalList[start] = {
...@@ -651,13 +661,13 @@ ...@@ -651,13 +661,13 @@
preStartDate: dateObj.startDate, preStartDate: dateObj.startDate,
preEndDate: dateObj.endDate preEndDate: dateObj.endDate
}).then(res => { }).then(res => {
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.filter(item => item.isAvailable === 0).sort((a, this.useCouponList = res.data.data.filter(item => item.isAvailable === 0).sort((a,
b) => b.subPrice - a.subPrice); b) => b.subPrice - a.subPrice);
} }
}else if(res.data.code == 200){ } else if (res.data.code == 200) {
this.$refs.loginPop.open(); this.$refs.loginPop.open();
} }
this.onComputePrice(); this.onComputePrice();
...@@ -717,10 +727,10 @@ ...@@ -717,10 +727,10 @@
}, },
// 下单模式切换 // 下单模式切换
onTypeChange(i) { onTypeChange(i) {
if(this.orderType ==2){ if (this.orderType == 2) {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title:'房间续单无法选择套餐模式' title: '房间续单无法选择套餐模式'
}) })
return return
} }
...@@ -750,14 +760,14 @@ ...@@ -750,14 +760,14 @@
this.onSetEndTime() this.onSetEndTime()
}, },
onDateChange(k) { onDateChange(k) {
if(this.orderType ==2) return; if (this.orderType == 2) return;
if (this.dateIndex === k) return; if (this.dateIndex === k) return;
this.dateIndex = k this.dateIndex = k
this.onGetSortDistance() this.onGetSortDistance()
}, },
// 开始选择时间 // 开始选择时间
onSelectDate() { onSelectDate() {
if(this.orderType === 2) return; if (this.orderType === 2) return;
if (!this.checkedIndex.length) { if (!this.checkedIndex.length) {
let arr = this.startTime.split(":") let arr = this.startTime.split(":")
if (arr.length) { if (arr.length) {
...@@ -772,7 +782,7 @@ ...@@ -772,7 +782,7 @@
} else { } else {
this.checkedDateList = [Number(arr[0]) + 1, 0] this.checkedDateList = [Number(arr[0]) + 1, 0]
} }
} }
} }
} }
...@@ -780,7 +790,7 @@ ...@@ -780,7 +790,7 @@
this.$refs.popup.open() this.$refs.popup.open()
}, },
// 切换时间 // 切换时间
onBindChange(e) { onBindChange(e) {
this.checkedIndex = e.target.value this.checkedIndex = e.target.value
}, },
...@@ -810,7 +820,7 @@ ...@@ -810,7 +820,7 @@
this.distanceMode[this.distanceIndex] = { this.distanceMode[this.distanceIndex] = {
duration: this.editDuration[0] + 1, duration: this.editDuration[0] + 1,
} }
this.onHideModal() this.onHideModal()
this.$forceUpdate(); this.$forceUpdate();
this.onSetEndTime() this.onSetEndTime()
...@@ -822,7 +832,7 @@ ...@@ -822,7 +832,7 @@
onCancle() { onCancle() {
this.$refs.confirmPop.close(); this.$refs.confirmPop.close();
}, },
onOrderConfirm(){ onOrderConfirm() {
if (!this.useDateStatus) { if (!this.useDateStatus) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
...@@ -830,9 +840,24 @@ ...@@ -830,9 +840,24 @@
}) })
return return
} }
this.$refs.confirmPop.open(); if (uni.getStorageSync("orderUseMessage")) {
this.$refs.confirmPop.open();
}else{
wx.requestSubscribeMessage({
tmplIds: ['K8fbcKVq46w9o7Ekpesn74WPjwxnbso947YZiYBQw9c',
'HB2_moQRQrXC2cKw6zE08NU3AQO9Ggj3aAOg0lIgecg',
'oTc000e4NHkoc7v9OLBZiwM6Q6SFzguemrx6d0iuVS8'
],
success: (res) => {
uni.setStorageSync("orderUseMessage", true);
this.$refs.confirmPop.open();
},
complete: (res) => {
console.log(res, 909090)
}
})
}
}, },
onOrderCreate() { onOrderCreate() {
this.onCancle(); this.onCancle();
uni.showLoading({ uni.showLoading({
...@@ -850,22 +875,22 @@ ...@@ -850,22 +875,22 @@
preEndDate: dateObj.endDate, preEndDate: dateObj.endDate,
totalFee: Number(this.roomInfo.price) * this.duration, totalFee: Number(this.roomInfo.price) * this.duration,
payFee: this.computePriceInfo.payFee || 0, payFee: this.computePriceInfo.payFee || 0,
packId:this.index>0? this.packageMode[this.modeIndex].id : '' packId: this.index > 0 ? this.packageMode[this.modeIndex].id : ''
} }
if(this.orderType === 2 && this.preOrderNo){ if (this.orderType === 2 && this.preOrderNo) {
params.preOrderNo = this.preOrderNo params.preOrderNo = this.preOrderNo
} }
orderCreate(params).then(res => { orderCreate(params).then(res => {
uni.hideLoading() uni.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
if(res.data.data.jsConfig){ if (res.data.data.jsConfig) {
wx.requestPayment({ wx.requestPayment({
"timeStamp": res.data.data.jsConfig.timeStamp, "timeStamp": res.data.data.jsConfig.timeStamp,
"nonceStr": res.data.data.jsConfig.nonceStr, "nonceStr": res.data.data.jsConfig.nonceStr,
"package": res.data.data.jsConfig.packages, "package": res.data.data.jsConfig.packages,
"signType": res.data.data.jsConfig.signType, "signType": res.data.data.jsConfig.signType,
"paySign": res.data.data.jsConfig.paySign, "paySign": res.data.data.jsConfig.paySign,
"success":(resp)=>{ "success": (resp) => {
// 支付成功 // 支付成功
uni.showToast({ uni.showToast({
icon: "success", icon: "success",
...@@ -873,33 +898,31 @@ ...@@ -873,33 +898,31 @@
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/orderResult/orderResult?orderNo=" + url: `/pages/orderResult/orderResult?orderNo=${res.data.data.orderNo}&success=true`
res.data.data.orderNo
}) })
}, 1500) }, 1500)
} }
}) })
}, },
"fail":(resp)=>{ "fail": (resp) => {
// 取消支付或支付失败 // 取消支付或支付失败
uni.showToast({ uni.showToast({
title: "取消支付或支付失败" title: "取消支付或支付失败"
}) })
// 调用取消订单接口 // 调用取消订单接口
}, },
"complete":(resp)=>{ "complete": (resp) => {
// 接口调用结束的回调函数(调用成功、失败都会执行) // 接口调用结束的回调函数(调用成功、失败都会执行)
} }
}); });
}else{ } else {
uni.showToast({ uni.showToast({
icon: "success", icon: "success",
title: "下单成功", title: "下单成功",
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/orderResult/orderResult?orderNo=" + url: `/pages/orderResult/orderResult?orderNo=${res.data.data.orderNo}&success=true`
res.data.data.orderNo
}) })
}, 1000) }, 1000)
} }
...@@ -907,8 +930,8 @@ ...@@ -907,8 +930,8 @@
} }
} else { } else {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:res.data.msg || "下单失败" title: res.data.msg || "下单失败"
}) })
} }
}) })
...@@ -935,35 +958,35 @@ ...@@ -935,35 +958,35 @@
title: "功能暂未开发" title: "功能暂未开发"
}) })
}, },
onNavToCheckedCoupon(){ onNavToCheckedCoupon() {
uni.navigateTo({ uni.navigateTo({
url:"/pages/couponCheck/couponCheck?openShopUuid="+this.roomInfo.openShopUuid, url: "/pages/couponCheck/couponCheck?openShopUuid=" + this.roomInfo.openShopUuid,
events: { events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptData(data){ acceptData(data) {
if(data.data){ if (data.data) {
this.onGetUseCoupon() this.onGetUseCoupon()
} }
} }
} }
}) })
}, },
onSelectDatePoint(val,i){ onSelectDatePoint(val, i) {
console.log(val,i) console.log(val, i)
if(i<24){ if (i < 24) {
if(val.status ==1){ if (val.status == 1) {
let mTime=moment(val.endHoldTime).format("mm") let mTime = moment(val.endHoldTime).format("mm")
console.log(mTime,"分钟数据") console.log(mTime, "分钟数据")
if( mTime>= '59' ){ if (mTime >= '59') {
uni.showToast({ uni.showToast({
icon:'none', icon: 'none',
title:'当前时段不可选' title: '当前时段不可选'
}) })
}else{ } else {
this.startTime = `${i}:${mTime}`; this.startTime = `${i}:${mTime}`;
this.onSetEndTime() this.onSetEndTime()
} }
}else{ } else {
this.startTime = `${i}:00`; this.startTime = `${i}:00`;
this.onSetEndTime() this.onSetEndTime()
} }
...@@ -1010,24 +1033,29 @@ ...@@ -1010,24 +1033,29 @@
padding: 30upx; padding: 30upx;
background-color: #ffffff; background-color: #ffffff;
align-items: center; align-items: center;
.part-2 {
display: flex; .part-2 {
align-items: center; display: flex;
width: 100%; align-items: center;
height: 100upx; width: 100%;
background: #F8EDDD; height: 100upx;
border-radius: 50rpx; background: #F8EDDD;
padding: 0 30upx; border-radius: 50rpx;
.tips{ padding: 0 30upx;
line-height: 36upx;
} .tips {
text{ line-height: 36upx;
color: #C98D35;
}
} }
text {
color: #C98D35;
}
}
.part-left { .part-left {
display: block; display: block;
width: 100%; width: 100%;
image { image {
display: block; display: block;
width: 100%; width: 100%;
...@@ -1041,38 +1069,44 @@ ...@@ -1041,38 +1069,44 @@
align-items: center; align-items: center;
width: 100%; width: 100%;
padding: 20upx 6upx; padding: 20upx 6upx;
.status-icon-box{
.status-icon-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.status-box{
.status-box {
background: #F0F9EB; background: #F0F9EB;
border: 2upx solid #67C23A; border: 2upx solid #67C23A;
box-shadow: 0rpx 5rpx 13rpx 0rpx rgba(0,0,0,0.1); box-shadow: 0rpx 5rpx 13rpx 0rpx rgba(0, 0, 0, 0.1);
border-radius: 6px; border-radius: 6px;
font-size: 28upx; font-size: 28upx;
padding: 8upx 30upx 8upx 16upx; padding: 8upx 30upx 8upx 16upx;
color: #67C23A; color: #67C23A;
} }
.status-box-0{
.status-box-0 {
background: #F0F9EB; background: #F0F9EB;
border: 2upx solid #67C23A; border: 2upx solid #67C23A;
color: #67C23A; color: #67C23A;
} }
.status-box-1{
.status-box-1 {
background: #FDF6EC; background: #FDF6EC;
border: 2upx solid #F5DAB1; border: 2upx solid #F5DAB1;
color: #F5DAB1; color: #F5DAB1;
} }
.status-box-3{
.status-box-3 {
background: #ECF5FF; background: #ECF5FF;
border: 2upx solid #B3D8FF; border: 2upx solid #B3D8FF;
color: #B3D8FF; color: #B3D8FF;
} }
.img{
.img {
width: 68upx; width: 68upx;
margin-left: -30upx; margin-left: -30upx;
max-height: 180upx ; max-height: 180upx;
} }
} }
...@@ -1093,6 +1127,7 @@ ...@@ -1093,6 +1127,7 @@
justify-content: center; justify-content: center;
width: 100%; width: 100%;
background: #ffffff; background: #ffffff;
.tab-item { .tab-item {
position: relative; position: relative;
display: flex; display: flex;
...@@ -1100,12 +1135,14 @@ ...@@ -1100,12 +1135,14 @@
align-items: center; align-items: center;
height: 80upx; height: 80upx;
width: 36%; width: 36%;
text { text {
color: #000000; color: #000000;
font-size: 34upx; font-size: 34upx;
font-weight: 600; font-weight: 600;
} }
.line{
.line {
position: absolute; position: absolute;
width: 30%; width: 30%;
height: 2px; height: 2px;
...@@ -1119,40 +1156,46 @@ ...@@ -1119,40 +1156,46 @@
text { text {
color: #DBA556; color: #DBA556;
} }
.line{
.line {
background: #DBA556; background: #DBA556;
} }
} }
} }
.date-content-box{ .date-content-box {
width: 100%; width: 100%;
background-color: #FFF7F5; background-color: #FFF7F5;
} }
.date-tips{
.date-tips {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
width: 92%; width: 92%;
margin: 30upx auto 12upx; margin: 30upx auto 12upx;
.text-2{ .text-2 {
color: #8C8C8C; color: #8C8C8C;
} }
} }
.date-box { .date-box {
position: relative; position: relative;
margin: 10upx 30upx; margin: 10upx 30upx;
.date-item { .date-item {
position: relative; position: relative;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 40upx 0 12upx 0; padding: 40upx 0 12upx 0;
z-index: 10; z-index: 10;
text { text {
color: #6B0000; color: #6B0000;
} }
.text-first{
.text-first {
letter-spacing: 4upx; letter-spacing: 4upx;
} }
} }
...@@ -1170,7 +1213,8 @@ ...@@ -1170,7 +1213,8 @@
width: 20%; width: 20%;
height: 100%; height: 100%;
transition: left 0.3s ease-in-out; transition: left 0.3s ease-in-out;
.img{
.img {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 12upx; border-radius: 12upx;
...@@ -1178,16 +1222,19 @@ ...@@ -1178,16 +1222,19 @@
} }
} }
.data-content-box{ .data-content-box {
width: 100%; width: 100%;
background-color: #ffffff; background-color: #ffffff;
} }
.package-mode { .package-mode {
padding: 0 30upx 30upx; padding: 0 30upx 30upx;
border-bottom: 2upx solid #F1F1F1; border-bottom: 2upx solid #F1F1F1;
.part-1{
.part-1 {
margin: 30upx 0; margin: 30upx 0;
} }
.package-box { .package-box {
.item { .item {
margin: 0 1.5%; margin: 0 1.5%;
...@@ -1196,22 +1243,27 @@ ...@@ -1196,22 +1243,27 @@
border: 1px solid transparent; border: 1px solid transparent;
border-radius: 12upx; border-radius: 12upx;
padding: 12upx 0; padding: 12upx 0;
color: #333333; color: #333333;
background-color: #F7F8FA; background-color: #F7F8FA;
.flex-row { .flex-row {
align-items: flex-end; align-items: flex-end;
} }
} }
.item-3{
.item-3 {
width: 30%; width: 30%;
} }
.item-n{
.item-n {
flex: 1; flex: 1;
} }
.active { .active {
background: #FBF6EE; background: #FBF6EE;
border: 1px solid #DBA556; border: 1px solid #DBA556;
text{
text {
color: #B67D32; color: #B67D32;
} }
} }
...@@ -1221,9 +1273,10 @@ ...@@ -1221,9 +1273,10 @@
.distance-mode { .distance-mode {
margin: 10upx 30upx; margin: 10upx 30upx;
.distance-title{ .distance-title {
margin: 20upx 0; margin: 20upx 0;
} }
.distance-box { .distance-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -1239,24 +1292,28 @@ ...@@ -1239,24 +1292,28 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
width: 100%; width: 100%;
.part-1{
.part-1 {
display: flex; display: flex;
flex: 1; flex: 1;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.part-2{
.part-2 {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 60upx; width: 60upx;
} }
.part-3{
text{ .part-3 {
text {
color: #8C8C8C; color: #8C8C8C;
} }
} }
.cu-btn { .cu-btn {
width: 80%; width: 80%;
font-size: 32upx; font-size: 32upx;
...@@ -1358,18 +1415,20 @@ ...@@ -1358,18 +1415,20 @@
background-color: #ffffff; background-color: #ffffff;
margin-top: 30upx; margin-top: 30upx;
min-height: 300upx; min-height: 300upx;
padding:0 0 15upx; padding: 0 0 15upx;
overflow: hidden; overflow: hidden;
align-items: center; align-items: center;
.text-left{ .text-left {
width: 120upx; width: 120upx;
text-align-last: justify; text-align-last: justify;
} }
.original-price { .original-price {
width: 100%; width: 100%;
padding: 30upx 30upx 15upx; padding: 30upx 30upx 15upx;
.flex-row{
.flex-row {
align-items: flex-end; align-items: flex-end;
} }
...@@ -1385,11 +1444,12 @@ ...@@ -1385,11 +1444,12 @@
} }
} }
.use-coupon-box{ .use-coupon-box {
.flex-row{ .flex-row {
max-width: 70%; max-width: 70%;
} }
} }
.line { .line {
width: 94%; width: 94%;
border-top: 2upx solid rgba(255, 170, 255, 0.8); border-top: 2upx solid rgba(255, 170, 255, 0.8);
...@@ -1407,9 +1467,10 @@ ...@@ -1407,9 +1467,10 @@
width: 100%; width: 100%;
height: 120rpx; height: 120rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 5rpx 25rpx 0rpx rgba(0,0,0,0.1); box-shadow: 0rpx 5rpx 25rpx 0rpx rgba(0, 0, 0, 0.1);
padding: 0 30upx; padding: 0 30upx;
z-index: 111; z-index: 111;
>.flex-row { >.flex-row {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -1422,12 +1483,13 @@ ...@@ -1422,12 +1483,13 @@
color: #e03997; color: #e03997;
} }
} }
.btn-box{
.cu-btn-1{ .btn-box {
.cu-btn-1 {
width: 159rpx; width: 159rpx;
line-height: 58rpx; line-height: 58rpx;
background: linear-gradient(97deg, #FADB4A, #FFA751); background: linear-gradient(97deg, #FADB4A, #FFA751);
box-shadow: 0rpx 5rpx 9rpx 0rpx rgba(54,4,9,0.42); box-shadow: 0rpx 5rpx 9rpx 0rpx rgba(54, 4, 9, 0.42);
opacity: 0.95; opacity: 0.95;
border-radius: 29rpx; border-radius: 29rpx;
font-size: 30upx; font-size: 30upx;
...@@ -1435,11 +1497,12 @@ ...@@ -1435,11 +1497,12 @@
color: #ffffff; color: #ffffff;
padding: 0; padding: 0;
} }
.cu-btn-2{
.cu-btn-2 {
width: 159rpx; width: 159rpx;
line-height: 58rpx; line-height: 58rpx;
background: linear-gradient(97deg, #E5268B, #FD5661); background: linear-gradient(97deg, #E5268B, #FD5661);
box-shadow: 0rpx 5rpx 9rpx 0rpx rgba(54,4,9,0.42); box-shadow: 0rpx 5rpx 9rpx 0rpx rgba(54, 4, 9, 0.42);
opacity: 0.95; opacity: 0.95;
border-radius: 29rpx; border-radius: 29rpx;
text-align: center; text-align: center;
...@@ -1480,17 +1543,20 @@ ...@@ -1480,17 +1543,20 @@
min-height: 50vh; min-height: 50vh;
background-color: #ffffff; background-color: #ffffff;
border-radius: 20upx; border-radius: 20upx;
.info-box { .info-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 92%; width: 92%;
margin: 0 auto; margin: 0 auto;
padding-top: 12upx 0; padding-top: 12upx 0;
.info { .info {
padding: 12upx 0; padding: 12upx 0;
font-size: 20upx; font-size: 20upx;
} }
} }
.title { .title {
display: flex; display: flex;
justify-content: center; justify-content: center;
...@@ -1499,18 +1565,21 @@ ...@@ -1499,18 +1565,21 @@
padding: 20upx; padding: 20upx;
border-bottom: 1px solid #ffaaff; border-bottom: 1px solid #ffaaff;
} }
.flex-1{
.flex-1 {
display: flex; display: flex;
flex: 1; flex: 1;
width: 100%; width: 100%;
justify-content: center; justify-content: center;
padding-top: 40upx; padding-top: 40upx;
.tip-box{
.tip-box {
padding-top: 40upx; padding-top: 40upx;
width: 92%; width: 92%;
border-top: 1px dashed #ffaaff; border-top: 1px dashed #ffaaff;
.flex-col{
text{ .flex-col {
text {
line-height: 52upx; line-height: 52upx;
} }
} }
...@@ -1529,5 +1598,4 @@ ...@@ -1529,5 +1598,4 @@
} }
} }
} }
</style> </style>
\ No newline at end of file
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<text class="cuIcon cuIcon-title text-pink"></text> <text class="cuIcon cuIcon-title text-pink"></text>
<text class="text-title text-bold text-xl">{{item.storeName||'门店名称'}}</text> <text class="text-title text-bold text-xl">{{item.storeName||'门店名称'}}</text>
</view> </view>
<text :class="item.status==1?'text-pink':item.status==0?'text-cyan':item.status==2?'text-gray':'text-red'">{{orderStatusEnum[item.status]}}</text> <text :class="item.status==1?'text-pink':item.status==0?'text-cyan':item.status==2?'text-gray':'text-red'">{{item.status>=3? refundStatusEnum[item.refundStatus]: orderStatusEnum[item.status]}}</text>
</view> </view>
<view class="flex-row room-image-box"> <view class="flex-row room-image-box">
...@@ -162,7 +162,12 @@ import NoLogin from "@/components/noLogin/noLogin" ...@@ -162,7 +162,12 @@ import NoLogin from "@/components/noLogin/noLogin"
}, },
loginStatus:true, loginStatus:true,
orderStatusEnum:{}, orderStatusEnum:{},
roomTypeEnum:{} roomTypeEnum:{},
refundStatusEnum:{
1:'退款中',
2:'退款中',
3:'已退款'
}
}; };
}, },
onLoad() { onLoad() {
......
...@@ -80,7 +80,7 @@ ...@@ -80,7 +80,7 @@
<view class="part"> <view class="part">
<button class="cu-btn block round line-pink lg" @tap="onNavToShare">分享好友</button> <button class="cu-btn block round line-pink lg" @tap="onNavToShare">分享好友</button>
</view> </view>
<view class="part"> <view v-is="orderInfo.status == 1" class="part">
<button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button> <button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button>
</view> </view>
</view> </view>
...@@ -140,7 +140,10 @@ ...@@ -140,7 +140,10 @@
this.orderNo = option.orderNo; this.orderNo = option.orderNo;
this.onGetDicts() this.onGetDicts()
this.onLoading(); this.onLoading();
this.onMessagePush() if(option.success){
this.onMessagePush()
}
}, },
methods:{ methods:{
onGetDicts() { onGetDicts() {
...@@ -237,15 +240,7 @@ ...@@ -237,15 +240,7 @@
}) })
}, },
onMessagePush(){ onMessagePush(){
if( !uni.getStorageSync("orderUseMessage")){
uni.requestSubscribeMessage({
tmplIds:['oTc000e4NHkoc7v9OLBZiwM6Q6SFzguemrx6d0iuVS8'],
complete: (res) => {
console.log(res,909090)
uni.setStorageSync("orderUseMessage",true);
}
})
}
} }
} }
} }
......
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