This commit is contained in:
3321822538@qq.com 2025-01-07 18:02:57 +08:00
parent 535ccab02d
commit 8ac054164f
17 changed files with 1905 additions and 301 deletions

View File

@ -28,6 +28,14 @@
{{obj.device.sn == null ? '' : obj.device.sn}} <image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image> {{obj.device.sn == null ? '' : obj.device.sn}} <image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image>
</view> </view>
</view> </view>
<view class="ulbox" @click="btnewm">
<view class="one">
生成二维码
</view>
<view class="two">
<image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image>
</view>
</view>
<view class="ulbox" style="border: none;" @click="btnshoufei"> <view class="ulbox" style="border: none;" @click="btnshoufei">
<view class="one"> <view class="one">
收费方式 收费方式
@ -94,9 +102,6 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </template>
@ -147,6 +152,12 @@
uni.removeStorageSync('ruleIdlist') uni.removeStorageSync('ruleIdlist')
}, },
methods: { methods: {
//
btnewm(){
uni.navigateTo({
url:'/page_shanghu/erwm?equipmentId=' + this.obj.equipmentId + '&viewType=' + this.obj.viewType
})
},
// //
btntouf(){ btntouf(){
this.dtflags = false this.dtflags = false
@ -281,7 +292,7 @@
if(res.data.type == 2){ if(res.data.type == 2){
this.ksfs = '麻将桌' this.ksfs = '麻将桌'
}else if(res.data.type == 3){ }else if(res.data.type == 3){
this.ksfs = '棋牌桌' this.ksfs = '台球桌'
} }
this.obj = res.data this.obj = res.data
} }

View File

@ -20,7 +20,7 @@
</view> </view>
</view> </view>
<view class="shuom"> <view class="shuom">
(订单结束{{item.refundDuration == null ? '--' : item.refundDuration}}分钟后退还押金)订单提前结束剩余消费时长金额不返还 (订单结束{{item.refundDuration == 0 ? '立即' : item.refundDuration + '分钟后'}}退还押金)订单提前结束剩余消费时长金额不返还
</view> </view>
</view> </view>
</view> </view>

View File

@ -23,7 +23,7 @@
</view> </view>
</view> </view>
<view class="shuom"> <view class="shuom">
(订单结束{{item.refundDuration == null ? '--' : item.refundDuration}}分钟后退还押金) (订单结束{{item.refundDuration == 0 ? '立即' : item.refundDuration + '分钟后'}}退还押金)
</view> </view>
</view> </view>
</view> </view>
@ -82,7 +82,7 @@
show:false, show:false,
tclist:[], tclist:[],
modelist:[], modelist:[],
yajinindex:'', yajinindex:-1,
selectedIndices:[], selectedIndices:[],
ruleIdsone:[], ruleIdsone:[],
nameone:[], nameone:[],
@ -94,7 +94,7 @@
onShow() { onShow() {
this.tclist = [] this.tclist = []
this.modelist = [] this.modelist = []
this.yajinindex = '' this.yajinindex = -1
this.selectedIndices = [] this.selectedIndices = []
this.ruleIdsone = [] this.ruleIdsone = []
this.getlist() this.getlist()

View File

@ -44,6 +44,14 @@
{{kstj}} <image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image> {{kstj}} <image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image>
</view> </view>
</view> </view>
<view class="ulbox" @click="btnewm">
<view class="one">
生成二维码
</view>
<view class="two">
<image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image>
</view>
</view>
<u-select v-model="showone" :list="listone" @confirm="btnone"></u-select> <u-select v-model="showone" :list="listone" @confirm="btnone"></u-select>
<u-picker mode="time" v-model="showtwo" :params="params" @confirm="btntwo"></u-picker> <u-picker mode="time" v-model="showtwo" :params="params" @confirm="btntwo"></u-picker>
<u-select v-model="showthr" :list="listthr" @confirm="btnthr"></u-select> <u-select v-model="showthr" :list="listthr" @confirm="btnthr"></u-select>
@ -185,6 +193,12 @@
this.getxx() this.getxx()
}, },
methods: { methods: {
//
btnewm(){
uni.navigateTo({
url:'/page_shanghu/erwm?equipmentId=' + this.obj.equipmentId
})
},
// //
btntouf(){ btntouf(){
this.dtflags = false this.dtflags = false

View File

@ -756,7 +756,7 @@
name: this.dtname, name: this.dtname,
roomId: this.roomId, roomId: this.roomId,
type: this.type, type: this.type,
picture: '' picture: this.type == 2 ? 'https://api.ccttiot.com/smartmeter/img/static/uYJuFqo8fmq8vZ0xeSzP' : 'https://api.ccttiot.com/smartmeter/img/static/u8BAJ6O6waeSGyYlesEU'
} }
this.$u.post(`/app/equipment`, data).then(res => { this.$u.post(`/app/equipment`, data).then(res => {
if (res.code == 200) { if (res.code == 200) {

View File

@ -68,8 +68,12 @@
</view> </view>
</view> </view>
</view> </view>
<view class="" style="width: 100%;text-align: center;color: red;margin-top: 30rpx;">
押金的金额需是基础价格的倍数
</view>
</view> </view>
<!-- <view class="mask" v-if="maskflag"></view> --> <!-- <view class="mask" v-if="maskflag"></view> -->
<view class="tanchuang" v-if="type == 2"> <view class="tanchuang" v-if="type == 2">
<view class="names"> <view class="names">
@ -160,7 +164,11 @@
this.explain = res.data.explain this.explain = res.data.explain
this.tuitimes = res.data.refundDuration this.tuitimes = res.data.refundDuration
this.yajin = res.data.deposit this.yajin = res.data.deposit
this.tuitime = res.data.refundDuration + '分钟' if(res.data.refundDuration == 0){
this.tuitime = '立即退还'
}else{
this.tuitime = res.data.refundDuration + '分钟'
}
} }
}) })
}, },
@ -217,53 +225,61 @@
}, },
// and // and
btnshop(){ btnshop(){
let data = { if(this.yajin % this.price == 0){
ruleId:this.ruleId, let data = {
mode:this.type, ruleId:this.ruleId,
hours:1, mode:this.type,
price:this.price, hours:1,
minHours:this.mintime, price:this.price,
explain:this.explain, minHours:this.mintime,
refundDuration:this.tuitimes, explain:this.explain,
deposit:this.yajin refundDuration:this.tuitimes,
} deposit:this.yajin
if(this.anniutxt == '确认新建'){ }
this.$u.post(`/app/rule`,data).then(res => { if(this.anniutxt == '确认新建'){
if (res.code == 200) { this.$u.post(`/app/rule`,data).then(res => {
uni.showToast({ if (res.code == 200) {
title: '新建成功', uni.showToast({
icon: 'success', title: '新建成功',
duration: 2000 icon: 'success',
}) duration: 2000
setTimeout(()=>{ })
uni.navigateBack() setTimeout(()=>{
},1000) uni.navigateBack()
}else{ },1000)
uni.showToast({ }else{
title: res.msg, uni.showToast({
icon: 'none', title: res.msg,
duration: 2000 icon: 'none',
}) duration: 2000
} })
}) }
}else if(this.anniutxt == '确认修改'){ })
this.$u.put(`/app/rule`,data).then(res => { }else if(this.anniutxt == '确认修改'){
if (res.code == 200) { this.$u.put(`/app/rule`,data).then(res => {
uni.showToast({ if (res.code == 200) {
title: '修改成功', uni.showToast({
icon: 'success', title: '修改成功',
duration: 2000 icon: 'success',
}) duration: 2000
setTimeout(()=>{ })
uni.navigateBack() setTimeout(()=>{
},1000) uni.navigateBack()
}else{ },1000)
uni.showToast({ }else{
title: res.msg, uni.showToast({
icon: 'none', title: res.msg,
duration: 2000 icon: 'none',
}) duration: 2000
} })
}
})
}
}else{
uni.showToast({
title: '押金需是基础价格的倍数',
icon: 'none',
duration: 2000
}) })
} }
}, },

