Commit 101c0816 by zhangzhen

细节优化

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