index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. <template>
  2. <div class="pageya" ref="snb">
  3. <div class="navBarTOP">
  4. <van-nav-bar class="navBar" title="AI销售参谋" />
  5. </div>
  6. <div class="lineGrey"></div>
  7. <div class="lineGrey"></div>
  8. <div class="lineGrey"></div>
  9. <div class="lineGrey"></div>
  10. <div class="lineGrey"></div>
  11. <van-pull-refresh
  12. v-model="loading"
  13. :success-text="successText"
  14. @refresh="onLoad"
  15. :immediate-check="false">
  16. <div id="snb" ref="snb1">
  17. <div style="font-size: 14px" v-for="(item, index) in Ggreet" :key="index">
  18. <div style="margin: 14px" v-if="item.chatRecordFrom == 'ai' || item.chatRecordFrom == 2">
  19. <van-row>
  20. <van-col span="4" @click="clears"
  21. ><van-image
  22. :src="aiselect"
  23. style="
  24. float: right;
  25. background-color: #fff;
  26. border-radius: 6px;
  27. width: 46px;
  28. height: 46px;
  29. "
  30. /></van-col>
  31. <van-col span="16">
  32. <div
  33. style="
  34. text-align: left;
  35. background-color: white;
  36. min-height: 44px;
  37. margin: 0 10px;
  38. padding: 10px;
  39. border-radius: 6px;
  40. "
  41. v-for="(itemChild, itemIndex) in item.aiResponseMobiles"
  42. :key="itemIndex">
  43. <template v-if="itemChild.type == 'AI_WIRING_SCENE'">
  44. <p
  45. style="text-decoration: underline; color: #1c84c6; word-break: break-all"
  46. @click="choiceSelct(itemChild)">
  47. <img src="./../../assets/Icon/clcik.png" style="width: 20px; float: left" />
  48. <span>跳转高销额列表</span>
  49. </p>
  50. </template>
  51. <template v-else>
  52. <p style="word-break: break-all">{{ itemChild.voiceText }}</p>
  53. <p style="word-break: break-all">{{ itemChild.description }}</p>
  54. <p v-for="(sbpm, pmsb) in itemChild.textList" :key="pmsb" v-html="sbpm"></p>
  55. <div v-if="(itemChild.type = 'answer_radio')">
  56. <div
  57. v-for="(sbpm, pmsb) in itemChild.optionsList"
  58. :key="pmsb"
  59. style="margin-top: 10px">
  60. <p
  61. style="text-decoration: underline; color: #1c84c6; word-break: break-all"
  62. @click="choiceSelct(sbpm, itemChild)">
  63. <img
  64. src="./../../assets/Icon/clcik.png"
  65. style="width: 20px; float: left" /><span v-html="sbpm.radioName"></span>
  66. </p>
  67. </div></div
  68. ></template>
  69. </div>
  70. </van-col>
  71. <van-col span="4"></van-col>
  72. </van-row>
  73. </div>
  74. <div style="margin: 14px" v-if="item.chatRecordFrom == 1">
  75. <van-row>
  76. <van-col span="4"></van-col>
  77. <van-col span="16">
  78. <div
  79. style="
  80. text-align: left;
  81. background-color: #a0e75a;
  82. min-height: 44px;
  83. margin: 0 10px;
  84. padding: 10px;
  85. border-radius: 6px;
  86. display: inline-block;
  87. float: right;
  88. ">
  89. <p style="word-break: break-all" @click="voiceText(item)">
  90. {{ item.chatRecordText }}
  91. </p>
  92. </div>
  93. </van-col>
  94. <van-col span="4"
  95. ><van-image
  96. :src="avatar"
  97. style="
  98. float: left;
  99. background-color: #fff;
  100. width: 44px;
  101. height: 44px;
  102. border-radius: 6px;
  103. "
  104. /></van-col>
  105. </van-row>
  106. </div>
  107. <!-- <div style="margin: 14px" v-if="one1">-->
  108. <!-- <van-row>-->
  109. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  110. <!-- height: 44px;-->
  111. <!-- border-radius: 6px;" /></van-col>-->
  112. <!-- <van-col span="16">-->
  113. <!-- <div style="text-align: left;background-color: white;-->
  114. <!-- min-height: 44px;-->
  115. <!-- margin:0 10px;-->
  116. <!-- padding: 10px;border-radius: 6px">-->
  117. <!-- <p>符合您要求的有20家</p>-->
  118. <!-- <p style="line-height: 24px">-->
  119. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6;" @click="goFn(4)"><img src="./../../assets/Icon/clcik.png" style="width: 22px;float: left;">请点击查看门店列表</a>-->
  120. <!-- </p>-->
  121. <!-- </div>-->
  122. <!-- </van-col>-->
  123. <!-- <van-col span="4"></van-col>-->
  124. <!-- </van-row>-->
  125. <!-- </div>-->
  126. <!-- <div style="margin: 14px" v-if="one9">-->
  127. <!-- <van-row>-->
  128. <!-- <van-col span="4"></van-col>-->
  129. <!-- <van-col span="16">-->
  130. <!-- <div style="text-align: left;background-color: #A0E75A;min-height: 44px; margin:0 10px;padding: 10px;border-radius: 6px">-->
  131. <!-- 我的分销店中,哪些还没参加碰瓷专案?-->
  132. <!-- </div>-->
  133. <!-- </van-col>-->
  134. <!-- <van-col span="4"><van-image :src="avatar" style="float: left;background-color: #fff; width: 44px;-->
  135. <!-- height: 44px;-->
  136. <!-- border-radius: 6px;"/></van-col>-->
  137. <!-- </van-row>-->
  138. <!-- </div>-->
  139. <!-- <div style="margin: 14px" v-if="one10">-->
  140. <!-- <van-row>-->
  141. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  142. <!-- height: 44px;-->
  143. <!-- border-radius: 6px;" /></van-col>-->
  144. <!-- <van-col span="16">-->
  145. <!-- <div style="text-align: left;background-color: white;-->
  146. <!-- min-height: 44px;-->
  147. <!-- margin:0 10px;-->
  148. <!-- padding: 10px;border-radius: 6px">-->
  149. <!-- <p>符合您要求的有8家</p>-->
  150. <!-- <p style="line-height: 24px">-->
  151. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6;" @click="goFn(2)"><img src="./../../assets/Icon/clcik.png" style="width: 22px;float: left;">请点击查看门店列表</a>-->
  152. <!-- </p>-->
  153. <!-- </div>-->
  154. <!-- </van-col>-->
  155. <!-- <van-col span="4"></van-col>-->
  156. <!-- </van-row>-->
  157. <!-- </div>-->
  158. <!-- <div style="margin: 14px" v-if="one11">-->
  159. <!-- <van-row>-->
  160. <!-- <van-col span="4"></van-col>-->
  161. <!-- <van-col span="16">-->
  162. <!-- <div style="text-align: left;background-color: #A0E75A;min-height: 44px; margin:0 10px;padding: 10px;border-radius: 6px">-->
  163. <!-- 我的门店中,本月还没进货专业时时丽的有哪些?-->
  164. <!-- </div>-->
  165. <!-- </van-col>-->
  166. <!-- <van-col span="4"><van-image :src="avatar" style="float: left;background-color: #fff; width: 44px;-->
  167. <!-- height: 44px;-->
  168. <!-- border-radius: 6px;"/></van-col>-->
  169. <!-- </van-row>-->
  170. <!-- </div>-->
  171. <!-- <div style="margin: 14px" v-if="one12">-->
  172. <!-- <van-row>-->
  173. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  174. <!-- height: 44px;-->
  175. <!-- border-radius: 6px;" /></van-col>-->
  176. <!-- <van-col span="16">-->
  177. <!-- <div style="text-align: left;background-color: white;-->
  178. <!-- min-height: 44px;-->
  179. <!-- margin:0 10px;-->
  180. <!-- padding: 10px;border-radius: 6px">-->
  181. <!-- <p>您指的是哪种门店类型?</p>-->
  182. <!-- <p style="line-height: 24px">-->
  183. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6;" @click="typw(1)">1.金牌店</a>-->
  184. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6;" @click="typw(2)">2.所有分销店</a>-->
  185. <!--&lt;!&ndash; @click="typw(3)&ndash;&gt;-->
  186. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6;" >3.以上都不是,请具体描述门店类型</a>-->
  187. <!-- </p>-->
  188. <!-- </div>-->
  189. <!-- </van-col>-->
  190. <!-- <van-col span="4"></van-col>-->
  191. <!-- </van-row>-->
  192. <!-- </div>-->
  193. <!-- <div style="margin: 14px" v-if="one14">-->
  194. <!-- <van-row>-->
  195. <!-- <van-col span="4"></van-col>-->
  196. <!-- <van-col span="16">-->
  197. <!-- <div style="text-align: left;background-color: #A0E75A;min-height: 44px;margin:0 10px;;padding: 10px;border-radius: 6px;float: right;">-->
  198. <!-- <p>-->
  199. <!-- 1.金牌店-->
  200. <!-- </p>-->
  201. <!-- </div>-->
  202. <!-- </van-col>-->
  203. <!-- <van-col span="4"><van-image :src="avatar" style="float: left;background-color: #fff; width: 44px;-->
  204. <!-- height: 44px;-->
  205. <!-- border-radius: 6px;"/></van-col>-->
  206. <!-- </van-row>-->
  207. <!-- </div>-->
  208. <!-- <div style="margin: 14px" v-if="one15">-->
  209. <!-- <van-row>-->
  210. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  211. <!-- height: 44px;-->
  212. <!-- border-radius: 6px;" /></van-col>-->
  213. <!-- <van-col span="16">-->
  214. <!-- <div style="text-align: left;background-color: white;-->
  215. <!-- min-height: 44px;-->
  216. <!-- margin:0 10px;-->
  217. <!-- padding: 10px;border-radius: 6px">-->
  218. <!-- <p>-->
  219. <!-- 符合您要求的有15家-->
  220. <!-- </p>-->
  221. <!-- <p @click="goFn(3)">-->
  222. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6" ><img src="./../../assets/Icon/clcik.png" style="width: 20px;float: left;">请点击查看门店列表。</a>-->
  223. <!-- </p>-->
  224. <!-- </div>-->
  225. <!-- </van-col>-->
  226. <!-- <van-col span="4"></van-col>-->
  227. <!-- </van-row>-->
  228. <!-- </div>-->
  229. <!-- <div style="margin: 14px" v-if="one16">-->
  230. <!-- <van-row>-->
  231. <!-- <van-col span="4"></van-col>-->
  232. <!-- <van-col span="16">-->
  233. <!-- <div style="text-align: left;background-color: #A0E75A;min-height: 44px;margin:0 10px;;padding: 10px;border-radius: 6px; float: right;">-->
  234. <!-- <p>-->
  235. <!-- 2.所有分销店-->
  236. <!-- </p>-->
  237. <!-- </div>-->
  238. <!-- </van-col>-->
  239. <!-- <van-col span="4"><van-image :src="avatar" style="float: left;background-color: #fff; width: 44px;-->
  240. <!-- height: 44px;-->
  241. <!-- border-radius: 6px;"/></van-col>-->
  242. <!-- </van-row>-->
  243. <!-- </div>-->
  244. <!-- <div style="margin: 14px" v-if="one17">-->
  245. <!-- <van-row>-->
  246. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  247. <!-- height: 44px;-->
  248. <!-- border-radius: 6px;" /></van-col>-->
  249. <!-- <van-col span="16">-->
  250. <!-- <div style="text-align: left;background-color: white;-->
  251. <!-- min-height: 44px;-->
  252. <!-- margin:0 10px;-->
  253. <!-- padding: 10px;border-radius: 6px">-->
  254. <!-- <p>-->
  255. <!-- 符合您要求的有15家-->
  256. <!-- </p>-->
  257. <!-- <p @click="goFn(3)">-->
  258. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6" ><img src="./../../assets/Icon/clcik.png" style="width: 20px;float: left;">请点击查看门店列表。</a>-->
  259. <!-- </p>-->
  260. <!-- </div>-->
  261. <!-- </van-col>-->
  262. <!-- <van-col span="4"></van-col>-->
  263. <!-- </van-row>-->
  264. <!-- </div>-->
  265. <!-- <div style="margin: 14px" v-if="one18">-->
  266. <!-- <van-row>-->
  267. <!-- <van-col span="4"></van-col>-->
  268. <!-- <van-col span="16">-->
  269. <!-- <div style="text-align: left;background-color: #A0E75A;min-height: 44px;margin:0 10px;;padding: 10px;border-radius: 6px">-->
  270. <!-- 2个月业绩小于20000元的金牌店-->
  271. <!-- </div>-->
  272. <!-- </van-col>-->
  273. <!-- <van-col span="4"><van-image :src="avatar" style="float: left;background-color: #fff; width: 44px;-->
  274. <!-- height: 44px;-->
  275. <!-- border-radius: 6px;"/></van-col>-->
  276. <!-- </van-row>-->
  277. <!-- </div>-->
  278. <!-- <div style="margin: 14px" v-if="one19">-->
  279. <!-- <van-row>-->
  280. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  281. <!-- height: 44px;-->
  282. <!-- border-radius: 6px;" /></van-col>-->
  283. <!-- <van-col span="16">-->
  284. <!-- <div style="text-align: left;background-color: white;-->
  285. <!-- min-height: 44px;-->
  286. <!-- margin:0 10px;-->
  287. <!-- padding: 10px;border-radius: 6px">-->
  288. <!-- <p>-->
  289. <!-- 已为您筛选20家2个月业绩小于20000元的金牌店-->
  290. <!-- </p>-->
  291. <!-- <p @click="goFn(3)">-->
  292. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6" ><img src="./../../assets/Icon/clcik.png" style="width: 20px;float: left;">请点击此条信息查看门店。</a>-->
  293. <!-- </p>-->
  294. <!-- </div>-->
  295. <!-- </van-col>-->
  296. <!-- <van-col span="4"></van-col>-->
  297. <!-- </van-row>-->
  298. <!-- </div>-->
  299. <!-- <div style="margin: 14px" v-if="two">-->
  300. <!-- <van-row>-->
  301. <!-- <van-col span="4"></van-col>-->
  302. <!-- <van-col span="16">-->
  303. <!-- <div style="text-align: left;background-color: #A0E75A;min-height: 44px;margin:0 10px;;padding: 10px;border-radius: 6px">-->
  304. <!-- 我想邀请销量高的金牌店,参加线下订货会-->
  305. <!-- </div>-->
  306. <!-- </van-col>-->
  307. <!-- <van-col span="4"><van-image :src="avatar" style="float: left;background-color: #fff; width: 44px;-->
  308. <!-- height: 44px;-->
  309. <!-- border-radius: 6px;"/></van-col>-->
  310. <!-- </van-row>-->
  311. <!-- </div>-->
  312. <!-- <div style="margin: 14px" v-if="two1">-->
  313. <!-- <van-row>-->
  314. <!-- <van-col span="4"><van-image :src="aiselect" style="float: right;background-color: #fff; width: 44px;-->
  315. <!-- height: 44px;-->
  316. <!-- border-radius: 6px;" /></van-col>-->
  317. <!-- <van-col span="16">-->
  318. <!-- <div style="text-align: left;background-color: white;-->
  319. <!-- min-height: 44px;-->
  320. <!-- margin:0 10px;-->
  321. <!-- padding: 10px;border-radius: 6px">-->
  322. <!-- <p>-->
  323. <!-- 已为您筛选销量前10的金牌店-->
  324. <!-- </p>-->
  325. <!-- <p @click="goFn(1)">-->
  326. <!-- <a style="display: block;text-decoration: underline;color:#1c84c6" ><img src="./../../assets/Icon/clcik.png" style="width: 20px;float: left;">请点击此条信息查看门店。</a>-->
  327. <!-- </p>-->
  328. <!-- </div>-->
  329. <!-- </van-col>-->
  330. <!-- <van-col span="4"></van-col>-->
  331. <!-- </van-row>-->
  332. <!-- </div>-->
  333. </div>
  334. </div>
  335. <!-- </van-list>-->
  336. <br />
  337. <br />
  338. <br />
  339. <br />
  340. <br />
  341. <br />
  342. <br />
  343. <br />
  344. <br />
  345. <br />
  346. <br />
  347. <br />
  348. <br />
  349. <br />
  350. </van-pull-refresh>
  351. <div style="position: fixed; bottom: 50px; left: 0; width: 100%; background-color: white">
  352. <van-field v-model="content" rows="1" autosize type="textarea" placeholder="请输入文字">
  353. <template #left-icon>
  354. <van-icon :name="yy" style="margin-top: 10px; padding: 0 20px" @click="showFn" />
  355. </template>
  356. <template #button>
  357. <van-button
  358. size="small"
  359. :disabled="!btnclik"
  360. type="primary"
  361. color="#1c84c6"
  362. @click="Submit"
  363. >发送</van-button
  364. >
  365. </template>
  366. </van-field>
  367. </div>
  368. <tab-bar tabBarActive="ai"></tab-bar>
  369. <van-overlay :show="show" @click="show = false">
  370. <div class="wrapper" @click.stop>
  371. <div
  372. class="block"
  373. style="
  374. position: absolute;
  375. bottom: 0;
  376. background-color: white;
  377. width: 100%;
  378. height: 260px;
  379. ">
  380. <div class="audio" v-if="shows">
  381. <div class="wave"></div>
  382. <div class="wave"></div>
  383. <div class="wave"></div>
  384. <div class="wave"></div>
  385. <div class="wave"></div>
  386. </div>
  387. <div
  388. class="audioBox"
  389. style="
  390. background-color: rgb(0, 87, 186);
  391. left: 50%;
  392. width: 80px;
  393. height: 80px;
  394. border-radius: 100px;
  395. margin-left: -40px;
  396. position: absolute;
  397. bottom: 90px;
  398. ">
  399. <div class="tip">{{ tips }}</div>
  400. <div
  401. style="position: absolute; width: 100%; height: 80px; z-index: 999999"
  402. @touchstart="lujin"
  403. @touchend="endlujin"></div>
  404. <van-icon :name="yt" size="40" style="top: 20px; left: 50%; margin-left: -20px" />
  405. </div>
  406. </div>
  407. </div>
  408. </van-overlay>
  409. </div>
  410. </template>
  411. <script>
  412. import avatar from '@/assets/avatar2.png';
  413. import yy from '@/assets/Icon/yy.png';
  414. import yt from '@/assets/Icon/yt.png';
  415. import aiselect from '@/assets/Icon/avatar1.png';
  416. import tabBar from '@/components/tabBar';
  417. import { getReportInfo } from '@/api';
  418. import { aiDialogue } from '@/api/inventory';
  419. import axios from 'axios';
  420. export default {
  421. name: 'ai',
  422. components: { tabBar },
  423. data() {
  424. return {
  425. loading: false,
  426. finished: false,
  427. pageNum: 0,
  428. avatar: avatar,
  429. yy: yy,
  430. yt: yt,
  431. aiselect: aiselect,
  432. Ggreet: [{ textList: [] }],
  433. content: '',
  434. btnclik: true,
  435. message: '',
  436. num: 0,
  437. show: false,
  438. shows: false,
  439. one: false,
  440. two: false,
  441. one1: false,
  442. one9: false,
  443. one10: false,
  444. one11: false,
  445. one12: false,
  446. one14: false,
  447. one15: false,
  448. one16: false,
  449. one17: false,
  450. one18: false,
  451. one19: false,
  452. two1: false,
  453. dataList: [
  454. {
  455. type: 1,
  456. text: '厨卫店中,本月进货不满50包超好贴的门店有哪些?',
  457. },
  458. {
  459. type: 2,
  460. text: '点击此条信息进入推荐门店页面。',
  461. },
  462. ],
  463. isNoData: false, //是否加载完所有数据
  464. successText: '加载成功', //上拉刷新提示语
  465. tips: '按住 说话',
  466. };
  467. },
  468. // watch: {
  469. // $route(to, from) {
  470. // if (to.path == '/ai') {
  471. // this.onLoad();
  472. // }
  473. // },
  474. // },
  475. activated() {
  476. this.onLoad();
  477. },
  478. methods: {
  479. garbageManager() {
  480. this.$nextTick(() => {
  481. this.$refs.snb.scrollTop = this.$refs.snb.scrollHeight;
  482. });
  483. },
  484. onLoad() {
  485. if (this.isNoData) {
  486. this.successText = '以下所有内容!';
  487. this.$toast('已经加载所有内容!');
  488. this.loading = false;
  489. return;
  490. }
  491. this.pageNum++;
  492. this.aiDialogueGgreet();
  493. },
  494. choiceSelct(val, val2) {
  495. if (val.type == 'AI_WIRING_SCENE') {
  496. localStorage.setItem(val.type, val.content);
  497. // 跳转高销额列表
  498. this.$router.push({
  499. path: '/topStore',
  500. query: {
  501. AItype: val.type,
  502. },
  503. });
  504. return;
  505. } else {
  506. let loading1 = this.$toast.loading({
  507. duration: 0,
  508. message: '发送中...',
  509. forbidClick: true,
  510. });
  511. aiDialogue({
  512. type: 4,
  513. content: val.radioName,
  514. radioIndex: val.radioIndex,
  515. radioActionId: val2.radioActionId,
  516. radioAnswerId: val.radioAnswerId,
  517. radioValue: val.radioValue,
  518. radioName: val.radioName,
  519. }).then((response) => {
  520. loading1.clear();
  521. if (response.code == 200) {
  522. this.pageNum = 1;
  523. this.Ggreet = [];
  524. this.aiDialogueGgreet();
  525. }
  526. });
  527. }
  528. },
  529. aiDialogueGgreet() {
  530. let loading1 = this.$toast.loading({
  531. duration: 0,
  532. message: '发送中...',
  533. forbidClick: true,
  534. });
  535. aiDialogue({ type: 3, pageNum: this.pageNum, pageSize: 10 }).then((response) => {
  536. loading1.clear();
  537. this.loading = false;
  538. if (response.code == 200) {
  539. this.Ggreet = response.rows.concat(this.Ggreet);
  540. if (this.Ggreet.length >= response.total) {
  541. this.isNoData = true;
  542. } else {
  543. this.isNoData = false;
  544. }
  545. if (this.pageNum == 1) {
  546. this.garbageManager();
  547. }
  548. }
  549. });
  550. },
  551. Submit() {
  552. if (this.content.trim() == '') {
  553. this.$toast('请输入内容!');
  554. }
  555. let loading1 = this.$toast.loading({
  556. duration: 0,
  557. message: '发送中...',
  558. forbidClick: true,
  559. });
  560. this.btnclik = false;
  561. this.Ggreet.push({
  562. chatRecordText: this.content,
  563. chatRecordFrom: 1,
  564. });
  565. aiDialogue({ type: 1, content: this.content }).then((response) => {
  566. loading1.clear();
  567. this.btnclik = true;
  568. if (response.code == 200) {
  569. this.content = '';
  570. // this.pageNum = 1;
  571. // this.Ggreet = [];
  572. this.Ggreet.push(...response.rows);
  573. // this.aiDialogueGgreet();
  574. this.garbageManager();
  575. }
  576. });
  577. },
  578. lujin() {
  579. let url = window.location.href;
  580. let that = this;
  581. let wx = this.wx;
  582. let qiyeData;
  583. const instance = axios.create();
  584. instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
  585. instance
  586. .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
  587. params: {
  588. url: url,
  589. },
  590. })
  591. .then((response) => {
  592. if (response.status == 200) {
  593. qiyeData = response.data.data;
  594. wx.config({
  595. beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
  596. debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
  597. appId: qiyeData.appId, // 必填,企业微信的corpID
  598. timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
  599. nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
  600. signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
  601. jsApiList: ['ready', 'startRecord', 'stopRecord', 'onVoiceRecordEnd'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
  602. });
  603. wx.ready(function () {
  604. wx.startRecord();
  605. that.shows = true;
  606. wx.onVoiceRecordEnd({
  607. complete: function (res) {
  608. var localId = res.localId;
  609. that.shows = false;
  610. wx.uploadVoice({
  611. localId: localId,
  612. isShowProgressTips: 1, // 默认为1,显示进度提示
  613. success: function (res) {
  614. aiDialogue({ type: 2, content: res.serverId }).then((response) => {
  615. if (response.code == 200) {
  616. // that.pageNum = 1;
  617. // that.Ggreet = [];
  618. // that.aiDialogueGgreet();
  619. this.Ggreet.push(...response.rows);
  620. that.garbageManager();
  621. }
  622. that.show = false;
  623. });
  624. },
  625. });
  626. },
  627. });
  628. });
  629. }
  630. });
  631. },
  632. endlujin() {
  633. let wx = this.wx;
  634. var that = this;
  635. wx.stopRecord({
  636. success: function (res) {
  637. var localId = res.localId;
  638. wx.uploadVoice({
  639. localId: localId,
  640. isShowProgressTips: 1, // 默认为1,显示进度提示
  641. success: function (res) {
  642. aiDialogue({ type: 2, content: res.serverId }).then((response) => {
  643. if (response.code == 200) {
  644. // that.pageNum = 1;
  645. // that.Ggreet = [];
  646. // that.aiDialogueGgreet();
  647. this.Ggreet.push(...response.rows);
  648. that.garbageManager();
  649. }
  650. that.shows = false;
  651. that.show = false;
  652. });
  653. },
  654. });
  655. },
  656. });
  657. },
  658. typw(val) {
  659. if (val == 1) {
  660. this.one14 = true;
  661. setTimeout(() => {
  662. this.one15 = true;
  663. }, 1000);
  664. }
  665. if (val == 2) {
  666. this.one16 = true;
  667. setTimeout(() => {
  668. this.one17 = true;
  669. }, 1000);
  670. }
  671. if (val == 3) {
  672. this.one18 = true;
  673. setTimeout(() => {
  674. this.one19 = true;
  675. }, 1000);
  676. }
  677. },
  678. send() {
  679. this.one = false;
  680. this.two = false;
  681. this.one1 = false;
  682. this.one9 = false;
  683. this.one10 = false;
  684. this.one11 = false;
  685. this.one12 = false;
  686. this.one14 = false;
  687. this.one15 = false;
  688. this.one16 = false;
  689. this.one17 = false;
  690. this.one18 = false;
  691. this.one19 = false;
  692. this.two1 = false;
  693. if (this.message.indexOf('销量') != -1 || this.num == 1) {
  694. this.one = true;
  695. setTimeout(() => {
  696. this.one1 = true;
  697. }, 1000);
  698. }
  699. if (this.message.indexOf('专业时时丽') != -1 || this.num == 2) {
  700. this.one11 = true;
  701. setTimeout(() => {
  702. this.one12 = true;
  703. }, 1000);
  704. }
  705. if (this.message.indexOf('碰瓷专案') != -1 || this.num == 3) {
  706. this.one9 = true;
  707. setTimeout(() => {
  708. this.one10 = true;
  709. }, 1000);
  710. }
  711. this.message = '';
  712. },
  713. showFn() {
  714. this.shows = false;
  715. this.show = true;
  716. },
  717. mousedownFN() {
  718. this.shows = true;
  719. },
  720. clears() {
  721. this.show = false;
  722. // this.two=true
  723. //
  724. // setTimeout(()=>{
  725. // this.two1=true
  726. // },1000)
  727. this.one = false;
  728. this.two = false;
  729. this.one1 = false;
  730. this.one9 = false;
  731. this.one10 = false;
  732. this.one11 = false;
  733. this.one12 = false;
  734. this.one14 = false;
  735. this.one15 = false;
  736. this.one16 = false;
  737. this.one17 = false;
  738. this.one18 = false;
  739. this.one19 = false;
  740. this.two1 = false;
  741. },
  742. mouseupfN() {
  743. this.show = false;
  744. // this.two=true
  745. //
  746. // setTimeout(()=>{
  747. // this.two1=true
  748. // },1000)
  749. this.one = false;
  750. this.two = false;
  751. this.one1 = false;
  752. this.one9 = false;
  753. this.one10 = false;
  754. this.one11 = false;
  755. this.one12 = false;
  756. this.one14 = false;
  757. this.one15 = false;
  758. this.one16 = false;
  759. this.one17 = false;
  760. this.one18 = false;
  761. this.one19 = false;
  762. this.two1 = false;
  763. if (this.num > 2) {
  764. this.num = 0;
  765. }
  766. this.num = this.num + 1;
  767. this.send();
  768. },
  769. goFn(row) {
  770. this.$router.push({
  771. path: '/aipage',
  772. query: { type: row },
  773. });
  774. },
  775. getReportInfo() {
  776. this.deptLevel = localStorage.getItem('deptLevel');
  777. let loading1 = this.$toast.loading({
  778. duration: 0,
  779. message: '加载中...',
  780. forbidClick: true,
  781. });
  782. getReportInfo({ isContent: false }).then((res) => {
  783. loading1.clear();
  784. this.list = res.data.summaryTasks;
  785. this.historyButton = res.data.historyButton;
  786. localStorage.setItem('powerGrade', res.data.positionId);
  787. this.existReject = res.data.existReject;
  788. this.powerGrade = res.data.positionId;
  789. this.showButton = res.data.showButton;
  790. this.deptLevel = res.data.deptLevel;
  791. this.reportTargetAll = res.data.reportTargetAll;
  792. this.updataTime = res.data.reportTargetAll.updateTime;
  793. });
  794. },
  795. },
  796. };
  797. </script>
  798. <style lang="scss" scoped>
  799. p {
  800. margin: 0;
  801. line-height: 22px;
  802. }
  803. .audio {
  804. display: flex;
  805. justify-content: space-between;
  806. align-items: center;
  807. gap: 8px;
  808. width: 60px;
  809. height: 40px;
  810. position: absolute;
  811. left: 50%;
  812. top: 86px;
  813. margin-left: -34px;
  814. .wave {
  815. height: 40px;
  816. display: block;
  817. width: 10px;
  818. height: 6px;
  819. border-radius: 8px;
  820. background: orange;
  821. }
  822. }
  823. .audio {
  824. .wave {
  825. animation: audio-wave 2s ease-in-out infinite;
  826. &:nth-child(1) {
  827. animation-delay: 0.1s;
  828. }
  829. &:nth-child(2) {
  830. animation-delay: 0.2s;
  831. }
  832. &:nth-child(3) {
  833. animation-delay: 0.3s;
  834. }
  835. &:nth-child(4) {
  836. animation-delay: 0.4s;
  837. }
  838. &:nth-child(5) {
  839. animation-delay: 0.5s;
  840. }
  841. }
  842. }
  843. @keyframes audio-wave {
  844. 0% {
  845. height: 6px;
  846. transform: translateY(0px);
  847. background: #ff8e3a;
  848. }
  849. 25% {
  850. height: 6px;
  851. transform: translateY(0px);
  852. background: #9c73f8;
  853. }
  854. 50% {
  855. height: 30px;
  856. transform: translateY(-5px) scaleY(1.5);
  857. background: #ed509e;
  858. }
  859. 75% {
  860. height: 6px;
  861. transform: translateY(0px);
  862. background: #9c73f8;
  863. }
  864. 100% {
  865. height: 6px;
  866. transform: translateY(0px);
  867. background: #0fccce;
  868. }
  869. }
  870. .pageya {
  871. overflow-y: auto;
  872. height: 700px;
  873. }
  874. .wrapper {
  875. .audioBox {
  876. -webkit-touch-callout: none;
  877. -webkit-user-select: none;
  878. -khtml-user-select: none;
  879. -moz-user-select: none;
  880. -ms-user-select: none;
  881. user-select: none;
  882. .tip {
  883. position: absolute;
  884. top: -26px;
  885. display: flex;
  886. width: 100%;
  887. justify-content: center;
  888. font-size: 14px;
  889. }
  890. }
  891. }
  892. </style>