页面功能修改

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
+18 -3
View File
@@ -1,6 +1,6 @@
// const baseUrl = "https://api.collect.hs.hnzhwlkj.club/"; //这里放置url域名32044
// const baseUrl = "http://192.168.0.72:8083/api/v1/"; //这里放置url域名32044
const baseUrl = "http://219.157.255.213:9007/"; //这里放置url域名32044
// const baseUrl = "http://api.crm.hnxinyouhe.com/"; //这里放置url域名32044
// const baseUrl = "http://192.168.50.4:8787/"; //这里放置url域名32044
// const baseUrl = "/api/"; //这里放置url域名32044
export function request(options){//封装的requset
@@ -17,9 +17,23 @@ export function request(options){//封装的requset
header:{'content-type': 'application/x-www-form-urlencoded','Authorization': 'Bearer ' + uni.getStorageSync('token')},
method:method||"GET",//默认请求方式是get
success: (res) => {
resolve(res)
if(res.data.code==401){
uni.showToast({
title: res.data.message,
icon: 'none'
});
setTimeout(() => {
uni.reLaunch({
url: '/pages/login/index',// 替换为你要跳转的页面路径
});
}, 1000);
}else{
resolve(res)
}
},
complete: (data)=>{
console.log(data.code)
uni.hideLoading();
}
});
@@ -38,6 +52,7 @@ export function requestx(options){//封装的requset
resolve(res)
},
complete: (data)=>{
}
});
})
+9 -1
View File
@@ -30,6 +30,7 @@ export default {
followtype:'Follow up method',
Online:'On line',
Visit:'Visit',
addfollow:'follow up',
followtime:'Follow up time',
updataimg:'Upload follow-up chat screenshot',
followrecord:'Follow up records',
@@ -136,7 +137,14 @@ export default {
newpassword:'Password',
Confirmpassword:'Confirm password',
Confirmbtn:'Confirm modification',
edtbtn:'edit',
zh:'Chinese',
en:'English',
ru:'Russian'
ru:'Russian',
subsuccess:'Successful',
onedaygj:'1 day later',
threedaygj:'3 day later',
sevendaygj:'7 day later',
autodaygj:'Customize',
nexttime:'Next follow-up reminder setting',
}
+9 -1
View File
@@ -29,6 +29,7 @@ export default {
followtype:'跟进方式',
Online:'在线跟进',
Visit:'拜访',
addfollow:'添加跟进',
followtime:'跟进时间',
updataimg:'上传跟进最后聊天截图',
followrecord:'跟进记录',
@@ -135,7 +136,14 @@ export default {
newpassword:'新密码',
Confirmpassword:'确认密码',
Confirmbtn:'确认修改',
edtbtn:'编辑资料',
zh:'中文',
en:'英语',
ru:'俄语'
ru:'俄语',
subsuccess:'提交成功',
onedaygj:'1天后',
threedaygj:'3天后',
sevendaygj:'7天后',
autodaygj:'自定义',
nexttime:'下次跟进提醒设置',
}
+23 -3
View File
@@ -22,7 +22,7 @@
"style" :
{
"navigationBarTitleText": "首页",
"enablePullDownRefresh": true,
"enablePullDownRefresh": false,
"navigationStyle":"custom",// 去掉微信小程序顶部导航
"app-plus":{
"titleNView":false //去掉app+h5顶部导航
@@ -46,7 +46,7 @@
"path" : "pages/login/agreement",
"style" :
{
"navigationBarTitleText" : "隐私政策",
"navigationBarTitleText" : "用户协议",
"enablePullDownRefresh": false,
"navigationStyle":"custom"// 去掉微信小程序顶部导航
}
@@ -55,7 +55,9 @@
"path" : "pages/login/agreementuser",
"style" :
{
"navigationBarTitleText" : "用户服务协议"
"navigationBarTitleText" : "隐私协议",
"enablePullDownRefresh": false,
"navigationStyle":"custom"// 去掉微信小程序顶部导航
}
},
{
@@ -99,6 +101,15 @@
"navigationStyle":"custom"// 去掉微信小程序顶部导航
}
},
{
"path" : "editdetile",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh": false,
"navigationStyle":"custom"// 去掉微信小程序顶部导航
}
},
{
"path" : "followup",
"style" :
@@ -125,6 +136,15 @@
"enablePullDownRefresh": false,
"navigationStyle":"custom"// 去掉微信小程序顶部导航
}
},
{
"path" : "followsuccess",
"style" :
{
"navigationBarTitleText" : "",
"enablePullDownRefresh": false,
"navigationStyle":"custom"// 去掉微信小程序顶部导航
}
}
]
},{
+5 -2
View File
@@ -205,13 +205,16 @@
url: '/pages/customer/maph5'
});
// #endif
// #ifdef APP-PLUS
uni.navigateTo({
url: '/pages/customer/map'
});
// #endif
},
gomap1(){
uni.navigateTo({
url: '/pages/customer/map'
});
},
mapclose(){
this.showmap = false
+133 -249
View File
@@ -2,72 +2,31 @@
<view>
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('navbar.customerinfo')"></uni-nav-bar>
<view class="content">
<view class="cell">
<view class="item">{{$t('customer.CustomerChannel')}}</view>
<view class="right select" @click="showchannel = true">
<!-- <input :placeholder="$t('customer.CustomerChannelinput')" disabled v-model="channel_name" /> -->
<view class="" :class="['content2', { placeholder: !channel_name }]">{{channel_name || $t('customer.CustomerChannelinput')}}</view>
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
<view class="contents" >
<view class="top">
<view class="name">{{datas.contacts}}</view>
<view class="right">
<text class="medal" :style="{color:(datas.magnitude == 0 ?'#F5AB00' : datas.magnitude == 1 ?'#8495B8': '#9B7200')}">{{datas.magnitude_txt}}</text>
<text class="tag" :style="{background:(datas.follow == 0 ?'#3471FF' : datas.follow == 1 ?'#27C89C': '#FF4040')}">{{datas.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">{{datas.phone}}</text></view>
<view class="ststus">渠道:{{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>
<view class="edt">
<view class="btn" @click="editFn"><image src="/static/image/customer/edit.png" mode=""></image><text> {{$t('edtbtn')}}</text></view>
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Medal')}}</view>
<view class="right select" @click="showmagnitude = true">
<!-- <input :placeholder="$t('customer.Medalinput')" disabled v-model="magnitude_name" /> -->
<view class="" :class="['content2', { placeholder: !magnitude_name }]">{{magnitude_name || $t('customer.Medalinput')}}</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.CustomerName')}} <text class="red">*</text></view>
<view class="right">
<input :placeholder="$t('customer.CustomerNameinput')" v-model="form.contacts" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('gender')}}</view>
<view class="right">
<u-radio-group v-model="form.sex">
<u-radio :name="Number(0)">{{$t('gender0')}}</u-radio>
<u-radio :name="Number(1)" class="u-m-lr-10">{{$t('gender1')}}</u-radio>
<u-radio :name="Number(2)">{{$t('gender2')}}</u-radio>
</u-radio-group>
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('mine.lxcall')}} <text class="red">*</text></view>
<view class="right">
<input :placeholder="$t('mine.lxcallinputhd')" v-model="form.phone" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">Email</view>
<view class="right">
<input :placeholder="$t('customer.Emailinput')" v-model="form.email" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">WhatsApp</view>
<view class="right">
<input :placeholder="$t('customer.WhatsAppinput')" v-model="form.WhatsApp" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Customerph')}}</view>
<view class="right select" @click="showcartype = true">
<!-- <input :placeholder="$t('customer.Customerphinput')" disabled v-model="car_type_name" /> -->
<view class="" :class="['content2', { placeholder: !car_type_name }]">{{car_type_name || $t('customer.Customerphinput')}}</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.Cstomerfj')}}</view>
<view class="right select" @click="showgrade = true">
@@ -76,31 +35,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.Country')}}</view>
<view class="right select" @click="showarea = true">
<!-- <input :placeholder="$t('customer.Countryinput')" disabled v-model="country_name" /> -->
<view class="" :class="['content2', { placeholder: !country_name }]">{{country_name || $t('customer.Countryinput')}}</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.Company')}}</view>
<view class="right select" @click="gomap">
<!-- <input :placeholder="$t('customer.Companyinput')" type="text" disabled v-model="form.address"/> -->
<view class="" :class="['content2', { placeholder: !address }]">{{address || $t('customer.Companyinput')}}</view>
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
<u-line></u-line>
<view class="cell1">
<view class="item">{{$t('customer.Remarks')}}</view>
<view class="">
<textarea auto-height v-model="form.describe" :placeholder="$t('customer.Remarksinputhd')"/>
</view>
</view>
</view>
<u-gap height="10" bgColor="#F6F6F6"></u-gap>
<view class="steps">
@@ -141,14 +75,10 @@
<empty :list="followList"></empty>
</view>
<view class="zw"></view>
<view class="foot">
<!-- <view class="foot">
<button class="btn" @click="nextFn">{{$t('submit')}}</button>
</view>
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :defaultIndex="defaultIndexqd" :show="showchannel" @cancel="cancel('showchannel')" @close="close('showchannel')" :columns="channelList" keyName="name" @confirm="channelChange"></u-picker>
<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>
</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-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">
@@ -178,40 +108,12 @@
showcartype: false,
showchannel: false,
showarea: false,
getGradeList:[],
carTypeList:[],
channelList:[],
magnitudeList:[],
getGradeList1:[],
carTypeLis1:[],
channelList1:[],
magnitudeList1:[],
areaList1:[],
areaList:[],
getGradeList:[],
grade_name:'',
car_type_name:'',
country_name:'',
channel_name:'',
magnitude_name:'',
defaultIndexqd:[0],
defaultIndexsj:[0],
defaultIndexph:[0],
defaultIndexfj:[0],
defaultIndexgj:[0],
form: {
contacts: '',
sex: 0,
phone: '',
email: '',
describe: '',
grade:'',
country_id:'',
car_type_id:'',
channel_id:'',
magnitude:'',
address:'',
lat:'',
lng:'',
},
datas:''
@@ -221,11 +123,7 @@
console.log(options);
this.id = options.id;
var that = this
this.getChannel()
this.getMagnitude()
this.getGrade()
this.carType()
this.area()
this.customerdetailfn()
},
@@ -250,36 +148,12 @@
},
select(){
var that=this;
that.channelList1.forEach((item,index) => {
if(item.id == that.form.channel_id){
that.channel_name = item.name
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
that.defaultIndexph=[index]
}
})
that.magnitudeList1.forEach((item,index) => {
if(item.id == that.form.magnitude){
that.magnitude_name = item.name
that.defaultIndexsj=[index]
}
})
that.areaList1.forEach((item,index) => {
if(item.id == that.form.country_id){
that.country_name = item.name
that.defaultIndexgj=[index]
}
})
},
//客户详情
customerdetailfn(){
@@ -321,17 +195,6 @@
mapconfirm(){
this.showmap = false
},
//渠道
getChannel(){
request({
url:'customer/getChannel',
method:'get',
}).then(res => {
var list = res.data.data
this.channelList1 = list
this.channelList = [list]
})
},
//客户等级
getGrade(){
request({
@@ -343,68 +206,31 @@
this.getGradeList1 = list
})
},
//偏好
carType(){
request({
url:'carType/getAll',
method:'get',
}).then(res => {
var list = res.data.data
this.carTypeList1 = list
this.carTypeList = [list]
})
},
//国家
area(){
request({
url:'area/getCountry',
method:'get',
}).then(res => {
var list = res.data.data
this.areaList1 = list
this.areaList = [list]
})
},
//商机
getMagnitude(){
request({
url:'customer/getMagnitude',
method:'get',
}).then(res => {
var list = res.data.data
this.magnitudeList1 = list
this.magnitudeList = [list]
})
},
//商机切换事件
magnitudeChange(val){
this.form.magnitude = val.value[0].id
this.magnitude_name = val.value[0].name
this.showmagnitude = false
},
//通道切换事件
channelChange(val){
this.form.channel_id = val.value[0].id
this.channel_name = val.value[0].name
this.showchannel = false
},
//客户等级切换事件
gradeHandler(val){
this.form.grade = val.value[0].id
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
},
//偏好切换事件
cartypesChange(val){
this.form.car_type_id = val.value[0].id
this.car_type_name = val.value[0].name
this.showcartype = false
request({
url:'customer/grade',
method:'post',
data:{
id:this.id,
grade:this.form.grade
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
// if(res.data.code ==0){
// setTimeout(() => {
// uni.reLaunch({
// url: '/pages/index/customer',// 替换为你要跳转的页面路径
// });
// }, 1000);
// }
})
},
cancel(val){
this[val] = false
@@ -412,6 +238,11 @@
close(val){
this[val] = false
},
editFn(){
uni.navigateTo({
url: '/pages/customer/editdetile?id='+this.id
});
},
nextFn(){
request({
url:'customer/save',
@@ -459,10 +290,6 @@
position: absolute;
top: 2px;
}
.content{
padding-top: 10px;
background: #FFFFFF;
}
.cell{
position: relative;
display: flex;
@@ -472,20 +299,14 @@
font-weight: 500;
.item{
width: 90px;
color: #666666;
}
background: #f6f6f6;
border-radius: 10px;
}
.arrowright{
margin-right: -15px;
}
.cell1{
font-size: 32rpx;
padding: 18px 20px;
align-items: center;
font-weight: 500;
.item{
width: 100px;
}
}
.right{
text-align: right;
}
@@ -494,6 +315,85 @@
position: relative;
margin-right: 10px;
}
.content{
padding: 10px 15px;
background: #FFFFFF;
.contents{
background-color:#F6F6F6;
border-radius: 10px;
margin-bottom: 10px;
.edt{
display: flex;
justify-content: right;
padding-bottom: 10px;
image{
width: 14px;
height: 14px;
margin-right: 5px;
vertical-align: middle;
}
}
.btn{
color: #3471FF;
text-align: right;
padding: 0px 15px 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;
}
}
}
}
.steps{
padding: 15px;
background: #fff;
@@ -527,20 +427,4 @@
}
}
}
.foot{
position: fixed;
bottom: 0px;
width: 100%;
height: 160rpx;
background: #FFFFFF;
z-index: 1;
}
.btn{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
border-radius: 50px;
width: 92%;
margin-bottom: 40px;
margin: 15px 4%;
}
</style>
+477
View File
@@ -0,0 +1,477 @@
<template>
<view>
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('navbar.customerinfo')"></uni-nav-bar>
<view class="content">
<view class="cell">
<view class="item">{{$t('customer.CustomerChannel')}}</view>
<view class="right select" @click="showchannel = true">
<!-- <input :placeholder="$t('customer.CustomerChannelinput')" disabled v-model="channel_name" /> -->
<view class="" :class="['content2', { placeholder: !channel_name }]">{{channel_name || $t('customer.CustomerChannelinput')}}</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.Medal')}}</view>
<view class="right select" @click="showmagnitude = true">
<!-- <input :placeholder="$t('customer.Medalinput')" disabled v-model="magnitude_name" /> -->
<view class="" :class="['content2', { placeholder: !magnitude_name }]">{{magnitude_name || $t('customer.Medalinput')}}</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.CustomerName')}} <text class="red">*</text></view>
<view class="right">
<input :placeholder="$t('customer.CustomerNameinput')" v-model="form.contacts" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('gender')}}</view>
<view class="right">
<u-radio-group v-model="form.sex">
<u-radio :name="Number(0)">{{$t('gender0')}}</u-radio>
<u-radio :name="Number(1)" class="u-m-lr-10">{{$t('gender1')}}</u-radio>
<u-radio :name="Number(2)">{{$t('gender2')}}</u-radio>
</u-radio-group>
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('mine.lxcall')}} <text class="red">*</text></view>
<view class="right">
<input :placeholder="$t('mine.lxcallinputhd')" v-model="form.phone" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">Email</view>
<view class="right">
<input :placeholder="$t('customer.Emailinput')" v-model="form.email" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">WhatsApp</view>
<view class="right">
<input :placeholder="$t('customer.WhatsAppinput')" v-model="form.WhatsApp" />
</view>
</view>
<u-line></u-line>
<view class="cell">
<view class="item">{{$t('customer.Customerph')}}</view>
<view class="right select" @click="showcartype = true">
<!-- <input :placeholder="$t('customer.Customerphinput')" disabled v-model="car_type_name" /> -->
<view class="" :class="['content2', { placeholder: !car_type_name }]">{{car_type_name || $t('customer.Customerphinput')}}</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.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>
<view class="right select" @click="showarea = true">
<!-- <input :placeholder="$t('customer.Countryinput')" disabled v-model="country_name" /> -->
<view class="" :class="['content2', { placeholder: !country_name }]">{{country_name || $t('customer.Countryinput')}}</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.Company')}}</view>
<view class="right select" @click="gomap">
<!-- <input :placeholder="$t('customer.Companyinput')" type="text" disabled v-model="form.address"/> -->
<view class="" :class="['content2', { placeholder: !form.address }]">{{form.address || $t('customer.Companyinput')}}</view>
<u-icon class="arrowright" name="arrow-right" size="18" color="#747474"></u-icon>
</view>
</view>
<u-line></u-line>
<view class="cell1">
<view class="item">{{$t('customer.Remarks')}}</view>
<view class="">
<textarea auto-height v-model="form.describe" :placeholder="$t('customer.Remarksinputhd')"/>
</view>
</view>
</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="defaultIndexqd" :show="showchannel" @cancel="cancel('showchannel')" @close="close('showchannel')" :columns="channelList" keyName="name" @confirm="channelChange"></u-picker>
<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>
</view>
</u-popup> -->
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
id:'',
followList:[],
showmap: false,
showmagnitude: false,
showgrade: false,
showcartype: false,
showchannel: false,
showarea: false,
getGradeList:[],
carTypeList:[],
channelList:[],
magnitudeList:[],
getGradeList1:[],
carTypeLis1:[],
channelList1:[],
magnitudeList1:[],
areaList1:[],
areaList:[],
grade_name:'',
car_type_name:'',
country_name:'',
channel_name:'',
magnitude_name:'',
defaultIndexqd:[0],
defaultIndexsj:[0],
defaultIndexph:[0],
defaultIndexfj:[0],
defaultIndexgj:[0],
form: {
contacts: '',
sex: 0,
phone: '',
email: '',
describe: '',
grade:'',
country_id:'',
car_type_id:'',
channel_id:'',
magnitude:'',
address:'',
lat:'',
lng:'',
},
datas:''
}
},
onLoad(options) {
console.log(options);
this.id = options.id;
var that = this
this.getChannel()
this.getMagnitude()
// this.getGrade()
this.carType()
this.area()
this.customerdetailfn()
},
onShow() {
if(uni.getStorageSync('location')){
this.location = JSON.parse(uni.getStorageSync('location'))
this.form.address = this.location.address
this.form.lng = this.location.lng
this.form.lat = this.location.lat
console.log(this.location)
}
this.followlistfn()
},
methods: {
leftClick(){
uni.navigateBack({})
},
gomap(){
uni.navigateTo({
url: '/pages/customer/map'
});
},
select(){
var that=this;
that.channelList1.forEach((item,index) => {
if(item.id == that.form.channel_id){
that.channel_name = item.name
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
that.defaultIndexph=[index]
}
})
that.magnitudeList1.forEach((item,index) => {
if(item.id == that.form.magnitude){
that.magnitude_name = item.name
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(){
var that=this;
request({
url:'customer/detail',
method:'get',
data: {
id:this.id,
}
}).then(res => {
that.datas = res.data.data
that.form = res.data.data
that.select()
})
},
// 跟进记录
followlistfn(){
request({
url:'follow/list',
method:'get',
data: {
customer_id:this.id,
}
}).then(res => {
this.followList = res.data.data
console.log(res.data.data)
})
},
//添加跟进
followupFn(){
uni.navigateTo({
url: '/pages/customer/followup?id='+this.id
});
},
mapclose(){
this.showmap = false
},
mapconfirm(){
this.showmap = false
},
//渠道
getChannel(){
request({
url:'customer/getChannel',
method:'get',
}).then(res => {
var list = res.data.data
this.channelList1 = list
this.channelList = [list]
})
},
//客户等级
getGrade(){
request({
url:'customer/getGrade',
method:'get',
}).then(res => {
var list = res.data.data
this.getGradeList = [list]
this.getGradeList1 = list
})
},
//偏好
carType(){
request({
url:'carType/getAll',
method:'get',
}).then(res => {
var list = res.data.data
this.carTypeList1 = list
this.carTypeList = [list]
})
},
//国家
area(){
request({
url:'area/getCountry',
method:'get',
}).then(res => {
var list = res.data.data
this.areaList1 = list
this.areaList = [list]
this.select()
})
},
//商机
getMagnitude(){
request({
url:'customer/getMagnitude',
method:'get',
}).then(res => {
var list = res.data.data
this.magnitudeList1 = list
this.magnitudeList = [list]
})
},
//商机切换事件
magnitudeChange(val){
this.form.magnitude = val.value[0].id
this.magnitude_name = val.value[0].name
this.showmagnitude = false
},
//通道切换事件
channelChange(val){
this.form.channel_id = val.value[0].id
this.channel_name = val.value[0].name
this.showchannel = false
},
//客户等级切换事件
gradeHandler(val){
this.form.grade = val.value[0].id
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
},
//偏好切换事件
cartypesChange(val){
this.form.car_type_id = val.value[0].id
this.car_type_name = val.value[0].name
this.showcartype = false
},
cancel(val){
this[val] = false
},
close(val){
this[val] = false
},
nextFn(){
request({
url:'customer/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/customer',// 替换为你要跳转的页面路径
});
}, 1000);
}
})
}
}
}
</script>
<style lang="scss">
.u-m-lr-10{
margin: 0px 10px;
}
.placeholder {
color: #999; /* 占位符颜色 */
}
textarea {
min-height: 200rpx;// 设置默认高度 ,解决设置自适应高度之后高度无效问题
margin-top: 15px;
background-color: #F6F6F6;
padding: 15px;
border-radius: 10px;
}
.red{
color: red;
}
.zw{
height: 120px;
}
.uniui-right{
position: absolute;
top: 2px;
}
.content{
padding-top: 10px;
background: #FFFFFF;
}
.cell{
position: relative;
display: flex;
justify-content:space-between;
padding: 18px 20px;
align-items: center;
font-weight: 500;
.item{
width: 90px;
}
}
.arrowright{
margin-right: -15px;
}
.cell1{
font-size: 32rpx;
padding: 18px 20px;
align-items: center;
font-weight: 500;
.item{
width: 100px;
}
}
.right{
text-align: right;
}
.select{
display: flex;
position: relative;
margin-right: 10px;
}
.foot{
position: fixed;
bottom: 0px;
width: 100%;
height: 160rpx;
background: #FFFFFF;
z-index: 1;
}
.btn{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
border-radius: 50px;
width: 92%;
margin-bottom: 40px;
margin: 15px 4%;
}
</style>
+201
View File
@@ -0,0 +1,201 @@
<template>
<view>
<uni-nav-bar leftText=" " :fixed="true" :border="false" leftIcon="back" @clickLeft="leftClick" color="#000000" backgroundColor="#fff" :statusBar="true" :title="$t('subsuccess')"></uni-nav-bar>
<view class="contents">
<image src="/static/image/customer/success.png" mode=""></image>
<view class="">{{$t('subsuccess')}}</view>
</view>
<u-gap height="10" bgColor="#F6F6F6"></u-gap>
<view class="cont">
<view>{{$t('nexttime')}}</view>
<view class="coll">
<u-row justify="space-between" gutter="10">
<u-col span="4">
<view class="item" :class="{ active: actives=='1' }" @click="active('1')">
{{$t('onedaygj')}}
</view>
</u-col>
<u-col span="4">
<view class="item" :class="{ active: actives=='3' }" @click="active('3')">
{{$t('threedaygj')}}
</view>
</u-col>
<u-col span="4">
<view class="item" :class="{ active: actives=='7' }" @click="active('7')">
{{$t('sevendaygj')}}
</view>
</u-col>
</u-row>
</view>
<view class="coll">
<view class="item" :class="{ active: actives=='auto' }" @click="active('auto')">
{{time || $t('autodaygj')}}
</view>
</view>
</view>
<view class="">
<button class="btn" @click="nextFn">{{$t('submit')}}</button>
</view>
<u-datetime-picker
:show="shownexttime"
closeOnClickOverlay
v-model="nexttime"
mode="datetime"
@confirm="confirmnext"
@cancel="cancelnext"
@close="close('shownexttime')"
></u-datetime-picker>
</view>
</template>
<script>
import { request,showToast } from '@/api/apiT.js'
export default {
data() {
return {
id:'',
actives:'',
time:'',
shownexttime:false,
nexttime: Number(new Date()),
}
},
onLoad(options) {
console.log(options);
this.id = options.id;
},
methods: {
leftClick(){
uni.navigateBack({})
},
active(item){
console.log(item)
if(item=='auto'){
this.shownexttime = true
}
this.actives = item
},
result(time, mode) {
const timeFormat = uni.$u.timeFormat
switch (mode) {
case 'datetime':
return timeFormat(time, 'yyyy-mm-dd hh:MM')
case 'date':
return timeFormat(time, 'yyyy-mm-dd')
case 'year-month':
return timeFormat(time, 'yyyy-mm')
case 'time':
return time
default:
return ''
}
},
cancelnext() {
this.shownexttime = false
},
confirmnext(e) {
this.shownexttime = false
this.nexttime = e.value
this.time = this.result(e.value, e.mode)
console.log(this.nexttime)
},
getLaterDate(dayNum, dateTime = null) {
// 如果为null,则格式化当前时间为时间戳
if (!dateTime) dateTime = +new Date();
// 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
if (dateTime.toString().length == 10) dateTime *= 1000;
const timestamp = +new Date(Number(dateTime));
const one_day = 86400000; // 24 * 60 * 60 * 1000;
const addVal = dayNum * one_day + timestamp;
//x天后的日期
const date = new Date(addVal);
//格式化日期
const filters = n => {
return n < 10 ? (n = '0' + n) : n;
};
const month = filters(date.getMonth() + 1);
const day = filters(date.getDate());
const hours = filters(date.getHours());
const minutes = filters(date.getMinutes());
const seconds = filters(date.getSeconds());
const lastTime = `${date.getFullYear()}/${month}/${day} ${hours}:${minutes}:${seconds}`;
// console.log(lastTime)
return addVal;
},
nextFn(){
var nexttime=this.nexttime;
if(this.actives==1){
nexttime = this.getLaterDate(1)
}
if(this.actives==3){
nexttime = this.getLaterDate(3)
}
if(this.actives==7){
nexttime = this.getLaterDate(7)
}
console.log(nexttime)
request({
url:'customer/followNext',
method:'post',
data:{
id:this.id,
follow_next:nexttime/1000
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
if(res.data.code ==0){
setTimeout(() => {
uni.reLaunch({
url: '/pages/index/customer',// 替换为你要跳转的页面路径
});
}, 1000);
}
})
},
}
}
</script>
<style lang="scss">
.contents{
text-align: center;
padding-bottom: 15px;
image{
margin-top: 20px;
width:392rpx;
height:308rpx;
}
}
.cont{
padding: 15px;
}
.active{
color: white !important;
background: linear-gradient(to right, #3471FF, #6776FF) !important;
}
.coll{
margin-top: 10px;
.item{
background: #ECF2FF;
color: #3471FF;
border-radius: 8px;
padding:10px 0px;
text-align: center;
}
}
.btn{
background: linear-gradient(to right, #3471FF, #6776FF);
color: white;
border-radius: 8px;
width: 92%;
margin-bottom: 40px;
margin: 15px 4%;
}
</style>
+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;
+96 -125
View File
@@ -2,9 +2,18 @@
<view>
<view id="map" style="height: 100vh;"></view>
<!-- 输入框事件 -->
<view class="search-box">
<input id="search-box" type="text" v-model="cityInfo.address" @input="ListeningInputBox" placeholder="请输入搜索地址...">
<view id="btn">确定</view>
<view style="display: flex; padding: 30rpx; position: fixed;width: 93%; background: white; top: 0px;">
<input v-model="value" type="text" id="search-box" placeholder="请输入" class="search" @input="getPlacesList" />
<view class="btn" @click="nextfn">确定</view>
</view>
<view class="card" v-if="list.length > 0">
<view class="item" v-for="(item, index) in list" :key="index">
<view @click="confirm(item)">
<span class="title">{{item.structured_formatting.main_text}}</span>
<span>{{item.structured_formatting.secondary_text}}</span>
</view>
</view>
</view>
</view>
</template>
@@ -12,13 +21,17 @@
import { Loader } from "@googlemaps/js-api-loader";
const loader = new Loader({
// google服务的KEY
apiKey: "AIzaSyBGvV-vX7C72PEbcYrTdmUj3qrubejWzNw",
apiKey: "AIzaSyCiQdUlA2QrEBEaZthoj7B18HTz6sxU_3I",
version: "weekly",
libraries: ["places"]
});
export default {
data() {
return {
map:'',
value: '',
// 模糊匹配数据
list: [],
cityInfo:{
lat: '',
lng: '',
@@ -36,6 +49,50 @@ export default {
this.initMap()
},
methods:{
nextfn(){
uni.setStorageSync('location',JSON.stringify(this.cityInfo));
uni.navigateBack({})
},
// 模糊查询地址
getPlacesList() {
var that = this
var text = this.value
return new Promise(async(resolve, reject) => {
if (!text){
that.list = []
resolve([])
}
const autocomplete = new google.maps.places.AutocompleteService();
autocomplete.getPlacePredictions({ input: text }, function(predictions, status) {
that.list = predictions
});
});
},
confirm(item){
var that = this
// var latlng = JSON.parse(JSON.stringify(place.geometry.location))
console.log("place===", item.description)
that.value = item.description
that.cityInfo.address=item.description
var geocoder = new google.maps.Geocoder();
// var address = document.getElementById("address").value;
geocoder.geocode( { 'address': item.description}, function(results, status) {
console.log(results)
var latlng = JSON.parse(JSON.stringify(results[0].geometry.location))
console.log(latlng)
// // 将地图中心点指向用户所选位置,并设置标记
that.map.setCenter(latlng);
that.cityInfo.lat=latlng.lat
that.cityInfo.lng=latlng.lng
var searchmarker = new google.maps.Marker({
map: that.map,
position: results[0].geometry.location,
title: results[0].formatted_address
});
});
that.list =[]
},
initMap() {
var that = this
loader
@@ -45,7 +102,7 @@ export default {
type: 'wgs84', // 默认为 wgs84 坐标系,可选 gcj02
success: function (res) {
console.log(res)
const map = new google.maps.Map(document.getElementById("map"),
that.map = new google.maps.Map(document.getElementById("map"),
{
center: { lat:res.latitude, lng: res.longitude},
zoom: 12,// 地图缩放参数
@@ -56,7 +113,7 @@ export default {
)
var marker = new google.maps.Marker({
position: { lat:res.latitude, lng: res.longitude},
map: map,
map: that.map,
draggable: true, // 允许拖动标记
icon: {
url: 'https://now.guua.com/attachs/default/location_shop.png',
@@ -68,7 +125,7 @@ export default {
// 监听标记拖动事件
marker.addListener('dragend', () => {
const position = marker.getPosition();
map.setCenter(position);
that.map.setCenter(position);
// 根据标记位置获取地址信息
const geocoder = new google.maps.Geocoder();
geocoder.geocode({ location: position }, (results, status) => {
@@ -78,12 +135,8 @@ export default {
that.cityInfo.address = results[0].formatted_address;
that.cityInfo.lat = position.lat();
that.cityInfo.lng = position.lng();
console.log(that.cityInfo)
// cityInfo.address = results[0].formatted_address;
// updateInfo({
// formatted_address: results[0].formatted_address,
// geometry: { location: position },
// });
that.value = results[0].formatted_address;
console.log(that.cityInfo)
} else {
alert('无法获取地址信息');
}
@@ -102,121 +155,39 @@ export default {
.catch((e) => {
console.log(e)
})
},
ListeningInputBox() {
// 创建 Autocomplete 实例
const input = document.getElementById("search-box");
const autocomplete = new google.maps.places.AutocompleteService();
// 设置 Autocomplete 参数
// autocomplete.setFields(["geometry", "name"]);
// 添加事件监听器,当用户选择某个地点时,在地图上标记出所选位置
// LoadAnimation(true)
autocomplete.getPlacePredictions(this.cityInfo.address, function() {
const place = autocomplete.getPlace();
var latlng = JSON.parse(JSON.stringify(place.geometry.location))
console.log("place===", latlng)
getAddress(latlng.lat, latlng.lng);
if (!place.geometry) {
console.log("返回的地理信息无效!");
return;
}
// 将地图中心点指向用户所选位置,并设置标记
if (searchmarker) { //去除marker标记点
searchmarker.setMap(null)
searchmarker = ""
}
map.setCenter(place.geometry.location);
searchmarker = new google.maps.Marker({
map: map,
position: place.geometry.location,
title: place.name,
});
});
},
getAddress(latitude, longitude) {
var that=this
// 根据经纬度发起 Reverse Geocoding API 请求,获取地址信息
var geocoder = new google.maps.Geocoder();
var latlng = {
lat: latitude,
lng: longitude
};
this.cityInfo.lats = latitude
this.cityInfo.lng = longitude
geocoder.geocode({
location: latlng
}, function(results, status) {
if (status === 'OK') {
if (results[0]) {
console.log(results[0])
for (var i = 0; i < results.length; i++) {
var components = results[i].address_components;
for (var j = 0; j < components.length; j++) {
var component = components[j];
if (component.types.includes("country")) {
console.log("国家: ====>" + component.long_name);
cityInfo.country = component.long_name || '暂无';
} else if (component.types.includes("administrative_area_level_1")) {
console.log("省/州: ====>" + component.long_name);
cityInfo.province = component.long_name || '暂无';
} else if (component.types.includes("locality")) {
console.log("城市: ====> " + component.long_name);
cityInfo.city = component.long_name || '暂无';
} else if (component.types.includes("sublocality_level_1")) {
console.log("区/县: ====>" + component.long_name);
cityInfo.district = component.long_name || '暂无';
} else if (component.types.includes("route")) {
console.log("路/街道名: ====> " + component.long_name);
cityInfo.street = component.long_name || '暂无';
} else if (component.types.includes("street_number")) {
console.log("门牌号: ====> " + component.long_name);
cityInfo.door = component.long_name || '暂无';
}
}
}
that.cityInfo.address = results[0].formatted_address;
console.log("cityInfo==========", that.cityInfo)
// addInfo(cityInfo)
} else {
alert('找不到地址信息');
}
} else {
alert('获取地址信息失败:' + status);
}
});
}
},
}
</script>
<style lang="scss">
.search-box{
width: 99%;
left: 2%;
top: 80px;
font-size: 12px;
position: fixed;
padding: 5px;
display: flex;
align-items: center;
}
#search-box {
height: 30px;
padding: 5px;
font-size: 16px;
border-radius: 4px;
border: 1px solid #ccc;
box-shadow: 0px 1px 3px #ddd;
width:70%;
background: #fff;
}
#btn{
padding: 10px 20px;
text-align: center;
background: #fff;
border: 1px solid #bbbbbb;
border-radius: 6px;
margin-left: 10px;
}
.search {
flex: 1;
height: 70rpx;
padding: 0 30rpx;
margin-right: 20rpx;
border: 1rpx solid #ccc;
border-radius: 10rpx;
}
.btn {
color: #fff;
font-size: 28rpx;
height: 70rpx;
line-height: 70rpx;
padding: 0 20rpx;
background: #3c9cff;
border-radius: 10rpx;
}
.card {
position: fixed;width: 100%; top:60px;
background-color: white;
padding: 0 30rpx;
.item {
padding: 20rpx 0;
border-bottom: 2rpx solid #ccc;
.title {
margin-right: 20rpx;
font-weight: 700;
}
}
}
</style>
+94 -43
View File
@@ -3,7 +3,9 @@
<z-paging ref="paging" v-model="datalist" @query="queryList" empty-view-text='暂无数据!'>
<template #top>
<view class="top">
<view class="navbar">{{$t('customer.title')}}</view>
<!-- <view class="navbar">{{$t('customer.title')}}</view> -->
<uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="#3471ff" :statusBar="true" :title="$t('customer.title')"></uni-nav-bar>
<view class="topSearch">
<view class="left">
<u-search v-model="keyword" bgColor="#fff" search-icon=" " :show-action="false" :placeholder="$t('customer.inputhd')"></u-search>
@@ -16,37 +18,43 @@
</view>
</view>
</view>
<view class="tabsbg">
<u-tabs :list="list1" lineColor="#fff" :scrollable="false" @click="tabclick" :inactiveStyle="{color: '#fff'}" :activeStyle="{color: '#fff',fontWeight: 'bold',transform: 'scale(1.05)'}"></u-tabs>
</view>
</template>
<view class="list">
<view class="contents" v-for="(item, index) in datalist" :key="index" >
<view class="" @click="godetile(item)">
<view class="top">
<view class="">{{item.created_at}}</view>
<view class="right">
<text class="medal" :style="{color:(item.magnitude == 0 ?'#F5AB00' : item.magnitude == 1 ?'#8495B8': '#9B7200')}">{{item.magnitude_txt}}</text>
<text class="tag" :style="{background:(item.follow == 0 ?'#3471FF' : item.follow == 1 ?'#27C89C': '#FF4040')}">{{item.follow_txt}}</text>
<u-swipe-action>
<u-swipe-action-item :options="options1" v-for="(item, index) in datalist" :key="index" @click="delClick(item)">
<view class="contents" >
<view class="" @click="godetile(item)">
<view class="top">
<view class="">{{item.created_at}}</view>
<view class="right">
<text class="medal" :style="{color:(item.magnitude == 0 ?'#F5AB00' : item.magnitude == 1 ?'#8495B8': '#9B7200')}">{{item.magnitude_txt}}</text>
<text class="tag" :style="{background:(item.follow == 0 ?'#3471FF' : item.follow == 1 ?'#27C89C': '#FF4040')}">{{item.follow_txt}}</text>
</view>
</view>
<u-line margin="20rpx 0px"></u-line>
<view class="cont">
<view class="title">
<view class=""><text class="name">{{item.contacts}}</text><text class="phone">{{item.phone}}</text></view>
<view class="ststus">{{item.grade_txt}}</view>
</view>
<view class="info"><text class="sex">{{item.sex_txt}}</text> | <text class="addr">{{item.country_name}}</text><text class="type">{{item.car_type_name}}</text>
</view>
</view>
</view>
<view class="desc1">
<view class="" @click="callPhone(item)"><image src="/static/image/customer/phone.png" mode=""></image> {{$t('call')}}</view>
<view class="" @click="editClick(item)"><image src="/static/image/customer/edit.png" mode=""></image> {{$t('customer.addfollow')}}</view>
<!-- <view class="" @click="delClick(item)"><image src="/static/image/customer/trash.png" mode=""></image> {{$t('delete')}}</view> -->
</view>
</view>
<u-line margin="20rpx 0px"></u-line>
<view class="cont">
<view class="title">
<view class=""><text class="name">{{item.contacts}}</text><text class="phone">{{item.phone}}</text></view>
<view class="ststus">{{item.grade_txt}}</view>
</view>
<view class="info"><text class="sex">{{item.sex_txt}}</text> | <text class="addr">{{item.country_name}}</text><text class="type">{{item.car_type_name}}</text>
</view>
</view>
</view>
<view class="desc1">
<view class="" @click="callPhone(item)"><image src="/static/image/customer/phone.png" mode=""></image> {{$t('call')}}</view>
<view class="" @click="editClick(item)"><image src="/static/image/customer/edit.png" mode=""></image> {{$t('followup')}}</view>
<view class="" @click="delClick(item)"><image src="/static/image/customer/trash.png" mode=""></image> {{$t('delete')}}</view>
</view>
</view>
</u-swipe-action-item>
</u-swipe-action>
</view>
</z-paging>
<u-picker :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" :columns="columns" @cancel="cancel" @confirm="confirm" :title="$t('customer.CustomerScreening')" keyName="label"></u-picker>
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" :columns="columns" @cancel="cancel" @close="cancel" @confirm="confirm" :title="$t('customer.CustomerScreening')" keyName="label"></u-picker>
<u-popup :show="showts" :closeOnClickOverlay="false" :round="20" mode="center">
<view class="popupcontent">
<view class="title">{{$t('prompt')}}</view>
@@ -74,28 +82,17 @@
export default {
data() {
return {
options1: [],
x: 300, //x坐标
y: 550, //y坐标
keyword:'',
follow_last:'',
follow:'',
show:false,
showts:false,
del_id:'',
columns:[
[{
label: this.$t('all'),
id:''
},{
label:this.$t('tday'),
id: 0
}, {
label: this.$t('threeday'),
id: 1
}, {
label: this.$t('sevenday'),
id: 2
}]
],
columns:[],
list1: [],
datalist:[],
}
},
@@ -105,6 +102,42 @@
this.y = windowHeight-55
uni.removeStorageSync('location')
},
onShow() {
this.options1=[{
text: this.$t('delete'),
style: {
backgroundColor: '#f56c6c'
}
}]
this.list1=[{
name: this.$t('all'),
id:'all'
}, {
name: this.$t('followup'),
id:'followup'
}, {
name: this.$t('deal'),
id:'deal'
}, {
name: this.$t('lost'),
id:'lost'
}]
this.columns=[
[{
label: this.$t('all'),
id:''
},{
label:this.$t('tday'),
id: 0
}, {
label: this.$t('threeday'),
id: 1
}, {
label: this.$t('sevenday'),
id: 2
}]
]
},
methods: {
searchCli(){
this.queryList(1, 10)
@@ -121,6 +154,16 @@
cancel() {
this.show = false
},
//tab标签切换
tabclick(e){
console.log(e)
if(e.id=='all'){
this.follow=''
}else{
this.follow=e.index - 1
}
this.queryList(1, 10)
},
//客户列表数据
queryList(pageNo, pageSize) {
var that = this;
@@ -128,6 +171,7 @@
url:'customer/list',
method:'get',
data: {
follow:this.follow,
page:pageNo,
per_page:10,
keyword:this.keyword,
@@ -216,6 +260,10 @@
uni-page-body {
background-color: #F6F6F6 !important;
}
.u-swipe-action-item {
margin-bottom: 10px;
border-radius: 10px;
}
.conts{
background-image: url("/static/image/customer/bg.png");
background-size: 100%;
@@ -224,7 +272,7 @@
}
.navbar{
/* #ifdef APP-PLUS */
padding-top: 44px;
// padding-top: 20px;
/* #endif */
height: 44px;
line-height: 44px;
@@ -257,7 +305,10 @@
padding: 6px 16px 2px;
text-align: center;
position: absolute;
top: 3px;
/* #ifdef APP-PLUS */
top: 3px;
/* #endif */
top: 2px;
right: 5px;
font-size: 12px;
image{
+68 -125
View File
@@ -1,57 +1,55 @@
<template>
<view class="content">
<z-paging ref="paging" v-model="datalist" @query="queryList" style="background: #F3F3F3;"
empty-view-text='暂无数据!' >
<template #top>
<view class="contop">
<view class="changeyy" @click="showlang = true">
<image src="/static/image/change.png" mode=""></image>{{$t('home.langbtn')}}
</view>
<view class="title">
{{$t('home.title')}} CRM
</view>
<view class="num">
{{statisticsdata.day}}<text>{{$t('home.day')}}</text>
</view>
</view>
<view class="data-briefing">
<view class="top">
<text>{{$t('home.databf')}}</text>
<view class="time" @click="show = true">
<image src="/static/image/time.png" mode=""></image>
<u--input v-model="time" border="none" disabled disabledColor="#ffffff"
style="width: 65px;margin-left: 5px;"></u--input>
<u-icon name="arrow-down" color="#666666" size="16"></u-icon>
</view>
</view>
<view class="cont">
<u-grid :border="false">
<u-grid-item>
<text class="grid-num">{{statisticsdata.customer}}</text>
<text class="grid-text">{{$t('home.addkh')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.visit}}</text>
<text class="grid-text">{{$t('home.addbf')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.follow}}</text>
<text class="grid-text">{{$t('home.addgj')}}</text>
</u-grid-item>
</u-grid>
</view>
</view>
<view class="tabsbg">
<u-tabs :list="list1" :scrollable="false" @click="tabclick"></u-tabs>
</view>
</template>
<view class="userlist">
<view class="list">
<userlist :list="datalist" @click="godetile">
</userlist>
<view class="contop">
<view class="changeyy" @click="showlang = true">
<image src="/static/image/change.png" mode=""></image>{{$t('home.langbtn')}}
</view>
<view class="title">
{{$t('home.title')}} CRM
</view>
<view class="num">
{{statisticsdata.day}}<text>{{$t('home.day')}}</text>
</view>
</view>
<view class="data-briefing">
<view class="top">
<text>{{$t('home.databf')}}</text>
<view class="time" @click="show = true">
<image src="/static/image/time.png" mode=""></image>
<u--input v-model="time" border="none" disabled disabledColor="#ffffff"
style="width: 65px;margin-left: 5px;"></u--input>
<u-icon name="arrow-down" color="#666666" size="16"></u-icon>
</view>
</view>
</z-paging>
<view class="cont">
<u-grid :border="false">
<u-grid-item>
<text class="grid-num">{{statisticsdata.customer}}</text>
<text class="grid-text">{{$t('home.addkh')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.visit}}</text>
<text class="grid-text">{{$t('home.addbf')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.follow}}</text>
<text class="grid-text">{{$t('home.addgj')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.customer_init}}</text>
<text class="grid-text">{{$t('followup')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.customero_fllow}}</text>
<text class="grid-text">{{$t('deal')}}</text>
</u-grid-item>
<u-grid-item>
<text class="grid-num">{{statisticsdata.customer_deal}}</text>
<text class="grid-text">{{$t('lost')}}</text>
</u-grid-item>
</u-grid>
</view>
</view>
<u-datetime-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" :show="show" @close="close('show')" v-model="value1"
@confirm="confirm" @cancel="cancel" mode="year-month"></u-datetime-picker>
<u-picker closeOnClickOverlay :cancel-text="$t('cancel')" :confirm-text="$t('confirm')" @close="close('showlang')" :show="showlang" :columns="columns"
@@ -64,11 +62,7 @@
request,
showToast
} from '@/api/apiT.js'
import userlist from '@/components/userlist/index.vue';
export default {
components: {
userlist
},
data() {
return {
statisticsdata:{},
@@ -94,19 +88,7 @@
id: 'ru'
}]
],
list1: [{
name: this.$t('all'),
id:'all'
}, {
name: this.$t('followup'),
id:'followup'
}, {
name: this.$t('deal'),
id:'deal'
}, {
name: this.$t('lost'),
id:'lost'
}]
}
},
onLoad() {
@@ -130,15 +112,6 @@
close(value){
this[value] = false
},
// 处理滚动事件
onPageScroll(event) {
const scrollTop = event.scrollTop || 0;
if (scrollTop > 310) { // 吸顶条件
this.headerBgColor = '#E6EDFF'; // 吸顶时设置背景色
} else {
this.headerBgColor = 'transparent'; // 取消吸顶时恢复背景色
}
},
//统计数据
getstatistics(){
request({
@@ -173,15 +146,6 @@
id: 'ru'
}]
];
this.list1 = [{
name: this.$t('all'),
}, {
name: this.$t('followup'),
}, {
name: this.$t('deal')
}, {
name: this.$t('lost')
}];
uni.setTabBarItem({
index: 0,
text: this.$t('tabbar.home')
@@ -194,16 +158,22 @@
index: 2,
text: this.$t('tabbar.mine')
})
},
//tab标签切换
tabclick(e){
console.log(e)
if(e.id=='all'){
this.follow=''
}else{
this.follow=e.index - 1
var language = e.value[0].id
if(e.value[0].id=='zh-Hans'){
language= 'zh_CN'
}
this.queryList(1, 10)
request({
url:'user/language',
method:'POST',
data:{
language: language,
}
}).then(res => {
uni.showToast({
title: res.data.message,
icon: 'none'
});
})
},
//日期选择组件
confirm(e) {
@@ -224,35 +194,6 @@
this.time = timeFormat(time, 'yyyy-mm')
return timeFormat(time, 'yyyy-mm')
},
//客户列表数据
queryList(pageNo, pageSize) {
var that = this;
request({
url: 'customer/list',
method: 'get',
data: {
page: pageNo,
per_page: 10,
follow:this.follow
}
}).then(res => {
console.log(res.data)
if (res.data.code == 0) {
var datas = res.data.data.list;
this.$refs.paging.complete(datas);
} else {
// this.$refs.paging.complete(null);
// that.listlength=0
}
uni.stopPullDownRefresh();
})
},
godetile(item) {
console.log(item)
uni.navigateTo({
url: '/pages/customer/detile?id='+item.id
});
}
}
}
</script>
@@ -262,7 +203,9 @@
width: 18px;
height: 18px;
}
.u-grid-item{
margin-bottom: 20px;
}
.tabsbg {
border-radius: 16px 16px 0px 0px;
background: #E6EDFF
@@ -287,7 +230,7 @@
font-size: 28rpx;
position: relative;
background: #F6F6F6;
height: 100vh;
.contop {
background-image: url("/static/image/topbg.png");
background-size: 100%;
+33 -25
View File
@@ -1,24 +1,28 @@
<template>
<view class="contents">
<view class="navbar">{{$t('mine.title')}}</view>
<!-- <uni-nav-bar leftText=" " :fixed="true" :border="false" @clickLeft="leftClick" color="#fff" backgroundColor="#4579ff" :statusBar="true" :title="$t('mine.title')"></uni-nav-bar> -->
<!-- <view class="navbar">{{$t('mine.title')}}</view> -->
<view class="navbar"></view>
<view class="content">
<view class="contop">
<view class="">
<!-- <image class="userimg" :src="userinfo.avatar" mode=""></image> -->
<image class="userimg" src="/static/image/mine/user.png" mode=""></image>
</view>
<view class="right" @click="changinfo">
<!-- <view class="right" @click="changinfo"> -->
<view class="right">
<view class="">
<text>迪士尼公主</text>
<image src="/static/image/mine/edit.png" mode=""></image>
<text>{{userinfo.email}}</text>
<!-- <image src="/static/image/mine/edit.png" mode=""></image> -->
</view>
<view class="mineid">
ID:080427
ID:{{userinfo.id}}
</view>
</view>
</view>
<view class="bottomCon">
<view class="sonContent" @click="navTo('/pages/mine/massege')">
<!-- <view class="sonContent" @click="navTo('/pages/mine/massege')">
<image class="son-img-bg" src="/static/image/mine/icon1.png"></image>
<span>{{$t('mine.msg')}}</span>
<view class="">
@@ -27,33 +31,33 @@
</view>
<uni-icons type="right" class="icon" size="18"></uni-icons>
</view>
</view>
<view class="sonContent" @click="navTo('/pages/mine/resetPwd')">
</view> -->
<!-- <view class="sonContent" @click="navTo('/pages/mine/resetPwd')">
<image class="son-img-bg" src="/static/image/mine/icon2.png"></image>
<span>{{$t('mine.cpassword')}}</span>
<uni-icons type="right" class="icon" size="18"></uni-icons>
</view>
</view> -->
<view class="sonContent" @click="show=true">
<image class="son-img-bg" src="/static/image/mine/icon3.png"></image>
<span>{{$t('mine.contact')}}</span>
<uni-icons type="right" size="18" class="icon"></uni-icons>
</view>
<view class="sonContent" @click="navTo('/pages/mine/feedback')">
<!-- <view class="sonContent" @click="navTo('/pages/mine/feedback')">
<image class="son-img-bg" src="/static/image/mine/icon4.png"></image>
<span>{{$t('mine.feedback')}}</span>
<uni-icons type="right" class="icon" size="18"></uni-icons>
</view>
</view> -->
<view class="sonContent" @click="navTo('/pages/mine/about')">
<image class="son-img-bg" src="/static/image/mine/icon5.png"></image>
<span>{{$t('mine.about')}}</span>
<uni-icons type="right" class="icon" size="18"></uni-icons>
</view>
<view class="sonContent" @click="navTo('/pages/mine/logoff')">
<!-- <view class="sonContent" @click="navTo('/pages/mine/logoff')">
<image class="son-img-bg" src="/static/image/mine/icon6.png"></image>
<span>{{$t('mine.logoff')}}</span>
<uni-icons type="right" class="icon" size="18"></uni-icons>
</view>
<view class="sonContent" @click="navTo('/pages/login/index')">
</view> -->
<view class="sonContent" @click="logout">
<image class="son-img-bg" src="/static/image/mine/icon7.png"></image>
<span>{{$t('mine.logout')}}</span>
<uni-icons type="right" class="icon" size="18"></uni-icons>
@@ -67,8 +71,8 @@
<view class="popupcontent">
<image class="log1" src="/static/image/mine/kefu.png"></image>
<view class="title">{{$t('mine.kfphone')}}</view>
<view class="calls">13545678952</view>
<button class="btn" @click="callPhone()">{{$t('call')}}</button>
<view class="calls">18137110386</view>
<button class="btn" @click="callPhone('18137110386')">{{$t('call')}}</button>
</view>
</u-popup>
</view>
@@ -84,7 +88,7 @@
}
},
onLoad() {
this.userinfo =JSON.parse(uni.getStorageSync('userinfo'))
},
onShow() {
},
@@ -122,6 +126,13 @@
},
});
},
//退出登录
logout(){
uni.clearStorageSync();
uni.reLaunch({
url: '/pages/login/index',// 替换为你要跳转的页面路径
});
}
}
}
</script>
@@ -148,19 +159,17 @@
background-repeat: no-repeat;
}
.navbar{
padding-top: 30px;
height: 50px;
line-height: 50px;
text-align: center;
color: #fff;
font-size: 32rpx;
/* #ifdef APP-PLUS */
height:44px;
/* #endif */
height:30px;
}
.content{
padding:10px 15px 15px;
.contop{
display: flex;
align-items: center;
margin: 15px 0px 30px;
margin: 0px 0px 30px;
font-size: 34rpx;
color: white;
.right{
@@ -198,7 +207,6 @@
height: 220rpx;
}
.bottomCon {
margin-top: 40rpx;
color: #000;
font-weight: 400;
// padding: 0 24rpx 20rpx;
+20 -2
View File
@@ -10,7 +10,13 @@
<view class="inputs_button">
<view class="inputs">
<view class="account">
<input type="text" v-model="email" :placeholder="$t('account')" />
<u--input
type="text"
:placeholder="$t('account')"
v-model="email"
border="none"
></u--input>
<!-- <input type="text" v-model="email" :placeholder="$t('account')" /> -->
</view>
<view class="password">
<u--input
@@ -81,9 +87,15 @@
id: 'ru'
}]
],
language:'zh-Hans'
}
},
onLoad() {
if(uni.getStorageSync('token')){
uni.reLaunch({
url: '/pages/index/index',// 替换为你要跳转的页面路径
});
}
},
methods: {
close(){
@@ -96,6 +108,7 @@
confirmlang(e) {
this.$i18n.locale = e.value[0].id
uni.setStorageSync('i18locale', e.value[0].id);
this.language = e.value[0].id
this.showlang = false
this.columns =[
[{
@@ -166,12 +179,16 @@
});
return false
}
if(this.language=='zh-Hans'){
this.language= 'zh_CN'
}
request({
url:'user/login',
method:'POST',
data:{
email: this.email,
password: this.password,
language: this.language,
}
}).then(res => {
console.log(res.data.data)
@@ -179,10 +196,11 @@
uni.showToast({
title: res.data.message,
icon: 'none'
});token
});
} else if (res.data.code == 0) {
//存取session
uni.setStorageSync('userinfo',JSON.stringify(res.data.data));
uni.setStorageSync('token', res.data.data.token);
//返回数据接收成功
uni.reLaunch({
+11 -1
View File
@@ -1,5 +1,8 @@
<template>
<view class="page">
<view class="leftback">
<u-icon name="arrow-left" color="#000" size="20" @click="leftClick"></u-icon>
</view>
<view class="title">
<image src="/static/image/lingke.png" mode=""></image>
</view>
@@ -158,7 +161,14 @@
display: flex;
flex-direction: column;
justify-content: space-between;
.leftback{
position: fixed;
/* #ifdef APP-PLUS/
top: 44px;
/* #endif */
top: 30px;
left: 15px;
}
.title {
padding-top: 220rpx;
text-align: center;
Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 54 KiB