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
c3093201
Commit
c3093201
authored
Sep 01, 2025
by
王炽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口刷新
parent
70ba1d63
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
249 additions
and
58 deletions
+249
-58
xingmaLab.vue
pages/xingmaLab/xingmaLab.vue
+123
-49
xingmaLab.js
stores/xingmaLab.js
+126
-9
No files found.
pages/xingmaLab/xingmaLab.vue
View file @
c3093201
This diff is collapsed.
Click to expand it.
stores/xingmaLab.js
View file @
c3093201
import
{
defineStore
}
from
"pinia"
;
import
{
fetchRecordIndex
}
from
"../api/xingmaLab.js"
;
import
{
fetchRecordIndex
,
fetchRecordList
,
fetchFavoriteList
,
fetchRecordMyrecords
}
from
"../api/xingmaLab.js"
;
export
const
useXingmaLabStore
=
defineStore
(
"xingmaLab"
,
{
state
:
()
=>
{
return
{
// 星妈Lab接口返回的完整数据
xingmaInfo
:
null
,
// 加载状态
isLoading
:
false
,
// 藏馆接口返回的完整数据
cangguanInfo
:
null
,
// 收藏接口返回的完整数据
shoucangInfo
:
null
,
// 藏品接口返回的完整数据
cangpinInfo
:
null
,
// 加载状态(各接口独立)
isLoadingIndex
:
false
,
isLoadingCangguan
:
false
,
isLoadingShoucang
:
false
,
isLoadingCangpin
:
false
,
};
},
actions
:
{
...
...
@@ -16,7 +25,7 @@ export const useXingmaLabStore = defineStore("xingmaLab", {
*/
async
loadXingmaInfo
()
{
try
{
this
.
isLoading
=
true
;
this
.
isLoading
Index
=
true
;
const
{
data
}
=
await
fetchRecordIndex
();
console
.
log
(
"xingmaInfo data"
,
data
);
...
...
@@ -24,27 +33,135 @@ export const useXingmaLabStore = defineStore("xingmaLab", {
this
.
xingmaInfo
=
data
;
console
.
log
(
'保存的星妈Lab数据:'
,
this
.
xingmaInfo
);
}
else
{
console
.
warn
(
'星妈Lab数据格式不正确:'
,
data
);
console
.
log
(
'星妈Lab数据格式不正确:'
,
data
);
}
}
catch
(
error
)
{
console
.
error
(
'获取星妈Lab数据失败:'
,
error
);
console
.
log
(
'获取星妈Lab数据失败:'
,
error
);
}
finally
{
this
.
isLoading
=
false
;
this
.
isLoading
Index
=
false
;
}
},
/**
* 重置数据
* 获取藏馆数据
*/
async
loadCangguanInfo
(
pageIndex
=
1
,
pageSize
=
4
)
{
try
{
this
.
isLoadingCangguan
=
true
;
const
{
data
}
=
await
fetchRecordList
(
pageIndex
,
pageSize
);
console
.
log
(
"cangguanInfo data"
,
data
);
if
(
data
)
{
this
.
cangguanInfo
=
data
;
console
.
log
(
'保存的藏馆数据:'
,
this
.
cangguanInfo
);
}
else
{
console
.
log
(
'藏馆数据格式不正确:'
,
data
);
}
}
catch
(
error
)
{
console
.
log
(
'获取藏馆数据失败:'
,
error
);
}
finally
{
this
.
isLoadingCangguan
=
false
;
}
},
/**
* 获取收藏数据
*/
async
loadShoucangInfo
(
pageIndex
=
1
,
pageSize
=
4
)
{
try
{
this
.
isLoadingShoucang
=
true
;
const
{
data
}
=
await
fetchFavoriteList
(
pageIndex
,
pageSize
);
console
.
log
(
"shoucangInfo data"
,
data
);
if
(
data
)
{
this
.
shoucangInfo
=
data
;
console
.
log
(
'保存的收藏数据:'
,
this
.
shoucangInfo
);
}
else
{
console
.
log
(
'收藏数据格式不正确:'
,
data
);
}
}
catch
(
error
)
{
console
.
log
(
'获取收藏数据失败:'
,
error
);
}
finally
{
this
.
isLoadingShoucang
=
false
;
}
},
/**
* 获取藏品数据
*/
async
loadCangpinInfo
(
pageIndex
=
1
,
pageSize
=
8
)
{
try
{
this
.
isLoadingCangpin
=
true
;
const
{
data
}
=
await
fetchRecordMyrecords
(
pageIndex
,
pageSize
);
console
.
log
(
"cangpinInfo data"
,
data
);
if
(
data
)
{
this
.
cangpinInfo
=
data
;
console
.
log
(
'保存的藏品数据:'
,
this
.
cangpinInfo
);
}
else
{
console
.
log
(
'藏品数据格式不正确:'
,
data
);
}
}
catch
(
error
)
{
console
.
log
(
'获取藏品数据失败:'
,
error
);
}
finally
{
this
.
isLoadingCangpin
=
false
;
}
},
/**
* 重置星妈Lab数据
*/
resetXingmaInfo
()
{
this
.
xingmaInfo
=
null
;
},
/**
* 获取当前数据
* 重置藏馆数据
*/
resetCangguanInfo
()
{
this
.
cangguanInfo
=
null
;
},
/**
* 重置收藏数据
*/
resetShoucangInfo
()
{
this
.
shoucangInfo
=
null
;
},
/**
* 重置藏品数据
*/
resetCangpinInfo
()
{
this
.
cangpinInfo
=
null
;
},
/**
* 获取星妈Lab数据
*/
getXingmaInfo
()
{
return
this
.
xingmaInfo
;
},
/**
* 获取藏馆数据
*/
getCangguanInfo
()
{
return
this
.
cangguanInfo
;
},
/**
* 获取收藏数据
*/
getShoucangInfo
()
{
return
this
.
shoucangInfo
;
},
/**
* 获取藏品数据
*/
getCangpinInfo
()
{
return
this
.
cangpinInfo
;
},
},
});
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