This commit is contained in:
2025-12-14 15:01:13 +08:00
parent 2c572ee282
commit 39d9a3e8da
5 changed files with 37 additions and 38 deletions

View File

@@ -1,26 +1,26 @@
<script setup>
import {reactive, ref} from "vue";
import { reactive, ref } from "vue";
import XNav from "../../components/XNav.vue";
import {copy, download, showToast} from "../../utils/uils.js";
import { copy, download, showToast } from "../../utils/uils.js";
import XLink from "../../components/XLink.vue";
import XImage from "../../components/XImage.vue";
import {onLoad} from "@dcloudio/uni-app";
import { onLoad } from "@dcloudio/uni-app";
import Api from "../../api/index.js";
import {useUserStore} from "../../pinia/UserStore/index.js";
import { useUserStore } from "../../pinia/UserStore/index.js";
const {setToken} = useUserStore();
const { setToken } = useUserStore();
const detail = reactive({});
const current = ref(0);
const tabs = reactive([]);
onLoad((options) => {
const {id, token, task_children_id} = options;
const { id, token, task_children_id } = options;
if (!id) {
showToast('未找到任务');
return;
}
setToken(token);
Api.system.getTaskinfo(id, task_children_id).then(({data}) => {
Api.system.getTaskinfo(id, task_children_id).then(({ data }) => {
Object.assign(detail, data);
tabs.push(...detail.children?.material?.map((v, index) => ({
id: v.id,
@@ -41,11 +41,11 @@ const saveM = () => {
<x-nav></x-nav>
<!-- #endif -->
<tui-tabs v-if="tabs.length>0" :tabs="tabs" :currentTab="current" @change="({index})=>current=index"></tui-tabs>
<tui-tabs v-if="tabs.length > 0" :tabs="tabs" :currentTab="current" @change="({ index }) => current = index"></tui-tabs>
<template v-if="detail.id">
<view class="block"
v-if="detail.material_type?.title_limit > 0 && detail.children.material[current].title.length > 0">
v-if="detail.material_type?.title_limit > 0 && detail.children.material[current].title.length > 0">
<view class="title">标题</view>
<view class="info">
{{ detail.children.material[current].title }}
@@ -64,12 +64,11 @@ const saveM = () => {
</view>
<view class="block"
v-if="detail.material_type?.tags_limit > 0 && detail.children?.material[current].tags_arr.length > 0">
v-if="detail.material_type?.tags_limit > 0 && detail.children?.material[current].tags_arr.length > 0">
<view class="title">
话题
<view class="!ml-auto">
<x-image :src="detail.video"
:list="[detail.video]">
<x-image :src="detail.video" :list="[detail.video]">
<x-link show-description>查看引导</x-link>
</x-image>
</view>
@@ -85,10 +84,7 @@ const saveM = () => {
<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"
<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>
@@ -108,8 +104,7 @@ const saveM = () => {
}}
</view>
<view class="!ml-auto" v-if="v.pid !== 0">
<x-image :src="detail.comment_video"
:list="[detail.comment_video]">
<x-image :src="detail.comment_video" :list="[detail.comment_video]">
<x-link show-description>查看引导</x-link>
</x-image>
</view>
@@ -165,6 +160,7 @@ const saveM = () => {
border: 1px solid #E5E6EB;
border-radius: 8rpx;
position: relative;
white-space: pre-line;
}
.title {