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,5 +1,5 @@
<script setup>
import { watch, ref } from "vue";
import { watch, ref, onUnmounted } from "vue";
import XModal from "./XModal.vue";
import Api from "../api/index.js";
import { useUserStore } from "../pinia/UserStore/index.js";
@@ -8,6 +8,7 @@ const UserStore = useUserStore();
const show = defineModel('show');
const qrCode = ref(null);
let old_openid = "";
let max_timer = 50;
let timer = null;
const cancel = () => {
@@ -16,6 +17,8 @@ const cancel = () => {
}
const check = async () => {
max_timer--;
if (max_timer <= 0 && timer) clearInterval(timer);
await UserStore.getUserInfo();
if (old_openid !== UserStore.userInfo.openid) {
cancel();
@@ -30,11 +33,15 @@ watch(
await UserStore.getUserInfo();
old_openid = UserStore.userInfo.openid;
qrCode.value = data.url;
timer = setInterval(check, 500);
timer = setInterval(check, 5000);
});
}
}
)
onUnmounted(() => {
if (timer) clearInterval(timer);
});
</script>
<template>

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 {

View File

@@ -1,6 +1,7 @@
<script setup>
import { onShow } from "@dcloudio/uni-app";
import ICON from "../../static/images/wxweb.png";
import {toPage} from "../../utils/uils";
onShow(() => {
const ua = navigator.userAgent.toLowerCase();

View File

@@ -4,10 +4,10 @@ import linkIcon from '../../../static/icons/link.png';
import XImage from "../../../components/XImage.vue";
import XSquareCarouselImage from "../../../components/XSquareCarouselImage.vue";
import HF_ICON from "../../../static/icons/icon-wrapper.png";
import {copy} from "../../../utils/uils.js";
import {computed} from "vue";
import { copy } from "../../../utils/uils.js";
import { computed } from "vue";
const {data, home} = defineProps({
const { data, home } = defineProps({
data: {
type: Object,
default: null,
@@ -36,8 +36,8 @@ const list = computed(() => data.comment_arr?.flatMap(v => v.children ? [v, ...v
{{ data.case_url }}
</text>
<view @click="copy(data.case_url)"
class="nowrap flex-shrink !py-[7rpx] !px-[32rpx] rounded-full bg-[#E8F3FF]"
style="font-size: 24rpx">
class="nowrap flex-shrink !py-[7rpx] !px-[32rpx] rounded-full bg-[#E8F3FF]"
style="font-size: 24rpx">
复制
</view>
</view>
@@ -46,9 +46,7 @@ const list = computed(() => data.comment_arr?.flatMap(v => v.children ? [v, ...v
<view class="block">
<view class="block-title">素材案例:</view>
<view class="block-info !grid grid-cols-3 gap-[20rpx]">
<x-square-carousel-image
v-if="data.case_images_arr.length > 0"
:list="data.case_images_arr"
<x-square-carousel-image v-if="data.case_images_arr.length > 0" :list="data.case_images_arr"
:show-s-y="true">
</x-square-carousel-image>
</view>
@@ -69,13 +67,10 @@ const list = computed(() => data.comment_arr?.flatMap(v => v.children ? [v, ...v
</view>
<view class="!flex gap-[20rpx] flex-wrap !my-[10rpx]">
<view class="!w-[96rpx] !h-[96rpx] !aspect-square" v-for="k in v.image_arr">
<x-image
:style="{
width: '96rpx',
height: '96rpx',
}"
:src="k"
:list="v.image_arr">
<x-image :style="{
width: '96rpx',
height: '96rpx',
}" :src="k" :list="v.image_arr">
</x-image>
</view>
</view>

View File

@@ -10,9 +10,9 @@ export default defineConfig({
defineModel: true,
}
}),
// UnifiedViteWeappTailwindcssPlugin({
// rem2rpx: true,
// })
UnifiedViteWeappTailwindcssPlugin({
rem2rpx: true,
})
],
css: {
postcss: {