Compare commits

..

6 Commits

Author SHA1 Message Date
82e14bb969 无感处理墨册SAAS化加好友需求遗漏代码,等待后续上线通知
Some checks failed
Check / lint (push) Has been cancelled
Check / typecheck (push) Has been cancelled
Check / build (build, 18.x, ubuntu-latest) (push) Has been cancelled
Check / build (build, 18.x, windows-latest) (push) Has been cancelled
Check / build (build:app, 18.x, ubuntu-latest) (push) Has been cancelled
Check / build (build:app, 18.x, windows-latest) (push) Has been cancelled
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Has been cancelled
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Has been cancelled
2025-06-30 14:07:18 +08:00
6ae597c7f4 体制外正式环境为特殊账户开启控制台
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
2025-06-30 13:47:09 +08:00
94ef829509 无感处理墨册SAAS化加好友需求部分代码,等待后续上线通知
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
2025-06-30 13:26:36 +08:00
16c881acfd 处理语音时长显示格式
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
2025-06-30 10:30:43 +08:00
d3164014ee 重构语音播放动画和展示效果;解决复制语音转文字内容错误问题;增加语音转文字loading
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run
2025-06-30 09:22:24 +08:00
d81bfad19d 抽出所有向OA的Webview通信的方法并封装,统一向所有的webview广播,解决webviewId动态分配导致指定Id时有极小几率不是目标webview导致业务无法继续的问题 2025-06-26 19:06:51 +08:00
58 changed files with 758 additions and 531 deletions

View File

