增加高德地图页面

This commit is contained in:
fengerli
2025-07-14 10:24:02 +08:00
parent cabd3c0987
commit 2772db349a
8 changed files with 454 additions and 328 deletions

View File

@ -97,6 +97,12 @@
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/common/map/index",
"style": {
"navigationBarTitleText": "地图"
}
}
],

View File

@ -1,241 +0,0 @@
<template>
<view>
<!-- 使用自定义导航栏 -->
<custom-navbar :title="navTitle" :showBack="true" backgroundColor="#202020" color="#FFFFFF" right-text="编辑"
right-color="rgba(255, 255, 255, 0.87)" @right-click="handleEdit"></custom-navbar>
<view class="device-page" :style="{ paddingTop: navBarHeight + 'px' }">
<scroll-view scroll-y>
<uni-swipe-action >
<block v-for="(item, index) in videoList" :key="index">
<uni-swipe-action-item :right-options="item.showConfirm ? confirmOptions : deleteOptions"
@click="handleSwipeClick($event, index)" class="content">
<view class="image-box" @click="openVideoUrl(item.url)">
<view class="deviceIMG">
<image src="/static/images/video.png" mode="" class="video"></image>
</view>
<view class="">
<view class="file-title">{{item.title}}</view>
<view class="file-baidu">{{item.url}}</view>
</view>
</view>
<image src="/static/images/cires.png" class="circle"></image>
</uni-swipe-action-item>
</block>
</uni-swipe-action>
</scroll-view>
<view class="content1" @click="addvideo">
<image src="/static/images/path1.png" class="path1"></image>
</view>
</view>
</view>
</template>
<script>
import {
listOperationVideos,
deleteOperationVideo
} from '@/api/common/operationVideo/index.js'
export default {
data() {
return {
navTitle: '操作视频',
navBarHeight: 70 + uni.getSystemInfoSync().statusBarHeight,
videoList: [{
id: 1,
title: '使用教程1',
url: 'https://www.bilibili.com/variety/?spm_id_from=333.1007.0.0',
showConfirm: false
},
{
id: 2,
title: '使用教程2',
url: 'www.baidu.com',
showConfirm: false
},
{
id: 3,
title: '使用教程3',
url: 'www.baidu.com',
showConfirm: false
},
{
id: 4,
title: '使用教程4',
url: 'www.baidu.com',
showConfirm: false
},
{
id: 5,
title: '使用教程5',
url: 'www.baidu.com',
showConfirm: false
}
],
deleteOptions: [{
text: '编辑',
style: {
backgroundColor: 'rgb(224, 147, 25)',
borderRadius: '16px 0 0 16px',
width: '160rpx',
},
},
{
text: '删除',
style: {
backgroundColor: 'rgb(240, 60, 60)',
borderRadius: '0 16px 16px 0',
width: '160rpx',
},
}
],
confirmOptions: [{
text: '确认删除',
style: {
backgroundColor: 'rgb(240, 60, 60)',
borderRadius: '16px',
width: '280rpx',
fontSize: '30rpx',
}
}]
}
},
methods: {
// 导航栏编辑按钮
handleEdit() {
uni.showToast({
title: '点击了导航栏编辑',
icon: 'none'
});
},
// 添加视频
addvideo() {
uni.navigateTo({
url: '/pages/6170/addvideo/index'
})
},
// 处理滑动按钮点击
handleSwipeClick(e, index) {
const {
content
} = e;
// 如果是确认删除操作
if (content.text === '确认删除') {
this.videoList.splice(index, 1);
uni.showToast({
title: '删除成功',
icon: 'success'
});
return;
}
// 编辑操作
if (content.text === '编辑') {
this.editVideo(this.videoList[index].id);
}
// 删除操作
else if (content.text === '删除') {
// 只修改当前项的选项为确认删除
this.$set(this.videoList[index], 'showConfirm', true);
// 关闭其他项的确认状态
this.videoList.forEach((item, i) => {
if (i !== index && item.showConfirm) {
this.$set(this.videoList[i], 'showConfirm', false);
}
});
}
},
// 编辑视频
editVideo(id) {
uni.navigateTo({
url: `/pages/6170/editVideo/index?id=${id}`
});
},
// 打开视频URL
openVideoUrl(url) {
console.log(url, 'url333');
// 检查URL是否包含协议头如果没有则添加https://
let fullUrl = url;
if (!url.startsWith('http://') && !url.startsWith('https://')) {
fullUrl = 'https://' + url;
}
//APP跳转方式
if (plus) {
plus.runtime.openURL(fullUrl, function(err) {
uni.showToast({
title: '打开链接失败',
icon: 'none'
});
});
}
},
}
}
</script>
<style scoped>
/* 页面整体样式 */
.device-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background-color: rgb(18, 18, 18);
padding: 30rpx;
}
.content {
background: rgb(26, 26, 26);
border-radius: 16rpx;
align-items: center;
box-sizing: border-box;
margin-bottom: 30rpx;
position: relative;
}
.content1 {
height: 160rpx;
background: rgb(26, 26, 26);
border-radius: 16rpx;
text-align: center;
line-height: 200rpx;
}
.image-box {
display: flex;
align-items: center;
padding: 30rpx;
}
.video {
width: 56rpx;
height: 56rpx;
margin-right: 20rpx;
}
.file-title {
color: rgba(255, 255, 255, 0.87);
font-size: 32rpx;
}
.file-baidu {
color: rgba(255, 255, 255, 0.6);
}
.path1 {
width: 62rpx;
height: 62rpx;
}
.circle {
width: 10rpx;
height: 50rpx;
position: absolute;
right: 40rpx;
top: 50rpx;
}
</style>

