Compare commits
1 Commits
main
...
wyfMain-de
Author | SHA1 | Date | |
---|---|---|---|
82d5642376 |
@ -1,7 +1,6 @@
|
|||||||
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) => {
|
||||||
@ -47,7 +46,23 @@ export const ServeClearTalkUnreadNum = (data, unReadNum) => {
|
|||||||
useTalkStore().findTalkIndex(useDialogueStore().index_name)
|
useTalkStore().findTalkIndex(useDialogueStore().index_name)
|
||||||
]?.is_disturb
|
]?.is_disturb
|
||||||
) {
|
) {
|
||||||
handleFindWebview(`updateUnreadMsgNumReduce('${unReadNum}')`)
|
if (typeof plus !== 'undefined') {
|
||||||
|
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',
|
||||||
@ -68,8 +83,7 @@ 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,
|
||||||
})
|
})
|
||||||
|
@ -4,8 +4,7 @@ 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,
|
||||||
})
|
})
|
||||||
@ -14,8 +13,7 @@ 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,
|
||||||
})
|
})
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
<view
|
<view
|
||||||
:id="popoverBoxId"
|
:id="popoverBoxId"
|
||||||
class="popover-box"
|
class="popover-box"
|
||||||
@touchend="onTouchend"
|
v-passive-end="onTouchend"
|
||||||
@touchstart="onTouchstart"
|
v-passive-touch="onTouchstart"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</view>
|
</view>
|
||||||
@ -75,7 +75,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
v-show="data.popoverShow"
|
v-show="data.popoverShow"
|
||||||
@touchstart="close"
|
v-passive-touch="close"
|
||||||
@click="close"
|
@click="close"
|
||||||
class="popover-bg"
|
class="popover-bg"
|
||||||
></view>
|
></view>
|
||||||
|
@ -1,155 +1,109 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, onMounted, onUnmounted, computed } from 'vue'
|
import { ref, reactive, onMounted } 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 userStore = useUserStore()
|
const audioRef = ref();
|
||||||
const talkParams = reactive({
|
const audioContext = ref<any>(null);
|
||||||
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(() => {
|
||||||
audioContext.value = uni.createInnerAudioContext()
|
// 使用uni-app的方式创建内部音频上下文
|
||||||
audioContext.value.src = props.extra.url
|
audioContext.value = uni.createInnerAudioContext();
|
||||||
|
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)
|
|
||||||
let seconds = value
|
const minutes = Math.floor(value / 60);
|
||||||
|
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
|
<div class="im-message-audio">
|
||||||
class="audio-message"
|
<div class="play">
|
||||||
@click.stop="onPlay"
|
<div class="btn pointer" @click.stop="onPlay">
|
||||||
:class="
|
<n-icon
|
||||||
props?.data?.user_id == talkParams.uid
|
:size="18"
|
||||||
? 'justify-end py-[22rpx] pl-[30rpx] pr-[16rpx]'
|
:component="state.isAudioPlay ? PauseOne : PlayOne"
|
||||||
: '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>
|
||||||
<a-trumpet
|
<div class="desc">
|
||||||
v-if="props?.data?.user_id == talkParams.uid"
|
<span class="line" v-for="i in 23" :key="i"></span>
|
||||||
:isPlay="state.isAudioPlay"
|
<span
|
||||||
color="#C1C1C1"
|
class="indicator"
|
||||||
:size="30"
|
:style="{ left: state.progress + '%' }"
|
||||||
direction="left"
|
v-show="state.progress > 0"
|
||||||
></a-trumpet>
|
></span>
|
||||||
|
</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;
|
||||||
@ -291,7 +245,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);
|
||||||
|
@ -92,8 +92,8 @@ defineExpose({
|
|||||||
<tm-button
|
<tm-button
|
||||||
@click="sendCancel"
|
@click="sendCancel"
|
||||||
:width="319"
|
:width="319"
|
||||||
@touchstart="cancel = false"
|
v-passive-touch="cancel = false"
|
||||||
@touchend="cancel = true"
|
v-passive-end="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"
|
||||||
@touchstart="confirm = false"
|
v-passive-touch="confirm = false"
|
||||||
@touchend="confirm = true"
|
v-passive-end="confirm = true"
|
||||||
:width="319"
|
:width="319"
|
||||||
:fontSize="32"
|
:fontSize="32"
|
||||||
:transprent="confirm"
|
:transprent="confirm"
|
||||||
|
@ -34,7 +34,7 @@ class Connect {
|
|||||||
// 更新 WebSocket 连接状态
|
// 更新 WebSocket 连接状态
|
||||||
useUserStore().updateSocketStatus(true)
|
useUserStore().updateSocketStatus(true)
|
||||||
// online.value = true;
|
// online.value = true;
|
||||||
useTalkStore().loadTalkList()
|
uni.$emit('socket-refresh-talk-list')
|
||||||
},
|
},
|
||||||
// Websocket 断开连接回调方法
|
// Websocket 断开连接回调方法
|
||||||
onClose: () => {
|
onClose: () => {
|
||||||
|
@ -15,7 +15,6 @@ import {
|
|||||||
useDialogueListStore,
|
useDialogueListStore,
|
||||||
useGroupStore,
|
useGroupStore,
|
||||||
} from '@/store'
|
} from '@/store'
|
||||||
import { handleFindWebview } from '@/utils/common'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 好友状态事件
|
* 好友状态事件
|
||||||
@ -155,7 +154,23 @@ class Talk extends Base {
|
|||||||
|
|
||||||
//更新未读数量+1
|
//更新未读数量+1
|
||||||
updateUnreadMsgNumAdd() {
|
updateUnreadMsgNumAdd() {
|
||||||
handleFindWebview(`updateUnreadMsgNumAdd()`)
|
if (typeof plus !== 'undefined') {
|
||||||
|
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()`)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
85
src/main.js
85
src/main.js
@ -23,7 +23,6 @@ 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')
|
||||||
@ -53,6 +52,51 @@ 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) => {
|
||||||
@ -73,7 +117,12 @@ export function createApp() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log('===准备创建本地通知栏消息')
|
console.log('===准备创建本地通知栏消息')
|
||||||
handleFindWebview(`doCreatePushMessage('${msg}')`)
|
let OAWebView = plus.webview.all()
|
||||||
|
OAWebView.forEach((webview, index) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
webview.evalJS(`doCreatePushMessage('${msg}')`)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//处理聊天推送弹窗点开
|
//处理聊天推送弹窗点开
|
||||||
@ -94,14 +143,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、墨册强制刷新时,聊天同步强制刷新
|
||||||
@ -115,7 +164,12 @@ export function createApp() {
|
|||||||
|
|
||||||
//检查聊天页面是否可用
|
//检查聊天页面是否可用
|
||||||
window.checkChatWebviewAvailable = () => {
|
window.checkChatWebviewAvailable = () => {
|
||||||
handleFindWebview(`doneCheckChatWebviewAvailable()`)
|
let OAWebView = plus.webview.all()
|
||||||
|
OAWebView.forEach((webview, index) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
webview.evalJS(`doneCheckChatWebviewAvailable()`)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//获取从base传来的多选视频列表
|
//获取从base传来的多选视频列表
|
||||||
@ -128,19 +182,6 @@ 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') {
|
||||||
|
@ -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, handleFindWebview } from '@/utils/common'
|
import { handleSetWebviewStyle } 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,7 +376,12 @@ onLoad((options) => {
|
|||||||
|
|
||||||
const goWebHome = () => {
|
const goWebHome = () => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
handleFindWebview(`handleBackHost()`)
|
let OAWebView = plus.webview.all()
|
||||||
|
OAWebView.forEach((webview) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
webview.evalJS(`handleBackHost()`)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -342,8 +342,7 @@
|
|||||||
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 {
|
||||||
@ -399,7 +398,12 @@
|
|||||||
})
|
})
|
||||||
const goWebHome = () => {
|
const goWebHome = () => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
handleFindWebview(`handleBackHost()`)
|
let OAWebView = plus.webview.all()
|
||||||
|
OAWebView.forEach((webview) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
webview.evalJS(`handleBackHost()`)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// 添加判断是否为预选成员的方法
|
// 添加判断是否为预选成员的方法
|
||||||
const isPreSelectedMember = (member) => {
|
const isPreSelectedMember = (member) => {
|
||||||
|
@ -57,7 +57,6 @@ 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: {
|
||||||
@ -163,7 +162,12 @@ const photoActionsSelect = (index) => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// handleFindWebview(`getPlusVideoPicker()`)
|
// let OAWebView = plus.webview.all()
|
||||||
|
// OAWebView.forEach((webview, index) => {
|
||||||
|
// if (webview.id === 'webviewId1') {
|
||||||
|
// webview.evalJS(`getPlusVideoPicker()`)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
// return
|
// return
|
||||||
uni.chooseVideo({
|
uni.chooseVideo({
|
||||||
sourceType: ['album'],
|
sourceType: ['album'],
|
||||||
|
@ -256,17 +256,16 @@ const checkSendPermission = () => {
|
|||||||
|
|
||||||
//校验是否需要加好友
|
//校验是否需要加好友
|
||||||
const checkNeedAddFriend = () => {
|
const checkNeedAddFriend = () => {
|
||||||
state.canSendMsg = true
|
let params = {
|
||||||
// let params = {
|
receiver_id: state.userInfo.sys_id, //聊天的用户id
|
||||||
// receiver_id: state.userInfo.sys_id, //聊天的用户id
|
talk_type: 1,
|
||||||
// talk_type: 1,
|
}
|
||||||
// }
|
ServeCheckFriend(params).then((res) => {
|
||||||
// ServeCheckFriend(params).then((res) => {
|
console.log(res)
|
||||||
// console.log(res)
|
if (res?.code === 200) {
|
||||||
// if (res?.code === 200) {
|
state.canSendMsg = res.data?.is_friend || false
|
||||||
// state.canSendMsg = res.data?.is_friend || false
|
}
|
||||||
// }
|
})
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//主动加好友(单向好友)
|
//主动加好友(单向好友)
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
</template> -->
|
</template> -->
|
||||||
|
|
||||||
<!-- 数据加载状态栏 -->
|
<!-- 数据加载状态栏 -->
|
||||||
<div class="dialog-list" @touchstart="handleHidePanel">
|
<div class="dialog-list" v-passive-touch="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)"
|
||||||
@touchstart="() => handleAvatarTouchStart(item)"
|
v-passive-touch="() => handleAvatarTouchStart(item)"
|
||||||
@touchend="handleAvatarTouchEnd"
|
v-passive-end="handleAvatarTouchEnd"
|
||||||
>
|
>
|
||||||
<!-- <im-avatar
|
<!-- <im-avatar
|
||||||
class="pointer"
|
class="pointer"
|
||||||
@ -229,19 +229,10 @@
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="talk-tools voice-content"
|
class="talk-tools voice-content"
|
||||||
v-if="
|
v-if="item.voiceContent"
|
||||||
item?.voiceContent ||
|
|
||||||
(!item?.voiceContent && item?.isVoiceToTexting)
|
|
||||||
"
|
|
||||||
@click="copyVoiceContent(item?.voiceContent || '')"
|
@click="copyVoiceContent(item?.voiceContent || '')"
|
||||||
>
|
>
|
||||||
<wd-loading
|
<span>{{ item.voiceContent }}</span>
|
||||||
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>
|
||||||
|
|
||||||
@ -2719,12 +2710,6 @@ 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)
|
||||||
@ -2751,9 +2736,6 @@ 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')
|
||||||
@ -2782,21 +2764,17 @@ 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
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//语音输入框高度
|
//语音输入框高度
|
||||||
@ -2807,17 +2785,16 @@ const chatInputHeight = computed(() => {
|
|||||||
|
|
||||||
//校验是否需要加好友
|
//校验是否需要加好友
|
||||||
const checkNeedAddFriend = () => {
|
const checkNeedAddFriend = () => {
|
||||||
state.value.isFriendOrSameCompany = true
|
let params = {
|
||||||
// let params = {
|
receiver_id: talkParams.receiver_id, //聊天的用户id
|
||||||
// receiver_id: talkParams.receiver_id, //聊天的用户id
|
talk_type: 1,
|
||||||
// talk_type: 1,
|
}
|
||||||
// }
|
ServeCheckFriend(params).then((res) => {
|
||||||
// ServeCheckFriend(params).then((res) => {
|
console.log(res)
|
||||||
// console.log(res)
|
if (res?.code === 200) {
|
||||||
// if (res?.code === 200) {
|
state.value.isFriendOrSameCompany = res.data?.is_friend || false
|
||||||
// state.value.isFriendOrSameCompany = res.data?.is_friend || false
|
}
|
||||||
// }
|
})
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//主动加好友(单向好友)
|
//主动加好友(单向好友)
|
||||||
@ -2840,16 +2817,9 @@ const copyVoiceContent = (voiceContent) => {
|
|||||||
if (!voiceContent) {
|
if (!voiceContent) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
uni.setClipboardData({
|
clipboard(voiceContent, () => {
|
||||||
data: voiceContent,
|
message.success('复制成功')
|
||||||
showToast: false,
|
|
||||||
success: () => {
|
|
||||||
message.success('复制成功')
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
// clipboard(voiceContent, () => {
|
|
||||||
// message.success('复制成功')
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
|
@ -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="items"
|
v-model="talkListItems"
|
||||||
@query="queryList"
|
@query="queryList"
|
||||||
:loading-more-enabled="false"
|
:loading-more-enabled="false"
|
||||||
:refresher-end-bounce-enabled="false"
|
:refresher-end-bounce-enabled="false"
|
||||||
@ -18,6 +18,7 @@
|
|||||||
: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>
|
||||||
@ -65,9 +66,7 @@
|
|||||||
mode="scaleToFill"
|
mode="scaleToFill"
|
||||||
/>
|
/>
|
||||||
<template v-slot:label>
|
<template v-slot:label>
|
||||||
<div
|
<div class="w-full px-[14rpx]">
|
||||||
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]"
|
||||||
@ -86,7 +85,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]"
|
||||||
>
|
>
|
||||||
@ -103,7 +102,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]"
|
||||||
@ -139,7 +138,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="contentRoot">
|
<div class="contentRoot">
|
||||||
<chatItem
|
<chatItem
|
||||||
v-for="(item, index) in items"
|
v-for="(item, index) in talkListItems"
|
||||||
:key="item.index_name"
|
:key="item.index_name"
|
||||||
:index="index"
|
:index="index"
|
||||||
:data="item"
|
:data="item"
|
||||||
@ -152,7 +151,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 } from 'vue'
|
import { ref, watch, computed, onMounted, onUnmounted } 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'
|
||||||
@ -176,23 +175,34 @@ const dialogueParams = reactive({
|
|||||||
const { userInfo } = useAuth()
|
const { userInfo } = useAuth()
|
||||||
|
|
||||||
const topItems = computed(() => talkStore.topItems)
|
const topItems = computed(() => talkStore.topItems)
|
||||||
const items = computed(() => {
|
const talkListItems = ref(talkStore?.talkItems || [])
|
||||||
// if (searchKeyword.value.length === 0) {
|
watch(
|
||||||
console.log(talkStore.talkItems)
|
() => 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(() => {
|
||||||
@ -245,14 +255,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(
|
||||||
@ -263,28 +273,43 @@ 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)
|
||||||
// 页面显示时重新加载数据
|
// 页面显示时重新加载数据
|
||||||
talkStore
|
if (paging.value) {
|
||||||
.loadTalkList()
|
paging.value.reload()
|
||||||
.then(() => {
|
}
|
||||||
// 如果paging已经初始化,则刷新列表
|
// talkStore
|
||||||
if (paging.value) {
|
// .loadTalkList()
|
||||||
paging.value.reload()
|
// .then(() => {
|
||||||
}
|
// // 如果paging已经初始化,则刷新列表
|
||||||
})
|
// if (paging.value) {
|
||||||
.catch((error) => {
|
// paging.value.reload()
|
||||||
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 (items?.value?.length > 0) {
|
if (talkListItems?.value?.length > 0) {
|
||||||
items.value.forEach((openSession) => {
|
talkListItems.value.forEach((openSession) => {
|
||||||
if (openSession.index_name === options?.openSessionIndexName) {
|
if (openSession.index_name === options?.openSessionIndexName) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
dialogueStore.setDialogue(openSession)
|
dialogueStore.setDialogue(openSession)
|
||||||
|
@ -5,7 +5,6 @@ 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 () => {
|
||||||
@ -41,33 +40,19 @@ export const useDialogueListStore = createGlobalState(() => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const content = {
|
const content = {
|
||||||
content: '我试试传送文件和图片是不是一个接口',
|
content: "我试试传送文件和图片是不是一个接口",
|
||||||
name: '测试excel1.xlsx',
|
name: "测试excel1.xlsx",
|
||||||
path:
|
path: "https://cdn-test.szjixun.cn/fonchain-chat/chat/file/multipart/20250307/727a2371-ffc4-46da-b953-a7d449ff82ff-测试excel1.xlsx",
|
||||||
'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:
|
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'+'")',
|
||||||
'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 = {
|
||||||
@ -84,27 +69,38 @@ export const useDialogueListStore = createGlobalState(() => {
|
|||||||
path: '_doc/chat.db',
|
path: '_doc/chat.db',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
// handleFindWebview(
|
document.addEventListener('plusready', () => {
|
||||||
// `operateSQLite('${encodeURIComponent(JSON.stringify(chatDatabase))}')`,
|
let OAWebView = plus.webview.all()
|
||||||
// )
|
OAWebView.forEach((webview, index) => {
|
||||||
// handleFindWebview(
|
if (webview.id === 'webviewId1') {
|
||||||
// `operateSQLite('${encodeURIComponent(
|
webview.evalJS(
|
||||||
// JSON.stringify(chatDBexecuteSql),
|
`operateSQLite('${encodeURIComponent(
|
||||||
// )}')`,
|
JSON.stringify(chatDatabase),
|
||||||
// )
|
)}')`,
|
||||||
// handleFindWebview(
|
)
|
||||||
// `operateSQLite('${encodeURIComponent(
|
webview.evalJS(
|
||||||
// JSON.stringify(chatDBexecuteSql2),
|
`operateSQLite('${encodeURIComponent(
|
||||||
// )}')`,
|
JSON.stringify(chatDBexecuteSql),
|
||||||
// )
|
)}')`,
|
||||||
// handleFindWebview(
|
)
|
||||||
// `operateSQLite('${encodeURIComponent(JSON.stringify(chatDBSelectSql))}')`,
|
webview.evalJS(
|
||||||
// )
|
`operateSQLite('${encodeURIComponent(
|
||||||
// handleFindWebview(
|
JSON.stringify(chatDBexecuteSql2),
|
||||||
// `operateSQLite('${encodeURIComponent(
|
)}')`,
|
||||||
// JSON.stringify(chatDBIsOpenDatabase),
|
)
|
||||||
// )}')`,
|
webview.evalJS(
|
||||||
// )
|
`operateSQLite('${encodeURIComponent(
|
||||||
|
JSON.stringify(chatDBSelectSql),
|
||||||
|
)}')`,
|
||||||
|
)
|
||||||
|
webview.evalJS(
|
||||||
|
`operateSQLite('${encodeURIComponent(
|
||||||
|
JSON.stringify(chatDBIsOpenDatabase),
|
||||||
|
)}')`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
// testDatabase()
|
// testDatabase()
|
||||||
|
|
||||||
|
@ -2,7 +2,6 @@ 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', {
|
||||||
@ -104,7 +103,23 @@ 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通信,改变未读消息数量
|
||||||
handleFindWebview(`doUpdateUnreadNum('${data.unread_num}')`)
|
if (typeof plus !== 'undefined') {
|
||||||
|
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)
|
||||||
|
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
## 1.0.0(2023-09-05)
|
|
||||||
实现基础功能
|
|
@ -1,130 +0,0 @@
|
|||||||
<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>
|
|
@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
# 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| 方向,上下左右 |
|
|
@ -7,9 +7,9 @@
|
|||||||
<view
|
<view
|
||||||
class="record-btn"
|
class="record-btn"
|
||||||
@longpress="startRecord"
|
@longpress="startRecord"
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove="touchMove"
|
v-passive-move="touchMove"
|
||||||
@touchend="endRecord"
|
v-passive-end="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, handleFindWebview } from '@/utils/common'
|
import { multiplication } from '@/utils/common'
|
||||||
export default {
|
export default {
|
||||||
name: 'nbVoiceRecord',
|
name: 'nbVoiceRecord',
|
||||||
/**
|
/**
|
||||||
@ -355,11 +355,7 @@ export default {
|
|||||||
// }, 1000)
|
// }, 1000)
|
||||||
if (Number(permissionStatus) === 1) {
|
if (Number(permissionStatus) === 1) {
|
||||||
that.continueAppMicro()
|
that.continueAppMicro()
|
||||||
} else if (
|
} else if (Number(permissionStatus) === -1) {
|
||||||
Number(permissionStatus) === -1 ||
|
|
||||||
(Number(permissionStatus) === 0 &&
|
|
||||||
uni.getSystemInfoSync().osName === 'ios')
|
|
||||||
) {
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
content: '检测到您还未授权麦克风哦',
|
content: '检测到您还未授权麦克风哦',
|
||||||
@ -368,10 +364,12 @@ export default {
|
|||||||
cancelText: '保持拒绝',
|
cancelText: '保持拒绝',
|
||||||
success: ({ confirm, cancel }) => {
|
success: ({ confirm, cancel }) => {
|
||||||
if (confirm) {
|
if (confirm) {
|
||||||
handleFindWebview(`handleRequestAndroidPermission('settings')`)
|
let OAWebView = plus.webview.all()
|
||||||
}
|
OAWebView.forEach((webview, index) => {
|
||||||
if (cancel) {
|
if (webview.id === 'webviewId1') {
|
||||||
that.isCheckingPermission = false
|
webview.evalJS(`handleRequestAndroidPermission('settings')`)
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -453,7 +451,12 @@ export default {
|
|||||||
// #endif
|
// #endif
|
||||||
// #ifdef H5
|
// #ifdef H5
|
||||||
if (typeof plus !== 'undefined') {
|
if (typeof plus !== 'undefined') {
|
||||||
handleFindWebview(`handleRequestAndroidPermission('micro')`)
|
let OAWebView = plus.webview.all()
|
||||||
|
OAWebView.forEach((webview, index) => {
|
||||||
|
if (webview.id === 'webviewId1') {
|
||||||
|
webview.evalJS(`handleRequestAndroidPermission('micro')`)
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
that.continueAppMicro(isFirstRequestPer)
|
that.continueAppMicro(isFirstRequestPer)
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- #ifdef MP -->
|
<!-- #ifdef MP -->
|
||||||
<view @touchstart="touch.startDrag" @touchmove.stop="touch.onDrag" @touchend="touch.endDrag" :data-prop="towxsShareData">
|
<view v-passive-touch="touch.startDrag" v-passive-move.stop="touch.onDrag" v-passive-end="touch.endDrag" :data-prop="towxsShareData">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef H5||APP-VUE -->
|
<!-- #ifdef H5||APP-VUE -->
|
||||||
<view @touchstart="touch.startDrag" @touchmove="touch.onDrag" @touchend="touch.endDrag" :data-prop="towxsShareData">
|
<view v-passive-touch="touch.startDrag" v-passive-move="touch.onDrag" v-passive-end="touch.endDrag" :data-prop="towxsShareData">
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef APP-NVUE -->
|
<!-- #ifdef APP-NVUE -->
|
||||||
<view >
|
<view >
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<view @touchstart="touchstart" :style="{ left: _offset[0] + 'rpx', top: _offset[1] + 'rpx' }" class="div" id="adsorb" ref="adsorb">
|
<view v-passive-touch="touchstart" :style="{ left: _offset[0] + 'rpx', top: _offset[1] + 'rpx' }" class="div" id="adsorb" ref="adsorb">
|
||||||
<view
|
<view
|
||||||
:eventPenetrationEnabled="true"
|
:eventPenetrationEnabled="true"
|
||||||
:style="{
|
:style="{
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<button
|
<button
|
||||||
@click="onclick"
|
@click="onclick"
|
||||||
@touchstart="touchstart"
|
v-passive-touch="touchstart"
|
||||||
@touchend="touchend"
|
v-passive-end="touchend"
|
||||||
@longpress="emits('longpress', $event)"
|
@longpress="emits('longpress', $event)"
|
||||||
@touchcancel="touchcancel"
|
@touchcancel="touchcancel"
|
||||||
@touchmove="emits('touchmove', $event)"
|
v-passive-move="(e: Event) => emits('touchmove', e)"
|
||||||
@getphonenumber="emits('getphonenumber', $event)"
|
@getphonenumber="emits('getphonenumber', $event)"
|
||||||
@error="emits('error', $event)"
|
@error="emits('error', $event)"
|
||||||
@opensetting="emits('opensetting', $event)"
|
@opensetting="emits('opensetting', $event)"
|
||||||
|
@ -5,9 +5,9 @@
|
|||||||
<canvas
|
<canvas
|
||||||
@click="emits('click', $event)"
|
@click="emits('click', $event)"
|
||||||
v-if="!isPc"
|
v-if="!isPc"
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove="touchMove"
|
v-passive-move="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="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)"
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove="touchMove"
|
v-passive-move="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="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)"
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove="touchMove"
|
v-passive-move="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="touchEnd"
|
||||||
type="2d"
|
type="2d"
|
||||||
:id="canvasId"
|
:id="canvasId"
|
||||||
:canvas-id="canvasId"
|
:canvas-id="canvasId"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<view @touchmove.stop="stopMove" class="flex flex-col flex-col-top-center">
|
<view v-passive-move.stop="stopMove" class="flex flex-col flex-col-top-center">
|
||||||
<view
|
<view
|
||||||
@touchmove.stop="stopMove"
|
v-passive-move.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
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove="touchMove"
|
v-passive-move="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="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
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove="touchMove"
|
v-passive-move="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="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"
|
||||||
@touchstart="colorTouch.startDrag"
|
v-passive-touch="colorTouch.startDrag"
|
||||||
@touchmove="colorTouch.onDrag"
|
v-passive-move="colorTouch.onDrag"
|
||||||
@touchend="colorTouch.endDrag"
|
v-passive-end="colorTouch.endDrag"
|
||||||
@touchcancel="colorTouch.endDrag"
|
@touchcancel="colorTouch.endDrag"
|
||||||
>
|
>
|
||||||
<view class="itemwk" @touchend="touchEndWk(0)" @touchmove="touchEndWk(0)"></view>
|
<view class="itemwk" v-passive-end="touchEndWk(0)" v-passive-move="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"
|
||||||
@touchstart="colorTouch.startDrag2"
|
v-passive-touch="colorTouch.startDrag2"
|
||||||
@touchmove="colorTouch.onDrag2"
|
v-passive-move="colorTouch.onDrag2"
|
||||||
@touchend="colorTouch.endDrag2"
|
v-passive-end="colorTouch.endDrag2"
|
||||||
@touchcancel="colorTouch.endDrag2"
|
@touchcancel="colorTouch.endDrag2"
|
||||||
>
|
>
|
||||||
<view class="itemwk" @touchend="touchEndWk(1)" @touchmove="touchEndWk(1)"></view>
|
<view class="itemwk" v-passive-end="touchEndWk(1)" v-passive-move="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" @touchstart="nvueStartH">
|
<view id="wrapper" ref="wrapper" class="absolute l-0 t-0 wrapper item" v-passive-touch="nvueStartH">
|
||||||
<view class="itemwk"></view>
|
<view class="itemwk"></view>
|
||||||
</view>
|
</view>
|
||||||
<view id="wrapper2" ref="wrapper2" class="absolute r-0 t-0 wrapper item" @touchstart="nvueStartS">
|
<view id="wrapper2" ref="wrapper2" class="absolute r-0 t-0 wrapper item" v-passive-touch="nvueStartS">
|
||||||
<view class="itemwk"></view>
|
<view class="itemwk"></view>
|
||||||
</view>
|
</view>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view
|
<view
|
||||||
@longpress=""
|
@longpress=""
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove.stop.prevent="touchMove"
|
v-passive-move.stop.prevent="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="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"
|
||||||
|
@ -39,12 +39,12 @@
|
|||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:style="{ height: h - 1 + 'px', width: '100rpx' }"
|
:style="{ height: h - 1 + 'px', width: '100rpx' }"
|
||||||
@touchstart.stop.prevent="m_start($event, index)"
|
v-passive-touch.stop.prevent="(e: Event) => m_start(e, index)"
|
||||||
@longpress="m_start_longpress(index)"
|
@longpress="m_start_longpress(index)"
|
||||||
@mousedown="m_start($event, index)"
|
@mousedown="m_start($event, index)"
|
||||||
@touchmove.stop.prevent="m_move($event, index)"
|
v-passive-move.stop.prevent="(e: Event) => m_move(e, index)"
|
||||||
@mousemove.stop.prevent="m_move($event, index)"
|
@mousemove.stop.prevent="m_move($event, index)"
|
||||||
@touchend="m_end($event, index)"
|
v-passive-end="(e: Event) => m_end(e, 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,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<view
|
<view
|
||||||
v-if="show"
|
v-if="show"
|
||||||
@click.stop="closeDromenu"
|
@click.stop="closeDromenu"
|
||||||
@touchmove.stop=""
|
v-passive-move.stop=""
|
||||||
class="l-0 t-0 fixed zIndex-9"
|
class="l-0 t-0 fixed zIndex-9"
|
||||||
:style="[
|
:style="[
|
||||||
{
|
{
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
<!-- 背景遮罩,透明背景 -->
|
<!-- 背景遮罩,透明背景 -->
|
||||||
<view
|
<view
|
||||||
@click="close"
|
@click="close"
|
||||||
@touchmove.stop="stopEvent"
|
v-passive-move.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"
|
||||||
@touchmove.stop="stopEvent"
|
v-passive-move.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"
|
||||||
@touchmove.stop="stopEvent"
|
v-passive-move.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',
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
:style="[{ height: `${navright.length * navHeight}rpx`, width: '60rpx' }]"
|
:style="[{ height: `${navright.length * navHeight}rpx`, width: '60rpx' }]"
|
||||||
@touchstart="touchStart"
|
v-passive-touch="touchStart"
|
||||||
@touchmove.stop.prevent="touchMove"
|
v-passive-move.stop.prevent="touchMove"
|
||||||
@touchend="touchEnd"
|
v-passive-end="touchEnd"
|
||||||
id="navlist"
|
id="navlist"
|
||||||
ref="navlist"
|
ref="navlist"
|
||||||
class="flex flex-col flex-center"
|
class="flex flex-col flex-center"
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
|
|
||||||
<view
|
<view
|
||||||
@touchmove.prevent=""
|
v-passive-move.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 */
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
<scroll-view
|
<scroll-view
|
||||||
class="scroyy"
|
class="scroyy"
|
||||||
:scroll-top="scrollTop"
|
:scroll-top="scrollTop"
|
||||||
@touchstart="onTouchStart"
|
v-passive-touch="onTouchStart"
|
||||||
@touchmove="onTouchMove"
|
v-passive-move="onTouchMove"
|
||||||
@touchend="onTouchEnd"
|
v-passive-end="onTouchEnd"
|
||||||
@scroll="onScroll"
|
@scroll="onScroll"
|
||||||
@scrolltoupper="onScrollToTop"
|
@scrolltoupper="onScrollToTop"
|
||||||
@scrolltolower="onScrollToBottom"
|
@scrolltolower="onScrollToBottom"
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
<scroll-view
|
<scroll-view
|
||||||
class="scroyy"
|
class="scroyy"
|
||||||
:scroll-top="scrollTop"
|
:scroll-top="scrollTop"
|
||||||
@touchstart="onTouchStart"
|
v-passive-touch="onTouchStart"
|
||||||
@touchmove="onTouchMove"
|
v-passive-move="onTouchMove"
|
||||||
@touchend="onTouchEnd"
|
v-passive-end="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' }">
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
:blurEffect="blurEffect"
|
:blurEffect="blurEffect"
|
||||||
@click="onClick"
|
@click="onClick"
|
||||||
@longpress="longpress"
|
@longpress="longpress"
|
||||||
@touchend="touchend"
|
v-passive-end="touchend"
|
||||||
@touchstart="touchstart"
|
v-passive-touch="touchstart"
|
||||||
@touchcancel="touchcancel"
|
@touchcancel="touchcancel"
|
||||||
@mousedown="mousedown"
|
@mousedown="mousedown"
|
||||||
@mouseup="mouseup"
|
@mouseup="mouseup"
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
<!-- #ifdef APP-NVUE -->
|
<!-- #ifdef APP-NVUE -->
|
||||||
<gcanvas
|
<gcanvas
|
||||||
v-if="show"
|
v-if="show"
|
||||||
@touchstart="touchstart"
|
v-passive-touch="touchstart"
|
||||||
@touchmove="touchsmove"
|
v-passive-move="touchsmove"
|
||||||
@touchend="touchsend"
|
v-passive-end="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
|
||||||
@touchstart="touchstart"
|
v-passive-touch="touchstart"
|
||||||
@touchmove="touchsmove"
|
v-passive-move="touchsmove"
|
||||||
@touchend="touchsend"
|
v-passive-end="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
|
||||||
@touchstart.stop="touchstart"
|
v-passive-touch.stop="touchstart"
|
||||||
@touchmove.stop="touchsmove"
|
v-passive-move.stop="touchsmove"
|
||||||
@touchend.stop="touchsend"
|
v-passive-end.stop="touchsend"
|
||||||
@mousedown.stop="touchstart"
|
@mousedown.stop="touchstart"
|
||||||
@mousemove.stop="touchsmove"
|
@mousemove.stop="touchsmove"
|
||||||
@mouseup.stop="touchsend"
|
@mouseup.stop="touchsend"
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
<view >
|
<view >
|
||||||
<view
|
<view
|
||||||
v-if="!_disabled"
|
v-if="!_disabled"
|
||||||
@touchstart="startDrag"
|
v-passive-touch="startDrag"
|
||||||
@touchmove="onDrag"
|
v-passive-move="onDrag"
|
||||||
@touchend="endDrag"
|
v-passive-end="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')"
|
||||||
@touchstart.stop="touchstart"
|
v-passive-touch.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 {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<!-- <view
|
<!-- <view
|
||||||
data-text="hehe"
|
data-text="hehe"
|
||||||
@touchstart.stop="test.touchstart" @mousedown.stop="movestart" @touchmove.stop="test.touchmove" @mousemove.stop="moveing" @touchend.stop="moveend" @mouseup.stop="moveend" @mouseleave.stop="moveend"
|
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"
|
||||||
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
|
||||||
@touchstart.stop="movestart"
|
v-passive-touch.stop="movestart"
|
||||||
@mousedown.stop="movestart"
|
@mousedown.stop="movestart"
|
||||||
@touchmove.stop="moveing"
|
v-passive-move.stop="moveing"
|
||||||
@mousemove.stop="moveing"
|
@mousemove.stop="moveing"
|
||||||
@touchend.stop="moveend"
|
v-passive-end.stop="moveend"
|
||||||
@mouseup.stop="moveend"
|
@mouseup.stop="moveend"
|
||||||
@mouseleave.stop="moveend"
|
@mouseleave.stop="moveend"
|
||||||
class="absolute"
|
class="absolute"
|
||||||
|
@ -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"
|
||||||
@touchstart="drageStart"
|
v-passive-touch="drageStart"
|
||||||
@touchmove="onTouchMove($event, index)"
|
v-passive-move="(e: Event) => onTouchMove(e, index)"
|
||||||
@touchcancel="dragEnd($event, index)"
|
@touchcancel="dragEnd($event, index)"
|
||||||
@touchend="dragEnd($event, index)"
|
v-passive-end="(e: Event) => dragEnd(e, index)"
|
||||||
@change="eleChange($event, index)"
|
@change="eleChange($event, index)"
|
||||||
:x="item._x"
|
:x="item._x"
|
||||||
:y="item._y"
|
:y="item._y"
|
||||||
|
@ -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('-')" @touchend="endlongpressEvent('-')"
|
<view @click="setStep('-')" @longpress="longpressEvent('-')" v-passive-end="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('+')" @touchend="endlongpressEvent('+')"
|
<view @click="setStep('+')" @longpress="longpressEvent('+')" v-passive-end="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"
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<scroll-view
|
<scroll-view
|
||||||
@scroll="tableScroll"
|
@scroll="tableScroll"
|
||||||
@touchstart="scrollDong = 't'"
|
v-passive-touch="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)"
|
||||||
@touchstart="touchStartScroll(0)"
|
v-passive-touch="touchStartScroll(0)"
|
||||||
@mouseup="touchStartScroll(0)"
|
@mouseup="touchStartScroll(0)"
|
||||||
:scroll-x="true"
|
:scroll-x="true"
|
||||||
:scroll-y="true"
|
:scroll-y="true"
|
||||||
|
@ -51,8 +51,8 @@
|
|||||||
:style="[{ width: _width + 'rpx' }, _height ? { height: _height + 'rpx' } : '']"
|
:style="[{ width: _width + 'rpx' }, _height ? { height: _height + 'rpx' } : '']"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
@touchStart="onScrollStart"
|
v-passive-touch="onScrollStart"
|
||||||
@touchend="onScrollEnd"
|
v-passive-end="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"
|
||||||
|
@ -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
|
||||||
@touchmove="onMove"
|
v-passive-move="onMove"
|
||||||
@touchend="onEnd"
|
v-passive-end="onEnd"
|
||||||
@touchstart="onStart"
|
v-passive-touch="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 -->
|
||||||
<!-- @touchmove="onMove"
|
<!-- v-passive-move="onMove"
|
||||||
@touchend="onEnd"
|
v-passive-end="onEnd"
|
||||||
@touchstart="onStart" -->
|
v-passive-touch="onStart" -->
|
||||||
<view
|
<view
|
||||||
@touchstart="spinNvueAni"
|
v-passive-touch="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"
|
||||||
@touchmove="onMove"
|
v-passive-move="onMove"
|
||||||
@touchend="onEnd"
|
v-passive-end="onEnd"
|
||||||
@touchstart="onStart"
|
v-passive-touch="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 -->
|
||||||
<!-- @touchmove="onMove"
|
<!-- v-passive-move="onMove"
|
||||||
@touchend="onEnd"
|
v-passive-end="onEnd"
|
||||||
@touchstart="onStart" -->
|
v-passive-touch="onStart" -->
|
||||||
<!-- @touchmove="onMove" @touchend="onEnd" @touchcancel="onEnd" -->
|
<!-- v-passive-move="onMove" v-passive-end="onEnd" @touchcancel="onEnd" -->
|
||||||
<view
|
<view
|
||||||
@touchstart="spinNvueAni"
|
v-passive-touch="spinNvueAni"
|
||||||
@touchmove="onMove"
|
v-passive-move="onMove"
|
||||||
ref="tabsDom"
|
ref="tabsDom"
|
||||||
:style="{
|
:style="{
|
||||||
width: props.swiper ? `${totalWidth}px` : `${props.width}rpx`,
|
width: props.swiper ? `${totalWidth}px` : `${props.width}rpx`,
|
||||||
|
@ -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
|
||||||
@touchstart="touchstart"
|
v-passive-touch="touchstart"
|
||||||
@touchmove="touchmove"
|
v-passive-move="touchmove"
|
||||||
@touchend="touchend"
|
v-passive-end="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>
|
||||||
|
@ -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 @touchstart="touchstart">
|
<view v-passive-touch="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"
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
>
|
>
|
||||||
<view class="wd-picker__wraper">
|
<view class="wd-picker__wraper">
|
||||||
<!--toolBar-->
|
<!--toolBar-->
|
||||||
<view class="wd-picker__toolbar" @touchmove="noop">
|
<view class="wd-picker__toolbar" v-passive-move="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') }}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view
|
<view
|
||||||
@touchmove.stop.prevent="handleTouchMove"
|
v-passive-move.stop.prevent="handleTouchMove"
|
||||||
@touchstart="handleTouchStart"
|
v-passive-touch="handleTouchStart"
|
||||||
@touchend="handleTouchEnd"
|
v-passive-end="handleTouchEnd"
|
||||||
:class="`wd-fab ${customClass}`"
|
:class="`wd-fab ${customClass}`"
|
||||||
:style="rootStyle"
|
:style="rootStyle"
|
||||||
@click.stop=""
|
@click.stop=""
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 绘制的图片canvas -->
|
<!-- 绘制的图片canvas -->
|
||||||
<view v-if="modelValue" :class="`wd-img-cropper ${customClass}`" :style="customStyle" @touchmove="preventTouchMove">
|
<view v-if="modelValue" :class="`wd-img-cropper ${customClass}`" :style="customStyle" v-passive-move="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"
|
||||||
@touchstart="handleImgTouchStart"
|
v-passive-touch="handleImgTouchStart"
|
||||||
@touchmove="handleImgTouchMove"
|
v-passive-move="handleImgTouchMove"
|
||||||
@touchend="handleImgTouchEnd"
|
v-passive-end="handleImgTouchEnd"
|
||||||
@error="handleImgLoadError"
|
@error="handleImgLoadError"
|
||||||
@load="handleImgLoaded"
|
@load="handleImgLoaded"
|
||||||
/>
|
/>
|
||||||
|
@ -8,8 +8,8 @@
|
|||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view
|
<view
|
||||||
class="wd-index-bar__sidebar"
|
class="wd-index-bar__sidebar"
|
||||||
@touchmove.stop.prevent="handleTouchMove"
|
v-passive-move.stop.prevent="handleTouchMove"
|
||||||
@touchend.stop.prevent="handleTouchEnd"
|
v-passive-end.stop.prevent="handleTouchEnd"
|
||||||
@touchcancel.stop.prevent="handleTouchEnd"
|
@touchcancel.stop.prevent="handleTouchEnd"
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :class="`wd-key-wrapper ${wider ? 'wd-key-wrapper--wider' : ''}`" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd">
|
<view :class="`wd-key-wrapper ${wider ? 'wd-key-wrapper--wider' : ''}`" v-passive-touch="onTouchStart" v-passive-move="onTouchMove" v-passive-end="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'">
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
:duration="duration"
|
:duration="duration"
|
||||||
:custom-style="`z-index: ${zIndex}; ${customStyle}`"
|
:custom-style="`z-index: ${zIndex}; ${customStyle}`"
|
||||||
@click="handleClick"
|
@click="handleClick"
|
||||||
@touchmove.stop.prevent="lockScroll ? noop : ''"
|
v-passive-move.stop.prevent="lockScroll ? noop : ''"
|
||||||
>
|
>
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</wd-transition>
|
</wd-transition>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :class="`wd-password-input ${customClass}`" :style="customStyle">
|
<view :class="`wd-password-input ${customClass}`" :style="customStyle">
|
||||||
<view @touchstart="onTouchStart" class="wd-password-input__security">
|
<view v-passive-touch="onTouchStart" class="wd-password-input__security">
|
||||||
<view
|
<view
|
||||||
v-for="(_, index) in length"
|
v-for="(_, index) in length"
|
||||||
:key="index"
|
:key="index"
|
||||||
|
@ -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" @touchmove="noop">
|
<view class="wd-picker__toolbar" v-passive-move="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>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
:duration="duration"
|
:duration="duration"
|
||||||
:custom-style="modalStyle"
|
:custom-style="modalStyle"
|
||||||
@click="handleClickModal"
|
@click="handleClickModal"
|
||||||
@touchmove="noop"
|
v-passive-move="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 />
|
||||||
|
@ -92,7 +92,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</wd-radio-group>
|
</wd-radio-group>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="loading" class="wd-select-picker__loading" @touchmove="noop">
|
<view v-if="loading" class="wd-select-picker__loading" v-passive-move="noop">
|
||||||
<wd-loading :color="loadingColor" />
|
<wd-loading :color="loadingColor" />
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
@ -12,9 +12,9 @@
|
|||||||
<view
|
<view
|
||||||
class="wd-slider__button-wrapper"
|
class="wd-slider__button-wrapper"
|
||||||
:style="buttonLeftStyle"
|
:style="buttonLeftStyle"
|
||||||
@touchstart="onTouchStart"
|
v-passive-touch="onTouchStart"
|
||||||
@touchmove="onTouchMove"
|
v-passive-move="onTouchMove"
|
||||||
@touchend="onTouchEnd"
|
v-passive-end="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"
|
||||||
@touchstart="onTouchStartRight"
|
v-passive-touch="onTouchStartRight"
|
||||||
@touchmove="onTouchMoveRight"
|
v-passive-move="onTouchMoveRight"
|
||||||
@touchend="onTouchEndRight"
|
v-passive-end="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>
|
||||||
|
@ -4,9 +4,9 @@
|
|||||||
:class="`wd-swipe-action ${customClass}`"
|
:class="`wd-swipe-action ${customClass}`"
|
||||||
:style="customStyle"
|
:style="customStyle"
|
||||||
@click.stop="onClick()"
|
@click.stop="onClick()"
|
||||||
@touchstart="startDrag"
|
v-passive-touch="startDrag"
|
||||||
@touchmove="onDrag"
|
v-passive-move="onDrag"
|
||||||
@touchend="endDrag"
|
v-passive-end="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()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
</wd-sticky>
|
</wd-sticky>
|
||||||
|
|
||||||
<!--标签页-->
|
<!--标签页-->
|
||||||
<view class="wd-tabs__container" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd" @touchcancel="onTouchEnd">
|
<view class="wd-tabs__container" v-passive-touch="onTouchStart" v-passive-move="onTouchMove" v-passive-end="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" @touchstart="onTouchStart" @touchmove="onTouchMove" @touchend="onTouchEnd" @touchcancel="onTouchEnd">
|
<view class="wd-tabs__container" v-passive-touch="onTouchStart" v-passive-move="onTouchMove" v-passive-end="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>
|
||||||
|
@ -214,27 +214,6 @@ 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()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 通用运算函数
|
// 通用运算函数
|
||||||
/*
|
/*
|
||||||
函数,加法函数,用来得到精确的加法结果
|
函数,加法函数,用来得到精确的加法结果
|
||||||
@ -244,16 +223,16 @@ export function handleFindWebview(evalJS_) {
|
|||||||
返回值:两数相加的结果
|
返回值:两数相加的结果
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -272,20 +251,12 @@ 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,
|
m, resultVal, d = arguments[2];
|
||||||
resultVal,
|
m = (r1.split(".")[1] ? r1.split(".")[1].length : 0) + (r2.split(".")[1] ? r2.split(".")[1].length : 0);
|
||||||
d = arguments[2]
|
resultVal = Number(r1.replace(".", "")) * Number(r2.replace(".", "")) / Math.pow(10, m);
|
||||||
m =
|
return typeof d !== "number" ? Number(resultVal) : Number(resultVal.toFixed(parseInt(d)));
|
||||||
(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)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -296,18 +267,10 @@ 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,
|
m, resultVal, d = arguments[2];
|
||||||
resultVal,
|
m = (r2.split(".")[1] ? r2.split(".")[1].length : 0) - (r1.split(".")[1] ? r1.split(".")[1].length : 0);
|
||||||
d = arguments[2]
|
resultVal = Number(r1.replace(".", "")) / Number(r2.replace(".", "")) * Math.pow(10, m);
|
||||||
m =
|
return typeof d !== "number" ? Number(resultVal) : Number(resultVal.toFixed(parseInt(d)));
|
||||||
(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)))
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user