董国庆
2025-02-25 446fde90c3f6b5ff1e986c5eff7c805346c308c8
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/H5/threeSide
6个文件已修改
650 ■■■■ 已修改文件
H5/pages/Appeal/Appeal.vue 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/components/certificate/certificate.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/index/index.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/list/list.vue 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/location/location.vue 528 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/utils/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/pages/Appeal/Appeal.vue
@@ -4,16 +4,25 @@
            <view class="card  flex a-center h-108 j-between">
                <text class="w-108 fs-27 font-bold mr-85">发生时间</text>
                <view class=" flex a-center j-between flex1" @click="showDate=true">
                    <input v-model="time" disabled placeholder-style="color: rgba(0,0,0,0.3);font-size:27rpx;"
                        class="uni-input flex1" maxlength="10" placeholder="请选择问题发生的时间" />
                    <view class="flex1" v-if="time">
                        {{time}}
                    </view>
                    <view class="flex1" v-else style="color: rgba(0,0,0,0.3);font-size:27rpx;">
                        请选择问题发生的时间
                    </view>
                    <image src="/static/Appeal/left.png" class="w-19 h-19" mode=""></image>
                </view>
            </view>
            <view class="card  flex a-center h-108 j-between">
                <text class="w-108 fs-27 font-bold mr-85">问题类型</text>
                <view class=" flex a-center j-between flex1" @click="showList=true">
                    <input v-model="problemType" disabled placeholder-style="color: rgba(0,0,0,0.3);font-size:27rpx;"
                        class="uni-input flex1" maxlength="10" placeholder="请选择问题类型" />
                    <view class="flex1" v-if="problemType">
                        {{problemType}}
                    </view>
                    <view class="flex1" v-else style="color: rgba(0,0,0,0.3);font-size:27rpx;">
                        请选择问题类型
                    </view>
                    <image src="/static/Appeal/left.png" class="w-19 h-19" mode=""></image>
                </view>
            </view>
@@ -29,11 +38,16 @@
                    class="uni-input flex1" maxlength="11" placeholder="请输入群众联系电话" />
            </view>
            <view class="card  flex a-center h-108 j-between" @click="goTopage">
                <text class="w-108 fs-27 font-bold mr-85">发生地点</text>
            <view class="card  flex a-center h-108 j-between" @click="goTopagelocation()">
                <text class="w-108 fs-27 font-bold mr-85">地点</text>
                <view class=" flex a-center j-between flex1">
                    <input v-model="location" disabled placeholder-style="color: rgba(0,0,0,0.3);font-size:27rpx;"
                        class="uni-input flex1" placeholder="请选择问题发生具体地点" />
                    <view class="flex1" v-if="location">
                        {{location}}
                    </view>
                    <view class="flex1" v-else style="color: rgba(0,0,0,0.3);font-size:27rpx;">
                        请选择问题发生具体地点
                    </view>
                    <image src="/static/Appeal/left.png" class="w-19 h-19" mode=""></image>
                </view>
            </view>
@@ -49,6 +63,7 @@
                        <input v-model="descriptionTitle" placeholder-style="color: rgba(0,0,0,0.3);font-size:27rpx;"
                            class="h-94 pl-31 flex1" placeholder="请输入问题标题" />
                    </view>
                    <textarea name="" v-model="descriptionContent" id="" cols="30" placeholder="请输入问题描述内容"
                        placeholder-style="color: rgba(0, 0, 0, 0.30);font-size:27rpx;" rows="10"></textarea>
                </view>
