index.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683
  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.8
  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. console.log('评测结果:', res);
  316. const result = res.result;
  317. const integrity = Math.floor(result.integrity); //完成度
  318. const tone = Math.floor(result.tone); // 语调声调
  319. const accuracy = Math.floor(result.accuracy); // 准确度 发音分
  320. const fluency = Math.floor(result.fluency.overall); //流利度
  321. let myOverall = Math.floor(integrity * 0.3 + accuracy * 0.5 + fluency * 0.1 + tone * 0.1);
  322. let detail = {
  323. integrity,
  324. tone,
  325. accuracy,
  326. fluency,
  327. myOverall,
  328. tempFilePath: this.data.tempFilePath,
  329. title: this.data.videoInfo.userRead.title,
  330. id: this.data.videoInfo.userRead.exampleId,
  331. coverImg: this.data.videoInfo.userRead.coverImg,
  332. resourcesType: this.data.videoInfo.userReadExtend.resourcesType,
  333. aBg: this.data.videoInfo.userReadExtend.resourcesType == 1 ? this.data.videoInfo.userReadExtend.backgroundVirtualImg : '',
  334. originVideo: this.data.videoInfo.userRead.originVideo
  335. }
  336. this.setReadDetail(detail)
  337. if (this.data.readingType == 'public' || this.data.readingType == 'readMatch') {
  338. wx.redirectTo({
  339. url: `/pages/score/index?readingType=${this.data.readingType}`
  340. })
  341. } else {
  342. this.uploadAudio(detail)
  343. }
  344. },
  345. // 挑战录音上传
  346. uploadAudio(detail) {
  347. this.setData({
  348. uploadState: true
  349. })
  350. const uploadTask = wx.uploadFile({
  351. url: 'https://reader-api.ai160.com//file/upload',
  352. filePath: this.data.tempFilePath,
  353. name: '朗读录音',
  354. header: {
  355. uid: wx.getStorageSync('uid')
  356. },
  357. success: async (res) => {
  358. const formateRes = JSON.parse(res.data);
  359. let audioPath = formateRes.data;
  360. let uploadRes = await publishWorks({
  361. exampleId: this.data.pkData.exampleId,
  362. audioPath
  363. })
  364. let _data = this.data.readDetail
  365. console.log('挑战分数-----', {
  366. "userReadId": uploadRes.id,
  367. "complete": _data.integrity,
  368. "accuracy": _data.accuracy,
  369. "speed": _data.fluency,
  370. "intonation": _data.tone,
  371. "score": _data.myOverall
  372. });
  373. postWorksScore({
  374. "userReadId": uploadRes.id,
  375. "complete": _data.integrity,
  376. "accuracy": _data.accuracy,
  377. "speed": _data.fluency,
  378. "intonation": _data.tone,
  379. "score": _data.myOverall
  380. })
  381. let data = {
  382. challengerUserReadId: uploadRes.id,
  383. userReadId: this.data.pkData.id,
  384. winnerUId: this.data.pkData.score > _data.myOverall ? this.data.pkData.uid : this.data.pkData.score == _data.myOverall ? '' : wx.getStorageSync('uid')
  385. }
  386. console.log('uploadPk-----', data);
  387. let result = await uploadPk(data)
  388. wx.redirectTo({
  389. url: `/pages/pkResult/index?id=${result.id}`
  390. })
  391. },
  392. complete: () => {
  393. this.setData({
  394. uploadState: false
  395. })
  396. }
  397. });
  398. uploadTask.onProgressUpdate((res) => {
  399. this.setData({
  400. percent: res.progress
  401. })
  402. })
  403. },
  404. // 字体换行
  405. startRecording() {
  406. if (this.data.currentRow == null) {
  407. this.setData({
  408. currentRow: 0
  409. })
  410. }
  411. let row = this.data.article[this.data.currentRow]
  412. if (!row.readTime) {
  413. return
  414. }
  415. this.setTimeoutObj = setTimeout(() => {
  416. this.setData({
  417. currentRow: ++this.data.currentRow
  418. })
  419. this.setData({
  420. scrollTop: this.rowH * this.data.currentRow
  421. })
  422. this.startRecording()
  423. },
  424. row.readTime);
  425. },
  426. // 视频播放结束
  427. videoEnd() {
  428. console.log('视频播放结束触发的');
  429. this.resetReading()
  430. },
  431. videoPlay() {
  432. if (this.data.state) {
  433. return
  434. }
  435. if (this.data.videoInfo.userReadExtend.resourcesType == 1) {
  436. if (this.data.exampleState) {
  437. this.setData({
  438. exampleState: false
  439. })
  440. return this.resultAudioContext.stop()
  441. }
  442. this.resultAudioContext.src = this.data.readingReset ? this.data.readDetail.tempFilePath : this.data.videoInfo.userRead.audioPath;
  443. setTimeout(() => {
  444. this.resultAudioContext.play();
  445. }, 200)
  446. this.setData({
  447. exampleState: true
  448. })
  449. } else {
  450. if (this.data.readingReset) {
  451. this.resultAudioContext.src = this.data.readDetail.tempFilePath;
  452. this.resultAudioContext.play();
  453. this.setData({
  454. muted: true,
  455. exampleState: true
  456. })
  457. } else {
  458. this.setData({
  459. muted: false,
  460. exampleState: true
  461. })
  462. }
  463. this.setData({
  464. videoPath: this.data.videoInfo.userRead.videoPath
  465. })
  466. wx.nextTick(() => {
  467. this.videoContext.play()
  468. })
  469. }
  470. submitPlayLog({
  471. userReadId: this.data.videoInfo.userRead.exampleId,
  472. playStopTime: 1000
  473. })
  474. },
  475. // 控制视频或音频的播放状态
  476. async playMediaState() {
  477. console.log('触发');
  478. this.setData({
  479. muted: false
  480. })
  481. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  482. this.setData({
  483. videoPath: this.data.videoInfo.userRead.originVideo
  484. })
  485. wx.nextTick(() => {
  486. this.videoContext.play()
  487. })
  488. } else {
  489. this.innerAudioContext.play();
  490. }
  491. await userEvent({
  492. action: 'READING',
  493. readId: this.data.videoInfo.userRead.id
  494. })
  495. },
  496. // 重置一切状态
  497. resetReading() {
  498. clearTimeout(this.setTimeoutObj)
  499. clearInterval(this.stl)
  500. // 重置视频
  501. if (this.data.videoInfo.userReadExtend.resourcesType == 0) {
  502. this.videoContext.stop()
  503. this.videoContext.seek(0)
  504. }
  505. // 重置试听音频
  506. if (this.data.exampleState) {
  507. this.resultAudioContext.stop()
  508. // 重置录音时的背景音乐
  509. this.innerAudioContext.stop();
  510. console.log('是我暂停了');
  511. }
  512. if (this.data.state) {
  513. // 重置录音时的背景音乐
  514. this.innerAudioContext.stop();
  515. /*微信录音结束*/
  516. recorderManager.stop();
  517. }
  518. this.setData({
  519. exampleState: false,
  520. state: false,
  521. currentRow: null,
  522. scrollTop: 0,
  523. ["silderData.sliderValue"]: 0,
  524. ["silderData.currentTime"]: '00:00'
  525. })
  526. },
  527. // 获取设备高度与行高度
  528. getHeight() {
  529. var query = wx.createSelectorQuery();
  530. query.select('.content').boundingClientRect((rect) => {
  531. this.setData({
  532. contentH: rect.height
  533. })
  534. }).exec()
  535. query.select('.row').boundingClientRect((rect) => {
  536. this.rowH = rect.height
  537. }).exec()
  538. },
  539. // 进度条
  540. slider({
  541. detail
  542. }) {
  543. this.resultAudioContext.pause();
  544. console.log(detail.value / 100 * this.data.videoInfo.userRead.duration)
  545. this.resultAudioContext.seek(detail.value / 100 * this.data.videoInfo.userRead.duration)
  546. setTimeout(() => {
  547. this.resultAudioContext.play()
  548. }, 300)
  549. },
  550. onHide() {
  551. this.resetReading()
  552. },
  553. onUnload() {
  554. this.resetReading()
  555. this.storeBindings.destroyStoreBindings()
  556. },
  557. creatShare() {
  558. return new Promise((resolve, reject) => {
  559. let video = this.data.videoInfo
  560. let context = wx.createSelectorQuery();
  561. context
  562. .select('#share')
  563. .fields({
  564. node: true,
  565. size: true
  566. }).exec((res) => {
  567. const canvas = res[0].node;
  568. const ctx = canvas.getContext('2d');
  569. const dpr = wx.getSystemInfoSync().pixelRatio;
  570. canvas.width = res[0].width * dpr;
  571. canvas.height = res[0].height * dpr;
  572. ctx.scale(dpr, dpr);
  573. ctx.font = '14px PingFang';
  574. let pic = canvas.createImage();
  575. pic.src = video.userReadExtend && video.userReadExtend.resourcesType == 1 ? video.userReadExtend.backgroundVirtualImg : video.userRead.coverImg;
  576. pic.onload = () => {
  577. ctx.drawImage(pic, 0, 0, 375, 211);
  578. let peiyin = canvas.createImage();
  579. peiyin.src = '/static/peiyin.jpg';
  580. peiyin.onload = () => {
  581. ctx.drawImage(peiyin, 0, 211, 375, 89);
  582. //分享
  583. let fx = canvas.createImage();
  584. fx.src = '/static/share.png'
  585. fx.onload = () => {
  586. ctx.drawImage(fx, 12, 220, 20, 20)
  587. ctx.fillText('分享', 36, 238)
  588. // 收藏,一个一个渲染
  589. let sc = canvas.createImage();
  590. sc.src = '/static/no_collect.png'
  591. sc.onload = () => {
  592. ctx.drawImage(sc, 110, 220, 19, 19)
  593. ctx.fillText('收藏', 134, 238)
  594. //点赞
  595. let dz = canvas.createImage();
  596. dz.src = '/static/heart.png'
  597. dz.onload = () => {
  598. ctx.drawImage(dz, 318, 222, 22, 22)
  599. ctx.fillText(0, 254, 238)
  600. // 评论
  601. let pl = canvas.createImage();
  602. pl.src = '/static/comment.png'
  603. pl.onload = () => {
  604. ctx.drawImage(pl, 228, 222, 22, 22)
  605. ctx.fillText(0, 340, 238)
  606. if (video.userReadExtend.resourcesType == 1) {
  607. let aBg = canvas.createImage();
  608. aBg.src = '/static/shareAudioBg.png';
  609. aBg.onload = () => {
  610. ctx.drawImage(aBg, 127.5, 38, 120, 120);
  611. let rate = 0.5
  612. ctx.arc(
  613. Math.floor(375 * rate),
  614. 98,
  615. Math.floor(100 * rate),
  616. 0,
  617. 2 * Math.PI
  618. );
  619. ctx.clip() //裁剪
  620. let coverImg = canvas.createImage();
  621. coverImg.src = video.userRead.coverImg;
  622. coverImg.onload = () => {
  623. ctx.drawImage( //定位在圆圈范围内便会出现
  624. coverImg, //图片暂存路径
  625. 129, 42,
  626. 110, 110,
  627. );
  628. ctx.restore()
  629. }
  630. }
  631. }
  632. setTimeout(() => {
  633. wx.canvasToTempFilePath({
  634. canvas: canvas,
  635. success(res) {
  636. resolve({
  637. title: '我的新作品发布啦,快来捧场点赞!',
  638. path: `/pages/pkPage/index?videoId=${wx.getStorageSync('shareVideoId')}&uid=${wx.getStorageSync('uid')}`,
  639. imageUrl: res.tempFilePath
  640. })
  641. },
  642. fail(res) {
  643. reject()
  644. }
  645. }, this)
  646. }, 500)
  647. }
  648. }
  649. }
  650. }
  651. }
  652. }
  653. })
  654. })
  655. },
  656. onShareAppMessage({
  657. from,
  658. target
  659. }) {
  660. if (from == 'button') {
  661. const promise = new Promise(resolve => {
  662. this.creatShare().then(res => {
  663. resolve(res)
  664. })
  665. })
  666. return {
  667. title: '我的新作品发布啦,快来捧场点赞!',
  668. path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
  669. imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-1.jpg',
  670. promise
  671. }
  672. } else {
  673. return {
  674. title: '自从用了它,家里朗朗书声,美妙极了!你家孩子也快来试试!',
  675. path: `/pages/index/index?uid=${wx.getStorageSync('uid')}`,
  676. imageUrl: 'http://reader-wx.ai160.com/images/reader/v3/375-300-1.jpg'
  677. }
  678. }
  679. },
  680. })