5 changed files with 417 additions and 372 deletions
@ -1,365 +1,397 @@ |
|||||
<!--授课统计-详情--> |
<!--授课统计-详情--> |
||||
<template> |
<template> |
||||
<view class="main_box"> |
<view class="main_box"> |
||||
|
|
||||
<view class="main_section"> |
<view class="main_section"> |
||||
<view class="section"> |
<view class="section"> |
||||
<view class="item"> |
<view class="item"> |
||||
<image @click="changeAvatar()" class="pic" src="http://www.firstui.cn:4000/vipdoc/img/img_logo.png"></image> |
<image @click="changeAvatar()" class="pic" :src="$util.img(formData.headimg)" v-if="upload_type == 1"> |
||||
<view class="btn" @click="changeAvatar()">修改头像</view> |
<image @click="changeAvatar()" class="pic" :src="uploadHeadimg" v-else> |
||||
</view> |
</image> |
||||
</view> |
<view class="btn" @click="changeAvatar()">修改头像</view> |
||||
|
</view> |
||||
<view class="section"> |
</view> |
||||
<view class="item"> |
|
||||
<view class="title"> |
<view class="section"> |
||||
姓名 <text class="required">*</text> |
<view class="item"> |
||||
</view> |
<view class="title"> |
||||
<view class="input"> |
学员姓名 <text class="required">*</text> |
||||
<input v-model="formData.name" placeholder="请输入姓名" /> |
</view> |
||||
</view> |
<view class="input"> |
||||
</view> |
<input v-model="formData.name" placeholder="请输入姓名"/> |
||||
|
</view> |
||||
<view class="item"> |
</view> |
||||
<view class="title"> |
|
||||
账号 <text class="required"></text> |
<view class="item"> |
||||
</view> |
<view class="title"> |
||||
<view class="input"> |
账号 <text class="required"></text> |
||||
<input disabled placeholder="暂无" /> |
</view> |
||||
</view> |
<view class="input"> |
||||
</view> |
<input disabled placeholder="暂无" v-model="formData.username"/> |
||||
|
</view> |
||||
<view class="item"> |
</view> |
||||
<view class="title"> |
|
||||
部门 <text class="required"></text> |
<view class="item"> |
||||
</view> |
<view class="title"> |
||||
<view class="input"> |
住址 <text class="required"></text> |
||||
<input disabled placeholder="暂无" /> |
</view> |
||||
</view> |
<view class="input"> |
||||
</view> |
<input placeholder="暂无" v-model="formData.address"/> |
||||
|
</view> |
||||
<view class="item"> |
</view> |
||||
<view class="title"> |
|
||||
等级 <text class="required"></text> |
<view class="item"> |
||||
</view> |
<view class="title"> |
||||
<view class="input"> |
课程 <text class="required"></text> |
||||
<input disabled placeholder="暂无" /> |
</view> |
||||
</view> |
<view class="input"> |
||||
</view> |
<input disabled placeholder="暂无" :value="formData.classes_list"/> |
||||
</view> |
</view> |
||||
|
</view> |
||||
<view class="section"> |
</view> |
||||
<view class="item"> |
|
||||
<view class="title"> |
<view class="section"> |
||||
性别 <text class="required">*</text> |
<view class="item"> |
||||
</view> |
<view class="title"> |
||||
<view class="input"> |
性别 <text class="required">*</text> |
||||
<input placeholder="请选择性别" v-model="sex_name" @click="picker_show_sex=true"/> |
</view> |
||||
<fui-picker |
<view class="input"> |
||||
layer="1" |
<input placeholder="请选择性别" v-model="sex_name" @click="picker_show_sex=true" /> |
||||
:linkage="true" |
<fui-picker layer="1" :linkage="true" :options="options_sex_arr" :show="picker_show_sex" |
||||
:options="options_sex_arr" |
@change="changePickerSex" @cancel="picker_sex_show=false"></fui-picker> |
||||
:show="picker_show_sex" |
</view> |
||||
@change="changePickerSex" |
</view> |
||||
@cancel="picker_sex_show=false" |
|
||||
></fui-picker> |
<view class="item"> |
||||
</view> |
<view class="title"> |
||||
</view> |
生日 <text class="required">*</text> |
||||
|
</view> |
||||
<view class="item"> |
<view class="input"> |
||||
<view class="title"> |
<input placeholder="请选择生日" @click="picker_show_birthday=true" v-model="formData.birthday" /> |
||||
生日 <text class="required">*</text> |
<fui-date-picker :minDate="minDate" :maxDate="maxDate" :show="picker_show_birthday" type="3" |
||||
</view> |
@change="changePickerBirthday" @cancel="picker_show_birthday=false"></fui-date-picker> |
||||
<view class="input"> |
</view> |
||||
<input placeholder="请选择生日" @click="picker_show_birthday=true" v-model="formData.birthday"/> |
</view> |
||||
<fui-date-picker |
</view> |
||||
:minDate="minDate" |
|
||||
:maxDate="maxDate" |
<view class="section"> |
||||
:show="picker_show_birthday" |
<view class="item"> |
||||
type="3" |
<view class="title"> |
||||
@change="changePickerBirthday" |
邮箱 <text class="required">*</text> |
||||
@cancel="picker_show_birthday=false" |
</view> |
||||
></fui-date-picker> |
<view class="input"> |
||||
</view> |
<input v-model="formData.email" placeholder="请输入邮箱" /> |
||||
</view> |
</view> |
||||
|
</view> |
||||
<view class="item"> |
|
||||
<view class="title"> |
<view class="item"> |
||||
邮箱 <text class="required">*</text> |
<view class="title"> |
||||
</view> |
手机 <text class="required">*</text> |
||||
<view class="input"> |
</view> |
||||
<input v-model="formData.email" placeholder="请输入邮箱" /> |
<view class="input"> |
||||
</view> |
<input v-model="formData.mobile" placeholder="请输入手机" /> |
||||
</view> |
</view> |
||||
|
</view> |
||||
<view class="item"> |
</view> |
||||
<view class="title"> |
|
||||
手机 <text class="required">*</text> |
|
||||
</view> |
<view class="submet_btn" @click="submit">提交</view> |
||||
<view class="input"> |
</view> |
||||
<input v-model="formData.tel" placeholder="请输入手机" /> |
</view> |
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="item"> |
|
||||
<view class="title"> |
|
||||
微信 <text class="required"></text> |
|
||||
</view> |
|
||||
<view class="input"> |
|
||||
<input v-model="formData.wx" placeholder="请输入微信" /> |
|
||||
</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
|
|
||||
<view class="submet_btn">提交</view> |
|
||||
</view> |
|
||||
</view> |
|
||||
</template> |
</template> |
||||
|
|
||||
<script> |
<script> |
||||
// import user from '@/api/user.js'; |
import member from '@/api/member.js'; |
||||
import {Api_url} from "@/common/config.js"; |
import { |
||||
import AQTabber from "@/components/AQ/AQTabber" |
Api_url |
||||
|
} from "@/common/config.js"; |
||||
|
import AQTabber from "@/components/AQ/AQTabber" |
||||
export default { |
|
||||
components: { |
|
||||
AQTabber, |
export default { |
||||
}, |
components: { |
||||
data() { |
AQTabber, |
||||
return { |
}, |
||||
formData:{ |
data() { |
||||
images_arr:[], |
return { |
||||
name:'',//姓名 |
member_info: [], |
||||
email:'',//邮箱 |
formData: { |
||||
tel:'',//手机 |
images_arr: [], |
||||
wx:'',//微信 |
name: '', //姓名 |
||||
sex:'',//性别 |
email: '', //邮箱 |
||||
birthday:'',//生日 |
tel: '', //手机 |
||||
}, |
wx: '', //微信 |
||||
|
sex: '', //性别 |
||||
//上传图片APi路径 |
birthday: '', //生日 |
||||
uploadUrl: `${Api_url}/salesmanapi/common/uploadFile`, |
}, |
||||
|
|
||||
//性别选择器 相关 |
//上传图片APi路径 |
||||
picker_show_sex: false, |
uploadUrl: `${Api_url}/file/image`, |
||||
sex_name:'请选择', |
|
||||
options_sex_arr:[ |
//性别选择器 相关 |
||||
{ value: 1, text: '男' }, |
picker_show_sex: false, |
||||
{ value: 2, text: '女' }, |
sex_name: '请选择', |
||||
], |
options_sex_arr: [{ |
||||
|
value: 0, |
||||
//生日选择器相关 |
text: '保密' |
||||
minDate:'', |
},{ |
||||
maxDate:'', |
value: 1, |
||||
picker_show_birthday:false, |
text: '男' |
||||
} |
}, |
||||
}, |
{ |
||||
onLoad() { |
value: 2, |
||||
}, |
text: '女' |
||||
onShow() { |
}, |
||||
this.init() |
], |
||||
}, |
|
||||
methods: { |
//生日选择器相关 |
||||
|
minDate: '', |
||||
async init(){ |
maxDate: '', |
||||
this.getBirthday() |
picker_show_birthday: false, |
||||
}, |
upload_type: 1, |
||||
|
uploadHeadimg: '', |
||||
// 修改头像按钮 |
} |
||||
changeAvatar() { |
}, |
||||
uni.chooseImage({ |
onLoad() {}, |
||||
count: 1, |
onShow() { |
||||
sizeType: ['compressed'], |
this.init() |
||||
sourceType: ['album', 'camera'], |
this.member_init() |
||||
success: (res) => { |
}, |
||||
const tempFilePath = res.tempFilePaths[0] |
methods: { |
||||
// 这里可以调用上传接口 |
|
||||
this.uploadFilePromise(tempFilePath) |
async init() { |
||||
} |
this.getBirthday() |
||||
}) |
}, |
||||
}, |
|
||||
async uploadFilePromise(url) { |
//获取学员信息 |
||||
console.log('AQ',this.uploadUrl,url) |
member_init() { |
||||
return new Promise((resolve, reject) => { |
member.member().then(res => { |
||||
let a = uni.uploadFile({ |
if(res.code == 1){ |
||||
url: this.uploadUrl, // 仅为示例,非真实的接口地址 |
this.member_info = res.data |
||||
filePath: url, |
this.formData = {...this.member_info} |
||||
name: "file", |
if(res.data.sex == 0){ |
||||
formData: { |
this.sex_name = '保密' |
||||
token: this.$store.state.token, |
}else if(this.formData.sex == 1){ |
||||
}, |
this.sex_name = '男' |
||||
success: (e) => { |
}else if(this.formData.sex == 2){ |
||||
console.log('上传成功1',e) |
this.sex_name = '女' |
||||
let res = JSON.parse(e.data.replace(/\ufeff/g, "") || "{}") |
} |
||||
console.log('上传成功2',res) |
}else{ |
||||
if (res.code >= 0){ |
this.member_info = [] |
||||
this.userInfo.pic = res.data.pic_path |
} |
||||
this.editPic(res.data.pic_path) |
}) |
||||
}else{ |
}, |
||||
this.$util.showToast({ |
|
||||
title: res.message |
// 修改头像按钮 |
||||
}); |
changeAvatar() { |
||||
} |
uni.chooseImage({ |
||||
setTimeout(() => { |
count: 1, |
||||
resolve(res.data.data); |
sizeType: ['compressed'], |
||||
}, 1000); |
sourceType: ['album', 'camera'], |
||||
}, |
success: (res) => { |
||||
}); |
const tempFilePath = res.tempFilePaths[0] |
||||
}); |
// 这里可以调用上传接口 |
||||
}, |
this.uploadFilePromise(tempFilePath) |
||||
//修改头像Api |
} |
||||
async editPic(pic) { |
}) |
||||
let res = await salesmanApi.editPic({pic: pic}) |
}, |
||||
if (res.code >= 0) { |
async uploadFilePromise(url) { |
||||
this.$util.showToast({ |
let token = uni.getStorageSync('token') || '' |
||||
title: '修改成功' |
console.log(token,'AQ', this.uploadUrl, this.$store.state.token) |
||||
}) |
return new Promise((resolve, reject) => { |
||||
} else { |
let a = uni.uploadFile({ |
||||
this.$util.showToast({ |
url: this.uploadUrl, //仅为示例,非真实的接口地址 |
||||
title: res.message |
filePath: url, |
||||
}) |
name: 'file', |
||||
} |
header: { |
||||
}, |
'token': `${token}`,//请求头设置token |
||||
|
}, |
||||
//性别选择相关 |
success: (e) => { |
||||
changePickerSex(e){ |
let res = JSON.parse(e.data.replace(/\ufeff/g, "") || "{}") |
||||
console.log('监听选择',e) |
console.log('上传成功2', res) |
||||
this.sex_name = e.text |
if (res.code == 1) { |
||||
this.formData.sex = e.value |
this.upload_type = 2 |
||||
this.picker_show_sex = false |
this.formData.headimg = res.data.path |
||||
}, |
this.uploadHeadimg = res.data.url |
||||
|
} else { |
||||
//生日选择相关 |
uni.showToast({ |
||||
//获取当前年月日+获取30年前的日期 |
title: res.msg, |
||||
getBirthday(){ |
icon: 'none' |
||||
let date = new Date(); |
}) |
||||
let year = date.getFullYear(); |
} |
||||
let month = date.getMonth() + 1; |
setTimeout(() => { |
||||
let day = date.getDate(); |
resolve(res.data); |
||||
let year_30 = year - 30; |
}, 1000); |
||||
let month_30 = month; |
}, |
||||
let day_30 = day; |
}); |
||||
if (month_30 == 2 && day_30 > 28) { |
}); |
||||
month_30 = 3; |
}, |
||||
day_30 = 1; |
//性别选择相关 |
||||
} |
changePickerSex(e) { |
||||
if (month_30 == 4 && day_30 > 30) { |
console.log('监听选择', e) |
||||
month_30 = 5; |
this.sex_name = e.text |
||||
day_30 = 1; |
this.formData.sex = e.value |
||||
} |
this.picker_show_sex = false |
||||
if (month_30 == 6 && day_30 > 30) { |
}, |
||||
month_30 = 7; |
|
||||
day_30 = 1; |
//生日选择相关 |
||||
} |
//获取当前年月日+获取30年前的日期 |
||||
if (month_30 == 9 && day_30 > 30) { |
getBirthday() { |
||||
month_30 = 10; |
let date = new Date(); |
||||
day_30 = 1; |
let year = date.getFullYear(); |
||||
} |
let month = date.getMonth() + 1; |
||||
if (month_30 == 11 && day_30 > 30) { |
let day = date.getDate(); |
||||
month_30 = 12; |
let year_30 = year - 30; |
||||
day_30 = 1; |
let month_30 = month; |
||||
} |
let day_30 = day; |
||||
if (month_30 > 12) { |
if (month_30 == 2 && day_30 > 28) { |
||||
month_30 = month_30 - 12; |
month_30 = 3; |
||||
year_30 = year_30 + 1; |
day_30 = 1; |
||||
} |
} |
||||
let minDate = year_30 + "-" + month_30 + "-" + day_30 |
if (month_30 == 4 && day_30 > 30) { |
||||
let maxDate = year + "-" + month + "-" + day |
month_30 = 5; |
||||
this.minDate = minDate |
day_30 = 1; |
||||
this.maxDate = maxDate |
} |
||||
}, |
if (month_30 == 6 && day_30 > 30) { |
||||
|
month_30 = 7; |
||||
//监听生日选择 |
day_30 = 1; |
||||
changePickerBirthday(e){ |
} |
||||
console.log('监听生日选择',e) |
if (month_30 == 9 && day_30 > 30) { |
||||
this.formData.birthday = e.result |
month_30 = 10; |
||||
this.picker_show_birthday = false |
day_30 = 1; |
||||
}, |
} |
||||
|
if (month_30 == 11 && day_30 > 30) { |
||||
} |
month_30 = 12; |
||||
} |
day_30 = 1; |
||||
|
} |
||||
|
if (month_30 > 12) { |
||||
|
month_30 = month_30 - 12; |
||||
|
year_30 = year_30 + 1; |
||||
|
} |
||||
|
let minDate = year_30 + "-" + month_30 + "-" + day_30 |
||||
|
let maxDate = year + "-" + month + "-" + day |
||||
|
this.minDate = minDate |
||||
|
this.maxDate = maxDate |
||||
|
}, |
||||
|
|
||||
|
//监听生日选择 |
||||
|
changePickerBirthday(e) { |
||||
|
console.log('监听生日选择', e) |
||||
|
this.formData.birthday = e.result |
||||
|
this.picker_show_birthday = false |
||||
|
}, |
||||
|
|
||||
|
//提交信息 |
||||
|
submit(){ |
||||
|
member.member_edit({ |
||||
|
header: this.formData.headimg, |
||||
|
name: this.formData.name, |
||||
|
address: this.formData.address, |
||||
|
gender: this.formData.sex, |
||||
|
birthday: this.formData.birthday, |
||||
|
email: this.formData.email, |
||||
|
phone: this.formData.mobile, |
||||
|
}).then(res => { |
||||
|
if(res.code == 1){ |
||||
|
uni.showToast({ |
||||
|
title: res.msg, |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
}else{ |
||||
|
uni.showToast({ |
||||
|
title: res.msg, |
||||
|
icon: 'none' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
</script> |
</script> |
||||
|
|
||||
<style lang="less" scoped> |
<style lang="less" scoped> |
||||
|
.main_box { |
||||
.main_box{ |
background: #292929; |
||||
background: #292929 ; |
} |
||||
} |
|
||||
|
//自定义导航栏 |
||||
//自定义导航栏 |
.navbar_section { |
||||
.navbar_section{ |
display: flex; |
||||
display: flex; |
justify-content: center; |
||||
justify-content: center; |
align-items: center; |
||||
align-items: center; |
background: #29d3b4; |
||||
background: #29d3b4; |
|
||||
.title{ |
.title { |
||||
padding: 20rpx 0; |
padding: 20rpx 0; |
||||
font-size: 30rpx; |
font-size: 30rpx; |
||||
color: #315d55; |
color: #315d55; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.main_section{ |
.main_section { |
||||
min-height: 100vh; |
min-height: 100vh; |
||||
background: #292929 100%; |
background: #292929 100%; |
||||
padding: 0 0rpx; |
padding: 0 0rpx; |
||||
padding-top: 32rpx; |
padding-top: 32rpx; |
||||
padding-bottom: 150rpx; |
padding-bottom: 150rpx; |
||||
font-size: 28rpx; |
font-size: 28rpx; |
||||
color: #fff; |
color: #fff; |
||||
display: flex; |
display: flex; |
||||
flex-direction: column; |
flex-direction: column; |
||||
gap: 20rpx; |
gap: 20rpx; |
||||
|
|
||||
.section{ |
.section { |
||||
background-color: #434544; |
background-color: #434544; |
||||
.item{ |
|
||||
padding: 20rpx 40rpx; |
.item { |
||||
display: flex; |
padding: 20rpx 40rpx; |
||||
justify-content: space-between; |
display: flex; |
||||
align-items: center; |
justify-content: space-between; |
||||
.pic{ |
align-items: center; |
||||
width: 82rpx; |
|
||||
height: 82rpx; |
.pic { |
||||
border-radius: 50%; |
width: 82rpx; |
||||
} |
height: 82rpx; |
||||
.btn{} |
border-radius: 50%; |
||||
|
} |
||||
.title{ |
|
||||
display: flex; |
.btn {} |
||||
align-items: center; |
|
||||
font-size: 26rpx; |
.title { |
||||
color: #D7D7D7; |
display: flex; |
||||
.required{ |
align-items: center; |
||||
margin-left: 10rpx; |
font-size: 26rpx; |
||||
color: red; |
color: #D7D7D7; |
||||
} |
|
||||
} |
.required { |
||||
.input{ |
margin-left: 10rpx; |
||||
input{ |
color: red; |
||||
text-align: right; |
} |
||||
} |
} |
||||
} |
|
||||
} |
.input { |
||||
} |
input { |
||||
|
text-align: right; |
||||
.submet_btn{ |
} |
||||
margin: 0 auto; |
} |
||||
margin-top: 40rpx; |
} |
||||
border: 2px solid #25a18b; |
} |
||||
color: #25a18b; |
|
||||
width: 80%; |
.submet_btn { |
||||
height: 80rpx; |
margin: 0 auto; |
||||
font-size: 30rpx; |
margin-top: 40rpx; |
||||
display: flex; |
border: 2px solid #25a18b; |
||||
justify-content: center; |
color: #25a18b; |
||||
align-items: center; |
width: 80%; |
||||
} |
height: 80rpx; |
||||
|
font-size: 30rpx; |
||||
|
display: flex; |
||||
|
justify-content: center; |
||||
} |
align-items: center; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
||||
</style> |
</style> |
||||
Loading…
Reference in new issue