fix:优化

This commit is contained in:
阿梦 2026-06-22 18:50:03 +08:00
parent df717c6705
commit b9e8c2d660
8 changed files with 62 additions and 79 deletions

View File

@ -1,5 +1,5 @@
import { getCache } from '@/utils/cache';
import { HOST, TENANT_ID } from '@/utils/request';
import { request, HOST, TENANT_ID } from '@/utils/request';
/**
* { url, ... }
@ -32,3 +32,19 @@ export const uploadFile = (filePath: string): Promise<{ url: string; [key: strin
});
});
};
/**
*
*/
export const checkImage = (data: {
bizId: string;
bizType: number;
imageUrl: string;
scene: number;
}) =>
request({
url: '/applet/media/checkImage',
method: 'POST',
data,
silent: true,
});

View File

@ -3,16 +3,9 @@
<!-- 左侧题目 -->
<scroll-view :class="['q-left', { expanded: isLeftExpanded }]" scroll-y :show-scrollbar="false">
<view class="q-left-inner">
<!-- 题号 + 类型徽章 -->
<view class="q-meta">
<view class="q-badge">
<text class="q-badge-num">{{ idx }}</text>
<text class="q-badge-divider">/</text>
<text class="q-badge-total">{{ total }}</text>
</view>
<view v-if="data?.titleChannelTypeName" class="q-type">
<text>{{ data.titleChannelTypeName }}</text>
</view>
<!-- 类型徽章 -->
<view v-if="data?.titleChannelTypeName" class="q-type">
<text>{{ data.titleChannelTypeName }}</text>
</view>
<!-- 父题目 -->
@ -261,10 +254,7 @@
>
<image :src="pic" mode="aspectFill" @click="previewPicList(pIdx)" />
<view v-if="!reportFlag" class="del-btn" @click.stop="deletePic(pic)">
<svg viewBox="0 0 16 16" fill="none">
<path d="m5 5 6 6m0-6-6 6" stroke="#FFFFFF"
stroke-width="2" stroke-linecap="round" />
</svg>
<image class="del-icon" src="/static/image/svg/del.svg" mode="aspectFit" />
</view>
</view>
<view
@ -365,7 +355,7 @@
<script setup lang="ts">
import { ref, computed, watch, onUnmounted } from 'vue';
import { uploadFile } from '@/api/upload';
import { uploadFile, checkImage } from '@/api/upload';
import ImageCropper from '@/components/ImageCropper/index.vue';
import { formatQuestionHtml } from '@/utils/questionHtml';
@ -798,6 +788,19 @@ const uploadImage = async (filePath: string) => {
submitAnswerPic.value = newList.join(',');
emit('submit', { submitAnswerPic: submitAnswerPic.value });
uni.hideLoading();
//
const bizId = props.data?.id || props.data?.itemId || '';
if (bizId && newUrl) {
checkImage({
bizId,
bizType: 1,
imageUrl: newUrl,
scene: 1,
}).catch(() => {
//
});
}
} catch (err: any) {
uni.hideLoading();
uni.showToast({ title: err?.message || '上传失败', icon: 'none' });
@ -952,45 +955,12 @@ onUnmounted(() => {
padding: 10rpx 34rpx 10rpx 12rpx;
}
.q-meta {
display: flex;
align-items: center;
gap: 6rpx;
margin-bottom: 6rpx;
}
.q-badge {
display: inline-flex;
align-items: baseline;
gap: 2rpx;
padding: 3rpx 9rpx;
background: linear-gradient(180deg, #818cf8, #4f46e5);
color: #ffffff;
border-radius: 999rpx;
box-shadow:
0 4rpx 10rpx rgba(79, 70, 229, 0.3),
inset 0 -3rpx 0 rgba(0, 0, 0, 0.12);
.q-badge-num {
font-size: 15rpx;
font-weight: 800;
}
.q-badge-divider {
font-size: 11rpx;
opacity: 0.6;
}
.q-badge-total {
font-size: 12rpx;
opacity: 0.85;
}
}
.q-type {
display: inline-flex;
padding: 2rpx 8rpx;
background: #eef2ff;
border-radius: 999rpx;
margin-bottom: 6rpx;
text {
font-size: 13rpx;
@ -1623,15 +1593,18 @@ onUnmounted(() => {
position: absolute;
top: 4rpx;
right: 4rpx;
width: 36rpx;
height: 36rpx;
background: rgba(15, 23, 42, 0.7);
width: 38rpx;
height: 38rpx;
background: rgba(15, 23, 42, 0.65);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
svg { width: 22rpx; height: 22rpx; }
.del-icon {
width: 24rpx;
height: 24rpx;
}
}
}

View File

@ -23,13 +23,7 @@
<text class="total">{{ paperList.length }}</text>
</view>
<view class="top-clock">
<view class="clock-icon">
<svg viewBox="0 0 16 16" fill="none">
<circle cx="8" cy="8" r="6" stroke="#4F46E5" stroke-width="1.4" />
<path d="M8 5v3l2 1.2" stroke="#4F46E5" stroke-width="1.4"
stroke-linecap="round" />
</svg>
</view>
<image class="clock-icon" src="/static/image/svg/time.svg" mode="aspectFit" />
<text>{{ timeFilter }}</text>
</view>
</view>
@ -586,7 +580,7 @@ onUnmounted(() => {
display: flex;
align-items: center;
gap: 4rpx;
padding: 3rpx 10rpx;
padding: 5rpx 10rpx;
background: #ffffff;
border-radius: 999rpx;
box-shadow:
@ -594,13 +588,9 @@ onUnmounted(() => {
inset 0 -3rpx 0 rgba(199, 210, 254, 0.5);
.clock-icon {
width: 15rpx;
height: 15rpx;
svg {
width: 100%;
height: 100%;
}
width: 17rpx;
height: 17rpx;
flex-shrink: 0;
}
text {
@ -608,6 +598,8 @@ onUnmounted(() => {
font-weight: 700;
color: #4f46e5;
font-variant-numeric: tabular-nums;
line-height: 20rpx;
vertical-align: middle;
}
}
@ -617,7 +609,7 @@ onUnmounted(() => {
height: 0;
position: relative;
z-index: 1;
padding: 0 10rpx 5rpx;
padding: 0 10rpx;
display: flex;
flex-direction: column;
}
@ -632,16 +624,16 @@ onUnmounted(() => {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 6rpx;
padding: 6rpx 0 calc(8rpx + constant(safe-area-inset-bottom));
padding: 6rpx 0 calc(8rpx + env(safe-area-inset-bottom));
gap: 4rpx;
padding: 3rpx 0 calc(6rpx + constant(safe-area-inset-bottom));
padding: 3rpx 0 calc(6rpx + env(safe-area-inset-bottom));
box-sizing: border-box;
}
.indicator {
flex: 1;
width: 0;
height: 42rpx;
height: 40rpx;
white-space: nowrap;
}
@ -649,7 +641,7 @@ onUnmounted(() => {
display: inline-flex;
align-items: center;
gap: 5rpx;
padding: 3rpx 0 7rpx;
padding: 4rpx 0;
}
.indicator-item {
@ -731,13 +723,13 @@ onUnmounted(() => {
.btn-next {
flex-shrink: 0;
height: 36rpx;
padding: 0 18rpx;
height: 32rpx;
padding: 0 14rpx;
border-radius: 999rpx;
display: flex;
align-items: center;
justify-content: center;
gap: 8rpx;
gap: 6rpx;
background: linear-gradient(180deg, #4ade80, #16a34a);
color: #ffffff;
box-shadow:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1782092688921" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3186" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 883.2A371.2 371.2 0 1 0 140.8 512 371.2 371.2 0 0 0 512 883.2z m0 64a435.2 435.2 0 1 1 435.2-435.2 435.2 435.2 0 0 1-435.2 435.2z" fill="#ffffff" p-id="3187"></path><path d="M557.056 512l122.368 122.368a31.744 31.744 0 1 1-45.056 45.056L512 557.056l-122.368 122.368a31.744 31.744 0 1 1-45.056-45.056L466.944 512 344.576 389.632a31.744 31.744 0 1 1 45.056-45.056L512 466.944l122.368-122.368a31.744 31.744 0 1 1 45.056 45.056z" fill="#ffffff" p-id="3188"></path></svg>

After

Width:  |  Height:  |  Size: 804 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1782092625081" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2128" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 0a512 512 0 1 0 512 512 512.585143 512.585143 0 0 0-512-512z m0 938.715429A426.715429 426.715429 0 1 1 938.715429 512 427.154286 427.154286 0 0 1 512 938.715429z" fill="#5047E5" p-id="2129"></path><path d="M701.44 615.497143L542.208 523.483429V272.530286a38.4 38.4 0 0 0-76.8 0V541.257143c0 14.189714 17.627429 26.185143 29.184 32.768 4.900571 5.12 10.825143 9.216 17.261714 12.214857l158.208 95.963429a34.304 34.304 0 0 0 48.786286-13.970286 39.643429 39.643429 0 0 0-17.554286-52.809143z" fill="#5047E5" p-id="2130"></path></svg>

After

Width:  |  Height:  |  Size: 869 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 370 KiB