Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
e07eccec
Commit
e07eccec
authored
Sep 08, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master
parent
27e1aa78
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
99 deletions
+155
-99
XingmaLabDetailPage.vue
pages/XingmaLabDetailPage/XingmaLabDetailPage.vue
+24
-8
xingmaLab.vue
pages/xingmaLab/xingmaLab.vue
+100
-91
user.js
stores/user.js
+31
-0
No files found.
pages/XingmaLabDetailPage/XingmaLabDetailPage.vue
View file @
e07eccec
...
...
@@ -52,7 +52,9 @@
<button
open-type=
"getPhoneNumber"
@
getphonenumber=
"(e) => onGetPhoneNumber(e, 'like')"
class=
"auth-like-btn phone-auth-btn-cover"
></button>
<!-- 分享按钮授权覆盖 - 移除这个,让分享按钮正常工作 -->
<!-- 分享按钮授权覆盖 -->
<button
open-type=
"getPhoneNumber"
@
getphonenumber=
"(e) => onGetPhoneNumber(e, 'share')"
class=
"auth-share-btn phone-auth-btn-cover"
></button>
</div>
</div>
</view>
...
...
@@ -72,7 +74,7 @@ defineOptions({
})
// 响应式数据
const
collectionNumber
=
ref
(
'
123456789
'
)
const
collectionNumber
=
ref
(
''
)
const
recordId
=
ref
(
''
)
// 添加记录ID的响应式变量
const
detailData
=
ref
({
content
:
''
,
...
...
@@ -267,9 +269,9 @@ const handleGoBack = () => {
}
}
//
生命周期
onMounted
(
async
(
options
)
=>
{
//
页面初始化逻辑
const
initPage
=
async
(
)
=>
{
md
.
sensorComponentLogTake
({
xcxComponentExposure
:
"true"
,
pageName
:
"星妈lab-藏品详情页"
,
...
...
@@ -284,7 +286,6 @@ onMounted(async (options) => {
componentContent
:
"分享"
});
// 调用 home 接口获取登录状态
await
homeStore
.
loadHomeInfo
()
...
...
@@ -297,7 +298,6 @@ onMounted(async (options) => {
recordId
.
value
=
id
// 立即保存ID,确保分享时能获取到
await
fetchDetailData
(
id
)
md
.
sensorComponentLogTake
({
xcxComponentExposure
:
"true"
,
pageName
:
"星妈lab-藏品详情页"
,
...
...
@@ -305,7 +305,7 @@ onMounted(async (options) => {
componentContent
:
"藏品详情页+"
+
detailData
.
value
.
content
});
}
else
{
console
.
warn
(
'⚠️ 未获取到页面参数 id'
,
options
,
currentPage
.
options
)
console
.
warn
(
'⚠️ 未获取到页面参数 id'
,
currentPage
.
options
)
// uni.showToast({
// title: '参数错误',
// icon: 'none'
...
...
@@ -323,6 +323,22 @@ onMounted(async (options) => {
withShareTicket
:
true
,
menus
:
[
'shareAppMessage'
]
})
}
// 生命周期
onMounted
(
async
(
options
)
=>
{
console
.
log
(
'星妈lab详情页面已加载'
)
// 先进行自动登录获取基础信息,登录成功后执行页面初始化
try
{
console
.
log
(
'开始执行 normalAutoLogin...'
)
await
userStore
.
normalAutoLogin
(
initPage
)
console
.
log
(
'normalAutoLogin 完成'
)
}
catch
(
error
)
{
console
.
error
(
'normalAutoLogin 失败:'
,
error
)
// 即使登录失败也执行页面初始化
await
initPage
()
}
})
// 定义分享函数
...
...
pages/xingmaLab/xingmaLab.vue
View file @
e07eccec
This diff is collapsed.
Click to expand it.
stores/user.js
View file @
e07eccec
...
...
@@ -306,6 +306,37 @@ export const useUserStore = defineStore("userInfo", {
});
},
/**
*
* @param {sy使用}
* @returns
*/
async
normalAutoLogin
(
cb
=
null
)
{
uni
.
login
({
provider
:
"weixin"
,
success
:
async
(
res
)
=>
{
console
.
log
(
"normalAutoLogin"
,
res
);
if
(
res
.
errMsg
===
"login:ok"
)
{
const
{
data
}
=
await
autoLoginByCode
(
res
.
code
);
console
.
log
(
"normalAutoLogin"
,
data
);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if
(
data
&&
data
.
cuk
)
{
globalStore
.
setCuk
(
data
.
cuk
,
data
.
openId
,
data
.
unionId
);
cb
&&
cb
();
}
}
else
{
uni
.
showToast
({
title
:
res
.
errMsg
,
icon
:
"error"
,
});
}
md
.
sensors
.
init
();
},
});
},
async
createBabyInfo
(
babyInfo
)
{
console
.
log
(
"createBabyInfo:"
,
babyInfo
);
const
res
=
await
updateBabyInfo
(
babyInfo
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment