Merge remote-tracking branch 'upstream/main'
# Conflicts: # pages/common/index/index.vue
This commit is contained in:
@ -33,7 +33,7 @@
|
|||||||
<view class="device-content" @click.stop="handleFile(item)">
|
<view class="device-content" @click.stop="handleFile(item)">
|
||||||
<view class="device-header">
|
<view class="device-header">
|
||||||
<view class="deviceIMG">
|
<view class="deviceIMG">
|
||||||
<image :src="item.devicePic" class="IMG"></image>
|
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="device-name">
|
<view class="device-name">
|
||||||
<view>设备:{{item.deviceName}}</view>
|
<view>设备:{{item.deviceName}}</view>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')">
|
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')">
|
||||||
<view class="agreement-popupC" @click.stop>
|
<view class="agreement-popupC" @click.stop>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<image src="/static/images/delel.png" mode="" class="svg"></image>
|
<image src="/static/images/delel.png" class="svg" mode="aspectFit"></image>
|
||||||
<uni-icon class="trash"></uni-icon>
|
<uni-icon class="trash"></uni-icon>
|
||||||
<view class="popup-Title">
|
<view class="popup-Title">
|
||||||
{{ tabs[activeTab].name === '我的分享' ? '确定停止分享该设备' : '确定移除他人分享给你的这台设备' }}
|
{{ tabs[activeTab].name === '我的分享' ? '确定停止分享该设备' : '确定移除他人分享给你的这台设备' }}
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<!-- 设备电量信息 -->
|
<!-- 设备电量信息 -->
|
||||||
<view class="battery-section">
|
<view class="battery-section">
|
||||||
<view class="battery-sectionLeft">
|
<view class="battery-sectionLeft">
|
||||||
<image :src="deviceInfo.devicePic" class="bipImg"></image>
|
<image :src="deviceInfo.devicePic" class="bipImg" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
<view class="battery-v1">
|
<view class="battery-v1">
|
||||||
@ -23,7 +23,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="battery-v1">
|
<view class="battery-v1">
|
||||||
<image src="/static/images/nz.png" class="dlIMG"></image>
|
<image src="/static/images/nz.png" class="dlIMG" mode="aspectFit"></image>
|
||||||
<view>
|
<view>
|
||||||
<view class="battery-v2">1小时</view>
|
<view class="battery-v2">1小时</view>
|
||||||
<view class="battery-v3">续航时间</view>
|
<view class="battery-v3">续航时间</view>
|
||||||
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
<!-- 灯光亮度控制 -->
|
<!-- 灯光亮度控制 -->
|
||||||
<view class="control-card">
|
<view class="control-card">
|
||||||
<slider :value="sliderValue" min="0" max="100" activeColor="rgb(187, 230, 0)"
|
<slider :value="sliderValue" min="10" max="100" activeColor="rgb(187, 230, 0)"
|
||||||
backgroundColor="rgb(26, 26, 26)" :show-value="false" @changing="onSliderChanging"
|
backgroundColor="rgb(26, 26, 26)" :show-value="false" @changing="onSliderChanging"
|
||||||
@change="onSliderChanging" />
|
@change="onSliderChanging" />
|
||||||
</view>
|
</view>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="mode-v1" v-if="hasPermission('2')">
|
<view class="mode-v1" v-if="hasPermission('2')">
|
||||||
<view class="mode-v2" @click="lasermode">
|
<view class="mode-v2" @click="lasermode">
|
||||||
<image src="/static/images/jg.png" class="setIMG"></image>
|
<image src="/static/images/jg.png" class="setIMG" mode="aspectFit"></image>
|
||||||
<view>
|
<view>
|
||||||
<view class="battery-v2">激光模式</view>
|
<view class="battery-v2">激光模式</view>
|
||||||
</view>
|
</view>
|
||||||
@ -88,7 +88,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="mode-v1" v-if="hasPermission('3')">
|
<view class="mode-v1" v-if="hasPermission('3')">
|
||||||
<view class="mode-v2" @click="uploadStartup">
|
<view class="mode-v2" @click="uploadStartup">
|
||||||
<image src="/static/images/path7.png" class="setIMG"></image>
|
<image src="/static/images/path7.png" class="setIMG" mode="aspectFit"></image>
|
||||||
<view>
|
<view>
|
||||||
<view class="battery-v2">开机画面</view>
|
<view class="battery-v2">开机画面</view>
|
||||||
<view class="mode-v3">上传</view>
|
<view class="mode-v3">上传</view>
|
||||||
@ -143,22 +143,22 @@
|
|||||||
<view class="section-title">产品信息</view>
|
<view class="section-title">产品信息</view>
|
||||||
<view class="mode-buttons">
|
<view class="mode-buttons">
|
||||||
<view class="mode_1" @click="productparams">
|
<view class="mode_1" @click="productparams">
|
||||||
<image src="/static/images/cp.png" mode="" class="cpIMG"></image>
|
<image src="/static/images/cp.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">产品参数</view>
|
<view class="">产品参数</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode_1" @click="operatingInst">
|
<view class="mode_1" @click="operatingInst">
|
||||||
<image src="/static/images/sm.png" mode="" class="cpIMG"></image>
|
<image src="/static/images/sm.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">操作说明</view>
|
<view class="">操作说明</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mode_1" @click="operatingVideo">
|
<view class="mode_1" @click="operatingVideo">
|
||||||
<image src="/static/images/sp.png" mode="" class="cpIMG"></image>
|
<image src="/static/images/sp.png" mode="" class="cpIMG" mode="aspectFit"></image>
|
||||||
<view class="">操作视频</view>
|
<view class="">操作视频</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 弹框 -->
|
<!-- 弹框 -->
|
||||||
<view class="agreement-mask" v-if="lightModeA" @click="closePopup">
|
<view class="agreement-mask" v-if="lightModeA" @click.stop="closePopup">
|
||||||
<!-- 灯光模式弹窗 -->
|
<!-- 灯光模式弹窗 -->
|
||||||
<view class="agreement-popup" @click.stop>
|
<view class="agreement-popup" @click.stop>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
@ -178,9 +178,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 上传开机画面弹框 -->
|
<!-- 上传开机画面弹框 -->
|
||||||
<view class="agreement-mask" v-if="lightModeB" @click="closePopup">
|
<view class="agreement-mask" v-if="lightModeB" @click.stop="closePopup">
|
||||||
<!-- 上传画面弹窗 -->
|
<!-- 上传画面弹窗 -->
|
||||||
<view class="agreement-popupB">
|
<view class="agreement-popupB" @click.stop>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<view class="popup-title">上传开机画面</view>
|
<view class="popup-title">上传开机画面</view>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
@ -204,9 +204,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!--===================== 激光提示框================== -->
|
<!--===================== 激光提示框================== -->
|
||||||
<view class="agreement-mask" v-if="lightModeC" @click="closePopup">
|
<view class="agreement-mask" v-if="lightModeC" @click.stop="closePopup">
|
||||||
<!-- 上传画面弹窗 -->
|
<!-- 上传画面弹窗 -->
|
||||||
<view class="agreement-popupC">
|
<view class="agreement-popupC" @click.stop>
|
||||||
<!-- 标题 -->
|
<!-- 标题 -->
|
||||||
<view class="popup-title">确认开启激光模式?</view>
|
<view class="popup-title">确认开启激光模式?</view>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
@ -220,7 +220,7 @@
|
|||||||
<!-- 按钮组 -->
|
<!-- 按钮组 -->
|
||||||
<view class="popup-buttons">
|
<view class="popup-buttons">
|
||||||
<button class="btn disagree" @click="handleDisagree">取消</button>
|
<button class="btn disagree" @click="handleDisagree">取消</button>
|
||||||
<button class="btn agreeBtn" @click="handleBtn">确定</button>
|
<button class="btn agreeBtn" @click.stop="handleBtn">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -255,9 +255,9 @@
|
|||||||
secondaryMode: 'string',
|
secondaryMode: 'string',
|
||||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||||
navTitle: "",
|
navTitle: "",
|
||||||
sliderValue: 50,
|
sliderValue: 30,
|
||||||
lightModeA: false,
|
lightModeA: false,
|
||||||
currentMainMode: '强光模式',
|
currentMainMode: '强光',
|
||||||
lightModeB: false,
|
lightModeB: false,
|
||||||
lightModeC: false, //激光提示框
|
lightModeC: false, //激光提示框
|
||||||
items: [],
|
items: [],
|
||||||
@ -288,7 +288,8 @@
|
|||||||
popupConfirmText: '确认',
|
popupConfirmText: '确认',
|
||||||
showUploadPopup: false,
|
showUploadPopup: false,
|
||||||
selectedImage: null, // 添加这个变量来存储选择的图片
|
selectedImage: null, // 添加这个变量来存储选择的图片
|
||||||
file: ''
|
file: '',
|
||||||
|
selectedItemIndex: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -319,22 +320,22 @@
|
|||||||
if (type === 'main') {
|
if (type === 'main') {
|
||||||
this.items = [{
|
this.items = [{
|
||||||
text: '强光',
|
text: '强光',
|
||||||
selected: this.currentMainMode === '强光模式',
|
selected: this.currentMainMode === '强光', // 修正匹配条件
|
||||||
image: '/static/images/sett.png'
|
image: '/static/images/sett.png',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '弱光',
|
text: '弱光',
|
||||||
selected: this.currentMainMode === '弱光模式',
|
selected: this.currentMainMode === '弱光',
|
||||||
image: '/static/images/sett.png'
|
image: '/static/images/sett.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '爆闪',
|
text: '爆闪',
|
||||||
selected: this.currentMainMode === '爆闪模式',
|
selected: this.currentMainMode === '爆闪',
|
||||||
image: '/static/images/bs.png'
|
image: '/static/images/bs.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '泛光',
|
text: '泛光',
|
||||||
selected: this.currentMainMode === '泛光模式',
|
selected: this.currentMainMode === '泛光',
|
||||||
image: '/static/images/settt.png'
|
image: '/static/images/settt.png'
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -365,18 +366,28 @@
|
|||||||
},
|
},
|
||||||
// 灯光模式的确认
|
// 灯光模式的确认
|
||||||
handleSumbit() {
|
handleSumbit() {
|
||||||
if (this.selectedItemIndex === null) return;
|
if (this.selectedItemIndex === null) return;
|
||||||
const selectedItem = this.items[this.selectedItemIndex];
|
const selectedItem = this.items[this.selectedItemIndex];
|
||||||
const instruction = this.modeInstructions[selectedItem.text];
|
const instruction = this.modeInstructions[selectedItem.text];
|
||||||
console.log(selectedItem, 'selectedItemselectedItem');
|
console.log(selectedItem, 'selectedItemselectedItem');
|
||||||
this.selectedItemIndex = selectedItem.text;
|
// 修正这里的赋值错误,应该保存索引而不是文本
|
||||||
if (instruction) {
|
this.selectedItemIndex = this.selectedItemIndex;
|
||||||
const topic = `B/${this.itemInfo.deviceImei}`;
|
console.log(this.selectedItemIndex,'this.selectedItemIndexthis.selectedItemIndex');
|
||||||
const message = JSON.stringify(instruction);
|
// if (instruction) {
|
||||||
this.mqttClient.publish(topic, message);
|
// const topic = `B/${this.itemInfo.deviceImei}`;
|
||||||
console.log('已发送指令:', instruction);
|
// const message = JSON.stringify(instruction);
|
||||||
}
|
// // 确保mqttClient已连接
|
||||||
this.lightModeA = false;
|
// if (this.mqttClient && this.mqttClient.client && this.mqttClient.client.isConnected()) {
|
||||||
|
// this.mqttClient.publish(topic, message);
|
||||||
|
// console.log('已发送指令:', instruction);
|
||||||
|
// } else {
|
||||||
|
// uni.showToast({
|
||||||
|
// title: 'MQTT未连接',
|
||||||
|
// icon: 'none'
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
this.lightModeA = false;
|
||||||
},
|
},
|
||||||
// 上传开机画面
|
// 上传开机画面
|
||||||
uploadStartup() {
|
uploadStartup() {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<view class="device-info">
|
<view class="device-info">
|
||||||
<view class="device-header">
|
<view class="device-header">
|
||||||
<view class="deviceIMG">
|
<view class="deviceIMG">
|
||||||
<image :src="itemInfo.devicePic" mode="" class="IMG"></image>
|
<image :src="itemInfo.devicePic" mode="aspectFit" class="IMG"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="device-name">
|
<view class="device-name">
|
||||||
<view>设备:{{itemInfo.deviceName}}</view>
|
<view>设备:{{itemInfo.deviceName}}</view>
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<view class="agreement-mask" v-if="shareShow" @click="closePopup('share')">
|
<view class="agreement-mask" v-if="shareShow" @click="closePopup('share')">
|
||||||
<view class="agreement-popup" @click.stop>
|
<view class="agreement-popup" @click.stop>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<image src="/static/images/success.png" mode="" class="svg"></image>
|
<image src="/static/images/success.png" mode="aspectFit" class="svg"></image>
|
||||||
<view>
|
<view>
|
||||||
<view class="popup-Title">设备分享成功</view>
|
<view class="popup-Title">设备分享成功</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<view class="device-info" v-for="(item, index) in deviceList" :key="index">
|
<view class="device-info" v-for="(item, index) in deviceList" :key="index">
|
||||||
<view class="device-header" @click.stop="handleFile(item)">
|
<view class="device-header" @click.stop="handleFile(item)">
|
||||||
<view class="deviceIMG">
|
<view class="deviceIMG">
|
||||||
<image src="@/static/images/user.png" mode="" class="IMG"></image>
|
<image src="@/static/images/user.png" mode="aspectFit" class="IMG"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="device-name">
|
<view class="device-name">
|
||||||
<view>用户名:{{item.deviceName}}</view>
|
<view>用户名:{{item.deviceName}}</view>
|
||||||
|
@ -12,56 +12,63 @@
|
|||||||
{{tab.typeName}}
|
{{tab.typeName}}
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="uniui-more">
|
||||||
|
<image @click="allMore" src="/static/images/more.png" mode="" class="more"></image>
|
||||||
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view class="sendFlex">
|
<view class="sendFlex" v-if="activeTab && activeTab.id !== ''&& activeTabInfo.communicationMode==0">
|
||||||
|
<!-- <view class="callpolice">报警</view> -->
|
||||||
<view class="callpolice">报警</view>
|
|
||||||
<view class="Sendmessage" @click="location">位置</view>
|
<view class="Sendmessage" @click="location">位置</view>
|
||||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100"
|
<scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100"
|
||||||
style="height:80vh;">
|
style="height:80vh;">
|
||||||
<uni-swipe-action ref="swipeAction">
|
<view v-if="deviceList.length>0">
|
||||||
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
<uni-swipe-action ref="swipeAction">
|
||||||
<uni-swipe-action-item :right-options="Options"
|
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
||||||
@click="handleSwipeClick($event, item, index)" class="device-card">
|
<uni-swipe-action-item :right-options="Options"
|
||||||
<view @click.stop="handleFile(item)">
|
@click="handleSwipeClick($event, item, index)" class="device-card">
|
||||||
<view class="device-header">
|
<view @click.stop="handleFile(item)">
|
||||||
<view class="deviceIMG">
|
<view class="device-header">
|
||||||
<image :src="item.devicePic" class="IMG"></image>
|
<view class="deviceIMG">
|
||||||
</view>
|
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||||
<view class="device-name">
|
</view>
|
||||||
<view>设备:{{item.deviceName}}</view>
|
<view class="device-name">
|
||||||
<view class="ID">
|
<view>设备:{{item.deviceName}}</view>
|
||||||
<view class="ID" v-if="item.communicationMode==0">ID:{{item.deviceImei}}
|
<view class="ID">
|
||||||
|
<view class="ID" v-if="item.communicationMode==0">ID:{{item.deviceImei}}
|
||||||
|
</view>
|
||||||
|
<view class="ID" v-else>ID:{{item.deviceMac}}</view>
|
||||||
|
<view class="onlines" v-if="item.communicationMode==0">在线</view>
|
||||||
|
<view>电量:90%</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ID" v-else>ID:{{item.deviceMac}}</view>
|
|
||||||
<view class="onlines" v-if="item.communicationMode==0">在线</view>
|
|
||||||
<view>电量:90%</view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="" v-if="item.communicationMode==1">
|
||||||
|
<view class="device-status online">已连接</view>
|
||||||
|
<view class="device-status unline">未连接</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="" v-if="item.communicationMode==1">
|
<image src="/static/images/cires.png" class="circle" mode="aspectFit"></image>
|
||||||
<view class="device-status online">已连接</view>
|
</uni-swipe-action-item>
|
||||||
<view class="device-status unline">未连接</view>
|
</block>
|
||||||
</view>
|
</uni-swipe-action>
|
||||||
|
<!-- 加载状态提示 -->
|
||||||
</view>
|
<view class="loading-status">
|
||||||
<image src="/static/images/cires.png" class="circle"></image>
|
<text v-if="loading">加载中...</text>
|
||||||
</uni-swipe-action-item>
|
<text v-if="finished">没有更多数据了</text>
|
||||||
</block>
|
</view>
|
||||||
</uni-swipe-action>
|
</view>
|
||||||
<!-- 加载状态提示 -->
|
<view v-else class="noDATA">
|
||||||
<view class="loading-status">
|
<view> <uni-icons type="image-filled" size="120" color="rgba(255, 255, 255, 0.9)"></uni-icons>
|
||||||
<text v-if="loading">加载中...</text>
|
</view>
|
||||||
<text v-if="finished">没有更多数据了</text>
|
暂无数据
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 删除弹框 -->
|
<!-- 删除弹框 -->
|
||||||
<view class="agreement-mask" v-if="deleteShow">
|
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')">
|
||||||
<view class="agreement-popupC">
|
<view class="agreement-popupC" @click.stop>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<image src="/static/images/dell.png" mode="" class="svg"></image>
|
<image src="/static/images/dell.png" mode="" class="svg"></image>
|
||||||
<uni-icon class="trash"></uni-icon>
|
<uni-icon class="trash"></uni-icon>
|
||||||
@ -76,13 +83,14 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- =========重命名============== -->
|
<!-- =========重命名============== -->
|
||||||
<view class="agreement-mask" v-if="RenameModel">
|
<view class="agreement-mask" v-if="RenameModel" @click="closePopup('rename')">
|
||||||
<view class="agreement-popupD">
|
<view class="agreement-popupD" @click.stop>
|
||||||
<view class="popup-content">
|
<view class="popup-content">
|
||||||
<view>
|
<view>
|
||||||
<view class="popup-flex">
|
<view class="popup-flex">
|
||||||
<text>设备名称</text>
|
<text>设备名称</text>
|
||||||
<input type="text" v-model="deviceName" placeholder="请输入设备名称" class="popup-input" />
|
<input type="text" v-model="deviceName" placeholder="请输入设备名称" class="popup-input"
|
||||||
|
@click.stop />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -103,6 +111,17 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<!-- ====分享,类型提示框==== -->
|
||||||
|
<view class="tooltip-share" v-if="showshare">
|
||||||
|
<view class="tooltip-arrow"></view>
|
||||||
|
<view class="tooltip-content">
|
||||||
|
<view class="tooltip-item" v-for="(item, index) in shareItems" :key="index"
|
||||||
|
@click="handleshareClick(item)">
|
||||||
|
<image :src="item.icon" class="item-icon" />
|
||||||
|
<text>{{ item.text }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -121,6 +140,7 @@
|
|||||||
tabs: [],
|
tabs: [],
|
||||||
activeTab: 0,
|
activeTab: 0,
|
||||||
showTooltip: false,
|
showTooltip: false,
|
||||||
|
showshare: false,
|
||||||
Options: [{
|
Options: [{
|
||||||
text: '重命名',
|
text: '重命名',
|
||||||
style: {
|
style: {
|
||||||
@ -152,21 +172,63 @@
|
|||||||
action: 'bluetooth'
|
action: 'bluetooth'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
shareItems: [{
|
||||||
|
text: '所有类型',
|
||||||
|
icon: '/static/images/type.png',
|
||||||
|
action: 'type'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '所有分享',
|
||||||
|
icon: '/static/images/share.png',
|
||||||
|
action: 'share'
|
||||||
|
}
|
||||||
|
],
|
||||||
page: 1, // 当前页码
|
page: 1, // 当前页码
|
||||||
size: 10, // 每页条数
|
size: 10, // 每页条数
|
||||||
total: 0, // 总数据量
|
total: 0, // 总数据量
|
||||||
loading: false,
|
loading: false,
|
||||||
finished: false,
|
finished: false,
|
||||||
deviceId: '',
|
deviceId: '',
|
||||||
deviceName: "" //重命名
|
deviceName: "", //重命名
|
||||||
|
activeTabInfo: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 更多
|
||||||
|
allMore() {
|
||||||
|
this.showshare = !this.showshare;
|
||||||
|
},
|
||||||
|
// 所有分享,所有类型
|
||||||
|
handleshareClick(item) {
|
||||||
|
this.showshare = false; // 关闭弹窗
|
||||||
|
switch (item.action) {
|
||||||
|
case 'type':
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/common/allType/index'
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 'share':
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/6170/allShare/index"
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 点击弹框外的区域关闭
|
||||||
|
closePopup(type) {
|
||||||
|
if (type === 'delete') {
|
||||||
|
this.deleteShow = false;
|
||||||
|
uni.showTabBar(); // 显示TabBar
|
||||||
|
} else if (type === 'rename') {
|
||||||
|
this.RenameModel = false;
|
||||||
|
uni.showTabBar(); // 显示TabBar
|
||||||
|
}
|
||||||
|
},
|
||||||
// tab导航切换栏
|
// tab导航切换栏
|
||||||
getTab() {
|
getTab() {
|
||||||
deviceTypeList({}).then((res) => {
|
deviceTypeList({}).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
console.log("deviceTypeList=" + JSON.stringify(res.data));
|
//console.log("deviceTypeList=" + JSON.stringify(res.data));
|
||||||
this.tabs = [{
|
this.tabs = [{
|
||||||
id: '',
|
id: '',
|
||||||
name: '全部设备',
|
name: '全部设备',
|
||||||
@ -186,6 +248,7 @@
|
|||||||
switchTab(tab, index) {
|
switchTab(tab, index) {
|
||||||
this.deviceList = [];
|
this.deviceList = [];
|
||||||
this.activeTab = index;
|
this.activeTab = index;
|
||||||
|
this.activeTabInfo = tab
|
||||||
this.page = 1; // 重置页码
|
this.page = 1; // 重置页码
|
||||||
this.finished = false; // 重
|
this.finished = false; // 重
|
||||||
// 明确传递参数,空字符串改为null或undefined
|
// 明确传递参数,空字符串改为null或undefined
|
||||||
@ -226,10 +289,11 @@
|
|||||||
onScrollToLower() {
|
onScrollToLower() {
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
|
// 添加扫一三图标
|
||||||
scan() {
|
scan() {
|
||||||
this.showTooltip = !this.showTooltip;
|
this.showTooltip = !this.showTooltip;
|
||||||
},
|
},
|
||||||
|
// 添加设备,扫一扫,蓝牙
|
||||||
handleMenuClick(item) {
|
handleMenuClick(item) {
|
||||||
this.showTooltip = false; // 关闭弹窗
|
this.showTooltip = false; // 关闭弹窗
|
||||||
switch (item.action) {
|
switch (item.action) {
|
||||||
@ -239,15 +303,6 @@
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'bluetooth':
|
case 'bluetooth':
|
||||||
// uni.navigateTo({
|
|
||||||
// url: 'pages/common/addBLE/AddDevice',
|
|
||||||
// success:(res)=>{
|
|
||||||
// res.eventChannel.emit('key', { data: 'data from starter page' })
|
|
||||||
// },fail: (ex) => {
|
|
||||||
// console.log("跳转失败了",JSON.stringify(ex));
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: "/pages/common/addBLE/addEquip"
|
url: "/pages/common/addBLE/addEquip"
|
||||||
})
|
})
|
||||||
@ -256,8 +311,11 @@
|
|||||||
},
|
},
|
||||||
// 右滑点击事件处理
|
// 右滑点击事件处理
|
||||||
handleSwipeClick(e, item, index) {
|
handleSwipeClick(e, item, index) {
|
||||||
const {content} = e
|
|
||||||
console.log(e, 'eeeee');
|
const {
|
||||||
|
content
|
||||||
|
} = e
|
||||||
|
console.log(item, 'eeeee');
|
||||||
switch (e.content.text) {
|
switch (e.content.text) {
|
||||||
case '删除':
|
case '删除':
|
||||||
this.handleDeleteDevice(item, index)
|
this.handleDeleteDevice(item, index)
|
||||||
@ -290,6 +348,8 @@
|
|||||||
this.onIntall();
|
this.onIntall();
|
||||||
}, 500);
|
}, 500);
|
||||||
this.deleteShow = false
|
this.deleteShow = false
|
||||||
|
// 关闭所有滑动项
|
||||||
|
this.$refs.swipeAction.closeAll();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@ -323,6 +383,8 @@
|
|||||||
}, 500);
|
}, 500);
|
||||||
this.RenameModel = false
|
this.RenameModel = false
|
||||||
this.deviceName = ''
|
this.deviceName = ''
|
||||||
|
// 关闭所有滑动项
|
||||||
|
this.$refs.swipeAction.closeAll();
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
@ -334,57 +396,84 @@
|
|||||||
},
|
},
|
||||||
// 发生短信
|
// 发生短信
|
||||||
handleSend() {
|
handleSend() {
|
||||||
|
const currentTab = this.tabs[this.activeTab];
|
||||||
|
const deviceType = currentTab.id || 'all';
|
||||||
|
console.log(`跳转到发送信息页面\n当前设备类型: ${deviceType}\n设备类型名称: ${currentTab.typeName}`);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/common/send/index'
|
url: '/pages/common/send/index',
|
||||||
|
events: {
|
||||||
|
ack: function(data) {}
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
res.eventChannel.emit('deviceSend', {
|
||||||
|
data: deviceType
|
||||||
|
});
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 位置
|
// 位置
|
||||||
location(){
|
location() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/common/map/index'
|
url: '/pages/common/map/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleFile(item) {
|
handleFile(item) {
|
||||||
console.log('item' + JSON.stringify(item));
|
//console.log('item' + JSON.stringify(item));
|
||||||
// communicationMode 0是4G 1是蓝牙
|
// communicationMode 0是4G 1是蓝牙
|
||||||
if (item.communicationMode == 0) {
|
if (item.communicationMode == 0) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/6170/deviceControl/index?id=${item.id}`
|
url: "/pages/6170/deviceControl/index",
|
||||||
|
events: {
|
||||||
|
ack: function(data) {}
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
// 页面跳转成功后的回调函数
|
||||||
|
res.eventChannel.emit('deviceControl', {
|
||||||
|
data: item,
|
||||||
|
apiType: 'listA' // 自定义标识,详情哪里根据这个参数不同信息
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (item.typeName == '6155') {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: "/pages/6155/deviceDetail",
|
||||||
|
events: {
|
||||||
|
ack: function(data) {
|
||||||
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.typeName == '6155') {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: "/pages/650/HBY650",
|
|
||||||
events: {
|
|
||||||
ack: function(data) {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
success: (res) => {
|
|
||||||
res.eventChannel.emit('detailData', {
|
|
||||||
data: item
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
},
|
||||||
}
|
success: (res) => {
|
||||||
|
res.eventChannel.emit('detailData', {
|
||||||
|
data: item
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
onIntall() {
|
|
||||||
this.page = 1;
|
|
||||||
this.finished = false;
|
|
||||||
this.getData(); // 重新加载第一页数据
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onIntall() {
|
||||||
this.getTab()
|
this.page = 1;
|
||||||
|
this.finished = false;
|
||||||
|
this.getData(this.deviceType); // 重新加载第一页数据
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onLoad() {
|
||||||
|
this.getTab()
|
||||||
|
this.onIntall()
|
||||||
|
// 绑定页面做了监听,新增成功,刷新页面
|
||||||
|
uni.$on('refreshDeviceList', () => {
|
||||||
|
this.getTab() // 刷新数据
|
||||||
this.onIntall()
|
this.onIntall()
|
||||||
}
|
});
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
// 组件销毁前移除监听器
|
||||||
|
uni.$off('refreshDeviceList');
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
@ -403,6 +492,7 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
/* 禁止换行 */
|
/* 禁止换行 */
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,6 +530,21 @@
|
|||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.uniui-more {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.more {
|
||||||
|
width: 40rpx;
|
||||||
|
height: 8rpx;
|
||||||
|
/* position: absolute; */
|
||||||
|
/* right: 0rpx;
|
||||||
|
z-index: 100; */
|
||||||
|
float: right;
|
||||||
|
top: -95rpx
|
||||||
|
}
|
||||||
|
|
||||||
.gprs {
|
.gprs {
|
||||||
width: 28rpx;
|
width: 28rpx;
|
||||||
height: 35rpx;
|
height: 35rpx;
|
||||||
@ -465,118 +570,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* .device-header {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 15rpx;
|
|
||||||
padding: 30rpx 0 10rpx 30rpx;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-name {
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: rgba(255, 255, 255, 0.87);
|
|
||||||
margin-left: 24rpx;
|
|
||||||
line-height: 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ID {
|
|
||||||
color: rgba(255, 255, 255, 0.6);
|
|
||||||
font-size: 24rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-status {
|
|
||||||
width: 122rpx;
|
|
||||||
height: 52rpx;
|
|
||||||
font-size: 26rpx;
|
|
||||||
border-radius: 0px 8px 0px 8px;
|
|
||||||
background-color: rgb(42, 42, 42);
|
|
||||||
position: absolute;
|
|
||||||
top: 0rpx;
|
|
||||||
right: 0rpx;
|
|
||||||
text-align: center;
|
|
||||||
line-height: 52rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.circle {
|
|
||||||
width: 8rpx;
|
|
||||||
height: 40rpx;
|
|
||||||
position: absolute;
|
|
||||||
right: 18rpx;
|
|
||||||
top: 65rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.online {
|
|
||||||
color: rgb(187, 230, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
.unline {
|
|
||||||
color: rgba(255, 255, 255, 0.4);
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-id {
|
|
||||||
font-size: 26rpx;
|
|
||||||
color: #999;
|
|
||||||
margin-bottom: 20rpx;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.device-info {
|
|
||||||
display: flex;
|
|
||||||
font-size: 28rpx;
|
|
||||||
color: rgba(255, 255, 255, 0.87);
|
|
||||||
position: relative;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
.device-flex{
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.deviceIMG {
|
|
||||||
width: 100rpx;
|
|
||||||
height: 100rpx;
|
|
||||||
border-radius: 16rpx;
|
|
||||||
position: relative;
|
|
||||||
background-color: rgba(42, 42, 42, 0.6);
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.IMG {
|
|
||||||
width: 68rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
margin-left: 17%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.onlines::before {
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
width: 15rpx;
|
|
||||||
height: 15rpx;
|
|
||||||
background: rgb(0, 171, 103);
|
|
||||||
border-radius: 50%;
|
|
||||||
left: 120rpx;
|
|
||||||
top: 15rpx
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
width: 2rpx;
|
|
||||||
height: 24rpx;
|
|
||||||
background: linear-gradient(90deg,
|
|
||||||
rgba(0, 0, 0, 0) 0%,
|
|
||||||
rgb(255, 255, 255) 50%,
|
|
||||||
rgba(255, 255, 255, 0) 100%);
|
|
||||||
margin-top: 12rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.loading-status {
|
|
||||||
text-align: center;
|
|
||||||
color: rgba(255, 255, 255, 0.6);
|
|
||||||
padding: 20rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
} */
|
|
||||||
.device-header {
|
.device-header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -661,6 +654,7 @@
|
|||||||
width: 68rpx;
|
width: 68rpx;
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
margin-left: 17%;
|
margin-left: 17%;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.onlines {
|
.onlines {
|
||||||
@ -695,6 +689,12 @@
|
|||||||
font-size: 22rpx;
|
font-size: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.noDATA {
|
||||||
|
text-align: center;
|
||||||
|
color: rgba(255, 255, 255, 0.87);
|
||||||
|
transform: translate(-0%, 100%);
|
||||||
|
}
|
||||||
|
|
||||||
/* 遮罩层 */
|
/* 遮罩层 */
|
||||||
.agreement-mask {
|
.agreement-mask {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -756,6 +756,7 @@
|
|||||||
color: rgba(255, 255, 255, 0.87);
|
color: rgba(255, 255, 255, 0.87);
|
||||||
height: 50rpx;
|
height: 50rpx;
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-input {
|
.popup-input {
|
||||||
@ -812,6 +813,14 @@
|
|||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tooltip-share {
|
||||||
|
position: fixed;
|
||||||
|
right: 18rpx;
|
||||||
|
top: 230rpx;
|
||||||
|
/* 根据导航栏高度调整 */
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
.tooltip-arrow {
|
.tooltip-arrow {
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<view class="device-content">
|
<view class="device-content">
|
||||||
<view class="device-header">
|
<view class="device-header">
|
||||||
<view class="deviceIMG">
|
<view class="deviceIMG">
|
||||||
<image :src="item.devicePic" mode="" class="IMG"></image>
|
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="device-name">
|
<view class="device-name">
|
||||||
<view>设备:{{item.deviceName}}</view>
|
<view>设备:{{item.deviceName}}</view>
|
||||||
|
Reference in New Issue
Block a user