对接部分接口

This commit is contained in:
浅念
2025-03-17 17:43:41 +08:00
parent f24b70c8e9
commit 328311fe2a
10 changed files with 536 additions and 211 deletions
+152 -89
View File
@@ -5,56 +5,56 @@
<view class="cell">
<view>跟进方式</view>
<view class="right">
<u-radio-group v-model="form.followType">
<u-radio-group v-model="form.type">
<u-radio name="1">在线跟进</u-radio>
<u-radio name="2">拜访</u-radio>
<u-radio name="0">拜访</u-radio>
</u-radio-group>
</view>
</view>
<u-divider text=""></u-divider>
<u-line></u-line>
<view class="cell">
<view>跟进时间</view>
<view class="right" @click="show = true">
<input placeholder="跟进时间" v-model="form.firstFollow" />
<input placeholder="跟进时间" v-model="form.firstFollowtime" />
</view>
</view>
<u-divider text=""></u-divider>
<view class="cell1" v-if="form.followType==1">
<u-line></u-line>
<view class="cell1" v-if="form.type==1">
<view>上传跟进最后聊天截图</view>
<view>
<uni-file-picker fileMediatype="image" limit="1" :del-icon="false" disable-preview @select="select" @delete="delfn('front_45_degree')">
<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>
</uni-file-picker>
</view>
</view>
<view class="cell" v-if="form.followType==2">
<view class="cell" v-if="form.type==0">
<view>当前位置</view>
<view class="right">
<input placeholder="输入当前位置" v-model="form.phone" />
<input placeholder="输入当前位置" v-model="form.address" />
</view>
</view>
<u-divider text="" v-if="form.followType==2"></u-divider>
<view class="cell1" v-if="form.followType==2">
<u-line v-if="form.type==0"></u-line>
<view class="cell1" v-if="form.type==0">
<view>当前位置拍照上传</view>
<view style="margin-top: 10px;">
<uni-file-picker fileMediatype="image" limit="1" :del-icon="false" disable-preview @select="select1" @delete="delfn('front_45_degree')">
<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>
</uni-file-picker>
</view>
</view>
<u-divider text="" v-if="form.followType==2"></u-divider>
<view class="cell1" v-if="form.followType==2">
<u-line v-if="form.type==0"></u-line>
<view class="cell1" v-if="form.type==0">
<view>拜访内容</view>
<view class="yuyin">
<textarea auto-height v-model="form.bf_desc" placeholder="拜访内容..."/>
<textarea auto-height v-model="form.audio_text" placeholder="拜访内容..."/>
<image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognizebd"></image>
</view>
</view>
<u-divider text="" v-if="form.followType==2"></u-divider>
<view class="cell1" v-if="form.followType==2">
<u-line v-if="form.type==0"></u-line>
<view class="cell1" v-if="form.type==0">
<view>备注(非必填)</view>
<view class="yuyin">
<textarea auto-height v-model="form.mom_desc" placeholder="详细情况..."/>
<textarea auto-height v-model="form.remark" placeholder="详细情况..."/>
<image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognize"></image>
</view>
</view>
@@ -64,51 +64,37 @@
<view class="title">
跟进记录 <text class="status">跟进中</text>
</view>
<u-steps current="0" direction="column" dot>
<u-steps-item title="在线跟进">
<view slot="desc">
<view class="">
时间:2025-03-11 12:00:01
</view>
<view class="">
<image src="/static/image/customer/addr.png" mode=""></image>
</view>
</view>
</u-steps-item>
<u-steps-item title="拜访跟进">
<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">
<view slot="desc" class="desc">
<view class="">
<view class="" v-if="item.type==0">
<view class="">
时间:2025-03-11 12:00:01
<view class="">
时间:{{item.created_at}}
</view>
<view class="">地址:{{item.address}}</view>
<view class="">拜访内容:{{item.audio_text}}</view>
</view>
<view class="">地址:迪拜某某地方</view>
<view class="">拜访内容:讨论需求</view>
</view>
<view class="">
<image src="/static/image/customer/addr.png" mode=""></image>
</view>
</view>
</u-steps-item>
<u-steps-item title="拜访跟进">
<view slot="desc" class="desc">
<view class="">
<view class="">
时间:2025-03-11 12:00:01
<image :src="item.oss_picture" mode=""></image>
</view>
<view class="">地址:迪拜某某地方</view>
<view class="">拜访内容:讨论需求</view>
</view>
<view class="">
<image src="/static/image/customer/addr.png" mode=""></image>
<view class="" v-else>
<view class="">
时间:{{item.created_at}}
</view>
<view class="">
<image :src="item.oss_picture" mode=""></image>
</view>
</view>
</view>
</u-steps-item>
</u-steps>
<!-- <empty :list="brandList"></empty> -->
<empty :list="followList"></empty>
</view>
<u-gap height="100" bgColor="#fff"></u-gap>
<view class="foot">
<button class="btn1" @click="nextFn">下次跟进提醒</button>
<button class="btn1" @click="shownexttime=true">下次跟进提醒</button>
<button class="btn" @click="nextFn">提交</button>
</view>
<u-datetime-picker
@@ -119,6 +105,13 @@
@cancel="cancel"
@change="change"
></u-datetime-picker>
<u-datetime-picker
:show="shownexttime"
v-model="nexttime"
mode="datetime"
@confirm="confirmnext"
@cancel="cancelnext"
></u-datetime-picker>
</view>
</template>
<script>
@@ -127,49 +120,99 @@
export default {
data() {
return {
brandList:[],
energyList:[],
typesList:[],
id:'',
show:false,
firstFollow: '2025-03-11 12:00:01',
shownexttime:false,
firstFollow: Number(new Date()),
nexttime: Number(new Date()),
followList:[],
form: {
name: '',
followType: '1',
phone: '',
preference: '赵野军',
level: '初步接触',
region: '',
firstFollow: '2025-03-11 12:00:01',
details: '',
bf_desc:'',
mom_desc:'',
customer_id:'',
type: '1',
address: '',
lat: '',
lng: '',
firstFollowtime:'',
audio_text:'',
remark:'',
picture:''
}
}
},
onLoad() {
const { windowWidth, windowHeight } = uni.getSystemInfoSync();
this.x = windowWidth-70
this.y = windowHeight-185
onLoad(options) {
console.log(options);
this.id = options.id;
this.form.customer_id = options.id;
var that = this
this.getlocahost()
this.followlistfn()
},
methods: {
leftClick(){
uni.navigateBack({})
},
// 获取当前位置
getlocahost(){
uni.getLocation({
type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02
success: function (res) {
console.log('当前位置的经度:' + res.longitude);
console.log('当前位置的纬度:' + res.latitude);
// 如果需要将经纬度转换为具体地址,可以使用逆地理编码
// 这里调用 uni.chooseLocation 或第三方地图服务(如高德、腾讯地图)
},
fail: function (err) {
console.log('获取位置失败:', err);
},
complete: function () {
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);
// }
// });
},
// 跟进记录
followlistfn(){
request({
url:'follow/list',
method:'get',
data: {
customer_id:this.id,
}
}).then(res => {
this.followList = res.data.data.list
console.log(res.data.data)
})
},
//保存跟进
nextFn(){
},
cancel() {
this.show = false
},
confirm(e) {
this.show = false
this.form.firstFollow = this.result(e.value, e.mode)
console.log(this.result(e.value, e.mode))
console.log(this.form.firstFollow )
},
change(e) {
// console.log('change', e)
request({
url:'follow/save',
method:'post',
data:this.form
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
if(res.data.code ==0){
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/index/index',// 替换为你要跳转的页面路径
// });
// }, 1000);
}
})
},
result(time, mode) {
const timeFormat = uni.$u.timeFormat
@@ -186,6 +229,26 @@
return ''
}
},
cancel() {
this.show = false
},
confirm(e) {
this.show = false
this.form.firstFollowtime = this.result(e.value, e.mode)
console.log(this.result(e.value, e.mode))
},
cancelnext() {
this.shownexttime = false
},
confirmnext(e) {
this.shownexttime = false
this.nexttime = this.result(e.value, e.mode)
console.log(this.nexttime)
},
change(e) {
// console.log('change', e)
},
delfn(name){
console.log(name)
that.carinfo[name] =''
@@ -193,26 +256,26 @@
uploadfn(imgUrl,name){
var that = this;
uni.uploadFile({
url: 'https://api.collect.hs.hnzhwlkj.club/upload',
url: 'http://192.168.50.4:8787/upload',
filePath: imgUrl,
name: 'image',
name: 'files',
header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')},
success: (uploadFileRes) => {
const path=JSON.parse(uploadFileRes.data)
that.carinfo[name] = path.data.image_name
console.log(that.carinfo)
that.form[name] = path.data.path
console.log(that.form)
}
});
},
select(e){
const tempFilePaths = e.tempFilePaths;
const imgUrl=tempFilePaths[0]
this.uploadfn(imgUrl,'front_45_degree')
this.uploadfn(imgUrl,'picture')
},
select1(e){
const tempFilePaths = e.tempFilePaths;
const imgUrl=tempFilePaths[0]
this.uploadfn(imgUrl,'front_45_degree')
this.uploadfn(imgUrl,'picture')
},
async startRecognizebd () {
// #ifdef APP-PLUS