Browse Source

fix tapd issues

voice
zmt 4 years ago
parent
commit
bcf59a77a3
  1. 110
      src/subpackage/device/pages/audio_manage/audio_manage.vue
  2. 1
      src/subpackage/device/pages/index/index.vue
  3. 4
      src/subpackage/device/pages/index/router_manage.vue
  4. 28
      src/subpackage/device/pages/switch_manage/switch_manage.vue
  5. 9
      src/subpackage/device/pages/timing/timing_list.vue
  6. 3
      src/subpackage/device/pages/timing/timing_setting.vue

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

@ -4,7 +4,17 @@
<view class="sm-tit">
<text>{{pageInfo.name || '-'}}</text>
<text>{{pageInfo.tips || ''}}</text>
</view>
</view>
<view class="slider-box">
<text>音量</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="sm-list">
<view class="sl-item" v-for="(e, i) in deviceList" :key="i">
<view class="si-top">
@ -135,7 +145,8 @@
this.getDeviceList({
stadium_id: newVal.id,
hardware_type: this.pageInfo.hardware_type
})
})
}
},
data() {
@ -148,12 +159,14 @@
txt: "",
voicePath: "",
voiceUrl: "",
}
},
voiceLevel:0
}
},
onLoad(options) {
this.initAudio();
this.initPage(options);
this.initPage(options);
},
methods: {
//
@ -183,6 +196,48 @@
stadium_id: this.curStoreInfo.id,
hardware_type: _pageInfo.hardware_type
})
this.updateVoiceSlider();
},
//
sliderChange(e) {
console.log('value 发生变化:' + e.detail.value)
let _data = {
"device": this.curStoreInfo.device_name,
"data": {
"name": "audio-player-volume",
"value": {
"volume": e.detail.value.toString()
}
},
}
//
this.operateReq({
data: _data,
isTip:true
})
},
//
updateVoiceSlider(){
let that = this
let _data = {
"device": this.curStoreInfo.device_name,
"data": {
"name": "audio-player-volume",
"value": {
"volume": "-1"
}
},
}
//
this.operateReq({
data: _data,
succFun: (res) => {
console.log("操作结果:",res);
that.voiceLevel = res.data
},
isTip:false
})
},
longPressHandle(e) {
console.log("长按开始...");
@ -322,8 +377,17 @@
.then(res => {
util.hideLoad();
let _list = res.list || [];
//线
let deviceInfo = uni.getStorageSync("deviceInfo");
_list = _list.map((e,i)=>{
e['defineStatusCode'] = deviceInfo.Online==1? 1 : 0;
return e
})
this.deviceList = _list;
console.log(res)
this.updateVoiceSlider();
})
.catch(util.hideLoad)
},
@ -389,12 +453,14 @@
},
//
operateReq({
data,
data,
succFun,
isTip = true,
isLoad = true
}) {
let that = this
if (isLoad) util.showLoad();
if (isLoad) util.showLoad();
console.log("123",data);
deviceServer.post({
url: deviceApi.ouxuanac,
data: data,
@ -402,7 +468,8 @@
})
.then(res => {
if (isLoad) util.hideLoad();
if (res.data.code == 0) {
if (res.data.code == 0) {
succFun(res.data);
if (isTip) util.showNone(res.data.message || '操作成功!');
that.voicePadConfig.showVoicePad = false; //voicePad
} else {
@ -442,10 +509,13 @@
switchInfo,
index
}) {
this.getStatusReq({
data: this.getSwitchStatusQuery(switchInfo),
index,
})
// this.getStatusReq({
// data: this.getSwitchStatusQuery(switchInfo),
// index,
// })
//TODO ,
util.showLoad();
setTimeout(()=>util.hideLoad(),1000)
}, 300, 300),
//
getStatusReq({
@ -647,7 +717,21 @@
<style lang="scss">
@import '~style/public.scss';
.slider-box{
margin-bottom: 40rpx;
> text {
margin-left: 20rpx;
font-size: 24rpx;
color: #9C9C9F;
}
> view{
width: 100%;
color: #9C9C9F;
font-size: 28rpx;
@include centerFlex(space-between);
padding: 0 24rpx;
}
}
.sm-tit {
padding-left: 40upx;
padding-top: 52upx;
@ -874,7 +958,7 @@
width: 470rpx;
display: flex;
flex-direction: row;
justify-content: space-between;
justify-content: space-around;
align-items: center;
}

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

@ -115,6 +115,7 @@ export default {
.then(res=>{
util.hideLoad()
this.deviceInfo = res
uni.setStorageSync("deviceInfo",res)
})
.catch(util.hideLoad)
},

4
src/subpackage/device/pages/index/router_manage.vue

@ -14,7 +14,7 @@
<map style="width: 100%; height: 250px;" :latitude="latitude" :longitude="longitude" :markers="covers">
</map>
</view>
<view class="t-box">
<view class="t-box" v-if="infoObj">
<view class="info-list">
<view class="i-item" v-for="(item,index) in infoObj">
<view class="i-box">{{item.name}}</view>
@ -161,7 +161,6 @@
},
onShow() {
// this.updateList() //
console.log("123",infoObj);
},
watch: {
// curStoreInfo(newVal, oldVal){
@ -221,6 +220,7 @@
that.filterRouterData(res.data.data)
} else {
util.showNone(res.data.message || '操作失败!');
that.infoObj = ""
}
})
.catch(err => {

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

@ -13,7 +13,7 @@
<!-- 门闸没有状态查询 -->
<!-- 请求接口自定义字段设备状态 1->在线0->离线 -->
<view class="sr-bot-router" v-if="pageInfo.name =='物联卡管理'">
sim状态: <text>{{e.hardware_model}}</text>
sim状态: <text>{{getLotStatus(e)}}</text>
</view>
<view class="sr-bot" v-else-if="pageInfo.id !=5">
<view :class="[e.defineStatusCode == 1?'active':'']">
@ -101,7 +101,7 @@ const showArr = {
openIcon: '/subpackage/device/static/images/open.png',
closeIcon: '/subpackage/device/static/images/close.png',
longOpenIcon: '/subpackage/device/static/images/longOpen.png',timingIcon: '/subpackage/device/static/images/timing.png',
openName: '开', closeName: '关', hardware_type: 'Fan',longOpenName: '长按', timingName: '定时',iconNum:4,
openName: '开', closeName: '关', hardware_type: 'WaterValve',longOpenName: '长按', timingName: '定时',iconNum:4,
},
's12': {
id: 12, name: '互动设备管理', isOpen: true, isClose: true,
@ -139,6 +139,11 @@ export default {
return 100/this.pageInfo.iconNum+'%'
}
},
getLotStatus(){//sim, 0 :
return (e)=>{
return ["未知","注册","重启","在线","离线"][e.extension['HWC'].device_status]
}
},
getViewWidth(){//
return ()=>{
let widthViewArr = ["照明管理","水阀管理","风扇管理"]
@ -168,7 +173,7 @@ export default {
this.getDeviceList({
stadium_id: this.curStoreInfo.id,
hardware_type: _pageInfo.hardware_type
hardware_type: this.pageInfo.hardware_type
})
},
methods: {
@ -193,6 +198,12 @@ export default {
.then(res=>{
util.hideLoad();
let _list = res.list || [];
if(hardware_type=="Router4G"){ //线
_list = _list.map((e,i)=>{
e['defineStatusCode'] = e.extension.online? 1 : 0;
return e
})
}
this.deviceList = _list;
console.log(res)
})
@ -202,9 +213,6 @@ export default {
// status 0 -> 1 -> ,2 -> ,3 -> , 4 ->()
operateBtn: util.debounce(function({ switchInfo, status }){
console.log("icon tap status: ",status,switchInfo)
//todo page.json ,setting
let _data = this.getOperateReqData({ switchInfo, status })
//->& 20201224 5
@ -284,6 +292,14 @@ export default {
},
//
refreshStatusBtn: util.debounce(function({switchInfo, index}){
if(switchInfo.hardware_type == "Router4G"){
return this.getDeviceList({
stadium_id: this.curStoreInfo.id,
hardware_type: this.pageInfo.hardware_type
})
}
this.getStatusReq({
data: this.getSwitchStatusQuery(switchInfo),
index,

9
src/subpackage/device/pages/timing/timing_list.vue

@ -3,11 +3,11 @@
<store-name></store-name>
<view class="t-title">定时列表</view>
<view class="t-box">
<view class="tab-list">
<!-- <view class="tab-list">
<view class="t-item " :class="e.on?'active':''" v-for="(e,i) in tabArr" @click="clickTab(i)">
{{e.name}}
</view>
</view>
</view> -->
<view class="info-list">
<view class="i-item" v-for="(item,index) in infoArr">
<view class="i-box">{{item[0]}}</view>
@ -283,8 +283,9 @@
width: 30rpx;
text-align: center;
height: 6rpx;
border-radius: 3rpx;
top: 60rpx;
border-radius: 3rpx;
margin-top: 40rpx;
// top: 60rpx;
}
}

3
src/subpackage/device/pages/timing/timing_setting.vue

@ -484,9 +484,6 @@
height: auto;
background: #FFFFFF;
border-radius: 10rpx;
@include centerFlex(flex-start);
flex-direction: column;
align-items: flex-start;
font-size: 32rpx;
.il-switch{
width: 580rpx;

Loading…
Cancel
Save