DetailView.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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: 3, value: 3 },
  17. { text: 5, value: 5},
  18. { text: 8, value: 8 },
  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:"HEI_MA",
  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. 客户通过<b>抖音直播</b>了解到我们是一家售卖新车的汽贸城车商,对我司直播间内的车价十分感兴趣,因此选择在直播间内留资。接下来需要在前期的电话中与客户沟通,解答客户疑问,建立基本信任并发掘客户真实的购车需求。
  76. </span>
  77. </div>
  78. </div>
  79. <div class="rules">
  80. <div class="title">
  81. <van-icon
  82. name="records-o"
  83. size="1.5rem"
  84. color="rgba(64,149,229,1)"
  85. style="font-weight: bold"
  86. />
  87. <span>规则</span>
  88. </div>
  89. <div class="r_content">
  90. <div class="r_item">
  91. <label for="roles">陪练角色</label>
  92. <selectPage
  93. :optionValue="roleOptions"
  94. placeholder="请选择角色"
  95. @update:selectedOption="handleSelectRoles"
  96. />
  97. </div>
  98. <div class="r_item">
  99. <label for="nature">陪练性格</label>
  100. <selectPage
  101. :optionValue="naturesOptions"
  102. placeholder="请选择性格"
  103. @update:selectedOption="handleSelectNature"
  104. />
  105. </div>
  106. <div class="r_item">
  107. <label for="rounds">交互轮次</label>
  108. <selectPage
  109. :optionValue="roundsOptions"
  110. placeholder="请选择轮次"
  111. @update:selectedOption="handleSelectRounds"
  112. />
  113. </div>
  114. </div>
  115. </div>
  116. <div class="bottom">
  117. <button class="exam" @click="handleExam">考试</button>
  118. <button>练习</button>
  119. </div>
  120. </div>
  121. </div>
  122. </template>
  123. <style scoped lang="less">
  124. .detail {
  125. width: 100%;
  126. height: 100%;
  127. // overflow: hidden;
  128. /* background-color: #f5f5f5; */
  129. .content {
  130. padding: 0 1.88rem;
  131. }
  132. .produce {
  133. margin-top: 1.63rem;
  134. p {
  135. color: rgba(16, 16, 16, 1);
  136. font-size: 1rem;
  137. font-family: Times New Roman-regular;
  138. }
  139. .p_content {
  140. width: 100%;
  141. height: 7rem;
  142. overflow: scroll;
  143. }
  144. span {
  145. line-height: 1.25rem;
  146. color: rgba(102, 102, 102, 1);
  147. font-size: 0.88rem;
  148. text-align: left;
  149. font-family: SourceHanSansSC-bold;
  150. }
  151. .bg {
  152. font-weight: 600;
  153. color: #000;
  154. }
  155. }
  156. .rules {
  157. margin: 2rem 0;
  158. width: 100%;
  159. height: 13.69rem;
  160. line-height: 1.25rem;
  161. border-radius: 0.75rem;
  162. background-color: rgba(255, 255, 255, 1);
  163. color: rgba(16, 16, 16, 1);
  164. font-size: 0.88rem;
  165. text-align: center;
  166. box-shadow: 0rem 0.06rem 0.88rem 0rem rgba(0, 1, 130, 0.08);
  167. font-family: -regular;
  168. .title {
  169. display: flex;
  170. align-items: center;
  171. padding: 1.03rem 0.88rem;
  172. }
  173. .title span {
  174. margin-left: 0.31rem;
  175. color: rgba(64, 149, 229, 1);
  176. font-size: 1rem;
  177. font-family: Times New Roman-regular;
  178. }
  179. .r_content {
  180. margin-top: 0.44rem;
  181. }
  182. .r_item {
  183. display: flex;
  184. // justify-content: space-between;
  185. align-items: center;
  186. padding: 0 1.75rem;
  187. margin-bottom: 0.75rem;
  188. font-size: 0.88rem;
  189. color: rgba(16, 16, 16, 1);
  190. }
  191. .r_item select {
  192. width: 11.56rem;
  193. height: 2rem;
  194. line-height: 1.25rem;
  195. border-radius: 0.38rem;
  196. font-family: PingFangSC-regular;
  197. border: 0.06rem solid rgba(187, 187, 187, 1);
  198. padding: 0 10px;
  199. -webkit-appearance: none;
  200. -moz-appearance: none;
  201. appearance: none;
  202. 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")
  203. no-repeat right 10px center;
  204. background-size: 1.5rem 1.5rem;
  205. /* 调整箭头的大小 */
  206. }
  207. .r_item label {
  208. // width: 3.5rem;
  209. // height: 1.25rem;
  210. // line-height: 1.25rem;
  211. // color: rgba(16,16,16,1);
  212. // font-size: 0.88rem;
  213. // text-align: left;
  214. font-family: PingFangSC-medium;
  215. margin-right: 1.1rem;
  216. }
  217. }
  218. .bottom {
  219. width: 100%;
  220. display: flex;
  221. justify-content: space-between;
  222. margin-bottom: 1.38rem;
  223. button {
  224. width: 10rem;
  225. height: 2.44rem;
  226. line-height: 1.25rem;
  227. border-radius: 0.38rem 0.38rem 0.38rem 0.38rem;
  228. background-color: rgba(243, 249, 255, 1);
  229. font-size: 0.88rem;
  230. text-align: center;
  231. font-family: -regular;
  232. border: 0.06rem solid rgba(163, 208, 253, 1);
  233. color: #1989fa;
  234. }
  235. .exam {
  236. color: #fff;
  237. background-color: rgba(64, 149, 229, 1);
  238. margin-right: 0.63rem;
  239. }
  240. }
  241. }
  242. .banner {
  243. height: 11.63rem;
  244. border-radius: 0.75rem;
  245. background-color: rgba(229, 229, 229, 1);
  246. overflow: hidden;
  247. }
  248. .banner img {
  249. width: 100%;
  250. height: 11.63rem;
  251. object-fit: cover;
  252. }
  253. </style>