wui-components-v2 1.1.37 → 1.1.39

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.
@@ -1,4 +1,4 @@
1
- <script setup>
1
+ <script setup lang="ts">
2
2
  import { computed, defineEmits, defineExpose, defineOptions, defineProps, ref, watch } from 'vue'
3
3
  import { useManualTheme } from '../../composables/useManualTheme'
4
4
 
@@ -17,7 +17,7 @@ const props = defineProps({
17
17
  })
18
18
  const emit = defineEmits(['play', 'pause'])
19
19
  const { primary } = useManualTheme()
20
- const innerAudioContext = ref(null)
20
+ const innerAudioContext = ref<UniApp.InnerAudioContext | null>(null)
21
21
  const isPlaying = ref(false)
22
22
  const currentTime = ref(0)
23
23
  const duration = ref(0)
@@ -28,7 +28,7 @@ const progressPercent = computed(() => {
28
28
  })
29
29
 
30
30
  // 格式化时间显示
31
- function formatTime(seconds) {
31
+ function formatTime(seconds:any) {
32
32
  if (Number.isNaN(seconds))
33
33
  return '00:00'
34
34
  const mins = Math.floor(seconds / 60)
@@ -53,8 +53,8 @@ function initAudio() {
53
53
  })
54
54
 
55
55
  innerAudioContext.value.onTimeUpdate(() => {
56
- currentTime.value = innerAudioContext.value.currentTime
57
- duration.value = innerAudioContext.value.duration
56
+ currentTime.value = innerAudioContext.value?.currentTime||0
57
+ duration.value = innerAudioContext.value?.duration||0
58
58
  })
59
59
 
60
60
  innerAudioContext.value.onError((err) => {
@@ -73,7 +73,7 @@ function initAudio() {
73
73
  function play() {
74
74
  if (!innerAudioContext.value)
75
75
  initAudio()
76
- innerAudioContext.value.play()
76
+ innerAudioContext.value?.play()
77
77
  }
78
78
 
79
79
  function pause() {
@@ -46,7 +46,7 @@ const comEnums=computed(()=>{
46
46
  return {
47
47
  id:item.id,
48
48
  label:item.title,
49
- value:`${item.id}@R@${item.value}`
49
+ value:`${item.id}-R-${item.value}`
50
50
  }
51
51
  })
52
52
 
@@ -4,7 +4,7 @@ import type { Columns, Entities } from '../../type'
4
4
  import { downloadFile, formatItemData } from '../../utils'
5
5
  import ControlTypeSupportor from '../../utils/control-type-supportor'
6
6
  import VideoPlay from '../video-play/video-play.vue'
7
- import AudioPlay from '../audio-play/audio-play.vue'
7
+ import audioPlay from '../audio-play/audio-play.vue'
8
8
  import { useManualTheme } from '../../composables/useManualTheme'
9
9
  import openValueMore from './open-value-more.vue'
10
10
 
@@ -74,7 +74,7 @@ function isControlType(item: Columns): string {
74
74
  v-else-if="['mp3', 'wma', 'wav', 'aac', 'ogg', 'flac', 'm4a', 'amr'].includes(uitem.type)"
75
75
  style="display: flex;align-items: center;justify-content: center;"
76
76
  >
77
- <AudioPlay :src="uitem.url" />
77
+ <audioPlay :src="uitem.url" />
78
78
  </view>
79
79
  <!-- 文件 -->
80
80
  <view v-else-if="['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'txt', 'zip', 'rar', '7z', 'gz', 'bz2', 'tar', 'iso', 'exe', 'dmg', 'apk', 'apk', 'apk', 'apk', 'apk', 'apk', 'apk', 'apk'].includes(uitem.type)">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wui-components-v2",
3
- "version": "1.1.37",
3
+ "version": "1.1.39",
4
4
  "description": "wui 组件库",
5
5
  "author": "wgxshh",
6
6
  "license": "MIT",