Browse Source

8月份需求页面部分(空调,租球机),等待接口对接

voice08
zmt 4 years ago
parent
commit
1d59690a57
  1. 1
      src/pages.json
  2. 1
      src/subpackage/device/js/device_api.js
  3. 593
      src/subpackage/device/pages/index/airC_manage.vue
  4. 16
      src/subpackage/device/pages/index/index.vue
  5. 226
      src/subpackage/device/pages/index/lease_ball_box_manage.vue
  6. 148
      src/subpackage/device/pages/switch_manage/switch_manage.vue
  7. BIN
      src/subpackage/device/static/images/check_type_2.png
  8. BIN
      src/subpackage/device/static/images/cmd-close.png
  9. BIN
      src/subpackage/device/static/images/cmd-cold.png
  10. BIN
      src/subpackage/device/static/images/cmd-hot.png
  11. 5
      src/subpackage/device/style/img_bg.scss

1
src/pages.json

@ -281,7 +281,6 @@
"navigationBarTitleText": "租球机管理"
}
},
{
"path": "pages/switch_manage/switch_manage",
"style" : {

1
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`, //柜子列表
}

593
src/subpackage/device/pages/index/airC_manage.vue

@ -1,8 +1,591 @@
<template>
</template>
<template>
<view class="airC-page">
<!-- <store-name></store-name> -->
<view class="t-title">{{'1号空调'}}管理</view>
<view class="t-box">
<view class="info-list">
<view class="i-box-up">
<view class="i-u-item">
<text>温度</text>
<view class="">28</view>
<text> </text>
</view>
<view class="i-u-item">
<text>湿度</text>
<view class="">82</view>
<text>%</text>
</view>
</view>
<view class="i-box-down">
<view class="i-d-item" @click="runCMD">
<image src="../../static/images/cmd-cold.png" mode=""></image>
<text>制冷</text>
</view>
<view class="i-d-item" @click="runCMD">
<image src="../../static/images/cmd-hot.png" mode=""></image>
<text>制热</text>
</view>
<view class="i-d-item" @click="runCMD">
<image src="../../static/images/cmd-close.png" mode=""></image>
<text>关闭</text>
</view>
</view>
</view>
<view class="control-pad">
<text>红外定义命令</text>
<view class="pad-box">
<view class="b-item" v-for="i in 62" :class="(i+1)%4!=0?'m-right':''" @click="runCMD(i)">命令{{i}}</view>
</view>
</view>
<!-- <view class="save-btn" @click="saveAdd">保存</view> -->
<!-- <view class="bottom-tips">保存后发布后将会以最新的定时更新到欧轩智能中控设备首页<text>定时列表</text>可查看最新发布</view> -->
</view>
<!-- 日期天多选选择弹框 -->
<view class="voice_control_pad" v-if="padConfig.show" @touchmove.stop.prevent="(()=>{})">
<view class="cover_bg" @click.stop="padConfig.show=false" @touchmove.stop.prevent="(()=>{})"></view>
<view class="v_box" >
<scroll-view scroll-y="true" >
<view class="il-select-week">
<block v-for="(e,i) in dayArrSelect" :key="i">
<view class="" :class="e?'active':''" @click.stop="clickDaysTab(i)">{{i+1}} </view>
</block>
</view>
</scroll-view>
<view class="v_btns">
<view class="voice_btn btn_green" @click="padConfig.show=false">确认</view>
</view>
</view>
</view>
</view>
</template>
<script>
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'
const tabArr = [{
id: 0,
name: '全部',
path: ``,
on: true
},
];
const weekArrCN = ["日", "一", "二","三","四","五","六"];
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
isDel() {
return (item) => {
return item[2] == "删除" ? "true" : ""
}
},
startDate() {
return this.getDate('start');
},
endDate() {
return this.getDate('end');
}
},
data() {
const currentDate = this.getDate({
format: true
})
const dayArrSelect = (()=>{
let days = []
for(var i=1;i<=31;i++){
days.push(false)
}
return days
})()
return {
switchInfo:"",//
on:false,
singleArr:["星期","具体日期","具体时间段"],
sIndex:0,
dayArrSelect:dayArrSelect,//31
dIndex:0,
weekArrCN,
weekArrSelect:[false,false,false,false,false,false,false],
date: currentDate,
time: '00:00-',
startTime:"",
endTime:"",
padConfig:{
show:false,
data:[]
},
reqData:{// sendPacket switchData->postData->reqData()
"device": "00-10-7a-0f-6d-7a",
"delay": 1,
"data": {
"name": "set-time-select",
"value": {
"data": "传入设置的json格式字符串,例如:{\"time_arrow_id\":\"c8c39f5c-8dd4-11eb-9aad-4e965989bbce\",\"group\":\"RPIO\",\"type\":\"DAY_OF_WEEK\",\"day_of_week\":[0,1,2,3,6,5,4],\"day_of_month\":null,\"date_slice\":[{\"start\":\"\",\"end\":\"\"}],\"times_on_day\":[\"10:13:00-10:13:10\"],\"expand_tags\":null,\"expand_value\":{\"main\":{\"name\":\"set-rpio\",\"title\":\"测试中控照明9\",\"value\":{\"id\":\"9\",\"status\":\"high\"}}},\"weights\":0,\"extension\":null}"
}
}
},
postData:{// reqData.data.value
"time_arrow_id": "", //
"group": "RPIO", //,,,
"type": "DAY_OF_WEEK", //DAY_OF_WEEK/DAY_OF_MONTH/DATE_SLICE , ,,.
"day_of_week": [
],
"day_of_month": null, //
"date_slice": [
{
"start": "",
"end": ""
}
],
"times_on_day": [//
// "10:13:00-10:13:10" //,10s
],
"expand_tags": null,
"expand_value": {
"main": { //
"name": "set-rpio",
"title": "",
"value": {
"id": "",//id
"status": "high" //low:, high:
}
}
},
"weights": 0,//
"extension": null
},
switchData:"",// postData.expand_value.main
}
},
async onLoad(option) {
this.handleOpts(option);
},
onShow() {
// this.updateList() //
},
watch: {
curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
}
},
methods: {
//
handleOpts(option){
let switchInfo = JSON.parse(decodeURIComponent(option.switchInfo));
this.switchInfo = switchInfo // (使hardware_name)
this.switchData = switchInfo.switchData //
},
//
runCMD(){
let {switchData,postData,reqData,curStoreInfo,sIndex,time,getWeekRes,getMonthDaysRes,getSliceRes,getDayTimeRes,sendDataToVC} = this;
uni.showModal({
content: `确认要执行 ?`,
success(res) {
console.log("确认执行", res.confirm)
if(res.confirm){
// sendDataToVC();
}
},
})
},
tapSwitch(){ //
this.on = !this.on
this.switchData.data.value.status = this.on? "low":"high";
},
bindPickerChangeSingle(e){
console.log('bindPickerChangeSingle,携带值为', e.target.value)
this.sIndex = e.target.value
// DAY_OF_WEEK/DAY_OF_MONTH/DATE_SLICE
this.postData.type = ['DAY_OF_WEEK','DAY_OF_MONTH','DATE_SLICE'][e.target.value]
this.resetPostData();
},
resetPostData(){ //
let _reset = {
"day_of_week": [
],
"day_of_month": null, //
"date_slice": [{
"start": "",
"end": ""
}
],}
for(var i in _reset){
console.log("重置:",i);
this.postData[i] = _reset[i]
}
<script>
</script>
},
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()
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.airC-page {
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
margin: 60rpx auto 72rpx 40rpx;
}
.t-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
width: 100%;
.info-list {
margin-bottom: 50rpx;
width: 670rpx;
height: 470rpx;
background: #FFFFFF;
border-radius: 10rpx;
font-size: 32rpx;
@include centerFlex(center);
flex-direction: column;
.i-box-up{
width: 100%;
padding: 26rpx;
@include centerFlex(space-between);
.i-u-item{
@include centerFlex(center);
width: 300rpx;height: 180rpx;
background: #F2F2F7;
border-radius: 4rpx;
position: relative;
> view{
color: #009874;font-size: 80rpx;
}
> text{
position: absolute;
}
> text:first-child{
top: 20rpx;
left: 25rpx;
font-size: 28rpx;
color: #9C9C9F;
}
> text:last-child{
top: 50rpx;
right: 70rpx;
color: #009874;
}
}
}
.i-box-down{
margin: 20rpx 0 40rpx 0;
padding: 0 104rpx;
@include centerFlex(space-between);
width: 100%;
font-size: 24rpx;
color: #9A9A9D;
.i-d-item{
@include centerFlex(center);
flex-direction: column;
image{
margin-bottom: 15rpx;
width: 100rpx;
height: 100rpx;
}
}
}
}
.control-pad{
width: 720rpx;
> text{
font-size: 28rpx;
color: #9C9C9F;
margin-left:20rpx;
}
.pad-box{
margin-top: 30rpx;
margin-bottom: 30rpx;
width: 100%;
padding-left: 15rpx;
@include centerFlex(flex-start);
flex-wrap: wrap;
.b-item{
margin-bottom:20rpx ;
@include centerFlex(center);
width: 160rpx;
height: 86rpx;
background: #FFFFFF;
border-radius: 6rpx;
font-size: 28rpx;
color: #1A1A1A;
}
.m-right{
margin-right: 20rpx;
}
}
}
}
}
// css
.save-btn{
width: 700rpx;
height: 110rpx;
text-align: center;
line-height: 110rpx;
background: #009874;
border-radius: 10px;
color: white;
}
.bottom-tips{
font-size: 28rpx;
color: #1A1A1A;
text{
color: #009874;
}
margin: 40rpx;
}
//
.voice_control_pad {
position: fixed;
top: 0;
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
z-index: 1;
.cover_bg {
position: fixed;
top: 0;
background: rgba($color: #000000, $alpha: .3);
z-index: 2;
width: 100%;
height: 100%;
}
.v_box {
z-index: 3;
width: 630rpx;
background-color: white;
border-radius: 10rpx;
scroll-view{
margin-top: 30rpx;
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
border-radius: 5rpx;
flex-wrap: wrap;
width: 100%;
height: 700rpx;
border-bottom: 1rpx solid #F2F2F7;
.il-select-week{
width: 100%;
height: auto;
@include centerFlex(flex-start);
flex-wrap: wrap;
> view{
@include centerFlex(center);
width: 160rpx;
height: 88rpx;
border: 2rpx solid #979797;
border-radius: 6rpx;
color: #979797;
margin-left: 40rpx;
margin-top: 40rpx;
}
.active{
background: rgba(0,152,116,0.12);
border: 2rpx solid #009874;color: #009874;
}
}
<style>
}
.voice_btn {
width: 392rpx;
height: 112rpx;
background: #009874;
border-radius: 5rpx;
text-align: center;
line-height: 112rpx;
color: white;
font-size: 32rpx;
}
.btn_active {
color: black;
background-color: rgba($color: #000000, $alpha: .4);
}
.btn_white {
width: 204rpx;
height: 88rpx;
background-color: white;
color: #009874;
border: 1rpx solid #009874;
line-height: 88rpx;
}
.btn_green {
width: 204rpx;
height: 88rpx;
background-color: #009874;
color: white;
line-height: 88rpx;
}
.v_btns {
width: 100%;
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
margin: 50rpx 0;
}
}
}
</style>

16
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(`开发中!`);
}
}

226
src/subpackage/device/pages/index/lease_ball_box_manage.vue

@ -1,44 +1,45 @@
<template>
<view class="t-monitor-page">
<!-- <store-name></store-name> -->
<view class="t-title">管理监控平台账户
<view class="t-title">租球机管理
<!-- <view class="t-go-monitor" @click="clickGoMonitorAccount">管理监控平台账户
<image src="../../static/images/refresh.png" mode=""></image>
</view> -->
</view>
<view class="list-box">
<form @submit="formSubmit" @reset="formReset">
<view class="f-item">
<text>所属平台</text>
<input name="platform" placeholder="请输入所属平台" placeholder-class="i-class" type="text" value="" />
</view>
<view class="f-item">
<text>名称</text>
<input name="name" placeholder="请输入名称" placeholder-class="i-class" type="text" value="" />
<view class="ip-box">
<view class="ib-list" >
<block v-for="(e,i) in cabinetInfo.cabinets" :key="i">
<view class="il-item" @click="listChange(e)">
<view class="i-tag" v-if="e.done">已租</view>
<view class="i-tag t-red" v-else>未租</view>
<text>{{e.cabinet_name || ''}}</text>
<view class="check-box" v-if="e.rent_status == false"></view>
<image v-else src="../../static/images/check_type_2.png" mode="" ></image>
</view>
</block>
</view>
<view class="f-item">
<text>appKey</text>
<input name="appkey" placeholder="请输入appKey" placeholder-class="i-class" type="text" value="" />
</view>
<view class="f-item">
<text>Secret</text>
<input name="secret" placeholder="请输入Secret" placeholder-class="i-class" type="text" value="" />
</view>
<button class="add-btn" form-type="submit" submit hover-class="btn-active" >保存</button>
<view class="l-edit">
<view class="add-btn white-style">删除</view>
<view class="add-btn">保存</view>
</view>
</form>
</view>
</view>
<view class="info-box">
<!-- 页面底部信息栏 -->
<!-- <view class="info-box">
<view class="t1">上述信息请前往萤石云开放平台注册并以下步骤获取<text>https://open.ys7.com/</text> <text class="t-copy"
@click="copyInfo">复制地址</text></view>
<view class="t2">1在控制台内-我的账户-应用信息里面创建应用获得appKey和Secret并填入上方</view>
<view class="t3">2在我的资源-设备列表内添加您的设备如有可忽略</view>
</view>
</view> -->
<view class="bottom-box">
<view class="" @click="selectAll=!selectAll">
<view class="check-box" v-if="selectAll == false"></view>
<image v-else src="../../static/images/check_type_2.png" mode="" ></image>
<text>全选</text>
</view>
<view class="b-btn">打开柜子</view>
</view>
</view>
</template>
@ -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 @@
<style lang="scss">
@import '~style/public.scss';
@import "../../style/img_bg.scss";
.t-monitor-page {
@include centerFlex(flex-start);
flex-direction: column;
.t-title {
font-size: 44rpx;
color: #1A1A1A;
@ -206,43 +229,74 @@
}
.list-box {
.list-box {
margin-bottom: 110rpx;
@include centerFlex(flex-start);
flex-direction: column;
margin-top: 40rpx;
font-size: 32rpx;
color: #9C9C9F;
>image {
width: 380rpx;
height: 380rpx;
}
.f-item{
margin-top: 20rpx;
width: 620rpx;
@include centerFlex(space-between);
> input{
width: 434rpx;height: 96rpx;
padding: 0 15rpx;
border: 1rpx solid #9C9C9F;
border-radius: 10rpx;
}
.i-class{
color: #9C9C9F;font-size: 32rpx;
.ip-box{
margin: 0rpx auto;
width: 548rpx;
height: 982rpx;
background-image: url($lease_ball_bg);
background-size: cover;
background-repeat: no-repeat;
.ib-list{
padding-top: 136rpx;
padding-right: 32rpx;
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
align-items: center;
.il-item{
position: relative;
margin: 30rpx 0rpx;
width: 112rpx;
height: 100rpx;
background: rgba(255,255,255,0.51);
box-shadow: inset 0 2rpx 6rpx 0 rgba(0,126,90,0.45);
border-radius: 6rpx;
@include centerFlex(center);
.i-tag{
position: absolute;
padding: 3rpx;
right: -25rpx;
top: -15rpx;
font-size: 20rpx;
color: #1A1A1A;
background-color: white;
border-radius: 6rpx;
width: 52rpx;
height: 28rpx;
@include centerFlex(center);
}
.t-red{
color: #EA5061;
}
> text{
font-size: 28rpx;
position: absolute;
color: #FFFFFF;
left: 10rpx;
top: 2rpx;
}
> image {
width: 40rpx;height: 40rpx;
}
.check-box{
width: 40rpx;height: 40rpx;
background: #FFFFFF;
border: 2rpx solid #009874;
border-radius: 50%;
}
}
}
}
.l-edit{
@include centerFlex(space-between);
> view{
width: 224rpx;height: 112rpx;
}
.white-style{
color: #EA5061;
background-color: white;
}
}
}
.t-update {
@ -287,6 +341,42 @@
.t2 {
margin-top: 60rpx;
}
}
.bottom-box{
width: 100%;
height: 110rpx;
background-color: white;
position: fixed;
bottom: 0;
padding: 0 30rpx;
@include centerFlex(space-between);
> view:first-child{
@include centerFlex(center);
> text{
margin-left: 15rpx;
font-size: 28rpx;
color: #494949;
}
.check-box{
width: 40rpx;height: 40rpx;
background: #FFFFFF;
border: 2rpx solid #009874;
border-radius: 50%;
}
image{
width: 40rpx;height: 40rpx;
}
}
.b-btn{
width: 240rpx;
height: 88rpx;
background: #009874;
color: white;
font-size: 32rpx;
border-radius: 10rpx;
@include centerFlex(center);
}
}
}
</style>

148
src/subpackage/device/pages/switch_manage/switch_manage.vue

@ -26,38 +26,46 @@
<!-- 不同设备的可操作按钮区分,目前无明显规律,so 按需求单独 if 判断 -->
<view class="si-bottom" v-if="pageInfo.isOpen || pageInfo.isClose || pageInfo.isDetail||pageInfo.isTiming">
<view v-if="pageInfo.isOpen" @click="operateBtn({ switchInfo: e, status: 1 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.openIcon || ''"></image>
<view>{{pageInfo.openName || '-'}}</view>
</view>
<view v-if="pageInfo.isClose" @click="operateBtn({ switchInfo: e, status: 0 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.closeIcon || ''"></image>
<view>{{pageInfo.closeName || '-'}}</view>
</view>
<view v-if="pageInfo.isLongOpen" @click="operateBtn({ switchInfo: e, status: 2 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.longOpenIcon || ''"></image>
<view>{{pageInfo.longOpenName || '-'}}</view>
</view>
<view v-if="pageInfo.isTiming" @click="operateBtn({ switchInfo: e, status: 3 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.timingIcon || ''"></image>
<view>{{pageInfo.timingName || '-'}}</view>
<view class="si-btn-area">
<view v-if="pageInfo.isOpen" @click="operateBtn({ switchInfo: e, status: 1 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.openIcon || ''"></image>
<view>{{pageInfo.openName || '-'}}</view>
</view>
<view v-if="pageInfo.isClose" @click="operateBtn({ switchInfo: e, status: 0 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.closeIcon || ''"></image>
<view>{{pageInfo.closeName || '-'}}</view>
</view>
<view v-if="pageInfo.isLongOpen" @click="operateBtn({ switchInfo: e, status: 2 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.longOpenIcon || ''"></image>
<view>{{pageInfo.longOpenName || '-'}}</view>
</view>
<view v-if="pageInfo.isTiming" @click="operateBtn({ switchInfo: e, status: 3 })" :style="{width:getIconWidth()}">
<image mode="aspectFit" :src="pageInfo.timingIcon || ''"></image>
<view>{{pageInfo.timingName || '-'}}</view>
</view>
<view v-if="pageInfo.isDetail" @click="operateBtn({ switchInfo: e, status: 4 })" class="btn-detail">
<view >{{pageInfo.detailName || '-'}}</view>
</view>
</view>
<view v-if="pageInfo.isDetail" @click="operateBtn({ switchInfo: e, status: 4 })" class="btn-detail">
<view >{{pageInfo.detailName || '-'}}</view>
<view class="si-detail-area" @click="controlDevice(e)" v-if="pageInfo.name =='空调管理'">
<view class="">详情<image src="../../static/images/arrow_b2.png" mode=""></image></view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
//
import { mapState } from 'vuex';
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 showArr = {
's1': {
id: 1, name: '照明管理', isOpen: true, isClose: true, isLongOpen:true, isTiming:true,
@ -115,6 +123,12 @@ const showArr = {
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',detailName:"详情", hardware_type: 'IotSim',iconNum:2
},
's16': {//TODO
id: 16, name: '租球机管理', isOpen: false, isClose: false, isDetail:true,
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',detailName:"管理", hardware_type: 'Router4G',iconNum:2
},
's17': {//TODO
id: 17, name: '窗帘管理', isOpen: false, isClose: false, isDetail:true,
openIcon: '/subpackage/device/static/images/open.png',
@ -133,11 +147,9 @@ const showArr = {
closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',detailName:"详情", hardware_type: 'IotSim',iconNum:2
},
}
import { mapState } from 'vuex';
import util from '../../../../utils/util';
};
export default {
components: {
@ -180,10 +192,11 @@ export default {
}
},
onLoad(options){
console.log("onLoad: ",JSON.stringify(options));
let _pageInfo = showArr[`s${options.sid}`] || {};
this.pageInfo = _pageInfo;
uni.setNavigationBarTitle({ title: _pageInfo.name });
this.getDeviceList({
stadium_id: this.curStoreInfo.id,
hardware_type: this.pageInfo.hardware_type
@ -226,7 +239,7 @@ export default {
.catch(util.hideLoad)
},
controlDevice(e){
util.routeTo(`/subpackage/device/pages/index/lot_manage?mac=${switchInfo.hardware_standard}`, 'nT');
util.routeTo(`/subpackage/device/pages/index/airC_manage?mac=${e.hardware_standard}`, 'nT');
},
// status 0 -> 1 -> ,2 -> ,3 -> , 4 ->()
operateBtn: util.debounce(function({ switchInfo, status }){
@ -240,6 +253,7 @@ export default {
if(status == 4){
if(this.pageInfo.name=='租球机管理')return util.routeTo(`/subpackage/device/pages/index/lease_ball_box_manage?mac=${switchInfo.hardware_standard}`, 'nT');
// if(this.pageInfo.name=='')return util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_manage?mac=${switchInfo.hardware_standard}`, 'nT');
if(this.pageInfo.name=='窗帘管理')return util.routeTo(`/subpackage/device/pages/index/sunblind_manage?mac=${switchInfo.hardware_standard}`, 'nT');
if(this.pageInfo.hardware_type=='Router4G')return util.routeTo(`/subpackage/device/pages/index/router_manage?mac=${switchInfo.hardware_standard}`, 'nT');
@ -588,41 +602,67 @@ export default {
}
.si-bottom{
padding-top: 30upx;
padding-bottom: 30upx;
padding-bottom: 20upx;
display: flex;
justify-content: center;
flex-direction: column;
border-top: 2upx solid #F2F2F7;
>view{
flex-shrink: 0;
flex-grow: 0;
width: 50%;
>image{
display: block;
margin: 0 auto 20upx;
width: 100upx;
height: 100upx;
}
>view{
font-size: 24upx;
line-height: 34upx;
text-align: center;
color: #9a9a9d;
}
}
.btn-detail{
width:auto;
.si-btn-area{
display: flex;
justify-content: center;
width: 100%;
>view{
flex-shrink: 0;
flex-grow: 0;
width: 50%;
>image{
display: block;
margin: 0 auto 20upx;
width: 100upx;
height: 100upx;
}
>view{
font-size: 24upx;
line-height: 34upx;
text-align: center;
color: #9a9a9d;
}
}
.btn-detail{
width:auto;
> view{
width: 204rpx;
height: 88rpx;
background: #009874;
border-radius: 10rpx;
text-align: center;
line-height: 88rpx;
color: white;
}
}
}
.si-detail-area{
border-top: 1rpx solid #F2F2F7;
width: 100%;
margin-top: 30rpx;
font-size: 28rpx;
@include centerFlex(center);
flex-direction: column;
> view{
width: 204rpx;
height: 88rpx;
background: #009874;
border-radius: 10rpx;
text-align: center;
line-height: 88rpx;
color: white;
margin-top: 20rpx;
@include centerFlex(center);
color: #333333;
image{
margin-left: 20rpx;
width: 24rpx;height: 24rpx;
}
}
}
}
}
}

BIN
src/subpackage/device/static/images/check_type_2.png

After

Width: 40  |  Height: 40  |  Size: 1.9 KiB

BIN
src/subpackage/device/static/images/cmd-close.png

After

Width: 100  |  Height: 100  |  Size: 6.5 KiB

BIN
src/subpackage/device/static/images/cmd-cold.png

After

Width: 100  |  Height: 100  |  Size: 6.4 KiB

BIN
src/subpackage/device/static/images/cmd-hot.png

After

Width: 100  |  Height: 100  |  Size: 5.6 KiB

5
src/subpackage/device/style/img_bg.scss
File diff suppressed because it is too large
View File

Loading…
Cancel
Save