@@ -172,57 +187,68 @@
                        title: '请选择时间',
                        icon: 'none'
                    })
                    return
                } else if (!this.problemType) {
                    uni.showToast({
                        title: '请选择问题类型',
                        icon: 'none'
                    })
                    return
                } else if (!this.name) {
                    uni.showToast({
                        title: '请输入群众姓名',
                        icon: 'none'
                    })
                    return
                } else if (!this.contactNumber) {
                    uni.showToast({
                        title: '请输入联系电话',
                        icon: 'none'
                    })
                    return
                } else if (!preciseRegex.test(this.contactNumber)) {
                    uni.showToast({
                        title: '请输入正确的手机号',
                        icon: 'none'
                    })
                    return
                } else if (!this.location) {
                    uni.showToast({
                        title: '请选择地点',
                        icon: 'none'
                    })
                    return
                } else if (!this.detailedAddress) {
                    uni.showToast({
                        title: '请输入详细地址',
                        icon: 'none'
                    })
                    return
                } else if (!this.descriptionTitle) {
                    uni.showToast({
                        title: '请输入问题标题',
                        icon: 'none'
                    })
                    return
                } else if (!this.descriptionContent) {
                    uni.showToast({
                        title: '请输入问题描述',
                        icon: 'none'
                    })
                    return
                } else if (this.images == 0) {
                    uni.showToast({
                        title: '请上传图片',
                        icon: 'none'
                    })
                    return
                } else if (this.videos == 0) {
                    uni.showToast({
                        title: '请上传视频',
                        icon: 'none'
                    })
                    return
                }
                const data = {
                    time: this.time,
@@ -269,7 +295,8 @@
                this.showDate = false
                this.showList = false
            },
            goTopage() {
            goTopagelocation() {
                console.log('0000000000000000');
                uni.navigateTo({
                    url: '/pages/location/location'
                })
H5/pages/components/certificate/certificate.vue
@@ -12,7 +12,7 @@
                                <text>身份证号码:</text>
                                <text>所在党组织:</text>
                            </view>
                            <view class="flex flex-column a-end lh-48">
                            <view class="flex flex-column a-end font-bold lh-48">
                                <text>{{info.name}}</text>
                                <text>{{info.idCard}}</text>
                                <text>{{info.partyOrganization}}</text>
H5/pages/index/index.vue
@@ -19,29 +19,37 @@
        </view>
        <view class="pt-38 pl-31 pr-31 flex flex-column">
            <view class="flex j-between a-center">
                <text class="color1">工作台</text>
                <text class="color2" @click="showData =!showData">查看更多</text>
                <text class="color1 fs-31 font-bold">工作台</text>
                <text class="color2 fs-27" @click="showData =!showData">查看更多</text>
            </view>
            <view class="flex flex-wrap j-between">
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center" v-if="member==1" @click="onClick()" >
                    <image class="w-94 h-77 ml-38" src="/static/home/img7.png" mode=""></image>
                    <text class="ml-37 font-bold">党员证</text>
                </view>
                <view class="pt-38 pb-38 bg1 w-333 flex br-19 mt-19 a-center" @click="goTopage()">
                    <image class="w-81 h-77 ml-38" src="/static/home/img4.png" mode=""></image>
                    <text class="ml-37">诉求录入</text>
                    <text class="ml-37 font-bold">诉求录入</text>
                </view>
                <view class="pt-38  pb-38 bg1 w-333 mt-19 br-19 flex a-center" @click="goToList()">
                    <image class="w-81 h-77 ml-38" src="/static/home/img2.png" mode=""></image>
                    <text class="ml-37">诉求列表</text>
                    <text class="ml-37 font-bold ">诉求列表</text>
                </view>
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center">
                    <image class="w-79 h-77 ml-38" src="/static/home/img1.png" mode=""></image>
                    <text class="ml-37">回访评价</text>
                    <text class="ml-37 font-bold">回访评价</text>
                </view>
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center">
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center"  v-if="member==2">
                    <image class="w-81 h-77 ml-38" src="/static/home/img8.png" mode=""></image>
                    <text class="ml-37">统计分析</text>
                    <text class="ml-37 font-bold">统计分析</text>
                </view>
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center" @click="onClick()" v-if="showData">
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center"  v-if="showData&&member==1">
                    <image class="w-81 h-77 ml-38" src="/static/home/img8.png" mode=""></image>
                    <text class="ml-37 font-bold">统计分析</text>
                </view>
                <view class="pt-38 pb-38 bg1 w-333 br-19 mt-19 flex a-center"  @click="onClick()" v-if="showData&&member==2">
                    <image class="w-94 h-77 ml-38" src="/static/home/img7.png" mode=""></image>
                    <text class="ml-37">党员证</text>
                    <text class="ml-37 font-bold">党员证</text>
                </view>
            </view>
@@ -53,18 +61,18 @@
                    <view class="msg mr-19" @click="changeActive(1)" :class="isactive==1? 'active':''">
                        消息
                        <view class="tips">
                            {{msgList.length}}
                            {{noreadlist.length}}
                        </view>
                    </view>
                    <view class="representative" @click="changeActive(2)" :class="isactive==2? 'active':''">
                        待办
                        <view class="tips">
                            {{msgList.length}}
                            {{noreadlists.length}}
                        </view>
                    </view>
                </view>
                <view class="list mt-29">
                    <view class="flex a-center mb-27" v-for="item in msgList" :key="item.id">
                    <view class="flex a-center mb-27" v-for="item in isactive==1?msgList:msgLists" :key="item.id">
                        <view class="avater pb-33">
                            <image class="w-85 h-85 br50" src="/static/home/img9.png" mode=""></image>
                            <view class="tips" v-if="item.readStatus==2">
@@ -74,11 +82,11 @@
                        <view class="border-b flex1 ml-18 pb-33">
                            <view class="fs-31  font-w500 flex  flex1 j-between">
                                <text>{{item.title}}</text>
                                <text class="fs-23 font-w400">{{item.time}}分钟前</text>
                                <text class="fs-23 font-w400">{{item.time}}</text>
                            </view>
                            <view class="fs-27 flex j-between mt-8">
                                <text></text>
                                <text style="color: rgba(102, 102, 102, 1);">{{item.promptType==1?'临期提醒':'超时提醒'}}</text>
                                <view class="read" v-if="item.readStatus==1">已读</view>
                                <view class="noread" v-else>未读</view>
@@ -117,10 +125,13 @@
                pageNum: 1,
                bannerlist: [],
                msgList: [],
                msgLists: [],
                msgListTotal: [],
                member: 1,
                userInfo: {},
                isLoading: false,
                noreadlist: [],
                noreadlists: [],
            }
        },
        onPullDownRefresh() {
@@ -198,13 +209,17 @@
                        // 计算分钟数
                        const minutes = Math.floor(remainingSecondsAfterHours / 60);
                        item.time = days && hours ? `${days} 天 ${hours}小时 ${minutes} ` : !days && hours ?
                            `${hours}小时 ${minutes}` : `${minutes}`
                        item.time = days && hours ? `${days} 天前 ` : !days && hours ?
                            `${hours}小时 ${minutes} 分钟前` : `${minutes} 分钟前`
                        return item
                    })
                    this.msgList = JSON.parse(JSON.stringify(this.msgListTotal)).filter(item => item.promptType ==
                        2)
                    this.msgLists = JSON.parse(JSON.stringify(this.msgListTotal)).filter(item => item.promptType ==
                        1)
                    this.noreadlists = this.msgLists.filter(item => item.readStatus === 0)
                    this.noreadlist = this.msgList.filter(item => item.readStatus === 0)
                    console.log(this.msgListTotal, 'this.msgListTotal');
                })
            },
