DetailView.vue 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <script setup>
  2. import { ref, reactive, toRefs, onMounted } from "vue";
  3. import NavBarPage from "../components/NavBarPage.vue";
  4. import selectPage from "./result/selectPage.vue";
  5. import { fetchTaskCreate } from "./utils/api";
  6. import { showToast } from "vant";
  7. import { useRouter } from "vue-router";
  8. const router = useRouter();
  9. const selectedRole = ref("");
  10. const selectedNature = ref(null);
  11. const selectedRounds = ref(0);
  12. const roleOptions = [
  13. { text: "提前结清客户", value: "提前结清客户" },
  14. ];
  15. const roundsOptions = [
  16. { text: 10, value: 10 },
  17. { text: 15, value: 15},
  18. { text: 20, value: 20 },
  19. ];
  20. const naturesOptions = [
  21. { text: "固执己见,不愿妥协", value: "固执己见,不愿妥协" },
  22. { text: "细心周到,考虑周全", value: "细心周到,考虑周全" },
  23. { text: "易怒暴躁,难以沟通", value: "易怒暴躁,难以沟通" },
  24. { text: "幽默风趣,气氛活跃", value: "幽默风趣,气氛活跃" },
  25. { text: "自私冷漠,缺乏同理", value: "自私冷漠,缺乏同理" },
  26. ];
  27. const handleSelectNature = (option) => {
  28. selectedNature.value = option.value;
  29. };
  30. const handleSelectRoles = (option) => {
  31. selectedRole.value = option.value;
  32. };
  33. const handleSelectRounds = (option) => {
  34. selectedRounds.value = option.value;
  35. };
  36. const handleExam = async () => {
  37. if (!selectedRole.value || !selectedNature.value || !selectedRounds.value) {
  38. showToast("请选择角色、性格和轮数");
  39. return;
  40. }
  41. const data = {
  42. tutoringRole: selectedRole.value,
  43. personality: selectedNature.value,
  44. round: selectedRounds.value,
  45. sceneType:"QIRONG_JIEQING_1",
  46. };
  47. try {
  48. const { body } = await fetchTaskCreate(data);
  49. router.push({
  50. name: "ChatTts",
  51. query: { taskId: body, round: selectedRounds.value },
  52. });
  53. } catch (error) {
  54. console.log(error);
  55. }
  56. };
  57. onMounted(() => {
  58. localStorage.removeItem("chatHistory");
  59. localStorage.removeItem("status");
  60. });
  61. </script>
  62. <template>
  63. <div class="detail">
  64. <nav-bar-page title="课程详情" />
  65. <div style="height: 46px"></div>
  66. <div class="content">
  67. <div class="banner">
  68. <img src="../assets/role3.jpg" alt="" />
  69. </div>
  70. <div class="produce">
  71. <p>电话销售</p>
  72. <div class="p_content">
  73. <span class="bg">背景:</span>
  74. <span>
  75. 客户高登报,1971年出生,目前54岁。2024年10月起租我司二手车,起租金额14万,为期36个月。还款9个月后25年7月拨打客服电话申请提前结清
  76. 结清原因为办理其他业务。目前提前结清金额为121021.62元,全额打款金额为137362.73元,预期利益损失6535.05元,
  77. 违约金两段式。1-12期6%,13-36期5%,下一期租金5068.99元(本金3421元,利息1647.99元)
  78. 全额打款和提前结清目前相差16341.11元。租金减免测算最大可为其减免8500元
  79. </span>
  80. </div>
  81. </div>
  82. <div class="rules">
  83. <div class="title">
  84. <van-icon
  85. name="records-o"
  86. size="1.5rem"
  87. color="rgba(64,149,229,1)"
  88. style="font-weight: bold"
  89. />
  90. <span>规则</span>
  91. </div>
  92. <div class="r_content">
  93. <div class="r_item">
  94. <label for="roles">陪练角色</label>
  95. <selectPage
  96. :optionValue="roleOptions"
  97. placeholder="请选择角色"
  98. @update:selectedOption="handleSelectRoles"
  99. />
  100. </div>
  101. <div class="r_item">
  102. <label for="nature">陪练性格</label>
  103. <selectPage
  104. :optionValue="naturesOptions"
  105. placeholder="请选择性格"
  106. @update:selectedOption="handleSelectNature"
  107. />
  108. </div>
  109. <div class="r_item">
  110. <label for="rounds">交互轮次</label>
  111. <selectPage
  112. :optionValue="roundsOptions"
  113. placeholder="请选择轮次"
  114. @update:selectedOption="handleSelectRounds"
  115. />
  116. </div>
  117. </div>
  118. </div>
  119. <div class="bottom">
  120. <button class="exam" @click="handleExam">考试</button>
  121. <button>练习</button>
  122. </div>
  123. </div>
  124. </div>
  125. </template>
  126. <style scoped lang="less">
  127. .detail {
  128. width: 100%;
  129. height: 100%;
  130. // overflow: hidden;
  131. /* background-color: #f5f5f5; */
  132. .content {
  133. padding: 0 1.88rem;
  134. }
  135. .produce {
  136. margin-top: 1.63rem;
  137. p {
  138. color: rgba(16, 16, 16, 1);
  139. font-size: 1rem;
  140. font-family: Times New Roman-regular;
  141. }
  142. .p_content {
  143. width: 100%;
  144. height: 8rem;
  145. overflow: scroll;
  146. }
  147. span {
  148. line-height: 1.25rem;
  149. color: rgba(102, 102, 102, 1);
  150. font-size: 0.88rem;
  151. text-align: left;
  152. font-family: SourceHanSansSC-bold;
  153. }
  154. .bg {
  155. font-weight: 600;
  156. color: #000;
  157. }
  158. }
  159. .rules {
  160. margin: 2.38rem 0;
  161. width: 100%;
  162. height: 13.69rem;
  163. line-height: 1.25rem;
  164. border-radius: 0.75rem;
  165. background-color: rgba(255, 255, 255, 1);
  166. color: rgba(16, 16, 16, 1);
  167. font-size: 0.88rem;
  168. text-align: center;
  169. box-shadow: 0rem 0.06rem 0.88rem 0rem rgba(0, 1, 130, 0.08);
  170. font-family: -regular;
  171. .title {
  172. display: flex;
  173. align-items: center;
  174. padding: 1.03rem 0.88rem;
  175. }
  176. .title span {
  177. margin-left: 0.31rem;
  178. color: rgba(64, 149, 229, 1);
  179. font-size: 1rem;
  180. font-family: Times New Roman-regular;
  181. }
  182. .r_content {
  183. margin-top: 0.44rem;
  184. }
  185. .r_item {
  186. display: flex;
  187. // justify-content: space-between;
  188. align-items: center;
  189. padding: 0 1.75rem;
  190. margin-bottom: 0.75rem;
  191. font-size: 0.88rem;
  192. color: rgba(16, 16, 16, 1);
  193. }
  194. .r_item select {
  195. width: 11.56rem;
  196. height: 2rem;
  197. line-height: 1.25rem;
  198. border-radius: 0.38rem;
  199. font-family: PingFangSC-regular;
  200. border: 0.06rem solid rgba(187, 187, 187, 1);
  201. padding: 0 10px;
  202. -webkit-appearance: none;
  203. -moz-appearance: none;
  204. appearance: none;
  205. background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20fill%3D%22%23000%22%20fill-opacity%3D%22.9%22%20fill-rule%3D%22evenodd%22%20d%3D%22M17.35%209.65a.5.5%200%200%200-.7%200L12%2014.29%207.35%209.65a.5.5%200%201%200-.7.7l5%205c.2.2.5.2.7%200l5-5a.5.5%200%200%200%200-.7%22%20clip-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E")
  206. no-repeat right 10px center;
  207. background-size: 1.5rem 1.5rem;
  208. /* 调整箭头的大小 */
  209. }
  210. .r_item label {
  211. // width: 3.5rem;
  212. // height: 1.25rem;
  213. // line-height: 1.25rem;
  214. // color: rgba(16,16,16,1);
  215. // font-size: 0.88rem;
  216. // text-align: left;
  217. font-family: PingFangSC-medium;
  218. margin-right: 1.1rem;
  219. }
  220. }
  221. .bottom {
  222. width: 100%;
  223. display: flex;
  224. justify-content: space-between;
  225. margin-bottom: 1.38rem;
  226. button {
  227. width: 10rem;
  228. height: 2.44rem;
  229. line-height: 1.25rem;
  230. border-radius: 0.38rem 0.38rem 0.38rem 0.38rem;
  231. background-color: rgba(243, 249, 255, 1);
  232. font-size: 0.88rem;
  233. text-align: center;
  234. font-family: -regular;
  235. border: 0.06rem solid rgba(163, 208, 253, 1);
  236. color: #1989fa;
  237. }
  238. .exam {
  239. color: #fff;
  240. background-color: rgba(64, 149, 229, 1);
  241. margin-right: 0.63rem;
  242. }
  243. }
  244. }
  245. .banner {
  246. height: 11.63rem;
  247. border-radius: 0.75rem;
  248. background-color: rgba(229, 229, 229, 1);
  249. overflow: hidden;
  250. }
  251. .banner img {
  252. width: 100%;
  253. height: 11.63rem;
  254. object-fit: cover;
  255. }
  256. </style>