|
|
@@ -5,7 +5,6 @@ import selectPage from "./result/selectPage.vue";
|
|
|
import { fetchTaskCreate } from "./utils/api";
|
|
|
import { showToast } from "vant";
|
|
|
import { useRouter } from "vue-router";
|
|
|
-import { RollerSkatingRound } from "@vicons/material";
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
@@ -13,6 +12,9 @@ const selectedRole = ref("");
|
|
|
const selectedNature = ref(null);
|
|
|
const selectedRounds = ref(0);
|
|
|
|
|
|
+const sceneType = ref("")
|
|
|
+const naturesOptions = ref([]);
|
|
|
+
|
|
|
const rolelist = ref([]);
|
|
|
const roleOptions = JSON.parse(localStorage.getItem('role')).roleOption
|
|
|
|
|
|
@@ -22,13 +24,18 @@ const roundsOptions = [
|
|
|
{ text: 10, value: 10 },
|
|
|
];
|
|
|
|
|
|
-const naturesOptions = [
|
|
|
+const mappings = {
|
|
|
+ XIAOWEI: [
|
|
|
{ text: "固执己见,不愿妥协", value: "固执己见,不愿妥协" },
|
|
|
{ text: "细心周到,考虑周全", value: "细心周到,考虑周全" },
|
|
|
{ text: "易怒暴躁,难以沟通", value: "易怒暴躁,难以沟通" },
|
|
|
{ text: "幽默风趣,气氛活跃", value: "幽默风趣,气氛活跃" },
|
|
|
{ text: "自私冷漠,缺乏同理", value: "自私冷漠,缺乏同理" },
|
|
|
-];
|
|
|
+],
|
|
|
+XIAOWEI_RONGZI: [{ text: "谨慎理性", value: "谨慎理性" }],
|
|
|
+DEFAULT:[{ text: "无", value: "无" }]
|
|
|
+};
|
|
|
+
|
|
|
|
|
|
const handleSelectNature = (option) => {
|
|
|
selectedNature.value = option.value;
|
|
|
@@ -51,13 +58,13 @@ const handleExam = async () => {
|
|
|
tutoringRole: selectedRole.value,
|
|
|
personality: selectedNature.value,
|
|
|
round: selectedRounds.value,
|
|
|
- sceneType:"XIAOWEI",
|
|
|
+ sceneType:sceneType.value,
|
|
|
};
|
|
|
try {
|
|
|
const { body } = await fetchTaskCreate(data);
|
|
|
router.push({
|
|
|
name: "ChatTts",
|
|
|
- query: { taskId: body, round: selectedRounds.value },
|
|
|
+ query: { taskId: body, round: selectedRounds.value , sceneType:sceneType.value },
|
|
|
});
|
|
|
} catch (error) {
|
|
|
console.log(error);
|
|
|
@@ -66,6 +73,8 @@ const handleExam = async () => {
|
|
|
onMounted(() => {
|
|
|
const role = JSON.parse(localStorage.getItem('role'))
|
|
|
rolelist.value = role
|
|
|
+ sceneType.value = role.sceneType
|
|
|
+ naturesOptions.value = mappings[sceneType.value] || mappings.DEFAULT;
|
|
|
localStorage.removeItem("chatHistory");
|
|
|
localStorage.removeItem("status");
|
|
|
});
|