报告页逻辑
This commit is contained in:
@@ -3,6 +3,7 @@ import { defineProps, ref, watch } from "vue";
|
||||
import { styleJson } from "./json/style";
|
||||
const styleImage = ref("");
|
||||
const psychologicalStyleImage = ref("");
|
||||
|
||||
const props = defineProps({
|
||||
styleType: {
|
||||
type: String,
|
||||
@@ -19,6 +20,8 @@ const props = defineProps({
|
||||
default: "女",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
watch(
|
||||
() => props.styleType,
|
||||
(newVal) => {
|
||||
@@ -26,9 +29,12 @@ watch(
|
||||
},
|
||||
{ deep: true, immediate: true }
|
||||
);
|
||||
|
||||
|
||||
watch(
|
||||
() => props.psychologicalStyle,
|
||||
(newVal) => {
|
||||
console.log('newVal: sssssssssssssssssssss', newVal);
|
||||
psychologicalStyleImage.value = styleJson.find(
|
||||
(item) => item.type === newVal
|
||||
)?.pic;
|
||||
|
||||
@@ -25,10 +25,12 @@ const json = ref( [
|
||||
value: '静态型',
|
||||
}
|
||||
])
|
||||
|
||||
watch(
|
||||
() => props.type,
|
||||
(newVal) => {
|
||||
console.log('动静类型: props.type: ', newVal);
|
||||
console.log('动静类型: props.type: ', newVal, props.aiDesc);
|
||||
// console.log('props.aiDesc: ---------', props.aiDesc);
|
||||
json.value = json.value.map((item) => ({
|
||||
...item,
|
||||
checked: item.value == newVal,
|
||||
@@ -47,7 +49,7 @@ watch(
|
||||
<CheckBox :checked="item.checked">{{ item.value }}</CheckBox>
|
||||
</template>
|
||||
<view class="desc">
|
||||
{{ aiDesc }}
|
||||
{{ props.aiDesc }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
Reference in New Issue
Block a user