9
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
...mapActions("message", ["pushNewMessage", "updateOneMessage"]),
|
...mapActions("message", ["pushNewMessage", "updateOneMessage"]),
|
||||||
...mapActions("conversation", ["updateCurrentMemberInGroup"]),
|
...mapActions("conversation", ["updateCurrentMemberInGroup"]),
|
||||||
|
...mapActions("circle", ["getFriendCircleInfo"]),
|
||||||
...mapActions("contact", [
|
...mapActions("contact", [
|
||||||
"updateFriendInfo",
|
"updateFriendInfo",
|
||||||
"pushNewFriend",
|
"pushNewFriend",
|
||||||
@@ -137,12 +138,9 @@
|
|||||||
|
|
||||||
// friend
|
// friend
|
||||||
const friendInfoChangeHandler = ({data}) => {
|
const friendInfoChangeHandler = ({data}) => {
|
||||||
uni.$emit(IMSDK.IMEvents.OnFriendInfoChanged, {
|
console.log('friendInfoChangeHandler',data);
|
||||||
data
|
uni.$emit(IMSDK.IMEvents.OnFriendInfoChanged, {data});
|
||||||
});
|
this.updateFriendInfo({friendInfo: data,});
|
||||||
this.updateFriendInfo({
|
|
||||||
friendInfo: data,
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
const friendAddedHandler = ({data}) => {
|
const friendAddedHandler = ({data}) => {
|
||||||
this.pushNewFriend(data);
|
this.pushNewFriend(data);
|
||||||
@@ -266,6 +264,7 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
const conversationChangedHandler = ({data}) => {
|
const conversationChangedHandler = ({data}) => {
|
||||||
|
//console.log('conversationChangedHandler',data);
|
||||||
if (this.storeIsSyncing) {
|
if (this.storeIsSyncing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -291,15 +290,9 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
IMSDK.subscribe(
|
IMSDK.subscribe(IMSDK.IMEvents.OnTotalUnreadMessageCountChanged,totalUnreadCountChangedHandler);
|
||||||
IMSDK.IMEvents.OnTotalUnreadMessageCountChanged,
|
|
||||||
totalUnreadCountChangedHandler
|
|
||||||
);
|
|
||||||
IMSDK.subscribe(IMSDK.IMEvents.OnNewConversation, newConversationHandler);
|
IMSDK.subscribe(IMSDK.IMEvents.OnNewConversation, newConversationHandler);
|
||||||
IMSDK.subscribe(
|
IMSDK.subscribe(IMSDK.IMEvents.OnConversationChanged,conversationChangedHandler);
|
||||||
IMSDK.IMEvents.OnConversationChanged,
|
|
||||||
conversationChangedHandler
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tryLogin() {
|
tryLogin() {
|
||||||
@@ -312,6 +305,8 @@
|
|||||||
this.$store.dispatch("contact/getSentFriendApplications");
|
this.$store.dispatch("contact/getSentFriendApplications");
|
||||||
this.$store.dispatch("contact/getRecvGroupApplications");
|
this.$store.dispatch("contact/getRecvGroupApplications");
|
||||||
this.$store.dispatch("contact/getSentGroupApplications");
|
this.$store.dispatch("contact/getSentGroupApplications");
|
||||||
|
this.$store.dispatch("contact/getFriendList");
|
||||||
|
this.$store.dispatch("circle/getFriendCircleInfo");
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/conversation/conversationList/index?isRedirect=true",
|
url: "/pages/conversation/conversationList/index?isRedirect=true",
|
||||||
success() {
|
success() {
|
||||||
|
|||||||
+3
-3
@@ -33,8 +33,8 @@ export const businessModify = (params) =>
|
|||||||
// 用户信息
|
// 用户信息
|
||||||
export const businessInfoUpdate = (params) =>
|
export const businessInfoUpdate = (params) =>
|
||||||
uni.$u?.http.post(
|
uni.$u?.http.post(
|
||||||
"/user/profile",
|
"/user/info",
|
||||||
JSON.stringify({ ...params, }),
|
JSON.stringify({...params}),
|
||||||
{
|
{
|
||||||
header: {
|
header: {
|
||||||
token: uni.getStorageSync("BusinessToken"),
|
token: uni.getStorageSync("BusinessToken"),
|
||||||
@@ -44,7 +44,7 @@ export const businessInfoUpdate = (params) =>
|
|||||||
export const businessGetUserInfo = (userID) =>
|
export const businessGetUserInfo = (userID) =>
|
||||||
uni.$u?.http.post(
|
uni.$u?.http.post(
|
||||||
"/user/find",
|
"/user/find",
|
||||||
JSON.stringify({ userIDs: [userID], }),
|
JSON.stringify({userIDs: [userID],}),
|
||||||
{
|
{
|
||||||
header: {
|
header: {
|
||||||
token: uni.getStorageSync("BusinessToken"),
|
token: uni.getStorageSync("BusinessToken"),
|
||||||
|
|||||||
@@ -0,0 +1,339 @@
|
|||||||
|
<template>
|
||||||
|
<view class="mask" :class="!show?'':'mask-show'" :style="{backgroundColor:show?maskBg:'rgba(0,0,0,0)'}" @tap="tapMask">
|
||||||
|
<view class="popups" :class="[theme]"
|
||||||
|
:style="{top: popupsTop ,left: popupsLeft,flexDirection:direction}">
|
||||||
|
<text :class="dynPlace" :style="{width:'0px',height:'0px'}" v-if="triangle"></text>
|
||||||
|
<template v-for="(item,index) in popData">
|
||||||
|
<view @tap.stop="tapItem(item)" v-if="item.disabled==false"
|
||||||
|
class="itemChild view" :class="[direction=='row'?'solid-right':'solid-bottom',item.disabled?'disabledColor':'']">
|
||||||
|
<u-icon :color="item.disabled?'#c8c9cc':'#ffffff'" :name="item.icon" size="20" v-if="item.icon"></u-icon>
|
||||||
|
<text>{{item.title}}</text>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<slot></slot>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default{
|
||||||
|
props:{
|
||||||
|
maskBg:{
|
||||||
|
type:String,
|
||||||
|
default:'rgba(0,0,0,0)'
|
||||||
|
},
|
||||||
|
placement:{
|
||||||
|
type:String,
|
||||||
|
default:'default' //default top-start top-end bottom-start bottom-end
|
||||||
|
},
|
||||||
|
direction:{
|
||||||
|
type:String,
|
||||||
|
default:'column' //column row
|
||||||
|
},
|
||||||
|
x:{
|
||||||
|
type:Number,
|
||||||
|
default:0
|
||||||
|
},
|
||||||
|
y:{
|
||||||
|
type:Number,
|
||||||
|
default:0
|
||||||
|
},
|
||||||
|
value:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
|
},
|
||||||
|
popData:{
|
||||||
|
type:Array,
|
||||||
|
default:()=>[]
|
||||||
|
},
|
||||||
|
theme:{
|
||||||
|
type:String,
|
||||||
|
default:'light' //light dark
|
||||||
|
},
|
||||||
|
dynamic:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
|
},
|
||||||
|
gap:{
|
||||||
|
type:Number,
|
||||||
|
default:20
|
||||||
|
},
|
||||||
|
triangle:{
|
||||||
|
type:Boolean,
|
||||||
|
default:true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return{
|
||||||
|
popupsTop:'0px',
|
||||||
|
popupsLeft:'0px',
|
||||||
|
show:false,
|
||||||
|
dynPlace:''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.popupsPosition()
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
tapMask(){
|
||||||
|
|
||||||
|
this.$emit('input',!this.value)
|
||||||
|
},
|
||||||
|
tapItem(item){
|
||||||
|
if(item.disabled) return
|
||||||
|
this.$emit('tapPopup',item)
|
||||||
|
this.$emit('input',!this.value)
|
||||||
|
},
|
||||||
|
getStatusBar(){
|
||||||
|
let promise = new Promise((resolve,reject)=>{
|
||||||
|
uni.getSystemInfo({
|
||||||
|
success: function(e) {
|
||||||
|
|
||||||
|
let customBar
|
||||||
|
// #ifdef H5
|
||||||
|
|
||||||
|
customBar = e.statusBarHeight + e.windowTop;
|
||||||
|
|
||||||
|
// #endif
|
||||||
|
resolve(customBar)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return promise
|
||||||
|
},
|
||||||
|
async popupsPosition(){
|
||||||
|
let statusBar = await this.getStatusBar()
|
||||||
|
let promise = new Promise((resolve,reject)=>{
|
||||||
|
let popupsDom = uni.createSelectorQuery().in(this).select(".popups")
|
||||||
|
popupsDom.fields({
|
||||||
|
size: true,
|
||||||
|
}, (data) => {
|
||||||
|
let width = data.width
|
||||||
|
let height = data.height
|
||||||
|
|
||||||
|
let y = this.dynamic?this.dynamicGetY(this.y,this.gap):this.transformRpx(this.y)
|
||||||
|
|
||||||
|
let x = this.dynamic?this.dynamicGetX(this.x,this.gap):this.transformRpx(this.x)
|
||||||
|
|
||||||
|
|
||||||
|
// #ifdef H5
|
||||||
|
y = this.dynamic?(this.y+statusBar): this.transformRpx(this.y+statusBar)
|
||||||
|
// #endif
|
||||||
|
|
||||||
|
this.dynPlace = this.placement=='default'?this.getPlacement(x,y):this.placement
|
||||||
|
|
||||||
|
switch(this.dynPlace){
|
||||||
|
case 'top-start':
|
||||||
|
this.popupsTop = `${y+9}px`
|
||||||
|
this.popupsLeft = `${x-15}px`
|
||||||
|
break;
|
||||||
|
case 'top-end':
|
||||||
|
this.popupsTop = `${y+9}px`
|
||||||
|
this.popupsLeft = `${x+15-width}px`
|
||||||
|
break;
|
||||||
|
case 'bottom-start':
|
||||||
|
this.popupsTop = `${y-18-height}px`
|
||||||
|
this.popupsLeft = `${x-15}px`
|
||||||
|
break;
|
||||||
|
case 'bottom-end':
|
||||||
|
this.popupsTop = `${y-9-height}px`
|
||||||
|
this.popupsLeft = `${x+15-width}px`
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
resolve()
|
||||||
|
}).exec();
|
||||||
|
|
||||||
|
})
|
||||||
|
return promise
|
||||||
|
|
||||||
|
},
|
||||||
|
getPlacement(x,y){
|
||||||
|
let width = uni.getSystemInfoSync().windowWidth
|
||||||
|
let height = uni.getSystemInfoSync().windowHeight
|
||||||
|
if(x>width/2&&y>height/2){
|
||||||
|
return 'bottom-end'
|
||||||
|
}else if(x<width/2&&y<height/2){
|
||||||
|
return 'top-start'
|
||||||
|
}else if(x>width/2&&y<height/2){
|
||||||
|
return 'top-end'
|
||||||
|
}else if(x<width/2&&y>height/2){
|
||||||
|
return 'bottom-start'
|
||||||
|
}else if(x>width/2){
|
||||||
|
return 'top-end'
|
||||||
|
}else{
|
||||||
|
return 'top-start'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dynamicGetY(y,gap){
|
||||||
|
|
||||||
|
let height = uni.getSystemInfoSync().windowHeight
|
||||||
|
y = y<gap?gap:y
|
||||||
|
y = height - y <gap? (height - gap) : y
|
||||||
|
|
||||||
|
return y
|
||||||
|
},
|
||||||
|
dynamicGetX(x,gap){
|
||||||
|
let width = uni.getSystemInfoSync().windowWidth
|
||||||
|
x = x< gap?gap:x
|
||||||
|
x = width - x <gap? (width - gap) : x
|
||||||
|
return x
|
||||||
|
},
|
||||||
|
transformRpx(params){
|
||||||
|
|
||||||
|
return params*uni.getSystemInfoSync().screenWidth/375
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
value:{
|
||||||
|
immediate:true,
|
||||||
|
handler:async function (newVal,oldVal){
|
||||||
|
if(newVal) await this.popupsPosition()
|
||||||
|
this.show = newVal
|
||||||
|
}
|
||||||
|
},
|
||||||
|
placement:{
|
||||||
|
immediate:true,
|
||||||
|
handler(newVal,oldVal){
|
||||||
|
this.dynPlace = newVal
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.mask{
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
z-index: 9999;
|
||||||
|
transition: background 0.3s ease-in-out;
|
||||||
|
visibility: hidden;
|
||||||
|
|
||||||
|
&.mask-show{
|
||||||
|
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.popups{
|
||||||
|
position: absolute;
|
||||||
|
padding: 20rpx;
|
||||||
|
border-radius: 5px;
|
||||||
|
display:flex;
|
||||||
|
.view{
|
||||||
|
padding: 10rpx;
|
||||||
|
}
|
||||||
|
.image{
|
||||||
|
display: inline-block;
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 40rpx;
|
||||||
|
height: 40rpx;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.dark{
|
||||||
|
background-color: #4C4C4C;
|
||||||
|
color: #fff;
|
||||||
|
.top-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #4C4C4C;
|
||||||
|
}
|
||||||
|
.top-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #4C4C4C;
|
||||||
|
}
|
||||||
|
.bottom-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0 ;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4C4C4C transparent transparent ;
|
||||||
|
|
||||||
|
}
|
||||||
|
.bottom-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0 ;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #4C4C4C transparent transparent ;
|
||||||
|
}
|
||||||
|
.disabledColor{
|
||||||
|
color: #c8c9cc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.light{
|
||||||
|
color: #515a6e;
|
||||||
|
box-shadow: 0upx 0upx 30upx rgba(0,0,0,0.2);
|
||||||
|
background: #fff;
|
||||||
|
.top-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #fff;
|
||||||
|
}
|
||||||
|
.top-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 0 20rpx 20rpx;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: transparent transparent #fff;
|
||||||
|
}
|
||||||
|
.bottom-start:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
left: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0 ;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent ;
|
||||||
|
|
||||||
|
}
|
||||||
|
.bottom-end:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
bottom: -18rpx;
|
||||||
|
right: 10rpx;
|
||||||
|
border-width: 20rpx 20rpx 0 ;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #fff transparent transparent ;
|
||||||
|
}
|
||||||
|
.disabledColor{
|
||||||
|
color: #c8c9cc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.solid-bottom{
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
.solid-right{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-right: 20rpx;
|
||||||
|
}
|
||||||
|
.popups .itemChild:last-child{
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
+128
-126
@@ -1,139 +1,141 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="mark_id_container">
|
<view class="mark_id_container">
|
||||||
<custom-nav-bar :title="getTitle">
|
<custom-nav-bar :title="getTitle">
|
||||||
<view class="nav_right_action" slot="more">
|
<view class="nav_right_action" slot="more">
|
||||||
<text v-show="!loading" @click="saveOrCopy">{{ getConfirmText }}</text>
|
<text v-show="!loading" @click="saveOrCopy">{{ getConfirmText }}</text>
|
||||||
<u-loading-icon v-show="loading" />
|
<u-loading-icon v-show="loading" />
|
||||||
</view>
|
</view>
|
||||||
</custom-nav-bar>
|
</custom-nav-bar>
|
||||||
|
|
||||||
<view class="content_row">
|
<view class="content_row">
|
||||||
<u-input
|
<u-input :disabled="!isRemark && !isSelfNickname" v-model="content" disabledColor="transparent"
|
||||||
:disabled="!isRemark && !isSelfNickname"
|
maxlength="16" placeholder="请输入内容" clearable>
|
||||||
v-model="content"
|
</u-input>
|
||||||
disabledColor="transparent"
|
</view>
|
||||||
maxlength="16"
|
</view>
|
||||||
placeholder="请输入内容"
|
|
||||||
clearable
|
|
||||||
>
|
|
||||||
</u-input>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import IMSDK from "openim-uniapp-polyfill";
|
import IMSDK from "openim-uniapp-polyfill";
|
||||||
|
|
||||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||||
import { businessInfoUpdate } from "@/api/login";
|
import {
|
||||||
export default {
|
businessInfoUpdate
|
||||||
components: {
|
} from "@/api/login";
|
||||||
CustomNavBar,
|
export default {
|
||||||
},
|
components: {
|
||||||
props: {},
|
CustomNavBar,
|
||||||
data() {
|
},
|
||||||
return {
|
props: {},
|
||||||
content: "",
|
data() {
|
||||||
isRemark: false,
|
return {
|
||||||
isSelfNickname: false,
|
content: "",
|
||||||
sourceInfo: {},
|
isRemark: false,
|
||||||
loading: false,
|
isSelfNickname: false,
|
||||||
};
|
sourceInfo: {},
|
||||||
},
|
loading: false,
|
||||||
computed: {
|
};
|
||||||
getTitle() {
|
},
|
||||||
if (this.isRemark) {
|
computed: {
|
||||||
return "设置备注";
|
getTitle() {
|
||||||
}
|
if (this.isRemark) {
|
||||||
if (this.isSelfNickname) {
|
return "设置备注";
|
||||||
return "我的姓名";
|
}
|
||||||
}
|
if (this.isSelfNickname) {
|
||||||
return "ID号";
|
return "我的姓名";
|
||||||
},
|
}
|
||||||
getConfirmText() {
|
return "ID号";
|
||||||
return this.isRemark || this.isSelfNickname ? "保存" : "复制";
|
},
|
||||||
},
|
getConfirmText() {
|
||||||
},
|
return this.isRemark || this.isSelfNickname ? "保存" : "复制";
|
||||||
onLoad(options) {
|
},
|
||||||
const { isRemark, isSelfNickname, sourceInfo } = options;
|
},
|
||||||
this.sourceInfo = JSON.parse(sourceInfo);
|
onLoad(options) {
|
||||||
this.isRemark = !!isRemark;
|
const {
|
||||||
if (this.isRemark) {
|
isRemark,
|
||||||
this.content = this.sourceInfo.remark;
|
isSelfNickname,
|
||||||
}
|
sourceInfo
|
||||||
this.isSelfNickname = !!isSelfNickname;
|
} = options;
|
||||||
if (this.isSelfNickname) {
|
this.sourceInfo = JSON.parse(sourceInfo);
|
||||||
this.content = this.sourceInfo.nickname;
|
console.log(sourceInfo);
|
||||||
}
|
console.log(this.sourceInfo);
|
||||||
},
|
this.isRemark = !!isRemark;
|
||||||
methods: {
|
if (this.isRemark) {
|
||||||
async saveOrCopy() {
|
this.content = this.sourceInfo.remark;
|
||||||
if (this.isRemark) {
|
}
|
||||||
this.loading = true;
|
this.isSelfNickname = !!isSelfNickname;
|
||||||
IMSDK.asyncApi(IMSDK.IMMethods.SetFriendRemark, IMSDK.uuid(), {
|
if (this.isSelfNickname) {
|
||||||
toUserID: this.sourceInfo.userID,
|
this.content = this.sourceInfo.nickname;
|
||||||
remark: this.content,
|
}
|
||||||
})
|
},
|
||||||
.then(() => {
|
methods: {
|
||||||
uni.$u.toast("设置成功");
|
async saveOrCopy() {
|
||||||
setTimeout(() => uni.navigateBack(), 1000);
|
if (this.isRemark) {
|
||||||
})
|
this.loading = true;
|
||||||
.catch((error) => {
|
IMSDK.asyncApi(IMSDK.IMMethods.SetFriendRemark, IMSDK.uuid(), {
|
||||||
console.log(error);
|
toUserID: this.sourceInfo.id+'',
|
||||||
uni.$u.toast("设置失败");
|
remark: this.content,
|
||||||
})
|
})
|
||||||
.finally(() => (this.loading = false));
|
.then(() => {
|
||||||
} else if (this.isSelfNickname) {
|
uni.$u.toast("设置成功");
|
||||||
this.loading = true;
|
setTimeout(() => uni.navigateBack(), 1000);
|
||||||
try {
|
})
|
||||||
await businessInfoUpdate({
|
.catch((error) => {
|
||||||
userID: this.sourceInfo.userID,
|
console.log(error);
|
||||||
nickname: this.content,
|
uni.$u.toast("设置失败");
|
||||||
});
|
})
|
||||||
await this.$store.dispatch("user/updateBusinessInfo");
|
.finally(() => (this.loading = false));
|
||||||
uni.$u.toast("修改成功");
|
} else if (this.isSelfNickname) {
|
||||||
setTimeout(() => uni.navigateBack(), 1000);
|
this.loading = true;
|
||||||
} catch (e) {
|
try {
|
||||||
console.log(e);
|
await businessInfoUpdate({
|
||||||
uni.$u.toast("修改失败");
|
userID: this.sourceInfo.id,
|
||||||
}
|
nickname: this.content,
|
||||||
this.loading = false;
|
});
|
||||||
} else {
|
await this.$store.dispatch("user/updateBusinessInfo");
|
||||||
uni.setClipboardData({
|
uni.$u.toast("修改成功");
|
||||||
data: this.sourceInfo.userID,
|
setTimeout(() => uni.navigateBack(), 1000);
|
||||||
success: () => {
|
} catch (e) {
|
||||||
uni.hideToast();
|
console.log(e);
|
||||||
this.$nextTick(() => {
|
uni.$u.toast("修改失败");
|
||||||
uni.$u.toast("复制成功");
|
}
|
||||||
});
|
this.loading = false;
|
||||||
},
|
} else {
|
||||||
});
|
uni.setClipboardData({
|
||||||
}
|
data: this.sourceInfo.id,
|
||||||
},
|
success: () => {
|
||||||
},
|
uni.hideToast();
|
||||||
};
|
this.$nextTick(() => {
|
||||||
|
uni.$u.toast("复制成功");
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.mark_id_container {
|
.mark_id_container {
|
||||||
@include colBox(false);
|
@include colBox(false);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|
||||||
.nav_right_action {
|
.nav_right_action {
|
||||||
margin-right: 36rpx;
|
margin-right: 36rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content_row {
|
.content_row {
|
||||||
margin-top: 96rpx;
|
margin-top: 96rpx;
|
||||||
margin: 72rpx 44rpx 0;
|
margin: 72rpx 44rpx 0;
|
||||||
|
|
||||||
.u-input {
|
.u-input {
|
||||||
background-color: #e8eaef;
|
background-color: #e8eaef;
|
||||||
}
|
}
|
||||||
|
|
||||||
.u-button {
|
.u-button {
|
||||||
height: 60rpx;
|
height: 60rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
<view v-if="!isLoading" style="flex: 1;display: flex;flex-direction: column;">
|
<view v-if="!isLoading" style="flex: 1;display: flex;flex-direction: column;">
|
||||||
<view class="base_info">
|
<view class="base_info">
|
||||||
<my-avatar :desc="sourceUserInfo.remark || sourceUserInfo.nickname" :src="sourceUserInfo.faceURL"
|
<my-avatar :desc="sourceUserInfo.remark || sourceUserInfo.nickname" :src="sourceUserInfo.faceURL || sourceUserInfo.avatar"
|
||||||
size="46" />
|
size="46" />
|
||||||
<view class="user_name">
|
<view class="user_name">
|
||||||
<text class="text">{{ getShowName }}</text>
|
<text class="text">{{ getShowName }}</text>
|
||||||
|
|||||||
+112
-144
@@ -1,156 +1,124 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="user_more_container">
|
<view class="user_more_container">
|
||||||
<custom-nav-bar title="好友设置" />
|
<custom-nav-bar title="好友设置" />
|
||||||
|
|
||||||
<view class="info_row">
|
<view class="info_row">
|
||||||
<user-info-row-item @click="toMark" lable="设置备注" arrow />
|
<user-info-row-item @click="toMark" lable="设置备注" arrow />
|
||||||
<user-info-row-item @click="toMore" lable="个人资料" arrow />
|
<user-info-row-item @click="toMore" lable="个人资料" arrow />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="info_row">
|
<view class="info_row">
|
||||||
<user-info-row-item lable="加入黑名单" arrow>
|
<user-info-row-item lable="加入黑名单" arrow>
|
||||||
<u-switch
|
<u-switch asyncChange :loading="blackLoading" size="20" :value="isBlacked" @change="change"></u-switch>
|
||||||
asyncChange
|
</user-info-row-item>
|
||||||
:loading="blackLoading"
|
</view>
|
||||||
size="20"
|
|
||||||
:value="isBlacked"
|
|
||||||
@change="change"
|
|
||||||
></u-switch>
|
|
||||||
</user-info-row-item>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view v-if="isFriend" class="info_row">
|
<view v-if="isFriend" class="info_row">
|
||||||
<u-button
|
<u-button @click="() => (showConfirm = true)" type="error" plain text="解除好友关系"></u-button>
|
||||||
@click="() => (showConfirm = true)"
|
</view>
|
||||||
type="error"
|
<u-toast ref="uToast"></u-toast>
|
||||||
plain
|
<u-modal :content="`确定要解除与${sourceInfo.nickname}的好友关系吗?`" asyncClose :show="showConfirm" showCancelButton
|
||||||
text="解除好友关系"
|
@confirm="confirmRemove" @cancel="() => (showConfirm = false)"></u-modal>
|
||||||
></u-button>
|
</view>
|
||||||
</view>
|
|
||||||
<u-toast ref="uToast"></u-toast>
|
|
||||||
<u-modal
|
|
||||||
:content="`确定要解除与${sourceInfo.nickname}的好友关系吗?`"
|
|
||||||
asyncClose
|
|
||||||
:show="showConfirm"
|
|
||||||
showCancelButton
|
|
||||||
@confirm="confirmRemove"
|
|
||||||
@cancel="() => (showConfirm = false)"
|
|
||||||
></u-modal>
|
|
||||||
</view>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import IMSDK from "openim-uniapp-polyfill";
|
import IMSDK from "openim-uniapp-polyfill";
|
||||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||||
import UserInfoRowItem from "../userCard/components/UserInfoRowItem.vue";
|
import UserInfoRowItem from "../userCard/components/UserInfoRowItem.vue";
|
||||||
import { ContactChooseTypes } from "@/constant";
|
import {
|
||||||
export default {
|
ContactChooseTypes
|
||||||
components: {
|
} from "@/constant";
|
||||||
CustomNavBar,
|
export default {
|
||||||
UserInfoRowItem,
|
components: {
|
||||||
},
|
CustomNavBar,
|
||||||
data() {
|
UserInfoRowItem,
|
||||||
return {
|
},
|
||||||
blackLoading: false,
|
data() {
|
||||||
sourceInfo: {},
|
return {
|
||||||
showConfirm: false,
|
blackLoading: false,
|
||||||
};
|
sourceInfo: {},
|
||||||
},
|
showConfirm: false,
|
||||||
computed: {
|
};
|
||||||
isFriend() {
|
},
|
||||||
return (
|
computed: {
|
||||||
this.$store.getters.storeFriendList.findIndex(
|
isFriend() {
|
||||||
(friend) => friend.userID === this.sourceInfo.userID,
|
return (
|
||||||
) !== -1
|
this.$store.getters.storeFriendList.findIndex(
|
||||||
);
|
(friend) => friend.userID === this.sourceInfo.userID,
|
||||||
},
|
) !== -1
|
||||||
isBlacked() {
|
);
|
||||||
return (
|
},
|
||||||
this.$store.getters.storeBlackList.findIndex(
|
isBlacked() {
|
||||||
(black) => black.userID === this.sourceInfo.userID,
|
return (
|
||||||
) !== -1
|
this.$store.getters.storeBlackList.findIndex(
|
||||||
);
|
(black) => black.userID === this.sourceInfo.userID,
|
||||||
},
|
) !== -1
|
||||||
},
|
);
|
||||||
onLoad(options) {
|
},
|
||||||
const { sourceInfo } = options;
|
},
|
||||||
this.sourceInfo = JSON.parse(sourceInfo);
|
onLoad(options) {
|
||||||
},
|
const {sourceInfo} = options;
|
||||||
methods: {
|
this.sourceInfo = JSON.parse(sourceInfo);
|
||||||
change(isBlack) {
|
},
|
||||||
this.blackLoading = true;
|
methods: {
|
||||||
if (isBlack) {
|
change(isBlack) {
|
||||||
IMSDK.asyncApi(IMSDK.IMMethods.AddBlack, IMSDK.uuid(), {
|
this.blackLoading = true;
|
||||||
toUserID: this.sourceInfo.userID,
|
if (isBlack) {
|
||||||
ex: "",
|
IMSDK.asyncApi(IMSDK.IMMethods.AddBlack, IMSDK.uuid(), {toUserID: this.sourceInfo.userID,ex: "",})
|
||||||
})
|
.catch(() => this.showToast("操作失败"))
|
||||||
.catch(() => this.showToast("操作失败"))
|
.finally(() => (this.blackLoading = false));
|
||||||
.finally(() => (this.blackLoading = false));
|
return;
|
||||||
return;
|
}
|
||||||
}
|
IMSDK.asyncApi(IMSDK.IMMethods.RemoveBlack,IMSDK.uuid(),this.sourceInfo.userID)
|
||||||
IMSDK.asyncApi(
|
.catch(() => this.showToast("操作失败"))
|
||||||
IMSDK.IMMethods.RemoveBlack,
|
.finally(() => (this.blackLoading = false));
|
||||||
IMSDK.uuid(),
|
},
|
||||||
this.sourceInfo.userID
|
confirmRemove() {
|
||||||
)
|
IMSDK.asyncApi(IMSDK.IMMethods.DeleteFriend,IMSDK.uuid(),this.sourceInfo.userID,)
|
||||||
.catch(() => this.showToast("操作失败"))
|
.then(() => this.showToast("操作成功"))
|
||||||
.finally(() => (this.blackLoading = false));
|
.catch(() => this.showToast("操作失败"))
|
||||||
},
|
.finally(() => (this.showConfirm = false));
|
||||||
confirmRemove() {
|
},
|
||||||
IMSDK.asyncApi(
|
toMore() {
|
||||||
IMSDK.IMMethods.DeleteFriend,
|
uni.navigateTo({
|
||||||
IMSDK.uuid(),
|
url: `/pages/common/detailsFileds/index?sourceInfo=${JSON.stringify(this.sourceInfo,)}`,
|
||||||
this.sourceInfo.userID,
|
});
|
||||||
)
|
},
|
||||||
.then(() => this.showToast("操作成功"))
|
toMark() {
|
||||||
.catch(() => this.showToast("操作失败"))
|
uni.navigateTo({
|
||||||
.finally(() => (this.showConfirm = false));
|
url: `/pages/common/markOrIDPage/index?isRemark=true&sourceInfo=${JSON.stringify(this.sourceInfo,)}`,
|
||||||
},
|
});
|
||||||
toMore() {
|
},
|
||||||
uni.navigateTo({
|
toShare() {
|
||||||
url: `/pages/common/detailsFileds/index?sourceInfo=${JSON.stringify(
|
uni.navigateTo({
|
||||||
this.sourceInfo,
|
url: `/pages/common/contactChoose/index?type=${ContactChooseTypes.ShareCard}&cardInfo=${JSON.stringify(this.sourceInfo)}`,
|
||||||
)}`,
|
});
|
||||||
});
|
},
|
||||||
},
|
showToast(message) {
|
||||||
toMark() {
|
this.$refs.uToast.show({
|
||||||
uni.navigateTo({
|
message,
|
||||||
url: `/pages/common/markOrIDPage/index?isRemark=true&sourceInfo=${JSON.stringify(
|
});
|
||||||
this.sourceInfo,
|
},
|
||||||
)}`,
|
},
|
||||||
});
|
};
|
||||||
},
|
|
||||||
toShare() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/common/contactChoose/index?type=${
|
|
||||||
ContactChooseTypes.ShareCard
|
|
||||||
}&cardInfo=${JSON.stringify(this.sourceInfo)}`,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
showToast(message) {
|
|
||||||
this.$refs.uToast.show({
|
|
||||||
message,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.user_more_container {
|
.user_more_container {
|
||||||
@include colBox(false);
|
@include colBox(false);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-color: #f6f6f6;
|
background-color: #f6f6f6;
|
||||||
|
|
||||||
.info_row {
|
.info_row {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin: 24rpx;
|
margin: 24rpx;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
.u-button {
|
.u-button {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
this.getListHeight();
|
this.getListHeight();
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
await this.getFriendList();
|
//await this.getFriendList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions('contact',['getFriendList']),
|
...mapActions('contact',['getFriendList']),
|
||||||
|
|||||||
@@ -1,6 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="chat_action_bar">
|
<view class="chat_action_bar">
|
||||||
<u-row class="action_row">
|
<view class="fun-box u-border-top show-fun-box" v-if="isEmoji">
|
||||||
|
<swiper class="emoji-swiper" :indicator-dots="true" :duration="50" :circular="true">
|
||||||
|
<swiper-item v-for="(page,index1) in Math.ceil(emojiList.length/pagesize)" :key="index1">
|
||||||
|
<view @tap="emojiClick(emojiList[pagesize*(page-1)+n])" v-for="(n,index2) in pagesize" :key="index2">
|
||||||
|
{{emojiList[pagesize*(page-1)+n]}}
|
||||||
|
</view>
|
||||||
|
</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">
|
||||||
|
<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()">
|
||||||
|
<u-icon name="backspace" size="46" color="#ffffff"></u-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <view>
|
||||||
|
<u-button @click="$noClicks(sendText)" type="success" :custom-style="{padding:'20rpx'}">发送
|
||||||
|
</u-button>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<u-row class="action_row" v-else>
|
||||||
<u-col v-for="item in actionList" :key="item.idx" @click="actionClick(item)" span="3">
|
<u-col v-for="item in actionList" :key="item.idx" @click="actionClick(item)" span="3">
|
||||||
<view class="action_item">
|
<view class="action_item">
|
||||||
<image :src="item.icon" alt="" srcset="" />
|
<image :src="item.icon" alt="" srcset="" />
|
||||||
@@ -13,11 +35,25 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {ChatingFooterActionTypes,} from "@/constant";
|
import {ChatingFooterActionTypes,} from "@/constant";
|
||||||
|
import emojis from "@/common/emojis.js"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
props:{
|
||||||
|
isEmoji:{
|
||||||
|
type:Boolean,
|
||||||
|
default:false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch:{
|
||||||
|
isEmoji(v){
|
||||||
|
console.log(v);
|
||||||
|
this.emojiMode = v;
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
pagesize:24,
|
||||||
|
emojiList:emojis,
|
||||||
actionList: [
|
actionList: [
|
||||||
{
|
{
|
||||||
idx: 0,
|
idx: 0,
|
||||||
@@ -29,19 +65,19 @@
|
|||||||
idx: 1,
|
idx: 1,
|
||||||
type: ChatingFooterActionTypes.Camera,
|
type: ChatingFooterActionTypes.Camera,
|
||||||
title: "拍摄",
|
title: "拍摄",
|
||||||
icon: require("static/images/chating_action_image.png"),
|
icon: require("static/images/chating_action_camera.png"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
idx: 2,
|
idx: 2,
|
||||||
type: ChatingFooterActionTypes.Video,
|
type: ChatingFooterActionTypes.Video,
|
||||||
title: "视频通话",
|
title: "视频通话",
|
||||||
icon: require("static/images/chating_action_image.png"),
|
icon: require("static/images/chating_action_call.png"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
idx: 3,
|
idx: 3,
|
||||||
type: ChatingFooterActionTypes.Location,
|
type: ChatingFooterActionTypes.Location,
|
||||||
title: "位置",
|
title: "位置",
|
||||||
icon: require("static/images/chating_action_image.png"),
|
icon: require("static/images/chating_action_location.png"),
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// idx: 0,
|
// idx: 0,
|
||||||
@@ -59,6 +95,11 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
delSendStr(){},
|
||||||
|
clearSendStr(){},
|
||||||
|
async emojiClick(emoji){
|
||||||
|
this.$emit("prepareMediaMessage", 'emoji',emoji);
|
||||||
|
},
|
||||||
async actionClick(action) {
|
async actionClick(action) {
|
||||||
switch (action.type) {
|
switch (action.type) {
|
||||||
case ChatingFooterActionTypes.Video:
|
case ChatingFooterActionTypes.Video:
|
||||||
@@ -84,7 +125,7 @@
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.chat_action_bar {
|
.chat_action_bar {
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #f0f2f6;
|
background: #ececec;
|
||||||
padding: 24rpx 36rpx;
|
padding: 24rpx 36rpx;
|
||||||
|
|
||||||
.action_row {
|
.action_row {
|
||||||
@@ -108,5 +149,29 @@
|
|||||||
margin-top: 6rpx;
|
margin-top: 6rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.emoji_row{
|
||||||
|
.emoji{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.emoji-swiper {
|
||||||
|
height: 400rpx;
|
||||||
|
|
||||||
|
swiper-item {
|
||||||
|
display: flex;
|
||||||
|
align-content: flex-start;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
|
||||||
|
view {
|
||||||
|
width: 12%;
|
||||||
|
height: 16vw;
|
||||||
|
font-size: 48rpx;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -2,25 +2,56 @@
|
|||||||
<view>
|
<view>
|
||||||
<view>
|
<view>
|
||||||
<view class="chat_footer">
|
<view class="chat_footer">
|
||||||
|
<!-- 语音信息 -->
|
||||||
|
<image v-if="1==2" v-show="!isAudio" @click.prevent="isAudio=!isAudio"
|
||||||
|
src="@/static/images/chating_footer_audio.png" alt="" srcset="" />
|
||||||
|
<image v-if="1==2" v-show="isAudio" @click.prevent="isAudio=!isAudio"
|
||||||
|
src="@/static/images/chating_footer_audio_recording.png" alt="" srcset="" />
|
||||||
<view class="input_content">
|
<view class="input_content">
|
||||||
<CustomEditor class="custom_editor" ref="customEditor" @ready="editorReady" @focus="editorFocus"
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
<view v-if="isAudio" class="voice_title" @touchstart.stop.prevent="startVoice"
|
||||||
|
@touchmove.stop.prevent="moveVoice" @touchend.stop="endVoice"
|
||||||
|
@touchcancel.stop="cancelVoice" :style="{ background: recording ? '#c7c6c6' : '#FFFFFF' }">
|
||||||
|
<text>{{ voiceTitle }}</text>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
|
<CustomEditor v-if="!isAudio" class="custom_editor" ref="customEditor" @ready="editorReady" @focus="editorFocus"
|
||||||
@blur="editorBlur" @input="editorInput" />
|
@blur="editorBlur" @input="editorInput" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="footer_action_area">
|
<view class="footer_action_area" v-show="!isAudio">
|
||||||
|
<image class="emoji_action" @click.prevent="updateActionBar(true)"
|
||||||
|
src="@/static/images/chating_footer_emoji.png" alt="" srcset="" />
|
||||||
<image v-show="!hasContent" @click.prevent="updateActionBar"
|
<image v-show="!hasContent" @click.prevent="updateActionBar"
|
||||||
src="@/static/images/chating_footer_add.png" alt="" srcset="" />
|
src="@/static/images/chating_footer_add.png" alt="" srcset="" />
|
||||||
<image v-show="hasContent" @touchend.prevent="sendTextMessage" src="@/static/images/send_btn.png"
|
<button class="send_btn" type="primary" v-show="hasContent" @touchend.prevent="sendTextMessage">发送</button>
|
||||||
alt="" srcset="" />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<chating-action-bar @sendMessage="sendMessage" @prepareMediaMessage="prepareMediaMessage"
|
<chating-action-bar :isEmoji="isEmoji" @sendMessage="sendMessage" @prepareMediaMessage="prepareMediaMessage"
|
||||||
v-show="actionBarVisible" />
|
v-show="actionBarVisible" />
|
||||||
<u-action-sheet :safeAreaInsetBottom="true" round="12" :actions="actionSheetMenu" @select="selectClick"
|
<u-action-sheet :safeAreaInsetBottom="true" round="12" :actions="actionSheetMenu" @select="selectClick"
|
||||||
:closeOnClickOverlay="true" :closeOnClickAction="true" :show="showActionSheet"
|
:closeOnClickOverlay="true" :closeOnClickAction="true" :show="showActionSheet"
|
||||||
@close="showActionSheet = false">
|
@close="showActionSheet = false">
|
||||||
</u-action-sheet>
|
</u-action-sheet>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 录音动画 -->
|
||||||
|
<!-- #ifdef APP-PLUS -->
|
||||||
|
<view class="voice_an" v-if="recording">
|
||||||
|
<view class="voice_an_icon">
|
||||||
|
<view id="one" class="wave"></view>
|
||||||
|
<view id="two" class="wave"></view>
|
||||||
|
<view id="three" class="wave"></view>
|
||||||
|
<view id="four" class="wave"></view>
|
||||||
|
<view id="five" class="wave"></view>
|
||||||
|
<view id="six" class="wave"></view>
|
||||||
|
<view id="seven" class="wave"></view>
|
||||||
|
</view>
|
||||||
|
<view class="text">
|
||||||
|
<text>{{voiceIconText}}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- #endif -->
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -60,6 +91,12 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
recording:false,
|
||||||
|
sendMsgTimmer: null, //发送时间定时器
|
||||||
|
sendDuring: 0, //发送时间计数器 1分钟以内的信息不显示时间
|
||||||
|
sendTimeBetween: 60, //发送信息显示的间隔,60秒以内信息不显示发送时间
|
||||||
|
isEmoji:false,
|
||||||
|
isAudio:false,
|
||||||
customEditorCtx: null,
|
customEditorCtx: null,
|
||||||
inputHtml: "",
|
inputHtml: "",
|
||||||
actionBarVisible: false,
|
actionBarVisible: false,
|
||||||
@@ -143,15 +180,25 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
recordAudioMsg(){
|
||||||
|
|
||||||
|
if (uni.getSystemInfoSync().platform == "android") {
|
||||||
|
permission.requestAndroid("android.permission.RECORD_AUDIO"); //Android请求录音权限
|
||||||
|
} else {
|
||||||
|
permission.requestIOS("record"); //ios请求录音权限
|
||||||
|
}
|
||||||
|
},
|
||||||
// action
|
// action
|
||||||
onClickActionBarOutside() {
|
onClickActionBarOutside() {
|
||||||
if (this.actionBarVisible) {
|
if (this.actionBarVisible) {
|
||||||
this.actionBarVisible = false;
|
this.actionBarVisible = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
updateActionBar() {
|
updateActionBar(isEmoji) {
|
||||||
this.actionBarVisible = !this.actionBarVisible;
|
this.actionBarVisible = !this.actionBarVisible;
|
||||||
|
console.log(this.isEmoji);
|
||||||
|
this.isEmoji = !!isEmoji;
|
||||||
|
console.log(this.isEmoji);
|
||||||
},
|
},
|
||||||
editorReady(e) {
|
editorReady(e) {
|
||||||
this.customEditorCtx = e.context;
|
this.customEditorCtx = e.context;
|
||||||
@@ -167,7 +214,7 @@
|
|||||||
editorInput(e) {
|
editorInput(e) {
|
||||||
this.inputHtml = e.detail.html;
|
this.inputHtml = e.detail.html;
|
||||||
},
|
},
|
||||||
prepareMediaMessage(type) {
|
prepareMediaMessage(type,extra) {
|
||||||
console.log(type)
|
console.log(type)
|
||||||
if (type === ChatingFooterActionTypes.Video) {
|
if (type === ChatingFooterActionTypes.Video) {
|
||||||
this.actionSheetMenu = [...rtcChoose];
|
this.actionSheetMenu = [...rtcChoose];
|
||||||
@@ -195,6 +242,18 @@
|
|||||||
//longitude:1,
|
//longitude:1,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if (type === "emoji") {
|
||||||
|
//TODO 在光标处插入文字extra
|
||||||
|
this.customEditorCtx.insertText({
|
||||||
|
text: extra,
|
||||||
|
success: () => {
|
||||||
|
console.log("插入文字成功");
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log("插入文字失败", err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// from comp
|
// from comp
|
||||||
@@ -279,6 +338,133 @@
|
|||||||
disposeKeyboardListener() {
|
disposeKeyboardListener() {
|
||||||
uni.offKeyboardHeightChange(this.keyboardChangeHander);
|
uni.offKeyboardHeightChange(this.keyboardChangeHander);
|
||||||
},
|
},
|
||||||
|
/*----------------------------------------------------(H5不支持)录音相关 start-------------------------------------- */
|
||||||
|
//准备开始录音
|
||||||
|
startVoice(e) {
|
||||||
|
if (!this.Audio.paused) {
|
||||||
|
//如果音频正在播放 先暂停。
|
||||||
|
this.stopAudio(this.AudioExam)
|
||||||
|
}
|
||||||
|
this.recording = true;
|
||||||
|
this.isStopVoice = false;
|
||||||
|
this.voiceCanSend = true;
|
||||||
|
this.voiceIconText = "正在录音..."
|
||||||
|
this.PointY = e.touches[0].clientY;
|
||||||
|
this.Recorder.start({
|
||||||
|
format: 'mp3'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//录音已经开始
|
||||||
|
beginVoice() {
|
||||||
|
let that = this;
|
||||||
|
if (that.isStopVoice) {
|
||||||
|
that.Recorder.stop();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
that.voiceTitle = '松开 结束'
|
||||||
|
that.voiceInterval = setInterval(() => {
|
||||||
|
console.log("that.voiceTime", that.voiceTime);
|
||||||
|
if (that.voiceTime > 49) {
|
||||||
|
that.voiceIconText = "录音结束倒计时[" + (60 - that.voiceTime) + "]s";
|
||||||
|
};
|
||||||
|
if (that.voiceTime == 60) {
|
||||||
|
clearInterval(that.voiceInterval);
|
||||||
|
that.endVoice();
|
||||||
|
}
|
||||||
|
that.voiceTime++;
|
||||||
|
}, 1000)
|
||||||
|
},
|
||||||
|
//move 正在录音中
|
||||||
|
moveVoice(e) {
|
||||||
|
const PointY = e.touches[0].clientY;
|
||||||
|
const slideY = this.PointY - PointY;
|
||||||
|
if (slideY > uni.upx2px(120)) {
|
||||||
|
this.voiceCanSend = false;
|
||||||
|
this.voiceIconText = '松开手指 取消发送 '
|
||||||
|
} else if (slideY > uni.upx2px(60)) {
|
||||||
|
this.voiceCanSend = true;
|
||||||
|
this.voiceIconText = '手指上滑 取消发送 '
|
||||||
|
} else {
|
||||||
|
this.voiceIconText = '正在录音... '
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//结束录音
|
||||||
|
endVoice() {
|
||||||
|
this.isStopVoice = true; //加锁 确保已经结束录音并不会录制
|
||||||
|
this.Recorder.stop();
|
||||||
|
this.voiceTitle = '按住 说话'
|
||||||
|
},
|
||||||
|
//录音被打断
|
||||||
|
cancelVoice(e) {
|
||||||
|
console.log("路由被打断", e);
|
||||||
|
this.voiceTime = 0;
|
||||||
|
this.voiceTitle = '按住 说话';
|
||||||
|
this.voiceCanSend = false;
|
||||||
|
this.Recorder.stop();
|
||||||
|
},
|
||||||
|
//处理录音文件
|
||||||
|
handleRecorder({tempFilePath,duration }) {
|
||||||
|
if (this.voiceTime < 1) {
|
||||||
|
this.voiceIconText = "说话时间过短";
|
||||||
|
setTimeout(() => {
|
||||||
|
this.recording = false;
|
||||||
|
}, 500)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let contentDuration = this.voiceTime;
|
||||||
|
this.voiceTime = 0;
|
||||||
|
this.recording = false;
|
||||||
|
clearInterval(this.voiceInterval);
|
||||||
|
console.log("录音文件", tempFilePath);
|
||||||
|
console.log("是否发送语音信息", this.voiceCanSend);
|
||||||
|
let voiceFile = {
|
||||||
|
tempFilePath: tempFilePath,
|
||||||
|
contentDuration: Math.ceil(contentDuration),
|
||||||
|
anmitionPlay: false,
|
||||||
|
};
|
||||||
|
if (this.voiceCanSend) {
|
||||||
|
console.log("=====上传语音文件,并发送语音信息====");
|
||||||
|
let audioType = this.messageApi.CONTENT_TYPE.AUDIO_CONTENT_TYPE;
|
||||||
|
this.uploadFile(voiceFile, audioType);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
console.log("=====已经取消发送语音信息====")
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//控制播放还是暂停音频文件
|
||||||
|
handleAudio(item) {
|
||||||
|
this.AudioExam = item;
|
||||||
|
this.Audio.paused ? this.playAudio(item) : this.stopAudio(item);
|
||||||
|
},
|
||||||
|
//播放音频
|
||||||
|
playAudio(item) {
|
||||||
|
let target = item.content.fileSaveTarget;
|
||||||
|
let src = item.content.fullPath;
|
||||||
|
if (target == "local") {
|
||||||
|
src = this.$u.api.multipartAddress.getFileByPath + src;
|
||||||
|
}
|
||||||
|
this.Audio.src = src;
|
||||||
|
this.Audio.hasBeenSentId = item.id;
|
||||||
|
this.Audio.play();
|
||||||
|
let currentAudioMsg = this.messageList.find(it => it.id == item.id);
|
||||||
|
currentAudioMsg.content.anmitionPlay = true;
|
||||||
|
},
|
||||||
|
//停止音频
|
||||||
|
stopAudio(item) {
|
||||||
|
let currentAudioMsg = this.messageList.find(it => it.id == item.id);
|
||||||
|
currentAudioMsg.content.anmitionPlay = false;
|
||||||
|
this.Audio.src = '';
|
||||||
|
this.Audio.stop();
|
||||||
|
},
|
||||||
|
//关闭动画
|
||||||
|
closeAnmition() {
|
||||||
|
const hasBeenSentId = this.Audio.hasBeenSentId;
|
||||||
|
let item = this.messageList.find(it => it.id == hasBeenSentId);
|
||||||
|
item.content.anmitionPlay = false;
|
||||||
|
},
|
||||||
|
/*-------------------------------------录音相关方法块 end---------------------------------------------------*/
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -303,9 +489,9 @@
|
|||||||
|
|
||||||
.chat_footer {
|
.chat_footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: flex-end;
|
||||||
// background-color: #e9f4ff;
|
// background-color: #e9f4ff;
|
||||||
background: #f0f2f6;
|
background: #f6f6f6;
|
||||||
// height: 50px;
|
// height: 50px;
|
||||||
max-height: 120px;
|
max-height: 120px;
|
||||||
padding: 24rpx 20rpx;
|
padding: 24rpx 20rpx;
|
||||||
@@ -361,7 +547,7 @@
|
|||||||
.send_btn {
|
.send_btn {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
background-color: #4a9cfc;
|
background-color: $uni-color-success;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<u-navbar @click="click" placeholder class="chating_header">
|
<u-navbar @click="click" placeholder class="chating_header" bgColor="transparent">
|
||||||
<view @click="routeBack" class="u-nav-slot" slot="left">
|
<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="" />
|
<img class="back_icon" width="12" height="20" src="static/images/common_left_arrow.png" alt="" srcset="" />
|
||||||
</view>
|
</view>
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.chating_header {
|
.chating_header {
|
||||||
border: 2rpx solid #e8eaef;
|
border: 2rpx solid #e1e1e1;
|
||||||
|
|
||||||
::v-deep .u-navbar__content__left {
|
::v-deep .u-navbar__content__left {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
@@ -6,8 +6,12 @@
|
|||||||
<view id="scroll_wrap">
|
<view id="scroll_wrap">
|
||||||
<u-loadmore nomoreText="" :status="loadMoreStatus" />
|
<u-loadmore nomoreText="" :status="loadMoreStatus" />
|
||||||
<view v-for="item in storeHistoryMessageList" :key="item.clientMsgID">
|
<view v-for="item in storeHistoryMessageList" :key="item.clientMsgID">
|
||||||
<message-item-render @messageItemRender="messageItemRender" :source="item"
|
<message-item-render
|
||||||
:isSender="item.sendID === storeCurrentUserID" />
|
@messageItemRender="messageItemRender"
|
||||||
|
@longpress="onLongPressMessageItem(item)"
|
||||||
|
:source="item"
|
||||||
|
:isSender="item.sendID === storeCurrentUserID"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view style="visibility: hidden; height: 12px" id="auchormessage_bottom_item"></view>
|
<view style="visibility: hidden; height: 12px" id="auchormessage_bottom_item"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -175,6 +179,9 @@
|
|||||||
.exec();
|
.exec();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
onLongPressMessageItem(msg){
|
||||||
|
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
:previewImg="false"
|
:previewImg="false"
|
||||||
:showImgMenu="false"
|
:showImgMenu="false"
|
||||||
:lazyLoad="false"
|
:lazyLoad="false"
|
||||||
|
selectable
|
||||||
:content="getContent"
|
:content="getContent"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -15,13 +15,19 @@
|
|||||||
<image v-if="isFailedMessage && !isPreview" src="@/static/images/chating_message_failed.png" />
|
<image v-if="isFailedMessage && !isPreview" src="@/static/images/chating_message_failed.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="message_content_wrap message_content_wrap_shadow">
|
<view class="message_content_wrap message_content_wrap_shadow" @longtap="longtap($event)">
|
||||||
<text-message-render v-if="showTextRender" :message="source" />
|
<text-message-render v-if="showTextRender" :message="source" />
|
||||||
<media-message-render v-else-if="showMediaRender" :message="source" />
|
<media-message-render v-else-if="showMediaRender" :message="source" />
|
||||||
<error-message-render v-else />
|
<error-message-render v-else />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 长按菜单 -->
|
||||||
|
<chunLei-popups v-model="toolTipFlag" :popData="toolTipData" @tapPopup="tapPopup"
|
||||||
|
:x="toolTipX" :y="toolTipY" :placement="popPostion"
|
||||||
|
direction="row" theme="dark" :dynamic="true">
|
||||||
|
</chunLei-popups>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view v-else class="notice_message_container" :id="`auchor${source.clientMsgID}`">
|
<view v-else class="notice_message_container" :id="`auchor${source.clientMsgID}`">
|
||||||
@@ -30,25 +36,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {mapGetters} from "vuex";
|
||||||
mapGetters
|
import {MessageStatus,MessageType,SessionType,} from "openim-uniapp-polyfill";
|
||||||
} from "vuex";
|
import chunLeiPopups from "@/components/chunLei-popups.vue";
|
||||||
import {
|
|
||||||
MessageStatus,
|
|
||||||
MessageType,
|
|
||||||
SessionType,
|
|
||||||
} from "openim-uniapp-polyfill";
|
|
||||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||||
import TextMessageRender from "./TextMessageRender.vue";
|
import TextMessageRender from "./TextMessageRender.vue";
|
||||||
import MediaMessageRender from "./MediaMessageRender.vue";
|
import MediaMessageRender from "./MediaMessageRender.vue";
|
||||||
import ErrorMessageRender from "./ErrorMessageRender.vue";
|
import ErrorMessageRender from "./ErrorMessageRender.vue";
|
||||||
import {
|
import {noticeMessageTypes} from "@/constant";
|
||||||
noticeMessageTypes
|
import {tipMessaggeFormat,formatMessageTime} from "@/util/imCommon";
|
||||||
} from "@/constant";
|
|
||||||
import {
|
|
||||||
tipMessaggeFormat,
|
|
||||||
formatMessageTime
|
|
||||||
} from "@/util/imCommon";
|
|
||||||
|
|
||||||
const textRenderTypes = [MessageType.TextMessage];
|
const textRenderTypes = [MessageType.TextMessage];
|
||||||
|
|
||||||
@@ -60,6 +56,7 @@
|
|||||||
TextMessageRender,
|
TextMessageRender,
|
||||||
MediaMessageRender,
|
MediaMessageRender,
|
||||||
ErrorMessageRender,
|
ErrorMessageRender,
|
||||||
|
chunLeiPopups
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
source: Object,
|
source: Object,
|
||||||
@@ -71,7 +68,14 @@
|
|||||||
isActive: Boolean,
|
isActive: Boolean,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
toolTipX: 0,
|
||||||
|
toolTipY: 0,
|
||||||
|
toolTipFlag: false,
|
||||||
|
popPostion:"default",
|
||||||
|
toolTipData: [],
|
||||||
|
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
@@ -133,6 +137,119 @@
|
|||||||
}, 2000);
|
}, 2000);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
longtap(e){
|
||||||
|
console.log(e.target,e.currentTarget);
|
||||||
|
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: 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;
|
||||||
|
if (e.title == "撤回") {
|
||||||
|
let editMessage=JSON.parse(JSON.stringify(currentHandleMsg));
|
||||||
|
that.$emit("revertMsg",editMessage)
|
||||||
|
that.toolTipFlag = false;
|
||||||
|
}
|
||||||
|
if (e.title == "复制") {
|
||||||
|
let content = currentHandleMsg.content;
|
||||||
|
if (content) {
|
||||||
|
let copyContent =content.text;
|
||||||
|
let formatStr = this.replaceReseverEmoji(copyContent);
|
||||||
|
that.globalUtil.uniCopy({
|
||||||
|
content: 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.toolTipFlag = false;
|
||||||
|
/* that.$u.route({
|
||||||
|
url: '/pages/chat/chatGroup/msgForward',
|
||||||
|
params: {
|
||||||
|
msgList:encodeURIComponent(JSON.stringify([currentHandleMsg])),
|
||||||
|
sendType: 1, //1 单条转发 2多条转发
|
||||||
|
fromChatGroupId: currentHandleMsg.groupId
|
||||||
|
}
|
||||||
|
}) */
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(e.title=="调换"){
|
||||||
|
that.toolTipFlag = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (e.title == "多选") {
|
||||||
|
that.toolTipFlag = false;
|
||||||
|
/* that.$u.route({
|
||||||
|
url: '/pages/chat/chatting/chatting-checkbox',
|
||||||
|
params: {
|
||||||
|
groupId:currentHandleMsg.groupId,
|
||||||
|
pageNum:1,
|
||||||
|
selectMsgId: currentHandleMsg.id,
|
||||||
|
}
|
||||||
|
}) */
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if(e.title=="编辑"){
|
||||||
|
let editMessage=JSON.parse(JSON.stringify(currentHandleMsg));
|
||||||
|
editMessage.formatTimeStr=currentHandleMsg.createTime;
|
||||||
|
that.$emit("showUpdateMsg",editMessage)
|
||||||
|
that.toolTipFlag = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -185,19 +302,22 @@
|
|||||||
color: #666;
|
color: #666;
|
||||||
margin-bottom: 6rpx;
|
margin-bottom: 6rpx;
|
||||||
}
|
}
|
||||||
|
.message_content_wrap_shadow {
|
||||||
|
box-shadow: 0px 0px 2px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
.message_content_wrap {
|
.message_content_wrap {
|
||||||
@include vCenterBox();
|
@include vCenterBox();
|
||||||
text-align: start;
|
text-align: start;
|
||||||
// font-size: 14px;
|
// font-size: 14px;
|
||||||
color: $uni-text-color;
|
color: $uni-text-color;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
max-width: 100%;
|
word-wrap: break-word;
|
||||||
|
word-break: break-word;
|
||||||
|
|
||||||
.bg_container {
|
.bg_container {
|
||||||
padding: 16rpx 24rpx;
|
padding: 16rpx 24rpx;
|
||||||
border-radius: 0rpx 12rpx 12rpx 12rpx;
|
border-radius: 0rpx 12rpx 12rpx 12rpx;
|
||||||
background-color: #f0f0f0;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -245,13 +365,15 @@
|
|||||||
margin-right: 20rpx;
|
margin-right: 20rpx;
|
||||||
// text-align: end;
|
// text-align: end;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
|
.message_content_wrap_shadow {
|
||||||
|
box-shadow: 0px 0px 2px #95e261;
|
||||||
|
}
|
||||||
.message_content_wrap {
|
.message_content_wrap {
|
||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
|
|
||||||
.bg_container {
|
.bg_container {
|
||||||
border-radius: 12rpx 0 12rpx 12rpx;
|
border-radius: 12rpx 0 12rpx 12rpx;
|
||||||
background-color: #dcebfe !important;
|
background-color: #94ec68 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :style="{ backgroundColor: '#f8f8f8' }" class="chating_container">
|
<view class="chating_container">
|
||||||
<chating-header @click="pageClick" ref="chatingHeaderRef" />
|
<chating-header @click="pageClick" ref="chatingHeaderRef" />
|
||||||
<chating-list @click="pageClick" ref="chatingListRef" @initSuccess="initSuccess" />
|
<chating-list @click="pageClick" ref="chatingListRef" @initSuccess="initSuccess" />
|
||||||
<chating-footer ref="chatingFooterRef" :footerOutsideFlag="footerOutsideFlag"
|
<chating-footer ref="chatingFooterRef" :footerOutsideFlag="footerOutsideFlag"
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
@include colBox(false);
|
@include colBox(false);
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background-color: #fff !important;
|
background-color: #ececec !important;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.watermark {
|
.watermark {
|
||||||
|
|||||||
@@ -13,8 +13,7 @@
|
|||||||
:style="'height:'+scrollViewHeight+'px'">
|
:style="'height:'+scrollViewHeight+'px'">
|
||||||
<!-- 我的朋友圈基本信息 -->
|
<!-- 我的朋友圈基本信息 -->
|
||||||
<view class="content-imgbox">
|
<view class="content-imgbox">
|
||||||
<!--circleBgImg是vuex变量,不在本页面定义 -->
|
<image class="bgimg" v-if="settings.bg" :src="settings.bg" mode="scaleToFill" @tap="showSheet"></image>
|
||||||
<image class="bgimg" v-if="circleBgImg" :src="circleBgImg" mode="scaleToFill" @tap="showSheet"></image>
|
|
||||||
<view class="bgimg" v-else @tap="showSheet"></view>
|
<view class="bgimg" v-else @tap="showSheet"></view>
|
||||||
|
|
||||||
<MyAvatar class="headimg" :src="selfInfo.faceURL" :desc="selfInfo.nickname || selfInfo.remark"
|
<MyAvatar class="headimg" :src="selfInfo.faceURL" :desc="selfInfo.nickname || selfInfo.remark"
|
||||||
@@ -269,12 +268,21 @@
|
|||||||
selfInfo() {
|
selfInfo() {
|
||||||
return this.$store.getters.storeSelfInfo;
|
return this.$store.getters.storeSelfInfo;
|
||||||
},
|
},
|
||||||
|
circleData() {
|
||||||
|
return this.$store.getters.storeCircleData;
|
||||||
|
},
|
||||||
|
vuex_friendCircleUnreadCount() {
|
||||||
|
return this.$store.getters.storeCircleUnreadCount;
|
||||||
|
},
|
||||||
|
last_unread_item() {
|
||||||
|
return this.$store.getters.storeCircleLastUnreadItem;
|
||||||
|
},
|
||||||
|
settings() {
|
||||||
|
return this.$store.getters.storeCircleSettings;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
circleData:[],
|
|
||||||
circleBgImg:"",
|
|
||||||
vuex_friendCircleUnreadCount:0,
|
|
||||||
loadMoreFlag:true,//可以分页加载吗
|
loadMoreFlag:true,//可以分页加载吗
|
||||||
platFrom:'',
|
platFrom:'',
|
||||||
girdItemCustomStyle:{
|
girdItemCustomStyle:{
|
||||||
@@ -352,9 +360,8 @@
|
|||||||
let newPraise= friendCircleMessage.content.praise;
|
let newPraise= friendCircleMessage.content.praise;
|
||||||
const index = that.circleData.findIndex(i => i.id ==id);
|
const index = that.circleData.findIndex(i => i.id ==id);
|
||||||
that.circleData[index].praise=JSON.parse(newPraise);
|
that.circleData[index].praise=JSON.parse(newPraise);
|
||||||
let unreadCount=that.vuex_friendCircleUnreadCount?that.vuex_friendCircleUnreadCount:0;
|
|
||||||
if(friendCircleMessage.content.isPraise&&friendCircleMessage.userId!=that.selfInfo.userID){
|
if(friendCircleMessage.content.isPraise&&friendCircleMessage.userId!=that.selfInfo.userID){
|
||||||
that.$u.vuex("vuex_friendCircleUnreadCount",unreadCount+1)
|
that.$store.dispatch('circle/updateUnreadCount',1);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -376,12 +383,13 @@
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
clearUnReadCount(){
|
clearUnReadCount(){
|
||||||
this.$u.vuex("vuex_friendCircleUnreadCount",0);
|
this.$store.dispatch('circle/updateUnreadCount',0-this.vuex_friendCircleUnreadCount);
|
||||||
this.localGroupApi.setTabBarBadge(2,"0");
|
|
||||||
},
|
},
|
||||||
//初始化朋友圈
|
//初始化朋友圈
|
||||||
getCircleDataList:function(param){
|
getCircleDataList:function(param){
|
||||||
let that=this;
|
let that=this;
|
||||||
|
this.$store.dispatch('circle/getFriendCircleList',param);
|
||||||
|
return ;
|
||||||
getFriendCircle(param).then(res => {
|
getFriendCircle(param).then(res => {
|
||||||
//console.log("朋友圈列表",res);
|
//console.log("朋友圈列表",res);
|
||||||
let circleDataList=res.data;
|
let circleDataList=res.data;
|
||||||
|
|||||||
@@ -7,8 +7,8 @@
|
|||||||
:thumbSize="thumbSize"
|
:thumbSize="thumbSize"
|
||||||
showArrow
|
showArrow
|
||||||
to="/pages/workbench/friend-circle/friend-circle">
|
to="/pages/workbench/friend-circle/friend-circle">
|
||||||
<view slot="footer" v-if="newCircleInfo&&newCircleInfo.userHeadImg.length>0">
|
<view slot="footer" v-if="last_unread_item&&last_unread_item.avatar.length>0">
|
||||||
<u-avatar :src="newCircleInfo.userHeadImg" mode="square" :size="70"></u-avatar>
|
<u-avatar :src="last_unread_item.avatar" mode="square" :size="70"></u-avatar>
|
||||||
<u-badge :is-dot="true" type="error" :offset="[20,60]"></u-badge>
|
<u-badge :is-dot="true" type="error" :offset="[20,60]"></u-badge>
|
||||||
</view>
|
</view>
|
||||||
</uni-list-item>
|
</uni-list-item>
|
||||||
@@ -26,38 +26,25 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getFriendCircleInfo } from "@/api/login";
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
thumbSize:"base",
|
thumbSize:"base"
|
||||||
newCircleInfo: {
|
|
||||||
userHeadImg:"",
|
|
||||||
count:0
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow: function() {
|
computed:{
|
||||||
this.changeDefaultAvatar(1,10);
|
circleUnreadCount() {
|
||||||
let unreadCount= 1;
|
return this.$store.getters.storeCircleUnreadCount;
|
||||||
//this.vuex_friendCircleUnreadCount+"";
|
|
||||||
//this.localGroupApi.setTabBarBadge(2,unreadCount);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
changeDefaultAvatar:function(min,max){
|
|
||||||
let that=this;
|
|
||||||
getFriendCircleInfo().then(res => {
|
|
||||||
if(res.code==200){
|
|
||||||
console.log("查询朋友圈更新情况",res.data);
|
|
||||||
if(res.data&&res.data.length>0){
|
|
||||||
that.newCircleInfo=res.data;
|
|
||||||
}else{
|
|
||||||
that.newCircleInfo=null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
last_unread_item() {
|
||||||
|
return this.$store.getters.storeCircleLastUnreadItem;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
onShow: function() {
|
||||||
|
let unreadCount= 1;
|
||||||
|
this.$store.dispatch('circle/getFriendCircleInfo');
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 576 B |
Binary file not shown.
|
After Width: | Height: | Size: 924 B |
Binary file not shown.
|
After Width: | Height: | Size: 704 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -20,5 +20,9 @@ export default {
|
|||||||
storeReinstall: (state) => state.user.reinstall,
|
storeReinstall: (state) => state.user.reinstall,
|
||||||
storeProgress: (state) => state.user.progress,
|
storeProgress: (state) => state.user.progress,
|
||||||
storeAuthData: (state) => state.user.authData,
|
storeAuthData: (state) => state.user.authData,
|
||||||
|
storeCircleData: (state) => state.circle.list,
|
||||||
|
storeCircleUnreadCount: (state) => state.circle.unread_count,
|
||||||
|
storeCircleLastUnreadItem: (state) => state.circle.last_unread_item,
|
||||||
|
storeCircleSettings: (state) => state.circle.settings,
|
||||||
config: (state) => state.system.config,
|
config: (state) => state.system.config,
|
||||||
};
|
};
|
||||||
@@ -5,6 +5,7 @@ import contact from "./modules/contact";
|
|||||||
import conversation from "./modules/conversation";
|
import conversation from "./modules/conversation";
|
||||||
import message from "./modules/message";
|
import message from "./modules/message";
|
||||||
import system from "./modules/system";
|
import system from "./modules/system";
|
||||||
|
import circle from "./modules/circle";
|
||||||
import getters from "./getters";
|
import getters from "./getters";
|
||||||
|
|
||||||
Vue.use(Vuex);
|
Vue.use(Vuex);
|
||||||
@@ -16,6 +17,7 @@ const store = new Vuex.Store({
|
|||||||
conversation,
|
conversation,
|
||||||
message,
|
message,
|
||||||
system,
|
system,
|
||||||
|
circle,
|
||||||
},
|
},
|
||||||
getters,
|
getters,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
const state = {
|
||||||
|
list: [],
|
||||||
|
unread_count: 0,
|
||||||
|
last_unread_item: {"avatar":"","user_id":"","nickname":""},
|
||||||
|
settings: {bg:""}
|
||||||
|
};
|
||||||
|
|
||||||
|
const mutations = {
|
||||||
|
SET_LIST(state, info) {
|
||||||
|
state.list = [...list];
|
||||||
|
},
|
||||||
|
SET_UNREAD_COUNT(state, count) {
|
||||||
|
state.unread_count = count;
|
||||||
|
if(count<1){
|
||||||
|
uni.removeTabBarBadge({
|
||||||
|
index:2
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
uni.setTabBarBadge({
|
||||||
|
index:2,
|
||||||
|
text:count
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
SET_LAST_UNREAD(state, data) {
|
||||||
|
state.last_unread_item = {...data};
|
||||||
|
},
|
||||||
|
SET_SETTINGS(state, data) {
|
||||||
|
state.settings = {...data};
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const actions = {
|
||||||
|
async getFriendCircleList({ commit},params) {
|
||||||
|
uni.$u.http.get('/friendcircle/list',params).then(res=>{
|
||||||
|
commit("SET_LIST", res.data);
|
||||||
|
}).catch(e=>{
|
||||||
|
uni.$u.toast("获取个人信息失败");
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async getFriendCircleInfo({ commit, state}) {
|
||||||
|
uni.$u.http.get('/friendcircle/info').then(data=>{
|
||||||
|
commit("SET_UNREAD_COUNT", data.count);
|
||||||
|
commit("SET_LAST_UNREAD", data.last_unread_item);
|
||||||
|
commit("SET_SETTINGS", data.settings);
|
||||||
|
}).catch(e=>{
|
||||||
|
uni.$u.toast("获取个人信息失败");
|
||||||
|
})
|
||||||
|
},
|
||||||
|
async updateUnreadCount({commit,state},v) {
|
||||||
|
commit("SET_UNREAD_COUNT", state.unread_count+v);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
namespaced: true,
|
||||||
|
state,
|
||||||
|
mutations,
|
||||||
|
actions,
|
||||||
|
};
|
||||||
@@ -47,7 +47,7 @@ const actions = {
|
|||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
const count = initialFetch ? 10000 : 1000;
|
const count = initialFetch ? 10000 : 1000;
|
||||||
const {data} = await IMSDK.asyncApi("getFriendListPage", uuidv4(), {offset,count,});
|
const {data} = await IMSDK.asyncApi("getFriendListPage", uuidv4(), {offset,count,filterBlack:true});
|
||||||
//console.log(data);
|
//console.log(data);
|
||||||
friendInfoList = [
|
friendInfoList = [
|
||||||
...friendInfoList,
|
...friendInfoList,
|
||||||
|
|||||||
Reference in New Issue
Block a user