Browse Source

完成页面:平板,监控,窗帘

voice
zmt 4 years ago
parent
commit
02f61c2d80
  1. 32
      src/pages.json
  2. 4
      src/subpackage/device/pages/audio_manage/audio_manage.vue
  3. 8
      src/subpackage/device/pages/index/index.vue
  4. 292
      src/subpackage/device/pages/index/lease_ball_box_manage.vue
  5. 395
      src/subpackage/device/pages/index/sunblind_manage.vue
  6. 292
      src/subpackage/device/pages/monitor_manage/monitor_acount_add.vue
  7. 245
      src/subpackage/device/pages/monitor_manage/monitor_acount_list.vue
  8. 178
      src/subpackage/device/pages/monitor_manage/monitor_manage.vue
  9. 32
      src/subpackage/device/pages/switch_manage/switch_manage.vue
  10. BIN
      src/subpackage/device/static/images/no-info.png
  11. BIN
      src/subpackage/device/static/images/sunblind.png
  12. BIN
      src/subpackage/device/static/images/sunblind_close.png
  13. BIN
      src/subpackage/device/static/images/sunblind_open.png
  14. BIN
      src/subpackage/device/static/images/windows.png

32
src/pages.json

@ -245,6 +245,38 @@
} }
}, },
{ {
"path": "pages/monitor_manage/monitor_manage",
"style" : {
"navigationBarTitleText": "监控管理"
}
},
{
"path": "pages/monitor_manage/monitor_acount_list",
"style" : {
"navigationBarTitleText": "监控管理"
}
},
{
"path": "pages/monitor_manage/monitor_acount_add",
"style" : {
"navigationBarTitleText": "监控管理"
}
},
{
"path": "pages/index/sunblind_manage",
"style" : {
"navigationBarTitleText": "窗帘管理"
}
},
{
"path": "pages/index/lease_ball_box_manage",
"style" : {
"navigationBarTitleText": "租球机管理"
}
},
{
"path": "pages/switch_manage/switch_manage", "path": "pages/switch_manage/switch_manage",
"style" : { "style" : {
"navigationBarTitleText": "管理" "navigationBarTitleText": "管理"

4
src/subpackage/device/pages/audio_manage/audio_manage.vue

@ -720,7 +720,7 @@
.slider-box{ .slider-box{
margin-bottom: 40rpx; margin-bottom: 40rpx;
> text { > text {
margin-left: 20rpx;
margin-left: 30rpx;
font-size: 24rpx; font-size: 24rpx;
color: #9C9C9F; color: #9C9C9F;
} }
@ -729,7 +729,7 @@
color: #9C9C9F; color: #9C9C9F;
font-size: 28rpx; font-size: 28rpx;
@include centerFlex(space-between); @include centerFlex(space-between);
padding: 0 24rpx;
padding: 0 34rpx;
} }
} }
.sm-tit { .sm-tit {

8
src/subpackage/device/pages/index/index.vue

@ -50,11 +50,11 @@ const tabArr = [
{id: 10, name: '咖啡机', path: `/pages/device_manage/device_manage`}, {id: 10, name: '咖啡机', path: `/pages/device_manage/device_manage`},
{id: 11, name: '水阀', path: `/pages/switch_manage/switch_manage`}, {id: 11, name: '水阀', path: `/pages/switch_manage/switch_manage`},
{id: 12, name: '互动设备', path: `/pages/switch_manage/switch_manage`}, {id: 12, name: '互动设备', path: `/pages/switch_manage/switch_manage`},
{id: 13, name: '监控', path: ``},
{id: 13, name: '监控', path: `/pages/switch_manage/switch_manage`},
{id: 14, name: '音响', path: `/pages/audio_manage/audio_manage`}, //audio_manage {id: 14, name: '音响', path: `/pages/audio_manage/audio_manage`}, //audio_manage
{id: 15, name: '机器人', path: ``}, {id: 15, name: '机器人', path: ``},
{id: 16, name: '租球机', path: ``}, {id: 16, name: '租球机', path: ``},
{id: 17, name: '窗帘', path: ``},
{id: 17, name: '窗帘', path: `/pages/switch_manage/switch_manage`},
{id: 18, 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`}, {id: 19, name: '物联卡', path: `/pages/switch_manage/switch_manage`},
@ -140,12 +140,14 @@ export default {
e.id == 3 || // e.id == 3 || //
e.id == 4 || // e.id == 4 || //
e.id == 5 ||  // e.id == 5 ||  //
// e.id == 6 ||  //
e.id == 6 ||  //
e.id == 8 ||  // e.id == 8 ||  //
e.id == 9 ||  // e.id == 9 ||  //
e.id == 10 ||  // e.id == 10 ||  //
e.id == 11 ||  // e.id == 11 ||  //
e.id == 13 ||  //
e.id == 14 ||  // e.id == 14 ||  //
e.id == 17 ||  //
e.id == 18 ||  // e.id == 18 ||  //
e.id == 19 ||  // e.id == 19 ||  //
e.id == 7   // e.id == 7   //

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

@ -0,0 +1,292 @@
<template>
<view class="t-monitor-page">
<!-- <store-name></store-name> -->
<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>
<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 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>
</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'
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
},
data() {
return {
update_time: new Date(),
accountList: false
}
},
async onLoad(opts) {
console.log("opts:", opts);
this.mac = opts.mac;
this.updateList()
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
clickGoMonitorAccount() {
util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_list`, 'nT');
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
var formdata = e.detail.value
uni.showModal({
content: '表单数据内容:' + JSON.stringify(formdata),
showCancel: false
});
},
formReset: function(e) {
console.log('清空数据')
},
copyInfo() {
uni.setClipboardData({
data: 'https://open.ys7.com/',
success: function() {
console.log('success');
uni.showToast({
title: "复制成功"
})
}
});
},
reboot4G() {
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac: this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if (!this.mac) return
util.showLoad();
deviceServer.post({
url: deviceApi.getLotDetail,
data: {
iccid: this.mac,
is_sync: 1 //,1
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.t-monitor-page {
@include centerFlex(flex-start);
flex-direction: column;
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-go-monitor {
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
// color: #009874;
color: #9C9C9F;
image {
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.list-box {
@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;
}
}
.l-edit{
@include centerFlex(space-between);
> view{
width: 224rpx;height: 112rpx;
}
.white-style{
color: #EA5061;
background-color: white;
}
}
}
.t-update {
font-size: 28rpx;
color: #9C9C9F;
margin-top: 38rpx;
margin-left: 40rpx;
}
.add-btn {
margin-top: 80rpx;
width: 500rpx;
height: 112rpx;
background: #009874;
color: white;
font-size: 32rpx;
border-radius: 10rpx;
@include centerFlex(center);
}
.btn-active {
background: rgba($color: #000000, $alpha: .3);
}
.info-box {
margin-top: 114rpx;
width: 636rpx;
font-size: 28rpx;
color: #9C9C9F;
.t1 {
>text {
color: black;
}
.t-copy {
color: #009874;
margin-left: 30rpx;
}
}
.t2 {
margin-top: 60rpx;
}
}
}
</style>

395
src/subpackage/device/pages/index/sunblind_manage.vue

@ -0,0 +1,395 @@
<template>
<view class="t-monitor-page">
<!-- <store-name></store-name> -->
<view class="t-title" @tap="tap">1号窗帘
<!-- <view class="t-go-monitor" @click="clickGoMonitorAccount">管理平台账户
<image src="../../static/images/refresh.png" mode=""></image>
</view> -->
</view>
<view class="image-box">
<image src="../../static/images/windows.png" mode=""></image>
<!-- 窗帘从左到右开关 -->
<!-- <view class="box-one">
<view class="slice-box" >
<view class="slice-item" v-for="i in sliceLength"></view>
</view>
</view> -->
<!-- 窗帘从两边到中间开关 -->
<view class="box-two">
<view class="slice-box-left" >
<view class="slice-item" v-for="i in sliceLength"></view>
</view>
<view class="slice-box-right" >
<view class="slice-item" v-for="i in sliceLength"></view>
</view>
</view>
<!-- 触摸窗帘开关 -->
<!-- <movable-area class="box">
<movable-view class="max" :x="x" :y="y" @change="onChange"
direction="horizontal" inertia>
</movable-view>
</movable-area> -->
</view>
<view class="slider-box">
<text>目前状态{{voiceLevel}}%</text>
<slider :value="voiceLevel" activeColor="#009874" block-color="#009874" block-size="22"
@change="sliderChange" min="0" max="100" />
<view class="">
<text>0%</text>
<text>100%</text>
</view>
</view>
<view class="list-box">
<view class="l-item">
<image src="../../static/images/sunblind_close.png" mode=""></image>
<text>关闭</text>
</view>
<view class="l-item">
<image src="../../static/images/close.png" mode=""></image>
<text>暂停</text>
</view>
<view class="l-item">
<image src="../../static/images/sunblind_open.png" mode=""></image>
<text>开启</text>
</view>
</view>
<!-- <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>
</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'
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
},
data() {
return {
update_time: new Date(),
accountList: false,
voiceLevel:10,//10
sliceLength:0,
boxOne:false, // true: , false:
}
},
async onLoad(opts) {
console.log("opts:", opts);
this.mac = opts.mac;
this.updateList()
this.setSliceLength(this.voiceLevel)
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
const sysInfo = uni.getSystemInfoSync();
this.pixelRatio = sysInfo.pixelRatio
console.log(sysInfo.pixelRatio);
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
//
sliderChange(e) {
console.log('value 发生变化:' + e.detail.value)
this.setSliceLength(e.detail.value)
// this.sliceBoxW = this.sliceLength*30
return
let _data = {
"device": this.curStoreInfo.device_name,
"data": {
"name": "audio-player-volume",
"value": {
"volume": e.detail.value.toString()
}
},
}
//
this.operateReq({
data: _data,
isTip: true
})
},
setSliceLength(value){
// this.level = value
this.voiceLevel = value
this.sliceLength = Math.floor(value/(this.boxOne?5:10))
},
clickGoMonitorAccount() {
util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_list`, 'nT');
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
var formdata = e.detail.value
uni.showModal({
content: '表单数据内容:' + JSON.stringify(formdata),
showCancel: false
});
},
formReset: function(e) {
console.log('清空数据')
},
copyInfo() {
uni.setClipboardData({
data: 'https://open.ys7.com/',
success: function() {
console.log('success');
uni.showToast({
title: "复制成功"
})
}
});
},
reboot4G() {
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac: this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if (!this.mac) return
util.showLoad();
deviceServer.post({
url: deviceApi.getLotDetail,
data: {
iccid: this.mac,
is_sync: 1 //,1
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.slider-box {
// @include centerFlex(center);
// flex-direction: column;
width: 630rpx;
margin-top: 40rpx;
>text {
font-size: 32rpx;
color: #1A1A1A;
width: 100%;
@include centerFlex(center);
}
>view {
width: 100%;
color: #9C9C9F;
font-size: 28rpx;
@include centerFlex(space-between);
padding: 0 34rpx;
}
}
.t-monitor-page {
@include centerFlex(flex-start);
flex-direction: column;
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-go-monitor {
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
color: #9C9C9F;
image {
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.image-box {
margin-top: 40rpx;
image {
width: 690rpx;
height: 570rpx;
position: absolute;
left: 30rpx;
z-index: -1;
}
.box-one {
width: 590rpx;
height: 570rpx;
margin-top: 10rpx;
z-index: 1;
@include centerFlex(flex-start);
.slice-box{
@include centerFlex(flex-start);
background-color: lightgray;
height: 570rpx;
}
}
.box-two{
width: 560rpx;
height: 570rpx;
margin-top: 10rpx;
z-index: 1;
@include centerFlex(space-between);
.slice-box-left{
@include centerFlex(flex-start);
background-color: lightgray;
height: 570rpx;
}
.slice-box-right{
@include centerFlex(flex-end);
background-color: lightgray;
height: 570rpx;
}
}
//
.slice-item{
flex-grow: 1;
width: 30rpx;
height: 570rpx;
background-color: white;
border: 1rpx solid #919191;
border-radius: 5rpx;
}
}
.list-box {
width: 540rpx;
@include centerFlex(space-between);
margin-top: 40rpx;
font-size: 32rpx;
color: #9C9C9F;
>view {
@include centerFlex(center);
flex-direction: column;
>image {
width: 100rpx;
height: 100rpx;
}
>text {
margin-top: 20rpx;
font-size: 24rpx;
color: #9A9A9D;
}
}
}
.add-btn {
margin-top: 80rpx;
width: 500rpx;
height: 112rpx;
background: #009874;
color: white;
font-size: 32rpx;
border-radius: 10rpx;
@include centerFlex(center);
}
.btn-active {
background: rgba($color: #000000, $alpha: .3);
}
.info-box {
margin-top: 114rpx;
width: 636rpx;
font-size: 28rpx;
color: #9C9C9F;
.t1 {
>text {
color: black;
}
.t-copy {
color: #009874;
margin-left: 30rpx;
}
}
.t2 {
margin-top: 60rpx;
}
}
}
</style>

292
src/subpackage/device/pages/monitor_manage/monitor_acount_add.vue

@ -0,0 +1,292 @@
<template>
<view class="t-monitor-page">
<!-- <store-name></store-name> -->
<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>
<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 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>
</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'
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
},
data() {
return {
update_time: new Date(),
accountList: false
}
},
async onLoad(opts) {
console.log("opts:", opts);
this.mac = opts.mac;
this.updateList()
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
clickGoMonitorAccount() {
util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_list`, 'nT');
},
formSubmit: function(e) {
console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
var formdata = e.detail.value
uni.showModal({
content: '表单数据内容:' + JSON.stringify(formdata),
showCancel: false
});
},
formReset: function(e) {
console.log('清空数据')
},
copyInfo() {
uni.setClipboardData({
data: 'https://open.ys7.com/',
success: function() {
console.log('success');
uni.showToast({
title: "复制成功"
})
}
});
},
reboot4G() {
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac: this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if (!this.mac) return
util.showLoad();
deviceServer.post({
url: deviceApi.getLotDetail,
data: {
iccid: this.mac,
is_sync: 1 //,1
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.t-monitor-page {
@include centerFlex(flex-start);
flex-direction: column;
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-go-monitor {
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
// color: #009874;
color: #9C9C9F;
image {
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.list-box {
@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;
}
}
.l-edit{
@include centerFlex(space-between);
> view{
width: 224rpx;height: 112rpx;
}
.white-style{
color: #EA5061;
background-color: white;
}
}
}
.t-update {
font-size: 28rpx;
color: #9C9C9F;
margin-top: 38rpx;
margin-left: 40rpx;
}
.add-btn {
margin-top: 80rpx;
width: 500rpx;
height: 112rpx;
background: #009874;
color: white;
font-size: 32rpx;
border-radius: 10rpx;
@include centerFlex(center);
}
.btn-active {
background: rgba($color: #000000, $alpha: .3);
}
.info-box {
margin-top: 114rpx;
width: 636rpx;
font-size: 28rpx;
color: #9C9C9F;
.t1 {
>text {
color: black;
}
.t-copy {
color: #009874;
margin-left: 30rpx;
}
}
.t2 {
margin-top: 60rpx;
}
}
}
</style>

245
src/subpackage/device/pages/monitor_manage/monitor_acount_list.vue

@ -0,0 +1,245 @@
<template>
<view class="t-monitor-page">
<!-- <store-name></store-name> -->
<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">
<image src="../../static/images/no-info.png" mode="" v-if="!accountList"></image>
<view class="l-item" v-for=" i in 2" v-else>
<image src="" mode=""></image>
<text>店铺名称name</text>
<view class="opt-box">
<view class="o-item">
<text @click="addAccount">编辑</text><image src="../../static/images/order/tab_0_8.png" mode=""></image>
</view>
<view class="o-item">
<text>同步设备</text><image src="../../static/images/order/tab_0_8.png" mode=""></image>
</view>
</view>
</view>
</view>
<view class="add-btn" hover-class="btn-active" @click="accountList = !accountList">添加账户</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'
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
},
data() {
return {
update_time: new Date(),
accountList:false
}
},
async onLoad(opts) {
console.log("opts:", opts);
this.mac = opts.mac;
this.updateList()
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
clickGoMonitorAccount() {
util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_list`, 'nT');
},
statechange(e) {
console.log('live-player code:', e.detail.code)
},
error(e) {
console.error('live-player error:', e.detail.errMsg)
},
addAccount(){
util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_add`,'nT')
},
reboot4G() {
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac: this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if (!this.mac) return
util.showLoad();
deviceServer.post({
url: deviceApi.getLotDetail,
data: {
iccid: this.mac,
is_sync: 1 //,1
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.t-monitor-page {
@include centerFlex(flex-start);
flex-direction: column;
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-go-monitor {
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
// color: #009874;
color: #9C9C9F;
image {
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.list-box{
@include centerFlex(flex-start);
flex-direction: column;
margin-top: 40rpx;
> image{
width: 380rpx;
height: 380rpx;
}
.l-item{
margin-bottom: 30rpx;
padding: 20rpx;
background: white;
border-radius: 10rpx;
width: 670rpx;height: 170rpx;
font-size: 32rpx;
color: #333333;
@include centerFlex(flex-start);
> image{
width: 108rpx;height: 108rpx;
background-color: lightgray;
margin-right: 20rpx;
}
.opt-box{
position: absolute;
right: 65rpx;
.o-item{
height: 60rpx;
@include centerFlex(flex-end);
> text{
font-size: 28rpx;
color: #9C9C9F;
}
> image{
width: 36rpx;height: 36rpx;
margin-left: 10rpx;
background-color: lightgray;
}
}
}
}
}
.t-update {
font-size: 28rpx;
color: #9C9C9F;
margin-top: 38rpx;
margin-left: 40rpx;
}
.add-btn{
margin-top: 80rpx;
width: 670rpx;
height: 112rpx;
background: #009874;
color: white;
font-size: 32rpx;
border-radius: 10rpx;
@include centerFlex(center);
}
.btn-active{
background:rgba($color: #000000, $alpha: .3);
}
}
</style>

178
src/subpackage/device/pages/monitor_manage/monitor_manage.vue

@ -0,0 +1,178 @@
<template>
<view class="t-monitor-page">
<!-- <store-name></store-name> -->
<view class="t-title">监控管理
<view class="t-go-monitor" @click="clickGoMonitorAccount">管理监控平台账户
<!-- <image src="../../static/images/refresh.png" mode=""></image> -->
</view>
</view>
<view class="live-box">
<live-player src="https://domain/pull_stream" autoplay @statechange="statechange" @error="error"
style="width: 300px; height: 225px;" />
</view>
<!-- <view class="t-update">
更新时间: {{update_time}}
</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'
import {
mapState
} from 'vuex'
export default {
components: {
'store-name': store_name
},
computed: {
...mapState({
storeList: state => state.device.storeList,
curStoreInfo: state => state.device.curStoreInfo,
}),
},
data() {
return {
update_time: new Date(),
}
},
async onLoad(opts) {
console.log("opts:", opts);
this.mac = opts.mac;
this.updateList()
// try {
// util.showLoad();
// let _brandInfo = await this.$store.dispatch('getBrandInfo');
// await this.$store.dispatch('getStoreList');
// util.hideLoad();
// } catch (err) {
// util.hideLoad();
// }
},
onShow() {
// this.updateList() //
},
watch: {
// curStoreInfo(newVal, oldVal){
// this.infoArr.length = 1
// this.updateList()
// }
},
methods: {
clickGoMonitorAccount() {
util.routeTo(`/subpackage/device/pages/monitor_manage/monitor_acount_list`, 'nT');
},
statechange(e) {
console.log('live-player code:', e.detail.code)
},
error(e) {
console.error('live-player error:', e.detail.errMsg)
},
reboot4G() {
util.showLoad();
deviceServer.post({
url: deviceApi.reboot4G,
data: {
mac: this.mac
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
util.showNone(res.data.message || '操作成功!');
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
async updateList() {
let that = this
if (!this.mac) return
util.showLoad();
deviceServer.post({
url: deviceApi.getLotDetail,
data: {
iccid: this.mac,
is_sync: 1 //,1
},
isDefaultGet: false,
})
.then(res => {
util.hideLoad();
if (res.data.code == 0) {
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
}
})
.catch(err => {
util.hideLoad()
})
},
goBack() {
uni.navigateBack({
delta: 1
})
},
}
}
</script>
<style lang="scss">
@import '~style/public.scss';
.t-monitor-page {
.t-title {
font-size: 44rpx;
color: #1A1A1A;
font-weight: 900;
@include centerFlex(space-between);
margin: 60rpx auto 0rpx 40rpx;
.t-go-monitor {
padding-right: 48rpx;
@include centerFlex(center);
font-size: 32rpx;
// color: #009874;
color: #9C9C9F;
image {
margin-top: 5rpx;
margin-left: 15rpx;
width: 32rpx;
height: 32rpx;
}
}
}
.live-box{
@include centerFlex(center);
margin-top: 40rpx;
}
.t-update {
font-size: 28rpx;
color: #9C9C9F;
margin-top: 38rpx;
margin-left: 40rpx;
}
}
</style>

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

@ -90,11 +90,11 @@ const showArr = {
closeIcon: '/subpackage/device/static/images/out.png', closeIcon: '/subpackage/device/static/images/out.png',
openName: '进', closeName: '出', hardware_type: 'GateControl',iconNum:2 openName: '进', closeName: '出', hardware_type: 'GateControl',iconNum:2
}, },
's6': {
's6': {//TODO
id: 6, name: '平板管理', isOpen: false, isClose: false, id: 6, name: '平板管理', isOpen: false, isClose: false,
openIcon: '/subpackage/device/static/images/open.png', openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png', closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关', hardware_type: '',iconNum:2
openName: '开', closeName: '关', hardware_type: 'Router4G',iconNum:2
}, },
's11': { 's11': {
id: 11, name: '水阀管理', isOpen: true, isClose: true,isLongOpen:true, isTiming:true, id: 11, name: '水阀管理', isOpen: true, isClose: true,isLongOpen:true, isTiming:true,
@ -109,6 +109,18 @@ const showArr = {
closeIcon: '/subpackage/device/static/images/close.png', closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关', hardware_type: '',iconNum:2 openName: '开', closeName: '关', hardware_type: '',iconNum:2
}, },
's13': {//TODO
id: 13, 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: 'IotSim',iconNum:2
},
's17': {//TODO
id: 17, 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
},
's18': { 's18': {
id: 18, name: '路由器管理', isOpen: false, isClose: false, isDetail:true, id: 18, name: '路由器管理', isOpen: false, isClose: false, isDetail:true,
openIcon: '/subpackage/device/static/images/open.png', openIcon: '/subpackage/device/static/images/open.png',
@ -121,6 +133,7 @@ const showArr = {
closeIcon: '/subpackage/device/static/images/close.png', closeIcon: '/subpackage/device/static/images/close.png',
openName: '开', closeName: '关',detailName:"详情", hardware_type: 'IotSim',iconNum:2 openName: '开', closeName: '关',detailName:"详情", hardware_type: 'IotSim',iconNum:2
}, },
} }
import { mapState } from 'vuex'; import { mapState } from 'vuex';
@ -185,14 +198,17 @@ export default {
page = 1 page = 1
}){ }){
util.showLoad(); util.showLoad();
deviceServer.get({
url: deviceApi.hardwareList,
data: {
let reqListData = {
'filter[hardware_type]': hardware_type, 'filter[hardware_type]': hardware_type,
'filter[stadium_id]': stadium_id, 'filter[stadium_id]': stadium_id,
'limit': limit, 'limit': limit,
'page': page, 'page': page,
},
}
if(hardware_type=="WaterValve") reqListData.operating_status = 1; //0723
deviceServer.get({
url: deviceApi.hardwareList,
data: reqListData,
failMsg: '加载失败!' failMsg: '加载失败!'
}) })
.then(res=>{ .then(res=>{
@ -221,8 +237,12 @@ export default {
if(status == 2) return util.showNone("未对接,前端等待接口中...") if(status == 2) return util.showNone("未对接,前端等待接口中...")
if(status == 4){ if(status == 4){
// 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'); if(this.pageInfo.hardware_type=='Router4G')return util.routeTo(`/subpackage/device/pages/index/router_manage?mac=${switchInfo.hardware_standard}`, 'nT');
if(this.pageInfo.hardware_type=='IotSim')return util.routeTo(`/subpackage/device/pages/index/lot_manage?mac=${switchInfo.hardware_standard}`, 'nT'); if(this.pageInfo.hardware_type=='IotSim')return util.routeTo(`/subpackage/device/pages/index/lot_manage?mac=${switchInfo.hardware_standard}`, 'nT');
} }
if(status == 3) return (()=>{ if(status == 3) return (()=>{
switchInfo.switchData = _data;// switchInfo.switchData = _data;//

BIN
src/subpackage/device/static/images/no-info.png

After

Width: 380  |  Height: 380  |  Size: 55 KiB

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

After

Width: 676  |  Height: 570  |  Size: 26 KiB

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

After

Width: 100  |  Height: 100  |  Size: 5.1 KiB

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

After

Width: 100  |  Height: 100  |  Size: 5.2 KiB

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

After

Width: 1014  |  Height: 696  |  Size: 39 KiB

Loading…
Cancel
Save