feat(mini): 各页面增加分享入口(好友/朋友圈)及设置页微调

This commit is contained in:
gouki
2026-08-10 23:03:16 +00:00
parent 738b5c4452
commit 52c0d3c774
14 changed files with 172 additions and 26 deletions
+15 -2
View File
@@ -46,7 +46,7 @@ Page({
success: (loginRes) => {
if (!loginRes.code) {
this.setData({ logging: false });
wx.showToast({ title: '微信登录失败', icon: 'none' });
wx.showToast({ title: '授权登录失败', icon: 'none' });
return;
}
request({
@@ -72,7 +72,7 @@ Page({
},
fail: () => {
this.setData({ logging: false });
wx.showToast({ title: '微信登录失败', icon: 'none' });
wx.showToast({ title: '授权登录失败', icon: 'none' });
}
});
},
@@ -100,5 +100,18 @@ Page({
} else {
wx.navigateTo({ url });
}
},
onShareAppMessage() {
return {
title: '老黄历 - 个人中心',
path: '/pages/settings/settings'
};
},
onShareTimeline() {
return {
title: '老黄历 - 个人中心'
};
}
});
+9 -11
View File
@@ -8,25 +8,24 @@
<text>客</text>
</view>
<view>
<text class="text-base font-medium">{{userInfo.nickname || '微信用户'}}</text>
<text class="text-sm font-medium">{{userInfo.nickname || '授权用户'}}</text>
<text class="text-xs text-muted block">已登录,生辰档案云端同步</text>
</view>
</view>
<view class="btn-ghost text-muted" bindtap="logout">退出</view>
</view>
<block wx:else>
<view class="flex items-center gap-2 mb-2">
<view class="flex items-center justify-between" wx:else>
<view class="flex items-center gap-2">
<view class="avatar avatar-placeholder">
<text>客</text>
</view>
<view>
<text class="text-base font-medium">未登录</text>
<text class="text-xs text-muted block">绑定的生辰仅保存在本机,登录后才生效</text>
<text class="text-sm font-medium">未登录</text>
<text class="text-xs text-muted block">登录后生辰档案云端同步,换设备不丢失</text>
</view>
</view>
<view class="btn-primary text-center" bindtap="login">{{logging ? '登录中…' : '微信登录'}}</view>
<view class="text-xs text-muted text-center mt-2">登录后可将生辰档案同步到云端,换设备不丢失</view>
</block>
<view class="btn-primary btn-sm" bindtap="login">{{logging ? '登录中…' : '授权登录'}}</view>
</view>
</view>
<!-- 我的数据 -->
@@ -76,10 +75,9 @@
<!-- 关于 -->
<view class="card">
<view class="section-title">关于</view>
<view class="text-sm text-muted">
<text>老黄历小程序 v{{version}}</text>
<view class="text-xs text-muted">
<text>老黄历 v{{version}}</text>
<text class="block mt-1" wx:if="{{buildNumber !== '0'}}">构建 #{{buildNumber}} ({{commitSha}})</text>
<text class="block mt-1">提供农历、黄历、八字、许愿等功能</text>
</view>
</view>
</view>
+17 -10
View File
@@ -1,17 +1,17 @@
.container {
padding: 20rpx;
padding: 16rpx;
}
.section-title {
font-size: 28rpx;
font-size: 26rpx;
font-weight: 600;
margin-bottom: 16rpx;
margin-bottom: 8rpx;
color: #C41E3A;
}
.avatar {
width: 96rpx;
height: 96rpx;
width: 72rpx;
height: 72rpx;
border-radius: 50%;
}
@@ -21,14 +21,21 @@
justify-content: center;
background: #C41E3A;
color: #FFFFFF;
font-size: 40rpx;
font-size: 32rpx;
}
.btn-sm {
padding: 10rpx 28rpx;
font-size: 26rpx;
border-radius: 32rpx;
white-space: nowrap;
}
.menu-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 24rpx 0;
padding: 18rpx 0;
border-bottom: 1rpx solid #E8D5C4;
}
@@ -37,7 +44,7 @@
}
.menu-label {
font-size: 28rpx;
font-size: 26rpx;
}
.menu-right {
@@ -47,11 +54,11 @@
}
.menu-count {
font-size: 24rpx;
font-size: 22rpx;
color: #9E8E7E;
}
.menu-arrow {
color: #C9B8A6;
font-size: 36rpx;
font-size: 32rpx;
}