|
@@ -17,6 +17,9 @@
|
|
|
width="95%"
|
|
width="95%"
|
|
|
:padding="[40, 30]"
|
|
:padding="[40, 30]"
|
|
|
>
|
|
>
|
|
|
|
|
+ <FlexCol :padding="[0, 20]">
|
|
|
|
|
+ <Text :text="`#${currentTag}`" fontConfig="contentText" />
|
|
|
|
|
+ </FlexCol>
|
|
|
<Field v-model="title" type="text" placeholder="输入标题(可选)" :maxLength="30" />
|
|
<Field v-model="title" type="text" placeholder="输入标题(可选)" :maxLength="30" />
|
|
|
<Field
|
|
<Field
|
|
|
v-model="content"
|
|
v-model="content"
|
|
@@ -26,7 +29,7 @@
|
|
|
:maxLength="1000"
|
|
:maxLength="1000"
|
|
|
rows="20"
|
|
rows="20"
|
|
|
:inputStyle="{
|
|
:inputStyle="{
|
|
|
- height: '700rpx',
|
|
|
|
|
|
|
+ height: '600rpx',
|
|
|
}"
|
|
}"
|
|
|
showWordLimit
|
|
showWordLimit
|
|
|
/>
|
|
/>
|
|
@@ -38,12 +41,13 @@
|
|
|
@updateList="onUpdateList"
|
|
@updateList="onUpdateList"
|
|
|
@allUploaded="onAllUploaded"
|
|
@allUploaded="onAllUploaded"
|
|
|
/>
|
|
/>
|
|
|
- <FlexRow justify="flex-end" align="center" gap="gap.md">
|
|
|
|
|
|
|
+ <FlexRow v-if="!querys.disableAi" justify="flex-end" align="center" gap="gap.md">
|
|
|
<Button text="AI看图写作" @click="openImageWriting" />
|
|
<Button text="AI看图写作" @click="openImageWriting" />
|
|
|
<Tbutton
|
|
<Tbutton
|
|
|
:title="title"
|
|
:title="title"
|
|
|
:content="content"
|
|
:content="content"
|
|
|
:images="images"
|
|
:images="images"
|
|
|
|
|
+ :disabled="querys.disableAiPops"
|
|
|
@showAi="showAgentPopup = true"
|
|
@showAi="showAgentPopup = true"
|
|
|
/>
|
|
/>
|
|
|
</FlexRow>
|
|
</FlexRow>
|
|
@@ -58,6 +62,7 @@
|
|
|
</FlexRow>
|
|
</FlexRow>
|
|
|
</ProvideVar>
|
|
</ProvideVar>
|
|
|
<Agent
|
|
<Agent
|
|
|
|
|
+ v-if="!querys.disableAi"
|
|
|
ref="agentRef"
|
|
ref="agentRef"
|
|
|
v-model:showAgentPopup="showAgentPopup"
|
|
v-model:showAgentPopup="showAgentPopup"
|
|
|
v-model:title="title"
|
|
v-model:title="title"
|
|
@@ -75,14 +80,15 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { computed, onMounted, ref, watch } from 'vue';
|
|
import { computed, onMounted, ref, watch } from 'vue';
|
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
-import { Debounce, formatError } from '@imengyu/imengyu-utils';
|
|
|
|
|
-import { confirm, toast } from '@/components/dialog/CommonRoot';
|
|
|
|
|
|
|
+import { useRecharge } from './composables/recharge';
|
|
|
|
|
+import { useOfficialAccount } from '@/pages/home/composeabe/OfficialAccount';
|
|
|
import { useAuthStore } from '@/store/auth';
|
|
import { useAuthStore } from '@/store/auth';
|
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
import { useSimpleDataLoader } from '@/components/composeabe/loader/SimpleDataLoader';
|
|
|
import { envVersion, isDevEnv } from '@/common/config/AppCofig';
|
|
import { envVersion, isDevEnv } from '@/common/config/AppCofig';
|
|
|
import { back, backAndCallOnPageBack } from '@/components/utils/PageAction';
|
|
import { back, backAndCallOnPageBack } from '@/components/utils/PageAction';
|
|
|
import { confirm as uniConfirm } from '@/components/utils/DialogAction';
|
|
import { confirm as uniConfirm } from '@/components/utils/DialogAction';
|
|
|
-import { useRecharge } from './composables/recharge';
|
|
|
|
|
|
|
+import { Debounce, formatError } from '@imengyu/imengyu-utils';
|
|
|
|
|
+import { confirm, toast } from '@/components/dialog/CommonRoot';
|
|
|
import type { UploaderAction, UploaderItem } from '@/components/form/Uploader';
|
|
import type { UploaderAction, UploaderItem } from '@/components/form/Uploader';
|
|
|
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
import BackgroundBox from '@/components/display/block/BackgroundBox.vue';
|
|
|
import Field from '@/components/form/Field.vue';
|
|
import Field from '@/components/form/Field.vue';
|
|
@@ -96,14 +102,17 @@ import PrimaryButton from '@/common/components/PrimaryButton.vue';
|
|
|
import Tbutton from './components/tbutton.vue';
|
|
import Tbutton from './components/tbutton.vue';
|
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
import Height from '@/components/layout/space/Height.vue';
|
|
|
import Button from '@/components/basic/Button.vue';
|
|
import Button from '@/components/basic/Button.vue';
|
|
|
-import OfficialApi, { PostMessage } from '@/api/light/OfficialApi';
|
|
|
|
|
import LightVillageApi from '@/api/light/LightVillageApi';
|
|
import LightVillageApi from '@/api/light/LightVillageApi';
|
|
|
import CommonContent from '@/api/CommonContent';
|
|
import CommonContent from '@/api/CommonContent';
|
|
|
-import { useOfficialAccount } from '@/pages/home/composeabe/OfficialAccount';
|
|
|
|
|
|
|
+import Text from '@/components/basic/Text.vue';
|
|
|
|
|
+import { processImages } from './composables/file';
|
|
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
const { querys } = useLoadQuerys({
|
|
|
tag: '',
|
|
tag: '',
|
|
|
villageId: 0,
|
|
villageId: 0,
|
|
|
|
|
+ entranceContent: '',
|
|
|
|
|
+ disableAiPops: false,
|
|
|
|
|
+ disableAi: false,
|
|
|
}, () => {
|
|
}, () => {
|
|
|
|
|
|
|
|
const info = uni.getSystemInfoSync();
|
|
const info = uni.getSystemInfoSync();
|
|
@@ -138,7 +147,6 @@ const { onPublishSuccess, makeOfficialPublishLinkPathAndParams, prePublish } = u
|
|
|
images: images.value.map((image) => image.localUrl),
|
|
images: images.value.map((image) => image.localUrl),
|
|
|
}));
|
|
}));
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const title = ref('');
|
|
const title = ref('');
|
|
|
const content = ref('');
|
|
const content = ref('');
|
|
|
const images = ref<{
|
|
const images = ref<{
|
|
@@ -166,6 +174,25 @@ const villageInfoForAI = useSimpleDataLoader(async () => {
|
|
|
return null;
|
|
return null;
|
|
|
}, false);
|
|
}, false);
|
|
|
|
|
|
|
|
|
|
+const currentTag = computed(() => querys.value.tag || '亮乡源');
|
|
|
|
|
+
|
|
|
|
|
+async function loadEntranceContent() {
|
|
|
|
|
+ const entranceContent = uni.getStorageSync(querys.value.entranceContent);
|
|
|
|
|
+ if (entranceContent) {
|
|
|
|
|
+ content.value = entranceContent.content || '';
|
|
|
|
|
+ title.value = entranceContent.title || '';
|
|
|
|
|
+ const originalImages = entranceContent.images || [];
|
|
|
|
|
+ const processedImages = await processImages(originalImages);
|
|
|
|
|
+ images.value = processedImages;
|
|
|
|
|
+ uploader.value?.setList(processedImages.map((image) => ({
|
|
|
|
|
+ url: image.url,
|
|
|
|
|
+ type: 'image',
|
|
|
|
|
+ filePath: image.localUrl,
|
|
|
|
|
+ state: image.url ? 'success' : 'notstart',
|
|
|
|
|
+ })));
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const extraInfoFoAi = computed(() => {
|
|
const extraInfoFoAi = computed(() => {
|
|
|
const result = [] as string[];
|
|
const result = [] as string[];
|
|
|
result.push('用户正在编写话题:' +
|
|
result.push('用户正在编写话题:' +
|
|
@@ -297,7 +324,10 @@ defineExpose({
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
- loadDraft();
|
|
|
|
|
|
|
+ if (querys.value.entranceContent)
|
|
|
|
|
+ loadEntranceContent();
|
|
|
|
|
+ else
|
|
|
|
|
+ loadDraft();
|
|
|
if (envVersion === 'develop') {
|
|
if (envVersion === 'develop') {
|
|
|
//showAgentPopup.value = true;
|
|
//showAgentPopup.value = true;
|
|
|
}
|
|
}
|