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