This commit is contained in:
2025-06-24 20:55:09 +08:00
parent b98de4746d
commit 3ac2bbcf07
13 changed files with 116 additions and 146 deletions

View File

@@ -1,10 +1,9 @@
<script setup>
import {ref, reactive} from "vue";
import {reactive, ref} from "vue";
import XNav from "../../components/XNav.vue";
import {copy, download, showToast} from "../../utils/uils.js";
import XLink from "../../components/XLink.vue";
import XImage from "../../components/XImage.vue";
import testIcon from "../../static/images/test.png";
import {onLoad} from "@dcloudio/uni-app";
import Api from "../../api/index.js";
import {useUserStore} from "../../pinia/UserStore/index.js";
@@ -15,15 +14,15 @@ const current = ref(0);
const tabs = reactive([]);
onLoad((options) => {
const {id, token} = options;
const {id, token, task_children_id} = options;
if (!id) {
showToast('未找到任务');
return;
}
setToken(token);
Api.system.getTaskinfo(id).then(({data}) => {
Api.system.getTaskinfo(id, task_children_id).then(({data}) => {
Object.assign(detail, data);
tabs.push(...detail.children.material.map((v, index) => ({
tabs.push(...detail.children?.material?.map((v, index) => ({
id: v.id,
name: `素材${index + 1}`
})));
@@ -39,90 +38,76 @@ onLoad((options) => {
<tui-tabs v-if="tabs.length>0" :tabs="tabs" :currentTab="current" @change="({index})=>current=index"></tui-tabs>
<view class="block">
<view class="title">标题</view>
<view class="info">
{{ detail.children.material[current].title }}
<template v-if="detail.id">
<view class="block" v-if="detail.material_type?.title_limit > 0">
<view class="title">标题</view>
<view class="info">
{{ detail.children.material[current].title }}
<view class="copy-button" @click="copy(detail.children.material[current].title)">复制</view>
</view>
</view>
<view class="block">
<view class="title">
话题
<x-link class="!ml-auto" show-description>查看引导</x-link>
</view>
<view class="info">
{{ detail.children.material[current].tags_arr.join(' ') }}
<view class="copy-button" @click="copy(detail.children.material[current].tags_arr.join(' '))">复制</view>
</view>
</view>
<view class="block">
<view class="title">正文</view>
<view class="info">
{{ detail.children.material[current].content }}
<view class="copy-button" @click="copy(detail.children.material[current].content)">复制</view>
</view>
</view>
<view class="block">
<view class="title">素材请按顺序下载&发布</view>
<view class="info">
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
<x-image
v-for="(v, index) in detail.children.material[current].material_arr"
:key="index"
:src="v"
imageClass="!w-[100%] !h-auto !aspect-square">
</x-image>
<view class="copy-button" @click="copy(detail.children?.material[current].title)">复制</view>
</view>
<view class="copy-button" @click="download(detail.children.material[current].material_arr)">批量保存</view>
</view>
</view>
<view v-if="detail.children?.material[current]?.comment" class="block">
<view class="title">评论1</view>
<view class="info">
{{ detail.children?.material[current]?.comment.intro }}
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
<x-image
v-for="j in detail.children?.material[current]?.comment.image_arr"
:src="j"
imageClass="!w-[100%] !h-auto !aspect-square">
</x-image>
</view>
<view class="!flex gap-[24rpx] justify-center">
<view class="copy-button !mx-0" @click="copy(detail.children?.material[current]?.comment.intro)">复制文字
<view class="block" v-if="detail.material_type?.tags_limit > 0">
<view class="title">
话题
<view class="!ml-auto">
<x-image :src="detail.task_content[current].ts_images_arr[0]"
:list="detail.task_content[current].ts_images_arr">
<x-link show-description>查看引导</x-link>
</x-image>
</view>
<view class="copy-button !mx-0"
@click="download(detail.children?.material[current]?.comment.image_arr)">保存图片
</view>
<view class="info">
{{ detail.children?.material[current].tags_arr.join(' ') }}
<view class="copy-button" @click="copy(detail.children.material[current].tags_arr.join(' '))">复制
</view>
</view>
</view>
</view>
<view v-for="(v, index) in detail.children?.material[current]?.comment.children" :key="v.id" class="block">
<view class="title">评论{{ index + 2 }}</view>
<view class="info">
{{ v.intro }}
<view class="block" v-if="detail.material_type?.desc_limit > 0">
<view class="title">正文</view>
<view class="info">
{{ detail.children?.material[current].content }}
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
<x-image v-for="j in v.image_arr" :src="j" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
</view>
<view class="!flex gap-[24rpx] justify-center">
<view class="copy-button !mx-0" @click="copy(v.intro)">复制文字
</view>
<view class="copy-button !mx-0" @click="download(v.image_arr)">保存图片</view>
<view class="copy-button" @click="copy(detail.children?.material[current].content)">复制</view>
</view>
</view>
</view>
<view class="block">
<view class="title">素材请按顺序下载&发布</view>
<view class="info">
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
<x-image
v-for="(v, index) in detail.children?.material[current].material_arr"
:key="index"
:src="v"
imageClass="!w-[100%] !h-auto !aspect-square">
</x-image>
</view>
<view class="copy-button" @click="download(detail.children?.material[current].material_arr)">批量保存
</view>
</view>
</view>
<view v-for="(v, index) in detail.children?.material[current]?.comment" :key="v.id" class="block">
<view class="title">评论{{ index + 1 }}</view>
<view class="info">
{{ v.intro }}
<view class="!grid grid-cols-5 flex-wrap gap-[32rpx]">
<x-image v-for="j in v.image_arr" :src="j" imageClass="!w-[100%] !h-auto !aspect-square"></x-image>
</view>
<view class="!flex gap-[24rpx] justify-center">
<view class="copy-button !mx-0" @click="copy(v.intro)">复制文字
</view>
<view class="copy-button !mx-0" @click="download(v.image_arr)">保存图片</view>
</view>
</view>
</view>
</template>
</template>
<style scoped lang="scss">