Squashed commit of the following:
commitf9e9899e0eAuthor: 浅念 <email@sample.com> Date: Fri Mar 28 11:10:56 2025 +0800 设置默认语言为英语 commit303121ba81Author: 浅念 <email@sample.com> Date: Fri Mar 28 11:00:05 2025 +0800 调用接口调整 commit37e0e55d96Author: 浅念 <email@sample.com> Date: Fri Mar 28 10:33:48 2025 +0800 线上接口地址 commit11dd7de521Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:54:52 2025 +0800 修改样式 commit8ceb98b321Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:47:04 2025 +0800 隐藏我的名片 commitf58e712684Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:44:43 2025 +0800 样式调整 commit54ad6c9e37Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:35:21 2025 +0800 修改语言包 commit526f934a75Author: 浅念 <email@sample.com> Date: Thu Mar 27 16:13:47 2025 +0800 标签功能 commit8583ff2543Author: 浅念 <email@sample.com> Date: Wed Mar 26 17:02:04 2025 +0800 标签管理页面 commitbe8674fd51Author: 浅念 <email@sample.com> Date: Tue Mar 25 17:29:37 2025 +0800 样式调整 commita5d5ce4e7cAuthor: 浅念 <email@sample.com> Date: Tue Mar 25 17:23:40 2025 +0800 倒计时组件 commitf88048b876Author: 浅念 <email@sample.com> Date: Tue Mar 25 17:19:43 2025 +0800 首页添加跟进提醒 commitf9a39d5aaaAuthor: 浅念 <email@sample.com> Date: Tue Mar 25 13:13:39 2025 +0800 提交 commite3abe0bf18Author: 浅念 <email@sample.com> Date: Tue Mar 25 13:12:24 2025 +0800 名片部分页面。地图定位。国家下拉搜索 回收站
This commit is contained in:
+110
-16
@@ -117,21 +117,38 @@
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showmagnitude" @cancel="cancel('showmagnitude')" @close="close('showmagnitude')" :columns="magnitudeList" keyName="name" @confirm="magnitudeChange"></u-picker>
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showcartype" @cancel="cancel('showcartype')" @close="close('showcartype')" :columns="carTypeList" keyName="name" @confirm="cartypesChange"></u-picker>
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showgrade" @cancel="cancel('showgrade')" @close="close('showgrade')" :columns="getGradeList" keyName="name" @confirm="gradeHandler"></u-picker>
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showarea" @cancel="cancel('showarea')" @close="close('showarea')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker>
|
||||
|
||||
<!-- <u-popup :show="showmap" :round="10" mode="bottom" @close="mapclose" width="90%" height="70%">
|
||||
<view class="mapcont">
|
||||
<view class="header">
|
||||
<view class="cancel" @click="mapclose">取消</view>
|
||||
<view class="title">地图位置</view>
|
||||
<view class="confirm" @click="mapconfirm">确定</view>
|
||||
</view>
|
||||
<view class="map" id="map">
|
||||
</view>
|
||||
<!-- <u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="showarea" @cancel="cancel('showarea')" @close="close('showarea')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker> -->
|
||||
<!-- 国家选择 -->
|
||||
<u-popup closeOnClickOverlay :show="showarea" mode="bottom" :round="10" @close="close('showarea')">
|
||||
<view class="text">
|
||||
<view class="qx" @click="close('showarea') ">{{$t('cancel')}}</view>
|
||||
<view class="qd" @click="arerfn">{{$t('confirm')}}</view>
|
||||
</view>
|
||||
</u-popup> -->
|
||||
|
||||
<view class="popup-content">
|
||||
<!-- 搜索框 -->
|
||||
<u-input
|
||||
v-model="searchKeyword"
|
||||
:placeholder="$t('keyword')"
|
||||
@input="handleSearch"
|
||||
></u-input>
|
||||
|
||||
<!-- 选项列表 -->
|
||||
<scroll-view scroll-y class="option-list">
|
||||
<view
|
||||
v-for="(item, index) in filteredOptions"
|
||||
:key="index"
|
||||
class="option-item"
|
||||
@click="handleSelect(item)"
|
||||
:class="actives==item.id?'actives':''"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view v-if="filteredOptions.length === 0" class="no-data">
|
||||
{{$t('noresults')}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-popup>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
@@ -140,7 +157,13 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mapUrl: '',
|
||||
actives:'',
|
||||
activetags:'',
|
||||
searchKeyword: "", // 搜索关键词
|
||||
selectedLabel: "", // 选中的值(显示在输入框中)
|
||||
filteredOptions: [], // 过滤后的数据
|
||||
mapUrl: '',
|
||||
showtag: false,
|
||||
showmap: false,
|
||||
showmagnitude: false,
|
||||
showgrade: false,
|
||||
@@ -172,7 +195,9 @@
|
||||
lat:'',
|
||||
lng:'',
|
||||
},
|
||||
location:{}
|
||||
location:{},
|
||||
activeMap: {}, // 存储每个父级下选中的子项 { 父ID: 子ID }
|
||||
taglist:[]
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@@ -259,7 +284,8 @@
|
||||
method:'get',
|
||||
}).then(res => {
|
||||
var list = res.data.data
|
||||
this.areaList = [list]
|
||||
this.areaList = list
|
||||
this.filteredOptions = list;
|
||||
})
|
||||
},
|
||||
//商机
|
||||
@@ -302,6 +328,31 @@
|
||||
this.car_type_name = val.value[0].name
|
||||
this.showcartype = false
|
||||
},
|
||||
// 国家搜索处理函数
|
||||
handleSearch() {
|
||||
if (this.searchKeyword) {
|
||||
console.log(this.searchKeyword)
|
||||
this.filteredOptions = this.areaList.filter((item) =>
|
||||
item.name.includes(this.searchKeyword)
|
||||
);
|
||||
console.log(this.filteredOptions)
|
||||
} else {
|
||||
// 如果搜索框为空,显示全部数据
|
||||
this.filteredOptions = this.areaList;
|
||||
}
|
||||
},
|
||||
// 选择选项
|
||||
handleSelect(item) {
|
||||
this.selectedLabel = item.name; // 回显选中的值
|
||||
this.actives = item.id
|
||||
console.log("选中的值:", item.id);
|
||||
console.log("选中的值:", item.name);
|
||||
},
|
||||
arerfn(){
|
||||
this.showarea = false; // 关闭弹窗
|
||||
this.country_name = this.selectedLabel
|
||||
this.form.country_id = this.actives
|
||||
},
|
||||
cancel(val){
|
||||
this[val] = false
|
||||
},
|
||||
@@ -436,4 +487,47 @@
|
||||
height: 350px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
.actives{
|
||||
background-color: #dfdfdf;
|
||||
}
|
||||
.text{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
line-height: 30px;
|
||||
padding: 10px 15px 0px;
|
||||
.qd{
|
||||
color: #3471FF;
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.option-list {
|
||||
max-height: 400rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.option-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
+234
-29
@@ -14,19 +14,43 @@
|
||||
<view class="cont">
|
||||
<view class="title">
|
||||
<view class=""><text class="name">{{datas.phone}}</text></view>
|
||||
<view class="ststus">渠道:{{datas.channel_name}}</view>
|
||||
<view class="ststus" v-if="datas.channel_name!=''">{{$t('channel')}}:{{datas.channel_name}}</view>
|
||||
</view>
|
||||
<view class="info"><text class="sex">{{datas.sex_txt}}</text> | <text class="addr">{{datas.country_name}}</text><text class="type">{{datas.car_type_name}}</text>
|
||||
</view>
|
||||
<view v-if="datas.email!=''">Email: {{datas.email}}</view>
|
||||
<view v-if="datas.WhatsApp!=''">WhatsAPP: {{datas.WhatsApp}}</view>
|
||||
<view v-if="datas.address!=''">公司: {{datas.address}}</view>
|
||||
<view v-if="datas.describe!=''">备注: {{datas.describe}}</view>
|
||||
<view v-if="datas.address!=''">{{$t('customer.Company')}}: {{datas.address}}</view>
|
||||
<view v-if="datas.describe!=''">{{$t('remarks')}}: {{datas.describe}}</view>
|
||||
</view>
|
||||
<view class="edt">
|
||||
<!-- <view class="btn" @click="showtag = true"><image src="/static/image/customer/tagadd.png" mode=""></image><text> {{$t('addtag')}}</text></view> -->
|
||||
<view class="btn" @click="editFn"><image src="/static/image/customer/edit.png" mode=""></image><text> {{$t('edtbtn')}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cells">
|
||||
<view class="top">
|
||||
<view class="item">{{$t('CustomerProfile')}}</view>
|
||||
<view class="right">
|
||||
<view class="btn"@click="showtag = true"><image src="/static/image/customer/tagadd.png" mode=""></image><text> {{$t('addtag')}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="datas.tags.length>0">
|
||||
<view class="conts" :class="{'expandeds':!expanded}">
|
||||
<view class="tags" v-for="(item, index) in datas.tags" :key="index">{{item.name}}</view>
|
||||
</view>
|
||||
<view class="toggle" @click="expanded = !expanded">
|
||||
<text >
|
||||
{{ expanded ? $t('retract') : $t('expand') }}
|
||||
</text>
|
||||
<u-icon v-if="expanded" class="arrowright" name="arrow-up" size="16" color="#999999"></u-icon>
|
||||
<u-icon v-else class="arrowright" name="arrow-down" size="16" color="#999999"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="nones">
|
||||
{{$t('CustomerProfilemag')}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell">
|
||||
<view class="item">{{$t('customer.Cstomerfj')}}</view>
|
||||
<view class="right select" @click="showgrade = true">
|
||||
@@ -47,26 +71,36 @@
|
||||
</view>
|
||||
</view>
|
||||
<u-steps v-if="followList.length>0" :current="followList.length" direction="column" dot>
|
||||
<u-steps-item :title="item.type_txt" v-for="(item, index) in followList" :key="index">
|
||||
<u-steps-item :title="item.type==1? $t('customer.Online') : $t('customer.Visit') " v-for="(item, index) in followList" :key="index">
|
||||
<view slot="desc" class="desc">
|
||||
<view class="" v-if="item.type==0">
|
||||
<view class="flex" v-if="item.type==0">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<view class="lingh">
|
||||
{{$t('times')}} :{{item.created_at}}
|
||||
</view>
|
||||
<view class="">{{$t('address')}}:{{item.address}}</view>
|
||||
<view class="">{{$t('customer.Visitcontent')}}:{{item.audio_text}}</view>
|
||||
<view class="lingh">{{$t('customer.Visitcontent')}}:{{item.audio_text}}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<image :src="item.oss_picture" mode=""></image>
|
||||
<!-- <image :src="item.oss_picture" mode=""></image> -->
|
||||
<u-album
|
||||
:urls="isurls(item.oss_picture)"
|
||||
:singleSize="80"
|
||||
keyName="src"
|
||||
></u-album>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<view class="">
|
||||
<view class="lingh">
|
||||
{{$t('times')}}:{{item.created_at}}
|
||||
</view>
|
||||
<view class="">
|
||||
<image :src="item.oss_picture" mode=""></image>
|
||||
<u-album
|
||||
:urls="isurls(item.oss_picture)"
|
||||
keyName="src"
|
||||
:singleSize="80"
|
||||
></u-album>
|
||||
<!-- <image :src="item.oss_picture" mode=""></image> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -75,23 +109,27 @@
|
||||
<empty :list="followList"></empty>
|
||||
</view>
|
||||
<view class="zw"></view>
|
||||
<!-- <view class="foot">
|
||||
<button class="btn" @click="nextFn">{{$t('submit')}}</button>
|
||||
</view> -->
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexfj" :show="showgrade" @cancel="cancel('showgrade')" @close="close('showgrade')" :columns="getGradeList" keyName="name" @confirm="gradeHandler"></u-picker>
|
||||
|
||||
<!-- <u-popup :show="showmap" :round="10" mode="bottom" @close="mapclose">
|
||||
<view class="mapcont">
|
||||
<view class="header">
|
||||
<view class="cancel" @click="mapclose">取消</view>
|
||||
<view class="title">地图位置</view>
|
||||
<view class="confirm" @click="mapconfirm">确定</view>
|
||||
</view>
|
||||
<view class="map">
|
||||
<!-- 客户标签 -->
|
||||
<u-popup closeOnClickOverlay :show="showtag" mode="bottom" :round="10" @close="closetag('showtag')" :closeable="true" >
|
||||
<view class="popup-content">
|
||||
<scroll-view scroll-y class="tag-list">
|
||||
<view
|
||||
v-for="(item, index) in taglist"
|
||||
:key="index"
|
||||
class="tags"
|
||||
>
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="row">
|
||||
<view class="col4 tagitem" v-for="(item1, index1) in item.tags" :class="{ 'tagactive': isActive(item1.group_id, item1.id) }" @click="tagSelect(item1)" :key="index1">
|
||||
{{ item1.name }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-popup> -->
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -101,7 +139,9 @@
|
||||
data() {
|
||||
return {
|
||||
id:'',
|
||||
expanded:false,
|
||||
followList:[],
|
||||
showtag: false,
|
||||
showmap: false,
|
||||
showmagnitude: false,
|
||||
showgrade: false,
|
||||
@@ -115,7 +155,9 @@
|
||||
form: {
|
||||
grade:'',
|
||||
},
|
||||
datas:''
|
||||
datas:'',
|
||||
activeMap: {}, // 存储每个父级下选中的子项 { 父ID: 子ID }
|
||||
taglist:[]
|
||||
|
||||
}
|
||||
},
|
||||
@@ -125,6 +167,7 @@
|
||||
var that = this
|
||||
this.getGrade()
|
||||
this.customerdetailfn()
|
||||
this.tagGroup()
|
||||
|
||||
},
|
||||
onShow() {
|
||||
@@ -141,6 +184,13 @@
|
||||
leftClick(){
|
||||
uni.navigateBack({})
|
||||
},
|
||||
isurls(url){
|
||||
var urls=[]
|
||||
var obj={}
|
||||
obj.src = url
|
||||
urls.push(obj)
|
||||
return urls
|
||||
},
|
||||
gomap(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/customer/map'
|
||||
@@ -166,6 +216,10 @@
|
||||
}
|
||||
}).then(res => {
|
||||
that.datas = res.data.data
|
||||
|
||||
that.datas.tags.forEach((item,index) => {
|
||||
that.$set(that.activeMap, item.group_id,item.id);
|
||||
})
|
||||
that.form = res.data.data
|
||||
that.select()
|
||||
})
|
||||
@@ -238,11 +292,49 @@
|
||||
close(val){
|
||||
this[val] = false
|
||||
},
|
||||
closetag(val){
|
||||
this[val] = false
|
||||
this.customerdetailfn()
|
||||
},
|
||||
editFn(){
|
||||
uni.navigateTo({
|
||||
url: '/pages/customer/editdetile?id='+this.id
|
||||
});
|
||||
},
|
||||
//标签
|
||||
tagGroup(){
|
||||
request({
|
||||
url:'tagGroup/list',
|
||||
method:'get',
|
||||
}).then(res => {
|
||||
this.taglist = res.data.data
|
||||
})
|
||||
},
|
||||
//标签点击
|
||||
tagSelect(item) {
|
||||
// 如果已选中则取消,否则设置选中
|
||||
this.$set(this.activeMap, item.group_id, this.activeMap[item.group_id] === item.id ? '' : item.id);
|
||||
console.log(this.activeMap)
|
||||
request({
|
||||
url:'tagGroup/updatePivot',
|
||||
method:'post',
|
||||
data:{
|
||||
customer_id: this.id,
|
||||
group_id:item.group_id,
|
||||
tag_id:this.activeMap[item.group_id]
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.data.code!=0){
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
isActive(parentId, childId) {
|
||||
return this.activeMap[parentId] === childId;
|
||||
},
|
||||
nextFn(){
|
||||
request({
|
||||
url:'customer/save',
|
||||
@@ -267,6 +359,16 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .u-cell__body{
|
||||
padding: 0px !important;
|
||||
|
||||
}
|
||||
::v-deep .u-collapse-item__content__text{
|
||||
padding: 10px 0px!important;
|
||||
}
|
||||
::v-deep .u-cell__title-text{
|
||||
font-size: 14px;
|
||||
}
|
||||
.u-m-lr-10{
|
||||
margin: 0px 10px;
|
||||
}
|
||||
@@ -290,11 +392,68 @@
|
||||
position: absolute;
|
||||
top: 2px;
|
||||
}
|
||||
.expandeds{
|
||||
height: 33px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cells{
|
||||
margin-bottom: 10px;
|
||||
background: #f6f6f6;
|
||||
padding:13px 15px;
|
||||
border-radius: 10px;
|
||||
.top{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #666666;
|
||||
}
|
||||
.btn{
|
||||
color: #3471FF;
|
||||
text-align: right;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
image{
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
.conts{
|
||||
padding: 10px 0px;
|
||||
}
|
||||
.tags{
|
||||
display: inline-block;
|
||||
margin: 4px 3px;
|
||||
// width: 31%;
|
||||
background: #ECF2FF;
|
||||
border-radius: 15px;
|
||||
color: #3471FF;
|
||||
text-align: center;
|
||||
padding: 5px 15px;
|
||||
}
|
||||
.toggle{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #999999;
|
||||
font-size: 12px;
|
||||
margin-top: 5px;
|
||||
text{
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.nones{
|
||||
text-align: center;
|
||||
color: #999999;
|
||||
line-height: 30px;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
.cell{
|
||||
position: relative;
|
||||
display: flex;
|
||||
justify-content:space-between;
|
||||
padding: 18px 20px;
|
||||
padding: 13px 20px;
|
||||
align-items: center;
|
||||
font-weight: 500;
|
||||
.item{
|
||||
@@ -315,6 +474,10 @@
|
||||
position: relative;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.tagname{
|
||||
color: #726CFF;
|
||||
font-size: 12px;
|
||||
}
|
||||
.content{
|
||||
padding: 10px 15px;
|
||||
background: #FFFFFF;
|
||||
@@ -324,8 +487,9 @@
|
||||
margin-bottom: 10px;
|
||||
.edt{
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
justify-content: flex-end;
|
||||
padding-bottom: 10px;
|
||||
text-align: center;
|
||||
image{
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
@@ -402,10 +566,17 @@
|
||||
height:44px;
|
||||
}
|
||||
.desc{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
align-items: center;
|
||||
color: #999999;
|
||||
.lingh{
|
||||
line-height: 40px;
|
||||
}
|
||||
.flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
display: flex;
|
||||
@@ -427,4 +598,38 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 标签弹框
|
||||
.popup-content {
|
||||
padding: 20px;
|
||||
}
|
||||
.tag-list{
|
||||
max-height: 900rpx;
|
||||
margin-top: 20rpx;
|
||||
.tags{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.name{
|
||||
margin: 10px 0px;
|
||||
}
|
||||
.tagitem{
|
||||
background: #ECF2FF;
|
||||
border-radius: 8px;
|
||||
color: #3471FF;
|
||||
text-align: center;
|
||||
padding: 5px 0px;
|
||||
}
|
||||
.row{
|
||||
width: 100%;
|
||||
}
|
||||
.col4{
|
||||
display: inline-block;
|
||||
margin: 4px 3px;
|
||||
width: 30%;
|
||||
}
|
||||
}
|
||||
.tagactive{
|
||||
background: #3471FF !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
+118
-43
@@ -67,14 +67,6 @@
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <u-line></u-line>
|
||||
<view class="cell">
|
||||
<view class="item">{{$t('customer.Cstomerfj')}}</view>
|
||||
<view class="right select" @click="showgrade = true">
|
||||
<view class="" :class="['content2', { placeholder: !grade_name }]">{{grade_name || $t('customer.Cstomerfjinput')}}</view>
|
||||
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
|
||||
</view>
|
||||
</view> -->
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view class="item">{{$t('customer.Country')}}</view>
|
||||
@@ -109,20 +101,37 @@
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexsj" :show="showmagnitude" @cancel="cancel('showmagnitude')" @close="close('showmagnitude')" :columns="magnitudeList" keyName="name" @confirm="magnitudeChange"></u-picker>
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')":defaultIndex="defaultIndexph" :show="showcartype" @cancel="cancel('showcartype')" @close="close('showcartype')" :columns="carTypeList" keyName="name" @confirm="cartypesChange"></u-picker>
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexfj" :show="showgrade" @cancel="cancel('showgrade')" @close="close('showgrade')" :columns="getGradeList" keyName="name" @confirm="gradeHandler"></u-picker>
|
||||
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexgj" :show="showarea" @cancel="cancel('showarea')" @close="close('showarea')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker>
|
||||
|
||||
<!-- <u-popup :show="showmap" :round="10" mode="bottom" @close="mapclose">
|
||||
<view class="mapcont">
|
||||
<view class="header">
|
||||
<view class="cancel" @click="mapclose">取消</view>
|
||||
<view class="title">地图位置</view>
|
||||
<view class="confirm" @click="mapconfirm">确定</view>
|
||||
</view>
|
||||
<view class="map">
|
||||
|
||||
</view>
|
||||
<!-- <u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexgj" :show="showarea" @cancel="cancel('showarea')" @close="close('showarea')" :columns="areaList" keyName="name" @confirm="areaChange"></u-picker> -->
|
||||
<u-popup closeOnClickOverlay :show="showarea" mode="bottom" :round="10" @close="close('showarea')">
|
||||
<view class="text">
|
||||
<view class="qx" @click="close('showarea') ">{{$t('cancel')}}</view>
|
||||
<view class="qd" @click="arerfn">{{$t('confirm')}}</view>
|
||||
</view>
|
||||
</u-popup> -->
|
||||
<view class="popup-content">
|
||||
<!-- 搜索框 -->
|
||||
<u-input
|
||||
v-model="searchKeyword"
|
||||
:placeholder="$t('keyword')"
|
||||
@input="handleSearch"
|
||||
></u-input>
|
||||
|
||||
<!-- 选项列表 -->
|
||||
<scroll-view scroll-y class="option-list">
|
||||
<view
|
||||
v-for="(item, index) in filteredOptions"
|
||||
:key="index"
|
||||
class="option-item"
|
||||
@click="handleSelect(item)"
|
||||
:class="actives==item.id?'actives':''"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
<view v-if="filteredOptions.length === 0" class="no-data">
|
||||
{{$t('noresults')}}
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -133,6 +142,10 @@
|
||||
return {
|
||||
id:'',
|
||||
followList:[],
|
||||
actives:'',
|
||||
searchKeyword: "", // 搜索关键词
|
||||
selectedLabel: "", // 选中的值(显示在输入框中)
|
||||
filteredOptions: [], // 过滤后的数据
|
||||
showmap: false,
|
||||
showmagnitude: false,
|
||||
showgrade: false,
|
||||
@@ -184,7 +197,6 @@
|
||||
var that = this
|
||||
this.getChannel()
|
||||
this.getMagnitude()
|
||||
// this.getGrade()
|
||||
this.carType()
|
||||
this.area()
|
||||
this.customerdetailfn()
|
||||
@@ -207,7 +219,7 @@
|
||||
gomap(){
|
||||
// #ifdef H5
|
||||
uni.navigateTo({
|
||||
url: '/pages/customer/maph5'
|
||||
url: '/pages/customer/maph5?lat='+this.form.lat+'&lng='+this.form.lng
|
||||
});
|
||||
// #endif
|
||||
// #ifdef APP-PLUS
|
||||
@@ -224,12 +236,6 @@
|
||||
that.defaultIndexqd=[index]
|
||||
}
|
||||
})
|
||||
// that.getGradeList1.forEach((item,index) => {
|
||||
// if(item.id == that.form.grade){
|
||||
// that.grade_name = item.name
|
||||
// that.defaultIndexfj=[index]
|
||||
// }
|
||||
// })
|
||||
that.carTypeList1.forEach((item,index) => {
|
||||
if(item.id == that.form.car_type_id){
|
||||
that.car_type_name = item.name
|
||||
@@ -242,13 +248,6 @@
|
||||
that.defaultIndexsj=[index]
|
||||
}
|
||||
})
|
||||
that.areaList1.forEach((item,index) => {
|
||||
if(item.id == that.form.country_id){
|
||||
that.country_name = item.name
|
||||
that.defaultIndexgj=[index]
|
||||
console.log(that.country_name)
|
||||
}
|
||||
})
|
||||
},
|
||||
//客户详情
|
||||
customerdetailfn(){
|
||||
@@ -262,6 +261,8 @@
|
||||
}).then(res => {
|
||||
that.datas = res.data.data
|
||||
that.form = res.data.data
|
||||
this.actives = res.data.data.country_id
|
||||
this.country_name = res.data.data.country_name
|
||||
that.select()
|
||||
})
|
||||
},
|
||||
@@ -332,7 +333,8 @@
|
||||
var list = res.data.data
|
||||
this.areaList1 = list
|
||||
this.areaList = [list]
|
||||
this.select()
|
||||
this.filteredOptions = list;
|
||||
// this.select()
|
||||
})
|
||||
},
|
||||
//商机
|
||||
@@ -364,18 +366,46 @@
|
||||
this.grade_name = val.value[0].name
|
||||
this.showgrade = false
|
||||
},
|
||||
//国家切换事件
|
||||
areaChange(val){
|
||||
this.form.country_id = val.value[0].id
|
||||
this.country_name = val.value[0].name
|
||||
this.showarea = false
|
||||
},
|
||||
// //国家切换事件
|
||||
// areaChange(val){
|
||||
// this.form.country_id = val.value[0].id
|
||||
// this.country_name = val.value[0].name
|
||||
// this.showarea = false
|
||||
// },
|
||||
//偏好切换事件
|
||||
cartypesChange(val){
|
||||
this.form.car_type_id = val.value[0].id
|
||||
this.car_type_name = val.value[0].name
|
||||
this.showcartype = false
|
||||
},
|
||||
// 搜索处理函数
|
||||
handleSearch() {
|
||||
if (this.searchKeyword) {
|
||||
console.log(this.searchKeyword)
|
||||
this.filteredOptions = this.areaList1.filter((item) =>
|
||||
item.name.includes(this.searchKeyword)
|
||||
);
|
||||
console.log(this.filteredOptions)
|
||||
} else {
|
||||
// 如果搜索框为空,显示全部数据
|
||||
this.filteredOptions = this.areaList1;
|
||||
}
|
||||
},
|
||||
// 选择选项
|
||||
handleSelect(item) {
|
||||
this.selectedLabel = item.name; // 回显选中的值
|
||||
// this.searchKeyword = item.name
|
||||
this.actives = item.id
|
||||
// this.showPicker = false; // 关闭弹窗
|
||||
console.log("选中的值:", item.id);
|
||||
console.log("选中的值:", item.name);
|
||||
},
|
||||
arerfn(){
|
||||
this.showarea = false; // 关闭弹窗
|
||||
this.country_name = this.selectedLabel
|
||||
this.form.country_id = this.actives
|
||||
|
||||
},
|
||||
cancel(val){
|
||||
this[val] = false
|
||||
},
|
||||
@@ -481,4 +511,49 @@
|
||||
margin-bottom: 40px;
|
||||
margin: 15px 4%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.actives{
|
||||
background-color: #dfdfdf;
|
||||
}
|
||||
.text{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
line-height: 30px;
|
||||
padding: 10px 15px 0px;
|
||||
.qd{
|
||||
color: #3471FF;
|
||||
}
|
||||
}
|
||||
.popup-content {
|
||||
padding: 20px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.option-list {
|
||||
max-height: 400rpx;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.option-item {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #eee;
|
||||
}
|
||||
|
||||
.option-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.no-data {
|
||||
text-align: center;
|
||||
padding: 20rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
+89
-54
@@ -13,14 +13,14 @@
|
||||
<view class="cont">
|
||||
<view class="title">
|
||||
<view class=""><text class="name">{{userdatas.phone}}</text></view>
|
||||
<view class="ststus">渠道:{{userdatas.channel_name}}</view>
|
||||
<view class="ststus">{{$t('channel')}}:{{userdatas.channel_name}}</view>
|
||||
</view>
|
||||
<view class="info"><text class="sex">{{userdatas.sex_txt}}</text> | <text class="addr">{{userdatas.country_name}}</text><text class="type">{{userdatas.car_type_name}}</text>
|
||||
</view>
|
||||
<view v-if="userdatas.email!=''">Email: {{userdatas.email}}</view>
|
||||
<view v-if="userdatas.WhatsApp!=''">WhatsAPP: {{userdatas.WhatsApp}}</view>
|
||||
<view v-if="userdatas.address!=''">公司: {{userdatas.address}}</view>
|
||||
<view v-if="userdatas.describe!=''">备注: {{userdatas.describe}}</view>
|
||||
<view v-if="userdatas.address!=''">{{$t('customer.Company')}}: {{userdatas.address}}</view>
|
||||
<view v-if="userdatas.describe!=''">{{$t('remarks')}}: {{userdatas.describe}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell2">
|
||||
@@ -97,26 +97,36 @@
|
||||
{{$t('customer.followrecord')}} <text class="status" :style="{color:(datas.follow == 0 ?'#3471FF' : datas.follow == 1 ?'#27C89C': '#FF4040')}">{{datas.follow_txt}}</text>
|
||||
</view>
|
||||
<u-steps v-if="followList.length>0" :current="followList.length" direction="column" dot>
|
||||
<u-steps-item :title="item.type_txt" v-for="(item, index) in followList" :key="index">
|
||||
<u-steps-item :title="item.type==1? $t('customer.Online') : $t('customer.Visit') " v-for="(item, index) in followList" :key="index">
|
||||
<view slot="desc" class="desc">
|
||||
<view class="" v-if="item.type==0">
|
||||
<view class="flex" v-if="item.type==0">
|
||||
<view class="">
|
||||
<view class="">
|
||||
<view class="lingh">
|
||||
{{$t('times')}} :{{item.created_at}}
|
||||
</view>
|
||||
<view class="">{{$t('address')}}:{{item.address}}</view>
|
||||
<view class="">{{$t('customer.Visitcontent')}}:{{item.audio_text}}</view>
|
||||
<view class="lingh">{{$t('customer.Visitcontent')}}:{{item.audio_text}}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<image :src="item.oss_picture" mode=""></image>
|
||||
<!-- <image :src="item.oss_picture" mode=""></image> -->
|
||||
<u-album
|
||||
:urls="isurls(item.oss_picture)"
|
||||
:singleSize="80"
|
||||
keyName="src"
|
||||
></u-album>
|
||||
</view>
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<view class="">
|
||||
<view class="lingh">
|
||||
{{$t('times')}}:{{item.created_at}}
|
||||
</view>
|
||||
<view class="">
|
||||
<image :src="item.oss_picture" mode=""></image>
|
||||
<!-- <image :src="item.oss_picture" mode=""></image> -->
|
||||
<u-album
|
||||
:urls="isurls(item.oss_picture)"
|
||||
:singleSize="80"
|
||||
keyName="src"
|
||||
></u-album>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -187,11 +197,12 @@
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
this.getlocahost()
|
||||
this.id = options.id;
|
||||
this.form.customer_id = options.id;
|
||||
var that = this
|
||||
this.getGrade()
|
||||
this.getlocahost()
|
||||
|
||||
this.customerdetailfn()
|
||||
this.followlistfn()
|
||||
},
|
||||
@@ -199,6 +210,13 @@
|
||||
leftClick(){
|
||||
uni.navigateBack({})
|
||||
},
|
||||
isurls(url){
|
||||
var urls=[]
|
||||
var obj={}
|
||||
obj.src = url
|
||||
urls.push(obj)
|
||||
return urls
|
||||
},
|
||||
close(val){
|
||||
this[val]=false
|
||||
},
|
||||
@@ -281,33 +299,7 @@
|
||||
},
|
||||
});
|
||||
},
|
||||
getlocahost(){
|
||||
// 检查定位权限
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
if (!res.authSetting['scope.userLocation']) {
|
||||
// 未授权,请求权限
|
||||
uni.authorize({
|
||||
scope: 'scope.userLocation',
|
||||
success: () => {
|
||||
this.getlocahost();
|
||||
},
|
||||
fail: () => {
|
||||
uni.showToast({
|
||||
title: '定位权限未授权',
|
||||
icon: 'none',
|
||||
});
|
||||
},
|
||||
});
|
||||
} else {
|
||||
// 已授权,直接获取定位
|
||||
this.getlocahost();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
getlocahost(){
|
||||
|
||||
unigetLocation(){
|
||||
var that = this
|
||||
uni.getLocation({
|
||||
type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02
|
||||
@@ -325,18 +317,53 @@
|
||||
console.log('获取位置完成');
|
||||
}
|
||||
});
|
||||
|
||||
// uni.chooseLocation({
|
||||
// success: function (res) {
|
||||
// console.log('位置名称:' + res.name);
|
||||
// console.log('详细地址:' + res.address);
|
||||
// console.log('经度:' + res.longitude);
|
||||
// console.log('纬度:' + res.latitude);
|
||||
// },
|
||||
// fail: function (err) {
|
||||
// console.log('选择位置失败:', err);
|
||||
// }
|
||||
// });
|
||||
},
|
||||
getlocahost() {
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
console.log('当前位置的经度:' + position.coords.longitude);
|
||||
console.log('当前位置的纬度:' + position.coords.latitude);
|
||||
this.getarrd(position.coords.longitude,position.coords.latitude)
|
||||
this.error = '';
|
||||
console.log("获取位置成功:", position);
|
||||
},
|
||||
(error) => {
|
||||
this.unigetLocation()
|
||||
// this.error = this.getErrorMessage(error);
|
||||
// uni.showToast({
|
||||
// title: this.error,
|
||||
// icon: 'none'
|
||||
// });
|
||||
console.error("获取位置失败:", error);
|
||||
},
|
||||
{
|
||||
enableHighAccuracy: true,
|
||||
timeout: 10000,
|
||||
maximumAge: 0
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.unigetLocation()
|
||||
// this.error = "浏览器不支持 Geolocation API";
|
||||
// uni.showToast({
|
||||
// title: this.error,
|
||||
// icon: 'none'
|
||||
// });
|
||||
console.error("浏览器不支持 Geolocation API");
|
||||
}
|
||||
},
|
||||
getErrorMessage(error) {
|
||||
switch (error.code) {
|
||||
case error.PERMISSION_DENIED:
|
||||
return "用户拒绝了地理位置权限";
|
||||
case error.POSITION_UNAVAILABLE:
|
||||
return "无法获取当前位置";
|
||||
case error.TIMEOUT:
|
||||
return "获取位置超时";
|
||||
default:
|
||||
return "未知错误";
|
||||
}
|
||||
},
|
||||
// 跟进记录
|
||||
followlistfn(){
|
||||
@@ -438,14 +465,14 @@
|
||||
header:{'Authorization': 'Bearer ' + uni.getStorageSync('token')},
|
||||
success: (uploadFileRes) => {
|
||||
const path=JSON.parse(uploadFileRes.data)
|
||||
if(path.code==-1){
|
||||
if(path.code==0){
|
||||
that.form[name] = path.data.path
|
||||
console.log(that.form)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: path.message,
|
||||
icon: 'none'
|
||||
});
|
||||
}else{
|
||||
that.form[name] = path.data.path
|
||||
console.log(that.form)
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -733,6 +760,14 @@
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: #999999;
|
||||
.lingh{
|
||||
line-height: 40px;
|
||||
}
|
||||
.flex{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
.title{
|
||||
color: #666666;
|
||||
|
||||
+118
-52
@@ -31,6 +31,7 @@ export default {
|
||||
value: '',
|
||||
// 模糊匹配数据
|
||||
list: [],
|
||||
center: { lat:'', lng:''},
|
||||
cityInfo:{
|
||||
lat: '',
|
||||
lng: '',
|
||||
@@ -44,7 +45,12 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(e) {
|
||||
if(e.lat&&e.lat!=''&&e.lat!=0){
|
||||
this.center.lat = e.lat
|
||||
this.center.lng = e.lng
|
||||
}
|
||||
console.log(e)
|
||||
this.initMap()
|
||||
},
|
||||
methods:{
|
||||
@@ -92,63 +98,123 @@ export default {
|
||||
});
|
||||
that.list =[]
|
||||
},
|
||||
getErrorMessage(error) {
|
||||
switch (error.code) {
|
||||
case error.PERMISSION_DENIED:
|
||||
return "用户拒绝了地理位置权限";
|
||||
case error.POSITION_UNAVAILABLE:
|
||||
return "无法获取当前位置";
|
||||
case error.TIMEOUT:
|
||||
return "获取位置超时";
|
||||
default:
|
||||
return "未知错误";
|
||||
}
|
||||
},
|
||||
addmapmarkfn(lat,lng){
|
||||
var that = this
|
||||
that.map = new google.maps.Map(document.getElementById("map"),
|
||||
{
|
||||
center: { lat:lat, lng: lng},
|
||||
zoom: 12,// 地图缩放参数
|
||||
maxZoom: 18,// 最大缩放参数
|
||||
minZoom: 4,// 最小缩放参数
|
||||
disableDefaultUI: true// 禁用默认UI
|
||||
}
|
||||
)
|
||||
var marker = new google.maps.Marker({
|
||||
position: { lat:lat, lng: lng},
|
||||
map: that.map,
|
||||
draggable: true, // 允许拖动标记
|
||||
icon: {
|
||||
url: 'https://now.guua.com/attachs/default/location_shop.png',
|
||||
scaledSize: new google.maps.Size(30, 30),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(0, 0)
|
||||
}
|
||||
});
|
||||
// 监听标记拖动事件
|
||||
marker.addListener('dragend', () => {
|
||||
const position = marker.getPosition();
|
||||
that.map.setCenter(position);
|
||||
// 根据标记位置获取地址信息
|
||||
const geocoder = new google.maps.Geocoder();
|
||||
geocoder.geocode({ location: position }, (results, status) => {
|
||||
if (status === 'OK' && results[0]) {
|
||||
console.log(results)
|
||||
console.log(position)
|
||||
that.cityInfo.address = results[0].formatted_address;
|
||||
that.cityInfo.lat = position.lat();
|
||||
that.cityInfo.lng = position.lng();
|
||||
that.value = results[0].formatted_address;
|
||||
console.log(that.cityInfo)
|
||||
} else {
|
||||
alert('无法获取地址信息');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
unigetLocation(){
|
||||
var that = this
|
||||
uni.getLocation({
|
||||
type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02
|
||||
success: function (res) {
|
||||
console.log('当前位置的经度:' + res.longitude);
|
||||
console.log('当前位置的纬度:' + res.latitude);
|
||||
that.addmapmarkfn(res.latitude,res.longitude)
|
||||
// 如果需要将经纬度转换为具体地址,可以使用逆地理编码
|
||||
// 这里调用 uni.chooseLocation 或第三方地图服务(如高德、腾讯地图)
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('获取位置失败:', err);
|
||||
},
|
||||
complete: function () {
|
||||
console.log('获取位置完成');
|
||||
}
|
||||
});
|
||||
},
|
||||
initMap() {
|
||||
var that = this
|
||||
loader
|
||||
.load()
|
||||
.then((google) => {
|
||||
uni.getLocation({
|
||||
type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02
|
||||
success: function (res) {
|
||||
console.log(res)
|
||||
that.map = new google.maps.Map(document.getElementById("map"),
|
||||
{
|
||||
center: { lat:res.latitude, lng: res.longitude},
|
||||
zoom: 12,// 地图缩放参数
|
||||
maxZoom: 18,// 最大缩放参数
|
||||
minZoom: 4,// 最小缩放参数
|
||||
disableDefaultUI: true// 禁用默认UI
|
||||
}
|
||||
)
|
||||
var marker = new google.maps.Marker({
|
||||
position: { lat:res.latitude, lng: res.longitude},
|
||||
map: that.map,
|
||||
draggable: true, // 允许拖动标记
|
||||
icon: {
|
||||
url: 'https://now.guua.com/attachs/default/location_shop.png',
|
||||
scaledSize: new google.maps.Size(30, 30),
|
||||
origin: new google.maps.Point(0, 0),
|
||||
anchor: new google.maps.Point(0, 0)
|
||||
if(this.center.lat!=''){
|
||||
that.addmapmarkfn(parseFloat(this.center.lat),parseFloat(this.center.lng))
|
||||
}else{
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(
|
||||
(position) => {
|
||||
console.log('当前位置的经度:' + position.coords.longitude);
|
||||
console.log('当前位置的纬度:' + position.coords.latitude);
|
||||
that.addmapmarkfn(position.coords.latitude,position.coords.longitude)
|
||||
this.error = '';
|
||||
console.log("获取位置成功:", position);
|
||||
},
|
||||
(error) => {
|
||||
that.unigetLocation()
|
||||
// this.error = this.getErrorMessage(error);
|
||||
// uni.showToast({
|
||||
// title: this.error,
|
||||
// icon: 'none'
|
||||
// });
|
||||
console.error("获取位置失败:", error);
|
||||
},
|
||||
{
|
||||
enableHighAccuracy: true,
|
||||
timeout: 10000,
|
||||
maximumAge: 0
|
||||
}
|
||||
});
|
||||
// 监听标记拖动事件
|
||||
marker.addListener('dragend', () => {
|
||||
const position = marker.getPosition();
|
||||
that.map.setCenter(position);
|
||||
// 根据标记位置获取地址信息
|
||||
const geocoder = new google.maps.Geocoder();
|
||||
geocoder.geocode({ location: position }, (results, status) => {
|
||||
if (status === 'OK' && results[0]) {
|
||||
console.log(results)
|
||||
console.log(position)
|
||||
that.cityInfo.address = results[0].formatted_address;
|
||||
that.cityInfo.lat = position.lat();
|
||||
that.cityInfo.lng = position.lng();
|
||||
that.value = results[0].formatted_address;
|
||||
console.log(that.cityInfo)
|
||||
} else {
|
||||
alert('无法获取地址信息');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
fail: function (err) {
|
||||
console.log('获取位置失败:', err);
|
||||
},
|
||||
complete: function () {
|
||||
console.log('获取位置完成');
|
||||
}
|
||||
})
|
||||
);
|
||||
} else {
|
||||
that.unigetLocation()
|
||||
// this.error = "浏览器不支持 Geolocation API";
|
||||
// uni.showToast({
|
||||
// title: this.error,
|
||||
// icon: 'none'
|
||||
// });
|
||||
console.error("浏览器不支持 Geolocation API");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
.catch((e) => {
|
||||
|
||||
Reference in New Issue
Block a user