20
@@ -1,5 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import IMSDK from "openim-uniapp-polyfill";
|
import {mapGetters,mapActions} from "vuex";
|
||||||
|
import IMSDK, {IMMethods,MessageType,SessionType,} from "openim-uniapp-polyfill";
|
||||||
|
import config from "@/common/config";
|
||||||
|
import {getDbDir,toastWithCallback} from "@/util/common.js";
|
||||||
|
import {getConversationContent,conversationSort,prepareConversationState} from "@/util/imCommon";
|
||||||
|
import {PageEvents,UpdateMessageTypes} from "@/constant";
|
||||||
|
import {checkUpgrade} from "@/api/login.js"
|
||||||
export default {
|
export default {
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
// #ifndef APP
|
// #ifndef APP
|
||||||
@@ -8,18 +14,15 @@
|
|||||||
);
|
);
|
||||||
return ;
|
return ;
|
||||||
// #endif
|
// #endif
|
||||||
|
this.$store.dispatch("system/getConfig");
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
var args= plus.runtime.arguments;
|
|
||||||
if(args){
|
|
||||||
// 处理args参数,如直达到某新页面等
|
|
||||||
console.log(args);
|
|
||||||
}
|
|
||||||
//console.log("App Show");
|
//console.log("App Show");
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), false);
|
IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), false);
|
||||||
// #endif
|
// #endif
|
||||||
|
this.handleArguments();
|
||||||
//console.log(this.$store.state.contact);
|
//console.log(this.$store.state.contact);
|
||||||
},
|
},
|
||||||
onHide: function() {
|
onHide: function() {
|
||||||
@@ -28,20 +31,524 @@
|
|||||||
IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), true);
|
IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), true);
|
||||||
// #endif
|
// #endif
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters([
|
||||||
|
"storeConversationList",
|
||||||
|
"storeCurrentConversation",
|
||||||
|
"storeCurrentUserID",
|
||||||
|
"storeSelfInfo",
|
||||||
|
"storeRecvFriendApplications",
|
||||||
|
"storeRecvGroupApplications",
|
||||||
|
"storeHistoryMessageList",
|
||||||
|
"storeIsSyncing",
|
||||||
|
"storeGroupList",
|
||||||
|
"config",
|
||||||
|
]),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
...mapActions("message", ["pushNewMessage", "updateOneMessage"]),
|
||||||
|
...mapActions("conversation", ["updateCurrentMemberInGroup"]),
|
||||||
|
...mapActions("circle", ["getFriendCircleInfo"]),
|
||||||
|
...mapActions("contact", [
|
||||||
|
"updateFriendInfo",
|
||||||
|
"pushNewFriend",
|
||||||
|
"updateBlackInfo",
|
||||||
|
"pushNewBlack",
|
||||||
|
"pushNewGroup",
|
||||||
|
"updateGroupInfo",
|
||||||
|
"pushNewRecvFriendApplition",
|
||||||
|
"updateRecvFriendApplition",
|
||||||
|
"pushNewSentFriendApplition",
|
||||||
|
"updateSentFriendApplition",
|
||||||
|
"pushNewRecvGroupApplition",
|
||||||
|
"updateRecvGroupApplition",
|
||||||
|
"pushNewSentGroupApplition",
|
||||||
|
"updateSentGroupApplition",
|
||||||
|
]),
|
||||||
init(){
|
init(){
|
||||||
this.$store.dispatch("system/getConfig");
|
|
||||||
const IMToken = uni.getStorageSync("IMToken");
|
const IMToken = uni.getStorageSync("IMToken");
|
||||||
const IMUserID = uni.getStorageSync("IMUserID")+'';
|
const IMUserID = uni.getStorageSync("IMUserID")+'';
|
||||||
if (IMToken && IMUserID) {
|
if (IMToken && IMUserID) {
|
||||||
uni.navigateTo({
|
// #ifdef APP
|
||||||
url: "/pages/index/launch"
|
this.tryLogin();
|
||||||
|
// #endif
|
||||||
|
}else{
|
||||||
|
plus.navigator.closeSplashscreen();
|
||||||
|
uni.$u.route("/pages/common/login/index");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setGlobalIMlistener() {
|
||||||
|
//console.log("setGlobalIMlistener");
|
||||||
|
// init
|
||||||
|
const kickHander = (message) => {
|
||||||
|
toastWithCallback(message, () => {
|
||||||
|
uni.removeStorage({
|
||||||
|
key: "IMToken",
|
||||||
|
});
|
||||||
|
uni.removeStorage({
|
||||||
|
key: "BusinessToken",
|
||||||
|
});
|
||||||
|
uni.$u.route("/pages/common/login/index");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//由于 APP 管理员强制用户下线,或由于登录策略导致用户被踢下线
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnKickedOffline, (data) => {
|
||||||
|
kickHander("您的账号在其他设备登录,请重新登陆!");
|
||||||
|
});
|
||||||
|
//token无效回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnUserTokenExpired, (data) => {
|
||||||
|
kickHander("您的登录已过期,请重新登陆!");
|
||||||
|
});
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnUserTokenInvalid, (data) => {
|
||||||
|
kickHander("您的登录已无效,请重新登陆!");
|
||||||
|
});
|
||||||
|
|
||||||
|
// sync
|
||||||
|
//向服务器同步会话开始时的回调。
|
||||||
|
const syncStartHandler = ({data}) => {
|
||||||
|
this.$store.commit("user/SET_IS_SYNCING", true);
|
||||||
|
this.$store.commit("user/SET_REINSTALL", data);
|
||||||
|
};
|
||||||
|
//同步中
|
||||||
|
const syncProgressHandler = ({data}) => {
|
||||||
|
this.$store.commit("user/SET_PROGRESS", data);
|
||||||
|
};
|
||||||
|
//向服务器同步会话成功时的回调。
|
||||||
|
const syncFinishHandler = () => {
|
||||||
|
uni.hideLoading();
|
||||||
|
this.$store.dispatch("conversation/getConversationList");
|
||||||
|
this.$store.dispatch("contact/getFriendList");
|
||||||
|
this.$store.dispatch("contact/getGrouplist");
|
||||||
|
this.$store.dispatch("conversation/getUnReadCount");
|
||||||
|
this.$store.commit("user/SET_IS_SYNCING", false);
|
||||||
|
};
|
||||||
|
//向服务器同步会话失败时的回调。
|
||||||
|
const syncFailedHandler = () => {
|
||||||
|
uni.hideLoading();
|
||||||
|
uni.$u.toast("同步消息失败");
|
||||||
|
this.$store.dispatch("conversation/getConversationList");
|
||||||
|
this.$store.dispatch("conversation/getUnReadCount");
|
||||||
|
this.$store.commit("user/SET_IS_SYNCING", false);
|
||||||
|
};
|
||||||
|
//向服务器同步会话开始时的回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnSyncServerStart, syncStartHandler);
|
||||||
|
//向服务器同步会话成功时的回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnSyncServerFinish, syncFinishHandler);
|
||||||
|
//向服务器同步会话失败时的回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnSyncServerFailed, syncFailedHandler);
|
||||||
|
//同步中
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnSyncServerProgress, syncProgressHandler);
|
||||||
|
|
||||||
|
// 当前登录用户个人信息改变时会收到此回调。
|
||||||
|
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnSelfInfoUpdated, ({data}) => {
|
||||||
|
this.$store.commit("user/SET_SELF_INFO", {
|
||||||
|
...this.storeSelfInfo,
|
||||||
|
...data,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// message
|
||||||
|
//接收到新消息时会收到此回调,回调中只会携带一条消息。
|
||||||
|
//设置了批量消息监听setBatchMsgListener时,此回调不会触发。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.OnRecvNewMessage, ({data}) =>{});
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnRecvNewMessages, ({data}) => {
|
||||||
|
if (this.storeIsSyncing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
data.forEach(this.handleNewMessage);
|
||||||
|
});
|
||||||
|
|
||||||
|
//好友个人信息(包括备注)改变时会收到此回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnFriendInfoChanged,({data}) => {
|
||||||
|
console.log('friendInfoChangeHandler',data);
|
||||||
|
uni.$emit(IMSDK.IMEvents.OnFriendInfoChanged, {data});
|
||||||
|
this.updateFriendInfo({friendInfo: data,});
|
||||||
|
});
|
||||||
|
//两个用户成功建立好友关系后双方都会收到该回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnFriendAdded, ({data}) => {
|
||||||
|
this.pushNewFriend(data);
|
||||||
|
});
|
||||||
|
//某个用户的好友列表减少时会收到该回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnFriendDeleted, ({data}) => {
|
||||||
|
this.updateFriendInfo({
|
||||||
|
friendInfo: data,
|
||||||
|
isRemove: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// blacklist
|
||||||
|
//某个用户的黑名单列表增加时会收到该回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnBlackAdded, ({data}) => {
|
||||||
|
this.pushNewBlack(data);
|
||||||
|
});
|
||||||
|
//某个用户的黑名单列表减少时会收到该回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnBlackDeleted, ({data}) => {
|
||||||
|
this.updateBlackInfo({
|
||||||
|
blackInfo: data,
|
||||||
|
isRemove: true,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// group
|
||||||
|
const joinedGroupAddedHandler = ({data}) => {
|
||||||
|
this.pushNewGroup(data);
|
||||||
|
};
|
||||||
|
const joinedGroupDeletedHandler = ({data}) => {
|
||||||
|
this.updateGroupInfo({
|
||||||
|
groupInfo: data,
|
||||||
|
isRemove: true,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const groupInfoChangedHandler = ({data}) => {
|
||||||
|
this.updateGroupInfo({
|
||||||
|
groupInfo: data,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const groupMemberInfoChangedHandler = ({data}) => {
|
||||||
|
uni.$emit(IMSDK.IMEvents.OnGroupMemberInfoChanged, {data});
|
||||||
|
if (data.groupID === this.storeCurrentConversation?.groupID) {
|
||||||
|
this.updateCurrentMemberInGroup(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//用户所在群组的数量增加时(被邀请入群、入群申请被同意等),会收到此回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnJoinedGroupAdded,joinedGroupAddedHandler);
|
||||||
|
//用户所在群组的数量减少时(主动退群、群被解散等),会收到此回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnJoinedGroupDeleted,joinedGroupDeletedHandler);
|
||||||
|
//群组信息(头像、群名称等,也包括群主变化)改变时,该群所有群成员会收到此回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnGroupInfoChanged,groupInfoChangedHandler);
|
||||||
|
//群成员信息改变(群昵称、头像等)后回调,该群所有群成员会收到此回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnGroupMemberInfoChanged,groupMemberInfoChangedHandler);
|
||||||
|
|
||||||
|
// application
|
||||||
|
const friendApplicationNumHandler = ({data}) => {
|
||||||
|
const isRecv = data.toUserID === this.storeCurrentUserID;
|
||||||
|
if (isRecv) {
|
||||||
|
this.pushNewRecvFriendApplition(data);
|
||||||
|
} else {
|
||||||
|
this.pushNewSentFriendApplition(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const friendApplicationAccessHandler = ({data}) => {
|
||||||
|
const isRecv = data.toUserID === this.storeCurrentUserID;
|
||||||
|
if (isRecv) {
|
||||||
|
this.updateRecvFriendApplition({
|
||||||
|
application: data,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
this.updateSentFriendApplition({
|
||||||
url: "/pages/common/login/index"
|
application: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
const groupApplicationNumHandler = ({data}) => {
|
||||||
|
const isRecv = data.userID !== this.storeCurrentUserID;
|
||||||
|
if (isRecv) {
|
||||||
|
this.pushNewRecvGroupApplition(data);
|
||||||
|
} else {
|
||||||
|
this.pushNewSentGroupApplition(data);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const groupApplicationAccessHandler = ({data}) => {
|
||||||
|
const isRecv = data.userID !== this.storeCurrentUserID;
|
||||||
|
if (isRecv) {
|
||||||
|
this.updateRecvGroupApplition({
|
||||||
|
application: data,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.updateSentGroupApplition({
|
||||||
|
application: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
//用户发起好友申请后,申请发起者和接收者都会收到此回调,接收者可以选择同意或拒绝好友申请。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnFriendApplicationAdded,friendApplicationNumHandler);
|
||||||
|
//好友申请被同意时,申请发起方和接收方都会收到该回调,双方成功建立好友关系。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnFriendApplicationAccepted,friendApplicationAccessHandler);
|
||||||
|
//好友申请被拒绝时,申请发起方和接收方都会收到该回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnFriendApplicationRejected,friendApplicationAccessHandler);
|
||||||
|
//用户发起好友申请后,申请发起者和接收者都会收到此回调,接收者可以选择同意或拒绝好友申请。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnGroupApplicationAdded,groupApplicationNumHandler);
|
||||||
|
//好友申请被同意时,申请发起方和接收方都会收到该回调,双方成功建立好友关系。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnGroupApplicationAccepted,groupApplicationAccessHandler);
|
||||||
|
//好友申请被拒绝时,申请发起方和接收方都会收到该回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnGroupApplicationRejected,groupApplicationAccessHandler);
|
||||||
|
//群组被解散时,该群所有群成员会收到此回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.OnGroupDismissed,({ data })=>{});
|
||||||
|
//群成员增加(如用户被邀请进群),其他群成员会收到此回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onGroupMemberAdded,({ data })=>{});
|
||||||
|
//群成员增加(如用户被邀请进群),群成员减少(如群成员退群), 其他群成员会收到此回调。。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onGroupMemberDeleted,({ data })=>{});
|
||||||
|
//收到的消息被撤回或自己发出的消息被撤回时,会收到此回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onNewRecvMessageRevoked,({ data })=>{});
|
||||||
|
//自己发出的单聊消息被对方标记为已读后,消息发送者会收到此回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onRecvC2CReadReceipt,({ data })=>{});
|
||||||
|
//自己发出的群聊消息被群成员标记为已读后,消息发送者和标记者均会收到此回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onRecvGroupReadReceipt,({ data })=>{});
|
||||||
|
//当应用在后台运行,接收到新消息时,会收到该回调,回调中只会携带一条消息。
|
||||||
|
//设置了批量消息监听setBatchMsgListener时,此回调不会触发。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onRecvOfflineNewMessage,({ data })=>{});
|
||||||
|
//当应用在后台运行,接收到新消息时,会收到该回调,回调中可能会携带多条消息。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessages,({data})=>{
|
||||||
|
data.forEach(this.handleOfflineNewMessages);
|
||||||
|
});
|
||||||
|
//已订阅用户的在线状态发生变化时,会触发此回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onUserStatusChanged,({ data })=>{});
|
||||||
|
//建立WebSocket连接失败返回后,触发此回调
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onConnectFailed,({ data })=>{});
|
||||||
|
//建立WebSocket连接成功返回后,触发此回调
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onConnectSuccess,({ data })=>{});
|
||||||
|
//建立WebSocket连接中,触发此回调
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onConnecting,({ data })=>{});
|
||||||
|
//正在输入状态回调。
|
||||||
|
//IMSDK.subscribe(IMSDK.IMEvents.onInputStatusChanged,({ data })=>{});
|
||||||
|
// conversation
|
||||||
|
const totalUnreadCountChangedHandler = ({data}) => {
|
||||||
|
if (this.storeIsSyncing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$store.commit("conversation/SET_UNREAD_COUNT", data);
|
||||||
|
};
|
||||||
|
const newConversationHandler = ({data}) => {
|
||||||
|
if (this.storeIsSyncing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const result = [...data, ...this.storeConversationList];
|
||||||
|
this.$store.commit(
|
||||||
|
"conversation/SET_CONVERSATION_LIST",
|
||||||
|
conversationSort(result)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
const conversationChangedHandler = ({data}) => {
|
||||||
|
//console.log('conversationChangedHandler',data);
|
||||||
|
if (this.storeIsSyncing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let filterArr = [];
|
||||||
|
//console.log(data);
|
||||||
|
const chids = data.map((ch) => ch.conversationID);
|
||||||
|
filterArr = this.storeConversationList.filter((tc) => !chids.includes(tc.conversationID));
|
||||||
|
const idx = data.findIndex((c) =>c.conversationID === this.storeCurrentConversation.conversationID);
|
||||||
|
if (idx !== -1){
|
||||||
|
this.$store.commit("conversation/SET_CURRENT_CONVERSATION",data[idx]);
|
||||||
|
}
|
||||||
|
const result = [...data, ...filterArr];
|
||||||
|
this.$store.commit("conversation/SET_CONVERSATION_LIST",conversationSort(result));
|
||||||
|
};
|
||||||
|
//会话总未读发生变化时的回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnTotalUnreadMessageCountChanged,totalUnreadCountChangedHandler);
|
||||||
|
//有新会话产生时,会收到此回调。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnNewConversation, newConversationHandler);
|
||||||
|
//某些会话的关键信息发生变化时,会触发该回调,例如会话的未读数发生变化,会话的最后一条消息发生变化等。
|
||||||
|
IMSDK.subscribe(IMSDK.IMEvents.OnConversationChanged,conversationChangedHandler);
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
async tryLogin() {
|
||||||
|
const _this = this;
|
||||||
|
const IMToken = uni.getStorageSync("IMToken");
|
||||||
|
const IMUserID = uni.getStorageSync("IMUserID")+'';
|
||||||
|
//console.log('IMToken:',IMToken);
|
||||||
|
//console.log('IMUserID:',IMUserID);
|
||||||
|
const path = await getDbDir();
|
||||||
|
//console.log('path:',path);
|
||||||
|
const IMConfig = {
|
||||||
|
systemType: "uni-app",
|
||||||
|
apiAddr: config.getApiUrl(), // SDK的API接口地址。如:http://xxx:10002
|
||||||
|
wsAddr: config.getWsUrl(), // SDK的websocket地址。如: ws://xxx:10001
|
||||||
|
dataDir: path, // 数据存储路径
|
||||||
|
logLevel: 6,
|
||||||
|
logFilePath: path,
|
||||||
|
isLogStandardOutput: true,
|
||||||
|
isExternalExtensions: false,
|
||||||
|
};
|
||||||
|
//console.log('IMConfig:',IMConfig);
|
||||||
|
const flag = await IMSDK.asyncApi(IMMethods.InitSDK, IMSDK.uuid(), IMConfig);
|
||||||
|
//console.log('flag:',flag);
|
||||||
|
if (!flag) {
|
||||||
|
plus.navigator.closeSplashscreen();
|
||||||
|
console.log('初始化IMSDK失败!');
|
||||||
|
uni.$u.toast("初始化IMSDK失败!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_this.setGlobalIMlistener();
|
||||||
|
// setTimeout(()=>{
|
||||||
|
|
||||||
|
// },1000);
|
||||||
|
let status;
|
||||||
|
do{
|
||||||
|
status = await IMSDK.asyncApi(IMSDK.IMMethods.GetLoginStatus,IMSDK.uuid());
|
||||||
|
//console.log(status);
|
||||||
|
}while(status == -1001);
|
||||||
|
if (status === 3) {
|
||||||
|
console.log('初始化status === 3失败!');
|
||||||
|
_this.initStore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (status === 1) {
|
||||||
|
IMSDK.asyncApi(IMSDK.IMMethods.Login, IMSDK.uuid(), {
|
||||||
|
userID: IMUserID,
|
||||||
|
token: IMToken,
|
||||||
|
})
|
||||||
|
.then(_this.initStore)
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
uni.removeStorage({
|
||||||
|
key: "IMToken",
|
||||||
|
});
|
||||||
|
uni.removeStorage({
|
||||||
|
key: "BusinessToken",
|
||||||
|
});
|
||||||
|
plus.navigator.closeSplashscreen();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
handleOfflineNewMessages(newServerMsg) {
|
||||||
|
console.log(newServerMsg);
|
||||||
|
console.log( getConversationContent(newServerMsg));
|
||||||
|
uni.createPushMessage({
|
||||||
|
title:"您的朋友发来新的消息",
|
||||||
|
content:getConversationContent(newServerMsg),
|
||||||
|
payload:{
|
||||||
|
type:"msg",
|
||||||
|
data:newServerMsg
|
||||||
|
},
|
||||||
|
//icon:'',
|
||||||
|
//sound:'',
|
||||||
|
//cover:'false',
|
||||||
|
//delay:0,
|
||||||
|
//when:0,//消息上显示的提示时间
|
||||||
|
//channelId:"",
|
||||||
|
//category:"",
|
||||||
|
success(res){
|
||||||
|
//console.log(res);
|
||||||
|
},
|
||||||
|
fail(res){
|
||||||
|
//console.log(res);
|
||||||
|
},
|
||||||
|
complete(res){
|
||||||
|
//console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
handleNewMessage(newServerMsg) {
|
||||||
|
if (this.inCurrentConversation(newServerMsg)) {
|
||||||
|
if (
|
||||||
|
newServerMsg.contentType !== MessageType.TypingMessage &&
|
||||||
|
newServerMsg.contentType !== MessageType.RevokeMessage
|
||||||
|
) {
|
||||||
|
newServerMsg.isAppend = true;
|
||||||
|
this.pushNewMessage(newServerMsg);
|
||||||
|
setTimeout(() => uni.$emit(PageEvents.ScrollToBottom, true));
|
||||||
|
uni.$u.debounce(this.markConversationAsRead, 2000);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
this.handleOfflineNewMessages(newServerMsg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
inCurrentConversation(newServerMsg) {
|
||||||
|
switch (newServerMsg.sessionType) {
|
||||||
|
case SessionType.Single:
|
||||||
|
return (
|
||||||
|
newServerMsg.sendID === this.storeCurrentConversation.userID ||
|
||||||
|
(newServerMsg.sendID === this.storeCurrentUserID &&
|
||||||
|
newServerMsg.recvID === this.storeCurrentConversation.userID)
|
||||||
|
);
|
||||||
|
case SessionType.WorkingGroup:
|
||||||
|
return newServerMsg.groupID === this.storeCurrentConversation.groupID;
|
||||||
|
case SessionType.Notification:
|
||||||
|
return newServerMsg.sendID === this.storeCurrentConversation.userID;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
markConversationAsRead() {
|
||||||
|
IMSDK.asyncApi(
|
||||||
|
IMSDK.IMMethods.MarkConversationMessageAsRead,
|
||||||
|
IMSDK.uuid(),
|
||||||
|
this.storeCurrentConversation.conversationID
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
|
initStore() {
|
||||||
|
const _this = this;
|
||||||
|
this.$store.dispatch("user/getSelfInfo");
|
||||||
|
this.$store.dispatch("conversation/getConversationList");
|
||||||
|
this.$store.dispatch("conversation/getUnReadCount");
|
||||||
|
this.$store.dispatch("contact/getBlacklist");
|
||||||
|
this.$store.dispatch("contact/getRecvFriendApplications");
|
||||||
|
this.$store.dispatch("contact/getSentFriendApplications");
|
||||||
|
this.$store.dispatch("contact/getRecvGroupApplications");
|
||||||
|
this.$store.dispatch("contact/getSentGroupApplications");
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 验证是否升级
|
||||||
|
checkUpdate() {
|
||||||
|
const _this = this;
|
||||||
|
checkUpgrade();
|
||||||
|
},
|
||||||
|
|
||||||
|
keppAlive(){
|
||||||
|
// #ifdef APP-NVUE
|
||||||
|
uni.requestPermissions(['android.permission.RECEIVE_BOOT_COMPLETED'], (result) => {
|
||||||
|
if (result.granted) {
|
||||||
|
console.log('权限已获得');
|
||||||
|
} else {
|
||||||
|
console.log('权限被拒绝');
|
||||||
|
uni.showModal({
|
||||||
|
title: '权限申请',
|
||||||
|
content: '您需要授权后台运行权限才能正常使用该功能',
|
||||||
|
showCancel: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
|
|
||||||
|
handleArguments(){
|
||||||
|
var args= plus.runtime.arguments;
|
||||||
|
if(args){
|
||||||
|
if(args.startsWith('shunliao://')){
|
||||||
|
console.log(args);
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
if(args.startsWith('{')){
|
||||||
|
const json = JSON.parse(args);
|
||||||
|
if(json.type == 'msg'){
|
||||||
|
if(this.inCurrentConversation(json.data)){
|
||||||
|
}else{
|
||||||
|
let conversation = this.storeConversationList.find((item) => item === json.data);
|
||||||
|
if(conversation){
|
||||||
|
prepareConversationState(conversation);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
// 处理args参数,如直达到某新页面等
|
||||||
|
console.log(args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,8 +4,41 @@ import config from "@/common/config";
|
|||||||
export const businessConfig = (params) =>
|
export const businessConfig = (params) =>
|
||||||
uni.$u?.http.post("/common/init", JSON.stringify(params));
|
uni.$u?.http.post("/common/init", JSON.stringify(params));
|
||||||
// 验证是否升级
|
// 验证是否升级
|
||||||
export const checkUpgrade = (params) =>
|
export const checkUpgrade = (params) =>{
|
||||||
uni.$u?.http.post("/common/checkUpgrade", JSON.stringify(params));
|
const _this = this;
|
||||||
|
return new Promise((resolve,reject)=>{
|
||||||
|
let system = uni.getSystemInfoSync()
|
||||||
|
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||||
|
uni.$u?.http.post("/common/checkUpgrade", JSON.stringify({
|
||||||
|
version:system.appVersion,
|
||||||
|
platform:system.platform,
|
||||||
|
version_wgt:inf.versionCode,
|
||||||
|
})).then(res=>{
|
||||||
|
console.log(res);
|
||||||
|
if(!res || !res.version){
|
||||||
|
return reject(true);
|
||||||
|
}
|
||||||
|
let skip_version = uni.getStorageSync('skip_version')
|
||||||
|
//console.log(res.version,skip_version);
|
||||||
|
if(res && res.version!=skip_version){
|
||||||
|
uni.$emit('closeWebview')
|
||||||
|
uni.setStorageSync('upgrade_model',res)
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/pages/common/upgrade',
|
||||||
|
animationType:"fade-in",
|
||||||
|
complete(res1) {
|
||||||
|
//console.log(res1);
|
||||||
|
return resolve();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
reject();
|
||||||
|
}).catch(e=>{
|
||||||
|
reject(e);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
export const businessLogin = (params) =>
|
export const businessLogin = (params) =>
|
||||||
uni.$u?.http.post("/common/login", JSON.stringify(params));
|
uni.$u?.http.post("/common/login", JSON.stringify(params));
|
||||||
export const businessSendSms = (params) =>
|
export const businessSendSms = (params) =>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
// const API_URL = `http://${BASE_HOST}:10002`
|
// const API_URL = `http://${BASE_HOST}:10002`
|
||||||
// const WS_URL = `ws://${BASE_HOST}:10001`
|
// const WS_URL = `ws://${BASE_HOST}:10001`
|
||||||
|
|
||||||
const BASE_DOMAIN = 'www.axzc.xyz'
|
const BASE_DOMAIN = 'www.shun777.com'
|
||||||
// const CHAT_URL = `https://${BASE_DOMAIN}/chat`
|
// const CHAT_URL = `https://${BASE_DOMAIN}/chat`
|
||||||
// const API_URL = `https://${BASE_DOMAIN}/api`
|
// const API_URL = `https://${BASE_DOMAIN}/api`
|
||||||
// const WS_URL = `wss://${BASE_DOMAIN}/msg_gateway`
|
// const WS_URL = `wss://${BASE_DOMAIN}/msg_gateway`
|
||||||
|
|||||||
@@ -44,11 +44,23 @@
|
|||||||
return this.isGroup ? defaultGroupIcon : defaultUserIcon;
|
return this.isGroup ? defaultGroupIcon : defaultUserIcon;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch:{
|
||||||
|
src(nv,ov){
|
||||||
|
this.init(nv);
|
||||||
|
},
|
||||||
|
desc() {
|
||||||
|
//this.redirectShow();
|
||||||
|
}
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
//_this.cachesrc = plus.io.convertAbsoluteFileSystem();
|
this.init(this.src);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
init(nv){
|
||||||
const _this = this;
|
const _this = this;
|
||||||
if (this.src) {
|
//console.log(nv);
|
||||||
util.cacheFile(util.cdn(this.src),'avatar').then(res=>{
|
if (nv) {
|
||||||
|
util.cacheFile(util.cdn(nv),'avatar').then(res=>{
|
||||||
_this.avatarText=""
|
_this.avatarText=""
|
||||||
_this.cachesrc = res;
|
_this.cachesrc = res;
|
||||||
//_this.cachesrc = plus.io.convertAbsoluteFileSystem(res);
|
//_this.cachesrc = plus.io.convertAbsoluteFileSystem(res);
|
||||||
@@ -65,33 +77,17 @@
|
|||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
||||||
return "";
|
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
errorHandle() {
|
errorHandle() {
|
||||||
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
this.avatarText = this.desc ? this.desc.slice(0, 1) : "未知";
|
||||||
},
|
},
|
||||||
redirectShow() {
|
|
||||||
if (this.avatarText) {
|
|
||||||
this.avatarText = undefined;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
click() {
|
click() {
|
||||||
this.$emit("click");
|
this.$emit("click");
|
||||||
},
|
},
|
||||||
longpress() {
|
longpress() {
|
||||||
this.$emit("longpress");
|
this.$emit("longpress");
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
|
|
||||||
watch: {
|
|
||||||
src(nv,ov) {
|
|
||||||
this.redirectShow();
|
|
||||||
},
|
|
||||||
desc() {
|
|
||||||
this.redirectShow();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "瞬聊",
|
"name" : "瞬聊",
|
||||||
"appid" : "__UNI__E41111F",
|
"appid" : "__UNI__E41111F",
|
||||||
"description" : "一款即时聊天软件",
|
"description" : "一款即时聊天软件",
|
||||||
"versionName" : "3.3.5",
|
"versionName" : "3.3.6",
|
||||||
"versionCode" : 335,
|
"versionCode" : 336,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
"bounce" : "none",
|
"bounce" : "none",
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
],
|
],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
|
||||||
"minSdkVersion" : 21,
|
"minSdkVersion" : 21,
|
||||||
"targetSdkVersion" : 26,
|
"targetSdkVersion" : 36,
|
||||||
"schemes" : "shunliao"
|
"schemes" : "shunliao"
|
||||||
},
|
},
|
||||||
"ios" : {
|
"ios" : {
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
"push" : {
|
"push" : {
|
||||||
"unipush" : {
|
"unipush" : {
|
||||||
"version" : "2",
|
"version" : "2",
|
||||||
"offline" : true,
|
"offline" : false,
|
||||||
"icons" : {
|
"icons" : {
|
||||||
"small" : {
|
"small" : {
|
||||||
"ldpi" : "static/images/about_logo.png",
|
"ldpi" : "static/images/about_logo.png",
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"splashscreen" : {
|
"splashscreen" : {
|
||||||
"androidStyle" : "default",
|
"androidStyle" : "common",
|
||||||
"iosStyle" : "common",
|
"iosStyle" : "common",
|
||||||
"android" : {
|
"android" : {
|
||||||
"hdpi" : "unpackage/res/cover/480_762.9.png",
|
"hdpi" : "unpackage/res/cover/480_762.9.png",
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
{
|
{
|
||||||
"pages": [
|
"pages": [
|
||||||
|
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
||||||
{
|
{
|
||||||
"path": "pages/index/guide",
|
"path": "pages/common/login/index"
|
||||||
"style": {
|
|
||||||
"navigationBarTitleText": ""
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/index/launch",
|
"path": "pages/index/launch",
|
||||||
@@ -12,9 +10,11 @@
|
|||||||
"navigationBarTitleText": ""
|
"navigationBarTitleText": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
|
|
||||||
{
|
{
|
||||||
"path": "pages/common/login/index"
|
"path": "pages/index/guide",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/common/registerOrForget/index"
|
"path": "pages/common/registerOrForget/index"
|
||||||
@@ -277,7 +277,11 @@
|
|||||||
{
|
{
|
||||||
"path": "pages/common/upgrade",
|
"path": "pages/common/upgrade",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": ""
|
"navigationStyle": "custom",
|
||||||
|
"backgroundColor": "transparent",
|
||||||
|
"navigationBarTextStyle": "white",
|
||||||
|
"navigationBarTitleText": "系统更新",
|
||||||
|
"enablePullDownRefresh": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -235,6 +235,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
confirm() {
|
confirm() {
|
||||||
|
const _this = this;
|
||||||
//console.log(this.checkedUserIDList,this.checkedGroupIDList);
|
//console.log(this.checkedUserIDList,this.checkedGroupIDList);
|
||||||
//return false;
|
//return false;
|
||||||
// if (this.activeTab) {
|
// if (this.activeTab) {
|
||||||
@@ -262,16 +263,20 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this.type === ContactChooseTypes.Invite) {
|
if (this.type === ContactChooseTypes.Invite) {
|
||||||
|
console.log(_this.getCheckedUserInfo,_this.groupID);
|
||||||
IMSDK.asyncApi(IMSDK.IMMethods.InviteUserToGroup, IMSDK.uuid(), {
|
IMSDK.asyncApi(IMSDK.IMMethods.InviteUserToGroup, IMSDK.uuid(), {
|
||||||
groupID: this.groupID,
|
groupID: _this.groupID,
|
||||||
reason: "",
|
reason: "",
|
||||||
userIDList: this.getCheckedUserInfo.map((user) => user.userID),
|
userIDList: _this.getCheckedUserInfo.map((user) => user.userID),
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
toastWithCallback("操作成功", () => uni.navigateBack());
|
toastWithCallback("操作成功", () => uni.navigateBack());
|
||||||
this.comfirmLoading = false;
|
_this.comfirmLoading = false;
|
||||||
})
|
})
|
||||||
.catch(() => toastWithCallback("操作失败"));
|
.catch((e) => {
|
||||||
|
console.log(e);
|
||||||
|
toastWithCallback("操作失败")
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,6 @@
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
console.log(friend.nickname);
|
|
||||||
return friend.nickname.indexOf(this.keyword) !==-1 || friend?.remark.indexOf(this.keyword) !==-1
|
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -158,7 +158,6 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
async startLogin() {
|
async startLogin() {
|
||||||
this.$refs.loginForm.validate().then(async (valid) => {
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.saveLoginInfo();
|
this.saveLoginInfo();
|
||||||
let data = {};
|
let data = {};
|
||||||
@@ -188,7 +187,6 @@ export default {
|
|||||||
uni.$u.toast(checkLoginError(err));
|
uni.$u.toast(checkLoginError(err));
|
||||||
}
|
}
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
|
||||||
},
|
},
|
||||||
saveLoginProfile(data) {
|
saveLoginProfile(data) {
|
||||||
const { imToken, token, userID } = data;
|
const { imToken, token, userID } = data;
|
||||||
@@ -275,6 +273,7 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
|
border-radius: 32rpx;
|
||||||
width: 160rpx;
|
width: 160rpx;
|
||||||
height: 160rpx;
|
height: 160rpx;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,32 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="m-shade n-flex-1 n-align-center n-justify-center">
|
<view class="upgrade_page">
|
||||||
<view :style="{width:'580rpx'}">
|
<uni-nav-bar left-icon="back"
|
||||||
<image src="/static/image/upgrade.png" mode="widthFix"></image>
|
@clickLeft="back"
|
||||||
<view class="n-ps-all-ll n-ms-top-ll n-position-absolute">
|
title="系统更新"
|
||||||
<text class="n-size-mm n-weight-7 n-color-inverse">发现新版本</text>
|
backgroundColor="#FFF"
|
||||||
<text class="n-size-base n-ms-top-ss n-color-inverse">V{{model.version}}</text>
|
fixed
|
||||||
|
statusBar>
|
||||||
|
</uni-nav-bar>
|
||||||
|
|
||||||
|
<view style="flex:1;display: flex;align-items: center;justify-content: center;">
|
||||||
|
<view :style="{width:'580rpx',position:'relative'}">
|
||||||
|
<image src="/static/images/upgrade.png" :style="{width:'580rpx'}" mode="widthFix"></image>
|
||||||
|
<view class="version_info">
|
||||||
|
<text class="title">发现新版本</text>
|
||||||
|
<text class="code">V{{model.version}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="n-ps-all-l n-radius-lb-base" :style="{backgroundColor:'#f3f3f3',borderRadius:'0 0 16rpx 16rpx'}">
|
<view class="detail">
|
||||||
<view :style="{height:'300rpx'}">
|
<scroll-view :show-scrollbar="false" scroll-y>
|
||||||
<scroll-view class="n-flex-1" :show-scrollbar="false" scroll-y>
|
<rich-text :nodes="model.content"></rich-text>
|
||||||
<rich-text class="n-size-s" :nodes="model.content" :style="{lineHeight:'26rpx'}"></rich-text>
|
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
<view class="footer">
|
||||||
<view class="n-height-base n-justify-center">
|
|
||||||
<view v-if="progress">
|
<view v-if="progress">
|
||||||
<uv-line-progress :percentage="value" activeColor="#fc3463"></uv-line-progress>
|
<u-line-progress :percentage="value" activeColor="#fc3463"></u-line-progress>
|
||||||
|
</view>
|
||||||
|
<view class="buttons" v-else>
|
||||||
|
<u-button v-if="model.force==0" @click="cancel" :customStyle="{backgroundColor:'#f3f3f3'}" text="暂不更新" color="#fc3463" shape="circle" throttleTime="1000" plain></u-button>
|
||||||
|
<u-button @click="upgrade" text="立即更新" color="#fc3463" shape="circle" throttleTime="1000"></u-button>
|
||||||
</view>
|
</view>
|
||||||
<view class="n-flex-row" v-else>
|
|
||||||
<uv-button class="n-flex-1 n-ms-right-ll" v-if="model.force==0" @click="cancel" :customStyle="{backgroundColor:'#f3f3f3'}" text="暂不更新" color="#fc3463" shape="circle" throttleTime="1000" plain></uv-button>
|
|
||||||
<uv-button class="n-flex-1" @click="upgrade" text="立即更新" color="#fc3463" shape="circle" throttleTime="1000"></uv-button>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -27,7 +35,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import util from "@/util/index.js"
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -42,9 +50,23 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(evt) {
|
onLoad(evt) {
|
||||||
if(evt.model){
|
// if(evt.model){
|
||||||
this.model = {...this.model, ...JSON.parse(evt.model)}
|
// this.model = {...this.model, ...JSON.parse(evt.model)}
|
||||||
|
// }
|
||||||
|
var model = uni.getStorageSync('upgrade_model');
|
||||||
|
console.log(model);
|
||||||
|
if(model){
|
||||||
|
this.model = {...this.model, ...model};
|
||||||
}
|
}
|
||||||
|
// this.model = {
|
||||||
|
// "id": 1,
|
||||||
|
// "type": 1,
|
||||||
|
// "force": 1,
|
||||||
|
// "source": "https://shunliao.oss-accelerate.aliyuncs.com/files/150016c51d8672fde3d1cc6945a95089_695d97b6c0162.wgt",
|
||||||
|
// "version": "3.3.6",
|
||||||
|
// "content": "修复了一些bug",
|
||||||
|
// "source_text": null
|
||||||
|
// };
|
||||||
},
|
},
|
||||||
onBackPress() {
|
onBackPress() {
|
||||||
if(this.model.force==1){
|
if(this.model.force==1){
|
||||||
@@ -52,6 +74,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
back(){
|
||||||
|
if(this.model.force!=1){
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
|
},
|
||||||
// 取消更新
|
// 取消更新
|
||||||
cancel() {
|
cancel() {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
@@ -80,17 +107,14 @@
|
|||||||
// 防止强制更新无法关闭界面
|
// 防止强制更新无法关闭界面
|
||||||
this.model.force = 0
|
this.model.force = 0
|
||||||
if(this.model.type==1){
|
if(this.model.type==1){
|
||||||
uni.showToast({
|
util.showToast('更新成功,软件重启')
|
||||||
title:'更新成功,软件重启'
|
|
||||||
})
|
|
||||||
setTimeout(()=>{ plus.runtime.restart() }, 1500)
|
setTimeout(()=>{ plus.runtime.restart() }, 1500)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
fail: error=>{
|
fail: error=>{
|
||||||
uni.showToast({
|
util.showToast('下载失败,请检查您的网络情况')
|
||||||
title:'下载失败,请检查您的网络情况'
|
this.model.force = 0;
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 监听下载进度
|
// 监听下载进度
|
||||||
@@ -103,8 +127,54 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style lang="scss" scoped>
|
||||||
.m-shade{
|
.upgrade_page{
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
background-color: rgba(0, 0, 0, 0.1);
|
background-color: rgba(0, 0, 0, 0.1);
|
||||||
|
height: 100vh;
|
||||||
|
width: 100vw;
|
||||||
|
.version_info{
|
||||||
|
position: absolute;
|
||||||
|
top:120rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin-left: 20rpx;
|
||||||
|
width: 100%;
|
||||||
|
.title{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.code{
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.detail{
|
||||||
|
margin-top: -10rpx;
|
||||||
|
background-color:#f3f3f3;
|
||||||
|
border-radius:0 0 16rpx 16rpx;
|
||||||
|
padding: 10rpx 20rpx 30rpx;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
scroll-view{
|
||||||
|
flex: 1;
|
||||||
|
min-height: 300rpx;
|
||||||
|
rich-text{
|
||||||
|
font-size:32rpx;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.footer{
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 20rpx;
|
||||||
|
.buttons{
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-around;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,34 +1,16 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="group_list_container">
|
<view class="group_list_container">
|
||||||
<custom-nav-bar title="我的群组">
|
<custom-nav-bar title="我的群组"></custom-nav-bar>
|
||||||
|
|
||||||
</custom-nav-bar>
|
|
||||||
<view class="search_bar_wrap">
|
<view class="search_bar_wrap">
|
||||||
<u-search
|
<u-search class="search_bar" shape="square" placeholder="搜索" disabled :showAction="false" />
|
||||||
class="search_bar"
|
|
||||||
shape="square"
|
|
||||||
placeholder="搜索"
|
|
||||||
disabled
|
|
||||||
:showAction="false"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<u-tabs :scrollable="false" :list="tabList" @click="clickTab"></u-tabs>
|
<u-tabs :scrollable="false" :list="tabList" @click="clickTab"></u-tabs>
|
||||||
|
|
||||||
<view
|
<view class="pane_row" :style="{ transform: `translateX(${isMyCreate ? '0' : '-100%'})` }">
|
||||||
class="pane_row"
|
|
||||||
:style="{ transform: `translateX(${isMyCreate ? '0' : '-100%'})` }"
|
|
||||||
>
|
|
||||||
<view class="pane_content">
|
<view class="pane_content">
|
||||||
<u-list
|
<u-list v-if="getMyCreateGroupList.length > 0" class="group_list" :height="`${getListHeight}px`">
|
||||||
v-if="getMyCreateGroupList.length > 0"
|
<u-list-item v-for="group in getMyCreateGroupList" :key="group.groupID">
|
||||||
class="group_list"
|
|
||||||
:height="`${getListHeight}px`"
|
|
||||||
>
|
|
||||||
<u-list-item
|
|
||||||
v-for="group in getMyCreateGroupList"
|
|
||||||
:key="group.groupID"
|
|
||||||
>
|
|
||||||
<group-item :groupInfo="group" />
|
<group-item :groupInfo="group" />
|
||||||
</u-list-item>
|
</u-list-item>
|
||||||
</u-list>
|
</u-list>
|
||||||
@@ -36,15 +18,8 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="pane_content">
|
<view class="pane_content">
|
||||||
<u-list
|
<u-list v-if="getMyJoinedGroupList.length > 0" class="group_list" :height="`${getListHeight}px`">
|
||||||
v-if="getMyJoinedGroupList.length > 0"
|
<u-list-item v-for="group in getMyJoinedGroupList" :key="group.groupID">
|
||||||
class="group_list"
|
|
||||||
:height="`${getListHeight}px`"
|
|
||||||
>
|
|
||||||
<u-list-item
|
|
||||||
v-for="group in getMyJoinedGroupList"
|
|
||||||
:key="group.groupID"
|
|
||||||
>
|
|
||||||
<group-item :groupInfo="group" />
|
<group-item :groupInfo="group" />
|
||||||
</u-list-item>
|
</u-list-item>
|
||||||
</u-list>
|
</u-list>
|
||||||
@@ -55,7 +30,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from "vuex";
|
import {
|
||||||
|
mapGetters
|
||||||
|
} from "vuex";
|
||||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||||
import GroupItem from "./GroupItem.vue";
|
import GroupItem from "./GroupItem.vue";
|
||||||
export default {
|
export default {
|
||||||
@@ -66,8 +43,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
keyword: "",
|
keyword: "",
|
||||||
tabList: [
|
tabList: [{
|
||||||
{
|
|
||||||
name: "我创建的",
|
name: "我创建的",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -98,7 +74,7 @@ export default {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
getMyJoinedGroupList() {
|
getMyJoinedGroupList() {
|
||||||
// console.log(this.storeGroupList.filter(group => group.ownerUserID !== this.storeCurrentUserID));
|
//console.log(this.storeGroupList);
|
||||||
return this.storeGroupList.filter(
|
return this.storeGroupList.filter(
|
||||||
(group) => group.ownerUserID !== this.storeCurrentUserID,
|
(group) => group.ownerUserID !== this.storeCurrentUserID,
|
||||||
);
|
);
|
||||||
@@ -106,7 +82,9 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {},
|
||||||
methods: {
|
methods: {
|
||||||
clickTab({ index }) {
|
clickTab({
|
||||||
|
index
|
||||||
|
}) {
|
||||||
this.isMyCreate = index === 0;
|
this.isMyCreate = index === 0;
|
||||||
},
|
},
|
||||||
toCreateGroup() {
|
toCreateGroup() {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
conversationID:String,
|
conversationID:String,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
console.log(this.message);
|
//console.log(this.message);
|
||||||
return {
|
return {
|
||||||
loadingWidth: "120px",
|
loadingWidth: "120px",
|
||||||
src:"",
|
src:"",
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
util.cacheFile(snapshotUrl,`${this.conversationID}`).then((fn)=>{
|
util.cacheFile(snapshotUrl,`${this.conversationID}`).then((fn)=>{
|
||||||
self.coverDownloading = false;
|
self.coverDownloading = false;
|
||||||
self.src = fn;
|
self.src = fn;
|
||||||
console.log(fn);
|
//console.log(fn);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
clickMediaItem() {
|
clickMediaItem() {
|
||||||
|
|||||||
@@ -117,10 +117,10 @@
|
|||||||
methods: {
|
methods: {
|
||||||
async init(){
|
async init(){
|
||||||
const self = this;
|
const self = this;
|
||||||
console.log(this.message?.videoElem);
|
//console.log(this.message?.videoElem);
|
||||||
const snapshotUrl = this.message?.videoElem?.snapshotPath || this.message?.videoElem?.snapshotUrl;
|
const snapshotUrl = this.message?.videoElem?.snapshotUrl;
|
||||||
self.coverDownloading = true;
|
self.coverDownloading = true;
|
||||||
console.log(snapshotUrl);
|
//console.log(snapshotUrl);
|
||||||
util.cacheFile(snapshotUrl,`${this.conversationID}`).then((fn)=>{
|
util.cacheFile(snapshotUrl,`${this.conversationID}`).then((fn)=>{
|
||||||
self.coverDownloading = false;
|
self.coverDownloading = false;
|
||||||
self.src = fn;
|
self.src = fn;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
<uni-icons size="24" color="#FFF" type="personadd"></uni-icons>
|
<uni-icons size="24" color="#FFF" type="personadd"></uni-icons>
|
||||||
<text>添加好友</text>
|
<text>添加好友</text>
|
||||||
</view>
|
</view>
|
||||||
<view @click="clickMenu({name:'createGroup'})" class="menu_item">
|
<view @click="clickMenu({name:'scan'})" class="menu_item">
|
||||||
<uni-icons size="24" color="#FFF" type="scan"></uni-icons>
|
<uni-icons size="24" color="#FFF" type="scan"></uni-icons>
|
||||||
<text>扫一扫</text>
|
<text>扫一扫</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -191,6 +191,45 @@
|
|||||||
padding: 0 24rpx 10rpx;
|
padding: 0 24rpx 10rpx;
|
||||||
//margin-top: var(--status-bar-height);
|
//margin-top: var(--status-bar-height);
|
||||||
background: #f4f4f4;
|
background: #f4f4f4;
|
||||||
|
.status_notice{
|
||||||
|
.err-tag {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 44rpx;
|
||||||
|
background: #ffe1dd;
|
||||||
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
|
||||||
|
.status {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #ff381f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 44rpx;
|
||||||
|
background: #f2f8ff;
|
||||||
|
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
|
||||||
|
.loading {
|
||||||
|
animation: loading 1.5s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status {
|
||||||
|
font-size: 24rpx;
|
||||||
|
margin-left: 8rpx;
|
||||||
|
font-weight: 400;
|
||||||
|
color: #0089ff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.self_info {
|
.self_info {
|
||||||
@include btwBox();
|
@include btwBox();
|
||||||
@@ -216,46 +255,6 @@
|
|||||||
max-width: 240rpx;
|
max-width: 240rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.err-tag {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 152rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
background: #ffe1dd;
|
|
||||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
|
||||||
margin-left: 8rpx;
|
|
||||||
|
|
||||||
.status {
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin-left: 8rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #ff381f;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
width: 152rpx;
|
|
||||||
height: 44rpx;
|
|
||||||
background: #f2f8ff;
|
|
||||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
|
||||||
margin-left: 8rpx;
|
|
||||||
|
|
||||||
.loading {
|
|
||||||
animation: loading 1.5s infinite;
|
|
||||||
}
|
|
||||||
|
|
||||||
.status {
|
|
||||||
font-size: 24rpx;
|
|
||||||
margin-left: 8rpx;
|
|
||||||
font-weight: 400;
|
|
||||||
color: #0089ff;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.online_state {
|
.online_state {
|
||||||
@include vCenterBox();
|
@include vCenterBox();
|
||||||
margin-left: 24rpx;
|
margin-left: 24rpx;
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<view @longtap.prevent="longtapConversationItem" @tap.prevent="clickConversationItem" :class="['conversation_item',source.isPinned?'pinned' : '']">
|
<view @longtap.prevent="longtapConversationItem" @tap.prevent="clickConversationItem" :class="['conversation_item',source.isPinned?'pinned' : '']">
|
||||||
<view class="left_info">
|
<view class="left_info">
|
||||||
|
<view class="avatar">
|
||||||
<my-avatar :isGroup="isGroup" :isNotify="isNotify" :src="source.faceURL" :desc="source.showName" size="46" />
|
<my-avatar :isGroup="isGroup" :isNotify="isNotify" :src="source.faceURL" :desc="source.showName" size="46" />
|
||||||
|
<u-badge max="99" :value="source.unreadCount"></u-badge>
|
||||||
|
</view>
|
||||||
<view class="details">
|
<view class="details">
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<text class="conversation_name">
|
<text class="conversation_name">
|
||||||
@@ -9,7 +12,6 @@
|
|||||||
</text>
|
</text>
|
||||||
<view class="right_desc">
|
<view class="right_desc">
|
||||||
<text class="send_time">{{ latestMessageTime }}</text>
|
<text class="send_time">{{ latestMessageTime }}</text>
|
||||||
<u-badge max="99" :value="source.unreadCount"></u-badge>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="lastest_msg_wrap">
|
<view class="lastest_msg_wrap">
|
||||||
@@ -101,7 +103,14 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 12rpx 44rpx 20rpx;
|
padding: 12rpx 44rpx 20rpx;
|
||||||
flex:1;
|
flex:1;
|
||||||
|
.avatar{
|
||||||
|
position: relative;
|
||||||
|
.u-badge{
|
||||||
|
position: absolute;
|
||||||
|
right: -6rpx;
|
||||||
|
top: -6rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
.details {
|
.details {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -161,5 +170,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,11 +1,22 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="conversation_container">
|
<view class="conversation_container">
|
||||||
<chat-header ref="chatHeaderRef" />
|
<chat-header ref="chatHeaderRef" />
|
||||||
<scroll-view class="scroll-view" scroll-y="true" refresher-enabled="true" :refresher-triggered="triggered"
|
<scroll-view class="scroll-view"
|
||||||
:scroll-top="scrollTop" :scroll-with-animation="true" @scroll="scroll" @refresherrefresh="onRefresh"
|
scroll-y="true"
|
||||||
@refresherrestore="onRestore" @scrolltolower="scrolltolower">
|
refresher-enabled="true"
|
||||||
|
:refresher-triggered="triggered"
|
||||||
|
:scroll-top="scrollTop"
|
||||||
|
:scroll-with-animation="true"
|
||||||
|
@scroll="scroll"
|
||||||
|
@refresherrefresh="onRefresh"
|
||||||
|
@refresherrestore="onRestore"
|
||||||
|
@scrolltolower="scrolltolower">
|
||||||
<uni-swipe-action ref="swipe_action">
|
<uni-swipe-action ref="swipe_action">
|
||||||
<uni-swipe-action-item :right-options="swipe_actions" @click="actionClick($event,item)" v-for="item in storeConversationList" :key="item.conversationID" >
|
<uni-swipe-action-item
|
||||||
|
:right-options="swipe_actions"
|
||||||
|
@click="actionClick($event,item)"
|
||||||
|
v-for="item in storeConversationList"
|
||||||
|
:key="item.conversationID" >
|
||||||
<conversation-item @longtapEvent="showExtendMenu(item)" :source="item"/>
|
<conversation-item @longtapEvent="showExtendMenu(item)" :source="item"/>
|
||||||
</uni-swipe-action-item>
|
</uni-swipe-action-item>
|
||||||
</uni-swipe-action>
|
</uni-swipe-action>
|
||||||
@@ -178,7 +189,9 @@
|
|||||||
this.queryList();
|
this.queryList();
|
||||||
},
|
},
|
||||||
async queryList(isFirstPage = false) {
|
async queryList(isFirstPage = false) {
|
||||||
|
//console.log(1);
|
||||||
await this.$store.dispatch("conversation/getConversationList",isFirstPage);
|
await this.$store.dispatch("conversation/getConversationList",isFirstPage);
|
||||||
|
//console.log(2);
|
||||||
this.triggered = false;
|
this.triggered = false;
|
||||||
this._freshing = false;
|
this._freshing = false;
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -194,7 +194,7 @@
|
|||||||
faceURL : this.storeCurrentConversation.faceURL,
|
faceURL : this.storeCurrentConversation.faceURL,
|
||||||
type : "group",
|
type : "group",
|
||||||
});
|
});
|
||||||
return `/pages/common/userOrGroupQrCode?sourceInfo=${s}`;
|
return `/pages/common/userOrGroupQrCode?sourceInfo=${info}`;
|
||||||
},
|
},
|
||||||
getGroupVerStr() {
|
getGroupVerStr() {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -24,13 +24,14 @@
|
|||||||
<uni-list-item v-if="1==2" title="看一看" thumb="/static/images/find/06.png" :thumbSize="thumbSize" to="/pages/find/friend-circle/friend-circle" showArrow></uni-list-item>
|
<uni-list-item v-if="1==2" title="看一看" thumb="/static/images/find/06.png" :thumbSize="thumbSize" to="/pages/find/friend-circle/friend-circle" showArrow></uni-list-item>
|
||||||
<uni-list-item v-if="1==2" title="听一听" thumb="/static/images/find/06.png" :thumbSize="thumbSize" to="/pages/find/friend-circle/friend-circle" showArrow></uni-list-item>
|
<uni-list-item v-if="1==2" title="听一听" thumb="/static/images/find/06.png" :thumbSize="thumbSize" to="/pages/find/friend-circle/friend-circle" showArrow></uni-list-item>
|
||||||
<uni-list-item v-if="config.near_user_open == '1'" title="附近" thumb="/static/images/find/08.png" :thumbSize="thumbSize" to="/pages/find/near/near" showArrow></uni-list-item>
|
<uni-list-item v-if="config.near_user_open == '1'" title="附近" thumb="/static/images/find/08.png" :thumbSize="thumbSize" to="/pages/find/near/near" showArrow></uni-list-item>
|
||||||
<uni-list-item title="购物" thumb="/static/images/find/09.png" :thumbSize="thumbSize" :to="'/pages/common/webview?url='+encodeURI('http://pinduoduo.com')" showArrow></uni-list-item>
|
<uni-list-item v-if="1===2" title="购物" thumb="/static/images/find/09.png" :thumbSize="thumbSize" :to="'/pages/common/webview?url='+encodeURI('http://pinduoduo.com')" showArrow></uni-list-item>
|
||||||
</uni-list>
|
</uni-list>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from "vuex";
|
import { mapGetters } from "vuex";
|
||||||
|
import util from "@/util";
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -51,36 +52,7 @@
|
|||||||
this.$store.dispatch('circle/getFriendCircleInfo');
|
this.$store.dispatch('circle/getFriendCircleInfo');
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
scan(){
|
scan:util.scan
|
||||||
uni.scanCode({
|
|
||||||
success(res) {
|
|
||||||
if(res.scanType == "QR_CODE"){
|
|
||||||
if(res.result.startsWith("http")){
|
|
||||||
uni.navigateTo({
|
|
||||||
url:"/pages/common/webview?url="+encodeURIComponent(res.result)
|
|
||||||
});
|
|
||||||
//res.result;
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
const user_prefix = `${this.config.website}/u/`;
|
|
||||||
if(res.result.startsWith(user_prefix)){
|
|
||||||
return uni.navigateTo({
|
|
||||||
url:"/pages/common/userCard/index?sourceID="+res.result.replace(user_prefix,'')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const group_prefix = `${this.config.website}/g/`;
|
|
||||||
if(res.result.startsWith(group_prefix)){
|
|
||||||
return uni.navigateTo({
|
|
||||||
url:"/pages/common/groupCard/index?sourceID="+res.result.replace(group_prefix,'')
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// uni.navigateTo({
|
|
||||||
// url:"/pages/common/scan"
|
|
||||||
// })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -36,6 +36,10 @@
|
|||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
//console.log('onReady');
|
//console.log('onReady');
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url:"/pages/common/upgrade"
|
||||||
|
// });
|
||||||
|
// return ;
|
||||||
// #ifdef APP
|
// #ifdef APP
|
||||||
this.checkUpdate();
|
this.checkUpdate();
|
||||||
this.tryLogin();
|
this.tryLogin();
|
||||||
@@ -148,7 +152,6 @@
|
|||||||
if (this.storeIsSyncing) {
|
if (this.storeIsSyncing) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(data);
|
|
||||||
data.forEach(this.handleNewMessage);
|
data.forEach(this.handleNewMessage);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -282,8 +285,8 @@
|
|||||||
//设置了批量消息监听setBatchMsgListener时,此回调不会触发。
|
//设置了批量消息监听setBatchMsgListener时,此回调不会触发。
|
||||||
//IMSDK.subscribe(IMSDK.IMEvents.onRecvOfflineNewMessage,({ data })=>{});
|
//IMSDK.subscribe(IMSDK.IMEvents.onRecvOfflineNewMessage,({ data })=>{});
|
||||||
//当应用在后台运行,接收到新消息时,会收到该回调,回调中可能会携带多条消息。
|
//当应用在后台运行,接收到新消息时,会收到该回调,回调中可能会携带多条消息。
|
||||||
IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessages,(res)=>{
|
IMSDK.subscribe(IMSDK.IMEvents.OnRecvOfflineNewMessages,({data})=>{
|
||||||
console.log(res);
|
data.forEach(this.handleOfflineNewMessages);
|
||||||
});
|
});
|
||||||
//已订阅用户的在线状态发生变化时,会触发此回调。
|
//已订阅用户的在线状态发生变化时,会触发此回调。
|
||||||
//IMSDK.subscribe(IMSDK.IMEvents.onUserStatusChanged,({ data })=>{});
|
//IMSDK.subscribe(IMSDK.IMEvents.onUserStatusChanged,({ data })=>{});
|
||||||
@@ -404,6 +407,35 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleOfflineNewMessages(newServerMsg) {
|
||||||
|
console.log(newServerMsg);
|
||||||
|
console.log( getConversationContent(newServerMsg));
|
||||||
|
uni.createPushMessage({
|
||||||
|
title:"您的朋友发来新的消息",
|
||||||
|
content:getConversationContent(newServerMsg),
|
||||||
|
payload:{
|
||||||
|
type:"msg",
|
||||||
|
data:newServerMsg
|
||||||
|
},
|
||||||
|
//icon:'',
|
||||||
|
//sound:'',
|
||||||
|
//cover:'false',
|
||||||
|
//delay:0,
|
||||||
|
//when:0,//消息上显示的提示时间
|
||||||
|
//channelId:"",
|
||||||
|
//category:"",
|
||||||
|
success(res){
|
||||||
|
//console.log(res);
|
||||||
|
},
|
||||||
|
fail(res){
|
||||||
|
//console.log(res);
|
||||||
|
},
|
||||||
|
complete(res){
|
||||||
|
//console.log(res);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
handleNewMessage(newServerMsg) {
|
handleNewMessage(newServerMsg) {
|
||||||
if (this.inCurrentConversation(newServerMsg)) {
|
if (this.inCurrentConversation(newServerMsg)) {
|
||||||
if (
|
if (
|
||||||
@@ -416,30 +448,7 @@
|
|||||||
uni.$u.debounce(this.markConversationAsRead, 2000);
|
uni.$u.debounce(this.markConversationAsRead, 2000);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
console.log(newServerMsg);
|
this.handleOfflineNewMessages(newServerMsg);
|
||||||
|
|
||||||
console.log( getConversationContent(newServerMsg));
|
|
||||||
uni.createPushMessage({
|
|
||||||
title:"您的朋友发来新的消息",
|
|
||||||
content:getConversationContent(newServerMsg),
|
|
||||||
payload:newServerMsg,
|
|
||||||
//icon:'',
|
|
||||||
//sound:'',
|
|
||||||
//cover:'false',
|
|
||||||
//delay:0,
|
|
||||||
//when:0,//消息上显示的提示时间
|
|
||||||
//channelId:"",
|
|
||||||
//category:"",
|
|
||||||
success(res){
|
|
||||||
console.log(res);
|
|
||||||
},
|
|
||||||
fail(res){
|
|
||||||
console.log(res);
|
|
||||||
},
|
|
||||||
complete(res){
|
|
||||||
console.log(res);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -497,10 +506,10 @@
|
|||||||
let system = uni.getSystemInfoSync()
|
let system = uni.getSystemInfoSync()
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||||
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
||||||
|
console.log(res.version,skip_version);
|
||||||
let skip_version = uni.getStorageSync('skip_version')
|
let skip_version = uni.getStorageSync('skip_version')
|
||||||
if(res && res.version!=skip_version){
|
if(res && res.version!=skip_version){
|
||||||
uni.$emit('closeWebview')
|
uni.$emit('closeWebview')
|
||||||
this.setShow(this.current, false)
|
|
||||||
router('/pages/common/upgrade?model=' + JSON.stringify(res), '', 'fade-in')
|
router('/pages/common/upgrade?model=' + JSON.stringify(res), '', 'fade-in')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -523,6 +532,7 @@
|
|||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -537,5 +547,6 @@
|
|||||||
|
|
||||||
.gif-image {
|
.gif-image {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
|
border-radius: 10%;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -2,19 +2,19 @@
|
|||||||
<view class="page_container">
|
<view class="page_container">
|
||||||
<custom-nav-bar title="关于我们" />
|
<custom-nav-bar title="关于我们" />
|
||||||
<view class="logo_area">
|
<view class="logo_area">
|
||||||
<image :src="cdn(config.app_logo)" mode=""></image>
|
<image class="logo" :src="cdn(config.app_logo)" mode="aspectFit"></image>
|
||||||
<view>{{ appversion }}</view>
|
<view>{{ appversion }}</view>
|
||||||
|
|
||||||
<info-item @click="checkUpdate" class="check" title="检测更新" />
|
<info-item @click="checkUpdate" class="check" title="检测更新" />
|
||||||
<info-item @click="openurl(config.website)" class="check" title="官方网站" />
|
<info-item @click="openurl(config.website)" class="check" title="官方网站" />
|
||||||
<info-item @click="goto('/pages/common/article?type=spage&name=cooperation&title=商务合作')" class="check" title="商务合作" />
|
<info-item v-if="1==2" @click="goto('/pages/common/article?type=spage&name=cooperation&title=商务合作')" class="check" title="商务合作" />
|
||||||
<info-item @click="goto('/pages/common/article?type=spage&name=terms_of_service&title=用户协议')" class="check" title="用户协议" />
|
<info-item @click="goto('/pages/common/article?type=spage&name=terms_of_service&title=用户协议')" class="check" title="用户协议" />
|
||||||
<info-item @click="goto('/pages/common/article?type=spage&name=privacy_policy&title=隐私政策')" class="check" title="隐私政策" />
|
<info-item @click="goto('/pages/common/article?type=spage&name=privacy_policy&title=隐私政策')" class="check" title="隐私政策" />
|
||||||
<info-item @click="goto('/pages/common/article?type=spage&name=aboutus&title=关于我们')" class="check" title="关于我们" />
|
<info-item @click="goto('/pages/common/article?type=spage&name=aboutus&title=关于我们')" class="check" title="关于我们" />
|
||||||
<info-item @click="clearcache" class="check" title="清除缓存" />
|
<info-item @click="clearcache" class="check" title="清除缓存" />
|
||||||
<info-item @click="show = true" class="check" title="上传调试日志" />
|
<info-item v-if="1==2" @click="show = true" class="check" title="上传调试日志" />
|
||||||
|
|
||||||
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
|
<u-modal v-if="1==2" showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
|
||||||
<view class="slot-content">
|
<view class="slot-content">
|
||||||
<u--input placeholder="日志数量" border="surround" v-model="line"></u--input>
|
<u--input placeholder="日志数量" border="surround" v-model="line"></u--input>
|
||||||
</view>
|
</view>
|
||||||
@@ -113,27 +113,16 @@ import util from "@/util/index.js"
|
|||||||
checkUpdate() {
|
checkUpdate() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
const _this = this;
|
const _this = this;
|
||||||
let system = uni.getSystemInfoSync();
|
checkUpgrade().then(res=>{
|
||||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
|
||||||
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
|
||||||
_this.loading = false;
|
_this.loading = false;
|
||||||
if(!res.data){
|
}).catch(e=>{
|
||||||
uni.showToast({
|
console.log(e);
|
||||||
title:"已经是最新版本"
|
if(e === true){
|
||||||
})
|
uni.showToast({title:'已经是最新版本'})
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
let skip_version = uni.getStorageSync('skip_version')
|
_this.loading = false;
|
||||||
if(res && res.version!=skip_version){
|
|
||||||
uni.$emit('closeWebview')
|
|
||||||
_this.setShow(_this.current, false)
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/common/upgrade?model=' + JSON.stringify(res),
|
|
||||||
animationType:"fade-in"
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -153,9 +142,10 @@ import util from "@/util/index.js"
|
|||||||
padding: 48rpx 0 16rpx 0;
|
padding: 48rpx 0 16rpx 0;
|
||||||
color: $uni-text-color;
|
color: $uni-text-color;
|
||||||
|
|
||||||
image {
|
.logo{
|
||||||
width: 72px;
|
border-radius: 32rpx;
|
||||||
height: 72px;
|
width: 160rpx;
|
||||||
|
height: 160rpx;
|
||||||
margin-bottom: 24rpx;
|
margin-bottom: 24rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<view class="id_row">
|
<view class="id_row">
|
||||||
<text class="nickname">{{ selfInfo.nickname }}</text>
|
<text class="nickname">{{ selfInfo.nickname }}</text>
|
||||||
<view class="id_row_copy" @click="copy">
|
<view class="id_row_copy" @click="copy">
|
||||||
<text class="id">{{ selfInfo.userID }}</text>
|
<text class="id">瞬聊号:{{ selfInfo.userID }}</text>
|
||||||
<image style="width: 32rpx; height: 32rpx" src="@/static/images/id_copy.png" mode="" />
|
<image style="width: 32rpx; height: 32rpx" src="@/static/images/id_copy.png" mode="" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -55,16 +55,15 @@
|
|||||||
return this.$store.getters.storeSelfInfo;
|
return this.$store.getters.storeSelfInfo;
|
||||||
},
|
},
|
||||||
getGender() {
|
getGender() {
|
||||||
if (this.selfInfo.sex === 0) {
|
if (this.selfInfo.sex == 0) {
|
||||||
return "保密";
|
return "保密";
|
||||||
}
|
}
|
||||||
if (this.selfInfo.sex === 1) {
|
if (this.selfInfo.sex == 1) {
|
||||||
return "男";
|
return "男";
|
||||||
}
|
}
|
||||||
return "女";
|
return "女";
|
||||||
},
|
},
|
||||||
getBirth() {
|
getBirth() {
|
||||||
console.log(this.selfInfo);
|
|
||||||
const birth = this.selfInfo.birthday ?? 0;
|
const birth = this.selfInfo.birthday ?? 0;
|
||||||
return dayjs(birth).format("YYYY-MM-DD");
|
return dayjs(birth).format("YYYY-MM-DD");
|
||||||
},
|
},
|
||||||
@@ -153,6 +152,7 @@
|
|||||||
},
|
},
|
||||||
confirmDate({value}) {
|
confirmDate({value}) {
|
||||||
this.loadingState.birth = true;
|
this.loadingState.birth = true;
|
||||||
|
console.log(this.$store.getters.storeSelfInfo.faceURL);
|
||||||
this.updateSelfInfo({birth: value,},"birth",);
|
this.updateSelfInfo({birth: value,},"birth",);
|
||||||
this.showDatePicker = false;
|
this.showDatePicker = false;
|
||||||
},
|
},
|
||||||
|
|||||||
|
After Width: | Height: | Size: 194 KiB |
|
After Width: | Height: | Size: 22 KiB |
@@ -53,9 +53,6 @@ const mutations = {
|
|||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
async getFriendList({commit }) {
|
async getFriendList({commit }) {
|
||||||
//#ifndef APP
|
|
||||||
return [];
|
|
||||||
//#endif
|
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
let friendInfoList = [];
|
let friendInfoList = [];
|
||||||
let initialFetch = true;
|
let initialFetch = true;
|
||||||
@@ -73,14 +70,12 @@ const actions = {
|
|||||||
initialFetch = false;
|
initialFetch = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("getFriendListPage error",error);
|
console.error("getFriendListPage error",error);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
commit("SET_FRIEND_LIST", friendInfoList);
|
commit("SET_FRIEND_LIST", friendInfoList);
|
||||||
},
|
},
|
||||||
async getGrouplist({commit}) {
|
async getGrouplist({commit}) {
|
||||||
//#ifndef APP
|
|
||||||
return [];
|
|
||||||
//#endif
|
|
||||||
let offset = 0;
|
let offset = 0;
|
||||||
let groupList = [];
|
let groupList = [];
|
||||||
while (true) {
|
while (true) {
|
||||||
@@ -101,6 +96,7 @@ const actions = {
|
|||||||
console.error("getGrouplist error");
|
console.error("getGrouplist error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//console.log(groupList);
|
||||||
commit("SET_GROUP_LIST", groupList);
|
commit("SET_GROUP_LIST", groupList);
|
||||||
},
|
},
|
||||||
getBlacklist({commit}) {
|
getBlacklist({commit}) {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="ly-map-wrapper">
|
<view class="ly-map-wrapper">
|
||||||
<view style="background: transparent;position: absolute;z-index:1998;top:10px;left: 10px;right:10px;display: flex;align-items: center;justify-content: space-between;">
|
<view style="background: transparent;position: absolute;z-index:1998;top:54px;left: 10px;right:10px;display: flex;align-items: center;justify-content: space-between;">
|
||||||
<uni-icons type="left" size="26" color="#333" @click="back"></uni-icons>
|
<uni-icons type="left" size="26" color="#333" @click="back"></uni-icons>
|
||||||
<u-button
|
<u-button
|
||||||
@click="confirm"
|
@click="confirm"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="type == 'chooselocation'"
|
v-if="type == 'chooselocation'"
|
||||||
style="font-size: 15px;width: 100rpx;margin: 0;">确定</u-button>
|
style="font-size: 15px;width: 150rpx;margin: 0;">确定</u-button>
|
||||||
</view>
|
</view>
|
||||||
<!-- <uni-nav-bar
|
<!-- <uni-nav-bar
|
||||||
left-icon="back"
|
left-icon="back"
|
||||||
|
|||||||
|
After Width: | Height: | Size: 220 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 220 KiB After Width: | Height: | Size: 197 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 98 KiB |
|
Before Width: | Height: | Size: 202 KiB After Width: | Height: | Size: 231 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 532 B After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 4.0 KiB |
@@ -253,7 +253,6 @@ export const bytesToSize = (bytes) => {
|
|||||||
|
|
||||||
return (bytes / Math.pow(k, i)).toPrecision(3) + " " + sizes[i];
|
return (bytes / Math.pow(k, i)).toPrecision(3) + " " + sizes[i];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tipMessaggeFormat = (msg, currentUserID) => {
|
export const tipMessaggeFormat = (msg, currentUserID) => {
|
||||||
|
|
||||||
const getName = (user) =>
|
const getName = (user) =>
|
||||||
@@ -269,43 +268,43 @@ export const tipMessaggeFormat = (msg, currentUserID) => {
|
|||||||
case MessageType.GroupInfoUpdated:
|
case MessageType.GroupInfoUpdated:
|
||||||
const groupUpdateDetail = JSON.parse(msg.notificationElem.detail);
|
const groupUpdateDetail = JSON.parse(msg.notificationElem.detail);
|
||||||
const groupUpdateUser = groupUpdateDetail.opUser;
|
const groupUpdateUser = groupUpdateDetail.opUser;
|
||||||
return `${parseInfo(groupUpdateUser)}修改了群信息`;
|
return `${getName(groupUpdateUser)}修改了群信息`;
|
||||||
case MessageType.GroupOwnerTransferred:
|
case MessageType.GroupOwnerTransferred:
|
||||||
const transferDetails = JSON.parse(msg.notificationElem.detail);
|
const transferDetails = JSON.parse(msg.notificationElem.detail);
|
||||||
const transferOpUser = transferDetails.opUser;
|
const transferOpUser = transferDetails.opUser;
|
||||||
const newOwner = transferDetails.newGroupOwner;
|
const newOwner = transferDetails.newGroupOwner;
|
||||||
return `${parseInfo(transferOpUser)}转让群主给${parseInfo(newOwner)}`;
|
return `${getName(transferOpUser)}转让群主给${getName(newOwner)}`;
|
||||||
case MessageType.MemberQuit:
|
case MessageType.MemberQuit:
|
||||||
const quitDetails = JSON.parse(msg.notificationElem.detail);
|
const quitDetails = JSON.parse(msg.notificationElem.detail);
|
||||||
const quitUser = quitDetails.quitUser;
|
const quitUser = quitDetails.quitUser;
|
||||||
return `${parseInfo(quitUser)}退出了群组`;
|
return `${getName(quitUser)}退出了群组`;
|
||||||
case MessageType.MemberInvited:
|
case MessageType.MemberInvited:
|
||||||
const inviteDetails = JSON.parse(msg.notificationElem.detail);
|
const inviteDetails = JSON.parse(msg.notificationElem.detail);
|
||||||
const inviteOpUser = inviteDetails.opUser;
|
const inviteOpUser = inviteDetails.opUser;
|
||||||
const invitedUserList = inviteDetails.invitedUserList ?? [];
|
const invitedUserList = inviteDetails.invitedUserList ?? [];
|
||||||
let inviteStr = "";
|
let inviteStr = "";
|
||||||
invitedUserList.find(
|
invitedUserList.find(
|
||||||
(user, idx) => (inviteStr += parseInfo(user) + "、") && idx > 3,
|
(user, idx) => (inviteStr += getName(user) + "、") && idx > 3,
|
||||||
);
|
);
|
||||||
inviteStr = inviteStr.slice(0, -1);
|
inviteStr = inviteStr.slice(0, -1);
|
||||||
return `${parseInfo(inviteOpUser)} 邀请了${inviteStr}${invitedUserList.length > 3 ? "..." : ""}加入群聊`; case MessageType.MemberKicked:
|
return `${getName(inviteOpUser)} 邀请了${inviteStr}${invitedUserList.length > 3 ? "..." : ""}加入群聊`; case MessageType.MemberKicked:
|
||||||
const kickDetails = JSON.parse(msg.notificationElem.detail);
|
const kickDetails = JSON.parse(msg.notificationElem.detail);
|
||||||
const kickOpUser = kickDetails.opUser;
|
const kickOpUser = kickDetails.opUser;
|
||||||
const kickdUserList = kickDetails.kickedUserList ?? [];
|
const kickdUserList = kickDetails.kickedUserList ?? [];
|
||||||
let kickStr = "";
|
let kickStr = "";
|
||||||
kickdUserList.find(
|
kickdUserList.find(
|
||||||
(user, idx) => (kickStr += parseInfo(user) + "、") && idx > 3,
|
(user, idx) => (kickStr += getName(user) + "、") && idx > 3,
|
||||||
);
|
);
|
||||||
kickStr = kickStr.slice(0, -1);
|
kickStr = kickStr.slice(0, -1);
|
||||||
return `${parseInfo(kickOpUser)} 踢出了${kickStr}${kickdUserList.length > 3 ? "..." : ""}`;
|
return `${getName(kickOpUser)} 踢出了${kickStr}${kickdUserList.length > 3 ? "..." : ""}`;
|
||||||
case MessageType.MemberEnter:
|
case MessageType.MemberEnter:
|
||||||
const enterDetails = JSON.parse(msg.notificationElem.detail);
|
const enterDetails = JSON.parse(msg.notificationElem.detail);
|
||||||
const enterUser = enterDetails.entrantUser;
|
const enterUser = enterDetails.entrantUser;
|
||||||
return `${parseInfo(enterUser)}加入了群聊`;
|
return `${getName(enterUser)}加入了群聊`;
|
||||||
case MessageType.GroupDismissed:
|
case MessageType.GroupDismissed:
|
||||||
const dismissDetails = JSON.parse(msg.notificationElem.detail);
|
const dismissDetails = JSON.parse(msg.notificationElem.detail);
|
||||||
const dismissUser = dismissDetails.opUser;
|
const dismissUser = dismissDetails.opUser;
|
||||||
return `${parseInfo(dismissUser)}解散了群聊`;
|
return `${getName(dismissUser)}解散了群聊`;
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
|
|
||||||
//import i18n from '@/locales'
|
//import i18n from '@/locales'
|
||||||
import base from '@/common/config';
|
import base from '@/common/config';
|
||||||
//import store from "@/store";
|
import store from "@/store";
|
||||||
import IMSDK from "openim-uniapp-polyfill";
|
import IMSDK from "openim-uniapp-polyfill";
|
||||||
|
|
||||||
import CryptoJS from 'crypto-js';
|
import CryptoJS from 'crypto-js';
|
||||||
import md5 from "md5";
|
import md5 from "md5";
|
||||||
|
// #ifdef APP
|
||||||
import {downloadFile} from "@/uni_modules/network-manage";
|
import {downloadFile} from "@/uni_modules/network-manage";
|
||||||
|
// #endif
|
||||||
const isString = (v)=> {
|
const isString = (v)=> {
|
||||||
return typeof v === 'string' || v instanceof String;
|
return typeof v === 'string' || v instanceof String;
|
||||||
},
|
},
|
||||||
@@ -144,20 +145,31 @@ const scan = ()=>{
|
|||||||
barCode 扫描条形码时返回条形码数据 支付宝小程序
|
barCode 扫描条形码时返回条形码数据 支付宝小程序
|
||||||
imageChannel 来源 支付宝小程序
|
imageChannel 来源 支付宝小程序
|
||||||
*/
|
*/
|
||||||
if(res.result){
|
if(res.scanType == "QR_CODE"){
|
||||||
if(res.result.indexOf('blackcatp:/')){
|
const user_prefix = `${store.getters.config.website}/u/`;
|
||||||
|
console.log(res.result,user_prefix)
|
||||||
|
if(res.result.startsWith(user_prefix)){
|
||||||
|
return uni.navigateTo({
|
||||||
|
url:"/pages/common/userCard/index?sourceID="+res.result.replace(user_prefix,'')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const group_prefix = `${store.getters.config.website}/g/`;
|
||||||
|
console.log(res.result,group_prefix)
|
||||||
|
if(res.result.startsWith(group_prefix)){
|
||||||
|
return uni.navigateTo({
|
||||||
|
url:"/pages/common/groupCard/index?sourceID="+res.result.replace(group_prefix,'')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if(res.result.startsWith("http")){
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:res.result.substring(11)
|
url:"/pages/common/webview?url="+encodeURIComponent(res.result)
|
||||||
})
|
});
|
||||||
}else{
|
//res.result;
|
||||||
success(res.result)
|
return ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail(res){
|
fail(res){
|
||||||
|
|
||||||
},
|
|
||||||
complete(res){
|
|
||||||
console.log(res)
|
console.log(res)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -234,6 +246,11 @@ const get_absolute_path = (fn)=>{
|
|||||||
}
|
}
|
||||||
const pendingDownloads = new Map();
|
const pendingDownloads = new Map();
|
||||||
const cacheFile = (url, saveDir,progressCallback) => {
|
const cacheFile = (url, saveDir,progressCallback) => {
|
||||||
|
// #ifndef APP
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
resolve(url);
|
||||||
|
});
|
||||||
|
// #endif
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
try {
|
try {
|
||||||
if(!url || !url.startsWith('http')){
|
if(!url || !url.startsWith('http')){
|
||||||
@@ -443,7 +460,9 @@ export default{
|
|||||||
cacheFile,
|
cacheFile,
|
||||||
fileExsit,
|
fileExsit,
|
||||||
get_absolute_path,
|
get_absolute_path,
|
||||||
|
// #ifdef APP
|
||||||
downloadFile,
|
downloadFile,
|
||||||
|
// #endif
|
||||||
isString :isString,
|
isString :isString,
|
||||||
isNumber :isNumber,
|
isNumber :isNumber,
|
||||||
isInteger :isInteger,
|
isInteger :isInteger,
|
||||||
|
|||||||