地图页面 及页面加语言编译
This commit is contained in:
+66
-42
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<view>
|
||||
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" title="添加跟进"></uni-nav-bar>
|
||||
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('navbar.addfollowup')"></uni-nav-bar>
|
||||
<view class="content">
|
||||
<view class="cell">
|
||||
<view>跟进方式</view>
|
||||
<view>{{$t('customer.followtype')}}</view>
|
||||
<view class="right">
|
||||
<u-radio-group v-model="form.type">
|
||||
<u-radio name="1">在线跟进</u-radio>
|
||||
<u-radio name="0">拜访</u-radio>
|
||||
<u-radio name="1">{{$t('customer.Online')}}</u-radio>
|
||||
<u-radio name="0">{{$t('customer.Visit')}}</u-radio>
|
||||
</u-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<u-line></u-line>
|
||||
<view class="cell">
|
||||
<view>跟进时间</view>
|
||||
<view>{{$t('customer.followtime')}} </view>
|
||||
<view class="right" @click="show = true">
|
||||
<input placeholder="跟进时间" v-model="form.firstFollowtime" />
|
||||
<input :placeholder="$t('customer.followtime')" v-model="form.firstFollowtime" />
|
||||
</view>
|
||||
</view>
|
||||
<u-line></u-line>
|
||||
<view class="cell1" v-if="form.type==1">
|
||||
<view>上传跟进最后聊天截图</view>
|
||||
<view>{{$t('customer.updataimg')}}</view>
|
||||
<view style="margin-top: 10px;">
|
||||
<uni-file-picker fileMediatype="image" limit="1" :del-icon="false" disable-preview @select="select" @delete="delfn('picture')">
|
||||
<image src="/static/image/customer/upimg.png" mode="" class="addimg"></image>
|
||||
@@ -28,14 +28,14 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="cell" v-if="form.type==0">
|
||||
<view>当前位置</view>
|
||||
<view>{{$t('customer.followlocation')}}</view>
|
||||
<view class="right">
|
||||
<input placeholder="输入当前位置" v-model="form.address" />
|
||||
<input :placeholder="$t('customer.followlocation')" disabled v-model="form.address" />
|
||||
</view>
|
||||
</view>
|
||||
<u-line v-if="form.type==0"></u-line>
|
||||
<view class="cell1" v-if="form.type==0">
|
||||
<view>当前位置拍照上传</view>
|
||||
<view>{{$t('customer.locationimg')}}</view>
|
||||
<view style="margin-top: 10px;">
|
||||
<uni-file-picker fileMediatype="image" limit="1" :del-icon="false" disable-preview @select="select1" @delete="delfn('picture')">
|
||||
<image src="/static/image/customer/upimg.png" mode="" class="addimg"></image>
|
||||
@@ -44,25 +44,25 @@
|
||||
</view>
|
||||
<u-line v-if="form.type==0"></u-line>
|
||||
<view class="cell1" v-if="form.type==0">
|
||||
<view>拜访内容</view>
|
||||
<view>{{$t('customer.Visitcontent')}}</view>
|
||||
<view class="yuyin">
|
||||
<textarea auto-height v-model="form.audio_text" placeholder="拜访内容..."/>
|
||||
<textarea auto-height v-model="form.audio_text" :placeholder="$t('customer.Visiinputhd')"/>
|
||||
<image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognizebd"></image>
|
||||
</view>
|
||||
</view>
|
||||
<u-line v-if="form.type==0"></u-line>
|
||||
<view class="cell1" v-if="form.type==0">
|
||||
<view>备注(非必填)</view>
|
||||
<view>{{$t('customer.Remarks')}}</view>
|
||||
<view class="yuyin">
|
||||
<textarea auto-height v-model="form.remark" placeholder="详细情况..."/>
|
||||
<image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognize"></image>
|
||||
<textarea auto-height v-model="form.remark" :placeholder="$t('customer.Remarksinputhd')"/>
|
||||
<!-- <image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognize"></image> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-gap height="10" bgColor="#F6F6F6"></u-gap>
|
||||
<view class="steps">
|
||||
<view class="title">
|
||||
跟进记录 <text class="status">跟进中</text>
|
||||
{{$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">
|
||||
@@ -70,10 +70,10 @@
|
||||
<view class="" v-if="item.type==0">
|
||||
<view class="">
|
||||
<view class="">
|
||||
时间:{{item.created_at}}
|
||||
{{$t('times')}} :{{item.created_at}}
|
||||
</view>
|
||||
<view class="">地址:{{item.address}}</view>
|
||||
<view class="">拜访内容:{{item.audio_text}}</view>
|
||||
<view class="">{{$t('address')}}:{{item.address}}</view>
|
||||
<view class="">{{$t('customer.Visitcontent')}}:{{item.audio_text}}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<image :src="item.oss_picture" mode=""></image>
|
||||
@@ -81,7 +81,7 @@
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<view class="">
|
||||
时间:{{item.created_at}}
|
||||
{{$t('times')}}:{{item.created_at}}
|
||||
</view>
|
||||
<view class="">
|
||||
<image :src="item.oss_picture" mode=""></image>
|
||||
@@ -94,8 +94,8 @@
|
||||
</view>
|
||||
<u-gap height="100" bgColor="#fff"></u-gap>
|
||||
<view class="foot">
|
||||
<button class="btn1" @click="shownexttime=true">下次跟进提醒</button>
|
||||
<button class="btn" @click="nextFn">提交</button>
|
||||
<button class="btn1" @click="shownexttime=true">{{$t('customer.NextReminder')}}</button>
|
||||
<button class="btn" @click="nextFn">{{$t('submit')}}</button>
|
||||
</view>
|
||||
<u-datetime-picker
|
||||
:show="show"
|
||||
@@ -136,7 +136,8 @@
|
||||
audio_text:'',
|
||||
remark:'',
|
||||
picture:''
|
||||
}
|
||||
},
|
||||
datas:''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
@@ -154,27 +155,30 @@
|
||||
// 获取当前位置
|
||||
getarrd(longitude,latitude){
|
||||
const apiKey = 'AIzaSyBGvV-vX7C72PEbcYrTdmUj3qrubejWzNw';
|
||||
uni.request({
|
||||
url: `https://www.google.com/maps/embed/v1/view?key=${apiKey}&location=${longitude},${latitude}`,
|
||||
success: (res) => {
|
||||
console.log('逆地理编码结果:', res.data);
|
||||
if (res.data.status === '1') {
|
||||
const address = res.data.regeocode.formatted_address; // 具体地址
|
||||
console.log('具体地址:', address);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('逆地理编码失败:', err);
|
||||
}
|
||||
|
||||
uni.request({
|
||||
url: `https://maps.googleapis.com/maps/api/geocode/json?latlng=${latitude},${longitude}&key=${apiKey}`,
|
||||
success: (res) => {
|
||||
if (res.data.results && res.data.results.length > 0) {
|
||||
this.form.address = res.data.results[0].formatted_address; // 获取格式化地址
|
||||
console.log(res.data.results[0].formatted_address)
|
||||
} else {
|
||||
console.error('未找到地址');
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('请求失败:', err);
|
||||
},
|
||||
});
|
||||
},
|
||||
getlocahost(){
|
||||
var that = this
|
||||
uni.getLocation({
|
||||
type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02
|
||||
success: function (res) {
|
||||
console.log('当前位置的经度:' + res.longitude);
|
||||
console.log('当前位置的纬度:' + res.latitude);
|
||||
getarrd(res.longitude,res.latitude)
|
||||
that.getarrd(res.longitude,res.latitude)
|
||||
// 如果需要将经纬度转换为具体地址,可以使用逆地理编码
|
||||
// 这里调用 uni.chooseLocation 或第三方地图服务(如高德、腾讯地图)
|
||||
},
|
||||
@@ -207,6 +211,7 @@
|
||||
customer_id:this.id,
|
||||
}
|
||||
}).then(res => {
|
||||
this.datas = res.data.data
|
||||
this.followList = res.data.data
|
||||
console.log(res.data.data)
|
||||
})
|
||||
@@ -223,12 +228,9 @@
|
||||
icon: 'none'
|
||||
});
|
||||
if(res.data.code ==0){
|
||||
// setTimeout(() => {
|
||||
// uni.reLaunch({
|
||||
// url: '/pages/index/index',// 替换为你要跳转的页面路径
|
||||
// });
|
||||
// }, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({})
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -262,6 +264,25 @@
|
||||
this.shownexttime = false
|
||||
this.nexttime = this.result(e.value, e.mode)
|
||||
console.log(this.nexttime)
|
||||
request({
|
||||
url:'customer/followNext',
|
||||
method:'post',
|
||||
data:{
|
||||
id:this.id,
|
||||
follow_next:e.value
|
||||
}
|
||||
}).then(res => {
|
||||
uni.showToast({
|
||||
title: res.data.message,
|
||||
icon: 'none'
|
||||
});
|
||||
if(res.data.code ==0){
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({})
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
change(e) {
|
||||
// console.log('change', e)
|
||||
@@ -422,6 +443,7 @@
|
||||
padding-top: 20px;
|
||||
}
|
||||
.btn{
|
||||
font-size: 28rpx;
|
||||
background: linear-gradient(to right, #3471FF, #6776FF);
|
||||
color: white;
|
||||
border-radius: 50px;
|
||||
@@ -431,6 +453,7 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
.btn1{
|
||||
font-size: 28rpx;
|
||||
border: 1px solid #3471FF;
|
||||
background: #fff;
|
||||
color: #3471FF;
|
||||
@@ -456,6 +479,7 @@
|
||||
}
|
||||
.steps{
|
||||
padding: 15px;
|
||||
background: #fff;
|
||||
image{
|
||||
width: 44px;
|
||||
height:44px;
|
||||
|
||||
Reference in New Issue
Block a user