index.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. import {
  2. getreadInfo,
  3. submitPlayLog
  4. } from '~/api/video'
  5. import {
  6. publishWorks,
  7. uploadPk,
  8. postWorksScore
  9. } from '~/api/works'
  10. import {
  11. userEvent
  12. } from '~/api/global'
  13. import {
  14. createStoreBindings
  15. } from 'mobx-miniprogram-bindings'
  16. import {
  17. store
  18. } from '~/store/index'
  19. import {
  20. setDuration
  21. } from '~/utils/util'
  22. const aiengine = require('~/utils/ChivoxAiEngine')
  23. const sha1 = require('~/utils/sha1');
  24. // 文章行高
  25. let rowH = 0
  26. let videoContext = null
  27. // 滚动变色定时器
  28. let stl = null
  29. // 倒计时
  30. let setTimeoutObj = null
  31. // 录音
  32. let innerAudioContext = null
  33. // 试听
  34. let resultAudioContext = null
  35. /*创建基础引擎*/
  36. let wsEngine = aiengine.createWsEngine({});
  37. /*微信录音*/
  38. let recorderManager = wx.getRecorderManager();
  39. Page({
  40. data: {
  41. videoInfo: {},
  42. videoPath: '',
  43. currentRow: null,
  44. state: false,
  45. // 示例播放状态
  46. exampleState: false,
  47. // 是否静音播放视频
  48. muted: false,
  49. countDown: {
  50. state: false,
  51. num: 3,
  52. },
  53. contentH: 0,
  54. scrollTop: 0,
  55. //如果readingReset为true就是重读
  56. readingReset: false,
  57. //readingType为public是普通阅读,为pk是pk逻辑,readMatch为朗读赛
  58. readingType: 'public',
  59. percent: 0,
  60. uploadState: false,
  61. article: [],
  62. silderData: {
  63. currentTime: '00:00',
  64. endTime: '00:00',
  65. silderValue: 0
  66. }
  67. },
  68. onLoad(options) {
  69. let videoId = options.videoId
  70. console.log(videoId);
  71. this.getreadInfo(videoId, options.reset)
  72. this.setData({
  73. readingReset: options.reset || false,
  74. readingType: options.readingType || 'public',
  75. uploadHide: options.uploadHide
  76. })
  77. // 手工绑定
  78. this.storeBindings = createStoreBindings(this, {
  79. store,
  80. fields: {
  81. userInfo: 'userInfo',
  82. readDetail: 'readDetail',
  83. pkData: 'pkData'
  84. },
  85. actions: {
  86. setReadDetail: 'setReadDetail'
  87. }
  88. })
  89. // 录音授权
  90. wx.getSetting({
  91. success(res) {
  92. if (!res.authSetting['scope.record']) {
  93. wx.authorize({
  94. scope: 'scope.record',
  95. success() {
  96. // 用户已经同意小程序使用录音功能,后续调用接口不会弹窗询问
  97. wx.getRecorderManager()
  98. }
  99. })
  100. }
  101. }
  102. })
  103. /*监听评测结果:必须在基础引擎创建后,调用任何评测接口前设置监听,否则有可能收不到相关事件。*/
  104. wsEngine.onResult((res) => {
  105. this.getRecordScore(res)
  106. });
  107. wsEngine.onErrorResult((res) => {
  108. console.log("===收到错误结果=============", res)
  109. });
  110. this.innerAudioContext = wx.createInnerAudioContext();
  111. this.innerAudioContext.onTimeUpdate(res => {
  112. this.setData({
  113. ["silderData.sliderValue"]: Math.round(this.innerAudioContext.currentTime / this.innerAudioContext.duration * 100),
  114. ["silderData.currentTime"]: setDuration(this.innerAudioContext.currentTime)
  115. })
  116. })
  117. this.resultAudioContext = wx.createInnerAudioContext();
  118. this.resultAudioContext.onTimeUpdate(res => {
  119. this.setData({
  120. ["silderData.sliderValue"]: Math.round(this.resultAudioContext.currentTime / this.resultAudioContext.duration * 100),
  121. ["silderData.currentTime"]: setDuration(this.resultAudioContext.currentTime)
  122. })
  123. })
  124. this.resultAudioContext.onEnded(res => {
  125. console.log('102-resultAudioContext.ended');
  126. this.setData({
  127. exampleState: false
  128. })
  129. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  130. this.videoContext.stop()
  131. this.videoContext.seek(0)
  132. }
  133. })
  134. this.resultAudioContext.onStop((res) => {
  135. console.log('109-resultAudioContext.onStop');
  136. this.setData({
  137. exampleState: false
  138. })
  139. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  140. this.videoContext.stop()
  141. this.videoContext.seek(0)
  142. }
  143. });
  144. this.resultAudioContext.onEnded(res => {
  145. this.setData({
  146. ["silderData.sliderValue"]: 100
  147. })
  148. })
  149. },
  150. // 获取阅读内容
  151. async getreadInfo(videoId, reset = false) {
  152. let videoInfo = await getreadInfo(videoId)
  153. wx.setNavigationBarTitle({
  154. title: videoInfo.userRead.title
  155. })
  156. let data = JSON.parse(videoInfo.userReadExtend.lessonText)
  157. data = data.map((item, index) => {
  158. item.time = Number(item.time)
  159. item.readTime = data[index + 1] ? data[index + 1].time - item.time : ''
  160. return item
  161. })
  162. this.setData({
  163. videoPath: videoInfo.userRead.originVideo,
  164. article: data,
  165. videoInfo,
  166. ["silderData.endTime"]: setDuration(videoInfo.userRead.duration)
  167. })
  168. if (!reset) {
  169. this.getHeight()
  170. }
  171. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  172. this.videoContext = wx.createVideoContext('myVideo')
  173. } else {
  174. this.innerAudioContext.src = videoInfo.userRead.originVideo
  175. this.innerAudioContext.onEnded(res => {
  176. console.log("138innerAudioContext触发的");
  177. this.resetReading()
  178. })
  179. this.innerAudioContext.onStop((res) => {
  180. console.log("143innerAudioContext触发的");
  181. });
  182. }
  183. },
  184. // 开始录制
  185. setCountDown() {
  186. let child = this.selectComponent('#readingTips').data
  187. // 判断是否有权限朗读 不是vip并且没有朗读机会
  188. const isVip = child.vipTime ? true : false
  189. if (!isVip && child.userInfo.experienceAmount <= 0 && this.data.readingType != 'readMatch') {
  190. return this.selectComponent('#readingTips').showModal();
  191. }
  192. if (this.data.state) {
  193. this.resetReading()
  194. return
  195. }
  196. if (!this.data.readingReset) {
  197. this.getHeight()
  198. }
  199. this.resetReading()
  200. this.setData({
  201. readingReset: false,
  202. 'countDown.state': true
  203. })
  204. this.stl = setInterval(() => {
  205. if (this.data.countDown.num == 0) {
  206. clearInterval(this.stl)
  207. this.setData({
  208. state: true,
  209. countDown: {
  210. state: false,
  211. num: 3
  212. }
  213. })
  214. this.playMediaState()
  215. this.soundRecording()
  216. this.startRecording()
  217. } else {
  218. this.setData({
  219. 'countDown.num': --this.data.countDown.num
  220. })
  221. }
  222. }, 1000)
  223. },
  224. // 录音
  225. soundRecording() {
  226. console.log('zzz');
  227. /*调用微信开始录音接口,并启动语音评测*/
  228. let timeStamp = new Date().getTime()
  229. let sig = sha1(`16075689600000da${timeStamp}caa8e60da6042731c230fe431ac9c7fd`)
  230. let app = {
  231. applicationId: '16075689600000da',
  232. sig, //签名字符串
  233. alg: 'sha1',
  234. timestamp: timeStamp + '',
  235. userId: wx.getStorageSync('uid')
  236. }
  237. let lessonText = JSON.parse(this.data.videoInfo.userReadExtend.lessonText).map((item) => {
  238. return item.text
  239. }).join('\n')
  240. // https://www.chivox.com/opendoc/#/ChineseDoc/coreCn/Chinese/cn.sent.raw?id=%e5%8f%82%e6%95%b0%e8%af%b4%e6%98%8e <----参数说明
  241. wsEngine.start({
  242. request: {
  243. coreType: "cn.pred.raw",
  244. refText: lessonText,
  245. rank: 100,
  246. attachAudioUrl: 1,
  247. result: {
  248. details: {
  249. gop_adjust: -0.2
  250. }
  251. }
  252. },
  253. app,
  254. audio: {
  255. audioType: "mp3",
  256. channel: 1,
  257. sampleBytes: 2,
  258. sampleRate: 16000
  259. },
  260. success: (res) => {
  261. /*引擎启动成功,可以启动录音机开始录音,并将音频片传给引擎*/
  262. const options = {
  263. duration: 600000,
  264. sampleRate: 44100, //采样率
  265. numberOfChannels: 1, //录音通道数
  266. encodeBitRate: 192000, //编码码率
  267. format: 'mp3', //音频格式,有效值aac/mp3
  268. frameSize: 50 //指定帧大小,单位 KB
  269. };
  270. //开始录音,在开始录音回调中feed音频片
  271. recorderManager.start(options);
  272. },
  273. fail: (res) => {
  274. console.log("fail============= " + res);
  275. },
  276. });
  277. recorderManager.onError(res => {
  278. console.log(res, 'rrrrrsse');
  279. })
  280. //监听录音开始事件
  281. recorderManager.onStart(() => {});
  282. //监听录音结束事件
  283. recorderManager.onStop((res) => {
  284. console.log('录音结束', res);
  285. this.setData({
  286. tempFilePath: res.tempFilePath,
  287. });
  288. //录音机结束后,驰声引擎执行结束操作,等待评测返回结果
  289. wsEngine.stop({
  290. success: () => {
  291. console.log('====== wsEngine stop success ======');
  292. },
  293. fail: (res) => {
  294. console.log('录音结束报错', res);
  295. },
  296. });
  297. });
  298. //监听已录制完指定帧大小的文件事件。如果设置了 frameSize,则会回调此事件。
  299. recorderManager.onFrameRecorded((res) => {
  300. const {
  301. frameBuffer
  302. } = res
  303. //TODO 调用feed接口传递音频片给驰声评测引擎
  304. wsEngine.feed({
  305. data: frameBuffer, // frameBuffer为微信录音机回调的音频数据
  306. success: () => {},
  307. fail: (res) => {
  308. console.log('监听已录制完指定帧大小报错', res)
  309. },
  310. });
  311. });
  312. },
  313. // 获取测评结果
  314. getRecordScore(res) {
  315. const result = res.result;
  316. const integrity = Math.floor(result.integrity); //完成度
  317. const tone = Math.floor(result.tone); // 语调声调
  318. const accuracy = Math.floor(result.accuracy); // 准确度 发音分
  319. const fluency = Math.floor(result.fluency.overall); //流利度
  320. let myOverall = Math.floor(integrity * 0.3 + accuracy * 0.5 + fluency * 0.1 + tone * 0.1);
  321. let detail = {
  322. integrity,
  323. tone,
  324. accuracy,
  325. fluency,
  326. myOverall,
  327. tempFilePath: this.data.tempFilePath,
  328. title: this.data.videoInfo.userRead.title,
  329. id: this.data.videoInfo.userRead.exampleId,
  330. coverImg: this.data.videoInfo.userRead.coverImg,
  331. resourcesType: this.data.videoInfo.userReadExtend.resourcesType,
  332. aBg: this.data.videoInfo.userReadExtend.resourcesType == 1 ? this.data.videoInfo.userReadExtend.backgroundVirtualImg : '',
  333. originVideo: this.data.videoInfo.userRead.originVideo
  334. }
  335. this.setReadDetail(detail)
  336. if (this.data.readingType == 'public' || this.data.readingType == 'readMatch') {
  337. wx.redirectTo({
  338. url: `/pages/score/index?readingType=${this.data.readingType}`
  339. })
  340. } else {
  341. this.uploadAudio(detail)
  342. }
  343. },
  344. // 挑战录音上传
  345. uploadAudio(detail) {
  346. this.setData({
  347. uploadState: true
  348. })
  349. const uploadTask = wx.uploadFile({
  350. url: 'https://reader-api.ai160.com//file/upload',
  351. filePath: this.data.tempFilePath,
  352. name: '朗读录音',
  353. header: {
  354. uid: wx.getStorageSync('uid')
  355. },
  356. success: async (res) => {
  357. const formateRes = JSON.parse(res.data);
  358. let audioPath = formateRes.data;
  359. let uploadRes = await publishWorks({
  360. exampleId: this.data.pkData.exampleId,
  361. audioPath
  362. })
  363. let _data = this.data.readDetail
  364. console.log('挑战分数-----', {
  365. "userReadId": uploadRes.id,
  366. "complete": _data.integrity,
  367. "accuracy": _data.accuracy,
  368. "speed": _data.fluency,
  369. "intonation": _data.tone,
  370. "score": _data.myOverall
  371. });
  372. postWorksScore({
  373. "userReadId": uploadRes.id,
  374. "complete": _data.integrity,
  375. "accuracy": _data.accuracy,
  376. "speed": _data.fluency,
  377. "intonation": _data.tone,
  378. "score": _data.myOverall
  379. })
  380. let data = {
  381. challengerUserReadId: uploadRes.id,
  382. userReadId: this.data.pkData.id,
  383. winnerUId: this.data.pkData.score > _data.myOverall ? this.data.pkData.uid : this.data.pkData.score == _data.myOverall ? '' : wx.getStorageSync('uid')
  384. }
  385. console.log('uploadPk-----', data);
  386. let result = await uploadPk(data)
  387. wx.redirectTo({
  388. url: `/pages/pkResult/index?id=${result.id}`
  389. })
  390. },
  391. complete: () => {
  392. this.setData({
  393. uploadState: false
  394. })
  395. }
  396. });
  397. uploadTask.onProgressUpdate((res) => {
  398. this.setData({
  399. percent: res.progress
  400. })
  401. })
  402. },
  403. // 字体换行
  404. startRecording() {
  405. if (this.data.currentRow == null) {
  406. this.setData({
  407. currentRow: 0
  408. })
  409. }
  410. let row = this.data.article[this.data.currentRow]
  411. if (!row.readTime) {
  412. return
  413. }
  414. this.setTimeoutObj = setTimeout(() => {
  415. this.setData({
  416. currentRow: ++this.data.currentRow
  417. })
  418. this.setData({
  419. scrollTop: this.rowH * this.data.currentRow
  420. })
  421. this.startRecording()
  422. },
  423. row.readTime);
  424. },
  425. // 视频播放结束
  426. videoEnd() {
  427. console.log('视频播放结束触发的');
  428. this.resetReading()
  429. },
  430. videoPlay() {
  431. if (this.data.state) {
  432. return
  433. }
  434. if (this.data.videoInfo.userReadExtend.resourcesType == 1) {
  435. if (this.data.exampleState) {
  436. this.setData({
  437. exampleState: false
  438. })
  439. return this.resultAudioContext.stop()
  440. }
  441. this.resultAudioContext.src = this.data.readingReset ? this.data.readDetail.tempFilePath : this.data.videoInfo.userRead.audioPath;
  442. setTimeout(() => {
  443. this.resultAudioContext.play();
  444. }, 200)
  445. this.setData({
  446. exampleState: true
  447. })
  448. } else {
  449. if (this.data.readingReset) {
  450. this.resultAudioContext.src = this.data.readDetail.tempFilePath;
  451. this.resultAudioContext.play();
  452. this.setData({
  453. muted: true,
  454. exampleState: true
  455. })
  456. } else {
  457. this.setData({
  458. muted: false,
  459. exampleState: true
  460. })
  461. }
  462. this.setData({
  463. videoPath: this.data.videoInfo.userRead.videoPath
  464. })
  465. wx.nextTick(() => {
  466. this.videoContext.play()
  467. })
  468. }
  469. submitPlayLog({
  470. userReadId: this.data.videoInfo.userRead.exampleId,
  471. playStopTime: 1000
  472. })
  473. },
  474. // 控制视频或音频的播放状态
  475. async playMediaState() {
  476. console.log('触发');
  477. this.setData({
  478. muted: false
  479. })
  480. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  481. this.setData({
  482. videoPath: this.data.videoInfo.userRead.originVideo
  483. })
  484. wx.nextTick(() => {
  485. this.videoContext.play()
  486. })
  487. } else {
  488. this.innerAudioContext.play();
  489. }
  490. await userEvent({
  491. action: 'READING',
  492. readId: this.data.videoInfo.userRead.id
  493. })
  494. },
  495. // 重置一切状态
  496. resetReading() {
  497. clearTimeout(this.setTimeoutObj)
  498. clearInterval(this.stl)
  499. // 重置视频
  500. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  501. this.videoContext.stop()
  502. this.videoContext.seek(0)
  503. }
  504. // 重置试听音频
  505. if (this.data.exampleState) {
  506. this.resultAudioContext.stop()
  507. // 重置录音时的背景音乐
  508. this.innerAudioContext.stop();
  509. console.log('是我暂停了');
  510. }
  511. if (this.data.state) {
  512. // 重置录音时的背景音乐
  513. this.innerAudioContext.stop();
  514. /*微信录音结束*/
  515. recorderManager.stop();
  516. }
  517. this.setData({
  518. exampleState: false,
  519. state: false,
  520. currentRow: null,
  521. scrollTop: 0,
  522. ["silderData.sliderValue"]: 0,
  523. ["silderData.currentTime"]: '00:00'
  524. })
  525. },
  526. // 获取设备高度与行高度
  527. getHeight() {
  528. var query = wx.createSelectorQuery();
  529. query.select('.content').boundingClientRect((rect) => {
  530. this.setData({
  531. contentH: rect.height
  532. })
  533. }).exec()
  534. query.select('.row').boundingClientRect((rect) => {
  535. this.rowH = rect.height
  536. }).exec()
  537. },
  538. // 进度条
  539. slider({
  540. detail
  541. }) {
  542. this.resultAudioContext.pause();
  543. console.log(detail.value / 100 * this.data.videoInfo.userRead.duration)
  544. this.resultAudioContext.seek(detail.value / 100 * this.data.videoInfo.userRead.duration)
  545. setTimeout(() => {
  546. this.resultAudioContext.play()
  547. }, 300)
  548. },
  549. onHide() {
  550. this.resetReading()
  551. },
  552. onUnload() {
  553. this.resetReading()
  554. this.storeBindings.destroyStoreBindings()
  555. },
  556. creatShare() {
  557. return new Promise((resolve, reject) => {
  558. let video = this.data.videoInfo
  559. let context = wx.createSelectorQuery();
  560. context
  561. .select('#share')
  562. .fields({
  563. node: true,
  564. size: true
  565. }).exec((res) => {
  566. const canvas = res[0].node;
  567. const ctx = canvas.getContext('2d');
  568. const dpr = wx.getSystemInfoSync().pixelRatio;
  569. canvas.width = res[0].width * dpr;
  570. canvas.height = res[0].height * dpr;
  571. ctx.scale(dpr, dpr);
  572. ctx.font = '14px PingFang';
  573. let pic = canvas.createImage();
  574. pic.src = video.userReadExtend && video.userReadExtend.resourcesType == 1 ? video.userReadExtend.backgroundVirtualImg : video.userRead.coverImg;
  575. pic.onload = () => {
  576. ctx.drawImage(pic, 0, 0, 375, 211);
  577. let peiyin = canvas.createImage();
  578. peiyin.src = '/static/peiyin.jpg';
  579. peiyin.onload = () => {
  580. ctx.drawImage(peiyin, 0, 211, 375, 89);
  581. //分享
  582. let fx = canvas.createImage();
  583. fx.src = '/static/share.png'
  584. fx.onload = () => {
  585. ctx.drawImage(fx, 12, 220, 20, 20)
  586. ctx.fillText('分享', 36, 238)
  587. // 收藏,一个一个渲染
  588. let sc = canvas.createImage();
  589. sc.src = '/static/no_collect.png'
  590. sc.onload = () => {
  591. ctx.drawImage(sc, 110, 220, 19, 19)
  592. ctx.fillText('收藏', 134, 238)
  593. //点赞
  594. let dz = canvas.createImage();
  595. dz.src = '/static/heart.png'
  596. dz.onload = () => {
  597. ctx.drawImage(dz, 318, 222, 22, 22)
  598. ctx.fillText(0, 254, 238)
  599. // 评论
  600. let pl = canvas.createImage();
  601. pl.src = '/static/comment.png'
  602. pl.onload = () => {
  603. ctx.drawImage(pl, 228, 222, 22, 22)
  604. ctx.fillText(0, 340, 238)
  605. if (video.userReadExtend.resourcesType == 1) {
  606. let aBg = canvas.createImage();
  607. aBg.src = '/static/shareAudioBg.png';
  608. aBg.onload = () => {
  609. ctx.drawImage(aBg, 127.5, 38, 120, 120);
  610. let rate = 0.5
  611. ctx.arc(
  612. Math.floor(375 * rate),
  613. 98,
  614. Math.floor(100 * rate),
  615. 0,
  616. 2 * Math.PI
  617. );
  618. ctx.clip() //裁剪
  619. let coverImg = canvas.createImage();
  620. coverImg.src = video.userRead.coverImg;
  621. coverImg.onload = () => {
  622. ctx.drawImage( //定位在圆圈范围内便会出现
  623. coverImg, //图片暂存路径
  624. 129, 42,
  625. 110, 110,
  626. );
  627. ctx.restore()
  628. }
  629. }
  630. }
  631. setTimeout(() => {
  632. wx.canvasToTempFilePath({
  633. canvas: canvas,
  634. success(res) {
  635. resolve({
  636. title: '我的新作品发布啦,快来捧场点赞!',
  637. path: `/pages/pkPage/index?videoId=${wx.getStorageSync('shareVideoId')}&uid=${wx.getStorageSync('uid')}&isShare=true`,
  638. imageUrl: res.tempFilePath
  639. })
  640. },
  641. fail(res) {
  642. reject()
  643. }
  644. }, this)
  645. }, 500)
  646. }
  647. }
  648. }
  649. }
  650. }
  651. }
  652. })
  653. })
  654. },
  655. onShareAppMessage({
  656. from,
  657. target
  658. }) {
  659. if (from == 'button') {
  660. const promise = new Promise(resolve => {
  661. this.creatShare().then(res => {
  662. resolve(res)
  663. })
  664. })
  665. return {
  666. title: '我的新作品发布啦,快来捧场点赞!',
  667. path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
  668. imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-1.jpg',
  669. promise
  670. }
  671. } else {
  672. return {
  673. title: '自从用了它,家里朗朗书声,美妙极了!你家孩子也快来试试!',
  674. path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
  675. imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-1.jpg'
  676. }
  677. }
  678. },
  679. })