byt-lingxiao-ai 0.3.23 → 0.3.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -94,6 +94,7 @@ export default {
94
94
  initialX: 10,
95
95
  initialY: 20,
96
96
  hasMoved: false,
97
+ timeJumpPoints: []
97
98
  }
98
99
  },
99
100
  computed: {
@@ -117,6 +118,8 @@ export default {
117
118
  this.appendToBodyHandler()
118
119
  }
119
120
 
121
+ this.fetchTimeJumpPoints()
122
+
120
123
  this.$nextTick(() => {
121
124
  const chatEl = this.$el;
122
125
  const style = window.getComputedStyle(chatEl);
@@ -219,42 +222,47 @@ export default {
219
222
  }
220
223
  })
221
224
  },
225
+ async fetchTimeJumpPoints() {
226
+ try {
227
+ const res = await fetch(TIME_JUMP_POINTS_URL)
228
+ const data = await res.json()
229
+ this.timeJumpPoints = Array.isArray(data) ? data : []
230
+ console.log('时间跳转点加载完成:', this.timeJumpPoints)
231
+ } catch (err) {
232
+ console.error('获取时间跳转点失败:', err)
233
+ this.timeJumpPoints = []
234
+ }
235
+ },
222
236
  // 音频时间更新处理
223
237
  onTimeUpdate() {
224
238
  const audio = this.$refs.audioPlayer
225
239
  const currentTime = audio.currentTime
226
240
 
227
- if (!this.jumpedTimePoints) {
228
- this.jumpedTimePoints = new Set()
229
- }
241
+ if (!this.timeJumpPoints.length) return
242
+
243
+ this.timeJumpPoints.forEach(point => {
244
+ if (
245
+ currentTime >= point.time &&
246
+ currentTime < point.time + 1 &&
247
+ !this.jumpedTimePoints.has(point.time)
248
+ ) {
249
+ console.log('触发跳转:', point.url)
230
250
 
231
- fetch(TIME_JUMP_POINTS_URL)
232
- .then(response => response.json())
233
- .then(data => {
234
- console.log('时间跳转点:', data)
235
- console.log('当前时间:', currentTime)
236
- data.forEach(point => {
237
- console.log('跳转点:', point)
238
- console.log('跳转时间:', point.time)
239
- console.log('当前时间:', currentTime)
240
- console.log('是否已跳转:', this.jumpedTimePoints.has(point.time))
241
- console.log('跳转时间范围:', currentTime >= point.time && currentTime < point.time + 1)
242
- if (currentTime >= point.time && currentTime < point.time + 1 && !this.jumpedTimePoints.has(point.time)) {
243
- this.jumpedTimePoints.add(point.time)
244
- this.$appOptions.store.dispatch('tags/addTagview', {
245
- path: point.url,
246
- fullPath: point.url,
247
- label: point.title,
248
- name: point.title,
249
- meta: { title: point.title },
250
- query: {},
251
- params: {}
252
- })
253
- this.$appOptions.router.push({ path: point.url })
254
- }
251
+ this.jumpedTimePoints.add(point.time)
252
+
253
+ this.$appOptions.store.dispatch('tags/addTagview', {
254
+ path: point.url,
255
+ fullPath: point.url,
256
+ label: point.title,
257
+ name: point.title,
258
+ meta: { title: point.title },
259
+ query: {},
260
+ params: {}
255
261
  })
256
- })
257
- .catch(error => console.error('获取时间跳转点失败:', error))
262
+
263
+ this.$appOptions.router.push({ path: point.url })
264
+ }
265
+ })
258
266
  },
259
267
  onAudioEnded() {
260
268
  this.robotStatus = 'leaving'
@@ -14,7 +14,9 @@ export default {
14
14
  try {
15
15
  // this.ws = new WebSocket('ws://10.2.233.41:9999');
16
16
  // 测试
17
+ // console.log('WS_URL:', WS_URL)
17
18
  this.ws = new WebSocket(WS_URL);
19
+ // this.ws = new WebSocket('ws://192.168.8.87/audio/ws/');
18
20
  this.ws.binaryType = 'arraybuffer';
19
21
 
20
22
  this.ws.onopen = async () => {
@@ -28604,7 +28604,7 @@ if (typeof window !== 'undefined') {
28604
28604
  var es_iterator_constructor = __webpack_require__(8111);
28605
28605
  // EXTERNAL MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
28606
28606
  var es_iterator_for_each = __webpack_require__(7588);
28607
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=template&id=244aa1c1&scoped=true
28607
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=template&id=67cef8d6&scoped=true
28608
28608
  var render = function render() {
28609
28609
  var _vm = this,
28610
28610
  _c = _vm._self._c;
@@ -31527,7 +31527,9 @@ const TIME_JUMP_POINTS_URL = '/minio/lingxiaoai/timeJumpPoints.json'; // 语音u
31527
31527
  try {
31528
31528
  // this.ws = new WebSocket('ws://10.2.233.41:9999');
31529
31529
  // 测试
31530
+ // console.log('WS_URL:', WS_URL)
31530
31531
  this.ws = new WebSocket(WS_URL);
31532
+ // this.ws = new WebSocket('ws://192.168.8.87/audio/ws/');
31531
31533
  this.ws.binaryType = 'arraybuffer';
31532
31534
  this.ws.onopen = async () => {
31533
31535
  console.log('WebSocket 连接成功');
@@ -32010,7 +32012,8 @@ const startTime = null;
32010
32012
  currentY: 20,
32011
32013
  initialX: 10,
32012
32014
  initialY: 20,
32013
- hasMoved: false
32015
+ hasMoved: false,
32016
+ timeJumpPoints: []
32014
32017
  };
32015
32018
  },
32016
32019
  computed: {
@@ -32033,6 +32036,7 @@ const startTime = null;
32033
32036
  if (this.appendToBody) {
32034
32037
  this.appendToBodyHandler();
32035
32038
  }
32039
+ this.fetchTimeJumpPoints();
32036
32040
  this.$nextTick(() => {
32037
32041
  const chatEl = this.$el;
32038
32042
  const style = window.getComputedStyle(chatEl);
@@ -32129,41 +32133,42 @@ const startTime = null;
32129
32133
  }
32130
32134
  });
32131
32135
  },
32136
+ async fetchTimeJumpPoints() {
32137
+ try {
32138
+ const res = await fetch(TIME_JUMP_POINTS_URL);
32139
+ const data = await res.json();
32140
+ this.timeJumpPoints = Array.isArray(data) ? data : [];
32141
+ console.log('时间跳转点加载完成:', this.timeJumpPoints);
32142
+ } catch (err) {
32143
+ console.error('获取时间跳转点失败:', err);
32144
+ this.timeJumpPoints = [];
32145
+ }
32146
+ },
32132
32147
  // 音频时间更新处理
32133
32148
  onTimeUpdate() {
32134
32149
  const audio = this.$refs.audioPlayer;
32135
32150
  const currentTime = audio.currentTime;
32136
- if (!this.jumpedTimePoints) {
32137
- this.jumpedTimePoints = new Set();
32138
- }
32139
- fetch(TIME_JUMP_POINTS_URL).then(response => response.json()).then(data => {
32140
- console.log('时间跳转点:', data);
32141
- console.log('当前时间:', currentTime);
32142
- data.forEach(point => {
32143
- console.log('跳转点:', point);
32144
- console.log('跳转时间:', point.time);
32145
- console.log('当前时间:', currentTime);
32146
- console.log('是否已跳转:', this.jumpedTimePoints.has(point.time));
32147
- console.log('跳转时间范围:', currentTime >= point.time && currentTime < point.time + 1);
32148
- if (currentTime >= point.time && currentTime < point.time + 1 && !this.jumpedTimePoints.has(point.time)) {
32149
- this.jumpedTimePoints.add(point.time);
32150
- this.$appOptions.store.dispatch('tags/addTagview', {
32151
- path: point.url,
32152
- fullPath: point.url,
32153
- label: point.title,
32154
- name: point.title,
32155
- meta: {
32156
- title: point.title
32157
- },
32158
- query: {},
32159
- params: {}
32160
- });
32161
- this.$appOptions.router.push({
32162
- path: point.url
32163
- });
32164
- }
32165
- });
32166
- }).catch(error => console.error('获取时间跳转点失败:', error));
32151
+ if (!this.timeJumpPoints.length) return;
32152
+ this.timeJumpPoints.forEach(point => {
32153
+ if (currentTime >= point.time && currentTime < point.time + 1 && !this.jumpedTimePoints.has(point.time)) {
32154
+ console.log('触发跳转:', point.url);
32155
+ this.jumpedTimePoints.add(point.time);
32156
+ this.$appOptions.store.dispatch('tags/addTagview', {
32157
+ path: point.url,
32158
+ fullPath: point.url,
32159
+ label: point.title,
32160
+ name: point.title,
32161
+ meta: {
32162
+ title: point.title
32163
+ },
32164
+ query: {},
32165
+ params: {}
32166
+ });
32167
+ this.$appOptions.router.push({
32168
+ path: point.url
32169
+ });
32170
+ }
32171
+ });
32167
32172
  },
32168
32173
  onAudioEnded() {
32169
32174
  this.robotStatus = 'leaving';
@@ -32174,10 +32179,10 @@ const startTime = null;
32174
32179
  });
32175
32180
  ;// ./components/ChatWindow.vue?vue&type=script&lang=js
32176
32181
  /* harmony default export */ var components_ChatWindowvue_type_script_lang_js = (ChatWindowvue_type_script_lang_js);
32177
- ;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=style&index=0&id=244aa1c1&prod&scoped=true&lang=css
32182
+ ;// ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-12.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-12.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-12.use[2]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./components/ChatWindow.vue?vue&type=style&index=0&id=67cef8d6&prod&scoped=true&lang=css
32178
32183
  // extracted by mini-css-extract-plugin
32179
32184
 
32180
- ;// ./components/ChatWindow.vue?vue&type=style&index=0&id=244aa1c1&prod&scoped=true&lang=css
32185
+ ;// ./components/ChatWindow.vue?vue&type=style&index=0&id=67cef8d6&prod&scoped=true&lang=css
32181
32186
 
32182
32187
  ;// ./components/ChatWindow.vue
32183
32188
 
@@ -32194,7 +32199,7 @@ var ChatWindow_component = normalizeComponent(
32194
32199
  staticRenderFns,
32195
32200
  false,
32196
32201
  null,
32197
- "244aa1c1",
32202
+ "67cef8d6",
32198
32203
  null
32199
32204
 
32200
32205
  )