|
@@ -13,20 +13,21 @@ import { useToast } from 'wot-design-uni'
|
|
|
const userStore = useUserStore()
|
|
|
const { userInfo } = storeToRefs(userStore)
|
|
|
const { error } = useToast()
|
|
|
-const value = ref('')
|
|
|
+const content = ref('')
|
|
|
const fileList = ref([])
|
|
|
-const action = ref('')
|
|
|
-const handleChange = (e: any) => {
|
|
|
- console.log(e)
|
|
|
+const action = ref(`${import.meta.env.VITE_SERVER_BASEURL}/app-api/infra/file/upload`)
|
|
|
+const handleChange = ({ fileList: files }) => {
|
|
|
+ fileList.value = files
|
|
|
+ console.log(fileList.value)
|
|
|
}
|
|
|
const handleSubmit = async () => {
|
|
|
const { code, msg } = await createCircle({
|
|
|
stylistId: userInfo.value.userId,
|
|
|
stylistName: userInfo.value.nickname,
|
|
|
- bannerUrls: [],
|
|
|
+ bannerUrls: fileList.value.map(({ response }) => JSON.parse(response).data),
|
|
|
tagName: '',
|
|
|
headUrl: userInfo.value.avatar,
|
|
|
- circleDesc: 'test',
|
|
|
+ circleDesc: content.value,
|
|
|
circleType: '1',
|
|
|
})
|
|
|
if (code !== 0) {
|
|
@@ -36,10 +37,14 @@ const handleSubmit = async () => {
|
|
|
title: '发布成功',
|
|
|
})
|
|
|
}
|
|
|
+onMounted(() => {
|
|
|
+ console.log(action.value)
|
|
|
+})
|
|
|
</script>
|
|
|
<template>
|
|
|
<div class="flex-grow bg-white p-3.5 flex flex-col">
|
|
|
- <wd-textarea v-model="value" placeholder="分享你此刻的想法" />
|
|
|
+ <wd-textarea v-model="content" placeholder="分享你此刻的想法" />
|
|
|
+
|
|
|
<!-- <div class="flex items-center">
|
|
|
<img
|
|
|
class="w-[100px] h-[100px] rounded-lg overflow-hidden"
|