设备列表,设备绑定,删除,修改设备名
35
api/common/index.js
Normal file
@ -0,0 +1,35 @@
|
||||
import request from '@/utils/request'
|
||||
import qs from 'qs'
|
||||
// 设备列表
|
||||
export function deviceInfo(params) {
|
||||
return request({
|
||||
url: '/app/device/list',
|
||||
method: 'GET',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// APP用户设备类型列表
|
||||
export function deviceTypeList(params) {
|
||||
return request({
|
||||
url: '/app/device/typeList',
|
||||
method: 'get',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
// 删除设备列表接口
|
||||
export function deviceUnbind(data) {
|
||||
return request({
|
||||
url: '/app/device/unBind',
|
||||
method: 'DELETE',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
// 重命名设备
|
||||
export function deviceReName(data) {
|
||||
return request({
|
||||
url: '/app/device/reName',
|
||||
method: 'POST',
|
||||
data: data,
|
||||
})
|
||||
}
|
@ -2,7 +2,7 @@ import request from '@/utils/request'
|
||||
// APP设备入库绑定
|
||||
export function deviceBind(data) {
|
||||
return request({
|
||||
url: '/api/app/device/bind',
|
||||
url: '/app/device/bind',
|
||||
method: 'POST',
|
||||
data: data
|
||||
})
|
||||
|
@ -23,7 +23,8 @@
|
||||
{{ rightText }}
|
||||
</text>
|
||||
<!-- 或显示图标 -->
|
||||
<image v-if="rightIcon" @click="handleRightClick" src="/static/images/path.png" mode="" class="pathIMG">
|
||||
<image v-if="rightIcon" :src="rightIcon" @click="handleRightClick" mode=""
|
||||
class="pathIMG">
|
||||
</image>
|
||||
</slot>
|
||||
</view>
|
||||
@ -49,8 +50,8 @@
|
||||
},
|
||||
rightText: String, // 右侧文字
|
||||
rightIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
type: String, // 改为 String 类型,接收图片路径
|
||||
default: '' // 默认空字符串
|
||||
},
|
||||
rightColor: { // 右侧内容颜色
|
||||
type: String,
|
||||
|
10
pages.json
@ -1,5 +1,6 @@
|
||||
{
|
||||
"pages": [{
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/common/login/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
@ -88,7 +89,14 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "6155"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/6155/bluetooth/bluetooth",
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#fff",
|
||||
|
257
pages/6155/bluetooth/bluetooth.vue
Normal file
@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view class="">
|
||||
<custom-navbar :showBack="true"></custom-navbar>
|
||||
<view class="pageContent" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<view class="scanner">
|
||||
<view class="pulse"></view>
|
||||
<view class="device-name">
|
||||
<!-- <image src="/static/images/svgg.png" class="bluth"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="device">我的设备</view>
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
||||
<!-- 设备卡片内容保持不变 -->
|
||||
<view @click.stop="handleFile(item)" class="device-card">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<!-- <image src="/static/images/bip.png" mode="" class="IMG"></image> -->
|
||||
</view>
|
||||
<view class="device-name1">
|
||||
<view>设备:001-00</view>
|
||||
<view class="ID">
|
||||
<view>ID:0222222</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
<view class="device">其他设备</view>
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<block v-for="(item, index) in 3" :key="index" :ref="'swipeItem_' + index">
|
||||
<!-- 设备卡片内容保持不变 -->
|
||||
<view @click.stop="handleFile(item)" class="device-card">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<!-- <image src="/static/images/bip.png" mode="" class="IMG"></image> -->
|
||||
</view>
|
||||
<view class="device-name1">
|
||||
<view>设备:001-00</view>
|
||||
<view class="ID">
|
||||
<view>ID:0222222</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 这里可以添加数据绑定
|
||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||
deviceList:[{}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 扫描
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pageContent {
|
||||
min-height: 100vh;
|
||||
background-color: rgb(18, 18, 18);
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
.scanner {
|
||||
position: relative;
|
||||
width: 600rpx;
|
||||
height: 600rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 设备名称 */
|
||||
.device-name {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
width: 104rpx;
|
||||
height: 104rpx;
|
||||
background: rgba(187, 230, 0, 1);
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bluth {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
}
|
||||
|
||||
/* 脉冲波纹效果 */
|
||||
.pulse {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
border: 1px solid rgba(206, 242, 49, 0.05);
|
||||
background: rgba(206, 242, 49, 0.05);
|
||||
animation: pulse 4s infinite cubic-bezier(0.2, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
/* 通过伪元素创建4层波纹 */
|
||||
.pulse::before,
|
||||
.pulse::after,
|
||||
.pulse .ripple-1,
|
||||
.pulse .ripple-2 {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
border-radius: 50%;
|
||||
background: rgba(187, 230, 0, 0.4);
|
||||
border: 1px solid rgba(206, 242, 49, 0.04);
|
||||
animation: inherit;
|
||||
}
|
||||
|
||||
.pulse::before {
|
||||
animation-delay: 1s;
|
||||
}
|
||||
|
||||
.pulse::after {
|
||||
animation-delay: 2s;
|
||||
}
|
||||
|
||||
.pulse .ripple-1 {
|
||||
animation-delay: 0.5s;
|
||||
}
|
||||
|
||||
.pulse .ripple-2 {
|
||||
animation-delay: 1.5s;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0% {
|
||||
transform: scale(0.1);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
70% {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
.device {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
/* 设备卡片 */
|
||||
.device-card {
|
||||
background-color: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
margin-bottom: 20rpx;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.device-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 15rpx;
|
||||
padding: 30rpx 0 10rpx 30rpx;
|
||||
}
|
||||
|
||||
.device-name1 {
|
||||
font-size: 32rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
margin-left:40rpx;
|
||||
line-height: 50rpx;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.ID {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 26rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
}
|
||||
|
||||
.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:25rpx;
|
||||
top:85rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.device-id {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
margin-bottom: 20rpx;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.device-info {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
position: relative;
|
||||
padding: 0rpx 0rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.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:38rpx;
|
||||
height: 80rpx;
|
||||
margin-left: 17%;
|
||||
}
|
||||
</style>
|
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 使用自定义导航栏 -->
|
||||
<custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF" :rightIcon=true
|
||||
right-color="rgba(255, 255, 255, 0.87)" @right-click="uploadStartup"></custom-navbar>
|
||||
<custom-navbar :title="navTitle" :showBack="true" color="#FFFFFF" rightIcon="/static/images/path.png"
|
||||
@right-click="uploadStartup"></custom-navbar>
|
||||
<view class="device-detail-container" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<!-- 设备电量信息 -->
|
||||
<view class="battery-section">
|
||||
|
@ -1,10 +1,29 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 使用自定义导航栏 -->
|
||||
<custom-navbar :title="navTitle" :showBack="false" backgroundColor="#202020" color="#FFFFFF" right-text="发送信息"
|
||||
right-color="rgba(255, 255, 255, 0.87)" @right-click="handleSend"></custom-navbar>
|
||||
<custom-navbar :title="navTitle" :showBack="false" backgroundColor="#202020" color="#FFFFFF"
|
||||
rightIcon="/static/images/add.png" @right-click="scan"></custom-navbar>
|
||||
<view class="device-page" :style="{ paddingTop: navBarHeight + 'px' }">
|
||||
<scroll-view class="device-list" scroll-y>
|
||||
<!-- handleSend 发送信息 -->
|
||||
|
||||
<scroll-view class="tab-bar" scroll-x="true" scroll-with-animation>
|
||||
<view class="tab-container">
|
||||
<view v-for="(tab, index) in tabs" :key="index"
|
||||
:class="['tab-item', activeTab === index ? 'active' : '']" @click="switchTab(tab,index)">
|
||||
{{tab.typeName}}
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="sendFlex">
|
||||
<view>
|
||||
<image src="/static/images/gprs.png" class="gprs"></image>
|
||||
</view>
|
||||
<view class="callpolice">报警</view>
|
||||
<view class="Sendmessage" @click="handleSend">发送信息</view>
|
||||
</view>
|
||||
|
||||
<scroll-view class="device-list" scroll-y @scrolltolower="onScrollToLower" :lower-threshold="100"
|
||||
style="height:80vh;">
|
||||
<uni-swipe-action ref="swipeAction">
|
||||
<block v-for="(item, index) in deviceList" :key="index" :ref="'swipeItem_' + index">
|
||||
<uni-swipe-action-item :right-options="Options" @click="handleSwipeClick($event, item, index)"
|
||||
@ -13,15 +32,17 @@
|
||||
<view @click.stop="handleFile(item)">
|
||||
<view class="device-header">
|
||||
<view class="deviceIMG">
|
||||
<image src="/static/images/device.png" mode="" class="IMG"></image>
|
||||
<image :src="item.devicePic" class="IMG"></image>
|
||||
</view>
|
||||
<view class="device-name">
|
||||
<view>设备:001-00</view>
|
||||
<view class="ID">ID:0222222</view>
|
||||
<view>设备:{{item.deviceName}}</view>
|
||||
<view class="ID" v-if="item.communicationMode==0">ID:{{item.deviceImei}}</view>
|
||||
<view class="ID" v-else>ID:{{item.deviceMac}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="device-status online">已连接</view>
|
||||
<view class="device-info">
|
||||
<!-- <view class="device-status online">已连接</view> -->
|
||||
<view class="device-status unline">未连接</view>
|
||||
<view class="device-info" v-if="item.communicationMode==0">
|
||||
<text class="onlines">在线</text>
|
||||
<text class="line"></text>
|
||||
<text>电量:90%</text>
|
||||
@ -31,8 +52,10 @@
|
||||
</uni-swipe-action-item>
|
||||
</block>
|
||||
</uni-swipe-action>
|
||||
<view class="device-uplod" @click="scan">
|
||||
<uni-icons type="plusempty" size="60" color="rgba(255, 255, 255, 0.5)"></uni-icons>
|
||||
<!-- 加载状态提示 -->
|
||||
<view class="loading-status">
|
||||
<text v-if="loading">加载中...</text>
|
||||
<text v-if="finished">没有更多数据了</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@ -47,7 +70,6 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
|
||||
<view class="popup-buttons">
|
||||
<button class="btn agreeBtn" @click="handleBtn">确定</button>
|
||||
</view>
|
||||
@ -60,14 +82,24 @@
|
||||
<view>
|
||||
<view class="popup-flex">
|
||||
<text>设备名称</text>
|
||||
<input type="text" placeholder="请输入设备名称" class="popup-input" />
|
||||
<input type="text" v-model="deviceName" placeholder="请输入设备名称" class="popup-input" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 按钮组 -->
|
||||
|
||||
<view class="popup-buttons" style="margin-top:50rpx;">
|
||||
<button class="btn agreeBtn4" @click="handleBtn">确定</button>
|
||||
<button class="btn agreeBtn4" @click="handleBtnName">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 小提示框 -->
|
||||
<view class="tooltip-box" v-if="showTooltip">
|
||||
<view class="tooltip-arrow"></view>
|
||||
<view class="tooltip-content">
|
||||
<view class="tooltip-item" v-for="(item, index) in menuItems" :key="index"
|
||||
@click="handleMenuClick(item)">
|
||||
<image :src="item.icon" class="item-icon" />
|
||||
<text>{{ item.text }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -75,11 +107,20 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
deviceTypeList,
|
||||
deviceInfo,
|
||||
deviceUnbind, //删除设备
|
||||
deviceReName
|
||||
} from '@/api/common/index.js'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
|
||||
deviceList:[],
|
||||
deviceList: [],
|
||||
tabs: [],
|
||||
activeTab: 0,
|
||||
showTooltip: false,
|
||||
Options: [{
|
||||
text: '重命名',
|
||||
style: {
|
||||
@ -99,15 +140,110 @@
|
||||
],
|
||||
navTitle: "我的设备",
|
||||
deleteShow: false,
|
||||
RenameModel: false
|
||||
RenameModel: false,
|
||||
menuItems: [{
|
||||
text: '扫一扫添加',
|
||||
icon: '/static/images/scane.png',
|
||||
action: 'scan'
|
||||
},
|
||||
{
|
||||
text: '蓝牙添加',
|
||||
icon: '/static/images/bluetooth.png',
|
||||
action: 'bluetooth'
|
||||
}
|
||||
],
|
||||
page: 1, // 当前页码
|
||||
size:10, // 每页条数
|
||||
total: 0, // 总数据量
|
||||
loading: false,
|
||||
finished: false,
|
||||
deviceId: '',
|
||||
deviceName: "" //重命名
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
scan() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/scan/scan'
|
||||
// tab导航切换栏
|
||||
getTab() {
|
||||
deviceTypeList({}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.tabs = [{
|
||||
id: '',
|
||||
name: '全部设备',
|
||||
typeName: '全部设备'
|
||||
},
|
||||
...res.data.map(item => ({
|
||||
id: item.id,
|
||||
name: item.typeName,
|
||||
typeName: item.typeName,
|
||||
communicationMode: item.communicationMode
|
||||
}))
|
||||
];
|
||||
}
|
||||
})
|
||||
},
|
||||
// tab切换页
|
||||
switchTab(tab, index) {
|
||||
this.deviceList = [];
|
||||
this.activeTab = index;
|
||||
this.page = 1; // 重置页码
|
||||
this.finished = false; // 重
|
||||
// 明确传递参数,空字符串改为null或undefined
|
||||
const deviceType = tab.id === '' ? undefined : tab.id;
|
||||
this.getData(deviceType);
|
||||
},
|
||||
// 获取设备列表
|
||||
getData(deviceType = '') {
|
||||
if (this.loading || this.finished) return;
|
||||
this.loading = true;
|
||||
let data = {
|
||||
pageNum: this.page,
|
||||
pageSize: this.size,
|
||||
deviceType: deviceType // 使用传入的设备类型
|
||||
}
|
||||
deviceInfo(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
const newDevices = res.rows.map(device => ({
|
||||
...device,
|
||||
showConfirm: false
|
||||
}));
|
||||
|
||||
// 如果是第一页或切换分类,替换数据
|
||||
this.deviceList = this.page === 1 ? newDevices : [...this.deviceList, ...newDevices];
|
||||
this.total = res.total;
|
||||
// 判断是否加载完成
|
||||
if (res.rows.length < this.size || this.deviceList.length >= this.total) {
|
||||
this.finished = true;
|
||||
} else {
|
||||
this.page++;
|
||||
}
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 滚动触底事件处理
|
||||
onScrollToLower() {
|
||||
this.getData();
|
||||
},
|
||||
scan() {
|
||||
this.showTooltip = !this.showTooltip;
|
||||
},
|
||||
|
||||
handleMenuClick(item) {
|
||||
this.showTooltip = false; // 关闭弹窗
|
||||
switch (item.action) {
|
||||
case 'scan':
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/scan/scan'
|
||||
});
|
||||
break;
|
||||
case 'bluetooth':
|
||||
uni.navigateTo({
|
||||
url: '/pages/6155/bluetooth/bluetooth'
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
// 右滑点击事件处理
|
||||
handleSwipeClick(e, item, index) {
|
||||
const {
|
||||
@ -122,23 +258,71 @@
|
||||
this.handleRenameDevice(item, index)
|
||||
break
|
||||
};
|
||||
|
||||
},
|
||||
// 删除设备
|
||||
handleDeleteDevice(item, index) {
|
||||
this.deviceId = item
|
||||
this.deleteShow = true
|
||||
uni.hideTabBar()
|
||||
},
|
||||
// 确认删除
|
||||
handleBtn() {
|
||||
this.deleteShow = false,
|
||||
uni.showTabBar()
|
||||
uni.showTabBar()
|
||||
let data = {
|
||||
id: this.deviceId.id
|
||||
}
|
||||
deviceUnbind(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.onIntall();
|
||||
}, 500);
|
||||
this.deleteShow = false
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 重命名设备
|
||||
handleRenameDevice(item, index) {
|
||||
this.RenameModel = true
|
||||
uni.hideTabBar()
|
||||
this.deviceId = item
|
||||
},
|
||||
handleBtnName() {
|
||||
uni.showTabBar()
|
||||
let data = {
|
||||
id: this.deviceId.id,
|
||||
deviceName: this.deviceName
|
||||
}
|
||||
deviceReName(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.onIntall();
|
||||
}, 500);
|
||||
this.RenameModel = false
|
||||
this.deviceName = ''
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
duration: 1000
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 发生短信
|
||||
handleSend() {
|
||||
@ -146,14 +330,32 @@
|
||||
url: '/pages/common/send/index'
|
||||
})
|
||||
},
|
||||
handleFile() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/6170/deviceControl/index'
|
||||
})
|
||||
handleFile(item) {
|
||||
console.log(item, 'item');
|
||||
// communicationMode 0是4G 1是蓝牙
|
||||
if (item.communicationMode == 0) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/6170/deviceControl/index'
|
||||
})
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/6155/index'
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
onIntall() {
|
||||
this.page = 1;
|
||||
this.finished = false;
|
||||
this.deviceList = [];
|
||||
this.getData(); // 重新加载第一页数据
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getTab()
|
||||
this.onIntall()
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -167,10 +369,67 @@
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
/* 设备列表 */
|
||||
.device-list {
|
||||
/* flex: 1; */
|
||||
/* padding: 20rpx; */
|
||||
.tab-bar {
|
||||
width: 100%;
|
||||
color: rgb(255, 255, 255);
|
||||
white-space: nowrap;
|
||||
/* 禁止换行 */
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.tab-container {
|
||||
display: flex;
|
||||
/* justify-content: space-around; */
|
||||
cursor: pointer;
|
||||
margin-bottom: 40rpx;
|
||||
/* min-width: 100%; */
|
||||
/* 最小宽度 */
|
||||
}
|
||||
|
||||
.tab-item {
|
||||
font-size: 28rpx;
|
||||
/* min-width: 120rpx; */
|
||||
padding: 0 30rpx; /* 左右内边距 */
|
||||
text-align: center; /* 文字居中 */
|
||||
/* 设置最小宽度 */
|
||||
}
|
||||
|
||||
.active {
|
||||
color: rgba(187, 230, 0, 1);
|
||||
border-bottom: 6rpx solid rgba(187, 230, 0, 1);
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
.sendFlex {
|
||||
display: flex;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
justify-content: flex-end;
|
||||
cursor: pointer;
|
||||
margin-bottom: 30rpx;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.gprs{
|
||||
width:28rpx;
|
||||
height:35rpx;
|
||||
position: absolute;
|
||||
left:50rpx
|
||||
}
|
||||
|
||||
.Sendmessage {
|
||||
margin-left: 50rpx;
|
||||
border: 1px solid rgba(187, 230, 0, 0.4);
|
||||
border-radius: 20px;
|
||||
padding: 7rpx 20rpx;
|
||||
color: rgba(187, 230, 0, 1);
|
||||
}
|
||||
.callpolice{
|
||||
border: 1px solid rgba(224, 52, 52, 0.4);
|
||||
border-radius: 20px;
|
||||
color: rgba(224, 52, 52, 1);
|
||||
width: 150rpx;
|
||||
text-align: center;
|
||||
padding: 5rpx 10rpx;
|
||||
}
|
||||
|
||||
/* 设备卡片 */
|
||||
@ -192,7 +451,7 @@
|
||||
}
|
||||
|
||||
.device-name {
|
||||
font-size: 32rpx;
|
||||
font-size: 28rpx;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
margin-left: 24rpx;
|
||||
line-height: 50rpx;
|
||||
@ -200,7 +459,7 @@
|
||||
|
||||
.ID {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
font-size: 26rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.device-status {
|
||||
@ -217,17 +476,21 @@
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 10rpx;
|
||||
height: 50rpx;
|
||||
width: 8rpx;
|
||||
height: 40rpx;
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 100rpx;
|
||||
top: 80rpx;
|
||||
}
|
||||
|
||||
.online {
|
||||
color: rgb(187, 230, 0);
|
||||
}
|
||||
|
||||
.unline {
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
}
|
||||
|
||||
.device-id {
|
||||
font-size: 26rpx;
|
||||
color: #999;
|
||||
@ -281,6 +544,13 @@
|
||||
margin-top: 12rpx;
|
||||
}
|
||||
|
||||
.loading-status {
|
||||
text-align: center;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
padding: 20rpx;
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.device-uplod {
|
||||
background-color: rgb(26, 26, 26);
|
||||
border-radius: 16rpx;
|
||||
@ -401,4 +671,49 @@
|
||||
background-color: rgba(35, 35, 35, 0.87);
|
||||
color: rgba(255, 255, 255, 1);
|
||||
}
|
||||
|
||||
/* 提示框样式 */
|
||||
.tooltip-box {
|
||||
position: fixed;
|
||||
right: 18rpx;
|
||||
top: 140rpx;
|
||||
/* 根据导航栏高度调整 */
|
||||
z-index: 9999;
|
||||
}
|
||||
|
||||
.tooltip-arrow {
|
||||
width: 0;
|
||||
height: 0;
|
||||
border-left: 8px solid transparent;
|
||||
border-right: 8px solid transparent;
|
||||
border-bottom: 8px solid #333;
|
||||
position: absolute;
|
||||
right: 12px;
|
||||
top: -8px;
|
||||
}
|
||||
|
||||
.tooltip-content {
|
||||
border-radius: 8rpx;
|
||||
backdrop-filter: blur(14px);
|
||||
background: rgba(58, 58, 58, 1);
|
||||
padding: 10px 0;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
.tooltip-item {
|
||||
padding: 8px 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tooltip-item text {
|
||||
margin-left: 8px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
</style>
|
@ -106,8 +106,7 @@
|
||||
title: '验证码已发送',
|
||||
icon: 'none'
|
||||
})
|
||||
} catch (error) {
|
||||
}
|
||||
} catch (error) {}
|
||||
},
|
||||
// 勾选同意
|
||||
toggleCheck() {
|
||||
@ -136,7 +135,7 @@
|
||||
return false
|
||||
}
|
||||
try {
|
||||
|
||||
|
||||
uni.showLoading({
|
||||
title: '登录中...'
|
||||
})
|
||||
@ -151,16 +150,14 @@
|
||||
if (res.code == 200) {
|
||||
uni.hideLoading()
|
||||
uni.setStorageSync('token', res.data.access_token) // 缓存token
|
||||
uni.setStorageSync('clientID', res.data.client_id) // 缓存token
|
||||
uni.showToast({
|
||||
title: '登录成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 跳转到首页
|
||||
setTimeout(() => {
|
||||
uni.switchTab({
|
||||
url: '/pages/common/index/index'
|
||||
})
|
||||
}, 800)
|
||||
uni.switchTab({
|
||||
url: '/pages/common/index/index'
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
|
@ -15,8 +15,8 @@
|
||||
<text class="device-name">设备名:CLI</text>
|
||||
<text class="device-model1">ID:{{deviceId}}</text>
|
||||
</view>
|
||||
<view class="connecting-line" v-if="isConnecting && !isConnected">连接中...</view>
|
||||
<view class="connecting-success" v-if="isConnected">设备绑定成功</view>
|
||||
<view class="connecting-line" v-if="isConnectNo">连接中...</view>
|
||||
<view class="connecting-success" v-if="isSuccess">设备绑定成功</view>
|
||||
</view>
|
||||
<view class="btn-bottom">
|
||||
<button class="login-btn" @click="handleConnect">
|
||||
@ -27,18 +27,26 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {deviceBind} from "@/api/common/qrcode.js"
|
||||
import {
|
||||
deviceBind
|
||||
} from "@/api/common/qrcode.js"
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
deviceId: '',
|
||||
isConnecting: false, // 是否正在连接
|
||||
isConnected: false // 是否连接成功
|
||||
isConnected: false ,// 是否连接成功
|
||||
isConnectNo:false,
|
||||
isSuccess:false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async handleConnect() {
|
||||
if (this.isConnecting) {
|
||||
// 绑定成功,确认按钮跳转到首页
|
||||
uni.switchTab({
|
||||
url: '/pages/common/index/index'
|
||||
})
|
||||
} else {
|
||||
// 开始连接逻辑
|
||||
uni.showLoading({
|
||||
@ -46,27 +54,33 @@
|
||||
title: '加载中....'
|
||||
})
|
||||
this.isConnecting = true;
|
||||
this.isConnectNo=true
|
||||
try {
|
||||
// 调用绑定设备接口
|
||||
await deviceBind({
|
||||
//deviceImei: this.deviceId,
|
||||
deviceIMEI: 'FYS-YF-082-SB',
|
||||
|
||||
const res = await deviceBind({
|
||||
deviceImei: this.deviceId,
|
||||
deviceMac: '',
|
||||
communicationMode: '0', //0是4g,1是蓝牙
|
||||
})
|
||||
|
||||
} catch (error) {
|
||||
}
|
||||
console.log(this.deviceId,'deerer ere');
|
||||
if (res.code == 0) {
|
||||
this.isConnectNo=false
|
||||
this.isSuccess =true
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title: res.data,
|
||||
icon: 'success'
|
||||
});
|
||||
this.isConnecting = true;
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
});
|
||||
}
|
||||
|
||||
} catch (error) {}
|
||||
}
|
||||
},
|
||||
connectSuccess() {
|
||||
uni.hideLoading()
|
||||
// 连接成功后的处理
|
||||
uni.showToast({
|
||||
title: '连接成功',
|
||||
icon: 'success'
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.deviceId) {
|
||||
|
@ -77,6 +77,7 @@
|
||||
uni.showTabBar()
|
||||
// 1. 清除本地存储的 token
|
||||
uni.removeStorageSync('token');
|
||||
uni.removeStorageSync('clientID'); //租户ID
|
||||
uni.showToast({
|
||||
title: '退出成功',
|
||||
icon: 'success'
|
||||
|
BIN
static/images/add.png
Normal file
After Width: | Height: | Size: 125 B |
BIN
static/images/bluetooth.png
Normal file
After Width: | Height: | Size: 265 B |
BIN
static/images/gprs.png
Normal file
After Width: | Height: | Size: 250 B |
BIN
static/images/scane.png
Normal file
After Width: | Height: | Size: 228 B |
@ -1,8 +1,8 @@
|
||||
|
||||
var isReady=false;var onReadyCallbacks=[];
|
||||
var isServiceReady=false;var onServiceReadyCallbacks=[];
|
||||
var __uniConfig = {"pages":["pages/common/login/index","pages/common/index/index","pages/common/user/index","pages/common/scan/scan","pages/common/qrcode/qrcode","pages/common/send/index","pages/common/userAgreement/index","pages/common/privacyAgreement/index","pages/common/aboutUs/index","pages/6170/deviceControl/index","pages/6170/operationVideo/index","pages/6170/addvideo/index","pages/6170/editVideo/index","pages/6170/operatingInstruct/index","pages/6155/index"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#121212","backgroundColor":"#121212"},"tabBar":{"color":"#fff","selectedColor":"#BBE600","backgroundColor":"#202020","list":[{"pagePath":"pages/common/index/index","text":"我的设备","iconPath":"/static/tabs/device.png","selectedIconPath":"/static/tabs/device-HL.png"},{"pagePath":"pages/common/user/index","text":"我的","iconPath":"/static/tabs/my.png","selectedIconPath":"/static/tabs/my-HL.png"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"JingQuan","compilerVersion":"4.66","entryPagePath":"pages/common/login/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/common/login/index","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/common/scan/scan","meta":{},"window":{"navigationBarTitleText":"扫描"}},{"path":"/pages/common/qrcode/qrcode","meta":{},"window":{"navigationBarTitleText":"扫描到的设备"}},{"path":"/pages/common/send/index","meta":{},"window":{"navigationBarTitleText":"发送信息"}},{"path":"/pages/common/userAgreement/index","meta":{},"window":{"navigationBarTitleText":"用户协议"}},{"path":"/pages/common/privacyAgreement/index","meta":{},"window":{"navigationBarTitleText":"隐私协议"}},{"path":"/pages/common/aboutUs/index","meta":{},"window":{"navigationBarTitleText":"关于我们"}},{"path":"/pages/6170/deviceControl/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6170/operationVideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6170/addvideo/index","meta":{},"window":{"navigationBarTitleText":"添加"}},{"path":"/pages/6170/editVideo/index","meta":{},"window":{"navigationBarTitleText":"编辑视频"}},{"path":"/pages/6170/operatingInstruct/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6155/index","meta":{},"window":{"navigationBarTitleText":"6155"}}];
|
||||
var __uniConfig = {"pages":["pages/common/login/index","pages/common/index/index","pages/common/user/index","pages/common/scan/scan","pages/common/qrcode/qrcode","pages/common/send/index","pages/common/userAgreement/index","pages/common/privacyAgreement/index","pages/common/aboutUs/index","pages/6170/deviceControl/index","pages/6170/operationVideo/index","pages/6170/addvideo/index","pages/6170/editVideo/index","pages/6170/operatingInstruct/index","pages/6155/index","pages/6155/bluetooth/bluetooth"],"window":{"navigationBarTextStyle":"white","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#121212","backgroundColor":"#121212"},"tabBar":{"color":"#fff","selectedColor":"#BBE600","backgroundColor":"#202020","list":[{"pagePath":"pages/common/index/index","text":"我的设备","iconPath":"/static/tabs/device.png","selectedIconPath":"/static/tabs/device-HL.png"},{"pagePath":"pages/common/user/index","text":"我的","iconPath":"/static/tabs/my.png","selectedIconPath":"/static/tabs/my-HL.png"}]},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"JingQuan","compilerVersion":"4.64","entryPagePath":"pages/common/login/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
|
||||
var __uniRoutes = [{"path":"/pages/common/login/index","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/index/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/user/index","meta":{"isQuit":true,"isTabBar":true},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/common/scan/scan","meta":{},"window":{"navigationBarTitleText":"扫描"}},{"path":"/pages/common/qrcode/qrcode","meta":{},"window":{"navigationBarTitleText":"扫描到的设备"}},{"path":"/pages/common/send/index","meta":{},"window":{"navigationBarTitleText":"发送信息"}},{"path":"/pages/common/userAgreement/index","meta":{},"window":{"navigationBarTitleText":"用户协议"}},{"path":"/pages/common/privacyAgreement/index","meta":{},"window":{"navigationBarTitleText":"隐私协议"}},{"path":"/pages/common/aboutUs/index","meta":{},"window":{"navigationBarTitleText":"关于我们"}},{"path":"/pages/6170/deviceControl/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6170/operationVideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6170/addvideo/index","meta":{},"window":{"navigationBarTitleText":"添加"}},{"path":"/pages/6170/editVideo/index","meta":{},"window":{"navigationBarTitleText":"编辑视频"}},{"path":"/pages/6170/operatingInstruct/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6155/index","meta":{},"window":{"navigationBarTitleText":"6155"}},{"path":"/pages/6155/bluetooth/bluetooth","meta":{},"window":{"navigationStyle":"custom"}}];
|
||||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
|
||||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});
|
||||
|
6359
unpackage/dist/dev/app-plus/app-service.js
vendored
2650
unpackage/dist/dev/app-plus/app-view.js
vendored
2
unpackage/dist/dev/app-plus/manifest.json
vendored
@ -1 +1 @@
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__A21EF43","name":"JingQuan","version":{"name":"1.0.0","code":"100"},"description":"设备管控","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"Barcode":{},"Camera":{},"Maps":{"coordType":"gcj02"},"OAuth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#121212"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"splashscreen":{"useOriginalMsgbox":true,"androidStyle":"common","iosStyle":"common","android":{"hdpi":"static/images/biao.png","xhdpi":"static/images/biao.png","xxhdpi":"static/images/biao.png"}},"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"google":{"permissions":["<uses-permission android:name=\"android.permission.INTERNET\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.a\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\"/>"],"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"minSdkVersion":21},"apple":{"privacyDescription":{"NSBluetoothPeripheralUsageDescription":"需要蓝牙访问权限,用于设备通信","NSBluetoothAlwaysUsageDescription":"需要蓝牙访问权限,用于设备通信"},"dSYMs":false},"plugins":{"geolocation":{},"maps":{},"oauth":{},"push":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#202020","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.66","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#fff","selectedColor":"#BBE600","backgroundColor":"#202020","list":[{"pagePath":"pages/common/index/index","text":"我的设备","iconPath":"/static/tabs/device.png","selectedIconPath":"/static/tabs/device-HL.png"},{"pagePath":"pages/common/user/index","text":"我的","iconPath":"/static/tabs/my.png","selectedIconPath":"/static/tabs/my-HL.png"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px"},"launch_path":"__uniappview.html"},"locale":"auto"}
|
||||
{"@platforms":["android","iPhone","iPad"],"id":"__UNI__A21EF43","name":"JingQuan","version":{"name":"1.0.0","code":"100"},"description":"设备管控","launch_path":"__uniappview.html","developer":{"name":"","email":"","url":""},"permissions":{"Bluetooth":{},"Barcode":{},"Camera":{},"Maps":{"coordType":"gcj02"},"OAuth":{},"UniNView":{"description":"UniNView原生渲染"}},"plus":{"useragent":{"value":"uni-app","concatenate":true},"splashscreen":{"target":"id:1","autoclose":true,"waiting":true,"delay":0},"popGesture":"close","launchwebview":{"id":"1","kernel":"WKWebview"},"statusbar":{"immersed":"supportedDevice","style":"light","background":"#121212"},"usingComponents":true,"nvueStyleCompiler":"uni-app","compilerVersion":3,"distribute":{"splashscreen":{"useOriginalMsgbox":true,"androidStyle":"common","iosStyle":"common","android":{"hdpi":"static/images/biao.png","xhdpi":"static/images/biao.png","xxhdpi":"static/images/biao.png"}},"icons":{"android":{"hdpi":"unpackage/res/icons/72x72.png","xhdpi":"unpackage/res/icons/96x96.png","xxhdpi":"unpackage/res/icons/144x144.png","xxxhdpi":"unpackage/res/icons/192x192.png"},"ios":{"appstore":"unpackage/res/icons/1024x1024.png","ipad":{"app":"unpackage/res/icons/76x76.png","app@2x":"unpackage/res/icons/152x152.png","notification":"unpackage/res/icons/20x20.png","notification@2x":"unpackage/res/icons/40x40.png","proapp@2x":"unpackage/res/icons/167x167.png","settings":"unpackage/res/icons/29x29.png","settings@2x":"unpackage/res/icons/58x58.png","spotlight":"unpackage/res/icons/40x40.png","spotlight@2x":"unpackage/res/icons/80x80.png"},"iphone":{"app@2x":"unpackage/res/icons/120x120.png","app@3x":"unpackage/res/icons/180x180.png","notification@2x":"unpackage/res/icons/40x40.png","notification@3x":"unpackage/res/icons/60x60.png","settings@2x":"unpackage/res/icons/58x58.png","settings@3x":"unpackage/res/icons/87x87.png","spotlight@2x":"unpackage/res/icons/80x80.png","spotlight@3x":"unpackage/res/icons/120x120.png"}}},"google":{"permissions":["<uses-permission android:name=\"android.permission.INTERNET\"/>","<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>","<uses-permission android:name=\"android.permission.VIBRATE\"/>","<uses-permission android:name=\"android.permission.READ_LOGS\"/>","<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>","<uses-feature android:name=\"android.hardware.camera.autofocus\"/>","<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>","<uses-permission android:name=\"android.permission.CAMERA\"/>","<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>","<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>","<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>","<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>","<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>","<uses-feature android:name=\"android.hardware.camera\"/>","<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>","<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>","<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>","<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>","<uses-permission android:name=\"android.permission.a\"/>","<uses-permission android:name=\"android.permission.BLUETOOTH_CONNECT\"/>"],"abiFilters":["armeabi-v7a","arm64-v8a","x86"],"minSdkVersion":21},"apple":{"privacyDescription":{"NSBluetoothPeripheralUsageDescription":"需要蓝牙访问权限,用于设备通信","NSBluetoothAlwaysUsageDescription":"需要蓝牙访问权限,用于设备通信"},"dSYMs":false},"plugins":{"geolocation":{},"maps":{},"oauth":{},"push":{},"audio":{"mp3":{"description":"Android平台录音支持MP3格式文件"}}}},"uniStatistics":{"enable":false},"allowsInlineMediaPlayback":true,"safearea":{"background":"#202020","bottom":{"offset":"auto"}},"uni-app":{"compilerVersion":"4.64","control":"uni-v3","nvueCompiler":"uni-app","renderer":"auto","nvue":{"flex-direction":"column"},"nvueLaunchMode":"normal"},"tabBar":{"color":"#fff","selectedColor":"#BBE600","backgroundColor":"#202020","list":[{"pagePath":"pages/common/index/index","text":"我的设备","iconPath":"/static/tabs/device.png","selectedIconPath":"/static/tabs/device-HL.png"},{"pagePath":"pages/common/user/index","text":"我的","iconPath":"/static/tabs/my.png","selectedIconPath":"/static/tabs/my-HL.png"}],"borderStyle":"rgba(0,0,0,0.4)","height":"50px"},"launch_path":"__uniappview.html"},"locale":"auto"}
|
BIN
unpackage/dist/dev/app-plus/static/images/add.png
vendored
Normal file
After Width: | Height: | Size: 125 B |
BIN
unpackage/dist/dev/app-plus/static/images/bluetooth.png
vendored
Normal file
After Width: | Height: | Size: 265 B |
BIN
unpackage/dist/dev/app-plus/static/images/gprs.png
vendored
Normal file
After Width: | Height: | Size: 250 B |
BIN
unpackage/dist/dev/app-plus/static/images/scane.png
vendored
Normal file
After Width: | Height: | Size: 228 B |
@ -1,35 +1,44 @@
|
||||
import axios from 'axios'
|
||||
const BASE_URL = 'http://192.168.2.23:8001'
|
||||
// 创建 Axios 实例
|
||||
const service = axios.create({
|
||||
baseURL: BASE_URL,
|
||||
timeout: 10000
|
||||
})
|
||||
// 请求拦截器
|
||||
service.interceptors.request.use(
|
||||
config => {
|
||||
console.log('Full Request URL:', config.baseURL + config.url)
|
||||
const token = uni.getStorageSync('token')
|
||||
if (token) {
|
||||
config.headers['Authorization'] = 'Bearer ' + token
|
||||
}
|
||||
config.headers['Content-Type'] = config.headers['Content-Type'] || 'application/json';
|
||||
return config
|
||||
},
|
||||
error => {
|
||||
console.log('Request Error:', error)
|
||||
return Promise.reject(error)
|
||||
}
|
||||
)
|
||||
const BASE_URL = 'http://192.168.2.34:8001';
|
||||
|
||||
// 响应拦截器
|
||||
service.interceptors.response.use(
|
||||
response => {
|
||||
return response.data;
|
||||
},
|
||||
error => {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
const request = (options) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
// 处理GET请求参数
|
||||
let url = BASE_URL + options.url;
|
||||
if (options.method === 'GET' && options.data) {
|
||||
// 使用qs序列化参数
|
||||
const params = Object.keys(options.data)
|
||||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(options.data[key])}`)
|
||||
.join('&');
|
||||
url += `?${params}`;
|
||||
}
|
||||
|
||||
export default service
|
||||
const config = {
|
||||
url: url,
|
||||
method: options.method || 'GET',
|
||||
data: options.method !== 'GET' ? options.data : {},
|
||||
header: options.header || {},
|
||||
timeout: 10000,
|
||||
success: (res) => {
|
||||
resolve(res.data);
|
||||
},
|
||||
fail: (err) => {
|
||||
reject(err);
|
||||
}
|
||||
};
|
||||
|
||||
if (!options.url.includes('/login')) {
|
||||
const token = uni.getStorageSync('token');
|
||||
const clientid = uni.getStorageSync('clientID');
|
||||
if (token) {
|
||||
config.header['Authorization'] = 'Bearer ' + token;
|
||||
config.header['clientid'] = clientid;
|
||||
}
|
||||
}
|
||||
if (!config.header['Content-Type']) {
|
||||
config.header['Content-Type'] = 'application/json';
|
||||
}
|
||||
uni.request(config);
|
||||
});
|
||||
};
|
||||
|
||||
export default request;
|