feat: 完善人生轨迹详情页功能及微信小程序登录优化

This commit is contained in:
2026-06-15 10:17:30 +08:00
parent cb3c5e6724
commit 74a2c15b6b
37 changed files with 1974 additions and 516 deletions
+15 -5
View File
@@ -3,10 +3,10 @@
<view class="space-bg"></view>
<view class="status-space" :style="{ height: capsuleTopReservePx + 'px' }"></view>
<view class="topbar" :style="topbarStyle">
<view class="topbar">
<text class="back" @click="goBack"></text>
<text class="title">编辑资料 <text class="gold"></text></text>
<text class="save" @click="saveProfile">保存</text>
<text class="save" :class="{ disabled: saving }" @click="saveProfile">{{ saving ? '保存中' : '保存' }}</text>
</view>
<scroll-view class="scroll" scroll-y :show-scrollbar="false">
@@ -188,7 +188,7 @@ import { useAppStore } from '../../stores/app.js'
import { useMenuButtonSafeArea } from '../../composables/useMenuButtonSafeArea.js'
const store = useAppStore()
const { capsuleTopReservePx, topbarStyle } = useMenuButtonSafeArea({ extraTopPx: 2 })
const { capsuleTopReservePx } = useMenuButtonSafeArea({ extraTopPx: 2 })
const isEdit = ref(false)
const saving = ref(false)
const birthday = ref('')
@@ -319,6 +319,7 @@ const saveProfile = async () => {
return
}
syncFromStore()
uni.showToast({ title: '已保存', icon: 'success' })
setTimeout(() => {
if (isEdit.value) uni.navigateBack()
@@ -331,9 +332,12 @@ const goBack = () => {
else uni.reLaunch({ url: '/pages/main/index?tab=script' })
}
onMounted(() => {
onMounted(async () => {
const pages = getCurrentPages()
isEdit.value = pages[pages.length - 1]?.options?.edit === '1'
if (isEdit.value) {
await store.fetchUserProfile()
}
syncFromStore()
})
</script>
@@ -374,7 +378,7 @@ onMounted(() => {
.topbar {
height: 72rpx;
display: grid;
grid-template-columns: 76rpx 1fr 76rpx;
grid-template-columns: 76rpx 1fr 112rpx;
align-items: center;
padding: 0 28rpx;
}
@@ -401,6 +405,12 @@ onMounted(() => {
color: #b94cff;
font-size: 26rpx;
text-align: right;
justify-self: end;
min-width: 96rpx;
}
.save.disabled {
opacity: 0.58;
}
.scroll {