设备图片自适应展示
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
<view class="device-content" @click.stop="handleFile(item)">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image :src="item.devicePic" class="IMG"></image>
|
||||
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:{{item.deviceName}}</view>
|
||||
@ -67,7 +67,7 @@
|
||||
<view class="agreement-mask" v-if="deleteShow" @click="closePopup('delete')">
|
||||
<view class="agreement-popupC" @click.stop>
|
||||
<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>
|
||||
<view class="popup-Title">
|
||||
{{ tabs[activeTab].name === '我的分享' ? '确定停止分享该设备' : '确定移除他人分享给你的这台设备' }}
|
||||
|
@ -12,7 +12,7 @@
|
||||
<!-- 设备电量信息 -->
|
||||
<view class="battery-section">
|
||||
<view class="battery-sectionLeft">
|
||||
<image :src="deviceInfo.devicePic" class="bipImg"></image>
|
||||
<image :src="deviceInfo.devicePic" class="bipImg" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="battery-v1">
|
||||
@ -23,7 +23,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<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 class="battery-v2">1小时</view>
|
||||
<view class="battery-v3">续航时间</view>
|
||||
@ -61,7 +61,7 @@
|
||||
|
||||
<!-- 灯光亮度控制 -->
|
||||
<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"
|
||||
@change="onSliderChanging" />
|
||||
</view>
|
||||
@ -80,7 +80,7 @@
|
||||
</view>
|
||||
<view class="mode-v1" v-if="hasPermission('2')">
|
||||
<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 class="battery-v2">激光模式</view>
|
||||
</view>
|
||||
@ -88,7 +88,7 @@
|
||||
</view>
|
||||
<view class="mode-v1" v-if="hasPermission('3')">
|
||||
<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 class="battery-v2">开机画面</view>
|
||||
<view class="mode-v3">上传</view>
|
||||
@ -143,22 +143,22 @@
|
||||
<view class="section-title">产品信息</view>
|
||||
<view class="mode-buttons">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</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>
|
||||
<!-- 标题 -->
|
||||
@ -178,9 +178,9 @@
|
||||
</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-content">
|
||||
@ -204,9 +204,9 @@
|
||||
</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-content">
|
||||
@ -220,7 +220,7 @@
|
||||
<!-- 按钮组 -->
|
||||
<view class="popup-buttons">
|
||||
<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>
|
||||
@ -255,9 +255,9 @@
|
||||
secondaryMode: 'string',
|
||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||
navTitle: "",
|
||||
sliderValue: 50,
|
||||
sliderValue: 30,
|
||||
lightModeA: false,
|
||||
currentMainMode: '强光模式',
|
||||
currentMainMode: '强光',
|
||||
lightModeB: false,
|
||||
lightModeC: false, //激光提示框
|
||||
items: [],
|
||||
@ -288,7 +288,8 @@
|
||||
popupConfirmText: '确认',
|
||||
showUploadPopup: false,
|
||||
selectedImage: null, // 添加这个变量来存储选择的图片
|
||||
file: ''
|
||||
file: '',
|
||||
selectedItemIndex: 0
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -319,22 +320,22 @@
|
||||
if (type === 'main') {
|
||||
this.items = [{
|
||||
text: '强光',
|
||||
selected: this.currentMainMode === '强光模式',
|
||||
image: '/static/images/sett.png'
|
||||
selected: this.currentMainMode === '强光', // 修正匹配条件
|
||||
image: '/static/images/sett.png',
|
||||
},
|
||||
{
|
||||
text: '弱光',
|
||||
selected: this.currentMainMode === '弱光模式',
|
||||
selected: this.currentMainMode === '弱光',
|
||||
image: '/static/images/sett.png'
|
||||
},
|
||||
{
|
||||
text: '爆闪',
|
||||
selected: this.currentMainMode === '爆闪模式',
|
||||
selected: this.currentMainMode === '爆闪',
|
||||
image: '/static/images/bs.png'
|
||||
},
|
||||
{
|
||||
text: '泛光',
|
||||
selected: this.currentMainMode === '泛光模式',
|
||||
selected: this.currentMainMode === '泛光',
|
||||
image: '/static/images/settt.png'
|
||||
},
|
||||
];
|
||||
@ -365,18 +366,28 @@
|
||||
},
|
||||
// 灯光模式的确认
|
||||
handleSumbit() {
|
||||
if (this.selectedItemIndex === null) return;
|
||||
const selectedItem = this.items[this.selectedItemIndex];
|
||||
const instruction = this.modeInstructions[selectedItem.text];
|
||||
console.log(selectedItem, 'selectedItemselectedItem');
|
||||
this.selectedItemIndex = selectedItem.text;
|
||||
if (instruction) {
|
||||
const topic = `B/${this.itemInfo.deviceImei}`;
|
||||
const message = JSON.stringify(instruction);
|
||||
this.mqttClient.publish(topic, message);
|
||||
console.log('已发送指令:', instruction);
|
||||
}
|
||||
this.lightModeA = false;
|
||||
if (this.selectedItemIndex === null) return;
|
||||
const selectedItem = this.items[this.selectedItemIndex];
|
||||
const instruction = this.modeInstructions[selectedItem.text];
|
||||
console.log(selectedItem, 'selectedItemselectedItem');
|
||||
// 修正这里的赋值错误,应该保存索引而不是文本
|
||||
this.selectedItemIndex = this.selectedItemIndex;
|
||||
console.log(this.selectedItemIndex,'this.selectedItemIndexthis.selectedItemIndex');
|
||||
// if (instruction) {
|
||||
// const topic = `B/${this.itemInfo.deviceImei}`;
|
||||
// const message = JSON.stringify(instruction);
|
||||
// // 确保mqttClient已连接
|
||||
// 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() {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<view class="device-info">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image :src="itemInfo.devicePic" mode="" class="IMG"></image>
|
||||
<image :src="itemInfo.devicePic" mode="aspectFit" class="IMG"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:{{itemInfo.deviceName}}</view>
|
||||
@ -48,7 +48,7 @@
|
||||
<view class="agreement-mask" v-if="shareShow" @click="closePopup('share')">
|
||||
<view class="agreement-popup" @click.stop>
|
||||
<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 class="popup-Title">设备分享成功</view>
|
||||
</view>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<view class="device-info" v-for="(item, index) in deviceList" :key="index">
|
||||
<view class="device-header" @click.stop="handleFile(item)">
|
||||
<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 class="device-name">
|
||||
<view>用户名:{{item.deviceName}}</view>
|
||||
|
@ -31,7 +31,7 @@
|
||||
<view @click.stop="handleFile(item)">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image :src="item.devicePic" class="IMG"></image>
|
||||
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:{{item.deviceName}}</view>
|
||||
@ -49,7 +49,7 @@
|
||||
<view class="device-status unline">未连接</view>
|
||||
</view>
|
||||
</view>
|
||||
<image src="/static/images/cires.png" class="circle"></image>
|
||||
<image src="/static/images/cires.png" class="circle" mode="aspectFit"></image>
|
||||
</uni-swipe-action-item>
|
||||
</block>
|
||||
</uni-swipe-action>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<view class="device-content">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image :src="item.devicePic" mode="" class="IMG"></image>
|
||||
<image :src="item.devicePic" class="IMG" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:{{item.deviceName}}</view>
|
||||
|
Reference in New Issue
Block a user