添加朋友圈功能

This commit is contained in:
bobobobo
2026-01-13 01:12:29 +08:00
parent ac67fa30f4
commit 06e026c8b8
8 changed files with 319 additions and 44 deletions

View File

@@ -1,5 +1,8 @@
<script setup>
import { reactive } from 'vue'
import { addUserMoments } from '@/api/my-index'
import { useUI } from '@/utils/use-ui'
import { navigateBack } from '@/utils/router'
const placeholderStyle = `font-family: PingFang SC, PingFang SC;
font-weight: 500;
@@ -9,13 +12,31 @@ line-height: 40rpx;
font-style: normal;
text-transform: none;`
const { showToast } = useUI()
const formData = reactive({
txt: '',
listImg: []
})
const onUpData = () => {
console.log(formData)
const onUpData = async () => {
if (!formData.txt) {
showToast('请输入内容')
return
}
await addUserMoments({
content: formData.txt,
privacy: 0,
images: formData.listImg.map(v => {
return {
imageUrl: v
}
})
})
await showToast('发布成功', 'success')
navigateBack()
}
</script>