Explorar o código

feat: 更新设置页面,初始化生日为当前时间戳,优化生日设置逻辑

EvilDragon hai 3 meses
pai
achega
459b435556
Modificáronse 1 ficheiros con 6 adicións e 4 borrados
  1. 6 4
      packages/app/src/pages/mine/setting/index.vue

+ 6 - 4
packages/app/src/pages/mine/setting/index.vue

@@ -24,7 +24,7 @@ const { setUserInfo } = userStore
 const { confirm } = useMessage('nickname')
 const formData = ref<any>({})
 const schema = ref<DataFormSchema>()
-const birthday = ref()
+const birthday = ref(dayjs().toDate().getTime())
 const birthdayShow = ref(false)
 const { data: userAuthInfo, run: setUserAuthInfo } = useRequest(() => getUserAuthInfo(), {})
 const { data: userBasicInfo, run: setUserBasicInfo } = useRequest(() => getUserBasicInfo(), {})
@@ -141,7 +141,7 @@ const handeleSetBirthday = async () => {
     // await setUserBasicInfo()
     setUserInfo({
       ...userInfo.value,
-      birthday: dayjs(birthday.value).format('YYYY-MM-DD'),
+      birthday: dayjs(birthday.value).toDate().getTime(),
     })
     birthdayShow.value = false
   }
@@ -171,7 +171,9 @@ onMounted(async () => {
           custom-class="border border-white border-solid"
         ></wd-img>
       </button>
-      <div class="text-center text-black/40 text-xs font-normal font-['PingFang_SC'] leading-none">
+      <div
+        class="mt-2 text-center text-black/40 text-xs font-normal font-['PingFang_SC'] leading-none"
+      >
         更换头像
       </div>
     </div>
@@ -220,7 +222,7 @@ onMounted(async () => {
     <div class="flex-1"></div>
     <div><wd-button block :round="false" @click="handleLogout">退出登录</wd-button></div>
     <FormMessageBox v-model="formData" selector="nickname" :schema="schema"></FormMessageBox>
-    <wd-action-sheet v-model="birthdayShow" title="设置生日" @close="close">
+    <wd-action-sheet v-model="birthdayShow" title="设置生日">
       <!-- <view style="padding: 15px 15px 150px 15px"> -->
       <wd-datetime-picker-view
         type="date"