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
642d61b3
Commit
642d61b3
authored
Aug 28, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lab
parent
2bc9a5df
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
30 deletions
+45
-30
xingmaLab.js
api/xingmaLab.js
+15
-7
XingmaLabPublishPage.vue
pages/XingmaLabPublishPage/XingmaLabPublishPage.vue
+30
-23
No files found.
api/xingmaLab.js
View file @
642d61b3
import
requestModule
from
'./request.js'
;
const
{
api
}
=
requestModule
;
import
requestModule
from
'./request.js'
const
{
api
}
=
requestModule
/**
* 星妈会藏馆
* @returns
*/
export
const
fetchRecordList
=
()
=>
api
.
get
(
'/c/lab/record/list'
)
;
export
const
fetchRecordList
=
()
=>
api
.
get
(
'/c/lab/record/list'
)
/**
* 我的收藏
* @returns
*/
export
const
fetchFavoriteList
=
()
=>
api
.
get
(
'/c/lab/favorite/list'
)
;
export
const
fetchFavoriteList
=
()
=>
api
.
get
(
'/c/lab/favorite/list'
)
/**
* 我的藏品
* @returns
*/
export
const
fetchRecordMyrecords
=
()
=>
api
.
get
(
'/c/lab/record/myRecords'
);
export
const
fetchRecordMyrecords
=
()
=>
api
.
get
(
'/c/lab/record/myRecords'
)
export
const
fetchRecordIndex
=
()
=>
api
.
get
(
'/c/lab/record/index'
)
export
const
fetchRecordPublish
=
(
data
)
=>
api
.
post
(
'/c/lab/record/create'
,
data
)
export
const
fetchRecordDetail
=
(
data
)
=>
api
.
get
(
'/c/lab/record/detail'
,
data
)
export
const
fetchFavoriteAdd
=
(
data
)
=>
api
.
get
(
'/c/lab/favorite/add'
,
data
)
export
const
fetchFavoriteRemove
=
(
data
)
=>
api
.
get
(
'/c/lab/favorite/remove'
,
data
)
pages/XingmaLabPublishPage/XingmaLabPublishPage.vue
View file @
642d61b3
...
...
@@ -63,23 +63,12 @@
</div>
<!-- 确认发布弹窗 - 使用 Xingmalabconfirmpop 组件 -->
<Xingmalabconfirmpop
:visible=
"showConfirmPopup"
title=
"确认发布"
confirm-text=
"确认发布"
cancel-text=
"取消"
@
confirm=
"handleConfirmPublish"
@
cancel=
"handleCancelPublish"
@
close=
"showConfirmPopup = false"
/>
<Xingmalabconfirmpop
:visible=
"showConfirmPopup"
title=
"确认发布"
confirm-text=
"确认发布"
cancel-text=
"取消"
@
confirm=
"handleConfirmPublish"
@
cancel=
"handleCancelPublish"
@
close=
"showConfirmPopup = false"
/>
<!-- 无次数弹窗 - 使用 Xingmalabnotimepop 组件 -->
<Xingmalabnotimepop
:visible=
"showNoTimePopup"
title=
"发布次数已用完"
@
button-click=
"handleNoTimeButtonClick"
@
close=
"showNoTimePopup = false"
/>
<Xingmalabnotimepop
:visible=
"showNoTimePopup"
title=
"发布次数已用完"
@
button-click=
"handleNoTimeButtonClick"
@
close=
"showNoTimePopup = false"
/>
<!-- 用户信息授权弹窗 -->
<uni-popup
ref=
"userInfoPopup"
type=
"bottom"
:mask-click=
"false"
>
...
...
@@ -185,6 +174,10 @@ const handleImageUpload = () => {
success
:
(
res
)
=>
{
const
tempFilePath
=
res
.
tempFilePaths
[
0
]
// 检查文件大小
uni
.
getFileInfo
({
filePath
:
tempFilePath
,
...
...
@@ -210,7 +203,7 @@ const handleImageUpload = () => {
}
// 上传图片
uploadImage
(
tempFilePath
)
uploadImage
Func
(
tempFilePath
)
},
fail
:
()
=>
{
uni
.
showToast
({
...
...
@@ -227,19 +220,33 @@ const handleImageUpload = () => {
}
// 上传图片到服务器
const
uploadImage
=
(
f
ilePath
)
=>
{
const
uploadImage
Func
=
async
(
tempF
ilePath
)
=>
{
isUploading
.
value
=
true
// 这里应该调用实际的上传接口
// 暂时使用本地路径作为示例
setTimeout
(()
=>
{
uploadedImage
.
value
=
filePath
console
.
log
(
tempFilePath
)
const
fs
=
uni
.
getFileSystemManager
();
console
.
log
(
fs
)
const
base64
=
"data:image/jpeg;base64,"
+
fs
.
readFileSync
(
tempFilePath
,
"base64"
);
const
uploadRes
=
await
uploadImage
(
base64
);
if
(
uploadRes
.
success
)
{
uploadedImage
.
value
=
tempFilePath
isUploading
.
value
=
false
uni
.
showToast
({
title
:
'图片上传成功'
,
icon
:
'
success
'
icon
:
'
none
'
})
},
1000
)
}
else
{
uni
.
showToast
({
title
:
uploadRes
.
message
,
icon
:
"none"
,
});
}
}
// 文案输入处理
...
...
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