From 1d59690a57fe445cef1443a1a06a3615a4dafa40 Mon Sep 17 00:00:00 2001 From: zmt Date: Thu, 29 Jul 2021 16:29:40 +0800 Subject: [PATCH] =?UTF-8?q?8=E6=9C=88=E4=BB=BD=E9=9C=80=E6=B1=82=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=83=A8=E5=88=86=EF=BC=88=E7=A9=BA=E8=B0=83=EF=BC=8C?= =?UTF-8?q?=E7=A7=9F=E7=90=83=E6=9C=BA=EF=BC=89=EF=BC=8C=E7=AD=89=E5=BE=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 1 - src/subpackage/device/js/device_api.js | 1 + src/subpackage/device/pages/index/airC_manage.vue | 593 ++++++++++++++++++++- src/subpackage/device/pages/index/index.vue | 16 +- .../device/pages/index/lease_ball_box_manage.vue | 226 +++++--- .../device/pages/switch_manage/switch_manage.vue | 148 +++-- .../device/static/images/check_type_2.png | Bin 0 -> 1895 bytes src/subpackage/device/static/images/cmd-close.png | Bin 0 -> 6681 bytes src/subpackage/device/static/images/cmd-cold.png | Bin 0 -> 6520 bytes src/subpackage/device/static/images/cmd-hot.png | Bin 0 -> 5704 bytes src/subpackage/device/style/img_bg.scss | 5 + 11 files changed, 860 insertions(+), 130 deletions(-) create mode 100644 src/subpackage/device/static/images/check_type_2.png create mode 100644 src/subpackage/device/static/images/cmd-close.png create mode 100644 src/subpackage/device/static/images/cmd-cold.png create mode 100644 src/subpackage/device/static/images/cmd-hot.png create mode 100644 src/subpackage/device/style/img_bg.scss diff --git a/src/pages.json b/src/pages.json index 648f733..124e40c 100644 --- a/src/pages.json +++ b/src/pages.json @@ -281,7 +281,6 @@ "navigationBarTitleText": "租球机管理" } }, - { "path": "pages/switch_manage/switch_manage", "style" : { diff --git a/src/subpackage/device/js/device_api.js b/src/subpackage/device/js/device_api.js index 474bbce..80becb5 100644 --- a/src/subpackage/device/js/device_api.js +++ b/src/subpackage/device/js/device_api.js @@ -53,6 +53,7 @@ export const DEVICE_API = { getLotDetail:`${ORIGIN}/ouxuanac/iotSim/huawei/get`, //查询物联卡详情 reboot4G:`${ORIGIN}/ouxuanac/router4G/reboot`, //重启4G 路由 + cabinetList:`${ORIGIN}/stadium/rentball/cabinet/list`, //柜子列表 } diff --git a/src/subpackage/device/pages/index/airC_manage.vue b/src/subpackage/device/pages/index/airC_manage.vue index 48d48ea..df97a6b 100644 --- a/src/subpackage/device/pages/index/airC_manage.vue +++ b/src/subpackage/device/pages/index/airC_manage.vue @@ -1,8 +1,591 @@ - + + + + }, + bindTimeChange(e){ //时间选择 + this.time = e.target.value + }, + bindTimeChangeStart(e){ //日期选择 + if(new Date(this.endTime)-new Date(e.target.value)<0) return util.showNone("开始时间异常") + this.startTime = e.target.value + }, + bindTimeChangeEnd(e){ //日期选择 + if(new Date(e.target.value)-new Date(this.startTime)<0) return util.showNone("结束时间异常") + this.endTime = e.target.value + }, + bindPickerChangeDay(e){ //月选择 + console.log('bindPickerChangeDay,携带值为', e.target.value) + this.dIndex = e.target.value + }, + //删除计划任务 + delItem(e,i) { + let that = this + let delData = { + "device": this.curStoreInfo.device_name, + "delay": 1, + "data": { + "name": "delete-time-select", + "value": { + "uuid": e[3] + } + } + } + uni.showModal({ + content: `确认要删除: ${e[0]}的计划任务 ?`, + success(res) { + console.log("确认删除", res.confirm) + if(res.confirm){ + that.operateReq({ + data: delData, + succFun: (res) => { + that.updateList() + }, + isTip:true + }) + } + }, + }) + }, + getDate(type) { + const date = new Date(); + let year = date.getFullYear(); + let month = date.getMonth() + 1; + let day = date.getDate(); + + if (type === 'start') { + year = year - 0; + } else if (type === 'end') { + year = year + 10;//限制可选10年内 + } + month = month > 9 ? month : '0' + month;; + day = day > 9 ? day : '0' + day; + return `${year}-${month}-${day}`; + }, + async sendDataToVC() { + let that = this + let timingData = { + } + timingData = this.reqData + + this.operateReq({ + data: timingData, + succFun: (res) => { + console.log("操作结果:",res); + if(res=="ok"){ + let timing_list = "/subpackage/device/pages/timing/timing_list" + util.routeTo(`${timing_list}`, 'nT'); + } + }, + isTip:true + }) + }, + goBack() { + uni.navigateBack({ + delta: 1 + }) + }, + // 操作接口请求 + operateReq({ + data, + succFun, + isTip = false, + isLoad = true, + + }) { + let that = this + if (isLoad) util.showLoad(); + deviceServer.post({ + url: deviceApi.ouxuanac, + data: data, + isDefaultGet: false, + }) + .then(res => { + if (isLoad) util.hideLoad(); + if (res.data.code == 0) { + if (isTip) util.showNone(res.data.message || '操作成功!'); + succFun(res.data.data) + } else { + if (isTip) util.showNone(res.data.message || '操作失败!'); + } + }) + .catch(err => { + if (isLoad) util.hideLoad() + }) + }, + + } + } + + + diff --git a/src/subpackage/device/pages/index/index.vue b/src/subpackage/device/pages/index/index.vue index 940bc1c..1a5527c 100644 --- a/src/subpackage/device/pages/index/index.vue +++ b/src/subpackage/device/pages/index/index.vue @@ -53,7 +53,7 @@ const tabArr = [ // {id: 13, name: '监控', path: `/pages/switch_manage/switch_manage`}, {id: 14, name: '音响', path: `/pages/audio_manage/audio_manage`}, //audio_manage // {id: 15, name: '机器人', path: ``}, - // {id: 16, name: '租球机', path: ``}, + {id: 16, name: '租球机', path: `/pages/switch_manage/switch_manage`}, // {id: 17, name: '窗帘', path: `/pages/switch_manage/switch_manage`}, {id: 18, name: '路由器', path: `/pages/switch_manage/switch_manage`}, {id: 19, name: '物联卡', path: `/pages/switch_manage/switch_manage`}, @@ -147,11 +147,23 @@ export default { e.id == 11 ||  // 水阀 e.id == 13 ||  // 监控 e.id == 14 ||  // 音响 + e.id == 16 ||  // 租球机 e.id == 17 ||  // 窗帘 e.id == 18 ||  // 路由 e.id == 19 ||  // 物联卡 e.id == 7   // 售货柜 - )return util.routeTo(`${rootPage}${e.path}?sid=${e.id}`, 'nT'); + ){ + let _path = `${rootPage}${e.path}?sid=${e.id}`; + uni.navigateTo({ + url:_path, + success() { + console.log("navigateTo success!",_path); + } + }) + return + // return util.routeTo(`${rootPage}${e.path}?sid=${e.id}`, 'nT'); + + } util.showNone(`开发中!`); } } diff --git a/src/subpackage/device/pages/index/lease_ball_box_manage.vue b/src/subpackage/device/pages/index/lease_ball_box_manage.vue index b9d764a..4bf9008 100644 --- a/src/subpackage/device/pages/index/lease_ball_box_manage.vue +++ b/src/subpackage/device/pages/index/lease_ball_box_manage.vue @@ -1,44 +1,45 @@ @@ -46,13 +47,14 @@ import util from '../../../../utils/util'; import store_name from '../../components/store_name/store_name'; import deviceServer from '../../js/device_server'; - import deviceApi from '../../js/device_api'; - - const rootPage = '/subpackage/device' - + import deviceApi from '../../js/device_api'; + + const rootPage = '/subpackage/device' + import { mapState - } from 'vuex' + } from 'vuex' + export default { components: { 'store-name': store_name @@ -61,18 +63,22 @@ ...mapState({ storeList: state => state.device.storeList, curStoreInfo: state => state.device.curStoreInfo, - }), + }), }, data() { return { update_time: new Date(), - accountList: false + accountList: false, + cabinetInfo:{ + cabinets:[{rent_status:false,cabinet_name:'1',done:true},{rent_status:true,cabinet_name:'2'},{rent_status:false,cabinet_name:'3'}] + }, + selectAll:false, } - }, + }, async onLoad(opts) { console.log("opts:", opts); this.mac = opts.mac; - this.updateList() + // this.updateList() // try { // util.showLoad(); // let _brandInfo = await this.$store.dispatch('getBrandInfo'); @@ -92,7 +98,24 @@ // this.updateList() // } }, - methods: { + methods: { + + // 柜子列表 + getCabinetList() { + // util.showLoad(); + boxServer.get({ + url: deviceApi.cabinetList, + data: { + hardware_id: this.leaseBallBoxInfo.hardware_id, + }, + failMsg: '加载数据失败!' + }) + .then(res => { + // util.hideLoad(); + console.log("柜子列表: ",res); + this.cabinetInfo = res + }); + }, clickGoMonitorAccount() { util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_list`, 'nT'); }, @@ -177,11 +200,11 @@ diff --git a/src/subpackage/device/pages/switch_manage/switch_manage.vue b/src/subpackage/device/pages/switch_manage/switch_manage.vue index 3f691e4..32e612b 100644 --- a/src/subpackage/device/pages/switch_manage/switch_manage.vue +++ b/src/subpackage/device/pages/switch_manage/switch_manage.vue @@ -26,38 +26,46 @@ - - - {{pageInfo.openName || '-'}} - - - - {{pageInfo.closeName || '-'}} - - - - {{pageInfo.longOpenName || '-'}} - - - - {{pageInfo.timingName || '-'}} + + + + {{pageInfo.openName || '-'}} + + + + {{pageInfo.closeName || '-'}} + + + + {{pageInfo.longOpenName || '-'}} + + + + {{pageInfo.timingName || '-'}} + + + {{pageInfo.detailName || '-'}} + - - {{pageInfo.detailName || '-'}} + + 详情 + +