diff --git a/common/http.interceptor.js b/common/http.interceptor.js index 5c0bfe5..5cbc2d2 100644 --- a/common/http.interceptor.js +++ b/common/http.interceptor.js @@ -20,8 +20,8 @@ const install = (Vue, vm) => { // }, // https://yxd.ccttiot.com/prod-api}); Vue.prototype.$u.http.setConfig({ - // baseUrl: 'http://192.168.2.116:8089', - baseUrl: 'https://testcha.chuangtewl.com/prod-api', + baseUrl: 'http://192.168.2.116:8089', + // baseUrl: 'https://testcha.chuangtewl.com/prod-api', loadingText: '努力加载中~', loadingTime: 800, // 设置自定义头部content-type diff --git a/page_moban/datingxq.vue b/page_moban/datingxq.vue index 78c2734..0a64487 100644 --- a/page_moban/datingxq.vue +++ b/page_moban/datingxq.vue @@ -20,12 +20,12 @@ {{ksfs}} - + 设备绑定 - {{sn}} + {{obj.device.sn == null ? '' : obj.device.sn}} @@ -51,6 +51,52 @@ + + + + + × + + + 请选择投放设备方式 + + + + + + 扫码投放 + + + 扫描设备上的二维码 + + + 投放设施 + + + + + + + + + + 未投放设备列表投放 + + + 选择未投放列表中的设备 + + + 投放设施 + + + + + + + + + + @@ -73,16 +119,18 @@ equipmentId:'', name:'', type:'', - sn:'', + obj:{}, namelist:[], ruleIdlist:[], + dtflags: false, } }, onLoad(option) { this.equipmentId = option.equipmentId - this.getxx() }, onShow() { + this.getxx() + this.namelist = [] if(uni.getStorageSync('namelist') && uni.getStorageSync('ruleIdlist')){ this.namelist = uni.getStorageSync('namelist') this.ruleIdlist = uni.getStorageSync('ruleIdlist') @@ -99,6 +147,53 @@ uni.removeStorageSync('ruleIdlist') }, methods: { + // 点击未投列表放选择 + btntouf(){ + this.dtflags = false + uni.navigateTo({ + url: '/page_shanghu/weishebei?equipmentId=' + this.obj.equipmentId + }) + }, + // 大厅设施点击扫码投放 + btnsaoma() { + uni.scanCode({ + onlyFromCamera: true, + scanType: ['qrCode'], + success: res => { + function getQueryParam(url, paramName) { + let regex = new RegExp(`[?&]${paramName}=([^&]*)`) + let results = regex.exec(url); + return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null + } + console.log(res); + let sceneValue = res.result + let decodedValue = decodeURIComponent(sceneValue) + let id = getQueryParam(decodedValue, 'sn') + let that = this + let data = { + deviceId: id, + equipmentId: this.obj.equipmentId + } + that.$u.put(`/app/store/bandGate`, data).then(res => { + if (res.code == 200) { + uni.showToast({ + title: '绑定成功', + icon: 'success', + duration: 2000 + }) + that.dtflags = false + this.getxx() + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) + } + }) + }, // 点击删除大厅设施 btndel(){ let that = this @@ -188,9 +283,7 @@ }else if(res.data.type == 3){ this.ksfs = '棋牌桌' } - if(res.data.device.sn){ - this.sn = res.data.device.sn - } + this.obj = res.data } }) }, @@ -204,6 +297,89 @@ padding-bottom: 20rpx; box-sizing: border-box; } + .mask{ + width: 100%; + height: 100vh; + background-color: #000; + opacity: .3; + position: fixed; + top: 0; + left: 0; + } + .addmen { + width: 694rpx; + height: 702rpx; + background: linear-gradient(180deg, #DEF1DA 0%, #FFFFFF 100%, #FFFFFF 100%); + border-radius: 36rpx 36rpx 36rpx 36rpx; + position: fixed; + top: 464rpx; + left: 50%; + transform: translateX(-50%); + z-index: 3; + box-shadow: 1px 2px 4px -3px; + + .one { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + + .rt { + image { + width: 60rpx; + height: 60rpx; + } + } + + .saoma { + font-weight: 600; + font-size: 36rpx; + color: #48893B; + margin-top: 10rpx; + } + + .saomas { + font-size: 28rpx; + color: #48893B; + margin-top: 10rpx; + } + + width: 584rpx; + height: 224rpx; + border: 2rpx solid #48893B; + border-radius: 20rpx; + margin: auto; + margin-top: 48rpx; + padding: 38rpx 44rpx; + box-sizing: border-box; + } + + .top { + display: flex; + flex-wrap: wrap; + padding: 0 26rpx; + box-sizing: border-box; + + .name { + font-weight: 600; + font-size: 44rpx; + color: #48893B; + width: 100%; + text-align: center; + position: absolute; + top: 56rpx; + left: 50%; + transform: translateX(-50%); + } + + .cha { + font-size: 68rpx; + font-weight: 600; + width: 100%; + text-align: right; + } + } + } .wz{ font-size: 24rpx; color: #3D3D3D; diff --git a/page_shanghu/cesuoxq.vue b/page_shanghu/cesuoxq.vue index a3b9b28..325eec6 100644 --- a/page_shanghu/cesuoxq.vue +++ b/page_shanghu/cesuoxq.vue @@ -47,24 +47,69 @@ - + 设备绑定 - {{sn}} + {{obj.device.sn == null ? '' : obj.device.sn}} - 删除 + {{txtdel}} - 修改 + {{txt}} + + + + + × + + + 请选择投放设备方式 + + + + + + 扫码投放 + + + 扫描设备上的二维码 + + + 投放设施 + + + + + + + + + + 未投放设备列表投放 + + + 选择未投放列表中的设备 + + + 投放设施 + + + + + + + + + @@ -75,18 +120,11 @@ bgc: { backgroundColor: "#fff", }, - listone:[{ - alue: '2', - label: '麻将桌' - },{ - alue: '3', - label: '台球桌' - }], listone:[{ value: '1', label: '通电开锁' },{ - alue: '2', + value: '2', label: '断电开锁' }], listthr:[ @@ -121,42 +159,137 @@ kstj:'', ksfsid:'', kstjid:'', + tit:'', + txt:'', + txtdel:'', + roomId:'', + obj:{}, + dtflags: false, } }, onLoad(option) { - this.equipmentId = option.equipmentId + if(option.equipmentId){ + this.equipmentId = option.equipmentId + this.tit = '修改卫生间信息' + this.txt = '修改' + this.txtdel = '删除' + }else{ + this.txt = '添加' + this.txtdel = '取消' + this.tit = '添加卫生间' + this.roomId = option.roomId + } + + }, + onShow() { this.getxx() }, methods: { - // 点击编辑卫生间 - btnshop(){ - let data = { - equipmentId:this.equipmentId, - name:this.name, - type:this.ksfsid, - unlockMode:this.ksfsid, - unlockCondition:this.kstjid, - unlockTime:this.kstime - } - this.$u.put(`/app/equipment`,data).then(res =>{ - if(res.code == 200){ - uni.showToast({ - title: '修改成功', - icon: 'success', - duration:2000 - }) - setTimeout(()=>{ - uni.navigateBack() - },1000) - }else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration:2000 + // 点击未投列表放选择 + btntouf(){ + this.dtflags = false + uni.navigateTo({ + url: '/page_shanghu/weishebei?equipmentId=' + this.obj.equipmentId + }) + }, + // 大厅设施点击扫码投放 + btnsaoma() { + uni.scanCode({ + onlyFromCamera: true, + scanType: ['qrCode'], + success: res => { + function getQueryParam(url, paramName) { + let regex = new RegExp(`[?&]${paramName}=([^&]*)`) + let results = regex.exec(url); + return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null + } + console.log(res); + let sceneValue = res.result + let decodedValue = decodeURIComponent(sceneValue) + let id = getQueryParam(decodedValue, 'sn') + let that = this + let data = { + deviceId: id, + equipmentId: this.obj.equipmentId + } + that.$u.put(`/app/store/bandGate`, data).then(res => { + if (res.code == 200) { + uni.showToast({ + title: '绑定成功', + icon: 'success', + duration: 2000 + }) + that.dtflags = false + this.getxx() + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } }) } }) }, + // 点击编辑卫生间 + btnshop(){ + if(this.txt == '修改'){ + let data = { + equipmentId:this.equipmentId, + name:this.name, + type:5, + unlockMode:this.ksfsid, + unlockCondition:this.kstjid, + unlockTime:this.kstime + } + this.$u.put(`/app/equipment`,data).then(res =>{ + if(res.code == 200){ + uni.showToast({ + title: '修改成功', + icon: 'success', + duration:2000 + }) + setTimeout(()=>{ + uni.navigateBack() + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 + }) + } + }) + }else{ + let data = { + name:this.name, + type:5, + roomId:this.roomId, + unlockMode:this.ksfsid, + unlockCondition:this.kstjid, + unlockTime:this.kstime + } + this.$u.post(`/app/equipment`,data).then(res =>{ + if(res.code == 200){ + uni.showToast({ + title: '添加成功', + icon: 'success', + duration:2000 + }) + setTimeout(()=>{ + uni.navigateBack() + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 + }) + } + }) + } + }, // 确认选择开锁方式 btnone(e){ this.ksfs = e[0].label @@ -173,45 +306,50 @@ }, // 点击删除厕所 btndel(){ - let that = this - uni.showModal({ - title: '温馨提示', - content: '您确定要删除此卫生间吗?', - success: function (res) { - if (res.confirm) { - that.$u.delete(`/app/equipment/${that.equipmentId}`).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: '删除成功', - icon: 'success', - duration:2000 - }) - setTimeout(()=>{ - uni.navigateBack({ - delta:1 + if(this.txtdel == '删除'){ + let that = this + uni.showModal({ + title: '温馨提示', + content: '您确定要删除此卫生间吗?', + success: function (res) { + if (res.confirm) { + that.$u.delete(`/app/equipment/${that.equipmentId}`).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: '删除成功', + icon: 'success', + duration:2000 + }) + setTimeout(()=>{ + uni.navigateBack({ + delta:1 + }) + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 }) - },1000) - }else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration:2000 - }) - } - }) - } else if (res.cancel) { - - } - } - }) + } + }) + } else if (res.cancel) { + + } + } + }) + }else{ + uni.navigateBack() + } }, // 获取设备信息 getxx(){ this.$u.get(`/app/equipment/${this.equipmentId}`).then(res => { if (res.code == 200) { + this.obj = res.data this.name = res.data.name this.type = res.data.type - this.sn = res.data.device.sn + // this.sn = res.data.device.sn this.kstime = res.data.unlockTime this.ksfsid = res.data.unlockMode this.kstjid = res.data.unlockCondition @@ -240,6 +378,89 @@ padding-bottom: 20rpx; box-sizing: border-box; } + .mask{ + width: 100%; + height: 100vh; + background-color: #000; + opacity: .3; + position: fixed; + top: 0; + left: 0; + } + .addmen { + width: 694rpx; + height: 702rpx; + background: linear-gradient(180deg, #DEF1DA 0%, #FFFFFF 100%, #FFFFFF 100%); + border-radius: 36rpx 36rpx 36rpx 36rpx; + position: fixed; + top: 464rpx; + left: 50%; + transform: translateX(-50%); + z-index: 3; + box-shadow: 1px 2px 4px -3px; + + .one { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + + .rt { + image { + width: 60rpx; + height: 60rpx; + } + } + + .saoma { + font-weight: 600; + font-size: 36rpx; + color: #48893B; + margin-top: 10rpx; + } + + .saomas { + font-size: 28rpx; + color: #48893B; + margin-top: 10rpx; + } + + width: 584rpx; + height: 224rpx; + border: 2rpx solid #48893B; + border-radius: 20rpx; + margin: auto; + margin-top: 48rpx; + padding: 38rpx 44rpx; + box-sizing: border-box; + } + + .top { + display: flex; + flex-wrap: wrap; + padding: 0 26rpx; + box-sizing: border-box; + + .name { + font-weight: 600; + font-size: 44rpx; + color: #48893B; + width: 100%; + text-align: center; + position: absolute; + top: 56rpx; + left: 50%; + transform: translateX(-50%); + } + + .cha { + font-size: 68rpx; + font-weight: 600; + width: 100%; + text-align: right; + } + } + } .wz{ font-size: 24rpx; color: #3D3D3D; diff --git a/page_shanghu/dianpuroomadd.vue b/page_shanghu/dianpuroomadd.vue index 769d1ea..2dd6473 100644 --- a/page_shanghu/dianpuroomadd.vue +++ b/page_shanghu/dianpuroomadd.vue @@ -454,6 +454,7 @@ onShow() { this.roomList = [] this.cesuolist = [] + this.gateSnflag = false this.getxq() this.getmendian() }, @@ -712,8 +713,11 @@ this.roomId = this.datingobj.roomId this.dtflag = true } else if (num == 2) { - this.roomId = this.cesuolist[0].roomId - this.dtflags = true + // this.roomId = this.cesuolist[0].roomId + // this.dtflags = true + uni.navigateTo({ + url: '/page_shanghu/cesuoxq?roomId=' + this.cesuolist[0].roomId + }) } }, // 确认添加厕所设施 @@ -775,7 +779,7 @@ // 点击跳转到大门详情 btnmendianxq() { uni.navigateTo({ - url: '/page_shanghu/toufsb?deviceId=' + this.gateSnobj.deviceId + '&storeId=' + this.storeId + url: '/page_shanghu/toufsb?storeId=' + this.storeId }) }, // 点击跳转编辑门店 @@ -832,53 +836,8 @@ url: '/page_moban/weicousuosb' }) }, - // 点击选择未投放设备 - btntouf() { - uni.navigateTo({ - url: '/page_shanghu/weishebei?storeId=' + this.storeId - }) - }, - // 大门配置点击扫码配置 - btnsaoma() { - uni.scanCode({ - onlyFromCamera: true, - scanType: ['qrCode'], - success: res => { - function getQueryParam(url, paramName) { - let regex = new RegExp(`[?&]${paramName}=([^&]*)`) - let results = regex.exec(url); - return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null - } - console.log(res); - let sceneValue = res.result - let decodedValue = decodeURIComponent(sceneValue) - let id = getQueryParam(decodedValue, 'sn') - let that = this - let data = { - sn: id, - storeId: this.storeId - } - that.$u.put(`/app/store/bandGate`, data).then(res => { - if (res.code == 200) { - uni.showToast({ - title: '绑定成功', - icon: 'success', - duration: 2000 - }) - that.xuanzeflag = false - that.addmenflag = false - that.getxq() - } else { - uni.showToast({ - title: res.msg, - icon: 'none', - duration: 2000 - }) - } - }) - } - }) - }, + + // 点击门店配置 btnroom() { this.xuanzeflag = true @@ -888,7 +847,7 @@ this.$u.get(`/app/equipment/gateGate?storeId=${this.storeId}`).then(res => { if (res.code == 200) { this.gateSnobj = res.data - if (res.data.device.sn) { + if (this.gateSnobj.device.sn) { this.gateSnflag = true } else { this.gateSnflag = false diff --git a/page_shanghu/roomsheshi.vue b/page_shanghu/roomsheshi.vue index 6fb12a3..5414e70 100644 --- a/page_shanghu/roomsheshi.vue +++ b/page_shanghu/roomsheshi.vue @@ -1,6 +1,6 @@ @@ -106,14 +152,30 @@ sn:'', namelist:[], ruleIdlist:[], - obj:{} + obj:{}, + txt:'', + txtdel:'', + roomId:'', + tit:'', + dtflags: false, } }, onLoad(option) { - this.equipmentId = option.equipmentId - this.getxx() + if(option.equipmentId){ + this.equipmentId = option.equipmentId + this.txt = '修改' + this.txtdel = '删除' + this.tit = '修改房间设施' + this.getxx() + }else{ + this.roomId = option.roomId + this.txt = '添加' + this.txtdel = '取消' + this.tit = '添加房间设施' + } }, onShow() { + this.getxx() if(uni.getStorageSync('namelist') && uni.getStorageSync('ruleIdlist')){ this.namelist = uni.getStorageSync('namelist') this.ruleIdlist = uni.getStorageSync('ruleIdlist') @@ -130,6 +192,53 @@ uni.removeStorageSync('ruleIdlist') }, methods: { + // 点击未投列表放选择 + btntouf(){ + this.dtflags = false + uni.navigateTo({ + url: '/page_shanghu/weishebei?equipmentId=' + this.obj.equipmentId + }) + }, + // 房间设施点击扫码投放 + btnsaoma() { + uni.scanCode({ + onlyFromCamera: true, + scanType: ['qrCode'], + success: res => { + function getQueryParam(url, paramName) { + let regex = new RegExp(`[?&]${paramName}=([^&]*)`) + let results = regex.exec(url); + return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null + } + console.log(res); + let sceneValue = res.result + let decodedValue = decodeURIComponent(sceneValue) + let id = getQueryParam(decodedValue, 'sn') + let that = this + let data = { + deviceId: id, + equipmentId: this.obj.equipmentId + } + that.$u.put(`/app/store/bandGate`, data).then(res => { + if (res.code == 200) { + uni.showToast({ + title: '绑定成功', + icon: 'success', + duration: 2000 + }) + that.dtflags = false + this.getxx() + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) + } + }) + }, // 确认选择开锁方式 btnone(e){ this.ksfs = e[0].label @@ -141,67 +250,99 @@ }, // 点击删除大厅设施 btndel(){ - let that = this - uni.showModal({ - title: '温馨提示', - content: '您确定要删除此设施吗?', - success: function (res) { - if (res.confirm) { - that.$u.delete(`/app/equipment/${that.equipmentId}`).then((res) => { - if (res.code == 200) { - uni.showToast({ - title: '删除成功', - icon: 'success', - duration:2000 - }) - setTimeout(()=>{ - uni.navigateBack({ - delta:1 + if(this.txtdel == '删除'){ + let that = this + uni.showModal({ + title: '温馨提示', + content: '您确定要删除此设施吗?', + success: function (res) { + if (res.confirm) { + that.$u.delete(`/app/equipment/${that.equipmentId}`).then((res) => { + if (res.code == 200) { + uni.showToast({ + title: '删除成功', + icon: 'success', + duration:2000 + }) + setTimeout(()=>{ + uni.navigateBack({ + delta:1 + }) + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 }) - },1000) - }else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration:2000 - }) - } - }) - } else if (res.cancel) { - - } - } - }) + } + }) + } else if (res.cancel) { + + } + } + }) + }else{ + uni.navigateBack() + } }, // 点击编辑大厅 btnshop(){ - console.log(this.ksfsid); - let data = { - equipmentId:this.equipmentId, - name:this.name, - type:this.kslxid, - ruleIds:this.ruleIdlist, - unlockMode:this.ksfsid, - unlockTime:this.kstime - } - this.$u.put(`/app/equipment`,data).then(res =>{ - if(res.code == 200){ - uni.showToast({ - title: '修改成功', - icon: 'success', - duration:2000 - }) - setTimeout(()=>{ - uni.navigateBack() - },1000) - }else{ - uni.showToast({ - title: res.msg, - icon: 'none', - duration:2000 - }) + if(this.txt == '修改'){ + let data = { + equipmentId:this.equipmentId, + name:this.name, + type:this.kslxid, + ruleIds:this.ruleIdlist, + unlockMode:this.ksfsid, + unlockTime:this.kstime } - }) + this.$u.put(`/app/equipment`,data).then(res =>{ + if(res.code == 200){ + uni.showToast({ + title: '修改成功', + icon: 'success', + duration:2000 + }) + setTimeout(()=>{ + uni.navigateBack() + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 + }) + } + }) + }else{ + let data = { + name:this.name, + type:this.kslxid, + roomId:this.roomId, + ruleIds:this.ruleIdlist, + unlockMode:this.ksfsid, + unlockTime:this.kstime + } + this.$u.post(`/app/equipment`,data).then(res =>{ + if(res.code == 200){ + uni.showToast({ + title: '添加成功', + icon: 'success', + duration:2000 + }) + setTimeout(()=>{ + uni.navigateBack() + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration:2000 + }) + } + }) + } }, // 点击选择收费 btnshoufei(){ @@ -227,7 +368,6 @@ this.name = res.data.name this.type = res.data.type this.kslxid = res.data.type - this.sn = res.data.device.sn this.kstime = res.data.unlockTime this.ksfsid = res.data.unlockMode if(res.data.unlockMode == 1){ @@ -245,6 +385,7 @@ }else if(res.data.type == 4){ this.kslx = '房间灯' } + // this.sn = res.data.device.sn } }) }, @@ -258,6 +399,80 @@ padding-bottom: 20rpx; box-sizing: border-box; } + .addmen { + width: 694rpx; + height: 702rpx; + background: linear-gradient(180deg, #DEF1DA 0%, #FFFFFF 100%, #FFFFFF 100%); + border-radius: 36rpx 36rpx 36rpx 36rpx; + position: fixed; + top: 464rpx; + left: 50%; + transform: translateX(-50%); + z-index: 3; + box-shadow: 1px 2px 4px -3px; + + .one { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + + .rt { + image { + width: 60rpx; + height: 60rpx; + } + } + + .saoma { + font-weight: 600; + font-size: 36rpx; + color: #48893B; + margin-top: 10rpx; + } + + .saomas { + font-size: 28rpx; + color: #48893B; + margin-top: 10rpx; + } + + width: 584rpx; + height: 224rpx; + border: 2rpx solid #48893B; + border-radius: 20rpx; + margin: auto; + margin-top: 48rpx; + padding: 38rpx 44rpx; + box-sizing: border-box; + } + + .top { + display: flex; + flex-wrap: wrap; + padding: 0 26rpx; + box-sizing: border-box; + + .name { + font-weight: 600; + font-size: 44rpx; + color: #48893B; + width: 100%; + text-align: center; + position: absolute; + top: 56rpx; + left: 50%; + transform: translateX(-50%); + } + + .cha { + font-size: 68rpx; + font-weight: 600; + width: 100%; + text-align: right; + } + } + } .wz{ font-size: 24rpx; color: #3D3D3D; diff --git a/page_shanghu/roomxq.vue b/page_shanghu/roomxq.vue index fc24d0a..6b67fc7 100644 --- a/page_shanghu/roomxq.vue +++ b/page_shanghu/roomxq.vue @@ -50,9 +50,9 @@ - + 下载二维码 @@ -65,7 +65,7 @@ 房间设施列表 - + 添加 + @@ -154,15 +150,48 @@ kstj:'', ksfsid:'', kstjid:'', - deviceId:'' + addmenflag:false } }, onLoad(option) { this.storeId = option.storeId - this.deviceId = option.deviceId + }, + onShow() { this.getmendian() }, methods: { + // 点击解绑店门 + btnjieb(){ + let that = this + uni.showModal({ + title: '温馨提示', + content: '您确定要解绑该设备吗?', + success: function (res) { + if (res.confirm) { + that.$u.post(`app/device/offline/${that.xxobj.deviceId}`).then(res => { + if (res.code == 200) { + uni.showToast({ + title: '解绑成功', + icon: 'success', + duration: 2000 + }) + setTimeout(()=>{ + uni.navigateBack() + },1000) + }else{ + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) + } else if (res.cancel) { + + } + } + }) + }, // 请求大门详情 getmendian(){ this.$u.get(`/app/equipment/gateGate?storeId=${this.storeId}`).then(res =>{ @@ -186,6 +215,54 @@ } }) }, + // 点击选择未投放设备 + btntouf() { + this.addmenflag = false + uni.navigateTo({ + url: '/page_shanghu/weishebei?equipmentId=' + this.xxobj.equipmentId + }) + }, + // 大门配置点击扫码配置 + btnsaoma() { + uni.scanCode({ + onlyFromCamera: true, + scanType: ['qrCode'], + success: res => { + function getQueryParam(url, paramName) { + let regex = new RegExp(`[?&]${paramName}=([^&]*)`) + let results = regex.exec(url); + return results ? decodeURIComponent(results[1].replace(/\+/g, ' ')) : null + } + console.log(res); + let sceneValue = res.result + let decodedValue = decodeURIComponent(sceneValue) + let id = getQueryParam(decodedValue, 'sn') + let that = this + let data = { + deviceId: id, + equipmentId: this.xxobj.equipmentId + } + that.$u.put(`/app/store/bandGate`, data).then(res => { + if (res.code == 200) { + uni.showToast({ + title: '绑定成功', + icon: 'success', + duration: 2000 + }) + that.xuanzeflag = false + that.addmenflag = false + that.getxq() + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) + } + }) + }, // 点击选择门店 btnshop(){ let data = { @@ -234,6 +311,90 @@ padding-bottom: 20rpx; box-sizing: border-box; } + .mask { + width: 100%; + height: 100vh; + background-color: #000; + opacity: .3; + position: fixed; + top: 0; + left: 0; + } + + .addmen { + width: 694rpx; + height: 702rpx; + background: linear-gradient(180deg, #DEF1DA 0%, #FFFFFF 100%, #FFFFFF 100%); + border-radius: 36rpx 36rpx 36rpx 36rpx; + position: fixed; + top: 464rpx; + left: 50%; + transform: translateX(-50%); + z-index: 3; + box-shadow: 1px 2px 4px -3px; + + .one { + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + + .rt { + image { + width: 60rpx; + height: 60rpx; + } + } + + .saoma { + font-weight: 600; + font-size: 36rpx; + color: #48893B; + margin-top: 10rpx; + } + + .saomas { + font-size: 28rpx; + color: #48893B; + margin-top: 10rpx; + } + + width: 584rpx; + height: 224rpx; + border: 2rpx solid #48893B; + border-radius: 20rpx; + margin: auto; + margin-top: 48rpx; + padding: 38rpx 44rpx; + box-sizing: border-box; + } + + .top { + display: flex; + flex-wrap: wrap; + padding: 0 26rpx; + box-sizing: border-box; + + .name { + font-weight: 600; + font-size: 44rpx; + color: #48893B; + width: 100%; + text-align: center; + position: absolute; + top: 56rpx; + left: 50%; + transform: translateX(-50%); + } + + .cha { + font-size: 68rpx; + font-weight: 600; + width: 100%; + text-align: right; + } + } + } .jieb{ width: 750rpx; height: 152rpx; diff --git a/page_shanghu/weishebei.vue b/page_shanghu/weishebei.vue index 50d9590..2d612d7 100644 --- a/page_shanghu/weishebei.vue +++ b/page_shanghu/weishebei.vue @@ -64,11 +64,12 @@ xiaflag:true, total:'', qingqiuflag:true, - storeId:'' + storeId:'', + equipmentId:'' } }, onLoad(option) { - this.storeId = option.storeId + this.equipmentId = option.equipmentId }, onShow() { this.status ='', @@ -80,8 +81,41 @@ methods: { // 点击跳转到设备信息页 btnedit(sn,deviceId){ - uni.navigateTo({ - url:'/page_shanghu/toufsb?storeId=' + this.storeId + '&sn=' + sn + '&deviceId=' + deviceId + // uni.navigateTo({ + // url:'/page_shanghu/toufsb?storeId=' + this.storeId + '&sn=' + sn + '&deviceId=' + deviceId + // }) + let that = this + uni.showModal({ + title: '温馨提示', + content: '您确定要将设备投放此设施吗?', + success: function (res) { + if (res.confirm) { + let data = { + deviceId: deviceId, + equipmentId: that.equipmentId + } + that.$u.put(`/app/equipment`, data).then(res => { + if (res.code == 200) { + uni.showToast({ + title: '投放成功', + icon: 'success', + duration: 2000 + }) + setTimeout(()=>{ + uni.navigateBack() + },1000) + } else { + uni.showToast({ + title: res.msg, + icon: 'none', + duration: 2000 + }) + } + }) + } else if (res.cancel) { + + } + } }) }, // 请求所有设备列表 diff --git a/page_user/zhaoshang.vue b/page_user/zhaoshang.vue index bb3a7ab..c0fabe2 100644 --- a/page_user/zhaoshang.vue +++ b/page_user/zhaoshang.vue @@ -3,7 +3,7 @@ - + * 您的姓名 diff --git a/pages.json b/pages.json index ad18bbc..2100be1 100644 --- a/pages.json +++ b/pages.json @@ -68,6 +68,13 @@ "enablePullDownRefresh": false, "navigationStyle": "custom" } + },{ + "path": "pages/myorder/taiqiuyuding", + "style": { + "navigationBarTitleText": "", + "enablePullDownRefresh": false, + "navigationStyle": "custom" + } },{ "path": "pages/myorder/returned/index", "style": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 121f992..ca85907 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3,7 +3,7 @@ - + @@ -27,7 +27,65 @@ 距我{{shopobj.distance == undefined ? '--' : shopobj.distance}}km {{shopobj.address == undefined ? '--' : shopobj.address}} - + + + + 空闲 2 + 茶室 + + + + + 空闲 2 + 棋牌 + + + + + 空闲 2 + 台球 + + + + + 茶室 干净舒适品好茶 + + + 棋牌 轻松消费无压力 + + + 台球 好台打好球,赛事级桌台 + + + + + + + + + 一号桌 + + + 开台 + + + + + + 杆柜 + + + + + + + + @@ -106,6 +164,7 @@ 没有更多房间啦,敬请期待吧... + @@ -173,7 +232,8 @@ arr:[], jinxinglist:[], jinxinflag:false, - jinxintxt:'开包厢' + jinxintxt:'开包厢', + tabindex:0 } }, onLoad(option) { @@ -194,6 +254,19 @@ }, methods: { + // 点击台球桌预定 + btntq(){ + uni.navigateTo({ + url:'/pages/myorder/taiqiuyuding' + }) + }, + + // 点击切换tab类型 + btngundong(section, index) { + this.tabindex = index + }, + + // 拿到当前时间后24小时格式成两位数 initializeData() { // 获取当前时间 @@ -463,6 +536,142 @@ background-color: #226914 !important; color: #fff !important; } + .taiqiubox{ + max-height: 710rpx; + overflow: scroll; + padding-bottom: 240rpx; + box-sizing: border-box; + .zhuozi{ + width: 99%; + max-height: 5632rpx; + box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0,0,0,0.15); + margin: auto; + margin-top: 10rpx; + padding: 10rpx; + padding-top: 0; + box-sizing: border-box; + border-radius: 10rpx; + .tqlist{ + display: flex; + flex-wrap: wrap; + justify-content: space-between; + .tqlist_item{ + width: 308rpx; + height: 180rpx; + position: relative; + margin-top: 16rpx; + .name{ + font-size: 36rpx; + color: #FFFFFF; + width: 100%; + text-align: center; + padding-top: 34rpx; + box-sizing: border-box; + } + .kaitai{ + width: 90rpx; + height: 42rpx; + background: #C5DFC0; + border-radius: 4rpx 4rpx 4rpx 4rpx; + text-align: center; + line-height: 42rpx; + font-size: 28rpx; + color: #48893B; + margin: auto; + margin-top: 14rpx; + } + image{ + position: absolute; + width: 308rpx; + height: 180rpx; + z-index: -1; + } + } + } + } + .gangui{ + width: 674rpx; + height: 298rpx; + position: relative; + margin-top: 16rpx; + image{ + position: absolute; + width: 674rpx; + height: 298rpx; + } + .cun{ + width: 92rpx; + height: 92rpx; + background: #48893B; + border: 2rpx solid #191114; + border-radius: 50%; + text-align: center; + line-height: 92rpx; + font-size: 40rpx; + color: #FFFFFF; + } + } + .tqname{ + font-weight: 600; + font-size: 32rpx; + color: #3D3D3D; + margin-top: 44rpx; + } + } + .typewz{ + display: flex; + align-items: center; + margin-top: 16rpx; + margin-bottom: 10rpx; + .one{ + font-weight: 600; + font-size: 32rpx; + color: #3D3D3D; + margin-right: 20rpx; + } + .two{ + font-size: 24rpx; + color: #3D3D3D; + } + } + .tongji{ + width: 100%; + height: 120rpx; + background: #FFFFFF; + border-radius: 0rpx 0rpx 0rpx 0rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + .one{ + width: 188rpx; + text-align: center; + .kg{ + font-weight: 600; + font-size: 24rpx; + color: #3D3D3D; + text{ + color: #48893B; + margin-left: 4rpx; + } + } + .gn{ + font-weight: 600; + font-size: 32rpx; + color: #3D3D3D; + margin-top: 10rpx; + } + image{ + width: 58rpx; + height: 14rpx; + } + } + .xian{ + width: 1px; + height: 62rpx; + background-color: #3D3D3D; + } + } .karaokeroom{ position: fixed; top: 332rpx; @@ -544,6 +753,8 @@ page { background: #fff; border-radius: 0rpx 0rpx 0rpx 0rpx; + height: 100vh; + overflow: hidden; } /deep/ .u-indicator-item-number { @@ -555,7 +766,7 @@ .xuanfu { position: fixed; - top: 52%; + top: 62%; right: 30rpx; animation: fadeInDowns .5s ease-out forwards; @@ -593,7 +804,7 @@ .xuanfus { position: fixed; - top: 52%; + top: 62%; right: -80rpx; animation: fadeInDown .5s ease-out forwards; diff --git a/pages/myorder/index.vue b/pages/myorder/index.vue index 9436449..4ebacfb 100644 --- a/pages/myorder/index.vue +++ b/pages/myorder/index.vue @@ -404,11 +404,9 @@ }) // console.log(room.reservationStatus,'02.0230.'); // room.forEach(period => { - let startHour = room.startTime.slice(room.startTime.length - 8, room.startTime.length - - 6) //取预定开始时间小时 + let startHour = room.startTime.slice(room.startTime.length - 8, room.startTime.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 year = now.getFullYear(); @@ -777,7 +775,7 @@ this.$u.get(`/app/room/${this.roomId}`).then(res => { if (res.code == 200) { this.shopobj = res.data - if(res.data.reservedTimePeriods == ''){ + if(res.data.reservedTimePeriods == null){ this.roomList = [] for(let i = 0;i < 24;i++){ this.roomList.push(false) @@ -993,7 +991,8 @@ margin-top: 18rpx; padding-bottom: 220rpx; box-sizing: border-box; - + height: 100vh; + overflow: hidden; .yudingtrue { width: 600rpx; height: 806rpx; diff --git a/pages/myorder/taiqiuyuding.vue b/pages/myorder/taiqiuyuding.vue new file mode 100644 index 0000000..e23a72a --- /dev/null +++ b/pages/myorder/taiqiuyuding.vue @@ -0,0 +1,480 @@ + + + + + \ No newline at end of file diff --git a/pages/nearbystores/index.vue b/pages/nearbystores/index.vue index 4304ecf..acd591a 100644 --- a/pages/nearbystores/index.vue +++ b/pages/nearbystores/index.vue @@ -2,7 +2,7 @@ - + 商户中心 @@ -17,13 +17,27 @@ + + + 茶室 + + + + 棋牌 + + + + 台球 + + + - + {{item.minimumTime == undefined ? '--' : item.minimumTime}}小时起订 @@ -35,6 +49,11 @@ {{item.address == undefined ? '--' : item.address}} + + + + + 距我{{item.distance == undefined ? '--' : item.distance}}km @@ -56,7 +75,7 @@ - + @@ -125,7 +144,8 @@ jinxinglist:[], mdindex:-1, jinxinflag:false, - sousuovalue:'' + sousuovalue:'', + tabindex:1 } }, onLoad(option) { @@ -142,6 +162,10 @@ this.getorder() }, methods: { + // 点击切换门店类型 + btntabindex(num){ + this.tabindex = num + }, // 点击跳转到商户中心 btnshanghu(){ uni.navigateTo({ @@ -475,6 +499,38 @@ background-color: #226914 !important; color: #fff !important; } + .activetab{ + font-weight: 600 !important; + font-size: 40rpx !important; + color: #3D3D3D !important; + } + .tabqh{ + display: flex; + width: 100%; + height: 84rpx; + background-color: #DEF1DA; + position: fixed; + top: 306rpx; + border-radius: 30rpx 30rpx 0 0; + view{ + font-weight: 600; + font-size: 32rpx; + color: #7C7C7C; + text-align: center; + width: 33%; + height: 84rpx; + line-height: 84rpx; + position: relative; + image{ + // width: 291rpx; + height: 84rpx; + position: absolute; + top: 0; + left: 0; + z-index: -1; + } + } + } .jinxinx{ width: 60rpx; height: 60rpx; @@ -615,10 +671,10 @@ width: 750rpx; height: 1250rpx; background: #FFFFFF; - margin-top: 28rpx; + margin-top: 48rpx; border-radius: 30rpx 30rpx 0 0; padding: 48rpx; - padding-top: 0 !important; + padding-top: 84rpx; box-sizing: border-box; overflow: scroll; padding-bottom: 240rpx !important; @@ -634,6 +690,15 @@ box-shadow: 0rpx 2rpx 12rpx 0rpx rgba(0,0,0,0.15); border-radius: 18rpx 18rpx 18rpx 18rpx; .rt{ + .storebq{ + margin-top: 16rpx; + display: flex; + image{ + width: 108rpx; + height: 40rpx; + margin-right: 10rpx; + } + } .yuding{ display: flex; align-items: center; @@ -655,7 +720,7 @@ .juli{ display: flex; justify-content: space-between; - margin-top: 56rpx; + margin-top: 16rpx; align-items: center; .kmjuli{ width: 210rpx;