Commit a46da194 by zhangzhen

功能完善

parent e3b5b235
......@@ -33,7 +33,7 @@
{
name:"验券",
sortName:"验",
routePath:"/pages/couponCheck/couponCheck"
routePath:"/pages/useCouponIllustrate/useCouponIllustrate"
},
{
name:"客服",
......
const CONFIG = {
// 开发环境配置
development: {
assetsPath: 'http://10.24.5.119:8211/static', // 静态资源路径
baseUrl: 'http://10.106.30.135:8883/front-api', // 后台接口请求地址
hostUrl: 'http://10.106.30.135:8882', // H5地址(前端运行地址)
assetsPath: 'http://192.168.43.242:8211/static', // 静态资源路径
baseUrl: 'http://192.168.43.21:8883/front-api', // 后台接口请求地址
hostUrl: 'http://192.168.43.21:8882', // H5地址(前端运行地址)
// baseUrl: 'http://192.168.1.189:8883/front', // 后台接口请求地址
// hostUrl: 'http://192.168.1.189:8882', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
......
......@@ -119,6 +119,14 @@
"navigationBarTitleText" : "券码核销",
"enablePullDownRefresh" : false
}
},
{
"path" : "pages/useCouponIllustrate/useCouponIllustrate",
"style" :
{
"navigationBarTitleText" : "验券说明",
"enablePullDownRefresh" : false
}
}
],
......
......@@ -76,17 +76,19 @@
name:"美团"
}
],
couponInfo:''
couponInfo:'',
eventChannel:null
};
},
mounted() {
},
filters:{
dateFormat(val){
return moment(val).format("YYYY-MM-DD HH:mm:ss")
}
},
onLoad() {
this.eventChannel = this.getOpenerEventChannel();
},
methods:{
onConfirm(){
if(!this.code){
......@@ -103,7 +105,18 @@
console.log(res,909090)
if(res.data.code === 200){
this.couponInfo = res.data.data
this.$refs.popup.open()
uni.showToast({
icon:"success",
title:"核验成功",
success: () => {
this.eventChannel.emit('acceptData', {data: true});
setTimeout(()=>{
uni.navigateBack()
},1000)
}
})
// this.$refs.popup.open()
}else{
uni.showToast({
icon:"none",
......
......@@ -459,7 +459,12 @@
this.useDateStatus = true
console.log(this.dateIntervalList, "dateIntervalList")
let start = Number(this.startTime.split(":")[0])
let startM = Number(this.startTime.split(":")[1])
let end = Number(this.endTime.split(":")[0])
let endM = Number(this.endTime.split(":")[1])
console.log(start, end, "start")
if (end <= start) {
end += 24
......@@ -470,8 +475,14 @@
...this.dateIntervalList
]
console.log(moment(this.dateIntervalList[start].endHoldTime).format("mm"),"获取分钟")
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")
&& endM > moment(this.dateIntervalList[start].startHoldTime).format("mm")
) {
// 表示时间点被占用,无法选择
this.useDateStatus = false
this.intervalList[start] = {
......@@ -484,9 +495,7 @@
status: 2
}
}
}
this.$forceUpdate();
setTimeout(() => {
......@@ -501,7 +510,6 @@
// 获取可用优惠券
onGetUseCoupon() {
let dateObj = this.onSetDateTime(this.startTime, this.endTime);
getUseCoupon({
storeId: this.roomInfo.storeId,
roomId: this.roomInfo.id,
......@@ -615,9 +623,11 @@
} else {
this.checkedDateList = [Number(arr[0]) + 1, 0]
}
}
}
}
this.checkedIndex = this.checkedDateList
this.$refs.popup.open()
},
......@@ -740,7 +750,16 @@
},
onNavToCheckedCoupon(){
uni.navigateTo({
url:"/pages/couponCheck/couponCheck"
url:"/pages/couponCheck/couponCheck",
events: {
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
acceptData(data){
console.log(data)
if(data.data){
this.onGetUseCoupon()
}
}
}
})
},
// 将时间转换成完整日期
......
<template>
<view class="flex-col use-coupon-illustrate">
<view class="title-box">
<text class="text-pink text-bold text-xl">优惠券使用教程</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
};
}
}
</script>
<style lang="scss" scoped>
.use-coupon-illustrate{
display: flex;
flex-direction: column;
width: 100%;
.title-box{
display: flex;
padding: 30upx;
}
}
</style>
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