DetailView.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  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. { text: "销售顾问", value: "销售顾问" },
  15. ];
  16. const roundsOptions = [
  17. { text: 5, value: 5 },
  18. { text: 8, value: 8 },
  19. { text: 10, value: 10 },
  20. ];
  21. const naturesOptions = [
  22. { text: "固执己见,不愿妥协", value: "固执己见,不愿妥协" },
  23. { text: "细心周到,考虑周全", value: "细心周到,考虑周全" },
  24. { text: "易怒暴躁,难以沟通", value: "易怒暴躁,难以沟通" },
  25. { text: "幽默风趣,气氛活跃", value: "幽默风趣,气氛活跃" },
  26. { text: "自私冷漠,缺乏同理", value: "自私冷漠,缺乏同理" },
  27. ];
  28. const handleSelectNature = (option) => {
  29. selectedNature.value = option.value;
  30. };
  31. const handleSelectRoles = (option) => {
  32. selectedRole.value = option.value;
  33. };
  34. const handleSelectRounds = (option) => {
  35. selectedRounds.value = option.value;
  36. };
  37. const handleExam = async () => {
  38. if (!selectedRole.value || !selectedNature.value || !selectedRounds.value) {
  39. showToast("请选择角色、性格和轮数");
  40. return;
  41. }
  42. const data = {
  43. tutoringRole: selectedRole.value,
  44. personality: selectedNature.value,
  45. round: selectedRounds.value,
  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. });
  60. </script>
  61. <template>
  62. <div class="detail">
  63. <nav-bar-page title="课程详情" />
  64. <div style="height: 46px"></div>
  65. <div class="content">
  66. <div class="banner">
  67. <img src="../assets/role3.jpg" alt="" />
  68. </div>
  69. <div class="produce">
  70. <p>电话销售</p>
  71. <div class="p_content">
  72. <span class="bg">背景:</span>
  73. <span
  74. >由于人员变动,晨会上高级将一直没有入网的吉利直营店分配给你维护。
  75. 初次拜访时,店里的金融负责人吴经理不在,打听得知直营店向来只和银行合作,过不了的单子才会找外部金融消化。
  76. 店里主推低价格产品方案,为了提升市场竞争力,有的车型降价幅度非常大,大大减少了单车的利润。
  77. 虽然店里的单子有金融专员跟进客户处理,但金融订单都是吴经理负责分配,提报银行通过的订单,吴经理有额外的激励。
  78. 旺季来了,吴经理想要提升店端的利润,让销售出谋划策。
  79. 于是,你计划再次拜访吴经理。
  80. </span>
  81. </div>
  82. </div>
  83. <div class="rules">
  84. <div class="title">
  85. <van-icon
  86. name="records-o"
  87. size="1.5rem"
  88. color="rgba(64,149,229,1)"
  89. style="font-weight: bold"
  90. />
  91. <span>规则</span>
  92. </div>
  93. <div class="r_content">
  94. <div class="r_item">
  95. <label for="roles">陪练角色</label>
  96. <selectPage
  97. :optionValue="roleOptions"
  98. placeholder="请选择角色"
  99. @update:selectedOption="handleSelectRoles"
  100. />
  101. </div>
  102. <div class="r_item">
  103. <label for="nature">陪练性格</label>
  104. <selectPage
  105. :optionValue="naturesOptions"
  106. placeholder="请选择性格"
  107. @update:selectedOption="handleSelectNature"
  108. />
  109. </div>
  110. <div class="r_item">
  111. <label for="rounds">交互轮次</label>
  112. <selectPage
  113. :optionValue="roundsOptions"
  114. placeholder="请选择轮次"
  115. @update:selectedOption="handleSelectRounds"
  116. />
  117. </div>
  118. </div>
  119. </div>
  120. <div class="bottom">
  121. <button class="exam" @click="handleExam">考试</button>
  122. <button>练习</button>
  123. </div>
  124. </div>
  125. </div>
  126. </template>
  127. <style scoped lang="less">
  128. .detail {
  129. width: 100%;
  130. height: 100%;
  131. // overflow: hidden;
  132. /* background-color: #f5f5f5; */
  133. .content {
  134. padding: 0 1.88rem;
  135. }
  136. .produce {
  137. margin-top: 1.63rem;
  138. p {
  139. color: rgba(16, 16, 16, 1);
  140. font-size: 1rem;
  141. font-family: Times New Roman-regular;
  142. }
  143. .p_content {
  144. width: 100%;
  145. height: 8rem;
  146. overflow: scroll;
  147. }
  148. span {
  149. line-height: 1.25rem;
  150. color: rgba(102, 102, 102, 1);
  151. font-size: 0.88rem;
  152. text-align: left;
  153. font-family: SourceHanSansSC-bold;
  154. }
  155. .bg {
  156. font-weight: 600;
  157. color: #000;
  158. }
  159. }
  160. .rules {
  161. margin: 2.38rem 0;
  162. width: 100%;
  163. height: 13.69rem;
  164. line-height: 1.25rem;
  165. border-radius: 0.75rem;
  166. background-color: rgba(255, 255, 255, 1);
  167. color: rgba(16, 16, 16, 1);
  168. font-size: 0.88rem;
  169. text-align: center;
  170. box-shadow: 0rem 0.06rem 0.88rem 0rem rgba(0, 1, 130, 0.08);
  171. font-family: -regular;
  172. .title {
  173. display: flex;
  174. align-items: center;
  175. padding: 1.03rem 0.88rem;
  176. }
  177. .title span {
  178. margin-left: 0.31rem;
  179. color: rgba(64, 149, 229, 1);
  180. font-size: 1rem;
  181. font-family: Times New Roman-regular;
  182. }
  183. .r_content {
  184. margin-top: 0.44rem;
  185. }
  186. .r_item {
  187. display: flex;
  188. // justify-content: space-between;
  189. align-items: center;
  190. padding: 0 1.75rem;
  191. margin-bottom: 0.75rem;
  192. font-size: 0.88rem;
  193. color: rgba(16, 16, 16, 1);
  194. }
  195. .r_item select {
  196. width: 11.56rem;
  197. height: 2rem;
  198. line-height: 1.25rem;
  199. border-radius: 0.38rem;
  200. font-family: PingFangSC-regular;
  201. border: 0.06rem solid rgba(187, 187, 187, 1);
  202. padding: 0 10px;
  203. -webkit-appearance: none;
  204. -moz-appearance: none;
  205. appearance: none;
  206. 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")
  207. no-repeat right 10px center;
  208. background-size: 1.5rem 1.5rem;
  209. /* 调整箭头的大小 */
  210. }
  211. .r_item label {
  212. // width: 3.5rem;
  213. // height: 1.25rem;
  214. // line-height: 1.25rem;
  215. // color: rgba(16,16,16,1);
  216. // font-size: 0.88rem;
  217. // text-align: left;
  218. font-family: PingFangSC-medium;
  219. margin-right: 1.1rem;
  220. }
  221. }
  222. .bottom {
  223. width: 100%;
  224. display: flex;
  225. justify-content: space-between;
  226. margin-bottom: 1.38rem;
  227. button {
  228. width: 10rem;
  229. height: 2.44rem;
  230. line-height: 1.25rem;
  231. border-radius: 0.38rem 0.38rem 0.38rem 0.38rem;
  232. background-color: rgba(243, 249, 255, 1);
  233. font-size: 0.88rem;
  234. text-align: center;
  235. font-family: -regular;
  236. border: 0.06rem solid rgba(163, 208, 253, 1);
  237. color: #1989fa;
  238. }
  239. .exam {
  240. color: #fff;
  241. background-color: rgba(64, 149, 229, 1);
  242. margin-right: 0.63rem;
  243. }
  244. }
  245. }
  246. .banner {
  247. height: 11.63rem;
  248. border-radius: 0.75rem;
  249. background-color: rgba(229, 229, 229, 1);
  250. overflow: hidden;
  251. }
  252. .banner img {
  253. width: 100%;
  254. height: 11.63rem;
  255. object-fit: cover;
  256. }
  257. </style>