4
@@ -1,29 +1,16 @@
|
||||
<script>
|
||||
import {
|
||||
mapGetters,
|
||||
mapActions
|
||||
} from "vuex";
|
||||
import IMSDK, {
|
||||
IMMethods,
|
||||
MessageType,
|
||||
SessionType,
|
||||
} 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 {
|
||||
conversationSort
|
||||
} from "@/util/imCommon";
|
||||
import {
|
||||
PageEvents,
|
||||
UpdateMessageTypes
|
||||
} from "@/constant";
|
||||
import {getDbDir,toastWithCallback} from "@/util/common.js";
|
||||
import {conversationSort} from "@/util/imCommon";
|
||||
import {checkUpgrade} from "@/api/login.js"
|
||||
import {PageEvents,UpdateMessageTypes} from "@/constant";
|
||||
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log("App Launch");
|
||||
this.checkUpdate();
|
||||
this.setGlobalIMlistener();
|
||||
this.tryLogin();
|
||||
// #ifdef H5
|
||||
@@ -101,15 +88,11 @@
|
||||
});
|
||||
|
||||
// sync
|
||||
const syncStartHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const syncStartHandler = ({data}) => {
|
||||
this.$store.commit("user/SET_IS_SYNCING", true);
|
||||
this.$store.commit("user/SET_REINSTALL", data);
|
||||
};
|
||||
const syncProgressHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const syncProgressHandler = ({data}) => {
|
||||
this.$store.commit("user/SET_PROGRESS", data);
|
||||
};
|
||||
const syncFinishHandler = () => {
|
||||
@@ -133,9 +116,7 @@
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnSyncServerProgress, syncProgressHandler);
|
||||
|
||||
// self
|
||||
const selfInfoUpdateHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const selfInfoUpdateHandler = ({data}) => {
|
||||
this.$store.commit("user/SET_SELF_INFO", {
|
||||
...this.storeSelfInfo,
|
||||
...data,
|
||||
@@ -145,9 +126,7 @@
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnSelfInfoUpdated, selfInfoUpdateHandler);
|
||||
|
||||
// message
|
||||
const newMessagesHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const newMessagesHandler = ({data}) => {
|
||||
if (this.storeIsSyncing) {
|
||||
return;
|
||||
}
|
||||
@@ -157,9 +136,7 @@
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnRecvNewMessages, newMessagesHandler);
|
||||
|
||||
// friend
|
||||
const friendInfoChangeHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const friendInfoChangeHandler = ({data}) => {
|
||||
uni.$emit(IMSDK.IMEvents.OnFriendInfoChanged, {
|
||||
data
|
||||
});
|
||||
@@ -167,36 +144,25 @@
|
||||
friendInfo: data,
|
||||
});
|
||||
};
|
||||
const friendAddedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const friendAddedHandler = ({data}) => {
|
||||
this.pushNewFriend(data);
|
||||
};
|
||||
const friendDeletedHander = ({
|
||||
data
|
||||
}) => {
|
||||
const friendDeletedHander = ({data}) => {
|
||||
this.updateFriendInfo({
|
||||
friendInfo: data,
|
||||
isRemove: true,
|
||||
});
|
||||
};
|
||||
|
||||
IMSDK.subscribe(
|
||||
IMSDK.IMEvents.OnFriendInfoChanged,
|
||||
friendInfoChangeHandler
|
||||
);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnFriendInfoChanged,friendInfoChangeHandler);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnFriendAdded, friendAddedHandler);
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnFriendDeleted, friendDeletedHander);
|
||||
|
||||
// blacklist
|
||||
const blackAddedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const blackAddedHandler = ({data}) => {
|
||||
this.pushNewBlack(data);
|
||||
};
|
||||
const blackDeletedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const blackDeletedHandler = ({data}) => {
|
||||
this.updateBlackInfo({
|
||||
blackInfo: data,
|
||||
isRemove: true,
|
||||
@@ -207,58 +173,34 @@
|
||||
IMSDK.subscribe(IMSDK.IMEvents.OnBlackDeleted, blackDeletedHandler);
|
||||
|
||||
// group
|
||||
const joinedGroupAddedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const joinedGroupAddedHandler = ({data}) => {
|
||||
this.pushNewGroup(data);
|
||||
};
|
||||
const joinedGroupDeletedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const joinedGroupDeletedHandler = ({data}) => {
|
||||
this.updateGroupInfo({
|
||||
groupInfo: data,
|
||||
isRemove: true,
|
||||
});
|
||||
};
|
||||
const groupInfoChangedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const groupInfoChangedHandler = ({data}) => {
|
||||
this.updateGroupInfo({
|
||||
groupInfo: data,
|
||||
});
|
||||
};
|
||||
const groupMemberInfoChangedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
uni.$emit(IMSDK.IMEvents.OnGroupMemberInfoChanged, {
|
||||
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
|
||||
);
|
||||
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 friendApplicationNumHandler = ({data}) => {
|
||||
const isRecv = data.toUserID === this.storeCurrentUserID;
|
||||
if (isRecv) {
|
||||
this.pushNewRecvFriendApplition(data);
|
||||
@@ -266,9 +208,7 @@
|
||||
this.pushNewSentFriendApplition(data);
|
||||
}
|
||||
};
|
||||
const friendApplicationAccessHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const friendApplicationAccessHandler = ({data}) => {
|
||||
const isRecv = data.toUserID === this.storeCurrentUserID;
|
||||
if (isRecv) {
|
||||
this.updateRecvFriendApplition({
|
||||
@@ -280,9 +220,7 @@
|
||||
});
|
||||
}
|
||||
};
|
||||
const groupApplicationNumHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const groupApplicationNumHandler = ({data}) => {
|
||||
const isRecv = data.userID !== this.storeCurrentUserID;
|
||||
if (isRecv) {
|
||||
this.pushNewRecvGroupApplition(data);
|
||||
@@ -290,9 +228,7 @@
|
||||
this.pushNewSentGroupApplition(data);
|
||||
}
|
||||
};
|
||||
const groupApplicationAccessHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const groupApplicationAccessHandler = ({data}) => {
|
||||
const isRecv = data.userID !== this.storeCurrentUserID;
|
||||
if (isRecv) {
|
||||
this.updateRecvGroupApplition({
|
||||
@@ -305,43 +241,21 @@
|
||||
}
|
||||
};
|
||||
|
||||
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.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);
|
||||
|
||||
// conversation
|
||||
const totalUnreadCountChangedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const totalUnreadCountChangedHandler = ({data}) => {
|
||||
if (this.storeIsSyncing) {
|
||||
return;
|
||||
}
|
||||
this.$store.commit("conversation/SET_UNREAD_COUNT", data);
|
||||
};
|
||||
const newConversationHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const newConversationHandler = ({data}) => {
|
||||
if (this.storeIsSyncing) {
|
||||
return;
|
||||
}
|
||||
@@ -351,9 +265,7 @@
|
||||
conversationSort(result)
|
||||
);
|
||||
};
|
||||
const conversationChangedHandler = ({
|
||||
data
|
||||
}) => {
|
||||
const conversationChangedHandler = ({data}) => {
|
||||
if (this.storeIsSyncing) {
|
||||
return;
|
||||
}
|
||||
@@ -421,17 +333,14 @@
|
||||
uni.$u.toast("初始化IMSDK失败!");
|
||||
return;
|
||||
}
|
||||
const status = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetLoginStatus,
|
||||
IMSDK.uuid()
|
||||
);
|
||||
const status = await IMSDK.asyncApi(IMSDK.IMMethods.GetLoginStatus,IMSDK.uuid());
|
||||
if (status === 3) {
|
||||
initStore();
|
||||
return;
|
||||
}
|
||||
|
||||
const IMToken = uni.getStorageSync("IMToken");
|
||||
const IMUserID = uni.getStorageSync("IMUserID");
|
||||
const IMUserID = uni.getStorageSync("IMUserID")+'';
|
||||
if (IMToken && IMUserID) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.Login, IMSDK.uuid(), {
|
||||
userID: IMUserID,
|
||||
@@ -494,6 +403,20 @@
|
||||
this.storeCurrentConversation.conversationID
|
||||
);
|
||||
},
|
||||
// 验证是否升级
|
||||
checkUpdate() {
|
||||
let system = uni.getSystemInfoSync()
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
||||
let skip_version = uni.getStorageSync('skip_version')
|
||||
if(res && res.version!=skip_version){
|
||||
uni.$emit('closeWebview')
|
||||
this.setShow(this.current, false)
|
||||
router('/pages/common/upgrade?model=' + JSON.stringify(res), '', 'fade-in')
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// 登录
|
||||
export const businessConfig = (params) =>
|
||||
uni.$u?.http.post("/common/init", JSON.stringify(params));
|
||||
// 验证是否升级
|
||||
export const checkUpgrade = (params) =>
|
||||
uni.$u?.http.post("/common/checkUpgrade", JSON.stringify(params));
|
||||
export const businessLogin = (params) =>
|
||||
uni.$u?.http.post("/common/login", JSON.stringify(params));
|
||||
export const businessSendSms = (params) =>
|
||||
@@ -28,9 +31,8 @@ export const businessModify = (params) =>
|
||||
export const businessInfoUpdate = (params) =>
|
||||
uni.$u?.http.post(
|
||||
"/user/profile",
|
||||
JSON.stringify({
|
||||
...params,
|
||||
}), {
|
||||
JSON.stringify({ ...params, }),
|
||||
{
|
||||
header: {
|
||||
token: uni.getStorageSync("BusinessToken"),
|
||||
},
|
||||
@@ -39,9 +41,8 @@ export const businessInfoUpdate = (params) =>
|
||||
export const businessGetUserInfo = (userID) =>
|
||||
uni.$u?.http.post(
|
||||
"/user/find",
|
||||
JSON.stringify({
|
||||
userIDs: [userID],
|
||||
}), {
|
||||
JSON.stringify({ userIDs: [userID], }),
|
||||
{
|
||||
header: {
|
||||
token: uni.getStorageSync("BusinessToken"),
|
||||
},
|
||||
@@ -77,3 +78,40 @@ export const businessSearchUser = (keyword,searchtype) =>
|
||||
},
|
||||
}
|
||||
);
|
||||
export const getArticle = (id,type) =>
|
||||
uni.$u?.http.post(
|
||||
"/article/detail",
|
||||
JSON.stringify({
|
||||
id,
|
||||
type:(type? type : 'id')
|
||||
}), {
|
||||
header: {
|
||||
token: uni.getStorageSync("BusinessToken"),
|
||||
},
|
||||
}
|
||||
);
|
||||
export const getFriendCircle = (page=1,limit=10) =>{
|
||||
uni.$u?.http.get(
|
||||
"/friend_circle/list",
|
||||
JSON.stringify({
|
||||
limit:limit,
|
||||
page:page
|
||||
}),
|
||||
{
|
||||
header: {
|
||||
token: uni.getStorageSync("BusinessToken"),
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
export const getFriendCircleNewcount = () =>{
|
||||
uni.$u?.http.get(
|
||||
"/friend_circle/newcount",
|
||||
JSON.stringify({}),
|
||||
{
|
||||
header: {
|
||||
token: uni.getStorageSync("BusinessToken"),
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ const BASE_DOMAIN = 'www.axzc.xyz'
|
||||
// const CHAT_URL = `https://${BASE_DOMAIN}/chat`
|
||||
// const API_URL = `https://${BASE_DOMAIN}/api`
|
||||
// const WS_URL = `wss://${BASE_DOMAIN}/msg_gateway`
|
||||
const CHAT_URL = `http://${BASE_DOMAIN}:8585/api`
|
||||
const CHAT_URL = `http://${BASE_DOMAIN}/api`
|
||||
const API_URL = `http://${BASE_DOMAIN}/imapi`
|
||||
const WS_URL = `ws://${BASE_DOMAIN}/ws`
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
<template>
|
||||
<view class="selected_item">
|
||||
<view class="left_info">
|
||||
<my-avatar
|
||||
:src="source.faceURL"
|
||||
:desc="source.nickname || source.showName"
|
||||
:isGroup="Boolean(source.groupID)"
|
||||
size="42"
|
||||
/>
|
||||
<my-avatar :src="source.faceURL" :desc="source.nickname || source.showName"
|
||||
:isGroup="Boolean(source.groupID)" size="42" />
|
||||
<text>{{ source.nickname || source.groupName || source.showName }}</text>
|
||||
</view>
|
||||
<view>
|
||||
@@ -16,8 +12,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
export default {
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
export default {
|
||||
name: "",
|
||||
components: {
|
||||
MyAvatar,
|
||||
@@ -36,11 +32,11 @@ export default {
|
||||
mounted() {
|
||||
console.log(this.source);
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.selected_item {
|
||||
.selected_item {
|
||||
@include btwBox();
|
||||
padding: 20rpx 0;
|
||||
|
||||
@@ -55,5 +51,5 @@ export default {
|
||||
.u-button {
|
||||
height: 48rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,19 +8,9 @@
|
||||
<view class="select_list">{{ selectedStr }}</view>
|
||||
</view>
|
||||
<view class="">
|
||||
<u-button
|
||||
:loading="comfirmLoading"
|
||||
@click="clickComfirm"
|
||||
:disabled="choosedData.length === 0"
|
||||
<u-button :loading="comfirmLoading" @click="clickComfirm" :disabled="choosedData.length === 0"
|
||||
type="primary"
|
||||
:text="
|
||||
isRemove
|
||||
? '移除'
|
||||
: `确定(${choosedData.length}${
|
||||
maxLength > 0 ? `/${maxLength}` : ``
|
||||
})`
|
||||
"
|
||||
/>
|
||||
:text="isRemove? '移除': `确定(${choosedData.length}${maxLength > 0 ? `/${maxLength}` : ``})`" />
|
||||
<u-popup round="24" :show="showSelected" mode="bottom" @close="close">
|
||||
<view class="selected_container">
|
||||
<view class="top_desc">
|
||||
@@ -28,10 +18,7 @@
|
||||
<text @click="close" class="comfirm_text">确认</text>
|
||||
</view>
|
||||
<u-list class="selected_list">
|
||||
<u-list-item
|
||||
v-for="item in choosedData"
|
||||
:key="item.userID || item.groupID"
|
||||
>
|
||||
<u-list-item v-for="item in choosedData" :key="item.userID || item.groupID">
|
||||
<selected-member @removeItem="removeItem(item)" :source="item" />
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
@@ -42,8 +29,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SelectedMember from "./SelectedMember.vue";
|
||||
export default {
|
||||
import SelectedMember from "./SelectedMember.vue";
|
||||
export default {
|
||||
name: "ChooseIndexFooter",
|
||||
components: {
|
||||
SelectedMember,
|
||||
@@ -78,11 +65,11 @@ export default {
|
||||
this.$emit("confirm");
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.member_checked_desc {
|
||||
.member_checked_desc {
|
||||
@include btwBox();
|
||||
background-color: #fff;
|
||||
align-items: flex-start;
|
||||
@@ -120,9 +107,9 @@ export default {
|
||||
height: 40px;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.selected_container {
|
||||
.selected_container {
|
||||
padding: 44rpx;
|
||||
|
||||
.top_desc {
|
||||
@@ -139,5 +126,5 @@ export default {
|
||||
height: 60vh !important;
|
||||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,34 +1,19 @@
|
||||
<template>
|
||||
<u-index-list
|
||||
@scrolltolower="scrolltolower"
|
||||
class="user_list"
|
||||
:style="{ height: height }"
|
||||
:index-list="indexList"
|
||||
>
|
||||
<u-index-list @scrolltolower="scrolltolower" class="user_list" :style="{ height: height }" :index-list="indexList">
|
||||
<template v-for="(item, index) in itemArr">
|
||||
<u-index-item :key="index">
|
||||
<u-index-anchor
|
||||
class="user_anchor"
|
||||
:text="indexList[index]"
|
||||
></u-index-anchor>
|
||||
<user-item
|
||||
@itemClick="itemClick"
|
||||
@updateCheck="updateCheck"
|
||||
:checked="checkedIDList.includes(cell.userID)"
|
||||
:disabled="disabledIDList.includes(cell.userID)"
|
||||
:checkVisible="showCheck"
|
||||
v-for="cell in item"
|
||||
:item="cell"
|
||||
:key="cell.userID"
|
||||
/>
|
||||
<u-index-anchor class="user_anchor" :text="indexList[index]"></u-index-anchor>
|
||||
<user-item @itemClick="itemClick" @updateCheck="updateCheck"
|
||||
:checked="checkedIDList.includes(cell.userID)" :disabled="disabledIDList.includes(cell.userID)"
|
||||
:checkVisible="showCheck" v-for="cell in item" :item="cell" :key="cell.userID" />
|
||||
</u-index-item>
|
||||
</template>
|
||||
</u-index-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import UserItem from "../UserItem/index.vue";
|
||||
export default {
|
||||
import UserItem from "../UserItem/index.vue";
|
||||
export default {
|
||||
name: "ChooseIndexList",
|
||||
components: {
|
||||
UserItem,
|
||||
@@ -73,19 +58,20 @@ export default {
|
||||
this.$emit("scrolltolower");
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.user_list {
|
||||
.user_list {
|
||||
flex: 1;
|
||||
|
||||
::v-deep uni-scroll-view {
|
||||
max-height: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user_anchor {
|
||||
.user_anchor {
|
||||
background-color: #f8f8f8 !important;
|
||||
border: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,9 @@
|
||||
export const ChatingFooterActionTypes = {
|
||||
Album: "Album",
|
||||
Camera: "Camera",
|
||||
Video: "Video",
|
||||
Voice: "Voice",
|
||||
Location: "Location",
|
||||
};
|
||||
|
||||
export const ContactMenuTypes = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { MessageType } from "openim-uniapp-polyfill";
|
||||
import {MessageType} from "openim-uniapp-polyfill";
|
||||
|
||||
export const CustomType = {
|
||||
VideoCall: "c100",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name" : "IM-UCB",
|
||||
"name" : "探探",
|
||||
"appid" : "__UNI__F0A946D",
|
||||
"description" : "",
|
||||
"versionName" : "3.3.4",
|
||||
@@ -21,7 +21,10 @@
|
||||
"Camera" : {},
|
||||
"Record" : {},
|
||||
"Geolocation" : {},
|
||||
"Maps" : {}
|
||||
"Maps" : {},
|
||||
"Fingerprint" : {},
|
||||
"Contacts" : {},
|
||||
"Barcode" : {}
|
||||
},
|
||||
"distribute" : {
|
||||
"android" : {
|
||||
@@ -66,8 +69,18 @@
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"ad" : {},
|
||||
"geolocation" : {},
|
||||
"maps" : {},
|
||||
"geolocation" : {
|
||||
"system" : {
|
||||
"__platform__" : [ "ios", "android" ]
|
||||
}
|
||||
},
|
||||
"maps" : {
|
||||
"amap" : {
|
||||
"name" : "amap_18926034082bYRO97pz",
|
||||
"appkey_ios" : "cfc7b531b60382598b4aac7944415fba",
|
||||
"appkey_android" : "e431515e99e69fc1b6edb674e3487f1a"
|
||||
}
|
||||
},
|
||||
"share" : {},
|
||||
"statics" : {},
|
||||
"speech" : {}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@openim/client-sdk": "^0.0.11-ahpha.1",
|
||||
"date-fns": "^2.30.0",
|
||||
"dayjs": "^1.11.6",
|
||||
"image-tools": "^1.4.0",
|
||||
"md5": "^2.3.0",
|
||||
"@openim/client-sdk": "^0.0.11-ahpha.1",
|
||||
"openim-uniapp-polyfill": "^1.4.1",
|
||||
"qrcode": "^1.5.4",
|
||||
"uuid": "^9.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -245,37 +245,61 @@
|
||||
"navigationBarTitleText": "",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/upgrade",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/article",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/common/webview",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/workbench/friend-circle/friend-circle",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
"color": "#8E9AB0",
|
||||
"selectedColor": "#0089FF",
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
"color": "#171717",
|
||||
"selectedColor": "#07c160",
|
||||
"borderStyle": "#f4f4f4",
|
||||
"backgroundColor": "#f4f4f4",
|
||||
"height": "55px",
|
||||
"list": [{
|
||||
"pagePath": "pages/conversation/conversationList/index",
|
||||
"iconPath": "./static/images/tabbar_conversation.png",
|
||||
"selectedIconPath": "static/images/tabbar_conversation_active.png",
|
||||
"text": "OpenIM"
|
||||
"iconPath": "./static/images/tabbar/conversation.png",
|
||||
"selectedIconPath": "static/images/tabbar/conversation_active.png",
|
||||
"text": "消息"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/contact/index/index",
|
||||
"iconPath": "./static/images/tabbar_contacts.png",
|
||||
"selectedIconPath": "static/images/tabbar_contacts_active.png",
|
||||
"iconPath": "./static/images/tabbar/contacts.png",
|
||||
"selectedIconPath": "static/images/tabbar/contacts_active.png",
|
||||
"text": "通讯录"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/workbench/index/index",
|
||||
"iconPath": "./static/images/tabbar_workbench.png",
|
||||
"selectedIconPath": "static/images/tabbar_workbench_active.png",
|
||||
"iconPath": "./static/images/tabbar/workbench.png",
|
||||
"selectedIconPath": "static/images/tabbar/workbench_active.png",
|
||||
"text": "发现"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/profile/index/index",
|
||||
"iconPath": "./static/images/tabbar_profile.png",
|
||||
"selectedIconPath": "static/images/tabbar_profile_active.png",
|
||||
"text": "我的"
|
||||
"iconPath": "./static/images/tabbar/profile.png",
|
||||
"selectedIconPath": "static/images/tabbar/profile_active.png",
|
||||
"text": "我"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<view class="n-ps-all-base">
|
||||
<uv-parse v-if="content" :content="content"></uv-parse>
|
||||
<view class="n-flex-row" v-if="showButton" :style="{marginTop:'100rpx'}">
|
||||
<uv-button class="n-flex-1 n-ms-base" v-for="(item, idx) in buttonList" :key="idx" @click="switchButton(idx, item)" :text="item.title" :icon="'/static/image/' + item.value + '.png'" :plain="current==idx" :color="current==idx ? item.color:'#f8f8f8'" :customStyle="{height:'80rpx'}" :customTextStyle="{color:current==idx ? item.color:'#333333',marginLeft:'20rpx'}" shape="circle" color="#f8f8f8" throttleTime="1000"></uv-button>
|
||||
</view>
|
||||
<uv-empty :show="empty" icon="/static/image/empty.png" text="暂无数据~" width="200" marginTop="100"></uv-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {getArticle} from '@/api/login.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
empty: false,
|
||||
content: '',
|
||||
current: null,
|
||||
questionId: 0,
|
||||
showButton: false,
|
||||
buttonList: [
|
||||
{title:'未解决', value:'unresolved', color:'#fc3463'},
|
||||
{title:'已解决', value:'resolved', color:'#5ac725'}
|
||||
]
|
||||
}
|
||||
},
|
||||
onLoad(evt) {
|
||||
if(evt.type=='config') this.setConfig(evt)
|
||||
if(evt.type=='question') this.setQuestion(evt)
|
||||
|
||||
uni.setNavigationBarTitle({title:evt.title})
|
||||
},
|
||||
methods: {
|
||||
// 设置配置内容
|
||||
setConfig(evt) {
|
||||
let config = getApp().globalData.config
|
||||
if(evt.name && config[evt.name]){
|
||||
this.content = config[evt.name]
|
||||
}else{
|
||||
this.empty = true
|
||||
}
|
||||
},
|
||||
// 设置问题内容
|
||||
setQuestion(evt) {
|
||||
this.content = evt.content
|
||||
this.questionId = evt.id
|
||||
this.showButton = true
|
||||
},
|
||||
// 切换按钮
|
||||
switchButton(idx, item) {
|
||||
this.current = idx
|
||||
getArticle({id:this.questionId,type:item.value})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -3,59 +3,41 @@
|
||||
<custom-nav-bar title="联系人" />
|
||||
|
||||
<view class="search_bar_wrap">
|
||||
<u-search
|
||||
shape="square"
|
||||
placeholder="搜索"
|
||||
:showAction="false"
|
||||
v-model="keyword"
|
||||
/>
|
||||
<u-search shape="square" placeholder="搜索" :showAction="false" v-model="keyword" />
|
||||
</view>
|
||||
|
||||
<view class="tab_container">
|
||||
<template v-if="activeTab === 0">
|
||||
<setting-item
|
||||
@click="tabChange(tabs[0].idx)"
|
||||
:title="tabs[0].title"
|
||||
:border="false"
|
||||
/>
|
||||
<setting-item @click="tabChange(tabs[0].idx)" :title="tabs[0].title" :border="false" />
|
||||
|
||||
<view class="tab_pane"></view>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<view class="tab_pane" v-show="activeTab === 1">
|
||||
<choose-index-list
|
||||
@updateCheck="updateCheckedUser"
|
||||
:indexList="getChooseData.indexList"
|
||||
:itemArr="getChooseData.dataList"
|
||||
:checkedIDList="checkedUserIDList"
|
||||
:disabledIDList="disabledUserIDList"
|
||||
:showCheck="true"
|
||||
/>
|
||||
<choose-index-list @updateCheck="updateCheckedUser" :indexList="getChooseData.indexList"
|
||||
:itemArr="getChooseData.dataList" :checkedIDList="checkedUserIDList"
|
||||
:disabledIDList="disabledUserIDList" :showCheck="true" />
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<choose-index-footer
|
||||
:comfirmLoading="comfirmLoading"
|
||||
@removeItem="updateCheckedUserOrGroup"
|
||||
@confirm="confirm"
|
||||
:choosedData="getCheckedInfo"
|
||||
/>
|
||||
<choose-index-footer :comfirmLoading="comfirmLoading" @removeItem="updateCheckedUserOrGroup" @confirm="confirm"
|
||||
:choosedData="getCheckedInfo" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { ContactChooseTypes } from "@/constant";
|
||||
import { formatChooseData, toastWithCallback } from "@/util/common";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import UserItem from "@/components/UserItem/index.vue";
|
||||
import ChooseIndexList from "@/components/ChooseIndexList/index.vue";
|
||||
import ChooseIndexFooter from "@/components/ChooseIndexFooter/index.vue";
|
||||
import SettingItem from "@/components/SettingItem/index.vue";
|
||||
import {mapGetters} from "vuex";
|
||||
import {ContactChooseTypes} from "@/constant";
|
||||
import {formatChooseData,toastWithCallback} from "@/util/common";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import UserItem from "@/components/UserItem/index.vue";
|
||||
import ChooseIndexList from "@/components/ChooseIndexList/index.vue";
|
||||
import ChooseIndexFooter from "@/components/ChooseIndexFooter/index.vue";
|
||||
import SettingItem from "@/components/SettingItem/index.vue";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
UserItem,
|
||||
@@ -117,16 +99,13 @@ export default {
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const {
|
||||
groupID,
|
||||
type,
|
||||
checkedUserIDList,
|
||||
} = options;
|
||||
const {groupID,type,checkedUserIDList,} = options;
|
||||
console.log(this.storeFriendList);
|
||||
this.type = type;
|
||||
this.groupID = groupID;
|
||||
this.checkedUserIDList = checkedUserIDList
|
||||
? JSON.parse(checkedUserIDList)
|
||||
: [];
|
||||
this.checkedUserIDList = checkedUserIDList ?
|
||||
JSON.parse(checkedUserIDList) :
|
||||
[];
|
||||
if (this.type === ContactChooseTypes.Invite) {
|
||||
this.checkDisabledUser();
|
||||
}
|
||||
@@ -137,7 +116,9 @@ export default {
|
||||
IMSDK.asyncApi("getUsersInGroup", IMSDK.uuid(), {
|
||||
groupID: this.groupID,
|
||||
userIDList: friendIDList,
|
||||
}).then(({ data }) => {
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
this.disabledUserIDList = data;
|
||||
});
|
||||
},
|
||||
@@ -150,7 +131,9 @@ export default {
|
||||
this.updateCheckedUser(item);
|
||||
}
|
||||
},
|
||||
updateCheckedUser({ userID }) {
|
||||
updateCheckedUser({
|
||||
userID
|
||||
}) {
|
||||
if (this.checkedUserIDList.includes(userID)) {
|
||||
const idx = this.checkedUserIDList.findIndex((item) => item === userID);
|
||||
const tmpArr = [...this.checkedUserIDList];
|
||||
@@ -202,17 +185,19 @@ export default {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep.u-popup {
|
||||
::v-deep.u-popup {
|
||||
flex: none;
|
||||
}
|
||||
.contact_choose_container {
|
||||
}
|
||||
|
||||
.contact_choose_container {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.search_bar_wrap {
|
||||
height: 34px;
|
||||
padding: 12px 22px;
|
||||
@@ -262,6 +247,7 @@ export default {
|
||||
.member_list {
|
||||
flex: 1;
|
||||
height: 80% !important;
|
||||
|
||||
::v-deepuni-scroll-view {
|
||||
max-height: 100% !important;
|
||||
}
|
||||
@@ -277,5 +263,5 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -86,6 +86,7 @@
|
||||
);
|
||||
info = data[0];
|
||||
}
|
||||
console.log(info)
|
||||
if (info) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/groupCard/index?sourceInfo=${JSON.stringify(info,)}`,
|
||||
@@ -103,7 +104,7 @@
|
||||
const {data} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetUsersInfo,
|
||||
IMSDK.uuid(),
|
||||
[res.data[0].id],
|
||||
[res.data[0].id+''],
|
||||
);
|
||||
const imData = data[0];
|
||||
|
||||
@@ -111,9 +112,9 @@
|
||||
...imData,
|
||||
...res.data[0],
|
||||
};
|
||||
}
|
||||
}
|
||||
console.log(info)
|
||||
}
|
||||
}
|
||||
if (info) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userCard/index?sourceInfo=${JSON.stringify(info,)}`,
|
||||
@@ -123,6 +124,7 @@
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
//TODO handle the exception
|
||||
}
|
||||
this.searching = false;
|
||||
|
||||
@@ -9,25 +9,18 @@
|
||||
<text class="title">{{ `发送${isGroup ? "入群" : "好友"}申请` }}</text>
|
||||
|
||||
<view class="input_container">
|
||||
<u--textarea
|
||||
height="120"
|
||||
v-model="reason"
|
||||
border="none"
|
||||
placeholder="请输入内容"
|
||||
maxlength="20"
|
||||
count
|
||||
>
|
||||
<u--textarea height="120" v-model="reason" border="none" placeholder="请输入内容" maxlength="20" count>
|
||||
</u--textarea>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK, { GroupJoinSource } from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import { navigateToDesignatedConversation } from "@/util/imCommon";
|
||||
import IMSDK, {GroupJoinSource} from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import {navigateToDesignatedConversation} from "@/util/imCommon";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
},
|
||||
@@ -42,8 +35,7 @@ export default {
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
const { isGroup, sourceID, isScan, notNeedVerification, sessionType } =
|
||||
options;
|
||||
const {isGroup,sourceID,isScan,notNeedVerification,sessionType} = options;
|
||||
this.isGroup = JSON.parse(isGroup);
|
||||
this.isScan = JSON.parse(isScan);
|
||||
this.sourceID = sourceID;
|
||||
@@ -54,9 +46,9 @@ export default {
|
||||
sendRequest() {
|
||||
let func;
|
||||
if (this.isGroup) {
|
||||
const joinSource = this.isScan
|
||||
? GroupJoinSource.QrCode
|
||||
: GroupJoinSource.Search;
|
||||
const joinSource = this.isScan ?
|
||||
GroupJoinSource.QrCode :
|
||||
GroupJoinSource.Search;
|
||||
func = IMSDK.asyncApi(IMSDK.IMMethods.JoinGroup, IMSDK.uuid(), {
|
||||
groupID: this.sourceID,
|
||||
reqMsg: this.reason,
|
||||
@@ -84,7 +76,7 @@ export default {
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
uni.$u.toast("发送失败");
|
||||
uni.$u.toast(err.errMsg || "发送失败");
|
||||
});
|
||||
},
|
||||
showToast(message) {
|
||||
@@ -93,11 +85,11 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.request_join_container {
|
||||
.request_join_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
background-color: #f6f6f6;
|
||||
@@ -121,5 +113,5 @@ export default {
|
||||
padding: 24rpx 44rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<view class="m-shade n-flex-1 n-align-center n-justify-center">
|
||||
<view :style="{width:'580rpx'}">
|
||||
<image src="/static/image/upgrade.png" mode="widthFix"></image>
|
||||
<view class="n-ps-all-ll n-ms-top-ll n-position-absolute">
|
||||
<text class="n-size-mm n-weight-7 n-color-inverse">发现新版本</text>
|
||||
<text class="n-size-base n-ms-top-ss n-color-inverse">V{{model.version}}</text>
|
||||
</view>
|
||||
<view class="n-ps-all-l n-radius-lb-base" :style="{backgroundColor:'#f3f3f3',borderRadius:'0 0 16rpx 16rpx'}">
|
||||
<view :style="{height:'300rpx'}">
|
||||
<scroll-view class="n-flex-1" :show-scrollbar="false" scroll-y>
|
||||
<rich-text class="n-size-s" :nodes="model.content" :style="{lineHeight:'26rpx'}"></rich-text>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="n-height-base n-justify-center">
|
||||
<view v-if="progress">
|
||||
<uv-line-progress :percentage="value" activeColor="#fc3463"></uv-line-progress>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: 0,
|
||||
model: {
|
||||
force: 1,
|
||||
version: '1.0.0',
|
||||
content: ''
|
||||
},
|
||||
progress: false,
|
||||
download: false
|
||||
}
|
||||
},
|
||||
onLoad(evt) {
|
||||
if(evt.model){
|
||||
this.model = {...this.model, ...JSON.parse(evt.model)}
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
if(this.model.force==1){
|
||||
return true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 取消更新
|
||||
cancel() {
|
||||
uni.navigateBack()
|
||||
uni.setStorageSync('skip_version', this.model.version)
|
||||
},
|
||||
// 立即更新
|
||||
upgrade(){
|
||||
// 检测更新方式
|
||||
if(this.model.type==0 || this.model.type==1){
|
||||
this.downloadUpdate()
|
||||
}else{
|
||||
plus.runtime.openURL(this.model.source_text)
|
||||
}
|
||||
},
|
||||
// 下载更新
|
||||
downloadUpdate() {
|
||||
if(!this.download){
|
||||
this.progress = true
|
||||
this.download = true
|
||||
// 下载安装包
|
||||
const download = uni.downloadFile({
|
||||
url: this.model.source_text,
|
||||
success: result=>{
|
||||
// 自动安装软件
|
||||
plus.runtime.install(result.tempFilePath, {force:true}, ()=>{
|
||||
// 防止强制更新无法关闭界面
|
||||
this.model.force = 0
|
||||
if(this.model.type==1){
|
||||
uni.showToast({
|
||||
title:'更新成功,软件重启'
|
||||
})
|
||||
setTimeout(()=>{ plus.runtime.restart() }, 1500)
|
||||
}
|
||||
})
|
||||
},
|
||||
fail: error=>{
|
||||
uni.showToast({
|
||||
title:'下载失败,请检查您的网络情况'
|
||||
})
|
||||
}
|
||||
})
|
||||
// 监听下载进度
|
||||
download.onProgressUpdate(result=>{
|
||||
this.value = result.progress
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.m-shade{
|
||||
background-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
</style>
|
||||
@@ -15,7 +15,11 @@
|
||||
<u-button type="primary" icon="man-add" text="添加"></u-button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info_row">
|
||||
<user-info-row-item lable="性别" :content="getGender" />
|
||||
<user-info-row-item lable="生日" :content="getBirth" />
|
||||
<user-info-row-item lable="个性签名" :content="sourceUserInfo.bio" />
|
||||
</view>
|
||||
<view v-if="isFriend" class="info_row">
|
||||
<user-info-row-item @click="toMoreInfo" lable="个人资料" arrow />
|
||||
</view>
|
||||
@@ -31,21 +35,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
navigateToDesignatedConversation
|
||||
} from "@/util/imCommon";
|
||||
import IMSDK, {
|
||||
SessionType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {mapGetters} from "vuex";
|
||||
import {navigateToDesignatedConversation} from "@/util/imCommon";
|
||||
import IMSDK, {SessionType,} from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import UserInfoRowItem from "./components/UserInfoRowItem.vue";
|
||||
import {
|
||||
businessSearchUserInfo
|
||||
} from "@/api/login";
|
||||
import {businessSearchUserInfo} from "@/api/login";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -67,6 +64,19 @@
|
||||
"storeFriendList",
|
||||
"storeSelfInfo",
|
||||
]),
|
||||
getGender() {
|
||||
if (this.sourceUserInfo.sex === 0) {
|
||||
return "保密";
|
||||
}
|
||||
if (this.sourceUserInfo.sex === 1) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
},
|
||||
getBirth() {
|
||||
const birth = this.sourceUserInfo.birthday ?? 0;
|
||||
return dayjs(birth).format("YYYY-MM-DD");
|
||||
},
|
||||
isFriend() {
|
||||
return (
|
||||
this.storeFriendList.findIndex(
|
||||
@@ -142,7 +152,7 @@
|
||||
} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetUsersInfo,
|
||||
IMSDK.uuid(),
|
||||
[this.sourceID],
|
||||
[this.sourceID+''],
|
||||
);
|
||||
const imData = data[0]?.friendInfo ?? data[0]?.publicInfo ?? {};
|
||||
info = {
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<web-view :src="linkUrl"></web-view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
linkUrl: "",
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.linkUrl = 'https://doc.rentsoft.cn/'
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
this.$scope
|
||||
.$getAppWebview()
|
||||
.children()[0]
|
||||
.setStyle({
|
||||
top: uni.getWindowInfo().statusBarHeight,
|
||||
height: uni.getWindowInfo().safeArea.height,
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
action: Object,
|
||||
@@ -28,11 +28,11 @@ export default {
|
||||
this.$emit("click", this.action);
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.action_item {
|
||||
.action_item {
|
||||
@include vCenterBox();
|
||||
padding: 24rpx 44rpx;
|
||||
|
||||
@@ -70,5 +70,5 @@ export default {
|
||||
bottom: -24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,26 +3,16 @@
|
||||
<custom-nav-bar title="添加" />
|
||||
|
||||
<view class="action_row">
|
||||
<action-item
|
||||
@click="friendAction(item)"
|
||||
v-for="item in friendActionMenus"
|
||||
:action="item"
|
||||
:key="item.idx"
|
||||
/>
|
||||
<action-item
|
||||
@click="groupAction(item)"
|
||||
v-for="item in groupActionMenus"
|
||||
:action="item"
|
||||
:key="item.idx"
|
||||
/>
|
||||
<action-item @click="friendAction(item)" v-for="item in friendActionMenus" :action="item" :key="'f_'+item.idx" />
|
||||
<action-item @click="groupAction(item)" v-for="item in groupActionMenus" :action="item" :key="'g_'+item.idx" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ActionItem from "./ActionItem.vue";
|
||||
export default {
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ActionItem from "./ActionItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
ActionItem,
|
||||
@@ -54,7 +44,7 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
groupAction({ idx }) {
|
||||
groupAction({idx}) {
|
||||
if (idx === 0) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/createGroup/index`,
|
||||
@@ -65,7 +55,7 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
friendAction({ idx }) {
|
||||
friendAction({idx}) {
|
||||
if (!idx) {
|
||||
uni.navigateTo({
|
||||
url: "/pages/common/searchUserOrGroup/index?isSearchGroup=false",
|
||||
@@ -73,11 +63,11 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.contact_add_container {
|
||||
.contact_add_container {
|
||||
height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
@@ -97,5 +87,5 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<view class="chat_action_bar">
|
||||
<u-row class="action_row">
|
||||
<u-col
|
||||
v-for="item in actionList"
|
||||
:key="item.idx"
|
||||
@click="actionClick(item)"
|
||||
span="3"
|
||||
>
|
||||
<u-col v-for="item in actionList" :key="item.idx" @click="actionClick(item)" span="3">
|
||||
<view class="action_item">
|
||||
<image :src="item.icon" alt="" srcset="" />
|
||||
<text class="action_item_title">{{ item.title }}</text>
|
||||
@@ -17,11 +12,9 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
ChatingFooterActionTypes,
|
||||
} from "@/constant";
|
||||
import {ChatingFooterActionTypes,} from "@/constant";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
@@ -29,28 +22,67 @@ export default {
|
||||
{
|
||||
idx: 0,
|
||||
type: ChatingFooterActionTypes.Album,
|
||||
title: "相册",
|
||||
title: "照片",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
}
|
||||
},
|
||||
{
|
||||
idx: 1,
|
||||
type: ChatingFooterActionTypes.Camera,
|
||||
title: "拍摄",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
{
|
||||
idx: 2,
|
||||
type: ChatingFooterActionTypes.Video,
|
||||
title: "视频通话",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
{
|
||||
idx: 3,
|
||||
type: ChatingFooterActionTypes.Location,
|
||||
title: "位置",
|
||||
icon: require("static/images/chating_action_image.png"),
|
||||
},
|
||||
// {
|
||||
// idx: 0,
|
||||
// type: ChatingFooterActionTypes.Album,
|
||||
// title: "红包",
|
||||
// icon: require("static/images/chating_action_image.png"),
|
||||
// },
|
||||
// {
|
||||
// idx: 0,
|
||||
// type: ChatingFooterActionTypes.Album,
|
||||
// title: "转账",
|
||||
// icon: require("static/images/chating_action_image.png"),
|
||||
// }
|
||||
],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async actionClick(action) {
|
||||
switch (action.type) {
|
||||
case ChatingFooterActionTypes.Video:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
case ChatingFooterActionTypes.Album:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
case ChatingFooterActionTypes.Camera:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
case ChatingFooterActionTypes.Location:
|
||||
this.$emit("prepareMediaMessage", action.type);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.chat_action_bar {
|
||||
.chat_action_bar {
|
||||
position: relative;
|
||||
background: #f0f2f6;
|
||||
padding: 24rpx 36rpx;
|
||||
@@ -76,5 +108,5 @@ export default {
|
||||
margin-top: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -25,40 +25,26 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
mapGetters,
|
||||
mapActions
|
||||
} from "vuex";
|
||||
import {
|
||||
getPurePath,
|
||||
html2Text
|
||||
} from "@/util/common";
|
||||
import {
|
||||
offlinePushInfo
|
||||
} from "@/util/imCommon";
|
||||
import {
|
||||
ChatingFooterActionTypes,
|
||||
UpdateMessageTypes,
|
||||
} from "@/constant";
|
||||
import IMSDK, {
|
||||
IMMethods,
|
||||
MessageStatus,
|
||||
MessageType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {mapGetters,mapActions} from "vuex";
|
||||
import {getPurePath,html2Text} from "@/util/common";
|
||||
import {offlinePushInfo} from "@/util/imCommon";
|
||||
import {ChatingFooterActionTypes,UpdateMessageTypes,} from "@/constant";
|
||||
import IMSDK, {IMMethods,MessageStatus,MessageType,} from "openim-uniapp-polyfill";
|
||||
import UParse from "@/components/gaoyia-parse/parse.vue";
|
||||
import CustomEditor from "./CustomEditor.vue";
|
||||
import ChatingActionBar from "./ChatingActionBar.vue";
|
||||
|
||||
const needClearTypes = [MessageType.TextMessage];
|
||||
|
||||
const albumChoose = [{
|
||||
name: "图片",
|
||||
type: ChatingFooterActionTypes.Album,
|
||||
const rtcChoose = [
|
||||
{
|
||||
name: "视频通话",
|
||||
type: ChatingFooterActionTypes.Video,
|
||||
idx: 0,
|
||||
},
|
||||
{
|
||||
name: "拍照",
|
||||
type: ChatingFooterActionTypes.Camera,
|
||||
name: "语言通话",
|
||||
type: ChatingFooterActionTypes.Voice,
|
||||
idx: 1,
|
||||
},
|
||||
];
|
||||
@@ -133,23 +119,19 @@
|
||||
message,
|
||||
offlinePushInfo,
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
}) => {
|
||||
.then(({data}) => {
|
||||
this.updateOneMessage({
|
||||
message: data,
|
||||
isSuccess: true,
|
||||
});
|
||||
})
|
||||
.catch(({
|
||||
data,
|
||||
errCode,
|
||||
errMsg
|
||||
}) => {
|
||||
.catch(({data,errCode,errMsg}) => {
|
||||
uni.$u.toast(errMsg);
|
||||
this.updateOneMessage({
|
||||
message: data,
|
||||
type: UpdateMessageTypes.KeyWords,
|
||||
keyWords: [{
|
||||
keyWords: [
|
||||
{
|
||||
key: "status",
|
||||
value: MessageStatus.Failed,
|
||||
},
|
||||
@@ -186,14 +168,62 @@
|
||||
this.inputHtml = e.detail.html;
|
||||
},
|
||||
prepareMediaMessage(type) {
|
||||
if (type === ChatingFooterActionTypes.Album) {
|
||||
this.actionSheetMenu = [...albumChoose];
|
||||
}
|
||||
console.log(type)
|
||||
if (type === ChatingFooterActionTypes.Video) {
|
||||
this.actionSheetMenu = [...rtcChoose];
|
||||
this.showActionSheet = true;
|
||||
}
|
||||
if (type === ChatingFooterActionTypes.Album) {
|
||||
this.chooseOrShotImage(["album"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
}
|
||||
if (type === ChatingFooterActionTypes.Camera) {
|
||||
this.chooseOrShotImage(["camera"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
}
|
||||
if (type === ChatingFooterActionTypes.Location) {
|
||||
uni.chooseLocation({
|
||||
complete(res) {
|
||||
console.log(res);
|
||||
},
|
||||
fail(res) {
|
||||
console.log(res);
|
||||
}
|
||||
//latitude:1,
|
||||
//longitude:1,
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
// from comp
|
||||
batchCreateImageMesage(paths) {
|
||||
/*
|
||||
createAdvancedTextMessage
|
||||
createTextAtMessage
|
||||
createLocationMessage
|
||||
createTextMessage
|
||||
createCustomMessage
|
||||
createQuoteMessage
|
||||
createAdvancedQuoteMessage
|
||||
createCardMessage
|
||||
createImageMessage
|
||||
createImageMessage
|
||||
createImageMessageByURL
|
||||
createSoundMessage
|
||||
createSoundMessageFromFullPath
|
||||
createSoundMessageByURL
|
||||
createVideoMessage
|
||||
createVideoMessageFromFullPath
|
||||
createVideoMessageByURL
|
||||
createFileMessage
|
||||
createFileMessageFromFullPath
|
||||
createFileMessageByURL
|
||||
createMergerMessage
|
||||
createFaceMessage
|
||||
createForwardMessage
|
||||
*/
|
||||
paths.forEach(async (path) => {
|
||||
const message = await IMSDK.asyncApi(
|
||||
IMMethods.CreateImageMessageFromFullPath,
|
||||
@@ -203,17 +233,19 @@
|
||||
this.sendMessage(message);
|
||||
});
|
||||
},
|
||||
selectClick({
|
||||
idx
|
||||
}) {
|
||||
selectClick({idx}) {
|
||||
if (idx === 0) {
|
||||
this.chooseOrShotImage(["album"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
uni.$u.toast('根据相关政策,暂时禁用视频通话');
|
||||
//发送视频通话
|
||||
// this.chooseOrShotImage(["album"]).then((paths) =>
|
||||
// this.batchCreateImageMesage(paths)
|
||||
// );
|
||||
} else {
|
||||
this.chooseOrShotImage(["camera"]).then((paths) =>
|
||||
this.batchCreateImageMesage(paths)
|
||||
);
|
||||
uni.$u.toast('根据相关政策,暂时禁用音频通话');
|
||||
//发送音频通话
|
||||
// this.chooseOrShotImage(["camera"]).then((paths) =>
|
||||
// this.batchCreateImageMesage(paths)
|
||||
// );
|
||||
}
|
||||
},
|
||||
chooseOrShotImage(sourceType) {
|
||||
@@ -222,9 +254,7 @@
|
||||
count: 9,
|
||||
sizeType: ["compressed"],
|
||||
sourceType,
|
||||
success: function({
|
||||
tempFilePaths
|
||||
}) {
|
||||
success: function({tempFilePaths}) {
|
||||
resolve(tempFilePaths);
|
||||
},
|
||||
fail: function(err) {
|
||||
@@ -236,9 +266,7 @@
|
||||
},
|
||||
|
||||
// keyboard
|
||||
keyboardChangeHander({
|
||||
height
|
||||
}) {
|
||||
keyboardChangeHander({height}) {
|
||||
if (height > 0) {
|
||||
if (this.actionBarVisible) {
|
||||
this.actionBarVisible = false;
|
||||
|
||||
@@ -1,39 +1,23 @@
|
||||
<template>
|
||||
<view class="chat_header">
|
||||
<view class="self_info">
|
||||
<my-avatar
|
||||
:src="storeSelfInfo.faceURL"
|
||||
:desc="storeSelfInfo.nickname"
|
||||
size="46"
|
||||
/>
|
||||
<my-avatar :src="storeSelfInfo.faceURL" :desc="storeSelfInfo.nickname" size="46" />
|
||||
<view class="self_info_desc">
|
||||
<view class="user_state">
|
||||
<text class="nickname">{{ storeSelfInfo.nickname }}</text>
|
||||
<view v-if="!storeReinstall">
|
||||
<view class="tag" v-if="storeIsSyncing">
|
||||
<img
|
||||
class="loading"
|
||||
style="height: 24rpx; width: 24rpx"
|
||||
src="static/images/loading.png"
|
||||
alt=""
|
||||
/>
|
||||
<img class="loading" style="height: 24rpx; width: 24rpx" src="static/images/loading.png"
|
||||
alt="" />
|
||||
<text class="status">同步中</text>
|
||||
</view>
|
||||
<view class="tag" v-if="connectStart == 0">
|
||||
<img
|
||||
class="loading"
|
||||
style="height: 24rpx; width: 24rpx"
|
||||
src="static/images/loading.png"
|
||||
alt=""
|
||||
/>
|
||||
<img class="loading" style="height: 24rpx; width: 24rpx" src="static/images/loading.png"
|
||||
alt="" />
|
||||
<text class="status">连接中</text>
|
||||
</view>
|
||||
<view class="err-tag" v-if="connectStart == -1">
|
||||
<img
|
||||
style="height: 24rpx; width: 24rpx"
|
||||
src="static/images/sync_error.png"
|
||||
alt=""
|
||||
/>
|
||||
<img style="height: 24rpx; width: 24rpx" src="static/images/sync_error.png" alt="" />
|
||||
<text class="status">连接失败</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -45,21 +29,9 @@
|
||||
<view @click="showMore" class="more_icon">
|
||||
<image src="@/static/images/common_circle_add.png"></image>
|
||||
</view>
|
||||
<u-overlay
|
||||
:show="moreMenuVisible"
|
||||
@click="moreMenuVisible = false"
|
||||
opacity="0"
|
||||
>
|
||||
<view
|
||||
:style="{ top: popMenuPosition.top, right: popMenuPosition.right }"
|
||||
class="more_menu"
|
||||
>
|
||||
<view
|
||||
@click="clickMenu(item)"
|
||||
v-for="item in moreMenus"
|
||||
:key="item.idx"
|
||||
class="menu_item"
|
||||
>
|
||||
<u-overlay :show="moreMenuVisible" @click="moreMenuVisible = false" opacity="0">
|
||||
<view :style="{ top: popMenuPosition.top, right: popMenuPosition.right }" class="more_menu">
|
||||
<view @click="clickMenu(item)" v-for="item in moreMenus" :key="item.idx" class="menu_item">
|
||||
<image :src="item.icon" mode=""></image>
|
||||
<text>{{ item.title }}</text>
|
||||
</view>
|
||||
@@ -70,10 +42,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
export default {
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
export default {
|
||||
name: "ChatHeader",
|
||||
components: {
|
||||
MyAvatar,
|
||||
@@ -87,8 +61,7 @@ export default {
|
||||
top: 0,
|
||||
right: 0,
|
||||
},
|
||||
moreMenus: [
|
||||
{
|
||||
moreMenus: [{
|
||||
idx: 1,
|
||||
title: "添加好友",
|
||||
icon: require("static/images/more_add_friend.png"),
|
||||
@@ -135,14 +108,12 @@ export default {
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnectSuccess, this.setStateSuccess);
|
||||
IMSDK.unsubscribe(IMSDK.IMEvents.OnConnectFailed, this.setStateError);
|
||||
},
|
||||
clickMenu({ idx }) {
|
||||
clickMenu({idx}) {
|
||||
switch (idx) {
|
||||
case 1:
|
||||
case 2:
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/searchUserOrGroup/index?isSearchGroup=${
|
||||
idx === 2
|
||||
}`,
|
||||
url: `/pages/common/searchUserOrGroup/index?isSearchGroup=${idx === 2}`,
|
||||
});
|
||||
break;
|
||||
case 3:
|
||||
@@ -155,7 +126,7 @@ export default {
|
||||
}
|
||||
},
|
||||
async showMore() {
|
||||
const { right, bottom } = await this.getEl(".more_icon");
|
||||
const {right,bottom} = await this.getEl(".more_icon");
|
||||
this.popMenuPosition.right =
|
||||
uni.getWindowInfo().windowWidth - right + "px";
|
||||
this.popMenuPosition.top = bottom + "px";
|
||||
@@ -174,11 +145,11 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@keyframes loading {
|
||||
@keyframes loading {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
@@ -186,9 +157,9 @@ export default {
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.chat_header {
|
||||
.chat_header {
|
||||
@include btwBox();
|
||||
padding: 36rpx 44rpx;
|
||||
margin-top: var(--status-bar-height);
|
||||
@@ -226,6 +197,7 @@ export default {
|
||||
background: #ffe1dd;
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
margin-left: 8rpx;
|
||||
|
||||
.status {
|
||||
font-size: 24rpx;
|
||||
margin-left: 8rpx;
|
||||
@@ -325,5 +297,5 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,34 +1,31 @@
|
||||
<template>
|
||||
<view @tap.prevent="clickConversationItem" class="conversation_item">
|
||||
<view class="pinned" v-if="source.isPinned"></view>
|
||||
<view @tap.prevent="clickConversationItem" :class="['conversation_item',source.isPinned?'pinned' : '']">
|
||||
<view class="left_info">
|
||||
<my-avatar :isGroup="isGroup" :isNotify="isNotify" :src="source.faceURL" :desc="source.showName"
|
||||
size="46" />
|
||||
<view class="details">
|
||||
<text class="conversation_name">{{ source.showName }}</text>
|
||||
<view class="lastest_msg_wrap">
|
||||
<text class="lastest_msg_content">{{ latestMessage }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="title">
|
||||
<text class="conversation_name">
|
||||
{{ source.showName }}
|
||||
</text>
|
||||
<view class="right_desc">
|
||||
<text class="send_time">{{ latestMessageTime }}</text>
|
||||
<u-badge max="99" :value="source.unreadCount"></u-badge>
|
||||
</view>
|
||||
</view>
|
||||
<view class="lastest_msg_wrap">
|
||||
<text class="lastest_msg_content">{{ latestMessage }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
SessionType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import {SessionType,} from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import UParse from "@/components/gaoyia-parse/parse.vue";
|
||||
import {
|
||||
getConversationContent,
|
||||
formatConversionTime,
|
||||
prepareConversationState,
|
||||
} from "@/util/imCommon";
|
||||
import {getConversationContent,formatConversionTime,prepareConversationState,} from "@/util/imCommon";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -81,6 +78,9 @@
|
||||
flex-direction: row;
|
||||
padding: 12rpx 44rpx 20rpx;
|
||||
position: relative;
|
||||
&.pinned{
|
||||
background-color: #ededed;
|
||||
}
|
||||
|
||||
&_active {
|
||||
background-color: #f3f3f3;
|
||||
@@ -88,17 +88,41 @@
|
||||
|
||||
.left_info {
|
||||
@include btwBox();
|
||||
flex:1;
|
||||
|
||||
.details {
|
||||
@include colBox(true);
|
||||
flex:1;
|
||||
margin-left: 24rpx;
|
||||
height: 46px;
|
||||
color: $uni-text-color;
|
||||
|
||||
border-bottom: 1px solid #eee;
|
||||
padding-bottom:20rpx;
|
||||
.title{
|
||||
@include btwBox();
|
||||
.conversation_name {
|
||||
@include nomalEllipsis();
|
||||
max-width: 40vw;
|
||||
font-size: 28rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.right_desc {
|
||||
@include colBox(true);
|
||||
align-items: flex-end;
|
||||
width: max-content;
|
||||
justify-content: space-between;
|
||||
|
||||
.send_time {
|
||||
width: max-content;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-badge {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.lastest_msg_wrap {
|
||||
@@ -125,32 +149,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.right_desc {
|
||||
@include colBox(true);
|
||||
align-items: flex-end;
|
||||
width: max-content;
|
||||
justify-content: space-between;
|
||||
height: 46px;
|
||||
|
||||
.send_time {
|
||||
width: max-content;
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-badge {
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
|
||||
.pinned {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 24rpx;
|
||||
width: 17rpx;
|
||||
height: 17rpx;
|
||||
background-image: linear-gradient(to bottom left, #314ffe 50%, white 50%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<view class="action_bar">
|
||||
<text>还没有账号?<text class="register" @click="toRegisterOrForget(true)">立即注册</text></text>
|
||||
<text style="margin-bottom: 16rpx" @click="copy">{{ v }}</text>
|
||||
<text style="margin-bottom: 16rpx" @click="copy">{{ appversion }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -62,7 +62,6 @@
|
||||
import { mapGetters } from "vuex";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import md5 from "md5";
|
||||
import { version } from '@/common/config'
|
||||
import { businessLogin, businessSendSms } from "@/api/login";
|
||||
import AreaPicker from "@/components/AreaPicker";
|
||||
import { checkLoginError } from "@/util/common";
|
||||
@@ -89,6 +88,7 @@
|
||||
areaCode: "86",
|
||||
verificationCode: "",
|
||||
},
|
||||
appversion:0,
|
||||
eying: false,
|
||||
loading: false,
|
||||
count: 0,
|
||||
@@ -97,12 +97,7 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"config",
|
||||
]),
|
||||
v() {
|
||||
return this.config.name+' '+version
|
||||
},
|
||||
...mapGetters(["config"]),
|
||||
canLogin() {
|
||||
return (
|
||||
(this.loginInfo.phoneNumber || this.loginInfo.email) &&
|
||||
@@ -111,16 +106,18 @@
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const _this = this;
|
||||
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
|
||||
console.log(inf);
|
||||
_this.appversion = inf.version
|
||||
});
|
||||
// if(options.isRedirect){
|
||||
// plus.navigator.closeSplashscreen();
|
||||
// }
|
||||
this.version = version
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
click({
|
||||
index
|
||||
}) {
|
||||
click({index}) {
|
||||
this.active = index;
|
||||
},
|
||||
copy() {
|
||||
@@ -164,14 +161,11 @@
|
||||
email: this.loginInfo.email,
|
||||
areaCode: `+${this.loginInfo.areaCode}`,
|
||||
password: this.isPwdLogin ? md5(this.loginInfo.password) : "",
|
||||
platform: uni.$u.os() === "ios" ? 1 : 2,
|
||||
platform: uni.$u.os(),
|
||||
type: this.active === 0 ? 'mobile' : 'email',
|
||||
code: this.loginInfo.verificationCode,
|
||||
});
|
||||
const {
|
||||
imToken,
|
||||
userID
|
||||
} = data;
|
||||
const {imToken,userID} = data;
|
||||
await IMSDK.asyncApi(IMSDK.IMMethods.Login, uuidv4(), {
|
||||
userID,
|
||||
token: imToken,
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
areaCode: `+${this.userInfo.areaCode}`,
|
||||
code: this.codeValue,
|
||||
password: this.formData.password,
|
||||
platform: uni.$u.os() === "ios" ? 1 : 2,
|
||||
platform: uni.$u.os(),
|
||||
operationID: Date.now() + "",
|
||||
};
|
||||
businessReset(options)
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</u-form>
|
||||
<view class="btn">
|
||||
<u-button :loading="loading" type="primary" @click="doNext">
|
||||
进入OpenIM
|
||||
进入{{config.name}}
|
||||
</u-button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -36,12 +36,9 @@
|
||||
<script>
|
||||
import md5 from "md5";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import {
|
||||
businessRegister
|
||||
} from "@/api/login";
|
||||
import {
|
||||
checkLoginError
|
||||
} from "@/util/common";
|
||||
import { mapGetters } from "vuex";
|
||||
import { businessRegister } from "@/api/login";
|
||||
import { checkLoginError } from "@/util/common";
|
||||
export default {
|
||||
components: {
|
||||
MyAvatar,
|
||||
@@ -100,19 +97,19 @@
|
||||
},
|
||||
};
|
||||
},
|
||||
computed:{
|
||||
...mapGetters(["config"]),
|
||||
},
|
||||
onLoad(options) {
|
||||
const {
|
||||
userInfo,
|
||||
codeValue
|
||||
} = options;
|
||||
const {userInfo,codeValue} = options;
|
||||
this.userInfo = {
|
||||
...this.userInfo,
|
||||
...JSON.parse(userInfo),
|
||||
};
|
||||
this.codeValue = codeValue;
|
||||
if(process.env.NODE_ENV == 'development'){
|
||||
this.userInfo.email = "commiu@outlook.com";
|
||||
this.userInfo.nickname = "commiu";
|
||||
//this.userInfo.email = "commiu@outlook.com";
|
||||
this.userInfo.nickname = "";
|
||||
this.userInfo.password = "qwe123";
|
||||
this.userInfo.confirmPassword = "qwe123";
|
||||
}
|
||||
@@ -135,12 +132,12 @@
|
||||
this.loading = true;
|
||||
const options = {
|
||||
code: this.codeValue,
|
||||
platform: uni.$u.os() === "ios" ? 1 : 2,
|
||||
platform: uni.$u.os(),
|
||||
autoLogin: true,
|
||||
...this.userInfo,
|
||||
areaCode: `+${this.userInfo.areaCode}`,
|
||||
password: md5(this.userInfo.password),
|
||||
mobile: `+${this.userInfo.phoneNumber}`,
|
||||
mobile: this.userInfo.phoneNumber
|
||||
};
|
||||
try {
|
||||
await businessRegister(options);
|
||||
|
||||
@@ -3,22 +3,20 @@
|
||||
<custom-nav-bar title="关于我们" />
|
||||
<view class="logo_area">
|
||||
<image src="@/static/images/about_logo.png" mode=""></image>
|
||||
<view>{{ v }}</view>
|
||||
<view>{{ appversion }}</view>
|
||||
|
||||
<info-item
|
||||
@click="show = true"
|
||||
class="check"
|
||||
title="上传调试日志"
|
||||
content=""
|
||||
/>
|
||||
<info-item @click="checkUpdate" class="check" title="检测更新" content="" />
|
||||
<info-item @click="openurl('http://baidu.com')" class="check" title="官方网站" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=coom&title=商务合作')" class="check" title="商务合作" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=contract&title=用户协议')" class="check" title="用户协议" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=privacy&title=隐私政策')" class="check" title="隐私政策" content="" />
|
||||
<info-item @click="goto('/pages/common/article?type=article&name=aboutus&title=关于我们')" class="check" title="关于我们" content="" />
|
||||
<info-item @click="clearcache" class="check" title="清除缓存" content="" />
|
||||
<info-item @click="show = true" class="check" title="上传调试日志" content="" />
|
||||
|
||||
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false" >
|
||||
<u-modal showCancelButton :show="show" title="上传日志" @confirm="uploadLog" @cancel="show = false">
|
||||
<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>
|
||||
</u-modal>
|
||||
</view>
|
||||
@@ -26,12 +24,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import { version } from '@/common/config'
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import { PageEvents } from "@/constant";
|
||||
import InfoItem from "../selfInfo/InfoItem.vue";
|
||||
export default {
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import {version } from '@/common/config'
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import {PageEvents } from "@/constant";
|
||||
import InfoItem from "../selfInfo/InfoItem.vue";
|
||||
import {checkUpgrade} from "@/api/login.js"
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
InfoItem,
|
||||
@@ -40,21 +39,12 @@ export default {
|
||||
return {
|
||||
show: false,
|
||||
line: 10000,
|
||||
version: "",
|
||||
appversion: "",
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
v(){
|
||||
return version
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getAppVersion();
|
||||
uni.$on(PageEvents.CheckForUpdateResp, this.checkRespHandler);
|
||||
},
|
||||
onUnload() {
|
||||
uni.$off(PageEvents.CheckForUpdateResp, this.checkRespHandler);
|
||||
},
|
||||
mounted() {
|
||||
IMSDK.subscribe('uploadLogsProgress', this.uploadHandler);
|
||||
@@ -65,23 +55,17 @@ export default {
|
||||
methods: {
|
||||
uploadLog() {
|
||||
this.show = false
|
||||
IMSDK.asyncApi(
|
||||
'uploadLogs',
|
||||
IMSDK.uuid(),
|
||||
{
|
||||
IMSDK.asyncApi('uploadLogs',IMSDK.uuid(), {
|
||||
line: this.line,
|
||||
ex: ""
|
||||
}
|
||||
)
|
||||
})
|
||||
uni.showLoading({
|
||||
title: '上传中',
|
||||
mask: true,
|
||||
});
|
||||
},
|
||||
uploadHandler({
|
||||
data: { current, size },
|
||||
}) {
|
||||
console.log('uploadHandler',current,size)
|
||||
uploadHandler({data: {current,size},}) {
|
||||
console.log('uploadHandler', current, size)
|
||||
if (current >= size) {
|
||||
uni.hideLoading();
|
||||
uni.showToast({
|
||||
@@ -92,24 +76,65 @@ export default {
|
||||
}
|
||||
},
|
||||
getAppVersion() {
|
||||
plus.runtime.getProperty(
|
||||
plus.runtime.appid,
|
||||
({ version }) => (this.appVersion = version),
|
||||
);
|
||||
},
|
||||
updateCheck() {
|
||||
this.loading = true;
|
||||
uni.$emit(PageEvents.CheckForUpdate, true);
|
||||
let system = uni.getSystemInfoSync();
|
||||
const _this = this;
|
||||
plus.runtime.getProperty(plus.runtime.appid,(inf) => {
|
||||
console.log(inf);
|
||||
_this.appversion = inf.version
|
||||
});
|
||||
},
|
||||
|
||||
checkRespHandler() {
|
||||
this.loading = false;
|
||||
},
|
||||
goto(url){
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
},
|
||||
};
|
||||
clearcache(){
|
||||
|
||||
},
|
||||
openurl(url){
|
||||
// #ifdef APP
|
||||
plus.runtime.openWeb(url)
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
window.open(url);
|
||||
// #endif
|
||||
},
|
||||
// 验证是否升级
|
||||
checkUpdate() {
|
||||
this.loading = true;
|
||||
const _this = this;
|
||||
let system = uni.getSystemInfoSync();
|
||||
plus.runtime.getProperty(plus.runtime.appid, function(inf) {
|
||||
checkUpgrade({version:system.appVersion,platform:system.platform,version_wgt:inf.versionCode}).then(res=>{
|
||||
_this.loading = false;
|
||||
if(!res.data){
|
||||
uni.showToast({
|
||||
title:"已经是最新版本"
|
||||
})
|
||||
return ;
|
||||
}
|
||||
let skip_version = uni.getStorageSync('skip_version')
|
||||
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"
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page_container {
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.logo_area {
|
||||
@@ -140,5 +165,5 @@ export default {
|
||||
.btn_row {
|
||||
padding: 0 44rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -86,17 +86,20 @@
|
||||
});
|
||||
},
|
||||
logoutConfirm() {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid())
|
||||
.then(() => {
|
||||
console.log(1)
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.Logout, IMSDK.uuid()).then(() => {
|
||||
console.log(2)
|
||||
uni.removeStorage({
|
||||
key: "IMToken",
|
||||
});
|
||||
uni.removeStorage({
|
||||
key: "BusinessToken",
|
||||
});
|
||||
})
|
||||
.catch((err) => console.log(err))
|
||||
.finally(() => {
|
||||
}).catch((err) => {
|
||||
console.log(3)
|
||||
console.log(err)
|
||||
}).finally(() => {
|
||||
console.log(4)
|
||||
uni.$u.route("/pages/login/index");
|
||||
});
|
||||
},
|
||||
|
||||
@@ -7,19 +7,14 @@
|
||||
<slot name="value">
|
||||
<text class="content">{{ content }}</text>
|
||||
</slot>
|
||||
<u-icon
|
||||
v-if="showArrow"
|
||||
name="arrow-right"
|
||||
size="16"
|
||||
color="#999"
|
||||
></u-icon>
|
||||
<u-icon v-if="showArrow" name="arrow-right" size="16" color="#999"></u-icon>
|
||||
</view>
|
||||
<u-loading-icon v-show="loading" class="loading_icon"></u-loading-icon>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
name: "",
|
||||
props: {
|
||||
title: String,
|
||||
@@ -41,11 +36,11 @@ export default {
|
||||
this.$emit("click");
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.info_item {
|
||||
.info_item {
|
||||
@include btwBox();
|
||||
height: 82rpx;
|
||||
padding: 0 44rpx;
|
||||
@@ -55,10 +50,12 @@ export default {
|
||||
|
||||
.right_value {
|
||||
@include vCenterBox();
|
||||
|
||||
.content {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.u-icon {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
@@ -70,5 +67,5 @@ export default {
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -3,71 +3,38 @@
|
||||
<custom-nav-bar title="个人资料" />
|
||||
|
||||
<view class="info_wrap">
|
||||
<info-item
|
||||
:loading="loadingState.faceURL"
|
||||
@click="updateAvatar"
|
||||
title="头像"
|
||||
>
|
||||
<my-avatar
|
||||
:src="selfInfo.faceURL"
|
||||
:desc="selfInfo.nickname"
|
||||
size="30"
|
||||
slot="value"
|
||||
/>
|
||||
<info-item :loading="loadingState.faceURL" @click="updateAvatar" title="头像">
|
||||
<my-avatar :src="selfInfo.faceURL" :desc="selfInfo.nickname" size="30" slot="value" />
|
||||
</info-item>
|
||||
<info-item
|
||||
@click="updateNickname"
|
||||
title="姓名"
|
||||
:content="selfInfo.nickname"
|
||||
/>
|
||||
<info-item
|
||||
:loading="loadingState.gender"
|
||||
@click="updateGender"
|
||||
title="性别"
|
||||
:content="getGender"
|
||||
/>
|
||||
<info-item
|
||||
:loading="loadingState.birth"
|
||||
@click="() => (showDatePicker = true)"
|
||||
title="生日"
|
||||
:content="getBirth"
|
||||
/>
|
||||
<info-item @click="updateNickname" title="姓名" :content="selfInfo.nickname" />
|
||||
<info-item :loading="loadingState.gender" @click="updateGender" title="性别" :content="getGender" />
|
||||
<info-item :loading="loadingState.birth" @click="() => (showDatePicker = true)" title="生日"
|
||||
:content="getBirth" />
|
||||
</view>
|
||||
|
||||
<view class="info_wrap">
|
||||
<info-item
|
||||
:showArrow="false"
|
||||
title="手机号码"
|
||||
:content="selfInfo.phoneNumber || '-'"
|
||||
/>
|
||||
<info-item
|
||||
:showArrow="false"
|
||||
title="邮箱"
|
||||
:content="selfInfo.email || '-'"
|
||||
/>
|
||||
<info-item :showArrow="false" title="手机号码" :content="selfInfo.mobile || '-'" />
|
||||
<info-item :showArrow="false" title="邮箱" :content="selfInfo.email || '-'" />
|
||||
</view>
|
||||
|
||||
<u-datetime-picker
|
||||
:minDate="0"
|
||||
:maxDate="nowDate"
|
||||
:show="showDatePicker"
|
||||
@confirm="confirmDate"
|
||||
@cancel="() => (showDatePicker = false)"
|
||||
v-model="selfInfo.birth"
|
||||
mode="date"
|
||||
/>
|
||||
<u-datetime-picker :minDate="0" :maxDate="nowDate" :show="showDatePicker" @confirm="confirmDate"
|
||||
@cancel="() => (showDatePicker = false)" v-model="selfInfo.birth" mode="date" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { businessInfoUpdate } from "@/api/login";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import dayjs from "dayjs";
|
||||
import InfoItem from "./InfoItem.vue";
|
||||
import { getPurePath } from "@/util/common";
|
||||
export default {
|
||||
import {
|
||||
businessInfoUpdate
|
||||
} from "@/api/login";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import dayjs from "dayjs";
|
||||
import InfoItem from "./InfoItem.vue";
|
||||
import {
|
||||
getPurePath
|
||||
} from "@/util/common";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
MyAvatar,
|
||||
@@ -89,16 +56,17 @@ export default {
|
||||
return this.$store.getters.storeSelfInfo;
|
||||
},
|
||||
getGender() {
|
||||
if (this.selfInfo.gender === 0) {
|
||||
if (this.selfInfo.sex === 0) {
|
||||
return "保密";
|
||||
}
|
||||
if (this.selfInfo.gender === 1) {
|
||||
if (this.selfInfo.sex === 1) {
|
||||
return "男";
|
||||
}
|
||||
return "女";
|
||||
},
|
||||
getBirth() {
|
||||
const birth = this.selfInfo.birth ?? 0;
|
||||
console.log(this.selfInfo);
|
||||
const birth = this.selfInfo.birthday ?? 0;
|
||||
return dayjs(birth).format("YYYY-MM-DD");
|
||||
},
|
||||
},
|
||||
@@ -112,15 +80,12 @@ export default {
|
||||
},
|
||||
updateGender() {
|
||||
uni.showActionSheet({
|
||||
itemList: ["男", "女"],
|
||||
success: async ({ tapIndex }) => {
|
||||
itemList: ['保密',"男", "女"],
|
||||
success: async ({
|
||||
tapIndex
|
||||
}) => {
|
||||
this.loadingState.gender = true;
|
||||
await this.updateSelfInfo(
|
||||
{
|
||||
gender: tapIndex + 1,
|
||||
},
|
||||
"gender",
|
||||
);
|
||||
await this.updateSelfInfo({gender: tapIndex,},"gender",);
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -128,7 +93,9 @@ export default {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
success: async ({ tempFilePaths }) => {
|
||||
success: async ({
|
||||
tempFilePaths
|
||||
}) => {
|
||||
const path = tempFilePaths[0];
|
||||
const nameIdx = path.lastIndexOf("/") + 1;
|
||||
const typeIdx = path.lastIndexOf(".") + 1;
|
||||
@@ -136,7 +103,9 @@ export default {
|
||||
const fileType = path.slice(typeIdx);
|
||||
this.loadingState.faceURL = true;
|
||||
const {
|
||||
data: { url },
|
||||
data: {
|
||||
url
|
||||
},
|
||||
} = await IMSDK.asyncApi(IMSDK.IMMethods.UploadFile, IMSDK.uuid(), {
|
||||
filepath: getPurePath(tempFilePaths[0]),
|
||||
name: fileName,
|
||||
@@ -144,8 +113,7 @@ export default {
|
||||
uuid: IMSDK.uuid(),
|
||||
});
|
||||
console.log(url);
|
||||
this.updateSelfInfo(
|
||||
{
|
||||
this.updateSelfInfo({
|
||||
faceURL: url,
|
||||
},
|
||||
"faceURL",
|
||||
@@ -172,6 +140,7 @@ export default {
|
||||
},
|
||||
async updateSelfInfo(data, key) {
|
||||
try {
|
||||
console.log(data);
|
||||
await businessInfoUpdate({
|
||||
userID: this.selfInfo.userID,
|
||||
...data,
|
||||
@@ -184,22 +153,17 @@ export default {
|
||||
}
|
||||
this.loadingState[key] = false;
|
||||
},
|
||||
confirmDate({ value }) {
|
||||
confirmDate({value}) {
|
||||
this.loadingState.birth = true;
|
||||
this.updateSelfInfo(
|
||||
{
|
||||
birth: value,
|
||||
},
|
||||
"birth",
|
||||
);
|
||||
this.updateSelfInfo({birth: value,},"birth",);
|
||||
this.showDatePicker = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page_container {
|
||||
.page_container {
|
||||
background-color: #f8f8f8;
|
||||
|
||||
.info_wrap {
|
||||
@@ -212,5 +176,5 @@ export default {
|
||||
height: 23px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,31 +1,270 @@
|
||||
<template>
|
||||
<web-view :src="linkUrl"></web-view>
|
||||
<view class="content">
|
||||
<u-navbar :is-back="false" title="发现" :background="{ background: '#f4f4f5' }" title-color="#404133"
|
||||
:title-bold="true" title-size="34" :border-bottom="false" z-index="1001">
|
||||
</u-navbar>
|
||||
<view style="background-color: #FFFFFF;">
|
||||
<view>
|
||||
<u-cell-item title="" :title-style="titleStyle" :border-bottom="showBorder(0)" :border-top="false"
|
||||
@tap="linkTo(cellList[0])">
|
||||
<u-icon class="u-m-r-10" slot="icon" name="/static/image/workbench/01.png" color="inherit" :size="44"></u-icon>
|
||||
<view slot="title" class="u-flex u-row-left u-col-center" style="min-width: 200rpx;">
|
||||
<view class="u-m-r-20">
|
||||
<text>朋友圈</text>
|
||||
</view>
|
||||
<view class="u-flex u-row-center u-col-center" v-if="vuex_friendCircleUnreadCount>0"
|
||||
style="width:36rpx;height:36rpx;background-color:#fa3534;border-radius:18rpx;font-size:28rpx;color: #ffffff;">
|
||||
<text>{{vuex_friendCircleUnreadCount}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view slot="right-icon" v-if="newCircleInfo&&newCircleInfo.userHeadImg.length>0">
|
||||
<u-avatar :src="newCircleInfo.userHeadImg" mode="square" :size="70"></u-avatar>
|
||||
<u-badge :is-dot="true" type="error" :offset="[20,60]"></u-badge>
|
||||
</view>
|
||||
</u-cell-item>
|
||||
<u-gap :height="16" bg-color="#f4f4f5" v-if="showGap(0)"></u-gap>
|
||||
</view>
|
||||
|
||||
|
||||
<view v-for="(item,index) in cellList" :key="index">
|
||||
<template v-if="item.hidden==false&&index!=0">
|
||||
<u-cell-item :title="item.title" :title-style="titleStyle"
|
||||
:border-bottom="showBorder(index)" :border-top="false"
|
||||
@tap="linkTo(item)">
|
||||
<u-icon :class="item.title=='购物'?'u-m-l-6 u-m-r-10':'u-m-r-10'"
|
||||
slot="icon" :name="item.icon" :color="item.color" :size="item.size"></u-icon>
|
||||
</u-cell-item>
|
||||
<u-gap :height="16" bg-color="#f4f4f5" v-if="showGap(index)"></u-gap>
|
||||
</template>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
linkUrl: "",
|
||||
cellList: [
|
||||
{
|
||||
id: 1,
|
||||
title: "朋友圈",
|
||||
icon: "/static/image/workbench/01.png",
|
||||
color: "inherit",
|
||||
bind: "/pages/workbench/friend-circle/friend-circle",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
title: "扫一扫",
|
||||
//icon: "/static/image/wx/saoyisao.png",
|
||||
icon: "/static/image/workbench/04.png",
|
||||
color: "#409eff",
|
||||
bind: "scan",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
title: "摇一摇",
|
||||
//icon: "/static/image/wx/yaoyiyao.png",
|
||||
icon: "/static/image/workbench/05.png",
|
||||
color: "#409eff",
|
||||
bind: "/pages/tabbar/find/yaoyiyao/yyy-index",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
title: "看一看",
|
||||
icon: "/static/image/workbench/06.png",
|
||||
color: "#f29100",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 13,
|
||||
title: "附近",
|
||||
icon: "/static/image/workbench/08.png",
|
||||
color: "#fab6b6",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 14,
|
||||
title: "购物",
|
||||
icon: "/static/image/workbench/09.png",
|
||||
color: "#fab6b6",
|
||||
bind: "taobao",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 15,
|
||||
title: "游戏",
|
||||
icon: "/static/image/workbench/10.png",
|
||||
color: "#fab6b6",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
title: "小程序",
|
||||
//icon: "/static/image/wx/xiaochengxu.png",
|
||||
icon: "/static/image/workbench/11.png",
|
||||
color: "#fab6b6",
|
||||
bind: "",
|
||||
hidden:false,
|
||||
size:44,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
title: "ChatGpt",
|
||||
icon: "/static/image/find/chatgpt.png",
|
||||
color: "#ff9900",
|
||||
bind: "/pages/tabbar/group/chat/chat-gpt-conversion-wss",
|
||||
hidden:true,
|
||||
size:64,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
title: "AI绘画",
|
||||
icon: "http://open.yjai.art/assets/logo-9a019aa3.svg",
|
||||
color: "#ff9900",
|
||||
bind: "/pages/tabbar/find/AI/ai-text-to-create-img/ai-text-to-create-img",
|
||||
hidden:true,
|
||||
size:64,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
title: "免费听歌",
|
||||
icon: "/static/image/find/MP3.png",
|
||||
color: "#19BE6B",
|
||||
bind: "/pages/tabbar/find/music/free-music",
|
||||
hidden:true,
|
||||
size:64,
|
||||
}
|
||||
],
|
||||
titleStyle: {
|
||||
marginLeft: "20rpx",
|
||||
fontSize: "34rpx",
|
||||
color: "#000000"
|
||||
},
|
||||
newCircleInfo: {
|
||||
userHeadImg:""
|
||||
},
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.linkUrl = 'https://doc.rentsoft.cn/'
|
||||
onShow: function() {
|
||||
this.changeDefaultAvatar(1,10);
|
||||
let unreadCount= 1;//this.vuex_friendCircleUnreadCount+"";
|
||||
this.localGroupApi.setTabBarBadge(2,unreadCount);
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP-PLUS
|
||||
setTimeout(() => {
|
||||
this.$scope
|
||||
.$getAppWebview()
|
||||
.children()[0]
|
||||
.setStyle({
|
||||
top: uni.getWindowInfo().statusBarHeight,
|
||||
height: uni.getWindowInfo().safeArea.height,
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
methods: {
|
||||
changeDefaultAvatar:function(min,max){
|
||||
let that=this;
|
||||
that.$u.api.friendCircle.checkFriendCircleUpdate().then(res => {
|
||||
if(res.code==200){
|
||||
console.log("查询朋友圈更新情况",res.data);
|
||||
if(res.data&&res.data.length>0){
|
||||
that.newCircleInfo=res.data[0];
|
||||
}else{
|
||||
that.newCircleInfo=null;
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
};
|
||||
|
||||
showBorder(index){
|
||||
switch (index){
|
||||
case 1:
|
||||
return true;
|
||||
case 3:
|
||||
return true;
|
||||
case 5:
|
||||
return true;
|
||||
case 8:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
showGap(index){
|
||||
switch (index){
|
||||
case 0:
|
||||
return true;
|
||||
case 2:
|
||||
return true;
|
||||
case 4:
|
||||
return true;
|
||||
case 6:
|
||||
return true;
|
||||
case 7:
|
||||
return true;
|
||||
case 9:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
},
|
||||
linkTo(item) {
|
||||
let that = this;
|
||||
let url = item.bind;
|
||||
console.log("跳转链接", url);
|
||||
if (url != null && url.length > 0) {
|
||||
if (url == 'taobao') {
|
||||
if (plus.os.name == 'Android') {
|
||||
plus.runtime.launchApplication({
|
||||
pname: 'com.taobao.taobao'
|
||||
},
|
||||
function(e) {
|
||||
console.log('Open system default browser failed: ' + e.message);
|
||||
}
|
||||
);
|
||||
} else if (plus.os.name == 'iOS') {
|
||||
//抖音 snssdk1128://
|
||||
plus.runtime.launchApplication({
|
||||
action: 'snssdk1128://'
|
||||
}, function(e) {
|
||||
console.log('Open system default browser failed: ' + e.message);
|
||||
});
|
||||
}
|
||||
} else if (url == "scan") {
|
||||
this.globalUtil.scanQRcode(that, {
|
||||
complete: function(res) {
|
||||
console.log("扫码结果", res);
|
||||
if (res.resp_code == 1000) {
|
||||
let respData = res.resp_result;
|
||||
that.$u.route({
|
||||
url: '/pages/chat/qr-info/qr-info',
|
||||
params: {
|
||||
qrInfo: respData
|
||||
},
|
||||
animationType: 'slide-in-bottom'
|
||||
});
|
||||
}
|
||||
},
|
||||
})
|
||||
} else {
|
||||
console.log("url", url);
|
||||
this.$u.route(url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss" scoped>
|
||||
.content {}
|
||||
</style>
|
||||
<style>
|
||||
page {
|
||||
background-color: #f4f4f5 !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 8.7 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 8.5 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
@@ -1,6 +1,4 @@
|
||||
import {
|
||||
v4 as uuidv4
|
||||
} from "uuid";
|
||||
import {v4 as uuidv4} from "uuid";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
|
||||
const state = {
|
||||
@@ -46,14 +44,9 @@ const mutations = {
|
||||
};
|
||||
|
||||
const actions = {
|
||||
async getConversationList({
|
||||
state,
|
||||
commit
|
||||
}, isFirstPage = true) {
|
||||
async getConversationList({state,commit}, isFirstPage = true) {
|
||||
try {
|
||||
const {
|
||||
data
|
||||
} = await IMSDK.asyncApi(
|
||||
const {data} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetConversationListSplit,
|
||||
uuidv4(), {
|
||||
offset: isFirstPage ? 0 : state.conversationList.length,
|
||||
@@ -71,9 +64,7 @@ const actions = {
|
||||
return [];
|
||||
}
|
||||
},
|
||||
getCurrentGroup({
|
||||
commit
|
||||
}, groupID) {
|
||||
getCurrentGroup({commit}, groupID) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetSpecifiedGroupsInfo, uuidv4(), [
|
||||
groupID,
|
||||
]).then(({
|
||||
@@ -82,10 +73,7 @@ const actions = {
|
||||
commit("SET_CURRENT_GROUP", data[0] ?? {});
|
||||
});
|
||||
},
|
||||
getCurrentMemberInGroup({
|
||||
commit,
|
||||
rootState
|
||||
}, groupID) {
|
||||
getCurrentMemberInGroup({commit,rootState}, groupID) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetSpecifiedGroupMembersInfo, uuidv4(), {
|
||||
groupID,
|
||||
userIDList: [rootState.user.selfInfo.userID],
|
||||
@@ -95,20 +83,15 @@ const actions = {
|
||||
commit("SET_CURRENT_MEMBER_IN_GROUP", data[0] ?? {});
|
||||
});
|
||||
},
|
||||
getUnReadCount({
|
||||
commit
|
||||
}) {
|
||||
getUnReadCount({commit}) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetTotalUnreadMsgCount, uuidv4()).then(
|
||||
(res) => {
|
||||
console.log(res);
|
||||
//console.log(res);
|
||||
commit("SET_UNREAD_COUNT", res.data);
|
||||
},
|
||||
);
|
||||
},
|
||||
updateCurrentMemberInGroup({
|
||||
commit,
|
||||
state
|
||||
}, memberInfo) {
|
||||
updateCurrentMemberInGroup({commit,state}, memberInfo) {
|
||||
console.log(memberInfo);
|
||||
if (
|
||||
memberInfo.groupID === state.currentMemberInGroup.groupID &&
|
||||
|
||||
@@ -48,19 +48,13 @@ const actions = {
|
||||
commit
|
||||
}) {
|
||||
try {
|
||||
const {
|
||||
data
|
||||
} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetSelfUserInfo,
|
||||
uuidv4(),
|
||||
);
|
||||
const res = await businessGetUserInfo(data.userID);
|
||||
//console.log(res.data);
|
||||
const result = await IMSDK.asyncApi(IMSDK.IMMethods.GetSelfUserInfo,uuidv4(),);
|
||||
const res = await businessGetUserInfo(result.data.userID);
|
||||
|
||||
const businessData = res.data[0] ?? {};
|
||||
filterEmptyValue(businessData);
|
||||
commit("SET_SELF_INFO", {
|
||||
...data,
|
||||
...result.data,
|
||||
...businessData,
|
||||
});
|
||||
} catch (e) {
|
||||
|
||||
@@ -11,7 +11,9 @@ import IMSDK, {
|
||||
SessionType,
|
||||
} from "openim-uniapp-polyfill";
|
||||
import dayjs from "dayjs";
|
||||
import { isThisYear } from "date-fns";
|
||||
import {
|
||||
isThisYear
|
||||
} from "date-fns";
|
||||
|
||||
import calendar from "dayjs/plugin/calendar";
|
||||
import relativeTime from "dayjs/plugin/relativeTime";
|
||||
@@ -60,13 +62,13 @@ export const conversationSort = (conversationList) => {
|
||||
filterArr.sort((a, b) => {
|
||||
if (a.isPinned === b.isPinned) {
|
||||
const aCompare =
|
||||
a.draftTextTime > a.latestMsgSendTime
|
||||
? a.draftTextTime
|
||||
: a.latestMsgSendTime;
|
||||
a.draftTextTime > a.latestMsgSendTime ?
|
||||
a.draftTextTime :
|
||||
a.latestMsgSendTime;
|
||||
const bCompare =
|
||||
b.draftTextTime > b.latestMsgSendTime
|
||||
? b.draftTextTime
|
||||
: b.latestMsgSendTime;
|
||||
b.draftTextTime > b.latestMsgSendTime ?
|
||||
b.draftTextTime :
|
||||
b.latestMsgSendTime;
|
||||
if (aCompare > bCompare) {
|
||||
return -1;
|
||||
} else if (aCompare < bCompare) {
|
||||
@@ -118,9 +120,9 @@ export const sec2Time = (seconds) => {
|
||||
|
||||
export const parseMessageByType = (pmsg) => {
|
||||
const getName = (user) => {
|
||||
return user.userID === store.getters.storeCurrentUserID
|
||||
? "你"
|
||||
: user.nickname;
|
||||
return user.userID === store.getters.storeCurrentUserID ?
|
||||
"你" :
|
||||
user.nickname;
|
||||
};
|
||||
|
||||
switch (pmsg.contentType) {
|
||||
@@ -319,17 +321,14 @@ export const prepareConversationState = (conversation, back2Tab = false) => {
|
||||
}, 300)
|
||||
};
|
||||
|
||||
export const navigateToDesignatedConversation = (
|
||||
sourceID,
|
||||
sessionType,
|
||||
back2Tab = false,
|
||||
) => {
|
||||
export const navigateToDesignatedConversation = (sourceID,sessionType,back2Tab = false,) => {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const { data } = await IMSDK.asyncApi(
|
||||
const {
|
||||
data
|
||||
} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetOneConversation,
|
||||
IMSDK.uuid(),
|
||||
{
|
||||
IMSDK.uuid(), {
|
||||
sessionType,
|
||||
sourceID,
|
||||
},
|
||||
|
||||