app
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// const API_URL = `http://${BASE_HOST}:10002`
|
||||
// const WS_URL = `ws://${BASE_HOST}:10001`
|
||||
|
||||
const BASE_DOMAIN = '110.42.52.196'
|
||||
const BASE_DOMAIN = '156.238.245.175'
|
||||
// const CHAT_URL = `https://${BASE_DOMAIN}/chat`
|
||||
// const API_URL = `https://${BASE_DOMAIN}/api`
|
||||
// const WS_URL = `wss://${BASE_DOMAIN}/msg_gateway`
|
||||
|
||||
+1
-2
@@ -253,8 +253,7 @@
|
||||
"borderStyle": "black",
|
||||
"backgroundColor": "#ffffff",
|
||||
"height": "55px",
|
||||
"list": [
|
||||
{
|
||||
"list": [{
|
||||
"pagePath": "pages/conversation/conversationList/index",
|
||||
"iconPath": "./static/images/tabbar_conversation.png",
|
||||
"selectedIconPath": "static/images/tabbar_conversation_active.png",
|
||||
|
||||
@@ -3,15 +3,8 @@
|
||||
<custom-nav-bar :route="false">
|
||||
<view slot="left"> </view>
|
||||
<view class="search_bar" slot="center">
|
||||
<u-search
|
||||
actionText="取消"
|
||||
@change="keywordChange"
|
||||
@custom="cancel"
|
||||
@search="startSearch"
|
||||
shape="square"
|
||||
:placeholder="getPlaceholder"
|
||||
v-model="keyword"
|
||||
/>
|
||||
<u-search actionText="取消" @change="keywordChange" @custom="cancel" @search="startSearch" shape="square"
|
||||
:placeholder="getPlaceholder" v-model="keyword" />
|
||||
</view>
|
||||
</custom-nav-bar>
|
||||
|
||||
@@ -34,14 +27,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
|
||||
import searchGroup from "static/images/contact_add_join_group_fill.png";
|
||||
import searchUser from "static/images/contact_add_search_user_fill.png";
|
||||
import { businessSearchUserInfo } from "@/api/login";
|
||||
import searchGroup from "static/images/contact_add_join_group_fill.png";
|
||||
import searchUser from "static/images/contact_add_search_user_fill.png";
|
||||
import {
|
||||
businessSearchUserInfo
|
||||
} from "@/api/login";
|
||||
|
||||
export default {
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
},
|
||||
@@ -62,7 +57,7 @@ export default {
|
||||
},
|
||||
},
|
||||
onLoad(options) {
|
||||
const { isSearchGroup } = options;
|
||||
const {isSearchGroup} = options;
|
||||
this.isSearchGroup = JSON.parse(isSearchGroup);
|
||||
},
|
||||
methods: {
|
||||
@@ -84,7 +79,7 @@ export default {
|
||||
(item) => item.groupID === value,
|
||||
);
|
||||
if (!info) {
|
||||
const { data } = await IMSDK.asyncApi(
|
||||
const {data} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetSpecifiedGroupsInfo,
|
||||
IMSDK.uuid(),
|
||||
[value],
|
||||
@@ -93,9 +88,7 @@ export default {
|
||||
}
|
||||
if (info) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/groupCard/index?sourceInfo=${JSON.stringify(
|
||||
info,
|
||||
)}`,
|
||||
url: `/pages/common/groupCard/index?sourceInfo=${JSON.stringify(info,)}`,
|
||||
});
|
||||
} else {
|
||||
this.empty = true;
|
||||
@@ -105,9 +98,9 @@ export default {
|
||||
(item) => item.userID === value,
|
||||
);
|
||||
if (!info) {
|
||||
const { total, users } = await businessSearchUserInfo(value);
|
||||
const {total,users} = await businessSearchUserInfo(value);
|
||||
if (total > 0) {
|
||||
const { data } = await IMSDK.asyncApi(
|
||||
const {data} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetUsersInfo,
|
||||
IMSDK.uuid(),
|
||||
[users[0].userID],
|
||||
@@ -122,9 +115,7 @@ export default {
|
||||
}
|
||||
if (info) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/userCard/index?sourceInfo=${JSON.stringify(
|
||||
info,
|
||||
)}`,
|
||||
url: `/pages/common/userCard/index?sourceInfo=${JSON.stringify(info,)}`,
|
||||
});
|
||||
} else {
|
||||
this.empty = true;
|
||||
@@ -136,11 +127,11 @@ export default {
|
||||
this.searching = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.search_container {
|
||||
.search_container {
|
||||
height: 100vh;
|
||||
background-color: #f8f8f8;
|
||||
|
||||
@@ -168,5 +159,5 @@ export default {
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -5,7 +5,8 @@
|
||||
|
||||
<view v-if="!isLoading" style="flex: 1;display: flex;flex-direction: column;">
|
||||
<view class="base_info">
|
||||
<my-avatar :desc="sourceUserInfo.remark || sourceUserInfo.nickname" :src="sourceUserInfo.faceURL" size="46" />
|
||||
<my-avatar :desc="sourceUserInfo.remark || sourceUserInfo.nickname" :src="sourceUserInfo.faceURL"
|
||||
size="46" />
|
||||
<view class="user_name">
|
||||
<text class="text">{{ getShowName }}</text>
|
||||
<text class="id" @click="copy(sourceUserInfo.userID)">{{sourceUserInfo.userID}}</text>
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
<text class="nickname">{{ selfInfo.nickname }}</text>
|
||||
<view class="id_row_copy" @click="copy">
|
||||
<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>
|
||||
|
||||
@@ -24,12 +20,8 @@
|
||||
</view>
|
||||
|
||||
<view class="action_box">
|
||||
<view
|
||||
@click="profileMenuClick(item)"
|
||||
class="profile_menu_item"
|
||||
v-for="item in profileMenus"
|
||||
:key="item.idx"
|
||||
>
|
||||
<view @click="profileMenuClick(item)" class="profile_menu_item" v-for="item in profileMenus"
|
||||
:key="item.idx">
|
||||
<view class="menu_left">
|
||||
<image style="width: 48rpx; height: 48rpx" :src="item.icon" mode="" />
|
||||
<text>{{ item.title }}</text>
|
||||
@@ -43,16 +35,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
export default {
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
export default {
|
||||
components: {
|
||||
MyAvatar,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
profileMenus: [
|
||||
{
|
||||
profileMenus: [{
|
||||
idx: 0,
|
||||
title: "我的信息",
|
||||
icon: require("static/images/profile_menu_info.png"),
|
||||
@@ -82,10 +73,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
copy() {
|
||||
console.log(this.selfInfo)
|
||||
uni.setClipboardData({
|
||||
showToast: false,
|
||||
data: this.selfInfo.userID,
|
||||
success: function () {
|
||||
success: function() {
|
||||
uni.showToast({
|
||||
icon: "none",
|
||||
title: "复制成功",
|
||||
@@ -108,7 +100,7 @@ export default {
|
||||
uni.$u.route("/pages/login/index");
|
||||
});
|
||||
},
|
||||
profileMenuClick({ idx }) {
|
||||
profileMenuClick({idx}) {
|
||||
switch (idx) {
|
||||
case 0:
|
||||
uni.navigateTo({
|
||||
@@ -153,11 +145,11 @@ export default {
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page_container {
|
||||
.page_container {
|
||||
background-color: #f8f9fa;
|
||||
|
||||
.self_info_row {
|
||||
@@ -234,5 +226,5 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,4 +1,6 @@
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import {
|
||||
v4 as uuidv4
|
||||
} from "uuid";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
|
||||
const state = {
|
||||
@@ -46,10 +48,11 @@ const mutations = {
|
||||
const actions = {
|
||||
async getConversationList({ state, commit }, isFirstPage = true) {
|
||||
try {
|
||||
const { data } = await IMSDK.asyncApi(
|
||||
const {
|
||||
data
|
||||
} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetConversationListSplit,
|
||||
uuidv4(),
|
||||
{
|
||||
uuidv4(), {
|
||||
offset: isFirstPage ? 0 : state.conversationList.length,
|
||||
count: 500,
|
||||
},
|
||||
@@ -68,7 +71,9 @@ const actions = {
|
||||
getCurrentGroup({ commit }, groupID) {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetSpecifiedGroupsInfo, uuidv4(), [
|
||||
groupID,
|
||||
]).then(({ data }) => {
|
||||
]).then(({
|
||||
data
|
||||
}) => {
|
||||
commit("SET_CURRENT_GROUP", data[0] ?? {});
|
||||
});
|
||||
},
|
||||
@@ -76,7 +81,9 @@ const actions = {
|
||||
IMSDK.asyncApi(IMSDK.IMMethods.GetSpecifiedGroupMembersInfo, uuidv4(), {
|
||||
groupID,
|
||||
userIDList: [rootState.user.selfInfo.userID],
|
||||
}).then(({ data }) => {
|
||||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
commit("SET_CURRENT_MEMBER_IN_GROUP", data[0] ?? {});
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import { v4 as uuidv4} from "uuid";
|
||||
import IMSDK from "openim-uniapp-polyfill";
|
||||
import { businessGetUserInfo } from "@/api/login";
|
||||
import { filterEmptyValue } from "@/util/common";
|
||||
import { businessGetUserInfo} from "@/api/login";
|
||||
import { filterEmptyValue} from "@/util/common";
|
||||
|
||||
const state = {
|
||||
selfInfo: {},
|
||||
@@ -36,11 +36,14 @@ const mutations = {
|
||||
const actions = {
|
||||
async getSelfInfo({ commit }) {
|
||||
try {
|
||||
const { data } = await IMSDK.asyncApi(
|
||||
const {
|
||||
data
|
||||
} = await IMSDK.asyncApi(
|
||||
IMSDK.IMMethods.GetSelfUserInfo,
|
||||
uuidv4(),
|
||||
);
|
||||
const { users } = await businessGetUserInfo(data.userID);
|
||||
const {users} = await businessGetUserInfo(data.userID);
|
||||
console.log(users);
|
||||
const businessData = users[0] ?? {};
|
||||
filterEmptyValue(businessData);
|
||||
commit("SET_SELF_INFO", {
|
||||
@@ -52,9 +55,14 @@ const actions = {
|
||||
uni.$u.toast("获取个人信息失败");
|
||||
}
|
||||
},
|
||||
async updateBusinessInfo({ commit, state }) {
|
||||
async updateBusinessInfo({
|
||||
commit,
|
||||
state
|
||||
}) {
|
||||
try {
|
||||
const { users } = await businessGetUserInfo(state.selfInfo.userID);
|
||||
const {
|
||||
users
|
||||
} = await businessGetUserInfo(state.selfInfo.userID);
|
||||
const businessData = users[0] ?? {};
|
||||
filterEmptyValue(businessData);
|
||||
commit("SET_SELF_INFO", {
|
||||
|
||||
Reference in New Issue
Block a user