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
7b5c9196
Commit
7b5c9196
authored
Aug 12, 2025
by
王炽
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master' into dev
parents
4d2598c4
0a6cca46
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
35 deletions
+81
-35
user.js
stores/user.js
+79
-24
Integral.vue
views/Integral.vue
+2
-11
No files found.
stores/user.js
View file @
7b5c9196
...
...
@@ -119,31 +119,86 @@ export const useUserStore = defineStore("userInfo", {
/**
* 获取宝宝信息
*/
async
loadBabyInfo
()
{
const
{
data
}
=
await
fetchBabyInfo
();
console
.
log
(
"babyInfo"
,
data
);
if
(
data
?.
memberId
!==
"not_login"
)
{
this
.
babyInfo
=
data
;
if
(
this
.
babyInfo
.
babyAge
==
"0月龄"
)
{
this
.
babyInfo
.
babyAge
=
"1月龄"
;
}
console
.
log
(
"this.11111"
,
this
.
babyNickCache
,
data
?.
content
?.
id
);
const
findItem
=
this
.
babyNickCache
.
find
(
(
item
)
=>
item
.
id
==
data
?.
content
?.
id
);
if
(
data
?.
content
?.
id
&&
findItem
)
{
this
.
babyInfo
.
babyName
=
findItem
.
name
;
this
.
babyInfo
.
allBabyBaseInfo
.
forEach
((
item
)
=>
{
if
(
item
.
id
==
data
?.
content
?.
id
)
{
item
.
babyName
=
findItem
.
name
;
}
});
}
}
},
// async loadBabyInfo() {
// const { data } = await fetchBabyInfo();
// console.log("babyInfo", data);
// if (data?.memberId !== "not_login") {
// this.babyInfo = data;
// console.log("this.11111", this.babyNickCache, data?.content?.id);
// const findItem = this.babyNickCache.find(
// (item) => item.id == data?.content?.id
// );
// if (data?.content?.id && findItem) {
// this.babyInfo.babyName = findItem.name;
// this.babyInfo.allBabyBaseInfo.forEach((item) => {
// if (item.id == data?.content?.id) {
// item.babyName = findItem.name;
// }
// });
// }
// }
// },
async
loadBabyInfo
(
retryCount
=
0
)
{
const
MAX_RETRIES
=
3
;
const
RETRY_DELAY
=
1000
;
// 1 second
try
{
const
{
data
}
=
await
fetchBabyInfo
();
console
.
log
(
"babyInfo-宝宝信息"
,
data
);
if
(
data
?.
memberId
!==
"not_login"
)
{
if
(
data
.
allBabyBaseInfo
)
{
this
.
babyInfo
=
data
;
if
(
this
.
babyInfo
.
babyAge
==
"0月龄"
)
{
this
.
babyInfo
.
babyAge
=
"1月龄"
;
}
console
.
log
(
"this.11111"
,
this
.
babyNickCache
,
data
?.
content
?.
id
);
const
findItem
=
this
.
babyNickCache
.
find
(
(
item
)
=>
item
.
id
==
data
?.
content
?.
id
);
if
(
data
?.
content
?.
id
&&
findItem
)
{
this
.
babyInfo
.
babyName
=
findItem
.
name
;
this
.
babyInfo
.
allBabyBaseInfo
.
forEach
((
item
)
=>
{
if
(
item
.
id
==
data
?.
content
?.
id
)
{
item
.
babyName
=
findItem
.
name
;
}
});
}
return
;
// Success case, exit the function
}
else
{
console
.
log
(
"this.babyInfo"
,
'重新请求接口'
);
if
(
retryCount
<
MAX_RETRIES
-
1
)
{
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
RETRY_DELAY
));
return
this
.
loadBabyInfo
(
retryCount
+
1
);
}
else
{
console
.
log
(
"Max retries reached, giving up"
);
// Show user notification when max retries reached
uni
.
showToast
({
title
:
"系统繁忙,请稍后再试"
,
icon
:
"none"
,
});
}
}
}
}
catch
(
error
)
{
console
.
log
(
"🚀 ~ loadBabyInfo ~ error:"
,
error
);
if
(
retryCount
>=
MAX_RETRIES
-
1
)
{
// Show user notification when max retries reached with error
uni
.
showToast
({
title
:
"系统繁忙,请稍后再试"
,
icon
:
"none"
,
});
}
}
},
/**
* 获取用户积分信息
*/
...
...
views/Integral.vue
View file @
7b5c9196
...
...
@@ -416,8 +416,8 @@
"tupianBanben"
:
"1008"
,
"swiper"
:
[
{
"bannerImg"
:
"integralBannerBg
0
.png"
,
"url"
:
"
subPackages/shopMainList/topicNew/index?id=1000916
"
,
"bannerImg"
:
"integralBannerBg
1
.png"
,
"url"
:
""
,
"type"
:
2
,
"extra"
:
{
"appId"
:
"wx4205ec55b793245e"
,
...
...
@@ -595,15 +595,6 @@
]
}
,
"vipActive"
:
[
{
"img"
:
"vipAct0.png"
,
"url"
:
"subPackages/shopMainList/topicNew/index?id=1000911"
,
"type"
:
2
,
"extra"
:
{
"appId"
:
"wx4205ec55b793245e"
,
"envVersion"
:
"release"
}
}
,
{
"img"
:
"vipAct1.png"
,
"url"
:
"subPackages/shopMainList/topicNew/index?id=1000912"
,
...
...
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