@@ -212,11 +227,14 @@
                this.isactive = value
                if (value == 1) {
                    this.msgList = JSON.parse(JSON.stringify(this.msgListTotal)).filter(item => item.promptType == 2)
                this.noreadlist = this.msgList.filter(item => item.readStatus === 0)
                } else {
                    this.msgList = JSON.parse(JSON.stringify(this.msgListTotal)).filter(item => item.promptType == 1)
                    this.msgLists = JSON.parse(JSON.stringify(this.msgListTotal)).filter(item => item.promptType == 1)
                    this.noreadlists = this.msgLists.filter(item => item.readStatus === 0)
                }
            },
            change() {
                console.log('1111');
H5/pages/list/list.vue
@@ -71,11 +71,11 @@
                </view>
                <view class="mt-27 ml-40 mr-40 br-19 bgColor4 pt-34 pb-34 fs-27 pl-27 pr-27 flex a-center j-between">
                    <text>{{ item.location || '' }}</text>
                    <image src="../../static/position@2x.png" mode="aspectFill" class="w-31 h-31 ml-10 shrink0"></image>
                    <image src="../../static/position@2x.png" class="w-31 h-31 ml-10 shrink0"></image>
                </view>
                <view class="ml-40 mr-40 mt-31 flex j-between a-center fs-27 txt-center">
                    <view class="">
                        <view class="">
                        <view class="font-bold">
                            问题类型
                        </view>
                        <view class="tip">
@@ -83,7 +83,7 @@
                        </view>
                    </view>
                    <view class="">
                        <view class="">
                        <view class="font-bold">
                            群众姓名
                        </view>
                        <view class="mt-10">
@@ -91,7 +91,7 @@
                        </view>
                    </view>
                    <view class="">
                        <view class="">
                        <view class="font-bold">
                            联系电话
                        </view>
                        <view class="mt-10">
@@ -100,7 +100,7 @@
                    </view>
                </view>
                <view v-if="item.status != '3'" class="fs-27 mt-31 ml-40 mr-40">
                    <view class="">
                    <view class="font-bold">
                        问题描述
                    </view>
                    <view class="mt-10 lh-38">
@@ -108,7 +108,7 @@
                    </view>
                </view>
                <view v-if="item.status != '3' && item.images" class="fs-27 mt-31 ml-40">
                    <view class="">
                    <view class="font-bold">
                        描述图片
                    </view>
                    <view class="mt-19 flex wrap a-center">
@@ -123,8 +123,8 @@
                    <view class="txt-center fs-23 mt-27 color6">
                        创建时间:{{ item.createTime | formatTime }}
                    </view>
                    <view v-if="!['3','5'].includes(item.status)" class="flex a-center j-center fs-23 mt-29 txt-center">
                        <view @click="addProgress(item.id)" class="h-58 lh-58 bgColor5 w-192 br-29 color7">
                    <view v-if="!(['3','5','7'].includes(item.status))" class="flex a-center j-center fs-23 mt-29 txt-center">
                        <view @click="addProgress(item.id)" class="h-58 lh-58 bgColor5 w-192 br-29 color10">
                            添加办理进度
                        </view>
                        <view @click="addResult(item.id)" class="ml-38 h-58 lh-58 bgColor6 w-192 br-29 color8">
@@ -266,6 +266,7 @@
    .tip {
        height: 40rpx;
        background-color: #FFFBE6;
        border: 2rpx solid #FFF1B8;
        border-radius: 8rpx;
        color: #FAAD14;
        text-align: center;
@@ -319,6 +320,10 @@
    .color9 {
        color: #999999;
    }
    .color10 {
        color: #636363;
    }
    .bgColor1 {
        background: linear-gradient(270deg, #FFB318 0%, #FF330D 100%);
H5/pages/location/location.vue
@@ -1,260 +1,270 @@
<template>
    <view class="content">
        <u-navbar title="选择地点" bgColor="transparent" titleStyle="font-size: 35rpx;font-weight:bold;" placeholder>
            <view slot="left" @click="back">
                <image src="/static/location/back.png" class="w-19 h-35" mode=""></image>
            </view>
        </u-navbar>
        <view class="" id="container">
        </view>
        <view class=" main">
            <view class="searchMain  mb-35 mt-38">
                <view class="search fs-27 ">
                    <text class="mr-35 ml-50">{{ city }}</text>
                    <image class="w-17 h-8 mr-35" src="/static/location/toleft.png" mode=""></image>
                    <image class="w-31 h-31 mr-13" src="/static/location/search.png" mode=""></image>
                    <input class="flex1" v-model="keyword" placeholder="搜索小区/写字楼等"
                        placeholder-style="font-size:27rpx"></input>
                    <view class="sure" @click="searchLocation">
                        确定
                    </view>
                </view>
            </view>
            <view class="card" @click="changeAdr(item.id,item)" :class="item.id ==uid ?'activecard':''"
                v-for="item in locationList" :key="item.id">
                <text>{{item.address}}</text>
                <text class="font-w500 fs-23 mt-25" style="color: rgba(0, 0, 0, 0.6);">{{item.address}}</text>
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                latitude: 39.909,
                longitude: 116.39742,
                map: null,
                uid: 0,
                keyword: '',
                locationList: [],
                city: '攀枝花市'
            };
        },
        methods: {
            back() {
                uni.navigateBack()
            },
            changeAdr(value, addr) {
                console.log(value, addr, 'asdasdada');
                this.uid = value
                const pages = getCurrentPages()
                let prevPage = pages[pages.length - 2];
                prevPage.location = addr.address
                prevPage.latitude = addr.point.lat
                prevPage.longitude = addr.point.lng
                setTimeout(() => {
                    uni.navigateBack()
                }, 200)
            },
            // 搜索地点
            searchLocation() {
                if (!this.keyword) return;
                uni.request({
                    url: `https://api.map.baidu.com/place/v2/search`,
                    method: 'GET',
                    data: {
                        query: this.keyword,
                        location: `${this.latitude},${this.longitude }`,
                        radius: 10000, // 搜索半径,单位:米
                        output: 'json',
                        ak: '3mHKIXMArjgIkgADzOlTYp4XssNSNkwr' // 替换为你自己的 AK
                    },
                    success: (res) => {
                        console.log(res, '-------');
                        if (res.data.status === 0) {
                            this.searchResults = res.data.results;
                            this.latitude = res.data.results[0].location.lat
                            this.longitude = res.data.results[0].location.lng
                            this.locationList = res.data.results.map((result, index) => {
                                result.id = index + 1
                                return result
                            });
                        }
                    },
                    fail: (err) => {
                        console.error('搜索失败:', err);
                    }
                });
            },
        },
        onLoad() {
        },
        onReady() {
            this.map = new BMapGL.Map("container"); // 创建地图实例
            console.log(this.map);
            // uni.getLocation({
            //     type: 'wgs84',
            //     success: (res) => {
            navigator.geolocation.getCurrentPosition(success, error, options);
            function success(position) {
                const latitude = position.coords.latitude;
                const longitude = position.coords.longitude;
                const accuracy = position.coords.accuracy; // 精度,单位米
                console.log(`纬度: ${latitude}, 经度: ${longitude}, 精度: ${accuracy}`);
                //  在这里可以使用获取到的经纬度信息,例如在地图上显示位置等。
            }
            function error(err) {
                console.log(err);
                switch (err.code) {
                    case err.PERMISSION_DENIED:
                        console.error("用户拒绝了位置请求。");
                        break;
                    case err.POSITION_UNAVAILABLE:
                        console.error("无法获取位置信息。");
                        break;
                    case err.TIMEOUT:
                        console.error("位置请求超时。");
                        break;
                    default:
                        console.error("未知错误。");
                }
            }
            const options = {
                enableHighAccuracy: true, // 启用高精度定位
                timeout: 5000, // 5 秒超时
                maximumAge: 0 //  不使用缓存
            };
            let res = {
                longitude: 101.725544,
                latitude: 26.587259
            }
            this.longitude = res.longitude;
            this.latitude = res.latitude;
            var point = new BMapGL.Point(res.longitude, res.latitude); // 创建点坐标
            this.map.enableScrollWheelZoom(true);
            this.map.centerAndZoom(point, 12);
            var marker = new BMapGL.Marker(point);
            this.map.addOverlay(marker);
            var myGeo = new BMapGL.Geocoder();
            // 根据坐标得到地址描述
            myGeo.getLocation(new BMapGL.Point(res.longitude, res.latitude), (result) => {
                this.locationList = result.surroundingPois.map((item, index) => {
                    item.id = index + 1
                    return item
                })
            })
            this.map.addEventListener('click', (e) => {
                var mercator = this.map.lnglatToMercator(e.latlng.lng, e.latlng.lat);
                this.latitude = e.latlng.lat
                this.longitude = e.latlng.lng
                var point = new BMapGL.Point(e.latlng.lng, e.latlng.lat);
                this.map.centerAndZoom(point, 12);
                var myGeo = new BMapGL.Geocoder();
                // 根据坐标得到地址描述
                myGeo.getLocation(new BMapGL.Point(e.latlng.lng, e.latlng.lat), (result) => {
                    console.log(result, 'result');
                    this.locationList = result.surroundingPois.map((item, index) => {
                        item.id = index + 1
                        return item
                    })
                })
                var marker = new BMapGL.Marker(point);
                this.map.addOverlay(marker);
            });
            // },
            // error:err=>{
            //     console.log(err,'err');
            // }
            // });
        }
    }
</script>
<style lang="scss" scoped>
    #container {
        width: 100vw;
        height: 534rpx;
    }
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        .main {
            background-color: #fff;
            border-radius: 34rpx;
            position: absolute;
            top: 517rpx;
            z-index: 100;
            .activecard {
                background: #F2F2F2;
            }
        }
    }
    .searchMain {
        padding-left: 40rpx;
        padding-right: 40rpx;
        border-radius: 40rpx;
        .search {
            width: 669rpx;
            height: 77rpx;
            background: #FFFFFF;
            border-radius: 38rpx;
            border: 2rpx solid #DADADA;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
    }
    .sure {
        width: 104rpx;
        height: 69rpx;
        background: linear-gradient(270deg, #FC8D55 0%, #FF4948 100%);
        border-radius: 48rpx;
        font-weight: 500;
        font-size: 23rpx;
        color: #FFFFFF;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .card {
        display: flex;
        flex-direction: column;
        font-weight: 800;
        font-size: 31rpx;
        color: rgba(0, 0, 0, 0.8);
        padding: 34rpx 38rpx 33rpx 38rpx;
        background: #fff;
        border-bottom: 2rpx solid rgba(0, 10, 26, 0.07);
    }
<template>
    <view class="content">
        <u-navbar title="选择地点" bgColor="transparent" titleStyle="font-size: 35rpx;font-weight:bold;" placeholder>
            <view slot="left" @click="back">
                <image src="/static/location/back.png" class="w-19 h-35" mode=""></image>
            </view>
        </u-navbar>
        <view class="" id="container">
        </view>
        <view class=" main">
            <view class="searchMain  mb-35 mt-38">
                <view class="search fs-27 ">
                    <text class="mr-35 ml-50">{{ city }}</text>
                    <image class="w-17 h-8 mr-35" src="/static/location/toleft.png" mode=""></image>
                    <image class="w-31 h-31 mr-13" src="/static/location/search.png" mode=""></image>
                    <input class="flex1" v-model="keyword" placeholder="搜索小区/写字楼等"
                        placeholder-style="font-size:27rpx"></input>
                    <view class="sure" @click="searchLocation">
                        确定
                    </view>
                </view>
            </view>
            <view class="card" @click="changeAdr(item.id,item)" :class="item.id ==uid ?'activecard':''"
                v-for="item in locationList" :key="item.id">
                <text>{{item.address}}</text>
                <text class="font-w500 fs-23 mt-25" style="color: rgba(0, 0, 0, 0.6);">{{item.address}}</text>
            </view>
        </view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
                latitude: 39.909,
                longitude: 116.39742,
                map: null,
                uid: 0,
                keyword: '',
                locationList: [],
                city: '攀枝花市',
                markers:[],
            };
        },
        methods: {
 clearMarkers() {
            // 清除所有标点
            this.markers.forEach((marker) => {
                this.map.removeOverlay(marker);
            });
            this.markers = []; // 清空存储标点的数组
        },
            back() {
                uni.navigateBack()
            },
            changeAdr(value, addr) {
                console.log(value, addr, 'asdasdada');
                this.uid = value
                const pages = getCurrentPages()
                let prevPage = pages[pages.length - 2];
                prevPage.location = addr.address
                prevPage.latitude = addr.point.lat
                prevPage.longitude = addr.point.lng
                setTimeout(() => {
                    uni.navigateBack()
                }, 200)
            },
            // 搜索地点
            searchLocation() {
                if (!this.keyword) return;
                uni.request({
                    url: `https://api.map.baidu.com/place/v2/search`,
                    method: 'GET',
                    data: {
                        query: this.keyword,
                        location: `${this.latitude},${this.longitude }`,
                        radius: 10000, // 搜索半径,单位:米
                        output: 'json',
                        ak: '3mHKIXMArjgIkgADzOlTYp4XssNSNkwr' // 替换为你自己的 AK
                    },
                    success: (res) => {
                        console.log(res, '-------');
                        if (res.data.status === 0) {
                            this.searchResults = res.data.results;
                            this.latitude = res.data.results[0].location.lat
                            this.longitude = res.data.results[0].location.lng
                            this.locationList = res.data.results.map((result, index) => {
                                result.id = index + 1
                                return result
                            });
                        }
                    },
                    fail: (err) => {
                        console.error('搜索失败:', err);
                    }
                });
            },
        },
        onLoad() {
        },
        onReady() {
            this.map = new BMapGL.Map("container"); // 创建地图实例
            console.log(this.map);
            // uni.getLocation({
            //     type: 'wgs84',
            //     success: (res) => {
            navigator.geolocation.getCurrentPosition(success, error, options);
            function success(position) {
                const latitude = position.coords.latitude;
                const longitude = position.coords.longitude;
                const accuracy = position.coords.accuracy; // 精度,单位米
                console.log(`纬度: ${latitude}, 经度: ${longitude}, 精度: ${accuracy}`);
                //  在这里可以使用获取到的经纬度信息,例如在地图上显示位置等。
            }
            function error(err) {
                console.log(err);
                switch (err.code) {
                    case err.PERMISSION_DENIED:
                        console.error("用户拒绝了位置请求。");
                        break;
                    case err.POSITION_UNAVAILABLE:
                        console.error("无法获取位置信息。");
                        break;
                    case err.TIMEOUT:
                        console.error("位置请求超时。");
                        break;
                    default:
                        console.error("未知错误。");
                }
            }
            const options = {
                enableHighAccuracy: true, // 启用高精度定位
                timeout: 5000, // 5 秒超时
                maximumAge: 0 //  不使用缓存
            };
            let res = {
                longitude: 101.725544,
                latitude: 26.587259
            }
            this.longitude = res.longitude;
            this.latitude = res.latitude;
            var point = new BMapGL.Point(res.longitude, res.latitude); // 创建点坐标
            this.map.enableScrollWheelZoom(true);
            this.map.centerAndZoom(point, 12);
            var marker = new BMapGL.Marker(point);
            this.map.addOverlay(marker);
            this.markers.push(marker);
            var myGeo = new BMapGL.Geocoder();
            // 根据坐标得到地址描述
            myGeo.getLocation(new BMapGL.Point(res.longitude, res.latitude), (result) => {
                this.locationList = result.surroundingPois.map((item, index) => {
                    item.id = index + 1
                    return item
                })
            })
            this.map.addEventListener('click', (e) => {
                this.clearMarkers()
                var mercator = this.map.lnglatToMercator(e.latlng.lng, e.latlng.lat);
                this.latitude = e.latlng.lat
                this.longitude = e.latlng.lng
                var point = new BMapGL.Point(e.latlng.lng, e.latlng.lat);
                this.map.centerAndZoom(point, 12);
                var myGeo = new BMapGL.Geocoder();
                // 根据坐标得到地址描述
                myGeo.getLocation(new BMapGL.Point(e.latlng.lng, e.latlng.lat), (result) => {
                    console.log(result, 'result');
                    this.locationList = result.surroundingPois.map((item, index) => {
                        item.id = index + 1
                        return item
                    })
                })
                var marker = new BMapGL.Marker(point);
                this.map.addOverlay(marker);
                this.markers.push(marker);
            });
            // },
            // error:err=>{
            //     console.log(err,'err');
            // }
            // });
        }
    }
