merge upstream
This commit is contained in:
@ -6,7 +6,7 @@ export function deviceDetail(id) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 获取设备分享详细信息
|
// 获取设备分享详细信息
|
||||||
export function deviceShareId(id) {
|
export function deviceShareId (id) {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/bjq6075/device/getShareInfo/${id}`,
|
url: `/app/bjq6075/device/getShareInfo/${id}`,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@ -28,7 +28,7 @@ export function deviceSendMessage(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 灯光模式设置
|
// 主灯光模式设置
|
||||||
export function lightModeSettings(data) {
|
export function lightModeSettings(data) {
|
||||||
return request({
|
return request({
|
||||||
url: `/app/bjq6075/device/lightModeSettings`,
|
url: `/app/bjq6075/device/lightModeSettings`,
|
||||||
@ -36,6 +36,14 @@ export function lightModeSettings(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 辅灯模式设置
|
||||||
|
export function auxiliaryLightModeSettings(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/bjq6075/device/auxiliaryLightModeSettings`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 激光模式设置
|
// 激光模式设置
|
||||||
export function laserModeSettings(data) {
|
export function laserModeSettings(data) {
|
||||||
return request({
|
return request({
|
||||||
@ -52,6 +60,14 @@ export function lightBrightnessSettings(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 声光报警
|
||||||
|
export function salaModeSettings(data) {
|
||||||
|
return request({
|
||||||
|
url: `/app/bjq6075/device/salaModeSettings`,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 地图逆解析
|
// 地图逆解析
|
||||||
export function mapReverseGeocoding(data) {
|
export function mapReverseGeocoding(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@ -238,11 +238,12 @@
|
|||||||
<button class="agree" @click="handleupload">确定</button>
|
<button class="agree" @click="handleupload">确定</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
|
||||||
<!-- ======各个弹框类型======= -->
|
<!-- ======各个弹框类型======= -->
|
||||||
<CustomPopup :show="currentPopup.show" ="currentPopup.config" @confirm="handleConfirm"
|
<CustomPopup :show="currentPopup.show" ="currentPopup.config" @confirm="handleConfirm"
|
||||||
@cancel="handleCancel" />
|
@cancel="handleCancel" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,13 @@
|
|||||||
<view>
|
<view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="callpolice">
|
||||||
|
<view class="">设备疑似受到外力碰撞!</view>
|
||||||
|
<view>
|
||||||
|
<uni-icons type="closeempty" size="15" color="rgba(255, 255, 255, 0.9)"
|
||||||
|
></uni-icons>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<!-- 设备基本信息 -->
|
<!-- 设备基本信息 -->
|
||||||
<view class="info-card">
|
<view class="info-card">
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
@ -44,13 +50,16 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="info-label">设备状态</text>
|
<text class="info-label">设备状态</text>
|
||||||
<text class="info-value status-running">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }}</text>
|
<text
|
||||||
|
class="info-value status-running">{{ deviceInfo.onlineStatus === 0 ? '离线' : deviceInfo.onlineStatus === 2 ? '故障' : '在线' }}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="info-row">
|
<view class="info-row">
|
||||||
<text class="info-label">定位信息</text>
|
<text class="info-label">定位信息</text>
|
||||||
<view class="info-value status-running" @click="gpsPosition">
|
<view class="info-value status-running" @click="gpsPosition">
|
||||||
<view class="info-value status-running"> {{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }}
|
<view class="info-value status-running">
|
||||||
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}</view>
|
{{ deviceInfo && deviceInfo.longitude ? Number(deviceInfo.longitude).toFixed(4) : '' }}
|
||||||
|
{{ deviceInfo && deviceInfo.latitude ? Number(deviceInfo.latitude).toFixed(4) : '' }}
|
||||||
|
</view>
|
||||||
<view class="info-value status-running">
|
<view class="info-value status-running">
|
||||||
<uni-icons @click="toggleForm" type="location" size="17"
|
<uni-icons @click="toggleForm" type="location" size="17"
|
||||||
color="rgba(255, 255, 255, 0.8)" style="vertical-align: bottom;" />
|
color="rgba(255, 255, 255, 0.8)" style="vertical-align: bottom;" />
|
||||||
@ -293,7 +302,7 @@
|
|||||||
icon: '/static/images/210/bj_1.png',
|
icon: '/static/images/210/bj_1.png',
|
||||||
message: '确定开启设备声光报警?',
|
message: '确定开启设备声光报警?',
|
||||||
confirmBtnBg: 'rgba(255, 200, 78, 1)',
|
confirmBtnBg: 'rgba(255, 200, 78, 1)',
|
||||||
popupBorder:'1rpx solid rgba(255, 200, 78, 0.3)',
|
popupBorder: '1rpx solid rgba(255, 200, 78, 0.3)',
|
||||||
showCancel: true
|
showCancel: true
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
@ -308,8 +317,10 @@
|
|||||||
registerPersonInfo,
|
registerPersonInfo,
|
||||||
deviceSendMessage,
|
deviceSendMessage,
|
||||||
deviceShareId,
|
deviceShareId,
|
||||||
lightModeSettings, //灯光模式设置
|
lightModeSettings, //主灯模式设置
|
||||||
|
auxiliaryLightModeSettings, //辅灯模式
|
||||||
laserModeSettings, //激光模式设置
|
laserModeSettings, //激光模式设置
|
||||||
|
salaModeSettings, //声光报警
|
||||||
mapReverseGeocoding //地图逆解析
|
mapReverseGeocoding //地图逆解析
|
||||||
} from '@/api/6075/6075.js'
|
} from '@/api/6075/6075.js'
|
||||||
import {
|
import {
|
||||||
@ -361,10 +372,10 @@
|
|||||||
selectedImage: null, // 添加这个变量来存储选择的图片
|
selectedImage: null, // 添加这个变量来存储选择的图片
|
||||||
file: '',
|
file: '',
|
||||||
selectedItemIndex: 0,
|
selectedItemIndex: 0,
|
||||||
radioList: ['M', 'S'],
|
|
||||||
radioSelected: 0, // -1表示未选中任何项
|
|
||||||
deviceType: '',
|
deviceType: '',
|
||||||
popupType: '', //弹框类型
|
popupType: '', //弹框类型
|
||||||
|
pendingMainMode: null, // 选中的索引
|
||||||
|
items: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@ -424,19 +435,53 @@
|
|||||||
url: '/pages/common/map/index'
|
url: '/pages/common/map/index'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 激光模式
|
|
||||||
lasermode() {
|
|
||||||
this.lightModeC = true
|
|
||||||
},
|
|
||||||
// 声光报警
|
// 声光报警
|
||||||
audible() {
|
audible() {
|
||||||
this.showPopup('audibleAlarm');
|
this.showPopup('audibleAlarm');
|
||||||
},
|
},
|
||||||
|
// 激光模式
|
||||||
|
lasermode() {
|
||||||
|
this.lightModeC = true;
|
||||||
|
},
|
||||||
|
// 激光确认框提交
|
||||||
|
handleBtn() {
|
||||||
|
if (this.deviceInfo.onlineStatus !== 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '设备已离线',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const instructValue = this.isLaserOn ? 0 : 1;
|
||||||
|
let data = {
|
||||||
|
deviceId: this.computedDeviceId,
|
||||||
|
instructValue: instructValue,
|
||||||
|
deviceImei: this.itemInfo.deviceImei,
|
||||||
|
typeName: this.itemInfo.typeName,
|
||||||
|
};
|
||||||
|
laserModeSettings(data).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: res.msg
|
||||||
|
});
|
||||||
|
// 更新状态
|
||||||
|
this.isLaserOn = !this.isLaserOn;
|
||||||
|
this.currentlaserMode = this.isLaserOn ? "开启" : "关闭";
|
||||||
|
this.lightModeC = false;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//激光取消
|
||||||
handleDisagree() {
|
handleDisagree() {
|
||||||
this.lightModeC = false
|
this.lightModeC = false
|
||||||
},
|
},
|
||||||
// 取消按钮
|
handleDisagree() {
|
||||||
handleBtn() {
|
|
||||||
this.lightModeC = false
|
this.lightModeC = false
|
||||||
},
|
},
|
||||||
// 主灯模式
|
// 主灯模式
|
||||||
@ -531,7 +576,6 @@
|
|||||||
this.isFormExpanded = !this.isFormExpanded;
|
this.isFormExpanded = !this.isFormExpanded;
|
||||||
},
|
},
|
||||||
onItemClick(index) {
|
onItemClick(index) {
|
||||||
console.log(index, 'index');
|
|
||||||
const item = this.items[index];
|
const item = this.items[index];
|
||||||
this.selectedItemIndex = index;
|
this.selectedItemIndex = index;
|
||||||
this.items = this.items.map((item, i) => ({
|
this.items = this.items.map((item, i) => ({
|
||||||
@ -539,14 +583,73 @@
|
|||||||
selected: i === index
|
selected: i === index
|
||||||
}));
|
}));
|
||||||
this.pendingMainMode = item.text;
|
this.pendingMainMode = item.text;
|
||||||
// 主灯
|
console.log(this.pendingMainMode, 'this.pendingMainModethis.pendingMainMode');
|
||||||
this.currentMainMode = item.text;
|
|
||||||
// 辅灯
|
|
||||||
this.currentSubMode = item.text;
|
|
||||||
|
|
||||||
},
|
},
|
||||||
// 灯光模式的确认
|
// 灯光模式的确认
|
||||||
handleSumbit() {
|
handleSumbit() {
|
||||||
|
if (this.deviceInfo.onlineStatus !== 1) {
|
||||||
|
uni.showToast({
|
||||||
|
title: '设备已离线',
|
||||||
|
icon: 'none'
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.popupTitle == '主灯模式') {
|
||||||
|
if (this.selectedItemIndex === null) return;
|
||||||
|
const selectedItem = this.items[this.selectedItemIndex];
|
||||||
|
let data = {
|
||||||
|
deviceId: this.computedDeviceId,
|
||||||
|
instructValue: selectedItem.instructValue,
|
||||||
|
deviceImei: this.itemInfo.deviceImei,
|
||||||
|
typeName: this.itemInfo.typeName,
|
||||||
|
};
|
||||||
|
lightModeSettings(data).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.currentMainMode = this.pendingMainMode;
|
||||||
|
this.selectedItemIndex = selectedItem;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
uni.hideLoading();
|
||||||
|
this.lightModeA = false;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (this.selectedItemIndex === null) return;
|
||||||
|
const selectedItem = this.items[this.selectedItemIndex];
|
||||||
|
let data = {
|
||||||
|
deviceId: this.computedDeviceId,
|
||||||
|
instructValue: selectedItem.instructValue,
|
||||||
|
deviceImei: this.itemInfo.deviceImei,
|
||||||
|
typeName: this.itemInfo.typeName,
|
||||||
|
};
|
||||||
|
auxiliaryLightModeSettings(data).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.currentSubMode = this.pendingMainMode;
|
||||||
|
this.selectedItemIndex = selectedItem;
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
uni.hideLoading();
|
||||||
|
this.lightModeA = false;
|
||||||
|
} else {
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
uni.hideLoading();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
this.lightModeA = false
|
this.lightModeA = false
|
||||||
},
|
},
|
||||||
// 上传开机画面
|
// 上传开机画面
|
||||||
@ -605,7 +708,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
uni.uploadFile({
|
uni.uploadFile({
|
||||||
url: baseURL + '/app/device/uploadLogo',
|
url: baseURL + '/app/bjq6075/device/uploadLogo',
|
||||||
filePath: this.selectedImage,
|
filePath: this.selectedImage,
|
||||||
name: 'file',
|
name: 'file',
|
||||||
formData: {
|
formData: {
|
||||||
@ -1136,7 +1239,17 @@
|
|||||||
margin-left: 40rpx;
|
margin-left: 40rpx;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.callpolice {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-radius: 16rpx;
|
||||||
|
background: rgba(224, 52, 52, 1);
|
||||||
|
padding: 15rpx;
|
||||||
|
margin-bottom: 15rpx;
|
||||||
|
color: #fff;
|
||||||
|
line-height: 35rpx;
|
||||||
|
font-size: 26rpx;
|
||||||
|
}
|
||||||
.example-body {
|
.example-body {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
|||||||
@ -536,6 +536,7 @@
|
|||||||
},
|
},
|
||||||
// 灯光模式的确认
|
// 灯光模式的确认
|
||||||
handleSumbit() {
|
handleSumbit() {
|
||||||
|
|
||||||
if (this.deviceInfo.onlineStatus !== 1) {
|
if (this.deviceInfo.onlineStatus !== 1) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '设备已离线',
|
title: '设备已离线',
|
||||||
|
|||||||
@ -2,11 +2,11 @@ import config from '../config/index.js';
|
|||||||
export const env = 'production'; //production development //开发of线上 改这里就行
|
export const env = 'production'; //production development //开发of线上 改这里就行
|
||||||
const BASE = config[env];
|
const BASE = config[env];
|
||||||
const request = (options) => {
|
const request = (options) => {
|
||||||
console.log("options"+JSON.stringify(options),BASE.BASE_URL)
|
console.log("options" + JSON.stringify(options), BASE.BASE_URL)
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// 处理GET请求参数
|
// 处理GET请求参数
|
||||||
let url = BASE.BASE_URL + options.url;
|
let url = BASE.BASE_URL + options.url;
|
||||||
console.log("url"+url)
|
console.log("url" + url)
|
||||||
if (options.method === 'GET' && options.data) {
|
if (options.method === 'GET' && options.data) {
|
||||||
// 使用qs序列化参数
|
// 使用qs序列化参数
|
||||||
const params = Object.keys(options.data)
|
const params = Object.keys(options.data)
|
||||||
@ -22,11 +22,29 @@ const request = (options) => {
|
|||||||
header: options.header || {},
|
header: options.header || {},
|
||||||
timeout: 30000,
|
timeout: 30000,
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
// console.log("res=",res);
|
console.log(res, 'resss');
|
||||||
|
if (res.data.code === 401) {
|
||||||
|
uni.removeStorageSync('token');
|
||||||
|
uni.removeStorageSync('clientID');
|
||||||
|
uni.showToast({
|
||||||
|
title: '登录已过期,请重新登录',
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000,
|
||||||
|
complete: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pages/common/login/index'
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// 返回一个pending的Promise,中断当前的Promise链
|
||||||
|
return new Promise(() => { });
|
||||||
|
}
|
||||||
resolve(res.data);
|
resolve(res.data);
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log("ex=",err);
|
console.log("ex=", err);
|
||||||
reject(err);
|
reject(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -48,5 +66,5 @@ const request = (options) => {
|
|||||||
// 导出基础URL以便其他地方使用
|
// 导出基础URL以便其他地方使用
|
||||||
export const baseURL = BASE.BASE_URL;
|
export const baseURL = BASE.BASE_URL;
|
||||||
export const getToken = () => uni.getStorageSync('token'); // 获取token的方法
|
export const getToken = () => uni.getStorageSync('token'); // 获取token的方法
|
||||||
export const clientid =() => uni.getStorageSync('clientID');
|
export const clientid = () => uni.getStorageSync('clientID');
|
||||||
export default request;
|
export default request;
|
||||||
Reference in New Issue
Block a user