This commit is contained in:
2025-06-20 21:21:58 +08:00
parent 2e8617147c
commit be8a44b623
11 changed files with 155 additions and 48 deletions

View File

@@ -1,16 +1,22 @@
<script setup>
import {ref, reactive} from "vue";
import {ref, computed} from "vue";
import XSquareCarouselImage from "../../../components/XSquareCarouselImage.vue";
import {toPage, toWXMiniApp} from "../../../utils/uils.js";
import {toWXMiniApp} from "../../../utils/uils.js";
const {data} = defineProps({
const {data, home} = defineProps({
data: {
type: Object,
default: null,
},
home: {
type: Boolean,
default: false,
}
});
const current = ref(0);
const list = computed(() => data.children.material[current.value].comment?.flatMap(v => v.children ? [v, ...v.children] : [v]));
</script>
<template>
@@ -38,7 +44,7 @@ const current = ref(0);
话题:
</view>
<view class="block-info">
#话题1 #话题2 #话题3 #话题4 #话题5
{{ data.children.material[current].tags_arr.map(item => `#${item}`).join(' ') }}
</view>
</view>
<view class="block">
@@ -54,7 +60,8 @@ const current = ref(0);
素材:
</view>
<view class="block-info">
<x-square-carousel-image :list="data.children.material[current].material_arr"></x-square-carousel-image>
<x-square-carousel-image :list="data.children.material[current].material_arr"
:show-s-y="home"></x-square-carousel-image>
</view>
</view>
<view class="block">
@@ -62,17 +69,18 @@ const current = ref(0);
评论区案例:
</view>
<view class="block-info">
<view>
<view>评论1我用的也是这款早tb可以购买噢~我用的也是这款早tb可以购买噢~</view>
<view class="!flex gap-[20rpx] flex-wrap">
<image class="!w-[96rpx] !h-[96rpx] !aspect-square" mode="aspectFill"
src="/static/images/test.png"></image>
<image class="!w-[96rpx] !h-[96rpx] !aspect-square" mode="aspectFill"
src="/static/images/test.png"></image>
<image class="!w-[96rpx] !h-[96rpx] !aspect-square" mode="aspectFill"
src="/static/images/test.png"></image>
<image class="!w-[96rpx] !h-[96rpx] !aspect-square" mode="aspectFill"
src="/static/images/test.png"></image>
<view v-for="(v, index) in list">
<view>
评论{{ index + 1 }}:
<text v-if="v.pid" class="text-[rgba(134,144,156)]">回复{{
list.findIndex(k => k.pid === v.pid)
}}
</text>
{{ v.intro }}
</view>
<view class="!flex gap-[20rpx] flex-wrap !my-[10rpx]">
<image v-for="k in v.image_arr" class="!w-[96rpx] !h-[96rpx] !aspect-square" mode="aspectFill"
:src="k"></image>
</view>
</view>
</view>

View File

@@ -1,5 +1,5 @@
<script setup>
import {defineEmits, reactive, ref, watch} from "vue";
import {defineEmits, reactive, ref, watch, onMounted, nextTick} from "vue";
import XLink from "../../../components/XLink.vue";
import XUpload from "../../../components/XUpload.vue";
import XInput from "../../../components/XInput.vue";
@@ -27,7 +27,7 @@ const success = async () => {
const {msg} = await Api.system.addTaskBackfill({
id: data.children.id,
cid: current.value + 1,
content: content,
content: content.flat(),
type: data.task_content[current.value].is_image,
});
showToast(msg);
@@ -38,11 +38,25 @@ watch(
() => [data, current],
() => {
if (data.children.back[current.value]?.content_arr) {
content.push(...data.children.back[current.value].content_arr);
setTimeout(() => {
content.length = 0;
content.push(...data.children.back[current.value].content_arr.map(v => [v]));
}, 100);
}
},
{deep: true, immediate: true}
)
const initContent = () => {
content.length = 0;
data.task_content[current.value].data.forEach(v => {
content.push([]);
})
}
onMounted(() => {
initContent();
})
</script>
<template>
@@ -50,7 +64,7 @@ watch(
<view class="!flex gap-[24rpx] !mb-[28rpx]">
<view
v-for="(item,index) in data.task_content"
@click="current=index"
@click="() => {current=index;initContent()}"
:class="['tab-item', index===current?'cur':'']">
回填{{ index + 1 }}
</view>
@@ -89,16 +103,16 @@ watch(
</view>
</view>
<view class="block" v-for="(v, index) in data.fb_num">
<view class="block" v-for="(v, index) in data.task_content[current].data">
<view class="block-title">
回填{{ index + 1 }}的截图:
{{ v.name }}:
</view>
<view class="block-info">
<x-upload
:del="data.children.back[current]"
:single="true"
v-model:files="content"
v-if="data.task_content[current].is_image === 1">
v-model:files="content[index]"
v-if="v.is_image === 1">
</x-upload>
<x-input v-else v-model:model-value="content[index]" height="64rpx" placeholder="请输入内容"></x-input>
</view>
@@ -137,8 +151,9 @@ watch(
</template>
<template
v-if="data.children.back.length===0 || data.children.back[current]?.operate === 0 || data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1">
<tui-button @click="success" :disabled="data.children.back[current]">
v-if="!data.children.back[current] || data.children.back[current]?.operate === 0 || data.children.back[current]?.operate === 3">
<tui-button @click="success"
:disabled="data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1">
{{
data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1 ? '已提交' : '提交'
}}
@@ -161,7 +176,6 @@ watch(
</view>
</view>
</template>
</template>
<style scoped lang="scss">

View File

@@ -1,6 +1,6 @@
<script setup>
import XModal from "../../../components/XModal.vue";
import {defineEmits, reactive, ref} from "vue";
import {defineEmits, reactive, ref, watch} from "vue";
import XUpload from "../../../components/XUpload.vue";
import XInput from "../../../components/XInput.vue";
import Api from "../../../api/index.js";
@@ -20,11 +20,28 @@ const {data, current} = defineProps({
const content = reactive([]);
const show = ref(false);
const initContent = () => {
content.length = 0;
data.task_content[current].data.forEach(v => {
content.push([]);
})
}
watch(
() => show.value,
(val) => {
if (val) {
initContent();
}
},
{deep: true}
)
const success = async () => {
const {msg} = await Api.system.addTaskBackfill({
id: data.children.id,
cid: current + 1,
content: content,
content: content.flat(),
type: data.task_content[current].is_image,
});
showToast(msg);
@@ -42,15 +59,15 @@ const success = async () => {
<view class="!py-[40rpx] !px-[32rpx] test-32r font-blod">
<view class="text-center text-[#1D2129] pb-[20rpx]">重新回填回填数据1</view>
<view class="block" v-for="(v, index) in data.fb_num">
<view class="block" v-for="(v, index) in data.task_content[current].data">
<view class="block-title">
回填{{ index + 1 }}的截图:
{{ v.name }}:
</view>
<view class="block-info">
<x-upload
:del="data.children.user_status !== 2"
:single="true"
v-model:files="content"
v-model:files="content[index]"
v-if="data.task_content[current].is_image === 1">
</x-upload>
<x-input v-else v-model:model-value="content[index]" height="64rpx"

View File

@@ -57,6 +57,10 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
<view class="px-[24rpx] py-[16rpx] bg-[#fff] rounded-[8rpx] test-24r text-[#4E5969]" v-else
v-html="v.content">
</view>
<view
:class="[v.status===0?'text_warn':'',v.status===1?'text_success':'',v.status===-1?'text_error':'', 'text_info']">
{{ v.status_text }}
</view>
<view :class="['status', v.is_read === 1 ? 'read' : 'unread']">
{{ v.is_read === 1 ? '已读' : '未读' }}
</view>
@@ -200,4 +204,21 @@ const {loading, pagination, initFetchData, fetchData} = useTableQuery({
box-sizing: border-box;
padding: 24rpx;
}
.text_info {
font-size: 20rpx;
margin-top: 8rpx;
}
.text_success {
color: rgba(0, 180, 42, 1);
}
.text_warn {
color: rgba(255, 125, 0, 1);
}
.text_error {
color: rgba(245, 63, 63, 1);
}
</style>

View File

@@ -2,11 +2,16 @@
import fmt from "../../../static/images/fmt.png";
import linkIcon from '../../../static/icons/link.png';
import XImage from "../../../components/XImage.vue";
import XSquareCarouselImage from "../../../components/XSquareCarouselImage.vue";
const {data} = defineProps({
const {data, home} = defineProps({
data: {
type: Object,
default: null,
},
home: {
type: Boolean,
default: false
}
});
</script>
@@ -35,14 +40,11 @@ const {data} = defineProps({
<view class="block">
<view class="block-title">素材案例:</view>
<view class="block-info !grid grid-cols-3 gap-[20rpx]">
<x-image
<x-square-carousel-image
v-if="data.case_images_arr.length > 0"
class="!size-[160rpx]"
:src="data.case_images_arr[0]"
:list="data.case_images_arr"
:cur="0" mode="aspectFill"
:draggable="false">
</x-image>
:show-s-y="home">
</x-square-carousel-image>
</view>
</view>
<view class="block">