</script>
<style lang="scss" scoped>
    #container {
        width: 100vw;
        height: 534rpx;
    }
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        .main {
            background-color: #fff;
            border-radius: 34rpx;
            position: absolute;
            top: 517rpx;
            z-index: 100;
            .activecard {
                background: #F2F2F2;
            }
        }
    }
    .searchMain {
        padding-left: 40rpx;
        padding-right: 40rpx;
        border-radius: 40rpx;
        .search {
            width: 669rpx;
            height: 77rpx;
            background: #FFFFFF;
            border-radius: 38rpx;
            border: 2rpx solid #DADADA;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
    }
    .sure {
        width: 104rpx;
        height: 69rpx;
        background: linear-gradient(270deg, #FC8D55 0%, #FF4948 100%);
        border-radius: 48rpx;
        font-weight: 500;
        font-size: 23rpx;
        color: #FFFFFF;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .card {
        display: flex;
        flex-direction: column;
        font-weight: 800;
        font-size: 31rpx;
        color: rgba(0, 0, 0, 0.8);
        padding: 34rpx 38rpx 33rpx 38rpx;
        background: #fff;
        border-bottom: 2rpx solid rgba(0, 10, 26, 0.07);
    }
</style>
H5/utils/request.js
@@ -20,7 +20,7 @@
    return new Promise(function(resolve, reject) {
        let token =
            'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0ODk0OTc5Nzk5NDA4NjUsInR5cGUiOjEsImV4cCI6MTc0MDQ2NjQ3MCwiY3JlYXRlZCI6MTc0MDM4MDA3MDQzN30.oOlB8GBE50WmV4Kw-Uuy33rQpQ-homoJQ61QXs34rkQIr-jFlAn9dUOgebitI9bz5PUaFImSldhY6vokRjmYlg'
            'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjU2MDYyLCJ0eXBlIjoxLCJleHAiOjE3NDE3MDU5MTgsImNyZWF0ZWQiOjE3NDA0MDk5MTg3MDF9.k9ck3gWfVElSCl1uUI_5fZ3lEbFgtbQs_OaJku4I4bXoUO77kUnHsghkPBFdRknFHa49fTdAEdHn0wsb_XN5tg'
        //党员 eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0ODk0OTc5Nzk5NDA4NjUsInR5cGUiOjEsImV4cCI6MTc0MDQ2NjQ3MCwiY3JlYXRlZCI6MTc0MDM4MDA3MDQzN30.oOlB8GBE50WmV4Kw-Uuy33rQpQ-homoJQ61QXs34rkQIr-jFlAn9dUOgebitI9bz5PUaFImSldhY6vokRjmYlg
        // 社区  eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE1OTAxNzYwNTgxNTY1NDgwOTgsInR5cGUiOjEsImV4cCI6MTc0MTcwNTE1OSwiY3JlYXRlZCI6MTc0MDQwOTE1OTEwMH0.AmeZFq2Pj2y2bRF1AolsRWHA4ehobBdx1-LtQHIJzub8WjEh_TxZ-PTEI7uiujlLWKhJE07PCVCggAdeuF3UIA
        // 市  eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOjE4OTI0MjE4MjgwODU4Mzc4MjYsInR5cGUiOjEsImV4cCI6MTc0MTY5ODg0OCwiY3JlYXRlZCI6MTc0MDQwMjg0ODMzN30.7IYRD37yTkhqcnKyXWcqKk_iTisMp3ar_ByfuVR7Go9rK8ZnGJrlwC3z4NF_ly7IIoBHgE2E4IAvfm3ccam8wg