master
王文杰 7 months ago
parent c4b2cdc48c
commit 58926e23c7

@ -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(() => {

Loading…
Cancel
Save