|
|
@ -16,7 +16,10 @@ const headIcon = ref()
|
|
|
|
const getMemberProfileData = async () => {
|
|
|
|
const getMemberProfileData = async () => {
|
|
|
|
const res = await getMemberProfileAPI()
|
|
|
|
const res = await getMemberProfileAPI()
|
|
|
|
const obj = res.data
|
|
|
|
const obj = res.data
|
|
|
|
const avatar = serviceDomain + JSON.parse(obj.headIcon)[0].url
|
|
|
|
let avatar = ''
|
|
|
|
|
|
|
|
if (obj.headIcon) {
|
|
|
|
|
|
|
|
avatar = serviceDomain + JSON.parse(obj.headIcon)[0].url
|
|
|
|
|
|
|
|
}
|
|
|
|
profile.value = {
|
|
|
|
profile.value = {
|
|
|
|
avatar,
|
|
|
|
avatar,
|
|
|
|
gender: obj.gender + '',
|
|
|
|
gender: obj.gender + '',
|
|
|
@ -78,18 +81,22 @@ const onGenderChange: UniHelper.RadioGroupOnChange = (ev) => {
|
|
|
|
// 点击保存提交表单
|
|
|
|
// 点击保存提交表单
|
|
|
|
const onSubmit = async () => {
|
|
|
|
const onSubmit = async () => {
|
|
|
|
const { staffsName, gender } = profile.value
|
|
|
|
const { staffsName, gender } = profile.value
|
|
|
|
const params = {
|
|
|
|
if (headIcon.value && staffsName && gender) {
|
|
|
|
headIcon: headIcon.value,
|
|
|
|
const params = {
|
|
|
|
staffsName,
|
|
|
|
headIcon: headIcon.value,
|
|
|
|
gender,
|
|
|
|
staffsName,
|
|
|
|
|
|
|
|
gender,
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
const res = await postMemberProfileAPI(params)
|
|
|
|
|
|
|
|
// 更新Store昵称
|
|
|
|
|
|
|
|
// memberStore.profile!.staffsName = staffsName
|
|
|
|
|
|
|
|
uni.showToast({ icon: 'success', title: '保存成功' })
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
|
|
|
}, 400)
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
uni.showToast({ icon: 'none', title: '请填写完整数据' })
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const res = await postMemberProfileAPI(params)
|
|
|
|
|
|
|
|
// 更新Store昵称
|
|
|
|
|
|
|
|
// memberStore.profile!.staffsName = staffsName
|
|
|
|
|
|
|
|
uni.showToast({ icon: 'success', title: '保存成功' })
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
|
|
uni.navigateBack()
|
|
|
|
|
|
|
|
}, 400)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onLoad(() => {
|
|
|
|
onLoad(() => {
|
|
|
|