feat: 样式兼容pptr

This commit is contained in:
kenny
2025-12-19 16:59:46 +08:00
parent 1fb39e4721
commit 1533e492e7
23 changed files with 159 additions and 141 deletions
+4 -1
View File
@@ -171,7 +171,10 @@ export const shengxiaoSystem_prompt = `五行八卦中年柱、月柱、日柱
• 注意闰年:需要注意的是,如果出生年份是闰年,2月有29天,在计算天数序号时要相应调整。闰年的判断方法是:能被4整除但不能被100整除的年份为闰年,此外能被400整除的年份也是闰年 。例如,2024年是闰年,计算当年天数序号时,2月按29天计算。 • 注意闰年:需要注意的是,如果出生年份是闰年,2月有29天,在计算天数序号时要相应调整。闰年的判断方法是:能被4整除但不能被100整除的年份为闰年,此外能被400整除的年份也是闰年 。例如,2024年是闰年,计算当年天数序号时,2月按29天计算。
年柱、月柱和日柱的计算规则虽然复杂,但它们蕴含着古人对时间和命运的深刻理解,是五行八卦命理学的重要基础 。`; 年柱、月柱和日柱的计算规则虽然复杂,但它们蕴含着古人对时间和命运的深刻理解,是五行八卦命理学的重要基础 。
特别注意:不需要多余的换行符,比如额外多余的\n,请直接返回文本内容
`;
export const statureText = ( export const statureText = (
customKey, customKey,
@@ -98,7 +98,7 @@ watch(
<template v-for="item of json"> <template v-for="item of json">
<CheckBox :checked="item.checked">{{ item.type }}</CheckBox> <CheckBox :checked="item.checked">{{ item.type }}</CheckBox>
</template> </template>
<image class="figure" :src="imageUrl" mode="widthFix"></image> <img class="figure" :src="imageUrl" mode="widthFix"></img>
</view> </view>
</template> </template>
@@ -109,5 +109,6 @@ watch(
.figure { .figure {
margin-top: 26px; margin-top: 26px;
margin-bottom: 12px; margin-bottom: 12px;
width: 100%;
} }
</style> </style>
@@ -49,38 +49,36 @@ watch(
<template <template
v-if="styleImage === psychologicalStyleImage && props.gender == '女'" v-if="styleImage === psychologicalStyleImage && props.gender == '女'"
> >
<image class="bottomMap" :src="styleImage" mode="widthFix"></image> <img class="bottomMap" :src="styleImage" >
</template> </template>
<template v-else> <template v-else>
<template v-if="props.gender == '女'"> <template v-if="props.gender == '女'">
<image class="bottomMap" :src="styleImage" mode="widthFix"></image> <img class="bottomMap" :src="styleImage" >
<view> <view>
<view class="psychologicalStyle">心理风格</view> <view class="psychologicalStyle">心理风格</view>
<image <img
class="bottomMap" class="bottomMap"
:src="psychologicalStyleImage" :src="psychologicalStyleImage"
mode="widthFix" >
></image>
</view> </view>
</template> </template>
</template> </template>
</view> </view>
<view class=""> <view class="">
<image <img
class="bottomMap" class="bottomMap"
:src="'https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/bottomMap.png'" :src="'https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/bottomMap.png'"
mode="widthFix" >
></image>
</view> </view>
<view style="padding-left: 20px; margin-top: 56px"> <view style="padding-left: 20px; margin-top: 56px">
人工智能大模型在计算中可能存在0.5%的误差 人工智能大模型在计算中可能存在0.5%的误差
</view> </view>
<view class="reportCompleted"> <view class="reportCompleted">
<image <img
class="bottomMap" class="bottomMap"
:src="'/static/reportCompleted.png'" :src="'/static/reportCompleted.png'"
mode="widthFix" >
></image>
</view> </view>
</template> </template>
@@ -1,57 +1,56 @@
<script setup> <script setup>
import { defineProps, ref, watch } from "vue"; import { defineProps, ref, watch } from 'vue';
import CheckBox from "./Checkbox.vue"; import CheckBox from './Checkbox.vue';
import { styleJson, manStyleJson } from "./json/style"; import { styleJson, manStyleJson } from './json/style';
const props = defineProps({ const props = defineProps({
styleType: { styleType: {
type: String, type: String,
default: "", default: '',
}, },
picList: { picList: {
type: Array, type: Array,
default: () => [], // 使用函数返回默认值 default: () => [], // 使用函数返回默认值
}, },
gender: { gender: {
type: String, type: String,
default: "", default: '',
}, },
}); });
console.log('geneticStyle -------------------------------------', props.gender) console.log('geneticStyle -------------------------------------', props.gender);
const styleTypeDesc = ref(""); const styleTypeDesc = ref('');
const styleTypeJson = ref(); const styleTypeJson = ref();
const showPreview = ref(false); const showPreview = ref(false);
const currentPreviewImage = ref(""); const currentPreviewImage = ref('');
watch( watch(
() => props.styleType, () => props.styleType,
(newVal) => { (newVal) => {
const json = props.gender === "男" ? manStyleJson : styleJson; const json = props.gender === '男' ? manStyleJson : styleJson;
styleTypeJson.value = json.map((item) => ({ styleTypeJson.value = json.map((item) => ({
...item, ...item,
checked: item.type === newVal, checked: item.type === newVal,
})); }));
styleTypeDesc.value = styleTypeJson.value.find( styleTypeDesc.value = styleTypeJson.value.find(
(item) => item.type === props.styleType (item) => item.type === props.styleType,
)?.value; )?.value;
}, },
{ deep: true, immediate: true } { deep: true, immediate: true },
); );
const previewImage = (imageUrl) => { const previewImage = (imageUrl) => {
currentPreviewImage.value = imageUrl;
showPreview.value = true;
};
currentPreviewImage.value = imageUrl; const closePreview = (e) => {
showPreview.value = true; // 阻止事件冒泡
}; e.stopPropagation();
showPreview.value = false;
const closePreview = (e) => { currentPreviewImage.value = '';
// 阻止事件冒泡 };
e.stopPropagation();
showPreview.value = false;
currentPreviewImage.value = "";
};
</script> </script>
<template v-if="styleTypeJson"> <template v-if="styleTypeJson">
@@ -70,9 +69,17 @@ const closePreview = (e) => {
:key="index" :key="index"
:src="pic" :src="pic"
class="pic" class="pic"
mode="aspectFill" mode="widthFix"
@click="previewImage(pic)" @click="previewImage(pic)"
></image> ></image>
<!-- <img
v-for="(pic, index) in picList"
:key="index"
:src="pic"
@click="previewImage(pic)"
class="pic"
/> -->
</view> </view>
<!-- 图片预览遮罩层 --> <!-- 图片预览遮罩层 -->
@@ -82,66 +89,66 @@ const closePreview = (e) => {
:src="currentPreviewImage" :src="currentPreviewImage"
class="preview-image" class="preview-image"
mode="widthFix" mode="widthFix"
@click="closePreview" @click="closePreview"
></image> ></image>
</view> </view>
</view> </view>
</template> </template>
<style scoped> <style scoped>
.title { .title {
padding-left: 20px; padding-left: 20px;
line-height: 21px; line-height: 21px;
margin-bottom: 12px; margin-bottom: 12px;
} }
.container { .container {
padding: 0 26px; padding: 0 26px;
text-align: justify; text-align: justify;
} }
.desc { .desc {
color: #4e4e4e; color: #4e4e4e;
margin-top: 10px; margin-top: 10px;
} }
.pic-container { .pic-container {
display: flex; display: flex;
padding: 20px 18px; padding: 20px 18px;
} }
/* .pic { /* .pic {
width: 100px; width: 100px;
height: 100px; height: 100px;
background-color: #eee; background-color: #eee;
border-radius: 4px; border-radius: 4px;
} */ } */
/* 预览遮罩层样式 */ /* 预览遮罩层样式 */
.preview-mask { .preview-mask {
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: rgba(0, 0, 0, 0.8); background-color: rgba(0, 0, 0, 0.8);
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 999; z-index: 999;
} }
.preview-container { .preview-container {
width: 90%; width: 90%;
height: 90%; height: 90%;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.preview-image { .preview-image {
max-width: 100%; max-width: 100%;
max-height: 100%; max-height: 100%;
border-radius: 4px; border-radius: 4px;
} }
</style> </style>
+44 -35
View File
@@ -1,5 +1,7 @@
<template> <template>
<view style="overflow-x: hidden; font-size: 0"> <view style="overflow-x: hidden; font-size: 0" :style="{
paddingBottom: isInPptr ? '250px' : 0
}">
<Custom-Header :userFaceInfo="collect" v-if="isInPptr" /> <Custom-Header :userFaceInfo="collect" v-if="isInPptr" />
@@ -117,11 +119,11 @@
<!-- 个人分格描述报告--> <!-- 个人分格描述报告-->
<StyleDiagnosticReport :html="customerStyle" /> <StyleDiagnosticReport :html="customerStyle" />
<!-- <BottomPic <BottomPic
:style-type="collect?.type" :style-type="collect?.type"
:psychological-style="collect?.psychological_style" :psychological-style="collect?.psychological_style"
:gender="collect.sex" :gender="collect.sex"
/> --> />
</template> </template>
</view> </view>
</view> </view>
@@ -230,7 +232,7 @@
:key="index" :key="index"
:class="index === 1 ? 'avatar-main' : 'avatar-side'" :class="index === 1 ? 'avatar-main' : 'avatar-side'"
> >
<img :src="item.url" alt="" srcset="" @click="previewImage(item.url)" /> <img :src="item.url.includes('1720084773937.png') ? '/static/imgs/site.png' : item.url" @click="previewImage(item.url)" />
</view> </view>
</view> </view>
<view class="rich-text-content"> <view class="rich-text-content">
@@ -246,8 +248,9 @@
height: collect?.gender === '男' ? '150px' : '328px', height: collect?.gender === '男' ? '150px' : '328px',
}" }"
class="face-img-box" class="face-img-box"
style="margin: 0 auto;"
> >
<img :src="faceImgUrl" alt="" srcset="" style="object-fit: cover" /> <img :src="faceImgUrl" style="object-fit: cover;" />
</view> </view>
<rich-text :nodes="praiseTextList[1]"></rich-text> <rich-text :nodes="praiseTextList[1]"></rich-text>
<view class="more-hairstyle"> <view class="more-hairstyle">
@@ -277,14 +280,12 @@
<view v-if="isInPptr ? true : activeTab === 3"> <view v-if="isInPptr ? true : activeTab === 3">
<view class="style-type" style="overflow-y: hidden"> <view class="style-type" style="overflow-y: hidden">
<view class="lucky-color-box" style="overflow-y: hidden"> <view class="lucky-color-box" style="overflow-y: hidden">
<view class="shengxiao"> <view class="shengxiao" >
<img <img
:src=" :src="
`https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/chineseZodiac/` + `https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/chineseZodiac/` +
shegnxiaoImgUrl shegnxiaoImgUrl
" "
alt=""
srcset=""
@click=" @click="
previewImage( previewImage(
`https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/chineseZodiac/` + `https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/chineseZodiac/` +
@@ -297,30 +298,32 @@
<view class="five-attribute-box"> <view class="five-attribute-box">
<view <view
class="numblock" class="numblock"
style="background-color: rgba(193, 156, 45, 1); top: 286px; left: 40px" style="background-color: rgba(193, 156, 45, 1); top: 45.5%; left: 14%"
>{{ numToChinese(shengxiaoNumList[0]) }}</view >{{ numToChinese(shengxiaoNumList[0]) }}</view
> >
<view <view
class="numblock" class="numblock"
style="background-color: rgba(62, 166, 123, 1); top: 32px; left: 119px" style="background-color: rgba(62, 166, 123, 1); top: 4.5%; left: 39%"
>{{ numToChinese(shengxiaoNumList[1]) }}</view >{{ numToChinese(shengxiaoNumList[1]) }}</view
> >
<view class="numblock" style="background-color: rgba(61, 146, 168, 1); top: 136px">{{ <view class="numblock" style="background-color: rgba(61, 146, 168, 1); top: 21%;left:0%">{{
numToChinese(shengxiaoNumList[2]) numToChinese(shengxiaoNumList[2])
}}</view> }}</view>
<view <view
class="numblock" class="numblock"
style="background-color: rgba(195, 52, 55, 1); top: 150px; right: 10px" style="background-color: rgba(195, 52, 55, 1); top: 23%;right: 3%"
>{{ numToChinese(shengxiaoNumList[3]) }}</view >{{ numToChinese(shengxiaoNumList[3]) }}</view
> >
<view <view
class="numblock" class="numblock"
style="background-color: rgba(253, 231, 73, 1); top: 293px; right: 70px" style="background-color: rgba(253, 231, 73, 1); top: 45.5%; right: 22%"
>{{ numToChinese(shengxiaoNumList[4]) }}</view >{{ numToChinese(shengxiaoNumList[4]) }}</view
> >
<view class="five-attribute"> <view class="five-attribute">
<view class="avatorLogo"> <view class="avatorLogo">
<img :src="userFaceInfo?.avatar_img_url" alt="" srcset="" /> <img :src="userFaceInfo?.avatar_img_url" >
</view> </view>
<view> <view>
<img <img
@@ -345,12 +348,11 @@
<!-- 图片预览遮罩层 --> <!-- 图片预览遮罩层 -->
<view v-if="showPreview" class="preview-mask" @click="closePreview"> <view v-if="showPreview" class="preview-mask" @click="closePreview">
<view class="preview-container" @click.stop> <view class="preview-container" @click.stop>
<image <img
:src="currentPreviewImage" :src="currentPreviewImage"
class="preview-image" class="preview-image"
mode="widthFix"
@click="closePreview" @click="closePreview"
></image> >
</view> </view>
</view> </view>
@@ -1191,7 +1193,7 @@
} }
.reference-img-box { .reference-img-box {
height: 195.5px; /* height: 195.5px; */
margin-top: 20px; margin-top: 20px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -1200,7 +1202,8 @@
.reference-img-box .reference-img1 { .reference-img-box .reference-img1 {
width: 100%; width: 100%;
height: 195.5px; /* height: 195.5px; */
object-fit: scale-down;
} }
.reference-img-box .reference-img2 { .reference-img-box .reference-img2 {
@@ -1226,17 +1229,19 @@
.avatar-warp { .avatar-warp {
width: 100%; width: 100%;
height: 192px; /* height: 192px; */
height: 50vw;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }
.avatar-main { .avatar-main {
width: 116px; /* width: 116px; */
height: 160px; /* height: 160px; */
margin: 0 10px; height: 100%;
border-radius: 40px; margin: 0 10rpx;
border-radius: 40rpx;
overflow: hidden; overflow: hidden;
} }
@@ -1247,10 +1252,11 @@
} }
.avatar-side { .avatar-side {
width: 80px; /* width: 80px;
height: 120px; height: 120px; */
height: 80%;
/* background-color: yellow; */ /* background-color: yellow; */
border-radius: 40px; border-radius: 40rpx;
overflow: hidden; overflow: hidden;
} }
@@ -1265,12 +1271,14 @@
} }
.face-img-box { .face-img-box {
width: 336px; /* width: 336px;
height: 338px; width: 50vw; */
text-align: center;
/* height: 338px; */
} }
.face-img-box img { .face-img-box img {
width: 100%; /* width: 100%; */
height: 100%; height: 100%;
/* border-radius: 8px; */ /* border-radius: 8px; */
} }
@@ -1294,7 +1302,7 @@
.shengxiao { .shengxiao {
width: 100%; width: 100%;
height: 283px; /* height: 283px; */
} }
.shengxiao img { .shengxiao img {
@@ -1308,8 +1316,8 @@
} }
.numblock { .numblock {
width: 50px; width: 100rpx;
height: 50px; height: 100rpx;
display: flex; display: flex;
border-radius: 50%; border-radius: 50%;
align-items: center; align-items: center;
@@ -1317,12 +1325,14 @@
position: absolute; position: absolute;
color: white; color: white;
z-index: 999; z-index: 999;
font-size: 25rpx;
} }
.five-attribute { .five-attribute {
width: 100%; width: 100%;
/* height: 597px; */ /* height: 597px; */
position: relative; position: relative;
/* opacity: 0; */
} }
.five-attribute img { .five-attribute img {
@@ -1337,7 +1347,6 @@
top: 25%; top: 25%;
width: 66.5px; width: 66.5px;
height: 66.5px; height: 66.5px;
background-color: red;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
border: 3.22px solid rgba(167, 178, 179, 1); border: 3.22px solid rgba(167, 178, 179, 1);
@@ -1345,7 +1354,7 @@
.avatorLogo img { .avatorLogo img {
width: 100%; width: 100%;
height: 100%; /* height: 100%; */
object-fit: cover; object-fit: cover;
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 440 B

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 477 KiB

After

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 KiB

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 543 KiB

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 KiB

After

Width:  |  Height:  |  Size: 152 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 KiB

After

Width:  |  Height:  |  Size: 150 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 KiB

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 380 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 KiB

After

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 631 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 577 KiB

After

Width:  |  Height:  |  Size: 157 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 498 KiB

After

Width:  |  Height:  |  Size: 132 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 560 KiB

After

Width:  |  Height:  |  Size: 213 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 20 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

After

Width:  |  Height:  |  Size: 34 KiB