12
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import defaultGroupIcon from "static/images/contact_my_group.png";
|
||||
import defaultNotifyIcon from "static/images/default_notify_icon.png";
|
||||
import defaultGroupIcon from "@/static/images/contact_my_group.png";
|
||||
import defaultNotifyIcon from "@/static/images/default_notify_icon.png";
|
||||
import util from "@/util";
|
||||
export default {
|
||||
name: "MyAvatar",
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<body class="body">
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
|
||||
@@ -54,6 +54,8 @@ const app = new Vue({
|
||||
});
|
||||
|
||||
// 引入请求封装
|
||||
require("./util/request/index")(app);
|
||||
import request from "./util/request/index";
|
||||
request(app)
|
||||
//require("./util/request/index")(app);
|
||||
|
||||
app.$mount();
|
||||
@@ -269,6 +269,7 @@
|
||||
{
|
||||
"path": "pages/common/webview",
|
||||
"style": {
|
||||
"navigationStyle": "default",
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
|
||||
+46
-13
@@ -1,7 +1,25 @@
|
||||
<template>
|
||||
<view class="scan_page">
|
||||
<uni-nav-bar left-icon="back" fixed backgroundColor="transparent" statusBar></uni-nav-bar>
|
||||
<barcode id='1' class="barcode" autostart="true" ref="barcode" background="rgb(0,0,0)" frameColor="#1C86EE" scanbarColor="#1C86EE" :filters="fil" @marked="success1" @error="fail1"></barcode>
|
||||
<view class="scan_page" :style="{height:windowHeight+'px'}">
|
||||
<uni-nav-bar
|
||||
left-icon="back"
|
||||
@clickLeft="back"
|
||||
fixed
|
||||
backgroundColor="#FFF"
|
||||
statusBar
|
||||
>
|
||||
</uni-nav-bar>
|
||||
<barcode id='1'
|
||||
class="barcode"
|
||||
ref="barcode"
|
||||
:autostart="true"
|
||||
background="rgb(0,0,0)"
|
||||
frameColor="#07c160"
|
||||
scanbarColor="#07c160"
|
||||
:style="{height:windowHeight+'px'}"
|
||||
:filters="fil"
|
||||
@marked="success"
|
||||
@error="fail">
|
||||
</barcode>
|
||||
<view class="overlay">
|
||||
<button class="btn" @click="toStart">开始扫码识别</button>
|
||||
<button class="btn" @click="tocancel">取消扫码识别</button>
|
||||
@@ -13,20 +31,30 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
onLoad() {
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
fil: [0, 2, 1]
|
||||
fil: [0, 2, 1,3,4,12],
|
||||
windowHeight:500,
|
||||
}
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
uni.scanCode({
|
||||
complete(res) {
|
||||
console.log(res)
|
||||
}
|
||||
})
|
||||
},
|
||||
created() {
|
||||
const info = uni.getSystemInfoSync();
|
||||
console.log(info);
|
||||
this.windowHeight = info.screenHeight;
|
||||
},
|
||||
methods: {
|
||||
success1(e) {
|
||||
success(e) {
|
||||
console.log("success1:" + JSON.stringify(e));
|
||||
},
|
||||
fail1(e) {
|
||||
fail(e) {
|
||||
console.log("fail1:" + JSON.stringify(e));
|
||||
},
|
||||
toStart: function() {
|
||||
@@ -49,6 +77,9 @@
|
||||
,(e)=>{
|
||||
console.log("scan_error:"+JSON.stringify(e));
|
||||
});
|
||||
},
|
||||
back(){
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,12 +88,9 @@
|
||||
<style lang="scss" scoped>
|
||||
.scan_page{
|
||||
width: 750rpx;
|
||||
height: 100vh;
|
||||
position: relative;
|
||||
background: #800000;
|
||||
.barcode {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
width: 750rpx;
|
||||
background-color: #808080;
|
||||
}
|
||||
|
||||
@@ -76,6 +104,11 @@
|
||||
}
|
||||
.overlay{
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
position: absolute;
|
||||
bottom: 100rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 200rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
linkUrl: "",
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.linkUrl = 'https://doc.rentsoft.cn/'
|
||||
onLoad(opt) {
|
||||
if(opt.url){
|
||||
this.linkUrl = opt.url;
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<script>
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ActionItem from "./ActionItem.vue";
|
||||
import contact_add_search_user_img from "static/images/contact_add_search_user.png"
|
||||
import contact_add_join_group_img from "static/images/contact_add_join_group.png"
|
||||
import contact_add_create_group_img from "static/images/contact_add_create_group.png"
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
@@ -24,13 +27,13 @@
|
||||
idx: 0,
|
||||
title: "创建群聊",
|
||||
desc: "创建群聊,全面使用OpenIM",
|
||||
icon: require("static/images/contact_add_create_group.png"),
|
||||
icon: contact_add_create_group_img,
|
||||
},
|
||||
{
|
||||
idx: 1,
|
||||
title: "添加群聊",
|
||||
desc: "向管理员或团队成员询问ID",
|
||||
icon: require("static/images/contact_add_join_group.png"),
|
||||
icon: rcontact_add_join_group_img,
|
||||
},
|
||||
],
|
||||
friendActionMenus: [
|
||||
@@ -38,7 +41,7 @@
|
||||
idx: 0,
|
||||
title: "添加好友",
|
||||
desc: "通过手机号/ID号/搜索添加",
|
||||
icon: require("static/images/contact_add_search_user.png"),
|
||||
icon: contact_add_search_user_img,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import {ContactMenuTypes} from "@/constant";
|
||||
import contact_new_friend_img from "@/static/images/contact_new_friend.png";
|
||||
import contact_new_group_img from "@/static/images/contact_new_group.png";
|
||||
import contact_my_friend_img from "@/static/images/contact_my_friend.png";
|
||||
import contact_my_group_img from "@/static/images/contact_my_group.png";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
@@ -43,13 +47,13 @@
|
||||
idx: 0,
|
||||
type: ContactMenuTypes.NewFriend,
|
||||
title: "新的好友",
|
||||
icon: require("static/images/contact_new_friend.png"),
|
||||
icon: contact_new_friend_img,
|
||||
},
|
||||
// {
|
||||
// idx: 1,
|
||||
// type: ContactMenuTypes.NewGroup,
|
||||
// title: "新的群组",
|
||||
// icon: require("static/images/contact_new_group.png"),
|
||||
// icon: contact_new_group_img,
|
||||
// },
|
||||
];
|
||||
},
|
||||
@@ -59,14 +63,14 @@
|
||||
// idx: 2,
|
||||
// type: ContactMenuTypes.MyFriend,
|
||||
// title: "我的好友",
|
||||
// icon: require("static/images/contact_my_friend.png"),
|
||||
// icon: contact_my_friend_img,
|
||||
// badge: 0,
|
||||
// },
|
||||
{
|
||||
idx: 3,
|
||||
type: ContactMenuTypes.MyGroup,
|
||||
title: "群聊",
|
||||
icon: require("static/images/contact_my_group.png"),
|
||||
icon: contact_my_group_img,
|
||||
badge: 0,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
<script>
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ActionItem from "../contactAdd/ActionItem.vue";
|
||||
import switch_join_id_img from "@/static/images/switch_join_id.png";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
@@ -36,7 +37,7 @@ export default {
|
||||
idx: 1,
|
||||
title: "群ID号加入",
|
||||
desc: "向管理员或团队成员询问ID",
|
||||
icon: require("static/images/switch_join_id.png"),
|
||||
icon: switch_join_id_img,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view style="padding:0rpx 20rpx;position: absolute;bottom: 1rpx;right: 10rpx;
|
||||
width: 250rpx;height: 150rpx;z-index: 1000;opacity: 0.9;" class="u-flex u-row-right u-col-center">
|
||||
width: 250rpx;height: 150rpx;z-index: 1000;opacity: 0.9;"
|
||||
class="u-flex u-row-right u-col-center">
|
||||
<view class="u-flex u-row-center u-col-center"
|
||||
style="border: 1px solid #f1f1f1;border-radius: 10rpx; background-color: #82848a;width: 100rpx;padding: 15rpx 20rpx;margin-right: 8rpx;">
|
||||
<view @click="delSendStr()" @longpress="clearSendStr()">
|
||||
@@ -25,7 +26,7 @@
|
||||
<u-row class="action_row" v-else>
|
||||
<u-col v-for="item in actionList" :key="item.idx" @click="actionClick(item)" span="3">
|
||||
<view class="action_item">
|
||||
<image :src="item.icon" alt="" srcset="" />
|
||||
<image class="img" :src="item.icon" alt="" srcset="" />
|
||||
<text class="action_item_title">{{ item.title }}</text>
|
||||
</view>
|
||||
</u-col>
|
||||
@@ -36,6 +37,10 @@
|
||||
<script>
|
||||
import {ChatingFooterActionTypes,} from "@/constant";
|
||||
import emojis from "@/common/emojis.js"
|
||||
import chating_action_image from "@/static/images/chating_action_image.png";
|
||||
import chating_action_camera from "@/static/images/chating_action_camera.png";
|
||||
import chating_action_call from "@/static/images/chating_action_call.png";
|
||||
import chating_action_location from "@/static/images/chating_action_location.png";
|
||||
|
||||
export default {
|
||||
props:{
|
||||
@@ -59,37 +64,37 @@
|
||||
idx: 0,
|
||||
type: ChatingFooterActionTypes.Album,
|
||||
title: "照片",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
icon: chating_action_image,
|
||||
},
|
||||
{
|
||||
idx: 1,
|
||||
type: ChatingFooterActionTypes.Camera,
|
||||
title: "拍摄",
|
||||
icon: require("static/images/chating_action_camera.png"),
|
||||
icon: chating_action_camera,
|
||||
},
|
||||
{
|
||||
idx: 2,
|
||||
type: ChatingFooterActionTypes.Video,
|
||||
title: "视频通话",
|
||||
icon: require("static/images/chating_action_call.png"),
|
||||
icon: chating_action_call,
|
||||
},
|
||||
{
|
||||
idx: 3,
|
||||
type: ChatingFooterActionTypes.Location,
|
||||
title: "位置",
|
||||
icon: require("static/images/chating_action_location.png"),
|
||||
icon: chating_action_location,
|
||||
},
|
||||
// {
|
||||
// idx: 0,
|
||||
// type: ChatingFooterActionTypes.Album,
|
||||
// title: "红包",
|
||||
// icon: require("static/images/chating_action_image.png"),
|
||||
// icon: chating_action_image,
|
||||
// },
|
||||
// {
|
||||
// idx: 0,
|
||||
// type: ChatingFooterActionTypes.Album,
|
||||
// title: "转账",
|
||||
// icon: require("static/images/chating_action_image.png"),
|
||||
// icon: chating_action_image,
|
||||
// }
|
||||
],
|
||||
};
|
||||
@@ -138,7 +143,7 @@
|
||||
flex-direction: column;
|
||||
margin-top: 24rpx;
|
||||
|
||||
image {
|
||||
.img {
|
||||
width: 96rpx;
|
||||
height: 96rpx;
|
||||
}
|
||||
|
||||
@@ -58,8 +58,8 @@
|
||||
import {ChatingFooterActionTypes,UpdateMessageTypes,} from "@/constant";
|
||||
import IMSDK, {IMMethods,MessageStatus,MessageType,} from "openim-uniapp-polyfill";
|
||||
import UParse from "@/components/gaoyia-parse/parse.vue";
|
||||
import CustomEditor from "./CustomEditor.vue";
|
||||
import ChatingActionBar from "./ChatingActionBar.vue";
|
||||
import CustomEditor from "./CustomEditor";
|
||||
import ChatingActionBar from "./ChatingActionBar";
|
||||
|
||||
const needClearTypes = [MessageType.TextMessage];
|
||||
|
||||
@@ -544,7 +544,7 @@
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background-color: $uni-color-success;
|
||||
padding: 0 8px;
|
||||
padding: 0 8px;
|
||||
border-radius: 4px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<u-navbar @click="click" placeholder class="chating_header" bgColor="transparent">
|
||||
<view @click="routeBack" class="u-nav-slot" slot="left">
|
||||
<img class="back_icon" width="12" height="20" src="static/images/common_left_arrow.png" alt="" srcset="" />
|
||||
<image class="back_icon" style="width: 12px; height: 20px;" src="/static/images/common_left_arrow.png"></image>
|
||||
</view>
|
||||
<view class="u-nav-slot" slot="center">
|
||||
<view class="chating_info" :class="{ chating_info_single: isSingle }">
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<script>
|
||||
import {mapGetters,mapActions} from "vuex";
|
||||
import MessageItemRender from "./MessageItem/index.vue";
|
||||
import MessageItemRender from "./MessageItem/index";
|
||||
|
||||
export default {
|
||||
name: "",
|
||||
|
||||
@@ -58,24 +58,24 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.media_message_container {
|
||||
position: relative;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
|
||||
.play_icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.play_icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.video_duration {
|
||||
position: absolute;
|
||||
bottom: 12rpx;
|
||||
right: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
.video_duration {
|
||||
position: absolute;
|
||||
bottom: 12rpx;
|
||||
right: 24rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<view style="height: 100%;display: flex;justify-items: center;align-items: center;">
|
||||
<view class="message_send_state">
|
||||
<u-loading-icon v-if="showSending && !isPreview" />
|
||||
<image v-if="isFailedMessage && !isPreview" src="@/static/images/chating_message_failed.png" />
|
||||
<image v-if="isFailedMessage && !isPreview" class="state_img" src="@/static/images/chating_message_failed.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="message_content_wrap message_content_wrap_shadow" :id="`message_content_wrap_${source.clientMsgID}`" @longtap.stop.prevent="longtapEvent($event)">
|
||||
@@ -23,12 +23,6 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 长按菜单 -->
|
||||
<chunLei-popups v-model="toolTipFlag" :popData="toolTipData" @tapPopup="tapPopup"
|
||||
:x="toolTipX" :y="toolTipY" :placement="popPostion"
|
||||
:triangle="false"
|
||||
direction="row" theme="dark" :dynamic="true">
|
||||
</chunLei-popups>
|
||||
</view>
|
||||
|
||||
<view v-else class="notice_message_container" style="margin: 0 auto;" :id="`auchor${source.clientMsgID}`">
|
||||
@@ -39,11 +33,10 @@
|
||||
<script>
|
||||
import {mapGetters} from "vuex";
|
||||
import {MessageStatus,MessageType,SessionType,} from "openim-uniapp-polyfill";
|
||||
import chunLeiPopups from "@/components/chunLei-popups.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import TextMessageRender from "./TextMessageRender.vue";
|
||||
import MediaMessageRender from "./MediaMessageRender.vue";
|
||||
import ErrorMessageRender from "./ErrorMessageRender.vue";
|
||||
import TextMessageRender from "./TextMessageRender";
|
||||
import MediaMessageRender from "./MediaMessageRender";
|
||||
import ErrorMessageRender from "./ErrorMessageRender";
|
||||
import {noticeMessageTypes} from "@/constant";
|
||||
import {tipMessaggeFormat,formatMessageTime} from "@/util/imCommon";
|
||||
|
||||
@@ -56,8 +49,7 @@
|
||||
MyAvatar,
|
||||
TextMessageRender,
|
||||
MediaMessageRender,
|
||||
ErrorMessageRender,
|
||||
chunLeiPopups
|
||||
ErrorMessageRender
|
||||
},
|
||||
props: {
|
||||
source: Object,
|
||||
@@ -139,123 +131,9 @@
|
||||
},
|
||||
longtapEvent(e){
|
||||
console.log('longtapEvent');
|
||||
// console.log("#"+e.currentTarget.id,e);
|
||||
// let view = uni.createSelectorQuery().in(this).select("#"+e.currentTarget.id.replace('message_content_wrap_','auchor'));
|
||||
// console.log(e.touches[0].clientX,e.touches[0].clientY);
|
||||
// view.boundingClientRect((data) => {
|
||||
// console.log(data.left,data.top);
|
||||
// //console.log("得到布局位置信息" + JSON.stringify(data));
|
||||
// }).exec();
|
||||
this.$emit('userEvent',{type:"longtapMsgContent"},this.source);
|
||||
//this.showToolTip(e);
|
||||
},
|
||||
//操作项
|
||||
showToolTip: function(e) {
|
||||
let that = this;
|
||||
that.toolTipData=[
|
||||
{
|
||||
id: 1,
|
||||
icon: '/static/images/chat/longTipIcon/copy.png',
|
||||
title: '复制',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
icon: '/static/images/chat/longTipIcon/zhuanfa.png',
|
||||
title: '转发',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
icon: '/static/images/chat/longTipIcon/select.png',
|
||||
title: '多选',
|
||||
disabled: false
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
icon: '/static/images/chat/longTipIcon/delete.png',
|
||||
title: '删除',
|
||||
disabled: false
|
||||
},
|
||||
// {
|
||||
// id: 5,
|
||||
// icon: '/static/images/chat/longTipIcon/tag.png',
|
||||
// title: '编辑',
|
||||
// disabled: false
|
||||
// }
|
||||
];
|
||||
that.toolTipX =e.touches[0].clientX;
|
||||
that.toolTipY = e.touches[0].clientY-20;
|
||||
that.toolTipFlag = !that.toolTipFlag;
|
||||
if(that.toolTipFlag==true){
|
||||
let nowTime=new Date().getTime();
|
||||
let msgTime=that.source.createTime;
|
||||
let diff= nowTime-msgTime;
|
||||
if(this.isSender&&diff<120000){
|
||||
that.toolTipData.push({
|
||||
id: 3,
|
||||
icon: '/static/images/chat/longTipIcon/revert.png',
|
||||
title: '撤回',
|
||||
disabled: false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
tapPopup(e) {
|
||||
let that = this;
|
||||
let currentHandleMsg=that.source;
|
||||
console.log(currentHandleMsg);
|
||||
if (e.title == "撤回") {
|
||||
that.toolTipFlag = false;
|
||||
that.$emit('userEvent',{type:'revokeMessage'},that.source);
|
||||
}
|
||||
if (e.title == "复制") {
|
||||
let content = currentHandleMsg.textElem?.content;
|
||||
if (content) {
|
||||
let copyContent =content.text;
|
||||
let formatStr = copyContent;
|
||||
//let formatStr = this.replaceReseverEmoji(copyContent);
|
||||
uni.setClipboardData({
|
||||
data:formatStr,
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
error: (e) => {
|
||||
uni.showToast({
|
||||
title: e,
|
||||
icon: 'none',
|
||||
duration: 3000,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
that.toolTipFlag = false;
|
||||
return;
|
||||
}
|
||||
if (e.title == "转发") {
|
||||
that.$emit('userEvent',{type:'forward'},that.source);
|
||||
that.toolTipFlag = false;
|
||||
return
|
||||
}
|
||||
if(e.title=="调换"){
|
||||
that.toolTipFlag = false;
|
||||
return;
|
||||
}
|
||||
if (e.title == "多选") {
|
||||
that.$emit('userEvent',{type:'select'},that.source);
|
||||
that.toolTipFlag = false;
|
||||
return
|
||||
}
|
||||
if (e.title == "删除") {
|
||||
that.toolTipFlag = false;
|
||||
that.$emit('userEvent',{type:'deleteMsg'},that.source);
|
||||
return
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -346,7 +224,7 @@
|
||||
color: #999;
|
||||
}
|
||||
|
||||
image {
|
||||
.state_img {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<view class="chating_container">
|
||||
<SelectHeader v-if="selectFlag" :count="selectItems.length" @leftClick="onUserMessageEvent({type:'cancelSelect'})" ref="selectHeaderRef" />
|
||||
<chating-header v-else @click="pageClick" ref="chatingHeaderRef" />
|
||||
<chating-list
|
||||
<ChatingHeader v-else @click="pageClick" ref="chatingHeaderRef" />
|
||||
<ChatingList
|
||||
@userEvent="onUserMessageEvent"
|
||||
@click="pageClick"
|
||||
:selectItems="selectItems"
|
||||
@@ -10,7 +10,7 @@
|
||||
ref="chatingListRef"
|
||||
@initSuccess="initSuccess" />
|
||||
<SelectFooter v-if="selectFlag" ref="selectFooterRef" @userEvent="onUserMessageEvent" />
|
||||
<chating-footer v-else ref="chatingFooterRef" :footerOutsideFlag="footerOutsideFlag"
|
||||
<ChatingFooter v-else ref="chatingFooterRef" :footerOutsideFlag="footerOutsideFlag"
|
||||
@scrollToBottom="scrollToBottom" />
|
||||
<u-loading-page :loading="initLoading"></u-loading-page>
|
||||
</view>
|
||||
@@ -19,15 +19,14 @@
|
||||
<script>
|
||||
import {mapActions,mapGetters} from "vuex";
|
||||
import {offlinePushInfo} from "@/util/imCommon";
|
||||
import {PageEvents,ContactChooseTypes} from "@/constant";
|
||||
import ChatingHeader from "./components/ChatingHeader.vue";
|
||||
import ChatingFooter from "./components/ChatingFooter/index.vue";
|
||||
import ChatingList from "./components/ChatingList.vue";
|
||||
import SelectHeader from "./components/SelectHeader.vue";
|
||||
import SelectFooter from "./components/SelectFooter.vue";
|
||||
import {PageEvents,ContactChooseTypes } from "@/constant";
|
||||
import ChatingHeader from "./components/ChatingHeader";
|
||||
import ChatingFooter from "./components/ChatingFooter/index";
|
||||
import ChatingList from "./components/ChatingList";
|
||||
import SelectHeader from "./components/SelectHeader";
|
||||
import SelectFooter from "./components/SelectFooter";
|
||||
import {markConversationAsRead} from "@/util/imCommon";
|
||||
import IMSDK,{MessageType} from "openim-uniapp-polyfill";
|
||||
|
||||
import IMSDK, {MessageType} from "openim-uniapp-polyfill";
|
||||
export default {
|
||||
components: {
|
||||
ChatingHeader,
|
||||
@@ -42,13 +41,13 @@
|
||||
footerOutsideFlag: 0,
|
||||
initLoading: true,
|
||||
back2Tab: false,
|
||||
selectFlag:false,
|
||||
selectItems:[],
|
||||
forwardItems:[],
|
||||
forwardMerge:false
|
||||
selectFlag: false,
|
||||
selectItems: [],
|
||||
forwardItems: [],
|
||||
forwardMerge: false
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"storeCurrentConversation",
|
||||
]),
|
||||
@@ -72,7 +71,7 @@
|
||||
this.resetMessageState();
|
||||
},
|
||||
methods: {
|
||||
...mapActions("message", ["resetMessageState", "deleteMessages","pushNewMessage", "updateOneMessage"]),
|
||||
...mapActions("message", ["resetMessageState", "deleteMessages", "pushNewMessage", "updateOneMessage"]),
|
||||
...mapActions("conversation", ["resetConversationState"]),
|
||||
scrollToBottom(isRecv = false) {
|
||||
this.$refs.chatingListRef.scrollToBottom(false, isRecv);
|
||||
@@ -92,46 +91,46 @@
|
||||
uni.$off(PageEvents.ScrollToBottom, this.scrollToBottom);
|
||||
},
|
||||
//选择会话列表的回调
|
||||
async onForwardTargetSelected(userList,groupList){
|
||||
async onForwardTargetSelected(userList, groupList) {
|
||||
const _this = this;
|
||||
//console.log(userList,groupList);
|
||||
if(this.forwardItems.length === 0){
|
||||
if (this.forwardItems.length === 0) {
|
||||
return false;
|
||||
}
|
||||
if(this.forwardMerge && this.forwardItems.length>1){
|
||||
if (this.forwardMerge && this.forwardItems.length > 1) {
|
||||
const res = await IMSDK.asyncApi(IMSDK.IMMethods.CreateMergerMessage, IMSDK.uuid(), {
|
||||
messageList: _this.forwardItems,
|
||||
title: "转发的消息",
|
||||
summaryList: ["summaryList","summaryList"]
|
||||
summaryList: ["summaryList", "summaryList"]
|
||||
});
|
||||
//console.log(res );
|
||||
if(res){
|
||||
await _this.doForwarMsg(userList,groupList,res);
|
||||
if (res) {
|
||||
await _this.doForwarMsg(userList, groupList, res);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
for (var mi = 0; mi < this.forwardItems.length; mi++) {
|
||||
var msg = this.forwardItems[mi];
|
||||
const res = await IMSDK.asyncApi(IMSDK.IMMethods.CreateForwardMessage, IMSDK.uuid(), msg);
|
||||
//console.log(res );
|
||||
if(res){
|
||||
await _this.doForwarMsg(userList,groupList,res);
|
||||
if (res) {
|
||||
await _this.doForwarMsg(userList, groupList, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.onUserMessageEvent({type:'cancelSelect'});
|
||||
this.onUserMessageEvent({type: 'cancelSelect'});
|
||||
},
|
||||
async doForwarMsg(userList,groupList,msgiem)
|
||||
async doForwarMsg(userList, groupList, msgiem)
|
||||
{
|
||||
//console.log(userList,groupList);
|
||||
const _this = this;
|
||||
for (var i = 0; i < userList.length; i++) {
|
||||
this.sendMessage(msgiem,userList[i].userID,"");
|
||||
this.sendMessage(msgiem, userList[i].userID, "");
|
||||
}
|
||||
for (var i = 0; i < groupList.length; i++) {
|
||||
this.sendMessage(msgiem,"",groupList[i].groupID);
|
||||
this.sendMessage(msgiem, "", groupList[i].groupID);
|
||||
}
|
||||
},
|
||||
sendMessage(message,user_id,group_id) {
|
||||
sendMessage(message, user_id, group_id) {
|
||||
//this.scrollToBottom();
|
||||
//console.log(message);
|
||||
//console.log(user_id,group_id);
|
||||
@@ -145,149 +144,149 @@
|
||||
console.log(data);
|
||||
this.pushNewMessage(message);
|
||||
})
|
||||
.catch((res={data,errCode,errMsg}) => {
|
||||
.catch((res = {data,errCode,errMsg}) => {
|
||||
console.log(res);
|
||||
uni.$u.toast(errMsg);
|
||||
});
|
||||
},
|
||||
onUserMessageEvent(e,data){
|
||||
onUserMessageEvent(e, data) {
|
||||
const _this = this;
|
||||
if(e.type == 'select'){
|
||||
if (e.type == 'select') {
|
||||
this.selectFlag = true;
|
||||
this.selectItems = [data];
|
||||
this.$refs.chatingListRef.scrollToAnchor(`auchor${data.clientMsgID}`);
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
if(e.type == 'cancelSelect'){
|
||||
if (e.type == 'cancelSelect') {
|
||||
this.selectFlag = false;
|
||||
this.selectItems = [];
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
if(e.type == 'selected'){
|
||||
if(this.selectFlag == true){
|
||||
if (e.type == 'selected') {
|
||||
if (this.selectFlag == true) {
|
||||
let founded = false;
|
||||
let arr = [];
|
||||
for (var index = 0; index < this.selectItems.length; index++) {
|
||||
var v = this.selectItems[index];
|
||||
if(v.clientMsgID == data.clientMsgID){
|
||||
if (v.clientMsgID == data.clientMsgID) {
|
||||
founded = true;
|
||||
}else{
|
||||
} else {
|
||||
arr.push(v);
|
||||
}
|
||||
}
|
||||
if(!founded){
|
||||
if (!founded) {
|
||||
arr.push(data);
|
||||
}
|
||||
console.log(arr.length);
|
||||
this.selectItems = [...arr];
|
||||
}
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
if(e.type == 'deleteMsg'){
|
||||
if (e.type == 'deleteMsg') {
|
||||
let deleteMsgs = [];
|
||||
if(!data){
|
||||
if (!data) {
|
||||
deleteMsgs = [...this.selectItems];
|
||||
}else{
|
||||
} else {
|
||||
deleteMsgs = [{...data}];
|
||||
}
|
||||
for (let i = 0; i < deleteMsgs.length; i++) {
|
||||
let element = deleteMsgs[i];
|
||||
IMSDK.asyncApi('deleteMessageFromLocalStorage',IMSDK.uuid(), {
|
||||
IMSDK.asyncApi('deleteMessageFromLocalStorage', IMSDK.uuid(), {
|
||||
conversationID: _this.storeCurrentConversation.conversationID,
|
||||
clientMsgID: element.clientMsgID
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
//console.log(res);
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
//console.log(res);
|
||||
}).finally(()=>{
|
||||
}).finally(() => {
|
||||
//console.log(arguments);
|
||||
})
|
||||
}
|
||||
this.selectItems = [];
|
||||
this.$refs.chatingListRef.loadMessageList();
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
if(e.type == 'forward'){
|
||||
if(!data){
|
||||
if (e.type == 'forward') {
|
||||
if (!data) {
|
||||
this.forwardItems = [...this.selectItems];
|
||||
let menu = ['逐条转发','合并转发'];
|
||||
let menu = ['逐条转发', '合并转发'];
|
||||
uni.showActionSheet({
|
||||
itemList:menu,
|
||||
success({tapIndex}){
|
||||
if(menu[tapIndex] == '逐条转发'){
|
||||
itemList: menu,
|
||||
success({tapIndex}) {
|
||||
if (menu[tapIndex] == '逐条转发') {
|
||||
this.forwardMerge = false;
|
||||
}
|
||||
if(menu[tapIndex] == '合并转发'){
|
||||
if (menu[tapIndex] == '合并转发') {
|
||||
this.forwardMerge = true;
|
||||
}
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/contactChoose/choose?type=${ContactChooseTypes.GetList}&checkedUserIDList=[]`,
|
||||
events:{
|
||||
onSelectedConfirm(userList,groupList){
|
||||
events: {
|
||||
onSelectedConfirm(userList, groupList) {
|
||||
//console.log(userList,groupList);
|
||||
_this.onForwardTargetSelected(userList,groupList)
|
||||
_this.onForwardTargetSelected(userList, groupList)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}else{
|
||||
} else {
|
||||
this.forwardItems = [{...data}];
|
||||
this.forwardMerge = false;
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/contactChoose/choose?type=${ContactChooseTypes.GetList}&checkedUserIDList=[]`,
|
||||
events:{
|
||||
onSelectedConfirm(userList,groupList){
|
||||
events: {
|
||||
onSelectedConfirm(userList, groupList) {
|
||||
//console.log(userList,groupList);
|
||||
_this.onForwardTargetSelected(userList,groupList)
|
||||
_this.onForwardTargetSelected(userList, groupList)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
if(e.type == 'revokeMessage'){
|
||||
if (e.type == 'revokeMessage') {
|
||||
IMSDK.asyncApi('revokeMessage', IMSDK.uuid(), {
|
||||
conversationID: _this.storeCurrentConversation.conversationID,
|
||||
clientMsgID: data.clientMsgID
|
||||
}).then(res=>{
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
}).catch(res=>{
|
||||
}).catch(res => {
|
||||
console.log(res);
|
||||
}).finally(()=>{
|
||||
}).finally(() => {
|
||||
console.log(arguments);
|
||||
})
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
if(e.type == 'longtapMsgContent'){
|
||||
if (e.type == 'longtapMsgContent') {
|
||||
let menu = [];
|
||||
if(data.contentType == MessageType.TextMessage){
|
||||
if (data.contentType == MessageType.TextMessage) {
|
||||
menu.push('复制')
|
||||
}
|
||||
menu.push('转发');
|
||||
menu.push('多选');
|
||||
menu.push('删除');
|
||||
let nowTime=new Date().getTime();
|
||||
let msgTime=data.createTime;
|
||||
let diff= nowTime-msgTime;
|
||||
if(this.isSender&&diff<120000){
|
||||
let nowTime = new Date().getTime();
|
||||
let msgTime = data.createTime;
|
||||
let diff = nowTime - msgTime;
|
||||
if (this.isSender && diff < 120000) {
|
||||
menu.push('撤回')
|
||||
}
|
||||
uni.showActionSheet({
|
||||
itemList:menu,
|
||||
success({tapIndex}){
|
||||
itemList: menu,
|
||||
success({tapIndex}) {
|
||||
const title = menu[tapIndex];
|
||||
switch (title) {
|
||||
case "撤回":
|
||||
_this.onUserMessageEvent({type:'revokeMessage'},data);
|
||||
_this.onUserMessageEvent({type: 'revokeMessage'}, data);
|
||||
break;
|
||||
case "复制":
|
||||
let content = data.textElem?.content;
|
||||
if (content) {
|
||||
//let formatStr = this.replaceReseverEmoji(copyContent);
|
||||
uni.setClipboardData({
|
||||
data:content,
|
||||
data: content,
|
||||
success: (res) => {
|
||||
uni.showToast({
|
||||
title: res,
|
||||
@@ -305,20 +304,20 @@
|
||||
}
|
||||
break;
|
||||
case "转发":
|
||||
_this.onUserMessageEvent({type:'forward'},data);
|
||||
_this.onUserMessageEvent({type: 'forward'}, data);
|
||||
break;
|
||||
case "多选":
|
||||
_this.onUserMessageEvent({type:'select'},data);
|
||||
_this.onUserMessageEvent({type: 'select'}, data);
|
||||
break;
|
||||
case "删除":
|
||||
_this.onUserMessageEvent({type:'deleteMsg'},data);
|
||||
_this.onUserMessageEvent({type: 'deleteMsg'}, data);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+3
-14
@@ -1,19 +1,8 @@
|
||||
import store from "@/store";
|
||||
import {
|
||||
CustomType,
|
||||
GroupSystemMessageTypes,
|
||||
AddFriendQrCodePrefix,
|
||||
AddGroupQrCodePrefix,
|
||||
} from "@/constant";
|
||||
import IMSDK, {
|
||||
GroupAtType,
|
||||
MessageType,
|
||||
SessionType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {CustomType,GroupSystemMessageTypes,AddFriendQrCodePrefix,AddGroupQrCodePrefix} from "@/constant";
|
||||
import IMSDK, {GroupAtType,MessageType,SessionType} from "openim-uniapp-polyfill";
|
||||
import dayjs from "dayjs";
|
||||
import {
|
||||
isThisYear
|
||||
} from "date-fns";
|
||||
import {isThisYear} from "date-fns";
|
||||
|
||||
import calendar from "dayjs/plugin/calendar";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
|
||||
@@ -6,8 +6,9 @@ uni.$u.http.setConfig((defaultConfig) => {
|
||||
defaultConfig.baseURL = config.getRegisterUrl(); /* 根域名 */
|
||||
return defaultConfig;
|
||||
});
|
||||
|
||||
import requestInterceptors from "./requestInterceptors";
|
||||
import responseInterceptors from "./responseInterceptors";
|
||||
module.exports = (vm) => {
|
||||
require("./requestInterceptors")(vm);
|
||||
require("./responseInterceptors")(vm);
|
||||
requestInterceptors(vm);
|
||||
responseInterceptors(vm);
|
||||
};
|
||||
Reference in New Issue
Block a user