deletemsg
This commit is contained in:
@@ -489,7 +489,7 @@
|
|||||||
this.$store.dispatch("contact/getFriendList");
|
this.$store.dispatch("contact/getFriendList");
|
||||||
this.$store.dispatch("circle/getFriendCircleInfo");
|
this.$store.dispatch("circle/getFriendCircleInfo");
|
||||||
|
|
||||||
this.handleArguments();
|
if(true !== this.handleArguments()){
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/conversation/conversationList/index?isRedirect=true",
|
url: "/pages/conversation/conversationList/index?isRedirect=true",
|
||||||
complete() {
|
complete() {
|
||||||
@@ -501,6 +501,7 @@
|
|||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 验证是否升级
|
// 验证是否升级
|
||||||
@@ -540,7 +541,9 @@
|
|||||||
}else{
|
}else{
|
||||||
let conversation = this.storeConversationList.find((item) => item === json.data);
|
let conversation = this.storeConversationList.find((item) => item === json.data);
|
||||||
if(conversation){
|
if(conversation){
|
||||||
|
plus.navigator.closeSplashscreen();
|
||||||
prepareConversationState(conversation);
|
prepareConversationState(conversation);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@
|
|||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler" : "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion" : 3,
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"alwaysShowBeforeRender" : false,
|
"alwaysShowBeforeRender" : true,
|
||||||
"waiting" : true,
|
"waiting" : true,
|
||||||
"autoclose" : false,
|
"autoclose" : false,
|
||||||
"delay" : 0
|
"delay" : 0
|
||||||
|
|||||||
@@ -32,8 +32,7 @@
|
|||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item v-if="active <= 1 && !isPwdLogin" label="" prop="verificationCode">
|
<u-form-item v-if="active <= 1 && !isPwdLogin" label="" prop="verificationCode">
|
||||||
<u-input v-model="loginInfo.verificationCode" border="surround" placeholder="请输入验证码">
|
<u-input v-model="loginInfo.verificationCode" border="surround" placeholder="请输入验证码">
|
||||||
<view class="code_btn" slot="suffix" @click="getCode">
|
<view class="code_btn" slot="suffix" @click="getCode">{{ count !== 0 ? `${count} s` : "获取验证码" }}
|
||||||
{{ count !== 0 ? `${count} s` : "获取验证码" }}
|
|
||||||
</view>
|
</view>
|
||||||
</u-input>
|
</u-input>
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
@@ -219,10 +218,11 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
phoneNumber: this.loginInfo.phoneNumber,
|
mobile: this.loginInfo.phoneNumber,
|
||||||
|
email: this.loginInfo.email,
|
||||||
region: `+${this.loginInfo.region}`,
|
region: `+${this.loginInfo.region}`,
|
||||||
usedFor: SmsUserFor.Login,
|
event: "login",
|
||||||
operationID: Date.now() + "",
|
type:"mobile"
|
||||||
};
|
};
|
||||||
businessSendSms(options)
|
businessSendSms(options)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
return value.length >= 6;
|
return value.length >= 6;
|
||||||
},
|
},
|
||||||
message: "密码太短",
|
message: "密码太过于简单",
|
||||||
trigger: ["change", "blur"],
|
trigger: ["change", "blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -62,10 +62,11 @@
|
|||||||
nickname: [{
|
nickname: [{
|
||||||
type: "string",
|
type: "string",
|
||||||
required: true,
|
required: true,
|
||||||
message: "请填写真实姓名",
|
message: "请填写您的昵称",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
}, ],
|
}, ],
|
||||||
password: [{
|
password: [
|
||||||
|
{
|
||||||
type: "string",
|
type: "string",
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入密码",
|
message: "请输入密码",
|
||||||
@@ -76,20 +77,20 @@
|
|||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
return value.length >= 6;
|
return value.length >= 6;
|
||||||
},
|
},
|
||||||
message: "密码太短",
|
message: "密码太过于简单",
|
||||||
trigger: ["change", "blur"],
|
trigger: ["change", "blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
confirmPassword: [{
|
confirmPassword: [{
|
||||||
type: "string",
|
type: "string",
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入确认密码",
|
message: "请再次输入密码",
|
||||||
trigger: ["blur", "change"],
|
trigger: ["blur", "change"],
|
||||||
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{6,}$/,
|
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{6,}$/,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
return value === this.formData.password;
|
return value === this.userInfo.password;
|
||||||
},
|
},
|
||||||
message: "两次密码不一致",
|
message: "两次密码不一致",
|
||||||
trigger: ["change", "blur"],
|
trigger: ["change", "blur"],
|
||||||
@@ -103,15 +104,17 @@
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const {userInfo,codeValue} = options;
|
const {userInfo,codeValue} = options;
|
||||||
|
if(userInfo){
|
||||||
this.userInfo = {
|
this.userInfo = {
|
||||||
...this.userInfo,
|
...this.userInfo,
|
||||||
...util.aesdecode(userInfo),
|
...util.aesdecode(userInfo),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
this.codeValue = codeValue;
|
this.codeValue = codeValue;
|
||||||
if(process.env.NODE_ENV == 'development'){
|
if(process.env.NODE_ENV == 'development'){
|
||||||
//this.userInfo.email = "commiu@outlook.com";
|
//this.userInfo.email = "commiu@outlook.com";
|
||||||
this.userInfo.nickname = "";
|
this.userInfo.nickname = "";
|
||||||
this.userInfo.password = "qwe123";
|
this.userInfo.password = "qwe1231";
|
||||||
this.userInfo.confirmPassword = "qwe123";
|
this.userInfo.confirmPassword = "qwe123";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -129,26 +132,29 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async doRegister() {
|
doRegister() {
|
||||||
this.loading = true;
|
const _this = this;
|
||||||
|
this.$refs.loginForm.validate().then(async (res) => {
|
||||||
|
_this.loading = true;
|
||||||
|
console.log(res);
|
||||||
const options = {
|
const options = {
|
||||||
code: this.codeValue,
|
code: _this.codeValue,
|
||||||
platform: uni.$u.os(),
|
platform: uni.$u.os(),
|
||||||
autoLogin: true,
|
autoLogin: true,
|
||||||
...this.userInfo,
|
..._this.userInfo,
|
||||||
region: `+${this.userInfo.region}`,
|
region: `+${_this.userInfo.region}`,
|
||||||
password: md5(this.userInfo.password),
|
password: md5(_this.userInfo.password),
|
||||||
mobile: this.userInfo.mobile
|
mobile: _this.userInfo.mobile
|
||||||
};
|
};
|
||||||
try {
|
try {
|
||||||
await businessRegister(options);
|
await businessRegister(options);
|
||||||
this.saveLoginInfo();
|
_this.saveLoginInfo();
|
||||||
uni.$u.toast('注册成功')
|
uni.$u.toast('注册成功')
|
||||||
uni.$u.route("/pages/common/login/index")
|
uni.$u.route("/pages/common/login/index")
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
if(err.msg=="验证码过期" || err.msg=="验证码错误"){
|
if(err.msg=="验证码过期" || err.msg=="验证码错误"){
|
||||||
const s = util.aesencode(this.userInfo);
|
const s = util.aesencode(_this.userInfo);
|
||||||
uni.$u.route("/pages/common/verifyCode/index", {
|
uni.$u.route("/pages/common/verifyCode/index", {
|
||||||
userInfo: s,
|
userInfo: s,
|
||||||
isRegister: true,
|
isRegister: true,
|
||||||
@@ -158,8 +164,14 @@
|
|||||||
}
|
}
|
||||||
// uni.$u.toast('注册失败')
|
// uni.$u.toast('注册失败')
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
_this.loading = false;
|
||||||
}
|
}
|
||||||
|
uni.$u.toast('校验通过')
|
||||||
|
}).catch(errors => {
|
||||||
|
console.log(errors);
|
||||||
|
uni.$u.toast('校验失败')
|
||||||
|
});
|
||||||
|
return ;
|
||||||
},
|
},
|
||||||
saveLoginInfo() {
|
saveLoginInfo() {
|
||||||
uni.setStorage({
|
uni.setStorage({
|
||||||
@@ -176,7 +188,6 @@
|
|||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.set_info_container {
|
.set_info_container {
|
||||||
margin-top: var(--status-bar-height);
|
|
||||||
background: linear-gradient(180deg,
|
background: linear-gradient(180deg,
|
||||||
rgba(0, 137, 255, 0.1) 0%,
|
rgba(0, 137, 255, 0.1) 0%,
|
||||||
rgba(255, 255, 255, 0) 100%);
|
rgba(255, 255, 255, 0) 100%);
|
||||||
|
|||||||
@@ -8,9 +8,16 @@
|
|||||||
export default {
|
export default {
|
||||||
name: "ErrorMessagegRender",
|
name: "ErrorMessagegRender",
|
||||||
components: {},
|
components: {},
|
||||||
|
props: {
|
||||||
|
message: Object,
|
||||||
|
conversationID:String,
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
|
created(){
|
||||||
|
console.log(this.message);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
<view v-if="isNoticeMessage" class="notice_message_container" style="margin: 0 auto;" :id="`auchor${source.clientMsgID}`">
|
<view v-if="isNoticeMessage" class="notice_message_container" style="margin: 0 auto;" :id="`auchor${source.clientMsgID}`">
|
||||||
<text>{{ getNoticeContent }}</text>
|
<text>{{ getNoticeContent }}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else-if="source.contentType == 1519" class="notice_message_container" style="margin: 0 auto;" :id="`auchor${source.clientMsgID}`">
|
||||||
|
<text @click="toAnnouncement">{{ announcementElem.opUser.nickname }}更新了群公告</text>
|
||||||
|
</view>
|
||||||
<view v-else class="message_wrapper">
|
<view v-else class="message_wrapper">
|
||||||
<template v-if="selectFlag">
|
<template v-if="selectFlag">
|
||||||
<uni-icons class="selectedIcon" size="30" color="#07c160" type="checkbox-filled" v-if="selectClientMsgIDItems.indexOf(source.clientMsgID)>-1"></uni-icons>
|
<uni-icons class="selectedIcon" size="30" color="#07c160" type="checkbox-filled" v-if="selectClientMsgIDItems.indexOf(source.clientMsgID)>-1"></uni-icons>
|
||||||
@@ -24,7 +27,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="message_content_wrap message_content_wrap_shadow" :id="`message_content_wrap_${source.clientMsgID}`" @longtap.stop.prevent="longtapEvent($event)">
|
<view class="message_content_wrap message_content_wrap_shadow" :id="`message_content_wrap_${source.clientMsgID}`" @longtap.stop.prevent="longtapEvent($event)">
|
||||||
<component :is="component"
|
<component v-if="component" :is="component"
|
||||||
@messageEvent="onMessageEvent"
|
@messageEvent="onMessageEvent"
|
||||||
:isSender="isSender"
|
:isSender="isSender"
|
||||||
:message="source"
|
:message="source"
|
||||||
@@ -34,6 +37,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="selected_overlay" v-if="selectFlag"></view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -113,7 +117,8 @@
|
|||||||
toolTipFlag: false,
|
toolTipFlag: false,
|
||||||
popPostion:"default",
|
popPostion:"default",
|
||||||
toolTipData: [],
|
toolTipData: [],
|
||||||
component:"ErrorMessageRender"
|
component:"",
|
||||||
|
announcementElem:{opUser:{nickname:""}}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -159,6 +164,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
if(this.source.contentType == MessageType.GroupAnnouncementUpdated){
|
||||||
|
this.announcementElem = JSON.parse(this.source.notificationElem.detail)
|
||||||
|
}else{
|
||||||
const MsgType2Components = {
|
const MsgType2Components = {
|
||||||
['type_'+MessageType.TextMessage] : "TextMessageRender",
|
['type_'+MessageType.TextMessage] : "TextMessageRender",
|
||||||
['type_'+MessageType.PictureMessage] : "PictureMessageRender",
|
['type_'+MessageType.PictureMessage] : "PictureMessageRender",
|
||||||
@@ -179,6 +187,7 @@
|
|||||||
'type_2001' : "NotificationRender"
|
'type_2001' : "NotificationRender"
|
||||||
};
|
};
|
||||||
this.component = MsgType2Components['type_'+this.source.contentType] || "ErrorMessageRender";
|
this.component = MsgType2Components['type_'+this.source.contentType] || "ErrorMessageRender";
|
||||||
|
}
|
||||||
this.$emit('userEvent',{type:"messageItemRender"},this.source.clientMsgID);
|
this.$emit('userEvent',{type:"messageItemRender"},this.source.clientMsgID);
|
||||||
this.setSendingDelay();
|
this.setSendingDelay();
|
||||||
},
|
},
|
||||||
@@ -191,6 +200,11 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
toAnnouncement(){
|
||||||
|
uni.navigateTo({
|
||||||
|
url:"/pages/conversation/groupSettings/announcement"
|
||||||
|
})
|
||||||
|
},
|
||||||
setSendingDelay() {
|
setSendingDelay() {
|
||||||
if (this.source.status === MessageStatus.Sending) {
|
if (this.source.status === MessageStatus.Sending) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -201,8 +215,8 @@
|
|||||||
longtapEvent(e){
|
longtapEvent(e){
|
||||||
this.$emit('userEvent',{type:"longtapMsgContent"},this.source);
|
this.$emit('userEvent',{type:"longtapMsgContent"},this.source);
|
||||||
},
|
},
|
||||||
onMessageEvent(e){
|
onMessageEvent(e,data){
|
||||||
this.$emit('userEvent',e);
|
this.$emit('userEvent',e,data);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -214,6 +228,15 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
position: relative;
|
||||||
|
.selected_overlay{
|
||||||
|
position: absolute;
|
||||||
|
left:0;
|
||||||
|
top:0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.message_item {
|
.message_item {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@@ -50,6 +50,8 @@
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
|
"storeHistoryMessageList",
|
||||||
|
"storeCurrentUserID",
|
||||||
"storeCurrentConversation","storeCurrentMsg",'storeCurrentMsgID'
|
"storeCurrentConversation","storeCurrentMsg",'storeCurrentMsgID'
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
@@ -91,8 +93,17 @@
|
|||||||
if (options?.back2Tab) {
|
if (options?.back2Tab) {
|
||||||
this.back2Tab = JSON.parse(options.back2Tab);
|
this.back2Tab = JSON.parse(options.back2Tab);
|
||||||
}
|
}
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnMsgDeleted,({data})=>{
|
||||||
|
let list = this.storeHistoryMessageList;
|
||||||
|
//console.log(data);
|
||||||
|
list = list.filter((item)=>{
|
||||||
|
return item.serverMsgID != data.serverMsgID;
|
||||||
|
})
|
||||||
|
this.$store.commit('message/SET_HISTORY_MESSAGE_LIST',list);
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
|
IMSDK.unsubscribe(IMSDK.IMEvents.OnMsgDeleted);
|
||||||
//console.log("unload");
|
//console.log("unload");
|
||||||
this.disposePageListener();
|
this.disposePageListener();
|
||||||
markConversationAsRead({...this.$store.getters.storeCurrentConversation,},true);
|
markConversationAsRead({...this.$store.getters.storeCurrentConversation,},true);
|
||||||
@@ -215,18 +226,9 @@
|
|||||||
if(noticeMessageTypes.includes(data.contentType)){
|
if(noticeMessageTypes.includes(data.contentType)){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
let founded = false;
|
let arr = this.selectItems.filter((item)=>item.clientMsgID != data.clientMsgID);
|
||||||
let arr = [];
|
if(arr.length === this.selectItems.length){
|
||||||
for (var index = 0; index < this.selectItems.length; index++) {
|
arr.push(data)
|
||||||
var v = this.selectItems[index];
|
|
||||||
if (v.clientMsgID == data.clientMsgID) {
|
|
||||||
founded = true;
|
|
||||||
} else {
|
|
||||||
arr.push(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!founded) {
|
|
||||||
arr.push(data);
|
|
||||||
}
|
}
|
||||||
this.selectItems = [...arr];
|
this.selectItems = [...arr];
|
||||||
}
|
}
|
||||||
@@ -241,17 +243,19 @@
|
|||||||
}
|
}
|
||||||
for (let i = 0; i < deleteMsgs.length; i++) {
|
for (let i = 0; i < deleteMsgs.length; i++) {
|
||||||
let element = deleteMsgs[i];
|
let element = deleteMsgs[i];
|
||||||
IMSDK.asyncApi('deleteMessageFromLocalStorage', IMSDK.uuid(), {
|
IMSDK.asyncApi(IMSDK.IMMethods.DeleteMessageFromLocalStorage, IMSDK.uuid(), {
|
||||||
|
//IMSDK.asyncApi(IMSDK.IMMethods.DeleteMessage, IMSDK.uuid(), {
|
||||||
conversationID: _this.storeCurrentConversation.conversationID,
|
conversationID: _this.storeCurrentConversation.conversationID,
|
||||||
clientMsgID: element.clientMsgID
|
clientMsgID: element.clientMsgID
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
//console.log(res);
|
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
//console.log(res);
|
console.log('catch',res);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
//console.log(arguments);
|
console.log('finally',arguments);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectItems = [];
|
this.selectItems = [];
|
||||||
this.$refs.chatingListRef.loadMessageList();
|
this.$refs.chatingListRef.loadMessageList();
|
||||||
return;
|
return;
|
||||||
@@ -300,7 +304,11 @@
|
|||||||
conversationID: _this.storeCurrentConversation.conversationID,
|
conversationID: _this.storeCurrentConversation.conversationID,
|
||||||
clientMsgID: data.clientMsgID
|
clientMsgID: data.clientMsgID
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res);
|
let list = _this.storeHistoryMessageList;
|
||||||
|
list = list.filter((item)=>{
|
||||||
|
return item.clientMsgID != data.clientMsgID;
|
||||||
|
});
|
||||||
|
_this.$store.commit('message/SET_HISTORY_MESSAGE_LIST',list);
|
||||||
}).catch(res => {
|
}).catch(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@@ -327,7 +335,7 @@
|
|||||||
let nowTime = new Date().getTime();
|
let nowTime = new Date().getTime();
|
||||||
let msgTime = data.createTime;
|
let msgTime = data.createTime;
|
||||||
let diff = nowTime - msgTime;
|
let diff = nowTime - msgTime;
|
||||||
if (this.isSender && diff < 120000) {
|
if (_this.storeCurrentUserID == data.sendID && diff < 120000) {
|
||||||
menu.push('撤回')
|
menu.push('撤回')
|
||||||
}
|
}
|
||||||
uni.showActionSheet({
|
uni.showActionSheet({
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
// uni.navigateTo({
|
// uni.navigateTo({
|
||||||
// url:"/pages/user/vip/vip"
|
// url:"/pages/user/vip/vip"
|
||||||
// });
|
// });
|
||||||
//prepareConversationState(this.storeConversationList[2]);
|
prepareConversationState(this.storeConversationList[0]);
|
||||||
},1000)
|
},1000)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@@ -1,17 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<view style="display: flex;flex-direction: column;width: 100vw;height: 100vh;">
|
<view>
|
||||||
<u-navbar
|
<u-navbar
|
||||||
:autoBack="true"
|
|
||||||
title="群公告"
|
title="群公告"
|
||||||
safeAreaInsetTop
|
|
||||||
placeholder
|
placeholder
|
||||||
fixed
|
:autoBack="true"
|
||||||
>
|
>
|
||||||
<view class="u-nav-slot" slot="right" v-if="isOwner || isAdmin">
|
<view class="u-nav-slot" slot="right" v-if="isOwner || isAdmin">
|
||||||
<u-button type="primary" size="mini" @click="save">确定</u-button>
|
<u-button type="primary" size="mini" @click="save">保存</u-button>
|
||||||
</view>
|
</view>
|
||||||
</u-navbar>
|
</u-navbar>
|
||||||
<u--textarea :disabled="!isOwner && !isAdmin" count confirmType="done" focus autoHeight maxlength="-1" border="none" v-model="announcement"></u--textarea >
|
<u-parse v-if="!isOwner && !isAdmin" :content="announcement"></u-parse>
|
||||||
|
<u--textarea v-else
|
||||||
|
count
|
||||||
|
confirmType="done"
|
||||||
|
focus
|
||||||
|
autoHeight
|
||||||
|
height="500"
|
||||||
|
maxlength="-1"
|
||||||
|
border="none"
|
||||||
|
:adjustPosition="false"
|
||||||
|
class="textarea"
|
||||||
|
placeholder="暂无公告"
|
||||||
|
v-model="announcement"
|
||||||
|
>
|
||||||
|
</u--textarea>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -45,7 +57,7 @@
|
|||||||
uni.navigateBack();
|
uni.navigateBack();
|
||||||
},
|
},
|
||||||
save(){
|
save(){
|
||||||
if(!isOwner && !isAdmin){
|
if(!this.isOwner && !this.isAdmin){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
IMSDK.asyncApi(IMSDK.IMMethods.SetGroupInfo, IMSDK.uuid(), {
|
IMSDK.asyncApi(IMSDK.IMMethods.SetGroupInfo, IMSDK.uuid(), {
|
||||||
@@ -62,6 +74,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style scoped lang="scss">
|
||||||
|
.textarea{
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<u-navbar :autoBack="true" bgColor="#ECECEC" :title="'群聊设置('+storeCurrentGroup.memberCount+')'" safeAreaInsetTop placeholder fixed></u-navbar>
|
<u-navbar :autoBack="true" bgColor="#ECECEC" :title="'群聊设置('+storeCurrentGroup.memberCount+')'" safeAreaInsetTop placeholder fixed></u-navbar>
|
||||||
|
|
||||||
<view class="group_settings_content">
|
<view class="group_settings_content">
|
||||||
<view class="setting_row info_row" v-if="1==2">
|
<view class="setting_row info_row">
|
||||||
<view class="group_avatar" @click="updateGroupAvatar">
|
<view class="group_avatar" @click="updateGroupAvatar">
|
||||||
<my-avatar :src="storeCurrentConversation.faceURL" :isGroup="true" size="46" />
|
<my-avatar :src="storeCurrentConversation.faceURL" :isGroup="true" size="46" />
|
||||||
<image v-if="isOwner" class="edit_icon" src="@/static/images/group_setting_edit.png" alt="" />
|
<image v-if="isOwner" class="edit_icon" src="@/static/images/group_setting_edit.png" alt="" />
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ const mutations = {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
SET_UNREAD_COUNT(state, count) {
|
SET_UNREAD_COUNT(state, count) {
|
||||||
if (count) {
|
if (count>0) {
|
||||||
uni.setTabBarBadge({
|
uni.setTabBarBadge({
|
||||||
index: 0,
|
index: 0,
|
||||||
text: count < 99 ? count + "" : "99+",
|
text: count < 99 ? count + "" : "99+",
|
||||||
|
|||||||
+20
-4
@@ -1,5 +1,5 @@
|
|||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
import {CustomType,GroupSystemMessageTypes,AddFriendQrCodePrefix,AddGroupQrCodePrefix} from "@/constant";
|
import {CustomType,GroupSystemMessageTypes,noticeMessageTypes} from "@/constant";
|
||||||
import IMSDK, {GroupAtType,MessageType,SessionType} from "openim-uniapp-polyfill";
|
import IMSDK, {GroupAtType,MessageType,SessionType} from "openim-uniapp-polyfill";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import {isThisYear} from "date-fns";
|
import {isThisYear} from "date-fns";
|
||||||
@@ -174,11 +174,17 @@ export const parseMessageByType = (pmsg) => {
|
|||||||
kickStr = kickStr.slice(0, -1);
|
kickStr = kickStr.slice(0, -1);
|
||||||
return `${getName(kickOpUser)}踢出了${kickStr}${kickdUserList.length > 3 ? "..." : ""}`;
|
return `${getName(kickOpUser)}踢出了${kickStr}${kickdUserList.length > 3 ? "..." : ""}`;
|
||||||
case MessageType.GroupMemberMuted:
|
case MessageType.GroupMemberMuted:
|
||||||
|
//群成员禁言通知
|
||||||
return `[GroupMemberMuted]`;
|
return `[GroupMemberMuted]`;
|
||||||
case MessageType.GroupMemberCancelMuted:
|
case MessageType.GroupMemberCancelMuted:
|
||||||
|
//取消群成员禁言通知
|
||||||
return `[GroupMemberCancelMuted]`;
|
return `[GroupMemberCancelMuted]`;
|
||||||
case MessageType.GroupMuted:
|
case MessageType.GroupMuted:
|
||||||
|
//群禁言通知
|
||||||
return `[GroupMuted]`;
|
return `[GroupMuted]`;
|
||||||
|
case MessageType.GroupCancelMuted:
|
||||||
|
//取消群禁言通知
|
||||||
|
return `[GroupCancelMuted]`;
|
||||||
case MessageType.MemberQuit:
|
case MessageType.MemberQuit:
|
||||||
const quitDetails = JSON.parse(pmsg.notificationElem.detail);
|
const quitDetails = JSON.parse(pmsg.notificationElem.detail);
|
||||||
const quitUser = quitDetails.quitUser;
|
const quitUser = quitDetails.quitUser;
|
||||||
@@ -200,15 +206,19 @@ export const parseMessageByType = (pmsg) => {
|
|||||||
const groupNameUpdateDetail = JSON.parse(pmsg.notificationElem.detail);
|
const groupNameUpdateDetail = JSON.parse(pmsg.notificationElem.detail);
|
||||||
const groupNameUpdateUser = groupNameUpdateDetail.opUser;
|
const groupNameUpdateUser = groupNameUpdateDetail.opUser;
|
||||||
return `${getName(groupNameUpdateUser)}修改了群名称为${groupNameUpdateDetail.group.groupName}`;
|
return `${getName(groupNameUpdateUser)}修改了群名称为${groupNameUpdateDetail.group.groupName}`;
|
||||||
case MessageType.GroupCancelMuted:
|
|
||||||
return `[GroupCancelMuted]`;
|
|
||||||
case MessageType.GroupAnnouncementUpdated:
|
case MessageType.GroupAnnouncementUpdated:
|
||||||
|
//群公告更新
|
||||||
|
const groupAnnouncementUpdatedDetail = JSON.parse(pmsg.notificationElem.detail);
|
||||||
|
return `${getName(groupAnnouncementUpdatedDetail.opUser)}更新了群公告`;
|
||||||
return `[GroupAnnouncementUpdated]`;
|
return `[GroupAnnouncementUpdated]`;
|
||||||
case MessageType.BurnMessageChange:
|
case MessageType.BurnMessageChange:
|
||||||
|
//阅后即焚开启或关闭通知
|
||||||
return `[BurnMessageChange]`;
|
return `[BurnMessageChange]`;
|
||||||
case MessageType.RevokeMessage:
|
case MessageType.RevokeMessage:
|
||||||
return `[RevokeMessage]`;
|
let notificationElem = JSON.parse(pmsg.notificationElem.detail);
|
||||||
|
return `${notificationElem.revokerNickname}撤回了一条消息`;
|
||||||
case MessageType.MsgPinned:
|
case MessageType.MsgPinned:
|
||||||
|
//消息置顶
|
||||||
return `[MsgPinned]`;
|
return `[MsgPinned]`;
|
||||||
case 2001:
|
case 2001:
|
||||||
const body = JSON.parse(pmsg.notificationElem.detail);
|
const body = JSON.parse(pmsg.notificationElem.detail);
|
||||||
@@ -370,11 +380,17 @@ export const offlinePushInfo = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getConversationContent = (message) => {
|
export const getConversationContent = (message) => {
|
||||||
|
if(noticeMessageTypes.includes(message.contentType)){
|
||||||
|
return `${parseMessageByType(message)}`;
|
||||||
|
}
|
||||||
if (
|
if (
|
||||||
!message.groupID ||
|
!message.groupID ||
|
||||||
message.sendID === store.getters.storeCurrentUserID
|
message.sendID === store.getters.storeCurrentUserID
|
||||||
) {
|
) {
|
||||||
return parseMessageByType(message);
|
return parseMessageByType(message);
|
||||||
}
|
}
|
||||||
|
if(message.senderNickname){
|
||||||
return `${message.senderNickname}:${parseMessageByType(message)}`;
|
return `${message.senderNickname}:${parseMessageByType(message)}`;
|
||||||
|
}
|
||||||
|
return parseMessageByType(message);
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user