1
0

DetailView.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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 = [{ text: "25岁年轻客户", value: "25岁年轻客户" }];
  13. // 5/10/20/30/40
  14. const roundsOptions = [
  15. { text: 5, value: 5 },
  16. { text: 10, value: 10 },
  17. { text: 15, value: 15 },
  18. { text: 20, value: 20 },
  19. { text: 30, value: 30 },
  20. { text: 40, value: 40 },
  21. ];
  22. // 1.固执己见,不愿妥协 2.精打细算,喜欢占小便宜 3.易怒暴躁,简单直接 4.不懂装懂,乱带节奏 5.理智谨慎,态度冷漠 6.无主见,不抵触,不决定
  23. const naturesOptions = [
  24. { text: "固执己见,不愿妥协", value: "固执己见,不愿妥协" },
  25. { text: "细心周到,考虑周全", value: "细心周到,考虑周全" },
  26. { text: "易怒暴躁,简单直接", value: "易怒暴躁,简单直接" },
  27. { text: "不懂装懂,乱带节奏", value: "不懂装懂,乱带节奏" },
  28. { text: "理智谨慎,态度冷漠", value: "理智谨慎,态度冷漠" },
  29. { text: "无主见,不抵触,不决定", value: "无主见,不抵触,不决定" },
  30. ];
  31. const handleSelectNature = (option) => {
  32. selectedNature.value = option.value;
  33. };
  34. const handleSelectRoles = (option) => {
  35. selectedRole.value = option.value;
  36. };
  37. const handleSelectRounds = (option) => {
  38. selectedRounds.value = option.value;
  39. };
  40. const handleExam = async () => {
  41. if (!selectedRole.value || !selectedNature.value || !selectedRounds.value) {
  42. showToast("请选择角色、性格和轮数");
  43. return;
  44. }
  45. const data = {
  46. tutoringRole: selectedRole.value,
  47. personality: selectedNature.value,
  48. round: selectedRounds.value,
  49. sceneType: "QIRONG_CUNKE",
  50. };
  51. try {
  52. const { body } = await fetchTaskCreate(data);
  53. router.push({
  54. name: "ChatTts",
  55. query: { taskId: body, round: selectedRounds.value },
  56. });
  57. } catch (error) {
  58. console.log(error);
  59. }
  60. };
  61. onMounted(() => {
  62. localStorage.removeItem("chatHistory");
  63. localStorage.removeItem("status");
  64. });
  65. </script>
  66. <template>
  67. <div class="detail">
  68. <nav-bar-page title="课程详情" />
  69. <div style="height: 46px"></div>
  70. <div class="content">
  71. <div class="banner">
  72. <img src="../assets/role3.jpg" alt="" />
  73. </div>
  74. <div class="produce">
  75. <p>电话销售</p>
  76. <div class="p_content">
  77. <span class="bg">背景:</span>
  78. <span>
  79. 老客户通过AI智能客服了解到,我们提供老客户复购车服务,模式为先核定额度再复购车,支持新车和二手车操作。此前,客户普遍认为购车需通过4S店或二手车商,贷款由车商指定的贷款公司或银行办理,对我们这边的复购车模式和流程优势了解较少。
  80. 客户已同意由客户经理后续对接,客户经理需通过电话沟通,了解客户购车意愿、购车周期、新车或二手车偏好、目标车型等信息。在沟通过程中,需解答客户疑问,介绍产品优势,建立基本信任,挖掘客户真实需求,并完成征信授权。
  81. </span>
  82. </div>
  83. </div>
  84. <div class="rules">
  85. <div class="title">
  86. <van-icon
  87. name="records-o"
  88. size="1.5rem"
  89. color="rgba(64,149,229,1)"
  90. style="font-weight: bold"
  91. />
  92. <span>规则</span>
  93. </div>
  94. <div class="r_content">
  95. <div class="r_item">
  96. <label for="roles">陪练角色</label>
  97. <selectPage
  98. :optionValue="roleOptions"
  99. placeholder="请选择角色"
  100. @update:selectedOption="handleSelectRoles"
  101. />
  102. </div>
  103. <div class="r_item">
  104. <label for="nature">陪练性格</label>
  105. <selectPage
  106. :optionValue="naturesOptions"
  107. placeholder="请选择性格"
  108. @update:selectedOption="handleSelectNature"
  109. />
  110. </div>
  111. <div class="r_item">
  112. <label for="rounds">交互轮次</label>
  113. <selectPage
  114. :optionValue="roundsOptions"
  115. placeholder="请选择轮次"
  116. @update:selectedOption="handleSelectRounds"
  117. />
  118. </div>
  119. </div>
  120. </div>
  121. <div class="bottom">
  122. <button class="exam" @click="handleExam">考试</button>
  123. <button>练习</button>
  124. </div>
  125. </div>
  126. </div>
  127. </template>
  128. <style scoped lang="less">
  129. .detail {
  130. width: 100%;
  131. height: 100%;
  132. // overflow: hidden;
  133. /* background-color: #f5f5f5; */
  134. .content {
  135. padding: 0 1.88rem;
  136. }
  137. .produce {
  138. margin-top: 1.63rem;
  139. p {
  140. color: rgba(16, 16, 16, 1);
  141. font-size: 1rem;
  142. font-family: Times New Roman-regular;
  143. }
  144. .p_content {
  145. width: 100%;
  146. height: 8rem;
  147. overflow: scroll;
  148. }
  149. span {
  150. line-height: 1.25rem;
  151. color: rgba(102, 102, 102, 1);
  152. font-size: 0.88rem;
  153. text-align: left;
  154. font-family: SourceHanSansSC-bold;
  155. }
  156. .bg {
  157. font-weight: 600;
  158. color: #000;
  159. }
  160. }
  161. .rules {
  162. margin: 2.38rem 0;
  163. width: 100%;
  164. height: 13.69rem;
  165. line-height: 1.25rem;
  166. border-radius: 0.75rem;
  167. background-color: rgba(255, 255, 255, 1);
  168. color: rgba(16, 16, 16, 1);
  169. font-size: 0.88rem;
  170. text-align: center;
  171. box-shadow: 0rem 0.06rem 0.88rem 0rem rgba(0, 1, 130, 0.08);
  172. font-family: -regular;
  173. .title {
  174. display: flex;
  175. align-items: center;
  176. padding: 1.03rem 0.88rem;
  177. }
  178. .title span {
  179. margin-left: 0.31rem;
  180. color: rgba(64, 149, 229, 1);
  181. font-size: 1rem;
  182. font-family: Times New Roman-regular;
  183. }
  184. .r_content {
  185. margin-top: 0.44rem;
  186. }
  187. .r_item {
  188. display: flex;
  189. // justify-content: space-between;
  190. align-items: center;
  191. padding: 0 1.75rem;
  192. margin-bottom: 0.75rem;
  193. font-size: 0.88rem;
  194. color: rgba(16, 16, 16, 1);
  195. }
  196. .r_item select {
  197. width: 11.56rem;
  198. height: 2rem;
  199. line-height: 1.25rem;
  200. border-radius: 0.38rem;
  201. font-family: PingFangSC-regular;
  202. border: 0.06rem solid rgba(187, 187, 187, 1);
  203. padding: 0 10px;
  204. -webkit-appearance: none;
  205. -moz-appearance: none;
  206. appearance: none;
  207. 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")
  208. no-repeat right 10px center;
  209. background-size: 1.5rem 1.5rem;
  210. /* 调整箭头的大小 */
  211. }
  212. .r_item label {
  213. // width: 3.5rem;
  214. // height: 1.25rem;
  215. // line-height: 1.25rem;
  216. // color: rgba(16,16,16,1);
  217. // font-size: 0.88rem;
  218. // text-align: left;
  219. font-family: PingFangSC-medium;
  220. margin-right: 1.1rem;
  221. }
  222. }
  223. .bottom {
  224. width: 100%;
  225. display: flex;
  226. justify-content: space-between;
  227. margin-bottom: 1.38rem;
  228. button {
  229. width: 10rem;
  230. height: 2.44rem;
  231. line-height: 1.25rem;
  232. border-radius: 0.38rem 0.38rem 0.38rem 0.38rem;
  233. background-color: rgba(243, 249, 255, 1);
  234. font-size: 0.88rem;
  235. text-align: center;
  236. font-family: -regular;
  237. border: 0.06rem solid rgba(163, 208, 253, 1);
  238. color: #1989fa;
  239. }
  240. .exam {
  241. color: #fff;
  242. background-color: rgba(64, 149, 229, 1);
  243. margin-right: 0.63rem;
  244. }
  245. }
  246. }
  247. .banner {
  248. height: 11.63rem;
  249. border-radius: 0.75rem;
  250. background-color: rgba(229, 229, 229, 1);
  251. overflow: hidden;
  252. }
  253. .banner img {
  254. width: 100%;
  255. height: 11.63rem;
  256. object-fit: cover;
  257. }
  258. </style>