@ -1,6 +1,7 @@
import request from '@/service/index.js' import request from '@/service/index.js'
import qs from 'qs' import qs from 'qs'
import { useTalkStore, useDialogueStore } from '@/store' import { useTalkStore, useDialogueStore } from '@/store'
import { handleFindWebview } from '@/utils/common'
// 获取聊天列表服务接口 // 获取聊天列表服务接口
export const ServeGetTalkList = (data) => { export const ServeGetTalkList = (data) => {
@ -46,23 +47,7 @@ export const ServeClearTalkUnreadNum = (data, unReadNum) => {
useTalkStore().findTalkIndex(useDialogueStore().index_name) useTalkStore().findTalkIndex(useDialogueStore().index_name)
]?.is_disturb ]?.is_disturb
) { ) {
if (typeof plus !== 'undefined') { handleFindWebview(`updateUnreadMsgNumReduce('${unReadNum}')`)
let OAWebView = plus.webview.all()
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`updateUnreadMsgNumReduce('${unReadNum}')`)
}
})
} else {
document.addEventListener('plusready', () => {
let OAWebView = plus.webview.all()
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`updateUnreadMsgNumReduce('${unReadNum}')`)
}
})
})
}
} }
return request({ return request({
url: '/api/v1/talk/unread/clear', url: '/api/v1/talk/unread/clear',
@ -83,7 +68,8 @@ export const ServeTalkRecords = (data) => {
// 获取转发会话记录详情列表服务接口 // 获取转发会话记录详情列表服务接口
export const ServeGetForwardRecords = (data) => { export const ServeGetForwardRecords = (data) => {
return request({ return request({
url: '/api/v1/talk/records/forward/v2', // url: '/api/v1/talk/records/forward/v2',
url: '/api/v1/talk/records/forward',
method: 'GET', method: 'GET',
data, data,
}) })

View File

@ -4,7 +4,8 @@ import qs from 'qs'
// ES搜索聊天记录-主页搜索什么都有 // ES搜索聊天记录-主页搜索什么都有
export const ServeSeachQueryAll = (data) => { export const ServeSeachQueryAll = (data) => {
return request({ return request({
url: '/api/v1/elasticsearch/query-all/v2', // url: '/api/v1/elasticsearch/query-all/v2',
url: '/api/v1/elasticsearch/query-all',
method: 'POST', method: 'POST',
data, data,
}) })
@ -13,7 +14,8 @@ export const ServeSeachQueryAll = (data) => {
// ES搜索用户数据 // ES搜索用户数据
export const ServeQueryUser = (data) => { export const ServeQueryUser = (data) => {
return request({ return request({
url: '/api/v1/elasticsearch/query-user/v2', // url: '/api/v1/elasticsearch/query-user/v2',
url: '/api/v1/elasticsearch/query-user',
method: 'POST', method: 'POST',
data, data,
}) })

View File

@ -3,8 +3,8 @@
<view <view
:id="popoverBoxId" :id="popoverBoxId"
class="popover-box" class="popover-box"
v-passive-end="onTouchend" @touchend="onTouchend"
v-passive-touch="onTouchstart" @touchstart="onTouchstart"
> >
<slot></slot> <slot></slot>
</view> </view>
@ -75,7 +75,7 @@
</view> </view>
<view <view
v-show="data.popoverShow" v-show="data.popoverShow"
v-passive-touch="close" @touchstart="close"
@click="close" @click="close"
class="popover-bg" class="popover-bg"
></view> ></view>

View File

@ -1,109 +1,155 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, onMounted } from "vue"; import { ref, reactive, onMounted, onUnmounted, computed } from 'vue'
import { PlayOne, PauseOne } from "@icon-park/vue-next"; import { PlayOne, PauseOne } from '@icon-park/vue-next'
import { ITalkRecordExtraAudio, ITalkRecord } from "@/types/chat"; import { ITalkRecordExtraAudio, ITalkRecord } from '@/types/chat'
import { onHide } from '@dcloudio/uni-app'
import aTrumpet from '@/uni_modules/a-trumpet/components/a-trumpet/a-trumpet.vue'
import { useUserStore } from '@/store'
const props = defineProps<{ const props = defineProps<{
extra: ITalkRecordExtraAudio; extra: ITalkRecordExtraAudio
data: ITalkRecord; data: ITalkRecord
maxWidth?: Boolean; maxWidth?: Boolean
}>(); }>()
const audioRef = ref(); const userStore = useUserStore()
const audioContext = ref<any>(null); const talkParams = reactive({
uid: computed(() => userStore.uid),
const durationDesc = ref("-"); })
const audioContext = ref<any>(null)
const durationDesc = ref('-')
const state = reactive({ const state = reactive({
isAudioPlay: false, isAudioPlay: false,
progress: 0, progress: 0,
duration: 0, duration: 0,
currentTime: 0, currentTime: 0,
loading: true, loading: true,
}); })
//
function onOtherAudioPlay(e) {
if (e.detail !== props.data.msg_id && state.isAudioPlay) {
audioContext.value.pause()
state.isAudioPlay = false
}
}
onMounted(() => { onMounted(() => {
// 使uni-app audioContext.value = uni.createInnerAudioContext()
audioContext.value = uni.createInnerAudioContext(); audioContext.value.src = props.extra.url
audioContext.value.src = props.extra.url;
audioContext.value.onCanplay(() => { audioContext.value.onCanplay(() => {
state.duration = audioContext.value.duration; state.duration = audioContext.value.duration
durationDesc.value = formatTime(parseInt(audioContext.value.duration)); durationDesc.value = formatTime(parseInt(audioContext.value.duration))
state.loading = false; state.loading = false
}); })
audioContext.value.onTimeUpdate(() => { audioContext.value.onTimeUpdate(() => {
if (audioContext.value.duration == 0) { if (audioContext.value.duration == 0) {
state.progress = 0; state.progress = 0
} else { } else {
state.currentTime = audioContext.value.currentTime; state.currentTime = audioContext.value.currentTime
state.progress = state.progress =
(audioContext.value.currentTime / audioContext.value.duration) * 100; (audioContext.value.currentTime / audioContext.value.duration) * 100
} }
}); })
audioContext.value.onEnded(() => { audioContext.value.onEnded(() => {
state.isAudioPlay = false; state.isAudioPlay = false
state.progress = 0; state.progress = 0
}); })
audioContext.value.onError((e) => { audioContext.value.onError((e) => {
console.log("音频播放异常===>", e); console.log('音频播放异常===>', e)
}); })
});
window.addEventListener('audio-play', onOtherAudioPlay)
})
onUnmounted(() => {
window.removeEventListener('audio-play', onOtherAudioPlay)
audioContext.value &&
audioContext.value.destroy &&
audioContext.value.destroy()
})
onHide(() => {
if (audioContext.value && audioContext.value.pause) {
audioContext.value.pause()
state.isAudioPlay = false
}
})
const onPlay = () => { const onPlay = () => {
if (state.isAudioPlay) { if (state.isAudioPlay) {
audioContext.value.pause(); audioContext.value.pause()
state.isAudioPlay = false
} else { } else {
audioContext.value.play(); //
window.dispatchEvent(
new CustomEvent('audio-play', { detail: props.data.msg_id }),
)
audioContext.value.play()
state.isAudioPlay = true
} }
}
state.isAudioPlay = !state.isAudioPlay;
};
const onPlayEnd = () => {
state.isAudioPlay = false;
state.progress = 0;
};
const formatTime = (value: number = 0) => { const formatTime = (value: number = 0) => {
if (value == 0) { if (value == 0) {
return "-"; return '-'
} }
const minutes = Math.floor(value / 60)
const minutes = Math.floor(value / 60); let seconds = value
let seconds = value;
if (minutes > 0) { if (minutes > 0) {
seconds = Math.floor(value - minutes * 60); seconds = Math.floor(value - minutes * 60)
} }
return `${minutes}'${seconds}"`
return `${minutes}'${seconds}"`; }
};
</script> </script>
<template> <template>
<div class="im-message-audio"> <div
<div class="play"> class="audio-message"
<div class="btn pointer" @click.stop="onPlay"> @click.stop="onPlay"
<n-icon :class="
:size="18" props?.data?.user_id == talkParams.uid
:component="state.isAudioPlay ? PauseOne : PlayOne" ? 'justify-end py-[22rpx] pl-[30rpx] pr-[16rpx]'
/> : 'justify-start py-[22rpx] pr-[30rpx] pl-[16rpx]'
</div> "
>
<a-trumpet
v-if="props?.data?.user_id != talkParams.uid"
:isPlay="state.isAudioPlay"
color="#C1C1C1"
:size="30"
></a-trumpet>
<div
:class="
props?.data?.user_id == talkParams.uid ? 'mr-[8rpx]' : 'ml-[8rpx]'
"
>
{{ Math.ceil(props?.extra?.duration / 1000) }}s
</div> </div>
<div class="desc"> <a-trumpet
<span class="line" v-for="i in 23" :key="i"></span> v-if="props?.data?.user_id == talkParams.uid"
<span :isPlay="state.isAudioPlay"
class="indicator" color="#C1C1C1"
:style="{ left: state.progress + '%' }" :size="30"
v-show="state.progress > 0" direction="left"
></span> ></a-trumpet>
</div>
<div class="time">{{ durationDesc }}</div>
</div> </div>
</template> </template>
<style lang="less" scoped> <style lang="less" scoped>
.audio-message {
display: flex;
flex-direction: row;
align-items: center;
width: 100%;
height: 100%;
background-color: #fff;
border-radius: 10px;
}
.im-message-audio { .im-message-audio {
--audio-bg-color: #f5f5f5; --audio-bg-color: #f5f5f5;
--audio-btn-bg-color: #ffffff; --audio-btn-bg-color: #ffffff;
@ -245,7 +291,7 @@ const formatTime = (value: number = 0) => {
} }
} }
html[theme-mode="dark"] { html[theme-mode='dark'] {
.im-message-audio { .im-message-audio {
--audio-bg-color: #2c2c32; --audio-bg-color: #2c2c32;
--audio-btn-bg-color: rgb(78, 75, 75); --audio-btn-bg-color: rgb(78, 75, 75);

View File

@ -92,8 +92,8 @@ defineExpose({
<tm-button <tm-button
@click="sendCancel" @click="sendCancel"
:width="319" :width="319"
v-passive-touch="cancel = false" @touchstart="cancel = false"
v-passive-end="cancel = true" @touchend="cancel = true"
:fontSize="32" :fontSize="32"
:height="112" :height="112"
:margin="[0]" :margin="[0]"
@ -107,8 +107,8 @@ defineExpose({
<div class="flex justify-center items-center text-[#CF3050]"> <div class="flex justify-center items-center text-[#CF3050]">
<tm-button <tm-button
@click="sendConfirm" @click="sendConfirm"
v-passive-touch="confirm = false" @touchstart="confirm = false"
v-passive-end="confirm = true" @touchend="confirm = true"
:width="319" :width="319"
:fontSize="32" :fontSize="32"
:transprent="confirm" :transprent="confirm"

View File

@ -34,7 +34,7 @@ class Connect {
// 更新 WebSocket 连接状态 // 更新 WebSocket 连接状态
useUserStore().updateSocketStatus(true) useUserStore().updateSocketStatus(true)
// online.value = true; // online.value = true;
uni.$emit('socket-refresh-talk-list') useTalkStore().loadTalkList()
}, },
// Websocket 断开连接回调方法 // Websocket 断开连接回调方法
onClose: () => { onClose: () => {

View File

@ -15,6 +15,7 @@ import {
useDialogueListStore, useDialogueListStore,
useGroupStore, useGroupStore,
} from '@/store' } from '@/store'
import { handleFindWebview } from '@/utils/common'
/** /**
* 好友状态事件 * 好友状态事件
@ -154,23 +155,7 @@ class Talk extends Base {
//更新未读数量+1 //更新未读数量+1
updateUnreadMsgNumAdd() { updateUnreadMsgNumAdd() {
if (typeof plus !== 'undefined') { handleFindWebview(`updateUnreadMsgNumAdd()`)
let OAWebView = plus.webview.all()
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`updateUnreadMsgNumAdd()`)
}
})
} else {
document.addEventListener('plusready', () => {
let OAWebView = plus.webview.all()
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`updateUnreadMsgNumAdd()`)
}
})
})
}
} }
/** /**

View File

@ -23,6 +23,7 @@ import {
useDialogueListStore, useDialogueListStore,
} from '@/store' } from '@/store'
import { uniStorage } from '@/utils/uniStorage.js' import { uniStorage } from '@/utils/uniStorage.js'
import { handleFindWebview } from '@/utils/common'
const { showMessage } = messagePopup() const { showMessage } = messagePopup()
dayjs.locale('zh-cn') dayjs.locale('zh-cn')
@ -52,51 +53,6 @@ export function createApp() {
}) })
}, },
}) })
//给touchstart事件添加passive属性
app.directive('passive-touch', {
mounted(el, binding) {
el._passiveTouchHandler = function (e) {
binding.value(e)
}
el.addEventListener('touchstart', el._passiveTouchHandler, {
passive: true,
})
},
unmounted(el) {
el.removeEventListener('touchstart', el._passiveTouchHandler)
delete el._passiveTouchHandler
},
})
// 给touchmove事件添加passive属性
app.directive('passive-move', {
mounted(el, binding) {
el._passiveTouchMoveHandler = function (e) {
binding.value(e)
}
el.addEventListener('touchmove', el._passiveTouchMoveHandler, {
passive: true,
})
},
unmounted(el) {
el.removeEventListener('touchmove', el._passiveTouchMoveHandler)
delete el._passiveTouchMoveHandler
},
})
// 给touchend事件添加passive属性
app.directive('passive-end', {
mounted(el, binding) {
el._passiveTouchEndHandler = function (e) {
binding.value(e)
}
el.addEventListener('touchend', el._passiveTouchEndHandler, {
passive: true,
})
},
unmounted(el) {
el.removeEventListener('touchend', el._passiveTouchEndHandler)
delete el._passiveTouchEndHandler
},
})
//获取当前聊天页面所在页面并通过当前的receiver_id判断是否要创建本地通知栏消息 //获取当前聊天页面所在页面并通过当前的receiver_id判断是否要创建本地通知栏消息
window.getCurrentChatRoute = (msg) => { window.getCurrentChatRoute = (msg) => {
@ -117,12 +73,7 @@ export function createApp() {
return return
} }
console.log('===准备创建本地通知栏消息') console.log('===准备创建本地通知栏消息')
let OAWebView = plus.webview.all() handleFindWebview(`doCreatePushMessage('${msg}')`)
OAWebView.forEach((webview, index) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`doCreatePushMessage('${msg}')`)
}
})
} }
//处理聊天推送弹窗点开 //处理聊天推送弹窗点开
@ -143,14 +94,14 @@ export function createApp() {
// 通讯录跳转 // 通讯录跳转
window.handleContacts = () => { window.handleContacts = () => {
// 旧版本-按组织架构树的通讯录 // 旧版本-按组织架构树的通讯录
// uni.navigateTo({ uni.navigateTo({
// url: '/pages/chooseByDeps/index?chooseMode=3&type=true' url: '/pages/chooseByDeps/index?chooseMode=3&type=true'
// }); });
// 新版本-按公司别、好友、群组的通讯录 // 新版本-按公司别、好友、群组的通讯录
uni.navigateTo({ // uni.navigateTo({
url: '/pages/addressBook/index?type=true', // url: '/pages/addressBook/index?type=true',
}) // })
} }
//处理OA、墨册强制刷新时聊天同步强制刷新 //处理OA、墨册强制刷新时聊天同步强制刷新
@ -164,12 +115,7 @@ export function createApp() {
//检查聊天页面是否可用 //检查聊天页面是否可用
window.checkChatWebviewAvailable = () => { window.checkChatWebviewAvailable = () => {
let OAWebView = plus.webview.all() handleFindWebview(`doneCheckChatWebviewAvailable()`)
OAWebView.forEach((webview, index) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`doneCheckChatWebviewAvailable()`)
}
})
} }
//获取从base传来的多选视频列表 //获取从base传来的多选视频列表
@ -182,6 +128,19 @@ export function createApp() {
} }
} }
//检查是否是特殊测试用户,开启控制台
const checkTestUser = () => {
const userStore = useUserStore()
if (
import.meta.env.VITE_SHOW_CONSOLE === 'false' &&
userStore.mobile == '18100591363'
) {
new VConsole()
}
}
checkTestUser()
window.message = ['success', 'error', 'warning'].reduce((acc, type) => { window.message = ['success', 'error', 'warning'].reduce((acc, type) => {
acc[type] = (message) => { acc[type] = (message) => {
if (typeof message === 'string') { if (typeof message === 'string') {

View File

@ -331,7 +331,7 @@ import avatarModule from '@/components/avatar-module/index.vue'
import { ref, onMounted, reactive, watch } from 'vue' import { ref, onMounted, reactive, watch } from 'vue'
import { onLoad } from '@dcloudio/uni-app' import { onLoad } from '@dcloudio/uni-app'
import { handleSetWebviewStyle } from '@/utils/common' import { handleSetWebviewStyle, handleFindWebview } from '@/utils/common'
import { ServeUserGroupChatList, ServeCreateTalkList } from '@/api/chat/index' import { ServeUserGroupChatList, ServeCreateTalkList } from '@/api/chat/index'
import { ServeGetSessionId } from '@/api/search/index' import { ServeGetSessionId } from '@/api/search/index'
import { formatTalkItem } from '@/utils/talk' import { formatTalkItem } from '@/utils/talk'
@ -376,12 +376,7 @@ onLoad((options) => {
const goWebHome = () => { const goWebHome = () => {
uni.navigateBack() uni.navigateBack()
let OAWebView = plus.webview.all() handleFindWebview(`handleBackHost()`)
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`handleBackHost()`)
}
})
} }
onMounted(() => { onMounted(() => {

View File

@ -342,7 +342,8 @@
import checkBox from '@/components/checkBox/index.vue' import checkBox from '@/components/checkBox/index.vue'
import lodash from 'lodash' import lodash from 'lodash'
import { import {
handleSetWebviewStyle handleSetWebviewStyle,
handleFindWebview
} from '@/utils/common' } from '@/utils/common'
import { import {
@ -398,12 +399,7 @@
}) })
const goWebHome = () => { const goWebHome = () => {
uni.navigateBack() uni.navigateBack()
let OAWebView = plus.webview.all() handleFindWebview(`handleBackHost()`)
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`handleBackHost()`)
}
})
} }
// //
const isPreSelectedMember = (member) => { const isPreSelectedMember = (member) => {

View File

@ -57,6 +57,7 @@ import videoImg from '@/static/image/chatList/video@2x.png'
import folder from '@/static/image/chatList/folder.png' import folder from '@/static/image/chatList/folder.png'
import { uploadImg } from '@/api/chat' import { uploadImg } from '@/api/chat'
import { uniqueId } from '@/utils' import { uniqueId } from '@/utils'
import { handleFindWebview } from '@/utils/common'
const props = defineProps({ const props = defineProps({
sendUserInfo: { sendUserInfo: {
@ -162,12 +163,7 @@ const photoActionsSelect = (index) => {
) )
} }
} else { } else {
// let OAWebView = plus.webview.all() // handleFindWebview(`getPlusVideoPicker()`)
// OAWebView.forEach((webview, index) => {
// if (webview.id === 'webviewId1') {
// webview.evalJS(`getPlusVideoPicker()`)
// }
// })
// return // return
uni.chooseVideo({ uni.chooseVideo({
sourceType: ['album'], sourceType: ['album'],

View File

@ -256,16 +256,17 @@ const checkSendPermission = () => {
// //
const checkNeedAddFriend = () => { const checkNeedAddFriend = () => {
let params = { state.canSendMsg = true
receiver_id: state.userInfo.sys_id, //id // let params = {
talk_type: 1, // receiver_id: state.userInfo.sys_id, //id
} // talk_type: 1,
ServeCheckFriend(params).then((res) => { // }
console.log(res) // ServeCheckFriend(params).then((res) => {
if (res?.code === 200) { // console.log(res)
state.canSendMsg = res.data?.is_friend || false // if (res?.code === 200) {
} // state.canSendMsg = res.data?.is_friend || false
}) // }
// })
} }
// //

View File

@ -61,7 +61,7 @@
</template> --> </template> -->
<!-- 数据加载状态栏 --> <!-- 数据加载状态栏 -->
<div class="dialog-list" v-passive-touch="handleHidePanel"> <div class="dialog-list" @touchstart="handleHidePanel">
<div <div
class="message-item" class="message-item"
v-for="item in virtualList" v-for="item in virtualList"
@ -146,8 +146,8 @@
<aside <aside
class="avatar-column" class="avatar-column"
@click="toUserDetailPage(item)" @click="toUserDetailPage(item)"
v-passive-touch="() => handleAvatarTouchStart(item)" @touchstart="() => handleAvatarTouchStart(item)"
v-passive-end="handleAvatarTouchEnd" @touchend="handleAvatarTouchEnd"
> >
<!-- <im-avatar <!-- <im-avatar
class="pointer" class="pointer"
@ -229,10 +229,19 @@
> >
<div <div
class="talk-tools voice-content" class="talk-tools voice-content"
v-if="item.voiceContent" v-if="
item?.voiceContent ||
(!item?.voiceContent && item?.isVoiceToTexting)
"
@click="copyVoiceContent(item?.voiceContent || '')" @click="copyVoiceContent(item?.voiceContent || '')"
> >
<span>{{ item.voiceContent }}</span> <wd-loading
v-if="item?.isVoiceToTexting && !item?.voiceContent"
color="#46299D"
:size="20"
style="margin: 0 12rpx 0 0;"
/>
<span v-if="item?.voiceContent">{{ item.voiceContent }}</span>
</div> </div>
</div> </div>
@ -2710,6 +2719,12 @@ const onProgressFn = (progress, id) => {
// console.log((progress.loaded / progress.total) * 100, 'progress') // console.log((progress.loaded / progress.total) * 100, 'progress')
} }
//
const startRecord = () => {
//
window.dispatchEvent(new CustomEvent('audio-play', { detail: null }))
}
// //
const endRecord = (file, url, duration) => { const endRecord = (file, url, duration) => {
console.log(file, url, duration) console.log(file, url, duration)
@ -2736,6 +2751,9 @@ const endRecord = (file, url, duration) => {
resp.catch(() => {}) resp.catch(() => {})
} }
//
const cancelRecord = () => {}
// //
const sendMediaMessage = (mediaUrl, duration, size) => { const sendMediaMessage = (mediaUrl, duration, size) => {
// console.log(mediaUrl, 'mediaUrl') // console.log(mediaUrl, 'mediaUrl')
@ -2764,17 +2782,21 @@ const sendMediaMessage = (mediaUrl, duration, size) => {
// //
const convertText = (msgItem) => { const convertText = (msgItem) => {
msgItem.isVoiceToTexting = true
const resp = ServeConvertText({ const resp = ServeConvertText({
voiceUrl: msgItem.extra.url, voiceUrl: msgItem.extra.url,
msgId: msgItem.msg_id, msgId: msgItem.msg_id,
}) })
// console.log(resp, 'resp') // console.log(resp, 'resp')
resp.then(({ code, data }) => { resp.then(({ code, data }) => {
msgItem.isVoiceToTexting = false
// console.log(code, data, 'data') // console.log(code, data, 'data')
if (code === 200) { if (code === 200) {
console.log(data.convText, 'convText') console.log(data.convText, 'convText')
msgItem.voiceContent = data.convText msgItem.voiceContent = data.convText
} }
}).catch(() => {
msgItem.isVoiceToTexting = false
}) })
} }
// //
@ -2785,16 +2807,17 @@ const chatInputHeight = computed(() => {
// //
const checkNeedAddFriend = () => { const checkNeedAddFriend = () => {
let params = { state.value.isFriendOrSameCompany = true
receiver_id: talkParams.receiver_id, //id // let params = {
talk_type: 1, // receiver_id: talkParams.receiver_id, //id
} // talk_type: 1,
ServeCheckFriend(params).then((res) => { // }
console.log(res) // ServeCheckFriend(params).then((res) => {
if (res?.code === 200) { // console.log(res)
state.value.isFriendOrSameCompany = res.data?.is_friend || false // if (res?.code === 200) {
} // state.value.isFriendOrSameCompany = res.data?.is_friend || false
}) // }
// })
} }
// //
@ -2817,9 +2840,16 @@ const copyVoiceContent = (voiceContent) => {
if (!voiceContent) { if (!voiceContent) {
return return
} }
clipboard(voiceContent, () => { uni.setClipboardData({
message.success('复制成功') data: voiceContent,
showToast: false,
success: () => {
message.success('复制成功')
},
}) })
// clipboard(voiceContent, () => {
// message.success('')
// })
} }
</script> </script>
<style scoped lang="less"> <style scoped lang="less">

View File

@ -10,7 +10,7 @@
:refresher-fixed-bac-height="80" :refresher-fixed-bac-height="80"
refresher-fixed-background="#F9F9FD" refresher-fixed-background="#F9F9FD"
refresher-background="#F9F9FD" refresher-background="#F9F9FD"
v-model="talkListItems" v-model="items"
@query="queryList" @query="queryList"
:loading-more-enabled="false" :loading-more-enabled="false"
:refresher-end-bounce-enabled="false" :refresher-end-bounce-enabled="false"
@ -18,7 +18,6 @@
:empty-view-show="isEmptyViewShow" :empty-view-show="isEmptyViewShow"
@refresherRefresh="onRefresh" @refresherRefresh="onRefresh"
:show-scrollbar="false" :show-scrollbar="false"
:auto-clean-list-when-reload="false"
> >
<template #top> <template #top>
<div> <div>
@ -66,7 +65,9 @@
mode="scaleToFill" mode="scaleToFill"
/> />
<template v-slot:label> <template v-slot:label>
<div class="w-full px-[14rpx]"> <div
class="w-full px-[14rpx]"
>
<div <div
@click="creatGroupChat" @click="creatGroupChat"
class="flex items-center pl-[22rpx] py-[32rpx]" class="flex items-center pl-[22rpx] py-[32rpx]"
@ -85,7 +86,7 @@
</div> </div>
</div> </div>
<div class="divider"></div> <div class="divider"></div>
<div <!-- <div
@click="toAddFriendPage" @click="toAddFriendPage"
class="flex items-center pl-[22rpx] py-[32rpx]" class="flex items-center pl-[22rpx] py-[32rpx]"
> >
@ -102,7 +103,7 @@
添加好友 添加好友
</div> </div>
</div> </div>
<div class="divider"></div> <div class="divider"></div> -->
<div <div
@click="toAddressBookPage" @click="toAddressBookPage"
class="flex items-center pl-[22rpx] py-[32rpx]" class="flex items-center pl-[22rpx] py-[32rpx]"
@ -138,7 +139,7 @@
</div> </div>
<div class="contentRoot"> <div class="contentRoot">
<chatItem <chatItem
v-for="(item, index) in talkListItems" v-for="(item, index) in items"
:key="item.index_name" :key="item.index_name"
:index="index" :index="index"
:data="item" :data="item"
@ -151,7 +152,7 @@
</template> </template>
<script setup> <script setup>
import customInput from '@/components/custom-input/custom-input.vue' import customInput from '@/components/custom-input/custom-input.vue'
import { ref, watch, computed, onMounted, onUnmounted } from 'vue' import { ref, watch, computed } from 'vue'
import { onShow, onLoad } from '@dcloudio/uni-app' import { onShow, onLoad } from '@dcloudio/uni-app'
import { useChatList } from '@/store/chatList/index.js' import { useChatList } from '@/store/chatList/index.js'
import { useAuth } from '@/store/auth' import { useAuth } from '@/store/auth'
@ -175,34 +176,23 @@ const dialogueParams = reactive({
const { userInfo } = useAuth() const { userInfo } = useAuth()
const topItems = computed(() => talkStore.topItems) const topItems = computed(() => talkStore.topItems)
const talkListItems = ref(talkStore?.talkItems || []) const items = computed(() => {
watch( // if (searchKeyword.value.length === 0) {
() => talkStore.talkItems, console.log(talkStore.talkItems)
(newVal) => {
talkListItems.value = newVal
},
{
deep: true,
immediate: true,
},
)
// computed(() => {
// // if (searchKeyword.value.length === 0) {
// // console.log(talkStore.talkItems)
// return talkStore.talkItems return talkStore.talkItems
// // } // }
// // return talkStore.talkItems.filter((item) => { // return talkStore.talkItems.filter((item) => {
// // let keyword = item.remark || item.name // let keyword = item.remark || item.name
// // return keyword.toLowerCase().indexOf(searchKeyword.value.toLowerCase()) != -1 // return keyword.toLowerCase().indexOf(searchKeyword.value.toLowerCase()) != -1
// // }) // })
// }) })
const queryList = (pageNo, pageSize) => { const queryList = (pageNo, pageSize) => {
// paging.value.complete(res.data.list); // paging.value.complete(res.data.list);
// console.log(talkStore) console.log(talkStore)
talkStore talkStore
.loadTalkList() .loadTalkList()
.then(() => { .then(() => {
@ -255,14 +245,14 @@ const toAddFriendPage = () => {
// //
const toAddressBookPage = () => { const toAddressBookPage = () => {
// - // -
// uni.navigateTo({ uni.navigateTo({
// url: '/pages/chooseByDeps/index?chooseMode=3', url: '/pages/chooseByDeps/index?chooseMode=3',
// }) })
// - // -
uni.navigateTo({ // uni.navigateTo({
url: '/pages/addressBook/index', // url: '/pages/addressBook/index',
}) // })
} }
/* watch( /* watch(
@ -273,43 +263,28 @@ const toAddressBookPage = () => {
{ deep: true, immediate: true } { deep: true, immediate: true }
); */ ); */
onMounted(() => {
uni.$on('socket-refresh-talk-list', () => {
if (paging.value) {
paging.value.reload() // ZPaging
}
})
})
onUnmounted(() => {
uni.$off('socket-refresh-talk-list')
})
onShow(() => { onShow(() => {
handleSetWebviewStyle(true) handleSetWebviewStyle(true)
// //
if (paging.value) { talkStore
paging.value.reload() .loadTalkList()
} .then(() => {
// talkStore // paging
// .loadTalkList() if (paging.value) {
// .then(() => { paging.value.reload()
// // paging }
// if (paging.value) { })
// paging.value.reload() .catch((error) => {
// } console.error('页面显示时数据加载失败', error)
// }) })
// .catch((error) => {
// console.error('', error)
// })
}) })
onLoad((options) => { onLoad((options) => {
console.log(options) console.log(options)
if (options?.openSessionIndexName) { if (options?.openSessionIndexName) {
if (talkListItems?.value?.length > 0) { if (items?.value?.length > 0) {
talkListItems.value.forEach((openSession) => { items.value.forEach((openSession) => {
if (openSession.index_name === options?.openSessionIndexName) { if (openSession.index_name === options?.openSessionIndexName) {
setTimeout(() => { setTimeout(() => {
dialogueStore.setDialogue(openSession) dialogueStore.setDialogue(openSession)

View File

@ -5,6 +5,7 @@ import lodash from 'lodash'
import { ref } from 'vue' import { ref } from 'vue'
import { createGlobalState, useStorage } from '@vueuse/core' import { createGlobalState, useStorage } from '@vueuse/core'
import { uniStorage } from '@/utils/uniStorage.js' import { uniStorage } from '@/utils/uniStorage.js'
import { handleFindWebview } from '@/utils/common'
export const useDialogueListStore = createGlobalState(() => { export const useDialogueListStore = createGlobalState(() => {
const testDatabase = async () => { const testDatabase = async () => {
@ -40,19 +41,33 @@ export const useDialogueListStore = createGlobalState(() => {
} }
const content = { const content = {
content: "我试试传送文件和图片是不是一个接口", content: '我试试传送文件和图片是不是一个接口',
name: "测试excel1.xlsx", name: '测试excel1.xlsx',
path: "https://cdn-test.szjixun.cn/fonchain-chat/chat/file/multipart/20250307/727a2371-ffc4-46da-b953-a7d449ff82ff-测试excel1.xlsx", path:
'https://cdn-test.szjixun.cn/fonchain-chat/chat/file/multipart/20250307/727a2371-ffc4-46da-b953-a7d449ff82ff-测试excel1.xlsx',
size: 9909, size: 9909,
drive: 3 drive: 3,
}; }
const extra = JSON.stringify(content); const extra = JSON.stringify(content)
let chatDBexecuteSql2 = { let chatDBexecuteSql2 = {
eventType: 'executeSql', eventType: 'executeSql',
eventParams: { eventParams: {
name: 'chat', name: 'chat',
sql: 'INSERT INTO talk_records (msg_id, sequence, talk_type, msg_type, user_id, receiver_id, is_revoke, is_mark, quote_id, extra, created_at, updated_at, biz_date) VALUES ("'+'77b715fb30f54f739a255a915ef72445'+'", 166, 2, 1, 1774, 888890, 0, 0, "'+''+'", "'+extra+'", "'+'2025-03-06T15:57:07.000Z'+'", "'+'2025-03-06T15:57:07.000Z'+'", "'+'20250306'+'")', sql:
'INSERT INTO talk_records (msg_id, sequence, talk_type, msg_type, user_id, receiver_id, is_revoke, is_mark, quote_id, extra, created_at, updated_at, biz_date) VALUES ("' +
'77b715fb30f54f739a255a915ef72445' +
'", 166, 2, 1, 1774, 888890, 0, 0, "' +
'' +
'", "' +
extra +
'", "' +
'2025-03-06T15:57:07.000Z' +
'", "' +
'2025-03-06T15:57:07.000Z' +
'", "' +
'20250306' +
'")',
}, },
} }
let chatDBSelectSql = { let chatDBSelectSql = {
@ -69,38 +84,27 @@ export const useDialogueListStore = createGlobalState(() => {
path: '_doc/chat.db', path: '_doc/chat.db',
}, },
} }
document.addEventListener('plusready', () => { // handleFindWebview(
let OAWebView = plus.webview.all() // `operateSQLite('${encodeURIComponent(JSON.stringify(chatDatabase))}')`,
OAWebView.forEach((webview, index) => { // )
if (webview.id === 'webviewId1') { // handleFindWebview(
webview.evalJS( // `operateSQLite('${encodeURIComponent(
`operateSQLite('${encodeURIComponent( // JSON.stringify(chatDBexecuteSql),
JSON.stringify(chatDatabase), // )}')`,
)}')`, // )
) // handleFindWebview(
webview.evalJS( // `operateSQLite('${encodeURIComponent(
`operateSQLite('${encodeURIComponent( // JSON.stringify(chatDBexecuteSql2),
JSON.stringify(chatDBexecuteSql), // )}')`,
)}')`, // )
) // handleFindWebview(
webview.evalJS( // `operateSQLite('${encodeURIComponent(JSON.stringify(chatDBSelectSql))}')`,
`operateSQLite('${encodeURIComponent( // )
JSON.stringify(chatDBexecuteSql2), // handleFindWebview(
)}')`, // `operateSQLite('${encodeURIComponent(
) // JSON.stringify(chatDBIsOpenDatabase),
webview.evalJS( // )}')`,
`operateSQLite('${encodeURIComponent( // )
JSON.stringify(chatDBSelectSql),
)}')`,
)
webview.evalJS(
`operateSQLite('${encodeURIComponent(
JSON.stringify(chatDBIsOpenDatabase),
)}')`,
)
}
})
})
} }
// testDatabase() // testDatabase()

View File

@ -2,6 +2,7 @@ import { defineStore } from 'pinia'
import { ServeGetTalkList, ServeCreateTalkList } from '@/api/chat/index' import { ServeGetTalkList, ServeCreateTalkList } from '@/api/chat/index'
import { formatTalkItem, ttime, KEY_INDEX_NAME } from '@/utils/talk' import { formatTalkItem, ttime, KEY_INDEX_NAME } from '@/utils/talk'
import { useEditorDraftStore } from './editor-draft' import { useEditorDraftStore } from './editor-draft'
import { handleFindWebview } from '@/utils/common'
// import { ISession } from '@/types/chat' // import { ISession } from '@/types/chat'
export const useTalkStore = defineStore('talk', { export const useTalkStore = defineStore('talk', {
@ -103,23 +104,7 @@ export const useTalkStore = defineStore('talk', {
return resp.then(({ code, data }) => { return resp.then(({ code, data }) => {
if (code == 200) { if (code == 200) {
//向OA的webview通信改变未读消息数量 //向OA的webview通信改变未读消息数量
if (typeof plus !== 'undefined') { handleFindWebview(`doUpdateUnreadNum('${data.unread_num}')`)
let OAWebView = plus.webview.all()
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`doUpdateUnreadNum('${data.unread_num}')`)
}
})
} else {
document.addEventListener('plusready', () => {
let OAWebView = plus.webview.all()
OAWebView.forEach((webview) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`doUpdateUnreadNum('${data.unread_num}')`)
}
})
})
}
this.items = data.items.map((item) => { this.items = data.items.map((item) => {
const value = formatTalkItem(item) const value = formatTalkItem(item)

View File

@ -0,0 +1,2 @@
## 1.0.02023-09-05
实现基础功能

View File

@ -0,0 +1,130 @@
<template>
<view :style="[boxStyel]" class="box">
<view class="audio-style" :style="[audioStyel]" :class="{ 'animation': isPlay }">
<view class="small" :style="{'background-color': color}"></view>
<view class="middle" :style="{'border-right-color': color}"></view>
<view class="large" :style="{'border-right-color': color}"></view>
</view>
</view>
</template>
<script>
export default {
emits: [],
props: {
isPlay: {
type: [Boolean],
default: false
},
direction: {
type: String,
default: 'right'
},
size: {
type: Number,
default: 24
},
color: {
type: String,
default: '#222'
}
},
data() {
return {
};
},
computed: {
audioStyel() {
return {
transform: `scale(${this.size / 24})`
};
},
boxStyel() {
const directDic = { right: '0deg', bottom: '90deg', left: '180deg', top: '270deg' };
const dir = directDic[this.direction || 'left'];
const style = {
transform: `rotate(${dir})`,
width: this.size + 'px',
height: this.size + 'px'
};
return style;
}
},
methods: {}
};
</script>
<style lang="scss" scoped>
view{
box-sizing: border-box;
}
.box {
// border: 1px solid #4c4c4c;
display: inline-flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.audio-style {
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
& > view {
border: 2px solid transparent;
border-radius: 50%;
}
}
.small {
border: 0px solid;
width: 3px;
height: 3px;
}
.middle {
width: 16px;
height: 16px;
margin-left: -11px;
opacity: 1;
}
.large {
width: 24px;
height: 24px;
margin-left: -19px;
opacity: 1;
}
.animation {
.middle {
animation: middle 1.2s ease-in-out infinite;
}
.large {
animation: large 1.2s ease-in-out infinite;
}
}
//
@keyframes middle {
0% {
opacity: 0;
}
10% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@keyframes large {
0% {
opacity: 0;
}
50% {
opacity: 1;
}
60% {
opacity: 0;
}
100% {
opacity: 0;
}
}
</style>

View File

@ -0,0 +1,83 @@
{
"id": "a-trumpet",
"displayName": "纯css语音播放语音聊天播放小喇叭动画组件",
"version": "1.0.0",
"description": "纯css语音播放语音聊天播放小喇叭动画组件",
"keywords": [
"a-trumpet",
"语音播报",
"播放小喇叭",
"动画"
],
"repository": "",
"engines": {
},
"dcloudext": {
"type": "component-vue",
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": ""
},
"uni_modules": {
"dependencies": [],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"Vue": {
"vue2": "y",
"vue3": "y"
},
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y",
"钉钉": "y",
"快手": "y",
"飞书": "y",
"京东": "y"
},
"快应用": {
"华为": "y",
"联盟": "y"
}
}
}
}
}

View File

@ -0,0 +1,18 @@
# a-trumpet
## 用法
```html
<a-trumpet :isPlay="isplay"></a-trumpet>
<a-trumpet :isPlay="isplay" color="#1100ff"></a-trumpet>
<a-trumpet :isPlay="isplay" :size="50"></a-trumpet>
<a-trumpet :isPlay="isplay" direction="right"></a-trumpet>
```
## 属性说明:
| 属性名 | 类型 | 默认值 | 说明 |
| ---- | ---- | ---- | ---- |
| isplay | Boolean | false | 是否播放动画 |
| size | Number | 24 | 宽高的尺寸 |
| color | String | #222 | 颜色 |
| direction | String | top、bottom、left、ringt| 方向,上下左右 |

View File

@ -7,9 +7,9 @@
<view <view
class="record-btn" class="record-btn"
@longpress="startRecord" @longpress="startRecord"
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move="touchMove" @touchmove="touchMove"
v-passive-end="endRecord" @touchend="endRecord"
hover-class="record-btn-hover" hover-class="record-btn-hover"
hover-start-time="200" hover-start-time="200"
hover-stay-time="150" hover-stay-time="150"
@ -160,7 +160,7 @@ import 'recorder-core/src/engine/mp3-engine'
import 'recorder-core/src/extensions/waveview' import 'recorder-core/src/extensions/waveview'
import recordCancelBg from '@/static/image/record/chat-voice-animation-bg-red.png' import recordCancelBg from '@/static/image/record/chat-voice-animation-bg-red.png'
// #endif // #endif
import { multiplication } from '@/utils/common' import { multiplication, handleFindWebview } from '@/utils/common'
export default { export default {
name: 'nbVoiceRecord', name: 'nbVoiceRecord',
/** /**
@ -355,7 +355,11 @@ export default {
// }, 1000) // }, 1000)
if (Number(permissionStatus) === 1) { if (Number(permissionStatus) === 1) {
that.continueAppMicro() that.continueAppMicro()
} else if (Number(permissionStatus) === -1) { } else if (
Number(permissionStatus) === -1 ||
(Number(permissionStatus) === 0 &&
uni.getSystemInfoSync().osName === 'ios')
) {
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '检测到您还未授权麦克风哦', content: '检测到您还未授权麦克风哦',
@ -364,12 +368,10 @@ export default {
cancelText: '保持拒绝', cancelText: '保持拒绝',
success: ({ confirm, cancel }) => { success: ({ confirm, cancel }) => {
if (confirm) { if (confirm) {
let OAWebView = plus.webview.all() handleFindWebview(`handleRequestAndroidPermission('settings')`)
OAWebView.forEach((webview, index) => { }
if (webview.id === 'webviewId1') { if (cancel) {
webview.evalJS(`handleRequestAndroidPermission('settings')`) that.isCheckingPermission = false
}
})
} }
}, },
}) })
@ -451,12 +453,7 @@ export default {
// #endif // #endif
// #ifdef H5 // #ifdef H5
if (typeof plus !== 'undefined') { if (typeof plus !== 'undefined') {
let OAWebView = plus.webview.all() handleFindWebview(`handleRequestAndroidPermission('micro')`)
OAWebView.forEach((webview, index) => {
if (webview.id === 'webviewId1') {
webview.evalJS(`handleRequestAndroidPermission('micro')`)
}
})
} else { } else {
that.continueAppMicro(isFirstRequestPer) that.continueAppMicro(isFirstRequestPer)
} }

View File

@ -1,14 +1,14 @@
<template> <template>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<view v-passive-touch="touch.startDrag" v-passive-move.stop="touch.onDrag" v-passive-end="touch.endDrag" :data-prop="towxsShareData"> <view @touchstart="touch.startDrag" @touchmove.stop="touch.onDrag" @touchend="touch.endDrag" :data-prop="towxsShareData">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef H5||APP-VUE --> <!-- #ifdef H5||APP-VUE -->
<view v-passive-touch="touch.startDrag" v-passive-move="touch.onDrag" v-passive-end="touch.endDrag" :data-prop="towxsShareData"> <view @touchstart="touch.startDrag" @touchmove="touch.onDrag" @touchend="touch.endDrag" :data-prop="towxsShareData">
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view > <view >
<!-- #endif --> <!-- #endif -->
<view v-passive-touch="touchstart" :style="{ left: _offset[0] + 'rpx', top: _offset[1] + 'rpx' }" class="div" id="adsorb" ref="adsorb"> <view @touchstart="touchstart" :style="{ left: _offset[0] + 'rpx', top: _offset[1] + 'rpx' }" class="div" id="adsorb" ref="adsorb">
<view <view
:eventPenetrationEnabled="true" :eventPenetrationEnabled="true"
:style="{ :style="{

View File

@ -1,11 +1,11 @@
<template> <template>
<button <button
@click="onclick" @click="onclick"
v-passive-touch="touchstart" @touchstart="touchstart"
v-passive-end="touchend" @touchend="touchend"
@longpress="emits('longpress', $event)" @longpress="emits('longpress', $event)"
@touchcancel="touchcancel" @touchcancel="touchcancel"
v-passive-move="(e: Event) => emits('touchmove', e)" @touchmove="emits('touchmove', $event)"
@getphonenumber="emits('getphonenumber', $event)" @getphonenumber="emits('getphonenumber', $event)"
@error="emits('error', $event)" @error="emits('error', $event)"
@opensetting="emits('opensetting', $event)" @opensetting="emits('opensetting', $event)"

View File

@ -5,9 +5,9 @@
<canvas <canvas
@click="emits('click', $event)" @click="emits('click', $event)"
v-if="!isPc" v-if="!isPc"
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move="touchMove" @touchmove="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
:id="canvasId" :id="canvasId"
:canvas-id="canvasId" :canvas-id="canvasId"
class="canvas" class="canvas"
@ -26,9 +26,9 @@
<!-- #ifdef MP-WEIXIN || MP-QQ --> <!-- #ifdef MP-WEIXIN || MP-QQ -->
<canvas <canvas
@click="emits('click', $event)" @click="emits('click', $event)"
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move="touchMove" @touchmove="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
type="2d" type="2d"
id="canvasId" id="canvasId"
canvas-id="canvasId" canvas-id="canvasId"
@ -39,9 +39,9 @@
<!-- #ifdef MP-ALIPAY --> <!-- #ifdef MP-ALIPAY -->
<canvas <canvas
@click="emits('click', $event)" @click="emits('click', $event)"
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move="touchMove" @touchmove="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
type="2d" type="2d"
:id="canvasId" :id="canvasId"
:canvas-id="canvasId" :canvas-id="canvasId"

View File

@ -1,7 +1,7 @@
<template> <template>
<view v-passive-move.stop="stopMove" class="flex flex-col flex-col-top-center"> <view @touchmove.stop="stopMove" class="flex flex-col flex-col-top-center">
<view <view
v-passive-move.stop="stopMove" @touchmove.stop="stopMove"
v-if="showCanvas" v-if="showCanvas"
class="overflow relative" class="overflow relative"
ref="webviewWk" ref="webviewWk"
@ -17,9 +17,9 @@
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN || MP-ALIPAY || MP-QQ --> <!-- #ifdef MP-WEIXIN || MP-ALIPAY || MP-QQ -->
<canvas <canvas
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move="touchMove" @touchmove="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
class="canvas" class="canvas"
type="2d" type="2d"
id="canvasId" id="canvasId"
@ -28,9 +28,9 @@
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP-WEIXIN || MP-ALIPAY || MP-QQ || APP-NVUE --> <!-- #ifndef MP-WEIXIN || MP-ALIPAY || MP-QQ || APP-NVUE -->
<canvas <canvas
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move="touchMove" @touchmove="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
class="canvas" class="canvas"
:id="canvasId" :id="canvasId"
:canvas-id="canvasId" :canvas-id="canvasId"
@ -41,30 +41,30 @@
<view <view
id="wrapper" id="wrapper"
class="absolute l-0 t-0 wrapper item" class="absolute l-0 t-0 wrapper item"
v-passive-touch="colorTouch.startDrag" @touchstart="colorTouch.startDrag"
v-passive-move="colorTouch.onDrag" @touchmove="colorTouch.onDrag"
v-passive-end="colorTouch.endDrag" @touchend="colorTouch.endDrag"
@touchcancel="colorTouch.endDrag" @touchcancel="colorTouch.endDrag"
> >
<view class="itemwk" v-passive-end="touchEndWk(0)" v-passive-move="touchEndWk(0)"></view> <view class="itemwk" @touchend="touchEndWk(0)" @touchmove="touchEndWk(0)"></view>
</view> </view>
<view <view
id="wrapper2" id="wrapper2"
class="absolute r-0 t-0 wrapper item" class="absolute r-0 t-0 wrapper item"
v-passive-touch="colorTouch.startDrag2" @touchstart="colorTouch.startDrag2"
v-passive-move="colorTouch.onDrag2" @touchmove="colorTouch.onDrag2"
v-passive-end="colorTouch.endDrag2" @touchend="colorTouch.endDrag2"
@touchcancel="colorTouch.endDrag2" @touchcancel="colorTouch.endDrag2"
> >
<view class="itemwk" v-passive-end="touchEndWk(1)" v-passive-move="touchEndWk(1)"></view> <view class="itemwk" @touchend="touchEndWk(1)" @touchmove="touchEndWk(1)"></view>
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<view id="wrapper" ref="wrapper" class="absolute l-0 t-0 wrapper item" v-passive-touch="nvueStartH"> <view id="wrapper" ref="wrapper" class="absolute l-0 t-0 wrapper item" @touchstart="nvueStartH">
<view class="itemwk"></view> <view class="itemwk"></view>
</view> </view>
<view id="wrapper2" ref="wrapper2" class="absolute r-0 t-0 wrapper item" v-passive-touch="nvueStartS"> <view id="wrapper2" ref="wrapper2" class="absolute r-0 t-0 wrapper item" @touchstart="nvueStartS">
<view class="itemwk"></view> <view class="itemwk"></view>
</view> </view>
<!-- #endif --> <!-- #endif -->

View File

@ -1,9 +1,9 @@
<template> <template>
<view <view
@longpress="" @longpress=""
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move.stop.prevent="touchMove" @touchmove.stop.prevent="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
@touchcancel="touchEnd" @touchcancel="touchEnd"
@mousedown="touchStart" @mousedown="touchStart"
@mousemove.stop.prevent="touchMove" @mousemove.stop.prevent="touchMove"
@ -34,7 +34,7 @@
v-if="url" v-if="url"
@error="imgError" @error="imgError"
class="absolute l-0 t-0" class="absolute l-0 t-0"
:userInteractionEnabled="false" :userInteractionEnabled="false"
@load="imgLoad" @load="imgLoad"
:src="url" :src="url"

View File

@ -39,12 +39,12 @@
</view> </view>
<view <view
:style="{ height: h - 1 + 'px', width: '100rpx' }" :style="{ height: h - 1 + 'px', width: '100rpx' }"
v-passive-touch.stop.prevent="(e: Event) => m_start(e, index)" @touchstart.stop.prevent="m_start($event, index)"
@longpress="m_start_longpress(index)" @longpress="m_start_longpress(index)"
@mousedown="m_start($event, index)" @mousedown="m_start($event, index)"
v-passive-move.stop.prevent="(e: Event) => m_move(e, index)" @touchmove.stop.prevent="m_move($event, index)"
@mousemove.stop.prevent="m_move($event, index)" @mousemove.stop.prevent="m_move($event, index)"
v-passive-end="(e: Event) => m_end(e, index)" @touchend="m_end($event, index)"
@mouseup="m_end($event, index)" @mouseup="m_end($event, index)"
class="flex-shrink flex flex-row flex-row-center-center opacity-3" class="flex-shrink flex flex-row flex-row-center-center opacity-3"
> >
@ -118,7 +118,7 @@ watch(
() => props.list, () => props.list,
() => { () => {
jishunTopData() jishunTopData()
}, },
{ {
deep: true, deep: true,

View File

@ -3,7 +3,7 @@
<view <view
v-if="show" v-if="show"
@click.stop="closeDromenu" @click.stop="closeDromenu"
v-passive-move.stop="" @touchmove.stop=""
class="l-0 t-0 fixed zIndex-9" class="l-0 t-0 fixed zIndex-9"
:style="[ :style="[
{ {

View File

@ -37,7 +37,7 @@
<!-- 背景遮罩,透明背景 --> <!-- 背景遮罩,透明背景 -->
<view <view
@click="close" @click="close"
v-passive-move.stop="stopEvent" @touchmove.stop="stopEvent"
class="bg fixed" class="bg fixed"
:style="{ :style="{
left: (isNaN(activeIndex) || isButton ? '-10000' : 0) + 'px', left: (isNaN(activeIndex) || isButton ? '-10000' : 0) + 'px',
@ -56,7 +56,7 @@
<!-- 动态菜单及内容的背景 --> <!-- 动态菜单及内容的背景 -->
<view <view
@click="close" @click="close"
v-passive-move.stop="stopEvent" @touchmove.stop="stopEvent"
:class="[isNaN(activeIndex) ? 'bgAnioff' : 'bgAni']" :class="[isNaN(activeIndex) ? 'bgAnioff' : 'bgAni']"
class="bgContent fixed" class="bgContent fixed"
:style="{ :style="{
@ -70,7 +70,7 @@
<!-- 动态菜单及内容 --> <!-- 动态菜单及内容 -->
<view <view
@click="close" @click="close"
v-passive-move.stop="stopEvent" @touchmove.stop="stopEvent"
class="content fixed" class="content fixed"
:style="{ :style="{
left: (isNaN(activeIndex) || isButton ? '-10000' : (props.fixed?0:el_left)) + 'px', left: (isNaN(activeIndex) || isButton ? '-10000' : (props.fixed?0:el_left)) + 'px',

View File

@ -27,9 +27,9 @@
> >
<view <view
:style="[{ height: `${navright.length * navHeight}rpx`, width: '60rpx' }]" :style="[{ height: `${navright.length * navHeight}rpx`, width: '60rpx' }]"
v-passive-touch="touchStart" @touchstart="touchStart"
v-passive-move.stop.prevent="touchMove" @touchmove.stop.prevent="touchMove"
v-passive-end="touchEnd" @touchend="touchEnd"
id="navlist" id="navlist"
ref="navlist" ref="navlist"
class="flex flex-col flex-center" class="flex flex-col flex-center"

View File

@ -7,7 +7,7 @@
<!-- #endif --> <!-- #endif -->
<view <view
v-passive-move.prevent="" @touchmove.prevent=""
v-if="showMask" v-if="showMask"
class="l-0 t-0" class="l-0 t-0"
:style="[ :style="[
@ -25,7 +25,7 @@
<view <view
ref="overlay" ref="overlay"
:class="[ :class="[
bgColor_rp && !props.transprent && ani ? 'blurOnOpacity' : 'blurOffOpacity', bgColor_rp && !props.transprent && ani ? 'blurOnOpacity' : 'blurOffOpacity',
'overlay', 'overlay',
store.tmuiConfig?.themeConfig.overflowBlur&&bgColor_rp && !props.transprent && ani?'blurOn':'', store.tmuiConfig?.themeConfig.overflowBlur&&bgColor_rp && !props.transprent && ani?'blurOn':'',
store.tmuiConfig?.themeConfig.overflowBlur&&bgColor_rp && !props.transprent && !ani?'blurOff':'', store.tmuiConfig?.themeConfig.overflowBlur&&bgColor_rp && !props.transprent && !ani?'blurOff':'',
@ -211,7 +211,7 @@ function close() {
clearTimeout(timerId); clearTimeout(timerId);
timerId = NaN; timerId = NaN;
} }
open(false); open(false);
} }
@ -223,12 +223,12 @@ function closeByclick(e: Event) {
} catch (e) { } catch (e) {
//TODO handle the exception //TODO handle the exception
} }
if (timerId) { if (timerId) {
clearTimeout(timerId); clearTimeout(timerId);
timerId = NaN; timerId = NaN;
} }
emits("click", e); emits("click", e);
if (!props.overlayClick) return; if (!props.overlayClick) return;
open(false); open(false);
@ -299,7 +299,7 @@ function fadeInVue(off = false) {
if (showMask.value == off) return; if (showMask.value == off) return;
throttle( throttle(
function () { function () {
if (off == false) { if (off == false) {
ani.value = false; ani.value = false;
setTimeout(function () { setTimeout(function () {
@ -342,7 +342,7 @@ defineExpose({
opacity: 0; opacity: 0;
} }
.blur{ .blur{
} }
.blurOn { .blurOn {
/* #ifndef APP-PLUS-NVUE */ /* #ifndef APP-PLUS-NVUE */

View File

@ -2,9 +2,9 @@
<scroll-view <scroll-view
class="scroyy" class="scroyy"
:scroll-top="scrollTop" :scroll-top="scrollTop"
v-passive-touch="onTouchStart" @touchstart="onTouchStart"
v-passive-move="onTouchMove" @touchmove="onTouchMove"
v-passive-end="onTouchEnd" @touchend="onTouchEnd"
@scroll="onScroll" @scroll="onScroll"
@scrolltoupper="onScrollToTop" @scrolltoupper="onScrollToTop"
@scrolltolower="onScrollToBottom" @scrolltolower="onScrollToBottom"

View File

@ -3,9 +3,9 @@
<scroll-view <scroll-view
class="scroyy" class="scroyy"
:scroll-top="scrollTop" :scroll-top="scrollTop"
v-passive-touch="onTouchStart" @touchstart="onTouchStart"
v-passive-move="onTouchMove" @touchmove="onTouchMove"
v-passive-end="onTouchEnd" @touchend="onTouchEnd"
@scroll="onScroll" @scroll="onScroll"
@scrolltoupper="onScrollToTop" @scrolltoupper="onScrollToTop"
@scrolltolower="onScrollToBottom" @scrolltolower="onScrollToBottom"
@ -59,11 +59,11 @@
</scroll-view> </scroll-view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<scroll-view <scroll-view
enableBackToTop="true" enableBackToTop="true"
alwaysScrollableVertical="true" alwaysScrollableVertical="true"
scroll-y="true" scroll-y="true"
@scrolltolower="onScrollToBottom" @scrolltolower="onScrollToBottom"
:style="[props.height ? { height: props.height + 'rpx' } : '', _style]" :class="_class"> :style="[props.height ? { height: props.height + 'rpx' } : '', _style]" :class="_class">
<refresh @refresh="onrefresh" @pullingdown="onpullingdown" :display="showLoading ? 'show' : 'hide'" style="width: 750rpx"> <refresh @refresh="onrefresh" @pullingdown="onpullingdown" :display="showLoading ? 'show' : 'hide'" style="width: 750rpx">
<view :style="{ height: _barHeight / 2 + 'px' }"> <view :style="{ height: _barHeight / 2 + 'px' }">

View File

@ -11,8 +11,8 @@
:blurEffect="blurEffect" :blurEffect="blurEffect"
@click="onClick" @click="onClick"
@longpress="longpress" @longpress="longpress"
v-passive-end="touchend" @touchend="touchend"
v-passive-touch="touchstart" @touchstart="touchstart"
@touchcancel="touchcancel" @touchcancel="touchcancel"
@mousedown="mousedown" @mousedown="mousedown"
@mouseup="mouseup" @mouseup="mouseup"

View File

@ -3,9 +3,9 @@
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<gcanvas <gcanvas
v-if="show" v-if="show"
v-passive-touch="touchstart" @touchstart="touchstart"
v-passive-move="touchsmove" @touchmove="touchsmove"
v-passive-end="touchsend" @touchend="touchsend"
:id="canvasId" :id="canvasId"
:ref="canvasId" :ref="canvasId"
class="canvas" class="canvas"
@ -15,9 +15,9 @@
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP-WEIXIN || MP-ALIPAY || MP-QQ --> <!-- #ifdef MP-WEIXIN || MP-ALIPAY || MP-QQ -->
<canvas <canvas
v-passive-touch="touchstart" @touchstart="touchstart"
v-passive-move="touchsmove" @touchmove="touchsmove"
v-passive-end="touchsend" @touchend="touchsend"
@mousedown="touchstart" @mousedown="touchstart"
@mousemove.stop="touchsmove" @mousemove.stop="touchsmove"
@mouseup.stop="touchsend" @mouseup.stop="touchsend"
@ -30,9 +30,9 @@
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP-WEIXIN || MP-ALIPAY || MP-QQ || APP-NVUE --> <!-- #ifndef MP-WEIXIN || MP-ALIPAY || MP-QQ || APP-NVUE -->
<canvas <canvas
v-passive-touch.stop="touchstart" @touchstart.stop="touchstart"
v-passive-move.stop="touchsmove" @touchmove.stop="touchsmove"
v-passive-end.stop="touchsend" @touchend.stop="touchsend"
@mousedown.stop="touchstart" @mousedown.stop="touchstart"
@mousemove.stop="touchsmove" @mousemove.stop="touchsmove"
@mouseup.stop="touchsend" @mouseup.stop="touchsend"

View File

@ -4,9 +4,9 @@
<view > <view >
<view <view
v-if="!_disabled" v-if="!_disabled"
v-passive-touch="startDrag" @touchstart="startDrag"
v-passive-move="onDrag" @touchmove="onDrag"
v-passive-end="endDrag" @touchend="endDrag"
@touchcancel="endDrag" @touchcancel="endDrag"
:style="`width:${attr.width}px;height:${attr.height}px `" :style="`width:${attr.width}px;height:${attr.height}px `"
class="overflow relative" class="overflow relative"
@ -97,7 +97,7 @@
</view> </view>
<view <view
@click="emits('click')" @click="emits('click')"
v-passive-touch.stop="touchstart" @touchstart.stop="touchstart"
id="wrapper" id="wrapper"
ref="tabsDom" ref="tabsDom"
class="absolute l-0 t-0" class="absolute l-0 t-0"
@ -329,7 +329,7 @@ var initOpen = function () {
} else if (opened.value && state.leftWidth > 0) { } else if (opened.value && state.leftWidth > 0) {
swipeMove(state.leftWidth) swipeMove(state.leftWidth)
} }
} }
var range = function (num: number, min: number, max: number) { var range = function (num: number, min: number, max: number) {
return Math.min(Math.max(num, min), max) return Math.min(Math.max(num, min), max)
@ -347,21 +347,21 @@ var swipeMove = function (_offset: number) {
transition: transition transition: transition
} }
funMethod('style', style) funMethod('style', style)
} }
var close = function () { var close = function () {
opened.value = false opened.value = false
swipeMove(0) swipeMove(0)
// #ifdef APP-NVUE // #ifdef APP-NVUE
nvue_now_left = -attr.value.rightWidth nvue_now_left = -attr.value.rightWidth
spinNvueAniEnd(-attr.value.rightWidth,attr.value.rightWidth,true) spinNvueAniEnd(-attr.value.rightWidth,attr.value.rightWidth,true)
funMethod('close', false) funMethod('close', false)
// #endif // #endif
// #ifndef APP-NVUE // #ifndef APP-NVUE
funMethod('close', false) funMethod('close', false)
// #endif // #endif
} }
@ -395,7 +395,7 @@ const startDrag = (event: TouchEvent | MouseEvent) => {
event?.preventDefault(); event?.preventDefault();
event?.stopImmediatePropagation(); event?.stopImmediatePropagation();
} catch (error) { } catch (error) {
} }
resetTouchStatus() resetTouchStatus()
state.startOffset = state.offset state.startOffset = state.offset
@ -410,9 +410,9 @@ const onDrag = (event: TouchEvent | MouseEvent) => {
event?.preventDefault(); event?.preventDefault();
event?.stopImmediatePropagation(); event?.stopImmediatePropagation();
} catch (error) { } catch (error) {
} }
var touchPoint = event.touches[0] var touchPoint = event.touches[0]
state.deltaX = touchPoint.clientX - state.startX state.deltaX = touchPoint.clientX - state.startX
state.deltaY = touchPoint.clientY - state.startY state.deltaY = touchPoint.clientY - state.startY
@ -430,7 +430,7 @@ const endDrag = (event: TouchEvent | MouseEvent) => {
state.dragging = false state.dragging = false
if (+state.rightWidth > 0 && -state.startOffset < +state.rightWidth && -state.offset > +state.rightWidth * THRESHOLD) { if (+state.rightWidth > 0 && -state.startOffset < +state.rightWidth && -state.offset > +state.rightWidth * THRESHOLD) {
open('right') open('right')
} else if (+state.leftWidth > 0 && state.startOffset < +state.leftWidth && state.offset > +state.leftWidth * THRESHOLD) { } else if (+state.leftWidth > 0 && state.startOffset < +state.leftWidth && state.offset > +state.leftWidth * THRESHOLD) {
open('left') open('left')
} else { } else {

View File

@ -2,7 +2,7 @@
<!-- #ifdef MP-WEIXIN --> <!-- #ifdef MP-WEIXIN -->
<!-- <view <!-- <view
data-text="hehe" data-text="hehe"
v-passive-touch.stop="test.touchstart" @mousedown.stop="movestart" v-passive-move.stop="test.touchmove" @mousemove.stop="moveing" v-passive-end.stop="moveend" @mouseup.stop="moveend" @mouseleave.stop="moveend" @touchstart.stop="test.touchstart" @mousedown.stop="movestart" @touchmove.stop="test.touchmove" @mousemove.stop="moveing" @touchend.stop="moveend" @mouseup.stop="moveend" @mouseleave.stop="moveend"
class="absolute movable" :style="[ class="absolute movable" :style="[
props.direction == 'horizontal'?{width:props.size+'rpx',height:props.size+'rpx',transform:`translateX(${_x}px)`,top:'0px'}:'', props.direction == 'horizontal'?{width:props.size+'rpx',height:props.size+'rpx',transform:`translateX(${_x}px)`,top:'0px'}:'',
props.direction == 'vertical'?{width:props.size+'rpx',height:props.size+'rpx',transform:`translateY(${_x}px)`,left:0+'rpx',top:'0px'}:'', props.direction == 'vertical'?{width:props.size+'rpx',height:props.size+'rpx',transform:`translateY(${_x}px)`,left:0+'rpx',top:'0px'}:'',
@ -13,11 +13,11 @@
<!-- #endif --> <!-- #endif -->
<view <view
v-passive-touch.stop="movestart" @touchstart.stop="movestart"
@mousedown.stop="movestart" @mousedown.stop="movestart"
v-passive-move.stop="moveing" @touchmove.stop="moveing"
@mousemove.stop="moveing" @mousemove.stop="moveing"
v-passive-end.stop="moveend" @touchend.stop="moveend"
@mouseup.stop="moveend" @mouseup.stop="moveend"
@mouseleave.stop="moveend" @mouseleave.stop="moveend"
class="absolute" class="absolute"

View File

@ -1,6 +1,6 @@
<template> <template>
<view id="box" ref="box" :style="{ width: props.width + 'rpx', height: props.height + 'rpx' }"> <view id="box" ref="box" :style="{ width: props.width + 'rpx', height: props.height + 'rpx' }">
<!-- <view <!-- <view
class="flex flex-row-top-start flex-row flex-wrap" class="flex flex-row-top-start flex-row flex-wrap"
:style="{ width: props.width + 'rpx', height: props.height + 'rpx', background: 'red' }"> :style="{ width: props.width + 'rpx', height: props.height + 'rpx', background: 'red' }">
<view v-for="(item, index) in _data" :key="index" <view v-for="(item, index) in _data" :key="index"
@ -12,10 +12,10 @@
<movable-view <movable-view
:class="[moveIndex === item._index ? 'opacity-6 zIndex-1' : 'zIndex-0']" :class="[moveIndex === item._index ? 'opacity-6 zIndex-1' : 'zIndex-0']"
:animation="false" :animation="false"
v-passive-touch="drageStart" @touchstart="drageStart"
v-passive-move="(e: Event) => onTouchMove(e, index)" @touchmove="onTouchMove($event, index)"
@touchcancel="dragEnd($event, index)" @touchcancel="dragEnd($event, index)"
v-passive-end="(e: Event) => dragEnd(e, index)" @touchend="dragEnd($event, index)"
@change="eleChange($event, index)" @change="eleChange($event, index)"
:x="item._x" :x="item._x"
:y="item._y" :y="item._y"

View File

@ -2,7 +2,7 @@
<view class="flex flex-row" :style="[{ height: `${props.height}rpx`,width: `${props.width}rpx`,}]"> <view class="flex flex-row" :style="[{ height: `${props.height}rpx`,width: `${props.width}rpx`,}]">
<tmSheet text class="flex-1" :transprent="props.circular" :followTheme="false" _class="flex flex-row flex-1" <tmSheet text class="flex-1" :transprent="props.circular" :followTheme="false" _class="flex flex-row flex-1"
:color="props.bgColor" :margin="[0, 0]" :padding="[0, 0]"> :color="props.bgColor" :margin="[0, 0]" :padding="[0, 0]">
<view @click="setStep('-')" @longpress="longpressEvent('-')" v-passive-end="endlongpressEvent('-')" <view @click="setStep('-')" @longpress="longpressEvent('-')" @touchend="endlongpressEvent('-')"
:class="[!props.circular ? `` : `round-${10}`, 'overflow', _disabled || isJianDisabled ? 'opacity-5' : '']"> :class="[!props.circular ? `` : `round-${10}`, 'overflow', _disabled || isJianDisabled ? 'opacity-5' : '']">
<tmSheet :followTheme="props.followTheme" :round="props.circular ? 10 : props.round" <tmSheet :followTheme="props.followTheme" :round="props.circular ? 10 : props.round"
:linear="props.linear" :linear-deep="props.linearDeep" _class="flex-center" :color="props.color" :linear="props.linear" :linear-deep="props.linearDeep" _class="flex-center" :color="props.color"
@ -23,7 +23,7 @@
} }
]" type="digit" /> ]" type="digit" />
<view @click="setStep('+')" @longpress="longpressEvent('+')" v-passive-end="endlongpressEvent('+')" <view @click="setStep('+')" @longpress="longpressEvent('+')" @touchend="endlongpressEvent('+')"
:class="[!props.circular ? `` : `round-${10}`, 'overflow', _disabled || isAddDisabled ? 'opacity-5' : '']"> :class="[!props.circular ? `` : `round-${10}`, 'overflow', _disabled || isAddDisabled ? 'opacity-5' : '']">
<tmSheet :followTheme="props.followTheme" :round="props.circular ? 10 : props.round" <tmSheet :followTheme="props.followTheme" :round="props.circular ? 10 : props.round"
:linear="props.linear" :linear-deep="props.linearDeep" :_class="'flex-center'" :color="props.color" :linear="props.linear" :linear-deep="props.linearDeep" :_class="'flex-center'" :color="props.color"

View File

@ -49,7 +49,7 @@
</view> </view>
<scroll-view <scroll-view
@scroll="tableScroll" @scroll="tableScroll"
v-passive-touch="scrollDong = 't'" @touchstart="scrollDong = 't'"
@mouseup="scrollDong = 't'" @mouseup="scrollDong = 't'"
class="flex-1" class="flex-1"
:class="['tableHeader']" :class="['tableHeader']"
@ -160,7 +160,7 @@
class="flex-1" class="flex-1"
:scroll-with-animation="false" :scroll-with-animation="false"
@scroll="headerScroll($event, 0)" @scroll="headerScroll($event, 0)"
v-passive-touch="touchStartScroll(0)" @touchstart="touchStartScroll(0)"
@mouseup="touchStartScroll(0)" @mouseup="touchStartScroll(0)"
:scroll-x="true" :scroll-x="true"
:scroll-y="true" :scroll-y="true"

View File

@ -51,8 +51,8 @@
:style="[{ width: _width + 'rpx' }, _height ? { height: _height + 'rpx' } : '']" :style="[{ width: _width + 'rpx' }, _height ? { height: _height + 'rpx' } : '']"
> >
<view <view
v-passive-touch="onScrollStart" @touchStart="onScrollStart"
v-passive-end="onScrollEnd" @touchend="onScrollEnd"
v-if="isShowRender" v-if="isShowRender"
:style="{ transform: `translateY(${reFresh == 2 ? -refreshJuli : 0}px)` }" :style="{ transform: `translateY(${reFresh == 2 ? -refreshJuli : 0}px)` }"
class="flex contentx" class="flex contentx"

View File

@ -8,9 +8,9 @@
<!-- https://ask.dcloud.net.cn/question/143230 --> <!-- https://ask.dcloud.net.cn/question/143230 -->
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view <view
v-passive-move="onMove" @touchmove="onMove"
v-passive-end="onEnd" @touchend="onEnd"
v-passive-touch="onStart" @touchstart="onStart"
@mousemove="onMove" @mousemove="onMove"
@mouseup="onEnd" @mouseup="onEnd"
@mouseleave="onEnd" @mouseleave="onEnd"
@ -28,11 +28,11 @@
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<!-- v-passive-move="onMove" <!-- @touchmove="onMove"
v-passive-end="onEnd" @touchend="onEnd"
v-passive-touch="onStart" --> @touchstart="onStart" -->
<view <view
v-passive-touch="spinNvueAni" @touchstart="spinNvueAni"
ref="tabsDom" ref="tabsDom"
:style="{ :style="{
width: props.swiper ? `${totalWidth}px` : `${props.width}rpx`, width: props.swiper ? `${totalWidth}px` : `${props.width}rpx`,
@ -149,7 +149,7 @@
</tm-sheet> </tm-sheet>
</view> </view>
</view> </view>
<view <view
v-if="props.showTabsLineAni && props.itemWidth > 0 && props.showTabsLine" v-if="props.showTabsLineAni && props.itemWidth > 0 && props.showTabsLine"
class="anilineBar absolute l-0" class="anilineBar absolute l-0"
@ -351,9 +351,9 @@
<!-- #ifndef APP-NVUE --> <!-- #ifndef APP-NVUE -->
<view <view
id="webIdTabs" id="webIdTabs"
v-passive-move="onMove" @touchmove="onMove"
v-passive-end="onEnd" @touchend="onEnd"
v-passive-touch="onStart" @touchstart="onStart"
@touchcancel="onEnd" @touchcancel="onEnd"
@mousemove="onMove" @mousemove="onMove"
@mouseup="onEnd" @mouseup="onEnd"
@ -372,13 +372,13 @@
</view> </view>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef APP-NVUE --> <!-- #ifdef APP-NVUE -->
<!-- v-passive-move="onMove" <!-- @touchmove="onMove"
v-passive-end="onEnd" @touchend="onEnd"
v-passive-touch="onStart" --> @touchstart="onStart" -->
<!-- v-passive-move="onMove" v-passive-end="onEnd" @touchcancel="onEnd" --> <!-- @touchmove="onMove" @touchend="onEnd" @touchcancel="onEnd" -->
<view <view
v-passive-touch="spinNvueAni" @touchstart="spinNvueAni"
v-passive-move="onMove" @touchmove="onMove"
ref="tabsDom" ref="tabsDom"
:style="{ :style="{
width: props.swiper ? `${totalWidth}px` : `${props.width}rpx`, width: props.swiper ? `${totalWidth}px` : `${props.width}rpx`,

View File

@ -11,9 +11,9 @@ interface positionType {
import { useTouchFinger } from '@/tmui/tool/useFun/useTouchFinger' import { useTouchFinger } from '@/tmui/tool/useFun/useTouchFinger'
const {touchstart,touchmove,touchend,touchcancel,addEventListener,direction,deltaXY,preTapPosition,angle,scale } = useTouchFinger(); const {touchstart,touchmove,touchend,touchcancel,addEventListener,direction,deltaXY,preTapPosition,angle,scale } = useTouchFinger();
<image <image
v-passive-touch="touchstart" @touchstart="touchstart"
v-passive-move="touchmove" @touchmove="touchmove"
v-passive-end="touchend" @touchend="touchend"
@touchcancel="touchcancel" @touchcancel="touchcancel"
src="https://pic.rmb.bdstatic.com/bjh/beautify/aee57799c6885386bb748e07fe43f78f.jpeg" src="https://pic.rmb.bdstatic.com/bjh/beautify/aee57799c6885386bb748e07fe43f78f.jpeg"
:style="{transform:`scale(${scale}) rotate(${angle}deg)`,width:'100px',height:'100px'}"></image> :style="{transform:`scale(${scale}) rotate(${angle}deg)`,width:'100px',height:'100px'}"></image>

View File

@ -1,6 +1,6 @@
<template> <template>
<view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']"> <view v-if="showPopup" class="uni-popup" :class="[popupstyle, isDesktop ? 'fixforpc-z-index' : '']">
<view v-passive-touch="touchstart"> <view @touchstart="touchstart">
<uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass" <uni-transition key="1" v-if="maskShow" name="mask" mode-class="fade" :styles="maskClass"
:duration="duration" :show="showTrans" @click="onTap" /> :duration="duration" :show="showTrans" @click="onTap" />
<uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration" <uni-transition key="2" :mode-class="ani" name="content" :styles="transClass" :duration="duration"

View File

@ -57,7 +57,7 @@
> >
<view class="wd-picker__wraper"> <view class="wd-picker__wraper">
<!--toolBar--> <!--toolBar-->
<view class="wd-picker__toolbar" v-passive-move="noop"> <view class="wd-picker__toolbar" @touchmove="noop">
<!--取消按钮--> <!--取消按钮-->
<view class="wd-picker__action wd-picker__action--cancel" @click="onCancel"> <view class="wd-picker__action wd-picker__action--cancel" @click="onCancel">
{{ cancelButtonText || translate('cancel') }} {{ cancelButtonText || translate('cancel') }}

View File

@ -1,8 +1,8 @@
<template> <template>
<view <view
v-passive-move.stop.prevent="handleTouchMove" @touchmove.stop.prevent="handleTouchMove"
v-passive-touch="handleTouchStart" @touchstart="handleTouchStart"
v-passive-end="handleTouchEnd" @touchend="handleTouchEnd"
:class="`wd-fab ${customClass}`" :class="`wd-fab ${customClass}`"
:style="rootStyle" :style="rootStyle"
@click.stop="" @click.stop=""

View File

@ -1,6 +1,6 @@
<template> <template>
<!-- 绘制的图片canvas --> <!-- 绘制的图片canvas -->
<view v-if="modelValue" :class="`wd-img-cropper ${customClass}`" :style="customStyle" v-passive-move="preventTouchMove"> <view v-if="modelValue" :class="`wd-img-cropper ${customClass}`" :style="customStyle" @touchmove="preventTouchMove">
<!-- 展示在用户面前的裁剪框 --> <!-- 展示在用户面前的裁剪框 -->
<view class="wd-img-cropper__wrapper"> <view class="wd-img-cropper__wrapper">
<!-- 画出裁剪框 --> <!-- 画出裁剪框 -->
@ -39,9 +39,9 @@
:src="imgSrc" :src="imgSrc"
:style="imageStyle" :style="imageStyle"
:lazy-load="false" :lazy-load="false"
v-passive-touch="handleImgTouchStart" @touchstart="handleImgTouchStart"
v-passive-move="handleImgTouchMove" @touchmove="handleImgTouchMove"
v-passive-end="handleImgTouchEnd" @touchend="handleImgTouchEnd"
@error="handleImgLoadError" @error="handleImgLoadError"
@load="handleImgLoaded" @load="handleImgLoaded"
/> />

View File

@ -8,8 +8,8 @@
</scroll-view> </scroll-view>
<view <view
class="wd-index-bar__sidebar" class="wd-index-bar__sidebar"
v-passive-move.stop.prevent="handleTouchMove" @touchmove.stop.prevent="handleTouchMove"
v-passive-end.stop.prevent="handleTouchEnd" @touchend.stop.prevent="handleTouchEnd"
@touchcancel.stop.prevent="handleTouchEnd" @touchcancel.stop.prevent="handleTouchEnd"
> >
<view <view

View File

@ -1,5 +1,5 @@
<template> <template>
<view :class="`wd-key-wrapper ${wider ? 'wd-key-wrapper--wider' : ''}`" v-passive-touch="onTouchStart" v-passive-move="onTouchMove" v-passive-end="onTouchEnd"> <view :class="`wd-key-wrapper ${wider ? 'wd-key-wrapper--wider' : ''}`" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd">
<view :class="keyClass"> <view :class="keyClass">
<wd-loading custom-class="wd-key--loading-icon" v-if="props.loading" /> <wd-loading custom-class="wd-key--loading-icon" v-if="props.loading" />
<template v-if="type === 'delete'"> <template v-if="type === 'delete'">

View File

@ -6,7 +6,7 @@
:duration="duration" :duration="duration"
:custom-style="`z-index: ${zIndex}; ${customStyle}`" :custom-style="`z-index: ${zIndex}; ${customStyle}`"
@click="handleClick" @click="handleClick"
v-passive-move.stop.prevent="lockScroll ? noop : ''" @touchmove.stop.prevent="lockScroll ? noop : ''"
> >
<slot></slot> <slot></slot>
</wd-transition> </wd-transition>

View File

@ -1,6 +1,6 @@
<template> <template>
<view :class="`wd-password-input ${customClass}`" :style="customStyle"> <view :class="`wd-password-input ${customClass}`" :style="customStyle">
<view v-passive-touch="onTouchStart" class="wd-password-input__security"> <view @touchstart="onTouchStart" class="wd-password-input__security">
<view <view
v-for="(_, index) in length" v-for="(_, index) in length"
:key="index" :key="index"

View File

@ -38,7 +38,7 @@
custom-class="wd-picker__popup" custom-class="wd-picker__popup"
> >
<view class="wd-picker__wraper"> <view class="wd-picker__wraper">
<view class="wd-picker__toolbar" v-passive-move="noop"> <view class="wd-picker__toolbar" @touchmove="noop">
<view class="wd-picker__action wd-picker__action--cancel" @click="onCancel"> <view class="wd-picker__action wd-picker__action--cancel" @click="onCancel">
{{ cancelButtonText || translate('cancel') }} {{ cancelButtonText || translate('cancel') }}
</view> </view>

View File

@ -7,7 +7,7 @@
:duration="duration" :duration="duration"
:custom-style="modalStyle" :custom-style="modalStyle"
@click="handleClickModal" @click="handleClickModal"
v-passive-move="noop" @touchmove="noop"
/> />
<view v-if="!lazyRender || inited" :class="rootClass" :style="style" @transitionend="onTransitionEnd"> <view v-if="!lazyRender || inited" :class="rootClass" :style="style" @transitionend="onTransitionEnd">
<slot /> <slot />

View File

@ -92,7 +92,7 @@
</view> </view>
</wd-radio-group> </wd-radio-group>
</view> </view>
<view v-if="loading" class="wd-select-picker__loading" v-passive-move="noop"> <view v-if="loading" class="wd-select-picker__loading" @touchmove="noop">
<wd-loading :color="loadingColor" /> <wd-loading :color="loadingColor" />
</view> </view>
</scroll-view> </scroll-view>

View File

@ -12,9 +12,9 @@
<view <view
class="wd-slider__button-wrapper" class="wd-slider__button-wrapper"
:style="buttonLeftStyle" :style="buttonLeftStyle"
v-passive-touch="onTouchStart" @touchstart="onTouchStart"
v-passive-move="onTouchMove" @touchmove="onTouchMove"
v-passive-end="onTouchEnd" @touchend="onTouchEnd"
@touchcancel="onTouchEnd" @touchcancel="onTouchEnd"
> >
<view class="wd-slider__label" v-if="!hideLabel">{{ leftNewValue }}</view> <view class="wd-slider__label" v-if="!hideLabel">{{ leftNewValue }}</view>
@ -25,9 +25,9 @@
v-if="showRight" v-if="showRight"
class="wd-slider__button-wrapper" class="wd-slider__button-wrapper"
:style="buttonRightStyle" :style="buttonRightStyle"
v-passive-touch="onTouchStartRight" @touchstart="onTouchStartRight"
v-passive-move="onTouchMoveRight" @touchmove="onTouchMoveRight"
v-passive-end="onTouchEndRight" @touchend="onTouchEndRight"
@touchcancel="onTouchEndRight" @touchcancel="onTouchEndRight"
> >
<view class="wd-slider__label" v-if="!hideLabel">{{ rightNewValue }}</view> <view class="wd-slider__label" v-if="!hideLabel">{{ rightNewValue }}</view>

View File

@ -4,9 +4,9 @@
:class="`wd-swipe-action ${customClass}`" :class="`wd-swipe-action ${customClass}`"
:style="customStyle" :style="customStyle"
@click.stop="onClick()" @click.stop="onClick()"
v-passive-touch="startDrag" @touchstart="startDrag"
v-passive-move="onDrag" @touchmove="onDrag"
v-passive-end="endDrag" @touchend="endDrag"
@touchcancel="endDrag" @touchcancel="endDrag"
> >
<!--容器--> <!--容器-->
@ -191,7 +191,7 @@ function onDrag(event: TouchEvent) {
if (touch.direction.value === 'vertical') { if (touch.direction.value === 'vertical') {
return return
} else { } else {
// event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
} }

View File

@ -59,7 +59,7 @@
</wd-sticky> </wd-sticky>
<!--标签页--> <!--标签页-->
<view class="wd-tabs__container" v-passive-touch="onTouchStart" v-passive-move="onTouchMove" v-passive-end="onTouchEnd" @touchcancel="onTouchEnd"> <view class="wd-tabs__container" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd" @touchcancel="onTouchEnd">
<view :class="['wd-tabs__body', animated ? 'is-animated' : '']" :style="bodyStyle"> <view :class="['wd-tabs__body', animated ? 'is-animated' : '']" :style="bodyStyle">
<slot /> <slot />
</view> </view>
@ -114,7 +114,7 @@
</view> </view>
<!--标签页--> <!--标签页-->
<view class="wd-tabs__container" v-passive-touch="onTouchStart" v-passive-move="onTouchMove" v-passive-end="onTouchEnd" @touchcancel="onTouchEnd"> <view class="wd-tabs__container" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd" @touchcancel="onTouchEnd">
<view :class="['wd-tabs__body', animated ? 'is-animated' : '']" :style="bodyStyle"> <view :class="['wd-tabs__body', animated ? 'is-animated' : '']" :style="bodyStyle">
<slot /> <slot />
</view> </view>

View File

@ -214,6 +214,27 @@ export function handleSetWebviewStyle(hasTabBar) {
} }
} }
//遍历所有的webview并通信
export function handleFindWebview(evalJS_) {
const findWebview = () => {
let allWebView = plus.webview.all()
allWebView.forEach((webview) => {
//由于webviewId后面的数字是动态分配的在很小情况下OAWebview的Id并不是webviewId1
//因此不做限制,全局广播,由接收页面自行接收处理
// if (webview.id === 'webviewId1') {//找到OAWebview
webview.evalJS(evalJS_)
// }
})
}
if (typeof plus !== 'undefined') {
findWebview()
} else {
document.addEventListener('plusready', () => {
findWebview()
})
}
}
// 通用运算函数 // 通用运算函数
/* /*
函数加法函数用来得到精确的加法结果 函数加法函数用来得到精确的加法结果
@ -223,16 +244,16 @@ export function handleSetWebviewStyle(hasTabBar) {
返回值两数相加的结果 返回值两数相加的结果
*/ */
export function addition(arg1, arg2) { export function addition(arg1, arg2) {
arg1 = arg1.toString(), arg2 = arg2.toString(); ;(arg1 = arg1.toString()), (arg2 = arg2.toString())
var arg1Arr = arg1.split("."), var arg1Arr = arg1.split('.'),
arg2Arr = arg2.split("."), arg2Arr = arg2.split('.'),
d1 = arg1Arr.length == 2 ? arg1Arr[1] : "", d1 = arg1Arr.length == 2 ? arg1Arr[1] : '',
d2 = arg2Arr.length == 2 ? arg2Arr[1] : ""; d2 = arg2Arr.length == 2 ? arg2Arr[1] : ''
var maxLen = Math.max(d1.length, d2.length); var maxLen = Math.max(d1.length, d2.length)
var m = Math.pow(10, maxLen); var m = Math.pow(10, maxLen)
var result = Number(((arg1 * m + arg2 * m) / m).toFixed(maxLen)); var result = Number(((arg1 * m + arg2 * m) / m).toFixed(maxLen))
var d = arguments[2]; var d = arguments[2]
return typeof d === "number" ? Number((result).toFixed(d)) : result; return typeof d === 'number' ? Number(result.toFixed(d)) : result
} }
/* /*
@ -251,12 +272,20 @@ export function addition(arg1, arg2) {
返回值两数相乘的结果 返回值两数相乘的结果
*/ */
export function multiplication(arg1, arg2) { export function multiplication(arg1, arg2) {
var r1 = arg1.toString(), var r1 = arg1.toString(),
r2 = arg2.toString(), r2 = arg2.toString(),
m, resultVal, d = arguments[2]; m,
m = (r1.split(".")[1] ? r1.split(".")[1].length : 0) + (r2.split(".")[1] ? r2.split(".")[1].length : 0); resultVal,
resultVal = Number(r1.replace(".", "")) * Number(r2.replace(".", "")) / Math.pow(10, m); d = arguments[2]
return typeof d !== "number" ? Number(resultVal) : Number(resultVal.toFixed(parseInt(d))); m =
(r1.split('.')[1] ? r1.split('.')[1].length : 0) +
(r2.split('.')[1] ? r2.split('.')[1].length : 0)
resultVal =
(Number(r1.replace('.', '')) * Number(r2.replace('.', ''))) /
Math.pow(10, m)
return typeof d !== 'number'
? Number(resultVal)
: Number(resultVal.toFixed(parseInt(d)))
} }
/* /*
@ -267,10 +296,18 @@ export function multiplication(arg1, arg2) {
返回值arg1除于arg2的结果 返回值arg1除于arg2的结果
*/ */
export function division(arg1, arg2) { export function division(arg1, arg2) {
var r1 = arg1.toString(), var r1 = arg1.toString(),
r2 = arg2.toString(), r2 = arg2.toString(),
m, resultVal, d = arguments[2]; m,
m = (r2.split(".")[1] ? r2.split(".")[1].length : 0) - (r1.split(".")[1] ? r1.split(".")[1].length : 0); resultVal,
resultVal = Number(r1.replace(".", "")) / Number(r2.replace(".", "")) * Math.pow(10, m); d = arguments[2]
return typeof d !== "number" ? Number(resultVal) : Number(resultVal.toFixed(parseInt(d))); m =
(r2.split('.')[1] ? r2.split('.')[1].length : 0) -
(r1.split('.')[1] ? r1.split('.')[1].length : 0)
resultVal =
(Number(r1.replace('.', '')) / Number(r2.replace('.', ''))) *
Math.pow(10, m)
return typeof d !== 'number'
? Number(resultVal)
: Number(resultVal.toFixed(parseInt(d)))
} }