页面功能修改

This commit is contained in:
浅念
2025-03-21 17:57:32 +08:00
parent ddcf63d131
commit 7d1884ad0b
18 changed files with 1403 additions and 590 deletions
+206 -10
View File
@@ -1,6 +1,36 @@
<template>
<view>
<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="contents" >
<view class="top">
<view class="name">{{userdatas.contacts}}</view>
<view class="right">
<text class="medal" :style="{color:(userdatas.magnitude == 0 ?'#F5AB00' : userdatas.magnitude == 1 ?'#8495B8': '#9B7200')}">{{userdatas.magnitude_txt}}</text>
<text class="tag" :style="{background:(userdatas.follow == 0 ?'#3471FF' : userdatas.follow == 1 ?'#27C89C': '#FF4040')}">{{userdatas.follow_txt}}</text>
</view>
</view>
<u-line margin="20rpx 0px" color="#fff" :hairline="false"></u-line>
<view class="cont">
<view class="title">
<view class=""><text class="name">{{userdatas.phone}}</text></view>
<view class="ststus">渠道:{{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>
</view>
<view class="cell2">
<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-gap height="10" bgColor="#F6F6F6"></u-gap>
<view class="content">
<view class="cell">
<view class="item">{{$t('customer.followtype')}}</view>
@@ -49,7 +79,7 @@
<view>{{$t('customer.Visitcontent')}}</view>
<view class="yuyin">
<textarea auto-height v-model="form.audio_text" :placeholder="$t('customer.Visiinputhd')"/>
<image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognizebd"></image>
<!-- <image src="/static/image/customer/yuyin.png" mode="" @tap="startRecognizebd"></image> -->
</view>
</view>
<u-line v-if="form.type==0"></u-line>
@@ -96,17 +126,19 @@
</view>
<u-gap height="100" bgColor="#fff"></u-gap>
<view class="foot">
<button class="btn1" @click="shownexttime=true">{{$t('customer.NextReminder')}}</button>
<!-- <button class="btn1" @click="shownexttime=true">{{$t('customer.NextReminder')}}</button> -->
<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-datetime-picker
:show="show"
closeOnClickOverlay
v-model="firstFollow"
mode="datetime"
@confirm="confirm"
@cancel="cancel"
@change="change"
@cancel="cancel('show')"
@close="close('show')"
></u-datetime-picker>
<u-datetime-picker
@@ -128,10 +160,16 @@
return {
id:'',
show:false,
showgrade:false,
shownexttime:false,
firstFollow: Number(new Date()),
nexttime: Number(new Date()),
followList:[],
getGradeList1:[],
getGradeList:[],
grade_name:'',
defaultIndexfj:[0],
grade:'',
form: {
customer_id:'',
type: '1',
@@ -143,7 +181,8 @@
remark:'',
picture:''
},
datas:''
datas:'',
userdatas:''
}
},
onLoad(options) {
@@ -151,7 +190,9 @@
this.id = options.id;
this.form.customer_id = options.id;
var that = this
this.getGrade()
this.getlocahost()
this.customerdetailfn()
this.followlistfn()
},
methods: {
@@ -161,6 +202,66 @@
close(val){
this[val]=false
},
selectgd(){
var that=this;
that.getGradeList1.forEach((item,index) => {
if(item.id == that.userdatas.grade){
that.grade_name = item.name
that.defaultIndexfj=[index]
}
})
},
//客户等级
getGrade(){
request({
url:'customer/getGrade',
method:'get',
}).then(res => {
var list = res.data.data
this.getGradeList = [list]
this.getGradeList1 = list
// this.selectgd()
})
},
//客户等级切换事件
gradeHandler(val){
this.grade = val.value[0].id
this.grade_name = val.value[0].name
this.showgrade = false
request({
url:'customer/grade',
method:'post',
data:{
id:this.id,
grade:this.grade
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
})
},
cancel(val){
this[val] = false
},
close(val){
this[val] = false
},
//客户详情
customerdetailfn(){
var that=this;
request({
url:'customer/detail',
method:'get',
data: {
id:this.id,
}
}).then(res => {
that.userdatas = res.data.data
that.selectgd()
})
},
// 获取当前位置
getarrd(longitude,latitude){
const apiKey = 'AIzaSyBGvV-vX7C72PEbcYrTdmUj3qrubejWzNw';
@@ -227,6 +328,7 @@
},
//保存跟进
nextFn(){
request({
url:'follow/save',
method:'post',
@@ -238,7 +340,9 @@
});
if(res.data.code ==0){
setTimeout(() => {
uni.navigateBack({})
uni.navigateTo({
url: '/pages/customer/followsuccess?id='+this.id
});
}, 1000);
}
})
@@ -258,9 +362,6 @@
return ''
}
},
cancel() {
this.show = false
},
confirm(e) {
this.show = false
this.form.firstFollowtime = this.result(e.value, e.mode)
@@ -304,7 +405,8 @@
uploadfn(imgUrl,name){
var that = this;
uni.uploadFile({
url: 'http://219.157.255.213:9007/upload',
// url: 'http://api.crm.hnxinyouhe.com/upload',
url: 'http://219.157.255.213:9007',
filePath: imgUrl,
name: 'files',
header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')},
@@ -414,10 +516,104 @@
.u-divider{
margin: 0px 0px !important;
}
.contents{
background-color:#F6F6F6;
border-radius: 10px;
margin: 0px 15px 10px;
.edt{
display: flex;
justify-content: center;
}
.btn{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
text-align: center;
border-radius: 20px;
width: 100px;
margin-bottom: 10px;
padding: 4px 0px;
}
.top{
padding: 10px 15px 0px;
display: flex;
align-items: center;
justify-content: space-between;
.tag{
color: white;
border-radius: 20px 0px 0px 20px;
padding: 3px 10px;
margin-right: -15px;
}
.right{
display: flex;
align-items: center;
.medal{
margin-right: 10px;
}
}
}
.name{
font-size: 32rpx;
font-weight: bold;
margin-right: 10px;
}
.cont{
padding: 0px 15px 10px;
font-size: 24rpx;
.title{
display: flex;
align-items: center;
justify-content: space-between;
color: #222222;
}
.ststus{
color: #666666;
}
.info,.desc{
color: #78758E;
line-height: 26px;
}
.sex{
margin-right: 5px;
}
.addr{
margin-left: 5px;
}
.type{
margin-left: 5px;
color: #3471FF;
}
}
}
.content{
padding-top: 10px;
background: #FFFFFF;
// height: calc(100vh - 44px);
}
.cell2{
position: relative;
display: flex;
justify-content:space-between;
padding: 18px 20px;
align-items: center;
font-weight: 500;
margin: 0px 15px 10px;
.item{
width: 90px;
color: #666666;
}
background: #f6f6f6;
border-radius: 10px;
.right{
text-align: right;
}
.select{
display: flex;
position: relative;
margin-right: 10px;
}
}
.cell{
position: relative;
@@ -462,7 +658,7 @@
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
border-radius: 50px;
width: 45%;
width: 93%;
height: 96rpx;
line-height: 96rpx;
margin-top: 20px;