Commit 101c0816 by zhangzhen

细节优化

parent f27b898b
...@@ -2,7 +2,7 @@ const CONFIG = { ...@@ -2,7 +2,7 @@ const CONFIG = {
// 开发环境配置 // 开发环境配置
development: { development: {
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径 assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址 baseUrl: 'http://192.168.1.189:8883/front-api', // 后台接口请求地址
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址) hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
// baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址 // baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址
// hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址) // hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址)
...@@ -14,7 +14,7 @@ const CONFIG = { ...@@ -14,7 +14,7 @@ const CONFIG = {
// 生产环境配置 // 生产环境配置
production: { production: {
assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径 assetsPath: 'https://www.coujio.com/wechat_static', // 静态资源路径
baseUrl: 'https://www.coujio.com/front-api', // 后台接口请求地址 baseUrl: 'http://www.coujio.com/front-api', // 后台接口请求地址
hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址) hostUrl: 'https://www.coujio.com/prod-api', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址 websocketUrl: '', // websocket服务端地址
weixinAppId: '', // 微信公众号appid weixinAppId: '', // 微信公众号appid
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<view v-if="list.length == 0" class="empty-box"> <view v-if="list.length == 0" class="empty-box">
<!-- 列表数量为0时 --> <!-- 列表数量为0时 -->
<u-empty text="暂无门店数据" textColor='#C1C1C1' width="60" <u-empty text="暂无数据" textColor='#C1C1C1' width="60"
:icon="storeListBlankImage"> :icon="storeListBlankImage">
</u-empty> </u-empty>
</view> </view>
...@@ -64,65 +64,7 @@ ...@@ -64,65 +64,7 @@
hostUrl: indexConfig.hostUrl, hostUrl: indexConfig.hostUrl,
statusBarHeight: this.statusBarHeight, statusBarHeight: this.statusBarHeight,
titleBarHeight: this.titleBarHeight, titleBarHeight: this.titleBarHeight,
list: [ list: [],
{
couponId:"111",
couponCode:"111",
name:"任意房型8小时通用券",
roomType:"标准",
couponTimeStart:"00:00",
couponTimeEnd:"08:00",
couponType:"满减券(2)",
maxDuration:8,
duration:8,
minPrice:200,
subPrice:62,
sourceType:"领取(1)",
platformType:1,
startDate:"2023-10-23",
endDate:"2023-11-23",
useStatus:1,
useDate:""
},
{
couponId:"2222",
couponCode:"2222",
name:"任意房型4小时通用券",
roomType:"标准",
couponTimeStart:"",
couponTimeEnd:"",
couponType:"满减券(2)",
maxDuration:4,
duration:4,
minPrice:100,
subPrice:22,
sourceType:"领取(1)",
platformType:2,
startDate:"2023-10-23",
endDate:"2023-11-23",
useStatus:1,
useDate:""
},
{
couponId:"8888",
couponCode:"8888",
name:"任意房型8小时通用券",
roomType:"标准",
couponTimeStart:"",
couponTimeEnd:"",
couponType:"满减券(2)",
maxDuration:8,
duration:8,
minPrice:200,
subPrice:62,
sourceType:"领取(1)",
platformType:2,
startDate:"2023-10-23",
endDate:"2023-11-23",
useStatus:2,
useDate:""
}
],
height: 120, height: 120,
queryParams: { queryParams: {
pageSize: 10, pageSize: 10,
......
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
</view> </view>
</view> </view>
<view v-else class="none-login"> <view v-else class="none-login">
<view class="cu-avatar xl round margin-bottom" <view class="cu-avatar xl round margin-bottom">
style="background-image:url(https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg);"> <image class="avatar-img" :src=" assetsPath+'/cart.png'" mode="scaleToFill"></image>
</view> </view>
<button class="cu-btn round bg-white" @tap="onNavToLogin">登录/注册</button> <button class="cu-btn round bg-white" @tap="onNavToLogin">登录/注册</button>
</view> </view>
...@@ -107,13 +107,13 @@ ...@@ -107,13 +107,13 @@
type:"", type:"",
show:true show:true
}, },
// { {
// label:"消费记录", label:"消费记录",
// iconUrl:config.assetsPath+'/record_icon.png', iconUrl:config.assetsPath+'/record_icon.png',
// routePath:"", routePath:"",
// type:"", type:"",
// show:true show:true
// }, },
// { // {
// label:"立即充值", // label:"立即充值",
// iconUrl:config.assetsPath+'/vip_icon.png', // iconUrl:config.assetsPath+'/vip_icon.png',
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
</view> </view>
<view class="flex-1 distance-box"> <view class="flex-1 distance-box">
<view v-for="(item,index) in distanceMode2" :key="index" class="flex-col" style="margin: 0 6upx;" <view v-for="(item,index) in distanceMode2" :key="index" class="flex-col" style="margin: 0 6upx;"
@tap="onDurationChange(index)"> @tap="onDurationChange2(index)">
<view class="cu-tag radius" :class="index===distanceIndex? 'line-pink':'line-gray'"> <view class="cu-tag radius" :class="index===distanceIndex? 'line-pink':'line-gray'">
<text>{{item.duration<1?'半小时': item.duration+'小时'}}</text> <text>{{item.duration<1?'半小时': item.duration+'小时'}}</text>
</view> </view>
...@@ -403,6 +403,9 @@ ...@@ -403,6 +403,9 @@
}; };
}, },
onLoad(option) { onLoad(option) {
uni.showLoading({
title: "加载中"
})
this.id = option.roomId || 106; this.id = option.roomId || 106;
if(option.orderNo){ if(option.orderNo){
this.orderType = 2; this.orderType = 2;
...@@ -411,11 +414,10 @@ ...@@ -411,11 +414,10 @@
title:'房间续单' title:'房间续单'
}) })
this.onGetOrderInfo() this.onGetOrderInfo()
}else{
this.onLoading()
} }
uni.showLoading({
title: "加载中"
})
this.onLoading()
}, },
methods: { methods: {
// 获取房间信息相关 // 获取房间信息相关
...@@ -442,9 +444,12 @@ ...@@ -442,9 +444,12 @@
}, },
onGetOrderInfo(){ onGetOrderInfo(){
getOrderInfoByNo(this.preOrderNo).then(res=>{ getOrderInfoByNo(this.preOrderNo).then(res=>{
console.log(res,909090)
if(res.data.code == 200){ if(res.data.code == 200){
this.startTime = moment(res.data.data.endDate).add(1, "m").format("HH:mm") let endDate = res.data.data.endDate || res.data.data.preEndDate;
this.startTime = moment(endDate).format("HH:mm");
let date = moment(endDate).format("YYYY-MM-DD")
this.dateIndex = this.dateList.findIndex(item=> item.readDate === date)
this.onLoading()
} }
}) })
}, },
...@@ -491,7 +496,7 @@ ...@@ -491,7 +496,7 @@
}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);
} }
console.log(this.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))
...@@ -503,9 +508,11 @@ ...@@ -503,9 +508,11 @@
if(startDateArr[0]>23){ if(startDateArr[0]>23){
startDateArr[0] = startDateArr[0]-23 startDateArr[0] = startDateArr[0]-23
} }
startDateArr[1] = m-60
}else{ }else{
startDateArr[1] = m startDateArr[1] = m
} }
console.log(startDateArr,"1111")
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) => {
...@@ -531,7 +538,7 @@ ...@@ -531,7 +538,7 @@
// 更新时间的选取状态 // 更新时间的选取状态
onUpdateIntervalList() { onUpdateIntervalList() {
this.useDateStatus = true this.useDateStatus = true
console.log(this.dateIntervalList, "dateIntervalList")
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])
...@@ -539,7 +546,6 @@ ...@@ -539,7 +546,6 @@
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])
console.log(start, end, "start")
if (end < start) { if (end < start) {
end += 24 end += 24
} }
...@@ -549,7 +555,6 @@ ...@@ -549,7 +555,6 @@
...this.dateIntervalList ...this.dateIntervalList
] ]
console.log(moment(this.dateIntervalList[start].endHoldTime).format("mm"),"获取分钟")
for (start; start <= end; start++) { for (start; start <= end; start++) {
// 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前 // 在时间小时段内,在被占用的情况下,新增订单的开始分钟时间需要占用结束时间后,结束分钟时间需在时间占用开始前
...@@ -591,12 +596,11 @@ ...@@ -591,12 +596,11 @@
preStartDate: dateObj.startDate, preStartDate: dateObj.startDate,
preEndDate: dateObj.endDate preEndDate: dateObj.endDate
}).then(res => { }).then(res => {
console.log(res.data.data, "优惠券")
if (res.statusCode == 200) { if (res.statusCode == 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);
console.log(this.useCouponList)
} }
} }
this.onComputePrice(); this.onComputePrice();
...@@ -610,7 +614,6 @@ ...@@ -610,7 +614,6 @@
url: "/pages/useCoupon/index", url: "/pages/useCoupon/index",
events: { events: {
getSelectData(data) { getSelectData(data) {
console.log(data)
that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data that.selectCouponIndex = that.useCouponList.findIndex(item => item.id === data
.couponId) .couponId)
} }
...@@ -684,12 +687,18 @@ ...@@ -684,12 +687,18 @@
this.distanceIndex = i this.distanceIndex = i
this.onSetEndTime() this.onSetEndTime()
}, },
onDurationChange2(i) {
if (this.distanceIndex === i) return;
this.distanceIndex = i
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) {
...@@ -714,13 +723,15 @@ ...@@ -714,13 +723,15 @@
this.$refs.popup.open() this.$refs.popup.open()
}, },
// 切换时间
onBindChange(e) { onBindChange(e) {
this.checkedIndex = e.target.value this.checkedIndex = e.target.value
}, },
// 选择完时间
onSelectedDate() { onSelectedDate() {
this.checkedDateList = this.checkedIndex; this.checkedDateList = this.checkedIndex;
this.startTime = `${this.hourList[this.checkedDateList[0]]}:${this.minuteList[this.checkedDateList[1]]}`; this.startTime = `${this.hourList[this.checkedDateList[0]]}:${this.minuteList[this.checkedDateList[1]]}`;
console.log(this.startTime, "开始时间") this.$forceUpdate();
//重新设置结束时间 //重新设置结束时间
this.onSetEndTime() this.onSetEndTime()
this.onHideModal(); this.onHideModal();
...@@ -734,7 +745,6 @@ ...@@ -734,7 +745,6 @@
}, },
onBindDuratin(e) { onBindDuratin(e) {
this.durationIndex = e.target.value this.durationIndex = e.target.value
}, },
onSelectedDuration() { onSelectedDuration() {
...@@ -743,8 +753,7 @@ ...@@ -743,8 +753,7 @@
this.distanceMode[this.distanceIndex] = { this.distanceMode[this.distanceIndex] = {
duration: this.editDuration[0] + 1, duration: this.editDuration[0] + 1,
} }
console.log(this.distanceMode, "1asdasdasd")
this.onHideModal() this.onHideModal()
this.$forceUpdate(); this.$forceUpdate();
this.onSetEndTime() this.onSetEndTime()
...@@ -841,13 +850,13 @@ ...@@ -841,13 +850,13 @@
} }
} else { } else {
uni.showToast({ uni.showToast({
title: "下单失败" icon:"none",
title:res.data.msg || "下单失败"
}) })
} }
}) })
}, },
onSelectTime(val, k) { onSelectTime(val, k) {
console.log(val, k, 909090)
if (val.status == 1) { if (val.status == 1) {
uni.showToast({ uni.showToast({
icon: "none", icon: "none",
...@@ -875,7 +884,6 @@ ...@@ -875,7 +884,6 @@
events: { events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据 // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptData(data){ acceptData(data){
console.log(data)
if(data.data){ if(data.data){
this.onGetUseCoupon() this.onGetUseCoupon()
} }
...@@ -885,7 +893,6 @@ ...@@ -885,7 +893,6 @@
}, },
// 将时间转换成完整日期 // 将时间转换成完整日期
onSetDateTime(startTime, endTime) { onSetDateTime(startTime, endTime) {
console.log(startTime, endTime,'时间段')
let obj = { let obj = {
startDate: "", startDate: "",
endDate: '' endDate: ''
...@@ -899,7 +906,6 @@ ...@@ -899,7 +906,6 @@
} else { } else {
obj.endDate = `${this.dateList[this.dateIndex].readDate} ${endTime}:00` obj.endDate = `${this.dateList[this.dateIndex].readDate} ${endTime}:00`
} }
console.log(obj)
return obj; return obj;
} }
} }
......
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
<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">
<button class="cu-btn block round bg-mauve lg" @tap="onNavToOrder">房间续单</button>
</view>
</view> </view>
</view> </view>
...@@ -95,9 +98,9 @@ ...@@ -95,9 +98,9 @@
</view> </view>
</view> </view>
<view v-if="orderInfo.status === 0" class="cancle-btn-box"> <!-- <view v-if="orderInfo.status === 0" class="cancle-btn-box">
<button class="cu-btn bg-pink round block lg">立即退单</button> <button class="cu-btn bg-pink round block lg">立即退单</button>
</view> </view> -->
</view> </view>
</view> </view>
</template> </template>
...@@ -169,6 +172,11 @@ ...@@ -169,6 +172,11 @@
console.log(res) console.log(res)
} }
}) })
},
onNavToOrder(){
uni.navigateTo({
url:`/pages/order/order?roomId=${this.orderInfo.roomId}&orderNo=${this.orderInfo.orderNo}`
})
} }
} }
} }
...@@ -284,13 +292,21 @@ ...@@ -284,13 +292,21 @@
margin-top: 30upx; margin-top: 30upx;
.btn-box{ .btn-box{
display: flex; display: flex;
justify-content: space-between; flex-direction: row;
align-items: center; align-items: center;
width: 94%; width: 100%;
margin: 24upx auto; margin: 24upx auto;
.part{ .part{
display: block; display: flex;
width: 48%; flex: 1;
margin: 0 10upx;
.cu-btn{
width: 100%;
padding: 0;
}
.bg-mauve{
background: rgba(224, 57, 151, 0.8);
}
} }
} }
} }
......
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