Commit 60755f0c by zhangzhen

细节优化

parent ae7d46f5
...@@ -66,10 +66,11 @@ ...@@ -66,10 +66,11 @@
<script> <script>
import {dictList} from "@/api/index.js"; import {dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.js"
import indexConfig from "@/config/index.config"; import indexConfig from "@/config/index.config";
import FixedHeader from "@/components/fixedHeader/index"; import FixedHeader from "@/components/fixedHeader/index";
import {getCouponList} from "@/api/coupon" import {getCouponList} from "@/api/coupon"
import {getDictItem} from "@/utils/tools.js"
export default { export default {
data() { data() {
......
...@@ -59,7 +59,8 @@ ...@@ -59,7 +59,8 @@
</view> </view>
<view v-for="(item,k) in dateList" :key="k" class="flex-1 flex-col date-item" <view v-for="(item,k) in dateList" :key="k" class="flex-1 flex-col date-item"
:class="{active:dateIndex === k}" @tap="onDateChange(k)"> :class="{active:dateIndex === k}" @tap="onDateChange(k)">
<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>
<text class="text-title text-bold" style="margin-top: 12upx;">{{ item.date}}</text> <text class="text-title text-bold" style="margin-top: 12upx;">{{ item.date}}</text>
</view> </view>
</view> </view>
...@@ -70,15 +71,14 @@ ...@@ -70,15 +71,14 @@
<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>
<scroll-view scroll-x="true" class="scroll-view" > <scroll-view scroll-x="true" class="scroll-view">
<view class="flex-row package-box"> <view class="flex-row 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}" :class="{active: modeIndex===index}" @tap="onChangeMode(index)">
@tap="onChangeMode(index)">
<text class="text-title">{{item.name}}</text> <text class="text-title">{{item.name}}</text>
<view class="flex-row" style="margin-top: 8upx;"> <view class="flex-row" style="margin-top: 8upx;">
<!-- <text>{{item.duration}}小时/</text>--> <!-- <text>{{item.duration}}小时/</text>-->
<text style="margin-bottom: 2upx;" ></text> <text style="margin-bottom: 2upx;"></text>
<text class="text-bold text-xl">{{item.price}}</text> <text class="text-bold text-xl">{{item.price}}</text>
</view> </view>
</view> </view>
...@@ -105,7 +105,8 @@ ...@@ -105,7 +105,8 @@
</view> </view>
</view> </view>
<view v-if="orderType ===2 && index == 0" class="flex-col distance-mode" style="margin: 40upx 20upx 40upx;"> <view v-if="orderType ===2 && index == 0" class="flex-col distance-mode"
style="margin: 40upx 20upx 40upx;">
<view class="distance-title"> <view class="distance-title">
<text class="text-title text-lg text-bold">时长选择:</text> <text class="text-title text-lg text-bold">时长选择:</text>
</view> </view>
...@@ -171,8 +172,7 @@ ...@@ -171,8 +172,7 @@
</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"
v-if="k>=startHours && k<=endHours" v-if="k>=startHours && k<=endHours" @tap="onSelectDatePoint(item,k)">
@tap="onSelectDatePoint(item,k)">
<view class="date-point" <view class="date-point"
:class="item.status === 0 || (item.status==1 && item.m <59) ?'free':item.status==1 && item.m >=59?'used': item.status==2?'checked':'error'"> :class="item.status === 0 || (item.status==1 && item.m <59) ?'free':item.status==1 && item.m >=59?'used': item.status==2?'checked':'error'">
</view> </view>
...@@ -203,7 +203,8 @@ ...@@ -203,7 +203,8 @@
</view> </view>
</view> </view>
<view class="flex-between price use-coupon-box"> <view class="flex-between price use-coupon-box">
<text class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text> <text
class="text-black text-left">{{useCouponList[selectCouponIndex].couponType==2? '团购券':'优惠券'}}</text>
<view class="flex-row" @tap="onNavToSelectCoupon"> <view class="flex-row" @tap="onNavToSelectCoupon">
<text class="" :class="useCouponList.length?'text-pink':'text-gray'"> <text class="" :class="useCouponList.length?'text-pink':'text-gray'">
{{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: couponList.length? '请选择':'暂无可用'}}</text> {{ useCouponList.length && selectCouponIndex>=0? useCouponList[selectCouponIndex].name: couponList.length? '请选择':'暂无可用'}}</text>
...@@ -228,8 +229,7 @@ ...@@ -228,8 +229,7 @@
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<button class="cu-btn cu-btn-1 margin-right" <button class="cu-btn cu-btn-1 margin-right" @tap="onNavToCheckedCoupon">团购验券</button>
@tap="onNavToCheckedCoupon">团购验券</button>
<button class="cu-btn cu-btn-2 " @tap="onOrderConfirmBefore">{{orderType===1?'预约':'续单'}} </button> <button class="cu-btn cu-btn-2 " @tap="onOrderConfirmBefore">{{orderType===1?'预约':'续单'}} </button>
</view> </view>
</view> </view>
...@@ -241,8 +241,8 @@ ...@@ -241,8 +241,8 @@
<view class="action text-pink" @tap="onSelectedDate">确定</view> <view class="action text-pink" @tap="onSelectedDate">确定</view>
</view> </view>
<view class="select-box"> <view class="select-box">
<picker-view class="picker-view" indicator-style="height: 42px;" :immediate-change="true" v-model="checkedDateList" <picker-view class="picker-view" indicator-style="height: 42px;" :immediate-change="true"
@change="onBindChange"> v-model="checkedDateList" @change="onBindChange">
<picker-view-column> <picker-view-column>
<view class="item" v-for="(item,index) in hourList" :key="index"> <view class="item" v-for="(item,index) in hourList" :key="index">
<text>{{item}}</text> <text>{{item}}</text>
...@@ -265,8 +265,8 @@ ...@@ -265,8 +265,8 @@
<view class="action text-pink" @tap="onSelectedDuration">确定</view> <view class="action text-pink" @tap="onSelectedDuration">确定</view>
</view> </view>
<view class="select-box"> <view class="select-box">
<picker-view class="picker-view" indicator-style="height: 42px;" :immediate-change="true" v-model="durationIndex2" <picker-view class="picker-view" indicator-style="height: 42px;" :immediate-change="true"
@change="onBindDuratin"> v-model="durationIndex2" @change="onBindDuratin">
<picker-view-column> <picker-view-column>
<view class="item" v-for="(item,index) in hourList2" :key="index"> <view class="item" v-for="(item,index) in hourList2" :key="index">
<text>{{item}}小时</text> <text>{{item}}小时</text>
...@@ -325,15 +325,8 @@ ...@@ -325,15 +325,8 @@
<LoginPop ref="loginPop" @success='onLoading' /> <LoginPop ref="loginPop" @success='onLoading' />
<uni-popup ref="popupConfirm" type="dialog"> <uni-popup ref="popupConfirm" type="dialog">
<uni-popup-dialog <uni-popup-dialog type="warn" mode="base" :content="content" :duration="2000" :before-close="true"
type="warn" @close="close" @confirm="confirm"></uni-popup-dialog>
mode="base"
:content="content"
:duration="2000"
:before-close="true"
@close="close"
@confirm="confirm"
></uni-popup-dialog>
</uni-popup> </uni-popup>
<uni-popup ref="popupMessage" type="center"> <uni-popup ref="popupMessage" type="center">
...@@ -386,7 +379,7 @@ ...@@ -386,7 +379,7 @@
data() { data() {
return { return {
id: '', id: '',
orderType: 1,//订单模式,1:下单;2续单 orderType: 1, //订单模式,1:下单;2续单
payWay: 1, payWay: 1,
hostUrl: config.hostUrl, hostUrl: config.hostUrl,
assetsPath: config.assetsPath, assetsPath: config.assetsPath,
...@@ -396,7 +389,7 @@ ...@@ -396,7 +389,7 @@
startTime: moment().format("HH:mm"), startTime: moment().format("HH:mm"),
endTime: '12:00', endTime: '12:00',
dateIndex: 0, dateIndex: 0,
dateList:[ dateList: [
// { // {
// date:"02-28", // date:"02-28",
// readDate:'2024-02-28', // readDate:'2024-02-28',
...@@ -459,8 +452,8 @@ ...@@ -459,8 +452,8 @@
"16", "16",
"17", "18", "19", "20", "21", "22", "23" "17", "18", "19", "20", "21", "22", "23"
], ],
durationIndex2:[0], durationIndex2: [0],
hourList2: [4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24], hourList2: [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
minuteList: ['00', "30"], minuteList: ['00', "30"],
orderTypeEnum: { orderTypeEnum: {
1: "预定", 1: "预定",
...@@ -482,37 +475,37 @@ ...@@ -482,37 +475,37 @@
roomStatusEnum: {}, roomStatusEnum: {},
roomTypeEnum: {}, roomTypeEnum: {},
setStartTime: { setStartTime: {
status:false, status: false,
startTime:'', startTime: '',
startDate:'', startDate: '',
duration:0, duration: 0,
days:1 days: 1
}, },
days:1, days: 1,
addM:false,//初始化加一分钟,之后不加 addM: false, //初始化加一分钟,之后不加
startHours:0, startHours: 0,
endHours:48, endHours: 48,
content:'', content: '',
toDayDate: '', // 今天日期 toDayDate: '', // 今天日期
}; };
}, },
filters:{ filters: {
resetStartTime(val){ resetStartTime(val) {
let hour = val.split(':').map((n,k)=> { let hour = val.split(':').map((n, k) => {
let t = Number(n) let t = Number(n)
if(k == 0){ if (k == 0) {
if(n>=24){ if (n >= 24) {
t = n>=24? n-24: n t = n >= 24 ? n - 24 : n
} }
} }
return t>=10? t: `0${t}` return t >= 10 ? t : `0${t}`
}).join(":") }).join(":")
return hour; return hour;
} }
}, },
watch:{ watch: {
dateIndex(){ dateIndex() {
this.onSetSelectTime() this.onSetSelectTime()
this.onSetStartHours() this.onSetStartHours()
} }
...@@ -539,41 +532,45 @@ ...@@ -539,41 +532,45 @@
} }
}, },
methods: { methods: {
onInitDateList(){ onInitDateList() {
this.toDayDate = moment().format("YYYY-MM-DD") this.toDayDate = moment().format("YYYY-MM-DD")
let dateList = []; let dateList = [];
for (let i = 0; i < 5; i++) { for (let i = 0; i < 5; i++) {
let obj = { let obj = {
date: this.dateList.length? moment(this.dateList[1].readDate).add(i, "days").format("MM-DD"):moment().add(i, "days").format("MM-DD"), date: this.dateList.length ? moment(this.dateList[1].readDate).add(i, "days").format("MM-DD") :
readDate: this.dateList.length? moment(this.dateList[1].readDate).add(i, "days").format("YYYY-MM-DD") : moment().add(i, "days").format("YYYY-MM-DD"), moment().add(i, "days").format("MM-DD"),
weekday: this.dateList.length? moment(this.dateList[1].readDate).add(i, "days").format("dddd") : moment().add(i, "days").format("dddd") readDate: this.dateList.length ? moment(this.dateList[1].readDate).add(i, "days").format(
"YYYY-MM-DD") : moment().add(i, "days").format("YYYY-MM-DD"),
weekday: this.dateList.length ? moment(this.dateList[1].readDate).add(i, "days").format(
"dddd") : moment().add(i, "days").format("dddd")
} }
dateList.push(obj) dateList.push(obj)
} }
this.dateList = dateList; this.dateList = dateList;
}, },
onSetSelectTime(){ onSetSelectTime() {
if(this.dateIndex === 0){ if (this.dateIndex === 0) {
let h = Number(moment().format("HH")) let h = Number(moment().format("HH"))
this.hourList = this.hourList.filter(item=> Number(item)>=h).map(item=> { this.hourList = this.hourList.filter(item => Number(item) >= h).map(item => {
let i = Number(item) let i = Number(item)
return i>=10? i: `0${i}` return i >= 10 ? i : `0${i}`
} ) })
}else{ } else {
this.hourList = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", this.hourList = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13",
"14", "15",
"16", "16",
"17", "18", "19", "20", "21", "22", "23" "17", "18", "19", "20", "21", "22", "23"
] ]
} }
}, },
onSetStartHours(){ onSetStartHours() {
if(this.dateIndex === 0){ if (this.dateIndex === 0) {
this.startHours = Number(moment().format("HH")); this.startHours = Number(moment().format("HH"));
}else{ } else {
this.startHours = 0 this.startHours = 0
} }
this.endHours = this.startHours+23; this.endHours = this.startHours + 23;
this.onSetSelectTime(); this.onSetSelectTime();
}, },
onGetDicts() { onGetDicts() {
...@@ -609,7 +606,7 @@ ...@@ -609,7 +606,7 @@
// 判断房间有没有绑定套餐 // 判断房间有没有绑定套餐
if (this.roomInfo.packList && this.roomInfo.packList.length) { if (this.roomInfo.packList && this.roomInfo.packList.length) {
this.packageMode = this.roomInfo.packList this.packageMode = this.roomInfo.packList
if(this.orderType === 1){ if (this.orderType === 1) {
this.index = 1; this.index = 1;
} }
this.modeIndex = 0; this.modeIndex = 0;
...@@ -646,26 +643,26 @@ ...@@ -646,26 +643,26 @@
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
day: this.dateList[this.dateIndex].readDate, day: this.dateList[this.dateIndex].readDate,
orderType:this.orderType orderType: this.orderType
}).then(res => { }).then(res => {
uni.hideLoading() uni.hideLoading()
if (this.orderTypeList[this.index].type == 2){ if (this.orderTypeList[this.index].type == 2) {
this.duration = Number(this.packageMode[this.modeIndex].duration); this.duration = Number(this.packageMode[this.modeIndex].duration);
}else{ } else {
this.duration = Number(this.distanceMode[this.distanceIndex].duration); this.duration = Number(this.distanceMode[this.distanceIndex].duration);
} }
this.dateIntervalList = res.data.data.map((item, index) => { this.dateIntervalList = res.data.data.map((item, index) => {
return { return {
...item, ...item,
m:item.endHoldTime? Number(moment(item.endHoldTime).format("mm")):0, m: item.endHoldTime ? Number(moment(item.endHoldTime).format("mm")) : 0,
hour: index > 0 && index - 24 == 0 ? '次日' : index > 24 ? index - 24 : index hour: index > 0 && index - 24 == 0 ? '次日' : index > 24 ? index - 24 : index
} }
}) })
if(this.orderType === 2){ if (this.orderType === 2) {
this.onSetEndTime() this.onSetEndTime()
}else{ } else {
this.onCheckDate(); this.onCheckDate();
} }
}) })
...@@ -745,9 +742,9 @@ ...@@ -745,9 +742,9 @@
// if(this.setStartTime.days >=2 || this.days == 2){ // if(this.setStartTime.days >=2 || this.days == 2){
// start +=24 // start +=24
// } // }
if (this.orderType ==2 && end < start){ if (this.orderType == 2 && end < start) {
end += 24 end += 24
}else if(this.orderType ==1 && end <= start) { } else if (this.orderType == 1 && end <= start) {
end += 24 end += 24
} }
this.dateObj = await this.onSetDateTime(this.startTime, this.endTime); this.dateObj = await this.onSetDateTime(this.startTime, this.endTime);
...@@ -758,12 +755,13 @@ ...@@ -758,12 +755,13 @@
] ]
for (let index = start; index <= end; index++) { for (let index = start; index <= end; index++) {
let endTimeM = 0 let endTimeM = 0
if(this.dateIntervalList[index].status ==1){ if (this.dateIntervalList[index].status == 1) {
endTimeM = moment(this.dateIntervalList[index].startHoldTime).format('mm') endTimeM = moment(this.dateIntervalList[index].startHoldTime).format('mm')
} }
// 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前 // 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前
if ((this.dateIntervalList[index].status == 1 && index > start && index < start+this.duration)|| if ((this.dateIntervalList[index].status == 1 && index > start && index < start + this.duration) ||
(this.dateIntervalList[index].status == 1 && index == end && Number(startM)>= Number(endTimeM) ) (this.dateIntervalList[index].status == 1 && index == end && Number(startM) >= Number(
endTimeM))
) { ) {
// 表示时间点被占用,无法选择 // 表示时间点被占用,无法选择
this.useDateStatus = false this.useDateStatus = false
...@@ -797,22 +795,28 @@ ...@@ -797,22 +795,28 @@
preStartDate: this.dateObj.startDate, preStartDate: this.dateObj.startDate,
preEndDate: this.dateObj.endDate, preEndDate: this.dateObj.endDate,
orderType: this.orderType, orderType: this.orderType,
packageId: this.index>0? this.packageMode[this.modeIndex].id:'' packageId: this.index > 0 ? this.packageMode[this.modeIndex].id : ''
}).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.couponList = res.data.data; this.couponList = res.data.data;
let list = res.data.data.filter(item => item.isAvailable === 0).map(item=> { let list = res.data.data.filter(item => item.isAvailable === 0)
if (list.length) {
list = list.map(item => {
return { return {
...item, ...item,
subPrice: item.subPrice || 0 subPrice: item.subPrice || 0
} }
}) })
list.sort((a,b) => b.subPrice - a.subPrice) list.sort((a, b) => b.subPrice - a.subPrice)
this.useCouponList = list; this.useCouponList = list;
if(this.useCouponList.length){ let i = this.useCouponList.findIndex(item => item.duration == this.duration)
let i = this.useCouponList.findIndex(item=> item.duration == this.duration) this.selectCouponIndex = i >= 0 ? i : 0
this.selectCouponIndex = i>=0? i : 0; }else{
this.useCouponList = list;
this.selectCouponIndex = -1
} }
} }
} else if (res.data.code == 401) { } else if (res.data.code == 401) {
...@@ -828,9 +832,10 @@ ...@@ -828,9 +832,10 @@
url: "/pages/useCoupon/index", url: "/pages/useCoupon/index",
events: { events: {
getSelectData(data) { getSelectData(data) {
if(data.couponId){ if (data.couponId) {
that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data.couponId) that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data
}else{ .couponId)
} else {
that.selectCouponIndex = -1 that.selectCouponIndex = -1
} }
that.onComputePrice(); that.onComputePrice();
...@@ -843,9 +848,10 @@ ...@@ -843,9 +848,10 @@
orderMode: that.orderTypeList[that.index].type, orderMode: that.orderTypeList[that.index].type,
preStartDate: that.dateObj.startDate, preStartDate: that.dateObj.startDate,
orderType: that.orderType, orderType: that.orderType,
packageId:that.packageMode[that.modeIndex].id, packageId: that.packageMode[that.modeIndex].id,
preEndDate: that.dateObj.endDate, preEndDate: that.dateObj.endDate,
selectId: that.selectCouponIndex >= 0 ? that.useCouponList[that.selectCouponIndex].id :'' selectId: that.selectCouponIndex >= 0 ? that.useCouponList[that
.selectCouponIndex].id : ''
}) })
} }
}) })
...@@ -860,7 +866,8 @@ ...@@ -860,7 +866,8 @@
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
buyType: this.orderTypeList[this.index].type, buyType: this.orderTypeList[this.index].type,
couponId: this.useCouponList.length && this.selectCouponIndex >= 0 ? this.useCouponList[this.selectCouponIndex].id : '', couponId: this.useCouponList.length && this.selectCouponIndex >= 0 ? this.useCouponList[this
.selectCouponIndex].id : '',
orderType: this.orderType, orderType: this.orderType,
preStartDate: this.dateObj.startDate, preStartDate: this.dateObj.startDate,
preEndDate: this.dateObj.endDate, preEndDate: this.dateObj.endDate,
...@@ -873,10 +880,10 @@ ...@@ -873,10 +880,10 @@
// uni.hideLoading() // uni.hideLoading()
if (res.data.code == 200) { if (res.data.code == 200) {
this.computePriceInfo = res.data.data; this.computePriceInfo = res.data.data;
}else { } else {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:res.data.msg title: res.data.msg
}) })
} }
...@@ -895,20 +902,20 @@ ...@@ -895,20 +902,20 @@
this.index = i this.index = i
this.modeIndex = 0; this.modeIndex = 0;
this.addM = false; this.addM = false;
this.distanceIndex = this.orderType == 2? 1: 0; this.distanceIndex = this.orderType == 2 ? 1 : 0;
this.setStartTime = { this.setStartTime = {
status:false, status: false,
startTime:'', startTime: '',
startDate:'', startDate: '',
duration:0, duration: 0,
days:1 days: 1
} }
// if(Number(this.startTime.split(":")[0])< new Date().getHours()){ // if(Number(this.startTime.split(":")[0])< new Date().getHours()){
// this.days = 2 // this.days = 2
// }else{ // }else{
// this.days =1 // this.days =1
// } // }
this.days =1 this.days = 1
// this.checkedDateList= [0,0] // this.checkedDateList= [0,0]
// this.onSetEndTime(); // this.onSetEndTime();
this.onGetSortDistance(); this.onGetSortDistance();
...@@ -919,39 +926,40 @@ ...@@ -919,39 +926,40 @@
this.selectCouponIndex = -1; this.selectCouponIndex = -1;
this.useDateStatus = true; this.useDateStatus = true;
this.duration = Number(this.packageMode[this.modeIndex].duration); this.duration = Number(this.packageMode[this.modeIndex].duration);
let val = this.intervalList.findIndex(item=>item.status === 2) let val = this.intervalList.findIndex(item => item.status === 2)
let len = this.intervalList.filter(item=> item.status ===2).length; let len = this.intervalList.filter(item => item.status === 2).length;
let duration = Number(this.packageMode[this.modeIndex].duration); let duration = Number(this.packageMode[this.modeIndex].duration);
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 h = val; let h = val;
if(val>=24){ if (val >= 24) {
this.setStartTime.days = 2; this.setStartTime.days = 2;
this.days = 2; this.days = 2;
} }
if(val+duration>=24){ if (val + duration >= 24) {
h = val+duration-24 h = val + duration - 24
} else{ } else {
h = val+duration h = val + duration
} }
this.endTime = `${h>=10?h:'0'+h}:${startM>=10?startM:'0'+startM}`; this.endTime = `${h>=10?h:'0'+h}:${startM>=10?startM:'0'+startM}`;
this.intervalList = this.intervalList.map((item,index) =>{ this.intervalList = this.intervalList.map((item, index) => {
let status = item.status; let status = item.status;
if(index>=val && index<= val+duration){ if (index >= val && index <= val + duration) {
status = 2 status = 2
let endTimeM = 0 let endTimeM = 0
if(this.dateIntervalList[index].status ==1){ if (this.dateIntervalList[index].status == 1) {
endTimeM = moment(this.dateIntervalList[index].startHoldTime).format('mm') endTimeM = moment(this.dateIntervalList[index].startHoldTime).format('mm')
} }
if((this.dateIntervalList[index].status === 1 && index > val && index < val+duration) || if ((this.dateIntervalList[index].status === 1 && index > val && index < val + duration) ||
(this.dateIntervalList[index].status === 1 && index == val+duration && Number(startM)>= Number(endTimeM))){ (this.dateIntervalList[index].status === 1 && index == val + duration && Number(
startM) >= Number(endTimeM))) {
this.useDateStatus = false this.useDateStatus = false
} }
}else{ } else {
status = this.dateIntervalList[index].status status = this.dateIntervalList[index].status
} }
return { return {
...@@ -964,13 +972,14 @@ ...@@ -964,13 +972,14 @@
icon: "none", icon: "none",
title: "所选时段已被其他订单占用", title: "所选时段已被其他订单占用",
success: () => { success: () => {
setTimeout(async ()=>{ setTimeout(async () => {
this.dateObj =await this.onSetDateTime(this.startTime, this.endTime); this.dateObj = await this.onSetDateTime(this.startTime, this
.endTime);
this.onGetUseCoupon() this.onGetUseCoupon()
},1000) }, 1000)
} }
}) })
}else{ } else {
this.dateObj = this.onSetDateTime(this.startTime, this.endTime); this.dateObj = this.onSetDateTime(this.startTime, this.endTime);
this.onGetUseCoupon(); this.onGetUseCoupon();
} }
...@@ -999,8 +1008,8 @@ ...@@ -999,8 +1008,8 @@
storeId: this.roomInfo.storeId, storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id, roomId: this.roomInfo.id,
day: this.dateList[k].readDate, day: this.dateList[k].readDate,
orderType:this.orderType orderType: this.orderType
}).then(res=>{ }).then(res => {
// 今天可连续选择的时段 // 今天可连续选择的时段
let selectNum = 0; let selectNum = 0;
//预定节点 //预定节点
...@@ -1011,15 +1020,16 @@ ...@@ -1011,15 +1020,16 @@
let endDate = "" let endDate = ""
// 查询有无可预定的时段 // 查询有无可预定的时段
let todaySelectStatus = false; let todaySelectStatus = false;
res.data.data.forEach((val,i)=>{ res.data.data.forEach((val, i) => {
if(val.status ==1 && moment(val.endHoldTime).format('mm')<59 && selectNum == 0){ if (val.status == 1 && moment(val.endHoldTime).format('mm') < 59 && selectNum ==
0) {
startDate = moment(val.endHoldTime).format("YYYY-MM-DD HH:mm:ss") startDate = moment(val.endHoldTime).format("YYYY-MM-DD HH:mm:ss")
selectNum += 1 selectNum += 1
t = i t = i
} else if(val.status ==1 && selectNum > 0 ){ } else if (val.status == 1 && selectNum > 0) {
let start = moment(startDate).valueOf() let start = moment(startDate).valueOf()
let end = moment(val.startHoldTime).valueOf() let end = moment(val.startHoldTime).valueOf()
if(end-start >this.duration*60*60*1000){ if (end - start > this.duration * 60 * 60 * 1000) {
todaySelectStatus = true; todaySelectStatus = true;
} else { } else {
startDate = '' startDate = ''
...@@ -1027,28 +1037,29 @@ ...@@ -1027,28 +1037,29 @@
endDate = "" endDate = ""
t = -1 t = -1
} }
} else if(selectNum == 0 && !val.status){ } else if (selectNum == 0 && !val.status) {
startDate = val.timeHour+":00:00"; startDate = val.timeHour + ":00:00";
selectNum+=1 selectNum += 1
t = i t = i
}else if(selectNum>0 && !val.status){ } else if (selectNum > 0 && !val.status) {
// 计算时长 // 计算时长
let start = moment(startDate).valueOf() let start = moment(startDate).valueOf()
endDate = endDate? moment(endDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss") : moment(startDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss") endDate = endDate ? moment(endDate).add(1, 'h').format("YYYY-MM-DD HH:mm:ss") :
moment(startDate).add(1, 'h').format("YYYY-MM-DD HH:mm:ss")
let end = moment(endDate).valueOf() let end = moment(endDate).valueOf()
if(end-start > this.duration*60*60*1000){ if (end - start > this.duration * 60 * 60 * 1000) {
todaySelectStatus = true; todaySelectStatus = true;
} else { } else {
selectNum+=1 selectNum += 1
} }
} }
}) })
if((todaySelectStatus && t >=24) || !todaySelectStatus ){ if ((todaySelectStatus && t >= 24) || !todaySelectStatus) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:"当前日期无可预约时段" title: "当前日期无可预约时段"
}) })
return; return;
} }
...@@ -1064,9 +1075,9 @@ ...@@ -1064,9 +1075,9 @@
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(":").map((item,k)=>{ let arr = this.startTime.split(":").map((item, k) => {
let n = Number(item) let n = Number(item)
if(k === 0 && this.dateIndex === 0){ if (k === 0 && this.dateIndex === 0) {
n = this.hourList.findIndex(val => Number(val) === n) n = this.hourList.findIndex(val => Number(val) === n)
} }
return n return n
...@@ -1097,7 +1108,7 @@ ...@@ -1097,7 +1108,7 @@
}, },
// 选择完时间 // 选择完时间
onSelectedDate() { onSelectedDate() {
this.checkedDateList = this.checkedIndex.length?this.checkedIndex.map(item=>Number(item)):[0,0]; this.checkedDateList = this.checkedIndex.length ? this.checkedIndex.map(item => Number(item)) : [0, 0];
this.startTime = `${this.hourList[this.checkedDateList[0]]}:${this.minuteList[this.checkedDateList[1]]}`; this.startTime = `${this.hourList[this.checkedDateList[0]]}:${this.minuteList[this.checkedDateList[1]]}`;
this.$forceUpdate(); this.$forceUpdate();
//重新设置结束时间 //重新设置结束时间
...@@ -1132,7 +1143,7 @@ ...@@ -1132,7 +1143,7 @@
onCancle() { onCancle() {
this.$refs.confirmPop.close(); this.$refs.confirmPop.close();
}, },
onOrderConfirmBefore(){ onOrderConfirmBefore() {
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: [ tmplIds: [
'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg', 'UkvsRnZkZB_w3MqXPbRhi4jEk8ML4N9PWT3rnd3Bhxg',
...@@ -1141,17 +1152,17 @@ ...@@ -1141,17 +1152,17 @@
}, },
complete: (res) => { complete: (res) => {
console.log(res,909090) console.log(res, 909090)
// this.$refs.confirmPop.open(); // this.$refs.confirmPop.open();
this.onOrderConfirm(); this.onOrderConfirm();
} }
}) })
}, },
onOrderConfirm() { onOrderConfirm() {
if(this.roomInfo.roomStat >=3){ if (this.roomInfo.roomStat >= 3) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:'当前房间维护中,无法预定,请选择其他房间' title: '当前房间维护中,无法预定,请选择其他房间'
}) })
return; return;
} }
...@@ -1172,17 +1183,20 @@ ...@@ -1172,17 +1183,20 @@
let setTime = moment(this.dateObj.startDate).format("HHmm"); let setTime = moment(this.dateObj.startDate).format("HHmm");
// 如果当前时间大于开始时间,则不允许下单 // 如果当前时间大于开始时间,则不允许下单
if(this.orderType ==1 && nowDate == setDate && nowTime > setTime){ if (this.orderType == 1 && nowDate == setDate && nowTime > setTime) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:"当前时间晚于预约开始时间,请重新选择预约时间" title: "当前时间晚于预约开始时间,请重新选择预约时间"
}) })
return return
} }
if(this.orderTypeList[this.index].type ===2){ if (this.orderTypeList[this.index].type === 2) {
if(this.packageMode[this.modeIndex].packaEndPeriod-this.packageMode[this.modeIndex].packaStartPeriod<23 && Number(moment(this.dateObj.endDate).format("HH"))>=this.packageMode[this.modeIndex].packaEndPeriod ){ if (this.packageMode[this.modeIndex].packaEndPeriod - this.packageMode[this.modeIndex]
this.content=`所选套餐为限时套餐,订单结束时间为当日${Number(this.packageMode[this.modeIndex].packaEndPeriod)>=10?this.packageMode[this.modeIndex].packaEndPeriod:'0'+this.packageMode[this.modeIndex].packaEndPeriod}:00,请注意下单结束时间!` .packaStartPeriod < 23 && Number(moment(this.dateObj.endDate).format("HH")) >= this.packageMode[
this.modeIndex].packaEndPeriod) {
this.content =
`所选套餐为限时套餐,订单结束时间为当日${Number(this.packageMode[this.modeIndex].packaEndPeriod)>=10?this.packageMode[this.modeIndex].packaEndPeriod:'0'+this.packageMode[this.modeIndex].packaEndPeriod}:00,请注意下单结束时间!`
this.$refs.popupConfirm.open() this.$refs.popupConfirm.open()
return return
} }
...@@ -1196,10 +1210,10 @@ ...@@ -1196,10 +1210,10 @@
} }
this.$refs.confirmPop.open(); this.$refs.confirmPop.open();
}, },
close(){ close() {
this.$refs.popupConfirm.close() this.$refs.popupConfirm.close()
}, },
confirm(){ confirm() {
this.close() this.close()
if (!this.useDateStatus) { if (!this.useDateStatus) {
uni.showToast({ uni.showToast({
...@@ -1210,7 +1224,7 @@ ...@@ -1210,7 +1224,7 @@
} }
this.$refs.confirmPop.open(); this.$refs.confirmPop.open();
}, },
onOrder(){ onOrder() {
wx.requestSubscribeMessage({ wx.requestSubscribeMessage({
tmplIds: [ tmplIds: [
'HB2_moQRQrXC2cKw6zE08FF8UZJ5ue1h_qXZhvOkacc', 'HB2_moQRQrXC2cKw6zE08FF8UZJ5ue1h_qXZhvOkacc',
...@@ -1220,7 +1234,7 @@ ...@@ -1220,7 +1234,7 @@
}, },
complete: (res) => { complete: (res) => {
console.log(res,909090) console.log(res, 909090)
// this.$refs.confirmPop.open(); // this.$refs.confirmPop.open();
this.onOrderCreate(); this.onOrderCreate();
} }
...@@ -1237,7 +1251,8 @@ ...@@ -1237,7 +1251,8 @@
orderType: this.orderType, orderType: this.orderType,
buyType: this.orderTypeList[this.index].type, buyType: this.orderTypeList[this.index].type,
payType: 1, payType: 1,
couponId: this.useCouponList.length && this.selectCouponIndex >=0 ? this.useCouponList[this.selectCouponIndex].id : '', couponId: this.useCouponList.length && this.selectCouponIndex >= 0 ? this.useCouponList[this
.selectCouponIndex].id : '',
preStartDate: this.dateObj.startDate, preStartDate: this.dateObj.startDate,
preEndDate: this.dateObj.endDate, preEndDate: this.dateObj.endDate,
totalFee: Number(this.roomInfo.price) * this.duration, totalFee: Number(this.roomInfo.price) * this.duration,
...@@ -1274,19 +1289,19 @@ ...@@ -1274,19 +1289,19 @@
}) })
}, },
"fail": (resp) => { "fail": (resp) => {
console.log(resp,"支付失败") console.log(resp, "支付失败")
// 取消支付或支付失败 // 取消支付或支付失败
uni.showToast({ uni.showToast({
title: "取消支付" title: "取消支付"
}) })
orderCancelPay({ orderCancelPay({
orderNo:res.data.data.orderNo orderNo: res.data.data.orderNo
}).then(res=>{ }).then(res => {
console.log(res) console.log(res)
}) })
}, },
"complete": (resp) => { "complete": (resp) => {
console.log(resp,"支付完成") console.log(resp, "支付完成")
// 接口调用结束的回调函数(调用成功、失败都会执行) // 接口调用结束的回调函数(调用成功、失败都会执行)
} }
}); });
...@@ -1309,7 +1324,7 @@ ...@@ -1309,7 +1324,7 @@
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
title: res.data.msg || "下单失败", title: res.data.msg || "下单失败",
duration:2000, duration: 2000,
success: () => { success: () => {
// setTimeout(()=>{ // setTimeout(()=>{
// this.onGetSortDistance() // this.onGetSortDistance()
...@@ -1356,22 +1371,22 @@ ...@@ -1356,22 +1371,22 @@
}) })
}, },
onSelectDatePoint(val, i) { onSelectDatePoint(val, i) {
if(this.orderType == 2) return; if (this.orderType == 2) return;
if(i>=24) { if (i >= 24) {
uni.showToast({ uni.showToast({
icon:"none", icon: "none",
title:'预约次日时段,请先选择日期' title: '预约次日时段,请先选择日期'
}) })
return return
} }
let time = i; let time = i;
if(i>=24){ if (i >= 24) {
time = i-24; time = i - 24;
if(this.dateIndex === 0){ if (this.dateIndex === 0) {
this.dateIndex+=1; this.dateIndex += 1;
} }
} }
if ( val.endHoldTime ) { if (val.endHoldTime) {
let mTime = Number(moment(val.endHoldTime).format("mm")) let mTime = Number(moment(val.endHoldTime).format("mm"))
if (mTime >= 59) { if (mTime >= 59) {
uni.showToast({ uni.showToast({
...@@ -1381,43 +1396,43 @@ ...@@ -1381,43 +1396,43 @@
return; return;
} else { } else {
this.startTime = `${time>=10?time:'0'+time}:${mTime>=10?mTime:'0'+mTime}`; this.startTime = `${time>=10?time:'0'+time}:${mTime>=10?mTime:'0'+mTime}`;
if(time >= 0){ if (time >= 0) {
// 开始时间加一分钟 // 开始时间加一分钟
let arr = this.startTime.split(":"); let arr = this.startTime.split(":");
let m = Number(arr[1])+1 let m = Number(arr[1]) + 1
let h = Number(arr[0]) let h = Number(arr[0])
this.startTime = `${h>=10?h:'0'+h}:${m>=10?m:'0'+m}` this.startTime = `${h>=10?h:'0'+h}:${m>=10?m:'0'+m}`
} }
this.endTime = this.startTime.split(":").map((item,k)=>{ this.endTime = this.startTime.split(":").map((item, k) => {
let n = Number(item); let n = Number(item);
if(k==0){ if (k == 0) {
n = n+this.duration>=24? n+this.duration-24:n+this.duration n = n + this.duration >= 24 ? n + this.duration - 24 : n + this.duration
} }
return n>=10? n: `0${n}` return n >= 10 ? n : `0${n}`
}).join(":") }).join(":")
} }
} else { } else {
this.startTime = `${time>=10?time:'0'+time}:00`; this.startTime = `${time>=10?time:'0'+time}:00`;
this.endTime = this.startTime.split(":").map((item,k)=>{ this.endTime = this.startTime.split(":").map((item, k) => {
let n = Number(item); let n = Number(item);
if(k==0){ if (k == 0) {
n = n+this.duration >=24 ? n+this.duration-24: n+this.duration n = n + this.duration >= 24 ? n + this.duration - 24 : n + this.duration
} }
return n>=10? n: `0${n}` return n >= 10 ? n : `0${n}`
}).join(":") }).join(":")
} }
this.dateObj = this.onSetDateTime(this.startTime, this.endTime); this.dateObj = this.onSetDateTime(this.startTime, this.endTime);
this.onGetUseCoupon(); this.onGetUseCoupon();
this.useDateStatus = true; this.useDateStatus = true;
this.intervalList = this.intervalList.map((item,index) =>{ this.intervalList = this.intervalList.map((item, index) => {
let status = item.status; let status = item.status;
if(index>=i && index<= i+this.duration){ if (index >= i && index <= i + this.duration) {
status = 2 status = 2
if(this.dateIntervalList[index].status === 1 && index !== i ){ if (this.dateIntervalList[index].status === 1 && index !== i) {
this.useDateStatus = false; this.useDateStatus = false;
} }
}else{ } else {
status = this.dateIntervalList[index].status status = this.dateIntervalList[index].status
} }
return { return {
...@@ -1446,7 +1461,7 @@ ...@@ -1446,7 +1461,7 @@
if ((this.orderType == 1 && Number(endArr[0]) <= Number(startArr[0]))) { if ((this.orderType == 1 && Number(endArr[0]) <= Number(startArr[0]))) {
obj.endDate = obj.endDate =
`${moment(obj.startDate).add(1,"days").format("YYYY-MM-DD")} ${endTime}:00` `${moment(obj.startDate).add(1,"days").format("YYYY-MM-DD")} ${endTime}:00`
}else if(this.orderType == 2 && Number(endArr[0]) < Number(startArr[0])) { } else if (this.orderType == 2 && Number(endArr[0]) < Number(startArr[0])) {
obj.endDate = obj.endDate =
`${moment(obj.startDate).add(1,"days").format("YYYY-MM-DD")} ${endTime}:00` `${moment(obj.startDate).add(1,"days").format("YYYY-MM-DD")} ${endTime}:00`
} else { } else {
...@@ -1454,7 +1469,7 @@ ...@@ -1454,7 +1469,7 @@
} }
return obj; return obj;
}, },
onCheckDate(){ onCheckDate() {
// 今天可连续选择的时段 // 今天可连续选择的时段
let selectNum = 0; let selectNum = 0;
...@@ -1468,15 +1483,15 @@ ...@@ -1468,15 +1483,15 @@
// 查询有无可预定的时段 // 查询有无可预定的时段
let todaySelectStatus = false; let todaySelectStatus = false;
this.dateIntervalList.forEach((val,i)=>{ this.dateIntervalList.forEach((val, i) => {
if(val.status ==1 && moment(val.endHoldTime).format('mm')<59 && selectNum == 0){ if (val.status == 1 && moment(val.endHoldTime).format('mm') < 59 && selectNum == 0) {
startDate = moment(val.endHoldTime).format("YYYY-MM-DD HH:mm:ss") startDate = moment(val.endHoldTime).format("YYYY-MM-DD HH:mm:ss")
selectNum += 1 selectNum += 1
t = i t = i
} else if(val.status ==1 && selectNum > 0 ){ } else if (val.status == 1 && selectNum > 0) {
let start = moment(startDate).valueOf() let start = moment(startDate).valueOf()
let end = moment(val.startHoldTime).valueOf() let end = moment(val.startHoldTime).valueOf()
if(end-start >this.duration*60*60*1000){ if (end - start > this.duration * 60 * 60 * 1000) {
todaySelectStatus = true; todaySelectStatus = true;
} else { } else {
startDate = '' startDate = ''
...@@ -1484,50 +1499,51 @@ ...@@ -1484,50 +1499,51 @@
endDate = "" endDate = ""
t = -1 t = -1
} }
} else if(selectNum == 0 && !val.status){ } else if (selectNum == 0 && !val.status) {
startDate =val.timeHour+":00:00"; startDate = val.timeHour + ":00:00";
selectNum+=1 selectNum += 1
t = i t = i
}else if(selectNum>0 && !val.status){ } else if (selectNum > 0 && !val.status) {
// 计算时长 // 计算时长
let start = moment(startDate).valueOf() let start = moment(startDate).valueOf()
endDate = endDate? moment(endDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss") : moment(startDate).add(1,'h').format("YYYY-MM-DD HH:mm:ss") endDate = endDate ? moment(endDate).add(1, 'h').format("YYYY-MM-DD HH:mm:ss") : moment(
startDate).add(1, 'h').format("YYYY-MM-DD HH:mm:ss")
let end = moment(endDate).valueOf() let end = moment(endDate).valueOf()
if(end-start > this.duration*60*60*1000){ if (end - start > this.duration * 60 * 60 * 1000) {
todaySelectStatus = true; todaySelectStatus = true;
} else { } else {
selectNum+=1 selectNum += 1
} }
} }
}) })
if((todaySelectStatus && t >=24) || !todaySelectStatus ){ if ((todaySelectStatus && t >= 24) || !todaySelectStatus) {
if(this.dateIndex>=this.dateList.length-1){ if (this.dateIndex >= this.dateList.length - 1) {
this.onInitDateList() this.onInitDateList()
}else{ } else {
this.dateIndex+=1; this.dateIndex += 1;
} }
//房间维护就不循环 //房间维护就不循环
if(this.roomInfo.roomStat !==3){ if (this.roomInfo.roomStat !== 3) {
this.onGetSortDistance(); this.onGetSortDistance();
} }
return; return;
}else{ } else {
let startDateTime= ""; let startDateTime = "";
if(!this.addM && (t != 0 || (t==0 && this.dateIntervalList[0].status==1))){ if (!this.addM && (t != 0 || (t == 0 && this.dateIntervalList[0].status == 1))) {
this.addM = true this.addM = true
startDateTime = moment(startDate).add(1,"m").format("YYYY-MM-DD"); startDateTime = moment(startDate).add(1, "m").format("YYYY-MM-DD");
this.startTime = moment(startDate).add(1,"m").format("HH:mm"); this.startTime = moment(startDate).add(1, "m").format("HH:mm");
} else{ } else {
startDateTime = moment(startDate).format("YYYY-MM-DD"); startDateTime = moment(startDate).format("YYYY-MM-DD");
this.startTime = moment(startDate).format("HH:mm"); this.startTime = moment(startDate).format("HH:mm");
} }
let i = this.dateList.findIndex(item => item.readDate === startDateTime) let i = this.dateList.findIndex(item => item.readDate === startDateTime)
if(this.dateIndex !== i && this.dateIndex>=0){ if (this.dateIndex !== i && this.dateIndex >= 0) {
this.dateIndex = i; this.dateIndex = i;
//房间维护就不循环 //房间维护就不循环
if(this.roomInfo.roomStat !==3){ if (this.roomInfo.roomStat !== 3) {
this.onGetSortDistance(); this.onGetSortDistance();
} }
return; return;
...@@ -1584,6 +1600,7 @@ ...@@ -1584,6 +1600,7 @@
width: 100%; width: 100%;
border-radius: 6upx; border-radius: 6upx;
overflow: hidden; overflow: hidden;
image { image {
display: block; display: block;
width: 100%; width: 100%;
...@@ -1640,6 +1657,7 @@ ...@@ -1640,6 +1657,7 @@
} }
} }
.tab-box { .tab-box {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
...@@ -1657,20 +1675,24 @@ ...@@ -1657,20 +1675,24 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 80upx; height: 80upx;
text { text {
color: #000000; color: #000000;
font-size: 34upx; font-size: 34upx;
font-weight: 700; font-weight: 700;
} }
.hot-icon{
.hot-icon {
position: relative; position: relative;
height: 40upx; height: 40upx;
.img-icon{
.img-icon {
position: absolute; position: absolute;
top: -4upx; top: -4upx;
left: 4upx; left: 4upx;
width: 46upx; width: 46upx;
image{
image {
width: 100%; width: 100%;
} }
...@@ -1681,12 +1703,14 @@ ...@@ -1681,12 +1703,14 @@
.active { .active {
background-color: #dc4397; background-color: #dc4397;
text { text {
color: #ffffff; color: #ffffff;
font-weight: 800; font-weight: 800;
} }
} }
} }
.order-type-box { .order-type-box {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -1696,6 +1720,7 @@ ...@@ -1696,6 +1720,7 @@
border: 4upx solid #DC4397; border: 4upx solid #DC4397;
box-shadow: 0 0 8upx #DC4397; box-shadow: 0 0 8upx #DC4397;
border-radius: 12upx 12upx 0 0; border-radius: 12upx 12upx 0 0;
.date-content-box { .date-content-box {
width: 100%; width: 100%;
background-color: #FFF7F5; background-color: #FFF7F5;
...@@ -1763,6 +1788,7 @@ ...@@ -1763,6 +1788,7 @@
.package-mode { .package-mode {
padding: 0 0 30upx; padding: 0 0 30upx;
border-bottom: 2upx solid #F1F1F1; border-bottom: 2upx solid #F1F1F1;
.part-1 { .part-1 {
margin: 30upx; margin: 30upx;
} }
...@@ -1813,7 +1839,8 @@ ...@@ -1813,7 +1839,8 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.cu-tag{
.cu-tag {
padding: 4upx 16upx; padding: 4upx 16upx;
border-radius: 20upx; border-radius: 20upx;
} }
...@@ -2136,7 +2163,8 @@ ...@@ -2136,7 +2163,8 @@
} }
} }
} }
.tip-box{
.tip-box {
padding: 12upx; padding: 12upx;
border: 4upx solid #DBA556; border: 4upx solid #DBA556;
border-radius: 12upx; border-radius: 12upx;
...@@ -2145,10 +2173,12 @@ ...@@ -2145,10 +2173,12 @@
color: #B67D32; color: #B67D32;
// font-size: 24upx; // font-size: 24upx;
} }
.scroll-view{
.scroll-view {
height: 136upx; height: 136upx;
width: 100vw; width: 100vw;
.package-box{
.package-box {
position: absolute; position: absolute;
top: 0; top: 0;
left: 2vw; left: 2vw;
...@@ -2156,28 +2186,33 @@ ...@@ -2156,28 +2186,33 @@
width: 96vw; width: 96vw;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.item{
.item {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
flex: 1; flex: 1;
height: 100%; height: 100%;
.text-title{
.text-title {
font-size: 28upx; font-size: 28upx;
} }
.flex-row{
.flex-row {
// font-size: 23upx; // font-size: 23upx;
} }
} }
} }
} }
.message-box{
.message-box {
display: flex; display: flex;
width: 80%; width: 80%;
background-color: #ffffff; background-color: #ffffff;
border-radius: 12upx; border-radius: 12upx;
overflow: hidden; overflow: hidden;
margin: 0 auto; margin: 0 auto;
.header{
.header {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
...@@ -2185,7 +2220,8 @@ ...@@ -2185,7 +2220,8 @@
height: 90upx; height: 90upx;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
.content{
.content {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
...@@ -2193,12 +2229,14 @@ ...@@ -2193,12 +2229,14 @@
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
padding: 0 30upx; padding: 0 30upx;
} }
.button-box{
.button-box {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 90upx; height: 90upx;
text{
text {
color: #55aaff; color: #55aaff;
} }
} }
......
...@@ -25,11 +25,11 @@ ...@@ -25,11 +25,11 @@
<text class="text-black">可用时段:</text> <text class="text-black">可用时段:</text>
<text class="text-black">{{item.couponTimeStart}}-{{item.couponTimeEnd}}</text> <text class="text-black">{{item.couponTimeStart}}-{{item.couponTimeEnd}}</text>
</view> </view>
<text>{{item.platformType==2?'美团核销':''}}</text> <text>{{platformEnum[item.platformType]}}</text>
</view> </view>
<view v-else class="des margin-top"> <view v-else class="des margin-top">
<text class="">全天通用</text> <text class="">全天通用</text>
<text>{{item.platformType==2?'美团核销':''}}</text> <text>{{platformEnum[item.platformType]}}</text>
</view> </view>
</view> </view>
...@@ -62,12 +62,12 @@ ...@@ -62,12 +62,12 @@
</template> </template>
<script> <script>
import {dictList} from "@/api/index.js";
import {getDictItem} from "@/utils/tools.js"
import config from "@/config/index.config" import config from "@/config/index.config"
import indexConfig from "@/config/index.config"; import indexConfig from "@/config/index.config";
import FixedHeader from "@/components/fixedHeader/index"; import FixedHeader from "@/components/fixedHeader/index";
import { import {getUseCoupon} from "@/api/coupon"
getUseCoupon
} from "@/api/coupon"
export default { export default {
data() { data() {
...@@ -90,13 +90,15 @@ ...@@ -90,13 +90,15 @@
tipText: "", tipText: "",
show: false, show: false,
eventChannel: null, eventChannel: null,
selectId: '' selectId: '',
platformEnum:{}
}; };
}, },
components: { components: {
'fixed-header': FixedHeader 'fixed-header': FixedHeader
}, },
onLoad() { onLoad() {
this.onGetDicts();
this.eventChannel = this.getOpenerEventChannel(); this.eventChannel = this.getOpenerEventChannel();
// eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'}); // eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'});
...@@ -106,6 +108,24 @@ ...@@ -106,6 +108,24 @@
}) })
}, },
methods: { methods: {
onGetDicts() {
let dicts = []
let dictStr = uni.getStorageSync('dicts')
if (dictStr) {
let dicts = JSON.parse(dictStr)
this.platformEnum = getDictItem(dicts, "consumer_coupon_platform_type");
this.couponSourceEnum = getDictItem(dicts, "consumer_coupon_source_type");
this.$forceUpdate()
}
dictList().then(res => {
dicts = res.data.data;
uni.setStorageSync('dicts', JSON.stringify(res.data.data))
this.platformEnum = getDictItem(dicts, "consumer_coupon_platform_type");
this.couponSourceEnum = getDictItem(dicts, "consumer_coupon_source_type");
this.$forceUpdate()
})
},
onLoading(d) { onLoading(d) {
getUseCoupon(d).then(res => { getUseCoupon(d).then(res => {
if (res.statusCode == 200) { if (res.statusCode == 200) {
......
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