feat: 提交一下
This commit is contained in:
+176
-287
@@ -10,12 +10,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<view :class="classFixed" style="width: 100%">
|
||||
<Tabs
|
||||
:tabs="tabsList"
|
||||
:activeTab="activeTab"
|
||||
@update:activeTab="onTabChange"
|
||||
>
|
||||
</Tabs>
|
||||
<Tabs :tabs="tabsList" :activeTab="activeTab" @update:activeTab="onTabChange"> </Tabs>
|
||||
</view>
|
||||
<view
|
||||
class="content"
|
||||
@@ -25,9 +20,7 @@
|
||||
}"
|
||||
v-if="collect"
|
||||
>
|
||||
|
||||
<view v-if="activeTab === 0">
|
||||
|
||||
<view class="style-type">
|
||||
<!--
|
||||
基因风格
|
||||
@@ -56,11 +49,8 @@
|
||||
:luminance="collect?.luminance ?? 0"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<!-- 轮廓类型-->
|
||||
<template v-if="customFigure">
|
||||
|
||||
<SensoryTypes
|
||||
:type="collect.straight_total_score_t"
|
||||
:ai-desc="customFigure?.sensory?.desc"
|
||||
@@ -78,11 +68,7 @@
|
||||
:ai-desc="customFigure?.movement?.desc"
|
||||
/>
|
||||
<!-- 体型-->
|
||||
<BodyType
|
||||
:body-type="collect?.somatotype"
|
||||
:gender="collect?.gender"
|
||||
/>
|
||||
|
||||
<BodyType :body-type="collect?.somatotype" :gender="collect?.gender" />
|
||||
</template>
|
||||
|
||||
<template v-if="true">
|
||||
@@ -99,7 +85,6 @@
|
||||
:gender="collect.sex"
|
||||
/>
|
||||
</template>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="activeTab === 1">
|
||||
@@ -115,20 +100,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<swiper class="swiper" @change="chageSwiper" :current="current">
|
||||
<swiper-item
|
||||
v-for="(item, index) in newColorTypeList"
|
||||
:key="index"
|
||||
>
|
||||
<swiper-item v-for="(item, index) in newColorTypeList" :key="index">
|
||||
<view class="swiper-item">
|
||||
<view class="img-box">
|
||||
<view
|
||||
style="
|
||||
width: 235px;
|
||||
height: 235px;
|
||||
position: absolute;
|
||||
z-index: 99;
|
||||
"
|
||||
>
|
||||
<view style="width: 235px; height: 235px; position: absolute; z-index: 99">
|
||||
<img
|
||||
style="width: 235px; height: 235px"
|
||||
:src="item.avatarFrameImgUrl"
|
||||
@@ -137,11 +112,7 @@
|
||||
/>
|
||||
</view>
|
||||
<view class="avatar">
|
||||
<img
|
||||
:src="userFaceInfo?.avatar_img_url"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
<img :src="collect?.avatar_img_url" alt="" srcset="" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -153,9 +124,7 @@
|
||||
<view class="swiper-type-name-en">{{ colorTypeInfo.enName }}</view>
|
||||
<view class="swiper-type-text">
|
||||
{{
|
||||
colorTypeInfo.typeName + "型" === userFaceInfo.sj_color_type
|
||||
? "最佳颜色"
|
||||
: "不匹配"
|
||||
colorTypeInfo.typeName + '型' === collect.sj_color_type ? '最佳颜色' : '不匹配'
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
@@ -200,41 +169,22 @@
|
||||
|
||||
<!-- 搭配趋势 -->
|
||||
<CustomSwiper :items="items" />
|
||||
<view class="padding-top20"
|
||||
>{{ colorTypeInfo.typeName }}人穿衣搭配全方案</view
|
||||
>
|
||||
<view class="padding-top20">{{ colorTypeInfo.typeName }}人穿衣搭配全方案</view>
|
||||
<view class="padding-top20">
|
||||
<rich-text :nodes="colorTypeText.scheme"></rich-text>
|
||||
</view>
|
||||
<view v-if="userFaceInfo?.gender === '女'" style="padding: 0 20px">
|
||||
<!-- <view class="reference-title">
|
||||
<img
|
||||
src="https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/reference.png"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
</view> -->
|
||||
|
||||
<view v-if="collect?.gender === '女'" style="padding: 0 20px">
|
||||
|
||||
<view class="reference-img-box">
|
||||
<img
|
||||
class="reference-img1"
|
||||
:src="colorTypeInfo.useReferenceImgUrl"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
<!-- <img
|
||||
class="reference-img2"
|
||||
src="https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/test2.png"
|
||||
alt=""
|
||||
srcset=""
|
||||
/> -->
|
||||
</view>
|
||||
</view>
|
||||
<view style="padding-left: 20px">
|
||||
注:人工智能大模型在计算中可能存在0.5%的误差。
|
||||
</view>
|
||||
<view class="reference-complate">
|
||||
------ 色彩类型报告完 ------
|
||||
</view>
|
||||
<view style="padding-left: 20px"> 注:人工智能大模型在计算中可能存在0.5%的误差。 </view>
|
||||
<view class="reference-complate"> ------ 色彩类型报告完 ------ </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -247,12 +197,7 @@
|
||||
v-for="(item, index) in avatarList"
|
||||
:key="index"
|
||||
>
|
||||
<img
|
||||
:src="item.url"
|
||||
alt=""
|
||||
srcset=""
|
||||
@click="previewImage(item.url)"
|
||||
/>
|
||||
<img :src="item.url" alt="" srcset="" @click="previewImage(item.url)" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="rich-text-content">
|
||||
@@ -263,23 +208,11 @@
|
||||
height: userFaceInfo?.gender === '男' ? '150px' : '328px',
|
||||
}"
|
||||
>
|
||||
<img
|
||||
style="object-fit: cover"
|
||||
:src="faceImgUrl"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
<img style="object-fit: cover" :src="faceImgUrl" alt="" srcset="" />
|
||||
</view>
|
||||
<rich-text :nodes="praiseTextList[1]"></rich-text>
|
||||
<view class="more-hairstyle">
|
||||
<view
|
||||
class=""
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 16px;
|
||||
"
|
||||
>
|
||||
<view class="" style="display: flex; justify-content: center; margin-bottom: 16px">
|
||||
<view>更多发型一键试戴</view>
|
||||
</view>
|
||||
<view class="scroll-box">
|
||||
@@ -290,23 +223,13 @@
|
||||
:key="index"
|
||||
style="height: 103px; margin-right: 8px"
|
||||
>
|
||||
<img
|
||||
style="width: 76px; height: 100%"
|
||||
:src="item.fileUrl"
|
||||
alt=""
|
||||
srcset=""
|
||||
/>
|
||||
<img style="width: 76px; height: 100%" :src="item.fileUrl" alt="" srcset="" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<rich-text :nodes="praiseTextList[2]"></rich-text>
|
||||
<view style="margin-top: 56px">
|
||||
注:人工智能大模型在计算中可能存在0.5%的误差。
|
||||
</view>
|
||||
<view
|
||||
class="reference-complate"
|
||||
style="margin-bottom: 0; margin-top: 10px"
|
||||
>
|
||||
<view style="margin-top: 56px"> 注:人工智能大模型在计算中可能存在0.5%的误差。 </view>
|
||||
<view class="reference-complate" style="margin-bottom: 0; margin-top: 10px">
|
||||
------ 发型报告完 ------
|
||||
</view>
|
||||
</view>
|
||||
@@ -326,7 +249,7 @@
|
||||
@click="
|
||||
previewImage(
|
||||
`https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/chineseZodiac/` +
|
||||
shegnxiaoImgUrl
|
||||
shegnxiaoImgUrl,
|
||||
)
|
||||
"
|
||||
/>
|
||||
@@ -335,43 +258,25 @@
|
||||
<view class="five-attribute-box">
|
||||
<view
|
||||
class="numblock"
|
||||
style="
|
||||
background-color: rgba(193, 156, 45, 1);
|
||||
top: 286px;
|
||||
left: 40px;
|
||||
"
|
||||
style="background-color: rgba(193, 156, 45, 1); top: 286px; left: 40px"
|
||||
>{{ numToChinese(shengxiaoNumList[0]) }}</view
|
||||
>
|
||||
<view
|
||||
class="numblock"
|
||||
style="
|
||||
background-color: rgba(62, 166, 123, 1);
|
||||
top: 32px;
|
||||
left: 119px;
|
||||
"
|
||||
style="background-color: rgba(62, 166, 123, 1); top: 32px; left: 119px"
|
||||
>{{ numToChinese(shengxiaoNumList[1]) }}</view
|
||||
>
|
||||
<view class="numblock" style="background-color: rgba(61, 146, 168, 1); top: 136px">{{
|
||||
numToChinese(shengxiaoNumList[2])
|
||||
}}</view>
|
||||
<view
|
||||
class="numblock"
|
||||
style="background-color: rgba(61, 146, 168, 1); top: 136px"
|
||||
>{{ numToChinese(shengxiaoNumList[2]) }}</view
|
||||
>
|
||||
<view
|
||||
class="numblock"
|
||||
style="
|
||||
background-color: rgba(195, 52, 55, 1);
|
||||
top: 150px;
|
||||
right: 10px;
|
||||
"
|
||||
style="background-color: rgba(195, 52, 55, 1); top: 150px; right: 10px"
|
||||
>{{ numToChinese(shengxiaoNumList[3]) }}</view
|
||||
>
|
||||
<view
|
||||
class="numblock"
|
||||
style="
|
||||
background-color: rgba(253, 231, 73, 1);
|
||||
top: 293px;
|
||||
right: 70px;
|
||||
"
|
||||
style="background-color: rgba(253, 231, 73, 1); top: 293px; right: 70px"
|
||||
>{{ numToChinese(shengxiaoNumList[4]) }}</view
|
||||
>
|
||||
<view class="five-attribute">
|
||||
@@ -389,9 +294,7 @@
|
||||
</view>
|
||||
|
||||
<rich-text :nodes="luckyTxtList[1]"></rich-text>
|
||||
<view style="margin-top: 56px">
|
||||
注:人工智能大模型在计算中可能存在0.5%的误差。
|
||||
</view>
|
||||
<view style="margin-top: 56px"> 注:人工智能大模型在计算中可能存在0.5%的误差。 </view>
|
||||
<view class="reference-complate" style="margin-bottom: 0">
|
||||
------ 幸运色分析完 ------
|
||||
</view>
|
||||
@@ -414,37 +317,38 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, onUnmounted, watchEffect } from "vue";
|
||||
import Header from "./component/Header/index.vue";
|
||||
import Tabs from "./component/Tabs/index.vue";
|
||||
import {
|
||||
fashionNeutrals,
|
||||
colorTypeList,
|
||||
faceList,
|
||||
shengxiaoImgList,
|
||||
} from "./database";
|
||||
import { ref, onMounted, onUnmounted, watchEffect } from 'vue';
|
||||
import Header from './component/Header/index.vue';
|
||||
import Tabs from './component/Tabs/index.vue';
|
||||
import { fashionNeutrals, colorTypeList, faceList, shengxiaoImgList } from './database';
|
||||
import {
|
||||
uploadFormData,
|
||||
downloadFile,
|
||||
numToChinese,
|
||||
getMaxElement,
|
||||
reorderByValue,
|
||||
} from "../../utils/index";
|
||||
import GeneticStyle from "./component/FirstStyleType/geneticStyle.vue";
|
||||
import SkinColor from "./component/FirstStyleType/SkinColor.vue";
|
||||
import BottomPic from "./component/FirstStyleType/BottomPic.vue";
|
||||
import StyleDiagnosticReport from "./component/FirstStyleType/StyleDiagnosticReport.vue";
|
||||
import BodyType from "./component/FirstStyleType/BodyType.vue";
|
||||
import FacialColorLatitude from "./component/FirstStyleType/FacialColorLatitude.vue";
|
||||
import CustomSwiper from "./component/CustomSwiper/CustomSwiper";
|
||||
import SensoryTypes from "./component/FirstStyleType/SensoryTypes.vue";
|
||||
import TypeOfMass from "./component/FirstStyleType/TypeOfMass.vue";
|
||||
import Movementtype from "./component/FirstStyleType/Movementtype.vue";
|
||||
import ReportApi from "../../sheep/api/report";
|
||||
} from '../../utils/index';
|
||||
import GeneticStyle from './component/FirstStyleType/geneticStyle.vue';
|
||||
import SkinColor from './component/FirstStyleType/SkinColor.vue';
|
||||
import BottomPic from './component/FirstStyleType/BottomPic.vue';
|
||||
import StyleDiagnosticReport from './component/FirstStyleType/StyleDiagnosticReport.vue';
|
||||
import BodyType from './component/FirstStyleType/BodyType.vue';
|
||||
import FacialColorLatitude from './component/FirstStyleType/FacialColorLatitude.vue';
|
||||
import CustomSwiper from './component/CustomSwiper/CustomSwiper';
|
||||
import SensoryTypes from './component/FirstStyleType/SensoryTypes.vue';
|
||||
import TypeOfMass from './component/FirstStyleType/TypeOfMass.vue';
|
||||
import Movementtype from './component/FirstStyleType/Movementtype.vue';
|
||||
import ReportApi from '../../sheep/api/report';
|
||||
|
||||
import { onLoad } from '@dcloudio/uni-app';
|
||||
import {hairText, shengxiaoText, shengxiaoSystem_prompt, statureText, styleText} from '@/constant/aiText'
|
||||
import { praiseTextApi } from '@/sheep/api/doubao'
|
||||
import {
|
||||
hairText,
|
||||
shengxiaoText,
|
||||
shengxiaoSystem_prompt,
|
||||
statureText,
|
||||
styleText,
|
||||
} from '@/constant/aiText';
|
||||
import { praiseTextApi } from '@/sheep/api/doubao';
|
||||
|
||||
const {
|
||||
// praiseTextApi,
|
||||
@@ -455,42 +359,40 @@ const {
|
||||
addHairApi,
|
||||
getHairApi,
|
||||
getAiFaceResult,
|
||||
getUserInfo
|
||||
getUserInfo,
|
||||
getUserAvatar,
|
||||
} = ReportApi;
|
||||
|
||||
|
||||
const collect = ref(null)
|
||||
|
||||
const collect = ref(null);
|
||||
|
||||
onLoad((options) => {
|
||||
uni.setStorageSync('token', options?.token ?? '92d2805a85ca422e90dd7d50eef49a85');
|
||||
console.log('🚀 ~ URL上的token ~ options?.token: ', options?.token);
|
||||
|
||||
Promise.all([getUserInfo(), getAiFaceResult()]).then(result => {
|
||||
const [res1, res2] = result
|
||||
|
||||
const {data} = JSON.parse(res2.result[0].thridResp)
|
||||
|
||||
const target = Object.assign({}, JSON.parse(res1.data.dataJson), data.face_figure)
|
||||
|
||||
target.gender = target.sex
|
||||
collect.value = target
|
||||
|
||||
console.log('collect.value: ', collect.value);
|
||||
})
|
||||
Promise.all([getUserInfo(), getAiFaceResult(), getUserAvatar()]).then((result) => {
|
||||
const [res1, res2, res3] = result;
|
||||
console.log('res3: zzzzzzzzzzzzz', res3.data);
|
||||
|
||||
const { data } = JSON.parse(res2.result[0].thridResp);
|
||||
|
||||
const target = Object.assign({}, JSON.parse(res1.data.dataJson), data.face_figure, {
|
||||
avatar_img_url: res3.data.avatar,
|
||||
});
|
||||
|
||||
target.gender = target.sex;
|
||||
collect.value = target;
|
||||
|
||||
console.log('collect.value: ', collect.value);
|
||||
});
|
||||
});
|
||||
|
||||
// if (
|
||||
// typeof window !== "undefined" &&
|
||||
// /MicroMessenger/i.test(navigator.userAgent)
|
||||
// ) {
|
||||
const pngImgUrl = ref("https://llshop.zglvling.com/shop/img/png/h5/");
|
||||
const pngImgUrl = ref('https://llshop.zglvling.com/shop/img/png/h5/');
|
||||
const showPreview = ref(false);
|
||||
const currentPreviewImage = ref("");
|
||||
const currentPreviewImage = ref('');
|
||||
let hairStyleList = ref([]);
|
||||
const previewImage = (imageUrl) => {
|
||||
currentPreviewImage.value = imageUrl;
|
||||
@@ -501,46 +403,43 @@ const closePreview = (e) => {
|
||||
// 阻止事件冒泡
|
||||
e.stopPropagation();
|
||||
showPreview.value = false;
|
||||
currentPreviewImage.value = "";
|
||||
currentPreviewImage.value = '';
|
||||
};
|
||||
|
||||
const gifAddress = "https://llshop.zglvling.com/shop/img/gif/";
|
||||
const gifAddress = 'https://llshop.zglvling.com/shop/img/gif/';
|
||||
const routes = new URLSearchParams(window.location.search);
|
||||
const classFixed = ref("");
|
||||
const openId = routes.get("openId");
|
||||
const enterType = routes.get("enterType"); // 1: 个人诊断报告 2: 发型试戴
|
||||
const classFixed = ref('');
|
||||
const openId = routes.get('openId');
|
||||
const enterType = routes.get('enterType'); // 1: 个人诊断报告 2: 发型试戴
|
||||
// const occupation = routes.get("occupation"); // 职业
|
||||
// const forWhom = routes.get("forWhom");
|
||||
|
||||
let scrollHeight = ref(0);
|
||||
const activeTab = ref(0);
|
||||
|
||||
|
||||
const tabsList = ref([
|
||||
{ name: "风格类型", icon: "icon-style" },
|
||||
{ name: "色彩类型", icon: "icon-color" },
|
||||
{ name: "发型发色", icon: "icon-body" },
|
||||
{ name: "幸运色", icon: "icon-face" },
|
||||
{ name: '风格类型', icon: 'icon-style' },
|
||||
{ name: '色彩类型', icon: 'icon-color' },
|
||||
{ name: '发型发色', icon: 'icon-body' },
|
||||
{ name: '幸运色', icon: 'icon-face' },
|
||||
]);
|
||||
const newColorTypeList = ref([]);
|
||||
let shegnxiaoImgUrl = ref("wuxingLoading.png");
|
||||
let shegnxiaoImgUrl = ref('wuxingLoading.png');
|
||||
let colorTypeInfo = ref([]);
|
||||
const colorTypeText = ref({});
|
||||
let current = ref(0);
|
||||
const praiseTextList = ref([]);
|
||||
const userFaceInfo = ref({ avatar_img_url: "" });
|
||||
const faceImgUrl = ref("");
|
||||
const userFaceInfo = ref({ avatar_img_url: '' });
|
||||
const faceImgUrl = ref('');
|
||||
const shengxiao = ref();
|
||||
const chageSwiper = (e) => {
|
||||
current.value = e.detail.current;
|
||||
colorTypeInfo.value = newColorTypeList.value[current.value];
|
||||
};
|
||||
|
||||
|
||||
const clothesList = ref([]);
|
||||
const styleType = ref({});
|
||||
|
||||
|
||||
const chageSwiperBtn = (x) => {
|
||||
if (x === -1 && current.value !== 0) {
|
||||
current.value--;
|
||||
@@ -554,81 +453,81 @@ const hairIds = ref([]);
|
||||
const avatarList = ref([
|
||||
{
|
||||
id: 1,
|
||||
url: "https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png",
|
||||
url: 'https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
url: "https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png",
|
||||
url: 'https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
url: "https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png",
|
||||
url: 'https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png',
|
||||
},
|
||||
]);
|
||||
let luckyTxtList = ref([]);
|
||||
const shengxiaoNumList = ref([1, 2, 3, 4, 5]);
|
||||
const formatText = (text) => {
|
||||
text = text.replace(/[\u0000-\u001F]/g, (c) => {
|
||||
if (c === "\n") return "\\n";
|
||||
if (c === "\r") return "\\r";
|
||||
if (c === "\t") return "\\t";
|
||||
return "";
|
||||
if (c === '\n') return '\\n';
|
||||
if (c === '\r') return '\\r';
|
||||
if (c === '\t') return '\\t';
|
||||
return '';
|
||||
});
|
||||
return text;
|
||||
};
|
||||
const formatPraiseText = (text) => {
|
||||
text = formatText(text);
|
||||
text = JSON.parse(text).choices[0].message.content;
|
||||
text = text.replace(/<\/?strong>/g, "");
|
||||
text = text.replace(/<\/?strong>/g, '');
|
||||
|
||||
text = text.replace(/<h1>/g, "<div>").replace(/<\/h1>/g, "</div>");
|
||||
text = text.replace(/<h1>/g, '<div>').replace(/<\/h1>/g, '</div>');
|
||||
|
||||
text = text.replace(/<h2>/g, "<div>").replace(/<\/h2>/g, "</div>");
|
||||
text = text.replace(/<h2>/g, '<div>').replace(/<\/h2>/g, '</div>');
|
||||
|
||||
text = text.replace(/<h3>/g, "<div>").replace(/<\/h3>/g, "</div>");
|
||||
text = text.replace(/<h3>/g, '<div>').replace(/<\/h3>/g, '</div>');
|
||||
let list = [];
|
||||
const split1 = text.split("二、核心风格基因解析");
|
||||
const split1 = text.split('二、核心风格基因解析');
|
||||
list.push(split1[0]);
|
||||
split1[1] = "<p>二、核心风格基因解析</p>" + split1[1];
|
||||
const split2 = split1[1].split("五、关键细节设计:刘海与发色");
|
||||
split2[1] = "<p>五、关键细节设计:刘海与发色</p>" + split2[1];
|
||||
split1[1] = '<p>二、核心风格基因解析</p>' + split1[1];
|
||||
const split2 = split1[1].split('五、关键细节设计:刘海与发色');
|
||||
split2[1] = '<p>五、关键细节设计:刘海与发色</p>' + split2[1];
|
||||
list = list.concat(split2);
|
||||
return list;
|
||||
};
|
||||
const formatShengXiao = (text) => {
|
||||
text = formatText(text);
|
||||
// text = JSON.parse(text).choices[0].message.content;
|
||||
text = text.replace(/<h1>/g, "<div>").replace(/<\/h1>/g, "</div>");
|
||||
text = text.replace(/<h1>/g, '<div>').replace(/<\/h1>/g, '</div>');
|
||||
|
||||
text = text.replace(/<h2>/g, "<div>").replace(/<\/h2>/g, "</div>");
|
||||
text = text.replace(/<h2>/g, '<div>').replace(/<\/h2>/g, '</div>');
|
||||
|
||||
text = text.replace(/<h3>/g, "<div>").replace(/<\/h3>/g, "</div>");
|
||||
text = text.replace(/<h3>/g, '<div>').replace(/<\/h3>/g, '</div>');
|
||||
let list = [];
|
||||
const split1 = text.split("二、五行命理与易学幸运色推导");
|
||||
const split1 = text.split('二、五行命理与易学幸运色推导');
|
||||
list.push(split1[0]);
|
||||
split1[1] = "<p>二、五行命理与易学幸运色推导</p>" + split1[1];
|
||||
split1[1] = '<p>二、五行命理与易学幸运色推导</p>' + split1[1];
|
||||
list.push(split1[1]);
|
||||
return list;
|
||||
};
|
||||
|
||||
const customFigure = ref(null);
|
||||
|
||||
const customerStyle = ref("");
|
||||
const customerStyle = ref('');
|
||||
|
||||
const getPraiseText = (callWord, type) => {
|
||||
let params = {
|
||||
// model: "doubao-seed-1-6-250615",
|
||||
model: "doubao-seed-1-6-flash-250715",
|
||||
model: 'doubao-seed-1-6-flash-250715',
|
||||
openId: openId,
|
||||
text: "",
|
||||
text: '',
|
||||
type: enterType,
|
||||
tabType: "",
|
||||
tabType: '',
|
||||
};
|
||||
if (type === 1) {
|
||||
// params.model = "doubao-1-5-thinking-vision-pro-250428";
|
||||
// params.model = "doubao-seed-1-6-250615";
|
||||
// params.model = "doubao-seed-1-6-flash-250715";
|
||||
params.model = "doubao-1-5-thinking-pro-m-250428";
|
||||
params.model = 'doubao-1-5-thinking-pro-m-250428';
|
||||
}
|
||||
|
||||
let customKey = `客户特征:
|
||||
@@ -686,42 +585,49 @@ const getPraiseText = (callWord, type) => {
|
||||
|
||||
`;
|
||||
|
||||
if (callWord === "one") {
|
||||
params.tabType = "hair";
|
||||
params.text = hairText(customKey)
|
||||
if (callWord === 'one') {
|
||||
params.tabType = 'hair';
|
||||
params.text = hairText(customKey);
|
||||
}
|
||||
|
||||
if (callWord === "three") {
|
||||
params.tabType = "shengxiao";
|
||||
params.text = shengxiaoText(collect?.value?.birthday, collect?.value?.gender, collect?.value?.work)
|
||||
if (callWord === 'three') {
|
||||
params.tabType = 'shengxiao';
|
||||
params.text = shengxiaoText(
|
||||
collect?.value?.birthday,
|
||||
collect?.value?.gender,
|
||||
collect?.value?.work,
|
||||
);
|
||||
|
||||
params.system_prompt = shengxiaoSystem_prompt
|
||||
params.system_prompt = shengxiaoSystem_prompt;
|
||||
}
|
||||
|
||||
if (callWord === "four") {
|
||||
params.tabType = "stature";
|
||||
params.text = statureText(customKey, collect.value?.straight_total_score_t, collect.value?.total_sense_of_quantity_t, collect.value.dynamic_static_t)
|
||||
if (callWord === 'four') {
|
||||
params.tabType = 'stature';
|
||||
params.text = statureText(
|
||||
customKey,
|
||||
collect.value?.straight_total_score_t,
|
||||
collect.value?.total_sense_of_quantity_t,
|
||||
collect.value.dynamic_static_t,
|
||||
);
|
||||
}
|
||||
|
||||
if (callWord === "five") {
|
||||
params.tabType = "style";
|
||||
if (callWord === 'five') {
|
||||
params.tabType = 'style';
|
||||
params.text = styleText(customKey);
|
||||
}
|
||||
|
||||
|
||||
praiseTextApi(params).then((res) => {
|
||||
console.log('res: vvvvvvvvvvvvvvvvvvvv', res);
|
||||
// tabType
|
||||
if (callWord === "one") {
|
||||
if (callWord === 'one') {
|
||||
// console.log("数据是什么1", res.data);
|
||||
praiseTextList.value = formatPraiseText(res.data);
|
||||
} else if (callWord === "two") {
|
||||
} else if (callWord === 'two') {
|
||||
return;
|
||||
luckyTxtList.value = formatShengXiao(res.data);
|
||||
} else if (callWord === "three") {
|
||||
} else if (callWord === 'three') {
|
||||
let obj = JSON.parse(res.data);
|
||||
|
||||
|
||||
let shengxiaoContent = JSON.parse(obj.choices[0].message.content).content;
|
||||
luckyTxtList.value = formatShengXiao(shengxiaoContent.text);
|
||||
// console.log(shengxiaoContent, "shengxiaoContent");
|
||||
@@ -741,14 +647,14 @@ const getPraiseText = (callWord, type) => {
|
||||
shegnxiaoImgUrl.value = shengxiaoImgList[i].imgUrl;
|
||||
}
|
||||
}
|
||||
} else if (callWord === "four") {
|
||||
} else if (callWord === 'four') {
|
||||
const obj = JSON.parse(res.data);
|
||||
console.log("obj: ccccccccccccccccccccccccccccc", obj);
|
||||
console.log('obj: ccccccccccccccccccccccccccccc', obj);
|
||||
const content = obj.choices[0].message.content;
|
||||
customFigure.value = JSON.parse(content);
|
||||
|
||||
console.log('customFigure.value: mmmmmmmmmmmmmmmmm', customFigure.value);
|
||||
} else if (callWord === "five") {
|
||||
} else if (callWord === 'five') {
|
||||
const obj = JSON.parse(res.data);
|
||||
const content = obj.choices[0].message.content;
|
||||
|
||||
@@ -783,19 +689,16 @@ const getPraiseText = (callWord, type) => {
|
||||
|
||||
const getHairstyleList = () => {
|
||||
hairStyleListApi({
|
||||
phone: "17600222111",
|
||||
isPerson: "yes",
|
||||
phone: '17600222111',
|
||||
isPerson: 'yes',
|
||||
}).then((res) => {
|
||||
hairStyleList.value = res.result;
|
||||
// console.log(res, "发型列表 -----------------");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
getHairstyleList();
|
||||
|
||||
|
||||
const pollExchangeHairHistory = (requestId, maxTries = 30, interval = 2000) => {
|
||||
let tries = 0;
|
||||
const poll = (resolve, reject) => {
|
||||
@@ -804,15 +707,15 @@ const pollExchangeHairHistory = (requestId, maxTries = 30, interval = 2000) => {
|
||||
// console.log("轮询结果", ress);
|
||||
if (
|
||||
ress.result[0].url !==
|
||||
"https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png" &&
|
||||
'https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png' &&
|
||||
ress.result[1].url !==
|
||||
"https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png" &&
|
||||
'https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png' &&
|
||||
ress.result[2].url !==
|
||||
"https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png"
|
||||
'https://cdn.meidaojia.com/aidigitalfield/digital_cloth/static/1720084773937.png'
|
||||
) {
|
||||
resolve(ress);
|
||||
} else if (tries >= maxTries) {
|
||||
reject(new Error("轮询超时"));
|
||||
reject(new Error('轮询超时'));
|
||||
} else {
|
||||
tries++;
|
||||
setTimeout(() => poll(resolve, reject), interval);
|
||||
@@ -826,9 +729,7 @@ const pollExchangeHairHistory = (requestId, maxTries = 30, interval = 2000) => {
|
||||
};
|
||||
|
||||
const getColorTypeText = (sj_color_type) => {
|
||||
const found = newColorTypeList.value.find(
|
||||
(item) => item.typeName + "型" === sj_color_type
|
||||
);
|
||||
const found = newColorTypeList.value.find((item) => item.typeName + '型' === sj_color_type);
|
||||
if (found) {
|
||||
colorTypeText.value = found;
|
||||
}
|
||||
@@ -848,22 +749,18 @@ const getHair = async (data) => {
|
||||
|
||||
const getUserFaceInfo = async () => {
|
||||
getStyleApi({ openId: openId }).then(async (res) => {
|
||||
newColorTypeList.value = reorderByValue(
|
||||
colorTypeList,
|
||||
res?.detail?.sj_color_type
|
||||
);
|
||||
newColorTypeList.value = reorderByValue(colorTypeList, res?.detail?.sj_color_type);
|
||||
|
||||
colorTypeInfo.value = newColorTypeList.value[0];
|
||||
|
||||
userFaceInfo.value = res.data || {};
|
||||
if (!userFaceInfo.value.avatar_img_url) {
|
||||
userFaceInfo.value.avatar_img_url =
|
||||
"https://llshop.zglvling.com/shop/img/jpg/avatar.jpg";
|
||||
userFaceInfo.value.avatar_img_url = 'https://llshop.zglvling.com/shop/img/jpg/avatar.jpg';
|
||||
}
|
||||
|
||||
if (userFaceInfo?.value?.gender === "男") {
|
||||
if (userFaceInfo?.value?.gender === '男') {
|
||||
faceImgUrl.value =
|
||||
"https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/menhairstyles.png";
|
||||
'https://llyz.oss-cn-beijing.aliyuncs.com/diagnostic-report-h5/menhairstyles.png';
|
||||
let hairInfo = faceList.find((item) => item.id === 8);
|
||||
hairIds.value = hairInfo?.hairStyleIdList;
|
||||
// for(let i =0)
|
||||
@@ -876,32 +773,26 @@ const getUserFaceInfo = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
getPraiseText('one');
|
||||
getPraiseText('three', 1);
|
||||
getPraiseText('four');
|
||||
getPraiseText('five');
|
||||
|
||||
getPraiseText("one");
|
||||
getPraiseText("three", 1);
|
||||
try {
|
||||
|
||||
getPraiseText("four");
|
||||
} catch (error) {
|
||||
console.error('error: ', error);
|
||||
}
|
||||
getPraiseText("five");
|
||||
|
||||
getColorTypeText(res?.detail?.sj_color_type || "");
|
||||
getColorTypeText(res?.detail?.sj_color_type || '');
|
||||
let blob = await downloadFile(userFaceInfo?.value?.avatar_img_url);
|
||||
let formData = new FormData();
|
||||
formData.append("phone", "17600222111");
|
||||
formData.append("isHr", "false");
|
||||
formData.append("sex", userFaceInfo?.value.gender);
|
||||
formData.append("hairIds", hairIds.value);
|
||||
formData.append('phone', '17600222111');
|
||||
formData.append('isHr', 'false');
|
||||
formData.append('sex', userFaceInfo?.value.gender);
|
||||
formData.append('hairIds', hairIds.value);
|
||||
// 如果有图片/文件需要上传
|
||||
if (blob) {
|
||||
formData.append("files", blob, "avatar.jpg");
|
||||
formData.append('files', blob, 'avatar.jpg');
|
||||
}
|
||||
|
||||
let taskInfo = await uploadFormData(formData);
|
||||
let ress = null;
|
||||
if (enterType === "weixin") {
|
||||
if (enterType === 'weixin') {
|
||||
ress = await getHair();
|
||||
} else {
|
||||
ress = await pollExchangeHairHistory(taskInfo.requestId);
|
||||
@@ -919,16 +810,16 @@ const toHairstyleRoom = (item) => {
|
||||
},
|
||||
fail(error) {
|
||||
// alert('错误', error)
|
||||
console.log("navigateTo error: ", error);
|
||||
console.log('navigateTo error: ', error);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
function getScrollHeight() {
|
||||
const tabsEl = document.getElementById("headerBox");
|
||||
const tabsEl = document.getElementById('headerBox');
|
||||
if (tabsEl) {
|
||||
const rect = tabsEl.getBoundingClientRect();
|
||||
console.log(rect.height, "rect.height");
|
||||
console.log(rect.height, 'rect.height');
|
||||
|
||||
scrollHeight.value = rect.height;
|
||||
}
|
||||
@@ -938,42 +829,40 @@ function onPageScroll(e) {
|
||||
let scrollTop = e && e.scrollTop !== undefined ? e.scrollTop : window.scrollY;
|
||||
if (scrollTop > scrollHeight.value) {
|
||||
//277是需要固定的地方到顶部的距离
|
||||
classFixed.value = "fixed";
|
||||
classFixed.value = 'fixed';
|
||||
} else {
|
||||
classFixed.value = "";
|
||||
classFixed.value = '';
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
getScrollHeight();
|
||||
window.addEventListener("scroll", onPageScroll);
|
||||
window.addEventListener('scroll', onPageScroll);
|
||||
});
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener("scroll", onPageScroll);
|
||||
window.removeEventListener('scroll', onPageScroll);
|
||||
});
|
||||
getStyleApi({ openId })
|
||||
.then((res) => {
|
||||
getStyleApi({ openId }).then((res) => {
|
||||
styleType.value = res.data;
|
||||
})
|
||||
});
|
||||
// .then(() => {
|
||||
// getUserFaceInfo();
|
||||
// });
|
||||
|
||||
watchEffect(() => {
|
||||
if (collect.value) {
|
||||
getUserFaceInfo()
|
||||
getUserFaceInfo();
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
function onTabChange(tabIndex) {
|
||||
// H5端滚动到id=tabs的位置
|
||||
if (
|
||||
typeof window !== "undefined" &&
|
||||
typeof window !== 'undefined' &&
|
||||
activeTab.value !== tabIndex &&
|
||||
!!window.scrollY &&
|
||||
window.scrollY > scrollHeight.value
|
||||
) {
|
||||
window.scrollTo({ top: scrollHeight.value, behavior: "smooth" });
|
||||
window.scrollTo({ top: scrollHeight.value, behavior: 'smooth' });
|
||||
}
|
||||
activeTab.value = tabIndex;
|
||||
}
|
||||
@@ -984,14 +873,14 @@ function onTabChange(tabIndex) {
|
||||
padding: 20px 20px 0;
|
||||
}
|
||||
.report-title {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
line-height: 28px !important;
|
||||
letter-spacing: 0px;
|
||||
}
|
||||
.report-title-en {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
line-height: 28px !important;
|
||||
@@ -1087,14 +976,14 @@ function onTabChange(tabIndex) {
|
||||
padding-top: 10px;
|
||||
}
|
||||
.swiper-type-name {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 28px !important;
|
||||
letter-spacing: 94%;
|
||||
}
|
||||
.swiper-type-name-en {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
line-height: 28px !important;
|
||||
@@ -1104,7 +993,7 @@ function onTabChange(tabIndex) {
|
||||
margin-top: 5px;
|
||||
}
|
||||
.swiper-type-text {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
line-height: 28px !important;
|
||||
@@ -1116,7 +1005,7 @@ function onTabChange(tabIndex) {
|
||||
}
|
||||
|
||||
.html-rich-text {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400 !important;
|
||||
font-size: 14px !important;
|
||||
line-height: 28px !important;
|
||||
@@ -1151,7 +1040,7 @@ function onTabChange(tabIndex) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
line-height: 28px !important;
|
||||
@@ -1269,7 +1158,7 @@ function onTabChange(tabIndex) {
|
||||
}
|
||||
.style-type {
|
||||
line-height: 28px !important;
|
||||
font-family: "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
color: #031c24;
|
||||
/* font-family: Molengo; */
|
||||
font-size: 14px;
|
||||
@@ -1280,7 +1169,7 @@ function onTabChange(tabIndex) {
|
||||
background-color: red; */
|
||||
}
|
||||
.trends-title {
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
margin-bottom: 16px;
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
@@ -1320,7 +1209,7 @@ function onTabChange(tabIndex) {
|
||||
height: 24px;
|
||||
background-color: black;
|
||||
margin-top: 28px;
|
||||
font-family: "PingFang SC", "Microsoft YaHei", "Arial", sans-serif !important;
|
||||
font-family: 'PingFang SC', 'Microsoft YaHei', 'Arial', sans-serif !important;
|
||||
font-weight: 400;
|
||||
font-style: Regular;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -75,6 +75,12 @@ const ReportApi = {
|
||||
method: 'get',
|
||||
}),
|
||||
|
||||
getUserAvatar: () =>
|
||||
request({
|
||||
url: '/member/user/get ',
|
||||
method: 'get',
|
||||
}),
|
||||
|
||||
// https://puton.huimeimeta.com/app-api/cloth/getFaceList
|
||||
};
|
||||
export default ReportApi;
|
||||
|
||||
Reference in New Issue
Block a user