View File

@ -13,7 +13,7 @@
<view class="imgewm"> <view class="imgewm">
<canvas canvas-id="qrcode" style="height: 100%;margin: 0 auto;" /> <canvas canvas-id="qrcode" style="height: 100%;margin: 0 auto;" />
<view class="" style="width: 100%;text-align: center;margin-top: 20rpx;"> <view class="" style="width: 100%;text-align: center;margin-top: 20rpx;">
SN:{{sn}} <!-- sn -->
</view> </view>
</view> </view>
</view> </view>
@ -31,11 +31,31 @@
bgc: { bgc: {
backgroundColor: "#DEF1DA", backgroundColor: "#DEF1DA",
}, },
sn:'' sn:'',
roomId:'',
viewType:'',
equipmentId:'',
https:''
} }
}, },
onLoad(option) { onLoad(option) {
this.sn = option.sn if(option.equipmentId){ //
this.equipmentId = option.equipmentId
if(option.viewType){ //
this.viewType = option.viewType
}else{
this.viewType = ''
}
this.https = 'https://testcha.chuangtewl.com?equipmentId=' + this.equipmentId + '&viewType=' + this.viewType
}else if(option.roomId){ //
this.roomId = option.roomId
this.viewType = option.viewType
this.https = 'https://testcha.chuangtewl.com?roomId=' + this.roomId + '&viewType=' + this.viewType
}else if(option.storeId){ //
this.storeId = option.storeId
this.https = 'https://testcha.chuangtewl.com?storeId=' + this.storeId
}
console.log(option)
this.qrFun() this.qrFun()
}, },
mounted() { mounted() {
@ -74,7 +94,7 @@
this.wemflag = true this.wemflag = true
uQRCode.make({ uQRCode.make({
canvasId: 'qrcode', canvasId: 'qrcode',
text: 'https://kg.chuantewulian.cn/w?s=' + this.sn, text: this.https,
size: 300, size: 300,
margin: 0, margin: 0,
backgroundColor: '#ffffff', backgroundColor: '#ffffff',

View File

@ -222,7 +222,7 @@
// //
btnaddsb(){ btnaddsb(){
uni.navigateTo({ uni.navigateTo({
url:'/page_shanghu/roomsheshi?roomId=' + this.roomId url:'/page_shanghu/roomsheshi?roomId=' + this.roomId
}) })
}, },
// 线 // 线
@ -435,7 +435,7 @@
// //
btnewm(){ btnewm(){
uni.navigateTo({ uni.navigateTo({
url:'/page_shanghu/erwm' url:'/page_shanghu/erwm?roomId=' + this.roomId + '&viewType=' + this.roomobj.viewType
}) })
}, },
// //

View File

@ -36,6 +36,14 @@
{{kstj}} <image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image> {{kstj}} <image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image>
</view> </view>
</view> </view>
<view class="ulbox" @click="btnewm">
<view class="one">
生成二维码
</view>
<view class="two">
<image src="https://api.ccttiot.com/smartmeter/img/static/uS5JydUQDmvbMyg4nsdo" mode=""></image>
</view>
</view>
<view class="ulbox" style="border: none;" v-if="xxobj.equipmentId" @click="addmenflag = true"> <view class="ulbox" style="border: none;" v-if="xxobj.equipmentId" @click="addmenflag = true">
<view class="one"> <view class="one">
设备绑定 设备绑定
@ -160,6 +168,12 @@
this.getmendian() this.getmendian()
}, },
methods: { methods: {
//
btnewm(){
uni.navigateTo({
url:'/page_shanghu/erwm?storeId=' + this.storeId
})
},
// //
btnjieb(){ btnjieb(){
let that = this let that = this

View File

@ -333,9 +333,17 @@
}, },
// //
btnxudan(){ btnxudan(){
uni.navigateTo({ if(this.orderobj.mode == 2){
url:'/page_user/xudan?roomId=' + this.orderobj.roomId + '&orderNo=' + this.orderNo + '&viewType=' + this.viewType uni.navigateTo({
}) url:'/page_user/xudan?roomId=' + this.orderobj.roomId + '&orderNo=' + this.orderNo + '&viewType=' + this.viewType
})
}else{
uni.showToast({
title: '押金收费暂不支持续单',
icon: 'none',
duration:2000
})
}
} }
} }
} }

View File

@ -145,7 +145,7 @@
btnmy() { btnmy() {
uni.reLaunch({ uni.reLaunch({
url: '/pages/my' url: '/page_user/luru'
}) })
}, },
qrcode() { qrcode() {

View File

@ -38,7 +38,7 @@
</view> </view>
</view> </view>
</view> --> </view> -->
<view class="tcxz"> <view class="tcxz" v-if="tclist[0].mode == 2">
<view class="tcxzname"> <view class="tcxzname">
套餐选择 套餐选择
</view> </view>
@ -50,6 +50,17 @@
</view> </view>
</view> </view>
</view> </view>
<view class="tcxz" v-else style="display: block;">
<view class="tcxzname">
收费方式
</view>
<view class="taocan" style="width: 600rpx;
font-weight: 400;
font-size: 28rpx;
flex-wrap: wrap;">
{{tclist[0].price == null ? '--' : tclist[0].price}}/小时最低消费{{tclist[0].minHours == null ? '--' : tclist[0].minHours}}小时押金金额{{tclist[0].deposit == null ? '--' : tclist[0].deposit}}
</view>
</view>
<view class="shichangxz"> <view class="shichangxz">
<view class="tcxzname"> <view class="tcxzname">
时长选择 时长选择
@ -60,7 +71,7 @@
</view> </view>
<view class="kaishi" style="background-color: #eee;"> <view class="kaishi" style="background-color: #eee;">
{{jstime.slice(10,16)}} {{jstime.length > 10 ? jstime.slice(10,16) : jstime}}
</view> </view>
</view> </view>
</view> </view>
@ -212,92 +223,6 @@
value: 'wx', value: 'wx',
label: '微信支付' label: '微信支付'
}], }],
list: [
[{
value: '1',
label: '00'
},
{
value: '2',
label: '01'
}, {
value: '3',
label: '02'
}, {
value: '4',
label: '03'
}, {
value: '5',
label: '04'
}, {
value: '6',
label: '05'
}, {
value: '7',
label: '06'
}, {
value: '8',
label: '07'
}, {
value: '9',
label: '08'
}, {
value: '10',
label: '09'
}, {
value: '11',
label: '10'
}, {
value: '12',
label: '11'
}, {
value: '13',
label: '12'
}, {
value: '14',
label: '13'
}, {
value: '15',
label: '14'
}, {
value: '16',
label: '15'
}, {
value: '17',
label: '16'
}, {
value: '18',
label: '17'
}, {
value: '19',
label: '18'
}, {
value: '20',
label: '19'
}, {
value: '21',
label: '20'
}, {
value: '22',
label: '21'
}, {
value: '23',
label: '22'
}, {
value: '24',
label: '23'
},
],
[{
value: '3',
label: '00'
},
{
value: '4',
label: '30'
}
],
],
kstime: '', kstime: '',
jstime: '', jstime: '',
timetype: '', timetype: '',
@ -331,7 +256,6 @@
this.viewType = option.viewType this.viewType = option.viewType
this.getstoredetail() this.getstoredetail()
this.getstoredetails() this.getstoredetails()
this.gettaocan()
this.getbiaoqian() this.getbiaoqian()
this.hourPointsArray = this.getCurrentHourPoints() //24 this.hourPointsArray = this.getCurrentHourPoints() //24
}, },
@ -545,9 +469,32 @@
this.$u.get(`/app/rule/getListByRoomId?roomId=${this.roomId}`).then(res => { this.$u.get(`/app/rule/getListByRoomId?roomId=${this.roomId}`).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.tclist = res.data this.tclist = res.data
if(res.data[0].mode == 1){
// this.kstime = e.hour + ':' + e.minute
// let shijian = '20' + this.ksriqi + ' ' + this.kstime
// console.log(shijian,shijian.slice(2,5));
// if(shijian.slice(2,5) == 'Wed'){
// this.timeshijian = this.formatDate(shijian)
// }else{
// this.timeshijian = this.parseTime(shijian)
// }
this.jstime = this.addOneHourToTimess(this.kstime.slice(10,16))
console.log(this.jstime,this.kstime);
this.price = this.tclist[0].deposit //
this.hourstime = Math.ceil(this.tclist[0].deposit / this.tclist[0].price) //
}
} }
}) })
}, },
//
addOneHourToTimess(timeString, date = new Date()) {
let [hours, minutes] = timeString.split(':').map(Number)
let timeDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hours, minutes, 0, 0)
timeDate.setHours(timeDate.getHours() + Math.ceil(this.tclist[0].deposit / this.tclist[0].price)) //
let newHours = timeDate.getHours()
let newMinutes = String(timeDate.getMinutes()).padStart(2, '0') //
return `${String(newHours).padStart(2, '0')}:${newMinutes}`
},
// //
getinfo() { getinfo() {
this.$u.get(`/getAppInfo`).then(res => { this.$u.get(`/getAppInfo`).then(res => {
@ -562,10 +509,10 @@
// let formattedDateString = time.replace(/\//g, "-") // let formattedDateString = time.replace(/\//g, "-")
let data = { let data = {
payType: this.zfssid, payType: this.zfssid,
ruleId: this.tcobj.ruleId, ruleId:this.tclist[0].mode == 2 ? this.tcobj.ruleId : this.tclist[0].mode,
viewType:this.viewType, viewType:this.viewType,
type: 2, type: 2,
mode: 2, mode: this.tclist[0].mode,
hours: this.hourstime, hours: this.hourstime,
price: this.price, price: this.price,
originalOrderNo:this.orderNo originalOrderNo:this.orderNo
@ -765,6 +712,7 @@
this.$u.get(`/appVerify/orderInfo?orderNo=${this.orderNo}`).then(res => { this.$u.get(`/appVerify/orderInfo?orderNo=${this.orderNo}`).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.kstime = res.data.reserveEndTime this.kstime = res.data.reserveEndTime
this.gettaocan()
} }
}) })
}, },
@ -1325,6 +1273,7 @@
font-size: 26rpx; font-size: 26rpx;
color: #48893B; color: #48893B;
line-height: 46rpx; line-height: 46rpx;
margin-top: 10rpx;
} }
} }
} }
@ -1418,7 +1367,7 @@
.shichangxz { .shichangxz {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 50rpx; margin-top: 30rpx;
// width: 3000rpx; // width: 3000rpx;
justify-content: space-between; justify-content: space-between;

View File

@ -19,6 +19,15 @@
"navigationBarTextStyle": "#FFFFFF", "navigationBarTextStyle": "#FFFFFF",
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{
"path": "pages/myorder/orderxd",
"style": {
"navigationBarTitleText": "首页",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#3996FD",
"navigationBarTextStyle": "#FFFFFF",
"navigationStyle": "custom"
}
},{ },{
"path": "pages/login/login", "path": "pages/login/login",
"style": { "style": {

View File

@ -29,8 +29,8 @@
{{shopobj.address == undefined ? '--' : shopobj.address}} {{shopobj.address == undefined ? '--' : shopobj.address}}
</view> </view>
<view class="tongji" v-if="tabarr.length > 1"> <view class="tongji" v-if="tabarr!=''">
<view class="one" @click="btngundong('section1',index)" v-for="(item,index) in tabarr" :key="index"> <view class="one" @click="btngundong(item.type,index)" v-for="(item,index) in tabarr" :key="index">
<view class="kg">空闲 <text>{{item.idleNum}}</text></view> <view class="kg">空闲 <text>{{item.idleNum}}</text></view>
<view class="gn">{{item.tag}}</view> <view class="gn">{{item.tag}}</view>
<image v-if="tabindex == index" src="https://api.ccttiot.com/smartmeter/img/static/uZNimi3DEsGWsjfJm2Bg" <image v-if="tabindex == index" src="https://api.ccttiot.com/smartmeter/img/static/uZNimi3DEsGWsjfJm2Bg"
@ -51,10 +51,10 @@
@touchcancel="onTouchCancel"> @touchcancel="onTouchCancel">
<view class="zhuozi"> <view class="zhuozi">
<view class="tqlist"> <view class="tqlist">
<view class="tqlist_item" v-for="(item,index) in 5" :key="index" @click="btntq"> <view class="tqlist_item" v-for="(item,index) in shopobj.roomList" :key="index" @click="btndetail(item)"> <!-- btntq -->
<image src="https://api.ccttiot.com/smartmeter/img/static/uqv5RPXXtMydaBdU7sqG" mode=""></image> <image src="https://api.ccttiot.com/smartmeter/img/static/uqv5RPXXtMydaBdU7sqG" mode=""></image>
<view class="name"> <view class="name">
一号桌 {{item.roomName}}
</view> </view>
<view class="kaitai"> <view class="kaitai">
开台 开台
@ -207,7 +207,7 @@
{{jinxintxt}} {{jinxintxt}}
</view> </view>
</view> </view>
<image v-if="jinxinflag" @click="jinxinflag = false" class="jinxinx" <image v-if="jinxinflag" @click="btnyc" class="jinxinx"
src="https://api.ccttiot.com/smartmeter/img/static/uH5fAInJQYhf3wlXkuYI" mode=""></image> src="https://api.ccttiot.com/smartmeter/img/static/uH5fAInJQYhf3wlXkuYI" mode=""></image>
<view class="mask" v-if="jinxinflag"></view> <view class="mask" v-if="jinxinflag"></view>
@ -240,12 +240,13 @@
biaostoreqianlist: [], biaostoreqianlist: [],
mdindex:-1, mdindex:-1,
viewType:'', viewType:'',
tit:'' tit:'',
tabarr:[],
type:''
} }
}, },
onLoad(option) { onLoad(option) {
this.tit = option.tit this.tit = option.tit
this.getroombq()
if (option.storeId) { if (option.storeId) {
this.storeId = option.storeId this.storeId = option.storeId
uni.setStorageSync('storeId', this.storeId) uni.setStorageSync('storeId', this.storeId)
@ -254,6 +255,8 @@
} }
}, },
onShow() { onShow() {
this.tabindex = 0
this.getroombq()
this.jinxinflag = false //tab this.jinxinflag = false //tab
this.getbiaoqian() this.getbiaoqian()
this.getstorebiaoqian() this.getstorebiaoqian()
@ -276,7 +279,10 @@
this.viewType = item.viewType this.viewType = item.viewType
this.mdindex = index this.mdindex = index
}, },
//
btnyc(){
this.jinxinflag = false
},
// //
getMatchingLabel(val) { getMatchingLabel(val) {
const matchingItem = this.biaoqianlist.find(item => item.dictValue === val) const matchingItem = this.biaoqianlist.find(item => item.dictValue === val)
@ -300,7 +306,6 @@
this.$u.get(`/appVerify/getDictData?dictType=ss_room_tags`).then((res) => { this.$u.get(`/appVerify/getDictData?dictType=ss_room_tags`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.biaoqianlist = res.data this.biaoqianlist = res.data
this.getstoredetail()
} }
}) })
}, },
@ -309,6 +314,13 @@
this.$u.get(`/app/room/getTagListByStoreId?storeId=${this.storeId}`).then(res => { this.$u.get(`/app/room/getTagListByStoreId?storeId=${this.storeId}`).then(res => {
if (res.code == 200) { if (res.code == 200) {
this.tabarr = res.data this.tabarr = res.data
if(this.tabarr[0].type){
this.type = this.tabarr[0].type
}else{
this.type = ''
}
this.getstoredetail()
console.log(this.tabarr);
} }
}) })
}, },
@ -320,8 +332,10 @@
}, },
// tab // tab
btngundong(section, index) { btngundong(type, index) {
this.tabindex = index this.tabindex = index
this.type = type
this.getstoredetail()
}, },
@ -592,7 +606,7 @@
getstoredetail() { getstoredetail() {
this.reservationStatus = {} this.reservationStatus = {}
let data = { let data = {
type: this.biaoqianlist[0].type == null ? '' : this.biaoqianlist[0].type type: this.type
} }
this.$u.get(`/app/store/${this.storeId}`, data).then(res => { this.$u.get(`/app/store/${this.storeId}`, data).then(res => {
if (res.code == 200) { if (res.code == 200) {

View File

@ -41,7 +41,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="tcxz"> <view class="tcxz" v-if="tclist[0].mode == 2">
<view class="tcxzname"> <view class="tcxzname">
套餐选择 套餐选择
</view> </view>
@ -53,6 +53,17 @@
</view> </view>
</view> </view>
</view> </view>
<view class="tcxz" v-else>
<view class="tcxzname">
收费方式
</view>
<view class="taocan" style="width: 600rpx;
font-weight: 400;
font-size: 28rpx;
flex-wrap: wrap;">
{{tclist[0].price == null ? '--' : tclist[0].price}}/小时最低消费{{tclist[0].minHours == null ? '--' : tclist[0].minHours}}小时押金金额{{tclist[0].deposit == null ? '--' : tclist[0].deposit}}
</view>
</view>
<view class="shichangxz"> <view class="shichangxz">
<view class="tcxzname"> <view class="tcxzname">
时长选择 时长选择
@ -190,8 +201,9 @@
</view> </view>
</view> </view>
</view> </view>
<u-select v-model="show" mode="mutil-column" title="选择时长" confirm-color="#48893B" :list="list" <!-- <u-select v-model="show" mode="mutil-column" title="选择时长" confirm-color="#48893B" :list="list"
@confirm="confirm"></u-select> @confirm="confirm"></u-select> -->
<u-picker v-model="show" title="选择时长" confirm-color="#48893B" :params="params" @confirm="confirm" mode="time"></u-picker>
<u-select v-model="shows" title="选择扣款方式" confirm-color="#48893B" :list="lists" @confirm="confirms"></u-select> <u-select v-model="shows" title="选择扣款方式" confirm-color="#48893B" :list="lists" @confirm="confirms"></u-select>
</view> </view>
</template> </template>
@ -203,7 +215,7 @@
bgc: { bgc: {
backgroundColor: "", backgroundColor: "",
}, },
indexone: -1, indexone: 0,
indextwo: -1, indextwo: -1,
yudingflag: false, yudingflag: false,
show: false, show: false,
@ -215,92 +227,14 @@
value: 'wx', value: 'wx',
label: '微信支付' label: '微信支付'
}], }],
list: [ params: {
[{ year: false,
value: '1', month: false,
label: '00' day: false,
}, hour: true,
{ minute: true,
value: '2', second: false
label: '01' },
}, {
value: '3',
label: '02'
}, {
value: '4',
label: '03'
}, {
value: '5',
label: '04'
}, {
value: '6',
label: '05'
}, {
value: '7',
label: '06'
}, {
value: '8',
label: '07'
}, {
value: '9',
label: '08'
}, {
value: '10',
label: '09'
}, {
value: '11',
label: '10'
}, {
value: '12',
label: '11'
}, {
value: '13',
label: '12'
}, {
value: '14',
label: '13'
}, {
value: '15',
label: '14'
}, {
value: '16',
label: '15'
}, {
value: '17',
label: '16'
}, {
value: '18',
label: '17'
}, {
value: '19',
label: '18'
}, {
value: '20',
label: '19'
}, {
value: '21',
label: '20'
}, {
value: '22',
label: '21'
}, {
value: '23',
label: '22'
}, {
value: '24',
label: '23'
},
],
[{
value: '3',
label: '00'
},
{
value: '4',
label: '30'
}
],
],
kstime: '', kstime: '',
jstime: '', jstime: '',
timetype: '', timetype: '',
@ -341,6 +275,41 @@
let arr = this.getCurrentWeekdayAndNextFiveDays(); let arr = this.getCurrentWeekdayAndNextFiveDays();
this.weekdayAndDateSequence = this.convertDates(arr) this.weekdayAndDateSequence = this.convertDates(arr)
console.log(this.weekdayAndDateSequence); console.log(this.weekdayAndDateSequence);
// // // // // //
this.ksriqi = this.weekdayAndDateSequence[0].date
let shijian = '20' + this.ksriqi + ' ' + this.kstime
if(shijian.slice(2,5) == 'Wed'){
this.timeshijian = this.formatDate(shijian)
}else{
this.timeshijian = this.parseTime(shijian)
}
if (this.tcobj.hours && this.kstime != '') {
this.jstime = this.addOneHourToTime(this.kstime)
}
this.indexone = 0
if(this.indexone != 0){
this.$u.get(`/app/order/getReservedTimePeriods?roomId=${this.roomId}&startTime=${'20' + this.ksriqi}`).then(res => {
if (res.code == 200) {
if(res.data == ''){
this.roomList = []
for(let i = 0;i < 24;i++){
this.roomList.push(false)
}
this.hourPointsArray = this.getDangtiantime()
}else{
this.roomList = res.data
this.hourPointsArray = this.getDangtiantime()
this.arr = this.getDangtiantimes()
this.getgengxinriqiday()
}
}
})
}else{
this.getstoredetail()
this.gettaocan()
this.hourPointsArray = this.getCurrentHourPoints() //24
}
// // // // // //
}, },
methods: { methods: {
// //
@ -373,23 +342,23 @@
Jan: '01', Feb: '02', Mar: '03', Apr: '04', Jan: '01', Feb: '02', Mar: '03', Apr: '04',
May: '05', Jun: '06', Jul: '07', Aug: '08', May: '05', Jun: '06', Jul: '07', Aug: '08',
Sep: '09', Oct: '10', Nov: '11', Dec: '12' Sep: '09', Oct: '10', Nov: '11', Dec: '12'
}; }
let month = monthMap[monthName]; let month = monthMap[monthName];
if (!month) { if (!month) {
console.error('无法识别的月份:', monthName); console.error('无法识别的月份:', monthName)
return item; // return item; //
} }
// //
let newDateStr = `${year.slice(2,4)}-${month}-${day.padStart(2, '0')}`; let newDateStr = `${year.slice(2,4)}-${month}-${day.padStart(2, '0')}`;
// //
return { return {
...item, ...item,
date: newDateStr date: newDateStr
}; }
}); })
}, },
// 24 // 24
initializeData() { initializeData() {
@ -398,7 +367,7 @@
// 0-23 // 0-23
const currentHour = now.getHours() const currentHour = now.getHours()
// //
this.hours = []; this.hours = []
this.arr = [] this.arr = []
// 24 // 24
for (let i = 0; i < 24; i++) { for (let i = 0; i < 24; i++) {
@ -503,15 +472,15 @@
const formattedDateString = `${hours}:${minutes}:${seconds}`; const formattedDateString = `${hours}:${minutes}:${seconds}`;
hourPoints.push(formattedDateString); hourPoints.push(formattedDateString);
} }
return hourPoints; return hourPoints
}, },
// + // +
getCurrentWeekdayAndNextFiveDays() { getCurrentWeekdayAndNextFiveDays() {
// //
const now = new Date(); const now = new Date()
// 01...6 // 01...6
const currentWeekday = now.getDay(); const currentWeekday = now.getDay()
const result = []; const result = [];
result.push({ result.push({
date: now.toLocaleDateString('zh-CN', { date: now.toLocaleDateString('zh-CN', {
@ -523,8 +492,8 @@
}); });
// //
for (let i = 1; i < 5; i++) { for (let i = 1; i < 5; i++) {
const newDate = new Date(now); const newDate = new Date(now)
newDate.setDate(now.getDate() + i); newDate.setDate(now.getDate() + i)
result.push({ result.push({
date: newDate.toLocaleDateString('zh-CN', { date: newDate.toLocaleDateString('zh-CN', {
year: '2-digit', year: '2-digit',
@ -575,10 +544,10 @@
roomId: this.roomId, roomId: this.roomId,
viewType:this.viewType, viewType:this.viewType,
payType: this.zfssid, payType: this.zfssid,
ruleId: this.tcobj.ruleId, ruleId:this.tclist[0].mode == 2 ? this.tcobj.ruleId : this.tclist[0].ruleId,
type: 1, type: 1,
reserveStartTime: this.timeshijian, reserveStartTime: this.timeshijian,
mode: 2, mode: this.tclist[0].mode,
hours: this.hourstime, hours: this.hourstime,
price: this.price price: this.price
} }
@ -642,7 +611,7 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
} else if (!this.tcobj.hours) { } else if (!this.tcobj.hours && this.tclist[0].mode == 2) {
uni.showToast({ uni.showToast({
title: '请先选择套餐', title: '请先选择套餐',
icon: 'none', icon: 'none',
@ -760,16 +729,31 @@
}, },
// //
confirm(e) { confirm(e) {
this.kstime = e[0].label + ':' + e[1].label if(this.tclist[0].mode == 2){
let shijian = '20' + this.ksriqi + ' ' + this.kstime this.kstime = e.hour + ':' + e.minute
console.log(shijian,shijian.slice(2,5)); let shijian = '20' + this.ksriqi + ' ' + this.kstime
if(shijian.slice(2,5) == 'Wed'){ console.log(shijian,shijian.slice(2,5));
this.timeshijian = this.formatDate(shijian) if(shijian.slice(2,5) == 'Wed'){
this.timeshijian = this.formatDate(shijian)
}else{
this.timeshijian = this.parseTime(shijian)
}
if (this.tcobj.hours) {
this.jstime = this.addOneHourToTime(this.kstime)
}
}else{ }else{
this.timeshijian = this.parseTime(shijian) this.kstime = e.hour + ':' + e.minute
} let shijian = '20' + this.ksriqi + ' ' + this.kstime
if (this.tcobj.hours) { console.log(shijian,shijian.slice(2,5));
this.jstime = this.addOneHourToTime(this.kstime) if(shijian.slice(2,5) == 'Wed'){
this.timeshijian = this.formatDate(shijian)
}else{
this.timeshijian = this.parseTime(shijian)
}
this.jstime = this.addOneHourToTimess(this.kstime)
this.price = this.tclist[0].deposit //
this.hourstime = Math.ceil(this.tclist[0].deposit / this.tclist[0].price) //
console.log(Math.ceil(this.tclist[0].deposit / this.tclist[0].price),'0000');
} }
}, },
// //
@ -791,6 +775,15 @@
let newMinutes = String(timeDate.getMinutes()).padStart(2, '0') // let newMinutes = String(timeDate.getMinutes()).padStart(2, '0') //
return `${String(newHours).padStart(2, '0')}:${newMinutes}` return `${String(newHours).padStart(2, '0')}:${newMinutes}`
}, },
//
addOneHourToTimess(timeString, date = new Date()) {
let [hours, minutes] = timeString.split(':').map(Number)
let timeDate = new Date(date.getFullYear(), date.getMonth(), date.getDate(), hours, minutes, 0, 0)
timeDate.setHours(timeDate.getHours() + Math.ceil(this.tclist[0].deposit / this.tclist[0].price)) //
let newHours = timeDate.getHours()
let newMinutes = String(timeDate.getMinutes()).padStart(2, '0') //
return `${String(newHours).padStart(2, '0')}:${newMinutes}`
},
// //
getstoredetail() { getstoredetail() {
this.$u.get(`/app/room/${this.roomId}`).then(res => { this.$u.get(`/app/room/${this.roomId}`).then(res => {
@ -860,10 +853,10 @@
let endHour = room.endTime.slice(room.endTime.length - 8, room.endTime.length - 6) // let endHour = room.endTime.slice(room.endTime.length - 8, room.endTime.length - 6) //
let timefen = room.startTime.slice(room.endTime.length - 5, room.endTime.length - 3) // let timefen = room.startTime.slice(room.endTime.length - 5, room.endTime.length - 3) //
// //
const now = new Date(); const now = new Date()
const year = now.getFullYear(); const year = now.getFullYear()
const month = String(now.getMonth() + 1).padStart(2, '0'); // 01padStart const month = String(now.getMonth() + 1).padStart(2, '0')// 01padStart
const day = String(now.getDate()).padStart(2, '0'); // padStart const day = String(now.getDate()).padStart(2, '0')// padStart
if(endHour < startHour){ if(endHour < startHour){
startHour = '00' startHour = '00'
} }
@ -889,23 +882,23 @@
for (let hour = 0; hour < 24; hour++) { for (let hour = 0; hour < 24; hour++) {
let formattedHour = String(hour).padStart(2, '0') let formattedHour = String(hour).padStart(2, '0')
if(formattedHour == '00'){ if(formattedHour == '00'){
timeString = `00:00:01`; timeString = `00:00:01`
}else{ }else{
timeString = `${formattedHour}:00:00` timeString = `${formattedHour}:00:00`
} }
hourPoints.push(timeString); hourPoints.push(timeString)
} }
return hourPoints; return hourPoints
}, },
// this.arr使 00:00 - 23:00 // this.arr使 00:00 - 23:00
getDangtiantimes() { getDangtiantimes() {
const hourPoints = []; const hourPoints = [];
for (let hour = 0; hour < 24; hour++) { for (let hour = 0; hour < 24; hour++) {
const formattedHour = String(hour).padStart(2, '0'); const formattedHour = String(hour).padStart(2, '0')
const timeString = `${formattedHour}:00:00`; const timeString = `${formattedHour}:00:00`
hourPoints.push(timeString); hourPoints.push(timeString)
} }
return hourPoints; return hourPoints
}, },
// //
btntc(index, item) { btntc(index, item) {
@ -959,9 +952,9 @@
return time_str return time_str
}, },
formatDate(inputDate) { formatDate(inputDate) {
const parts = inputDate.match(/(\d+)\D+(\w+)\s+(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+)/); const parts = inputDate.match(/(\d+)\D+(\w+)\s+(\w+)\s+(\d+)\s+(\d+)\s+(\d+):(\d+)/)
if (!parts) { if (!parts) {
throw new Error('Invalid date format'); throw new Error('Invalid date format')
} }
const [, dayOfMonth, , month, , year, hour, minute] = parts; const [, dayOfMonth, , month, , year, hour, minute] = parts;
const monthMap = { const monthMap = {
@ -971,10 +964,10 @@
}; };
const monthNum = monthMap[month]; const monthNum = monthMap[month];
let formattedHour = (parseInt(hour, 10) + 1).toString().padStart(2, '0'); let formattedHour = (parseInt(hour, 10) + 1).toString().padStart(2, '0');
let formattedMinute = minute.padStart(2, '0'); let formattedMinute = minute.padStart(2, '0')
let formattedSecond = '00'; // 00 let formattedSecond = '00'; // 00
const formattedDate = `${year}-${monthNum}-${dayOfMonth.padStart(2, '0')} ${formattedHour}:${formattedMinute}:${formattedSecond}`; const formattedDate = `${year}-${monthNum}-${dayOfMonth.padStart(2, '0')} ${formattedHour}:${formattedMinute}:${formattedSecond}`
return formattedDate; return formattedDate
} }
} }
} }
@ -1446,7 +1439,7 @@
.shichangxz { .shichangxz {
display: flex; display: flex;
align-items: center; align-items: center;
margin-top: 50rpx; margin-top: 30rpx;
// width: 3000rpx; // width: 3000rpx;
justify-content: space-between; justify-content: space-between;

1553
pages/myorder/orderxd.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -352,7 +352,10 @@
onlyFromCamera: true, onlyFromCamera: true,
scanType: ['qrCode'], scanType: ['qrCode'],
success: res => { success: res => {
console.log(res); console.log(res)
uni.navigateTo({
url:'/pages/myorder/orderxd?roomId=' + 65
})
}, },
fail: err => { fail: err => {
console.error('扫描失败:', err) console.error('扫描失败:', err)