发送信息列表接口联调,
This commit is contained in:
@ -13,8 +13,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="sendFlex">
|
||||
|
||||
<view class="sendFlex" v-if="activeTab && activeTab.id !== ''">
|
||||
<view class="callpolice">报警</view>
|
||||
<view class="Sendmessage" @click="location">位置</view>
|
||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
||||
@ -46,7 +45,6 @@
|
||||
<view class="device-status online">已连接</view>
|
||||
<view class="device-status unline">未连接</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<image src="/static/images/cires.png" class="circle"></image>
|
||||
</uni-swipe-action-item>
|
||||
@ -177,7 +175,7 @@
|
||||
getTab() {
|
||||
deviceTypeList({}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
console.log("deviceTypeList=" + JSON.stringify(res.data));
|
||||
//console.log("deviceTypeList=" + JSON.stringify(res.data));
|
||||
this.tabs = [{
|
||||
id: '',
|
||||
name: '全部设备',
|
||||
@ -353,8 +351,19 @@
|
||||
},
|
||||
// 发生短信
|
||||
handleSend() {
|
||||
const currentTab = this.tabs[this.activeTab];
|
||||
const deviceType = currentTab.id || 'all';
|
||||
console.log(`跳转到发送信息页面\n当前设备类型: ${deviceType}\n设备类型名称: ${currentTab.typeName}`);
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/send/index'
|
||||
url: '/pages/common/send/index',
|
||||
events: {
|
||||
ack: function(data) {}
|
||||
},
|
||||
success: (res) => {
|
||||
res.eventChannel.emit('deviceSend', {
|
||||
data: deviceType
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 位置
|
||||
@ -402,13 +411,21 @@
|
||||
onIntall() {
|
||||
this.page = 1;
|
||||
this.finished = false;
|
||||
this.getData(); // 重新加载第一页数据
|
||||
this.getData(this.deviceType); // 重新加载第一页数据
|
||||
},
|
||||
},
|
||||
onShow() {
|
||||
onLoad() {
|
||||
this.getTab()
|
||||
this.onIntall()
|
||||
}
|
||||
// 绑定页面做了监听,新增成功,刷新页面
|
||||
uni.$on('refreshDeviceList', () => {
|
||||
this.getTab() // 刷新数据
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 组件销毁前移除监听器
|
||||
uni.$off('refreshDeviceList');
|
||||
},
|
||||
|
||||
}
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user