diff --git a/App.vue b/App.vue index 9fc1727..73e9d22 100644 --- a/App.vue +++ b/App.vue @@ -489,18 +489,19 @@ this.$store.dispatch("contact/getFriendList"); this.$store.dispatch("circle/getFriendCircleInfo"); - this.handleArguments(); - uni.switchTab({ - url: "/pages/conversation/conversationList/index?isRedirect=true", - complete() { - _this.keppAlive(); - plus.navigator.closeSplashscreen(); - _this.checkUpdate(); - }, - fail(e){ - console.log(e); - } - }); + if(true !== this.handleArguments()){ + uni.switchTab({ + url: "/pages/conversation/conversationList/index?isRedirect=true", + complete() { + _this.keppAlive(); + plus.navigator.closeSplashscreen(); + _this.checkUpdate(); + }, + fail(e){ + console.log(e); + } + }); + } }, // 验证是否升级 @@ -540,7 +541,9 @@ }else{ let conversation = this.storeConversationList.find((item) => item === json.data); if(conversation){ + plus.navigator.closeSplashscreen(); prepareConversationState(conversation); + return true; } } } diff --git a/manifest.json b/manifest.json index 7f5596f..8998ca4 100644 --- a/manifest.json +++ b/manifest.json @@ -11,7 +11,7 @@ "nvueStyleCompiler" : "uni-app", "compilerVersion" : 3, "splashscreen" : { - "alwaysShowBeforeRender" : false, + "alwaysShowBeforeRender" : true, "waiting" : true, "autoclose" : false, "delay" : 0 diff --git a/pages/common/login/index.vue b/pages/common/login/index.vue index 34d88db..b57c53b 100644 --- a/pages/common/login/index.vue +++ b/pages/common/login/index.vue @@ -32,8 +32,7 @@ - - {{ count !== 0 ? `${count} s` : "获取验证码" }} + {{ count !== 0 ? `${count} s` : "获取验证码" }} @@ -218,12 +217,13 @@ export default { return; } - const options = { - phoneNumber: this.loginInfo.phoneNumber, - region: `+${this.loginInfo.region}`, - usedFor: SmsUserFor.Login, - operationID: Date.now() + "", - }; + const options = { + mobile: this.loginInfo.phoneNumber, + email: this.loginInfo.email, + region: `+${this.loginInfo.region}`, + event: "login", + type:"mobile" + }; businessSendSms(options) .then(() => { uni.$u.toast("验证码已发送!"); diff --git a/pages/common/setPassword/index.vue b/pages/common/setPassword/index.vue index e2369f7..27d656e 100644 --- a/pages/common/setPassword/index.vue +++ b/pages/common/setPassword/index.vue @@ -2,10 +2,10 @@ 重置密码 + fontSize: '14px', + marginTop: '20rpx', + minWidth: '200rpx', + }" ref="loginForm"> { return value.length >= 6; }, - message: "密码太短", + message: "密码太过于简单", trigger: ["change", "blur"], }, ], diff --git a/pages/common/setSelfInfo/index.vue b/pages/common/setSelfInfo/index.vue index 2915670..ff75e6f 100644 --- a/pages/common/setSelfInfo/index.vue +++ b/pages/common/setSelfInfo/index.vue @@ -2,10 +2,10 @@ 设置信息 + fontSize: '14px', + marginTop: '20rpx', + minWidth: '200rpx', + }" ref="loginForm"> @@ -37,8 +37,8 @@ import md5 from "md5"; import MyAvatar from "@/components/MyAvatar/index.vue"; import { mapGetters } from "vuex"; - import { businessRegister } from "@/api/login"; - import { checkLoginError } from "@/util/common"; + import {businessRegister} from "@/api/login"; + import {checkLoginError } from "@/util/common"; import util from "@/util/index.js" export default { components: { @@ -62,10 +62,11 @@ nickname: [{ type: "string", required: true, - message: "请填写真实姓名", + message: "请填写您的昵称", trigger: ["blur", "change"], }, ], - password: [{ + password: [ + { type: "string", required: true, message: "请输入密码", @@ -76,20 +77,20 @@ validator: (rule, value, callback) => { return value.length >= 6; }, - message: "密码太短", + message: "密码太过于简单", trigger: ["change", "blur"], }, ], confirmPassword: [{ type: "string", required: true, - message: "请输入确认密码", + message: "请再次输入密码", trigger: ["blur", "change"], pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{6,}$/, }, { validator: (rule, value, callback) => { - return value === this.formData.password; + return value === this.userInfo.password; }, message: "两次密码不一致", trigger: ["change", "blur"], @@ -103,15 +104,17 @@ }, onLoad(options) { const {userInfo,codeValue} = options; - this.userInfo = { - ...this.userInfo, - ...util.aesdecode(userInfo), - }; + if(userInfo){ + this.userInfo = { + ...this.userInfo, + ...util.aesdecode(userInfo), + }; + } this.codeValue = codeValue; if(process.env.NODE_ENV == 'development'){ //this.userInfo.email = "commiu@outlook.com"; this.userInfo.nickname = ""; - this.userInfo.password = "qwe123"; + this.userInfo.password = "qwe1231"; this.userInfo.confirmPassword = "qwe123"; } }, @@ -129,37 +132,46 @@ } }); }, - async doRegister() { - this.loading = true; - const options = { - code: this.codeValue, - platform: uni.$u.os(), - autoLogin: true, - ...this.userInfo, - region: `+${this.userInfo.region}`, - password: md5(this.userInfo.password), - mobile: this.userInfo.mobile - }; - try { - await businessRegister(options); - this.saveLoginInfo(); - uni.$u.toast('注册成功') - uni.$u.route("/pages/common/login/index") - } catch (err) { - console.log(err); - if(err.msg=="验证码过期" || err.msg=="验证码错误"){ - const s = util.aesencode(this.userInfo); - uni.$u.route("/pages/common/verifyCode/index", { - userInfo: s, - isRegister: true, - resend: 1, - }) - return ; + doRegister() { + const _this = this; + this.$refs.loginForm.validate().then(async (res) => { + _this.loading = true; + console.log(res); + const options = { + code: _this.codeValue, + platform: uni.$u.os(), + autoLogin: true, + ..._this.userInfo, + region: `+${_this.userInfo.region}`, + password: md5(_this.userInfo.password), + mobile: _this.userInfo.mobile + }; + try { + await businessRegister(options); + _this.saveLoginInfo(); + uni.$u.toast('注册成功') + uni.$u.route("/pages/common/login/index") + } catch (err) { + console.log(err); + if(err.msg=="验证码过期" || err.msg=="验证码错误"){ + const s = util.aesencode(_this.userInfo); + uni.$u.route("/pages/common/verifyCode/index", { + userInfo: s, + isRegister: true, + resend: 1, + }) + return ; + } + // uni.$u.toast('注册失败') + } finally { + _this.loading = false; } - // uni.$u.toast('注册失败') - } finally { - this.loading = false; - } + uni.$u.toast('校验通过') + }).catch(errors => { + console.log(errors); + uni.$u.toast('校验失败') + }); + return ; }, saveLoginInfo() { uni.setStorage({ @@ -176,7 +188,6 @@ \ No newline at end of file diff --git a/pages/conversation/groupSettings/index.vue b/pages/conversation/groupSettings/index.vue index e9c1a5b..4254b69 100644 --- a/pages/conversation/groupSettings/index.vue +++ b/pages/conversation/groupSettings/index.vue @@ -3,7 +3,7 @@ - + diff --git a/store/modules/conversation.js b/store/modules/conversation.js index cbaed1d..5cffb4a 100644 --- a/store/modules/conversation.js +++ b/store/modules/conversation.js @@ -19,7 +19,7 @@ const mutations = { }; }, SET_UNREAD_COUNT(state, count) { - if (count) { + if (count>0) { uni.setTabBarBadge({ index: 0, text: count < 99 ? count + "" : "99+", diff --git a/util/imCommon.js b/util/imCommon.js index 78d84e8..68d210d 100644 --- a/util/imCommon.js +++ b/util/imCommon.js @@ -1,5 +1,5 @@ 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 dayjs from "dayjs"; import {isThisYear} from "date-fns"; @@ -174,11 +174,17 @@ export const parseMessageByType = (pmsg) => { kickStr = kickStr.slice(0, -1); return `${getName(kickOpUser)}踢出了${kickStr}${kickdUserList.length > 3 ? "..." : ""}`; case MessageType.GroupMemberMuted: + //群成员禁言通知 return `[GroupMemberMuted]`; case MessageType.GroupMemberCancelMuted: + //取消群成员禁言通知 return `[GroupMemberCancelMuted]`; case MessageType.GroupMuted: + //群禁言通知 return `[GroupMuted]`; + case MessageType.GroupCancelMuted: + //取消群禁言通知 + return `[GroupCancelMuted]`; case MessageType.MemberQuit: const quitDetails = JSON.parse(pmsg.notificationElem.detail); const quitUser = quitDetails.quitUser; @@ -200,15 +206,19 @@ export const parseMessageByType = (pmsg) => { const groupNameUpdateDetail = JSON.parse(pmsg.notificationElem.detail); const groupNameUpdateUser = groupNameUpdateDetail.opUser; return `${getName(groupNameUpdateUser)}修改了群名称为${groupNameUpdateDetail.group.groupName}`; - case MessageType.GroupCancelMuted: - return `[GroupCancelMuted]`; case MessageType.GroupAnnouncementUpdated: + //群公告更新 + const groupAnnouncementUpdatedDetail = JSON.parse(pmsg.notificationElem.detail); + return `${getName(groupAnnouncementUpdatedDetail.opUser)}更新了群公告`; return `[GroupAnnouncementUpdated]`; case MessageType.BurnMessageChange: + //阅后即焚开启或关闭通知 return `[BurnMessageChange]`; case MessageType.RevokeMessage: - return `[RevokeMessage]`; + let notificationElem = JSON.parse(pmsg.notificationElem.detail); + return `${notificationElem.revokerNickname}撤回了一条消息`; case MessageType.MsgPinned: + //消息置顶 return `[MsgPinned]`; case 2001: const body = JSON.parse(pmsg.notificationElem.detail); @@ -370,11 +380,17 @@ export const offlinePushInfo = { }; export const getConversationContent = (message) => { + if(noticeMessageTypes.includes(message.contentType)){ + return `${parseMessageByType(message)}`; + } if ( !message.groupID || message.sendID === store.getters.storeCurrentUserID ) { return parseMessageByType(message); } - return `${message.senderNickname}:${parseMessageByType(message)}`; + if(message.senderNickname){ + return `${message.senderNickname}:${parseMessageByType(message)}`; + } + return parseMessageByType(message); }; \ No newline at end of file