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

@ -16,7 +16,10 @@ const headIcon = ref()
const getMemberProfileData = async () => {
const res = await getMemberProfileAPI()
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 = {
avatar,
gender: obj.gender + '',
@ -78,18 +81,22 @@ const onGenderChange: UniHelper.RadioGroupOnChange = (ev) => {
//
const onSubmit = async () => {
const { staffsName, gender } = profile.value
const params = {
headIcon: headIcon.value,
staffsName,
gender,
if (headIcon.value && staffsName && gender) {
const params = {
headIcon: headIcon.value,
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(() => {

Loading…
Cancel
Save