View File

@ -16,7 +16,7 @@
<view class="sendFlex">
<view class="callpolice">报警</view>
<view class="Sendmessage">位置</view>
<view class="Sendmessage" @click="location">位置</view>
<view class="Sendmessage" @click="handleSend">发送信息</view>
</view>
@ -356,6 +356,12 @@
url: '/pages/common/send/index'
})
},
// 位置
location(){
uni.navigateTo({
url:'/pages/common/map/index'
})
},
handleFile(item) {
console.log(item, 'item');
// communicationMode 0是4G 1是蓝牙
@ -374,7 +380,7 @@
this.page = 1;
this.finished = false;
this.getData(); // 重新加载第一页数据
}
},
},
onShow() {
this.getTab()

View File

@ -0,0 +1,38 @@
<template>
<view class="page-section page-section-gap">
<map class="map" :latitude="latitude" :longitude="longitude" :customMapStyle="amapStyle" :show-location="true"
:markers="covers">
</map>
</view>
</template>
<script>
export default {
data() {
return {
id: 0, // 使用 marker点击事件 需要填写id
title: 'map',
latitude: 39.909,
longitude: 116.39742,
covers: [{
latitude: 39.909,
longitude: 116.39742,
}],
amapStyle: {
}
}
},
methods: {
}
}
</script>
<style>
.map {
width: 100%;
height: 100vh;
}
</style>

View File

@ -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/common/operationVideo/index","pages/common/addvideo/index","pages/common/operatingInstruct/index","pages/common/productDes/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/common/operationVideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/addvideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/operatingInstruct/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/productDes/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6155/index","meta":{},"window":{"navigationBarTitleText":"6155"}},{"path":"/pages/6155/bluetooth/bluetooth","meta":{},"window":{"navigationStyle":"custom"}}];
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/common/operationVideo/index","pages/common/addvideo/index","pages/common/operatingInstruct/index","pages/common/productDes/index","pages/6155/index","pages/6155/bluetooth/bluetooth","pages/common/map/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.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/common/operationVideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/addvideo/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/operatingInstruct/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/productDes/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/6155/index","meta":{},"window":{"navigationBarTitleText":"6155"}},{"path":"/pages/6155/bluetooth/bluetooth","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/common/map/index","meta":{},"window":{"navigationBarTitleText":"地图"}}];
__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}}}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
const BASE_URL = 'http://192.168.2.34:8000';
const BASE_URL = 'http://192.168.2.23:8000';
const request = (options) => {
return new Promise((resolve, reject) => {
// 处理GET请求参数