22
This commit is contained in:
@@ -1,20 +1,29 @@
|
||||
<script>
|
||||
import {mapGetters,mapActions} from "vuex";
|
||||
// #ifdef APP
|
||||
import IMSDK, {IMMethods,MessageType,SessionType,} from "openim-uniapp-polyfill";
|
||||
// #endif
|
||||
import config from "@/common/config";
|
||||
import {getDbDir,toastWithCallback} from "@/util/common.js";
|
||||
import {getConversationContent,conversationSort,prepareConversationState} from "@/util/imCommon";
|
||||
import {getConversationContent,conversationSort,prepareConversationState,updateTabbar} from "@/util/imCommon";
|
||||
import {PageEvents,UpdateMessageTypes} from "@/constant";
|
||||
import checkUpgrade from "@/util/app_update.js"
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
// #ifndef APP
|
||||
this.$store.dispatch("system/getConfig");
|
||||
// #ifdef APP
|
||||
plus.screen.lockOrientation("portrait-primary");
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
//screen.orientation.type = "";
|
||||
screen.orientation.lock('portrait');
|
||||
// #endif
|
||||
// #ifndef MP
|
||||
console.error(
|
||||
`暂时不支持运行到 Web或小程序端,如果需要移动端的 Web 项目,参考 [H5 demo](https://github.com/openimsdk/openim-h5-demo)`
|
||||
`暂时不支持运行到小程序端`
|
||||
);
|
||||
return ;
|
||||
// #endif
|
||||
this.$store.dispatch("system/getConfig");
|
||||
this.init();
|
||||
},
|
||||
onShow: function() {
|
||||
@@ -43,8 +52,26 @@
|
||||
"storeIsSyncing",
|
||||
"storeGroupList",
|
||||
"config",
|
||||
'storeUnHandleFriendApplicationNum',
|
||||
'storeUnHandleGroupApplicationNum',
|
||||
'storeUnReadCount',
|
||||
'storeCircleUnreadCount'
|
||||
]),
|
||||
},
|
||||
watch:{
|
||||
storeUnReadCount(){
|
||||
updateTabbar(0);
|
||||
},
|
||||
storeUnHandleFriendApplicationNum(){
|
||||
updateTabbar(1);
|
||||
},
|
||||
storeUnHandleGroupApplicationNum(){
|
||||
updateTabbar(1);
|
||||
},
|
||||
storeCircleUnreadCount(){
|
||||
updateTabbar(2);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapActions("message", ["pushNewMessage", "updateOneMessage"]),
|
||||
...mapActions("conversation", ["updateCurrentMemberInGroup"]),
|
||||
@@ -74,7 +101,7 @@
|
||||
// #endif
|
||||
}else{
|
||||
plus.navigator.closeSplashscreen();
|
||||
uni.$u.route("/pages/common/login/index");
|
||||
//uni.$u.route("/pages/common/login/index");
|
||||
}
|
||||
},
|
||||
setGlobalIMlistener() {
|
||||
@@ -231,6 +258,7 @@
|
||||
}
|
||||
};
|
||||
const friendApplicationAccessHandler = ({data}) => {
|
||||
console.log(data);
|
||||
const isRecv = data.toUserID === this.storeCurrentUserID;
|
||||
if (isRecv) {
|
||||
this.updateRecvFriendApplition({
|
||||
@@ -509,7 +537,6 @@
|
||||
url: "/pages/conversation/conversationList/index?isRedirect=true",
|
||||
complete() {
|
||||
_this.keppAlive();
|
||||
plus.navigator.closeSplashscreen();
|
||||
_this.checkUpdate();
|
||||
},
|
||||
fail(e){
|
||||
@@ -573,6 +600,7 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/static/imfont/iconfont.css";
|
||||
/*每个页面公共css */
|
||||
text,view{
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||
|
||||
+3
-2
@@ -2,14 +2,15 @@
|
||||
"name" : "瞬聊",
|
||||
"appid" : "__UNI__E41111F",
|
||||
"description" : "一款即时聊天软件",
|
||||
"versionName" : "3.3.9",
|
||||
"versionCode" : 339,
|
||||
"versionName" : "3.4.2",
|
||||
"versionCode" : 342,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"bounce" : "none",
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"orientation" : [ "portrait-primary" ],
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
|
||||
+15
-11
@@ -1,13 +1,17 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@openim/client-sdk": "^0.0.11-ahpha.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"dayjs": "^1.11.6",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"image-tools": "^1.4.0",
|
||||
"md5": "^2.3.0",
|
||||
"openim-uniapp-polyfill": "^1.4.4",
|
||||
"uuid": "^9.0.0"
|
||||
}
|
||||
"dependencies": {
|
||||
"@openim/client-sdk": "^0.0.11-ahpha.1",
|
||||
"crypto-js": "^4.2.0",
|
||||
"date-fns": "^2.30.0",
|
||||
"dayjs": "^1.11.6",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"image-tools": "^1.4.0",
|
||||
"md5": "^2.3.0",
|
||||
"openim-uniapp-polyfill": "^1.4.4",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"worker-loader": "^3.0.8",
|
||||
"worker-plugin": "^5.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,6 +348,7 @@
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
|
||||
.member_list {
|
||||
flex: 1;
|
||||
|
||||
@@ -146,7 +146,7 @@ export default {
|
||||
this.loginInfo.email = "commiu@outlook.com";
|
||||
this.loginInfo.password = "qwe123";
|
||||
}
|
||||
plus.navigator.closeSplashscreen();
|
||||
//plus.navigator.closeSplashscreen();
|
||||
},
|
||||
updateEye() {
|
||||
this.eying = !this.eying;
|
||||
|
||||
@@ -108,7 +108,6 @@
|
||||
const info = util.aesdecode(sourceInfo);
|
||||
this.sourceID = info.userID;
|
||||
}
|
||||
//console.log(this.storeSelfInfo);
|
||||
this.getSourceUserInfo();
|
||||
},
|
||||
methods: {
|
||||
@@ -131,6 +130,7 @@
|
||||
info = {
|
||||
...friendInfo
|
||||
};
|
||||
console.log(info);
|
||||
} else {
|
||||
const {
|
||||
data
|
||||
@@ -142,10 +142,11 @@
|
||||
info = {
|
||||
...(data[0] ?? {})
|
||||
};
|
||||
console.log(info);
|
||||
}
|
||||
this.isLoading = true
|
||||
try {
|
||||
const res = await businessSearchUserInfo(this.sourceID);
|
||||
const res = await businessSearchUserInfo(this.sourceID);console.log(res);
|
||||
if (res.total > 0) {
|
||||
info = {
|
||||
...info,
|
||||
@@ -156,6 +157,7 @@
|
||||
info = {};
|
||||
}
|
||||
this.isLoading = false
|
||||
console.log(info);
|
||||
this.sourceUserInfo = {
|
||||
...info,
|
||||
};
|
||||
|
||||
@@ -1,173 +1,185 @@
|
||||
<template>
|
||||
<view class="application_list_container">
|
||||
<custom-nav-bar :title="isGroupApplication ? '新的群聊' : '新的好友'" />
|
||||
<view
|
||||
class="pane_row"
|
||||
:style="{ transform: `translateX(${isRecv ? '0' : '-100%'})` }"
|
||||
>
|
||||
<view class="pane_content">
|
||||
<u-list v-if="getRecvRenderData.length > 0" class="application_list">
|
||||
<u-list-item
|
||||
v-for="application in getRecvRenderData"
|
||||
:key="
|
||||
application[!isGroupApplication ? 'fromUserID' : 'userID'] +
|
||||
application.groupID
|
||||
"
|
||||
>
|
||||
<application-item :isRecv="true" :application="application" />
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<u-list
|
||||
v-else-if="getSendRenderData.length > 0"
|
||||
class="application_list"
|
||||
>
|
||||
<u-list-item
|
||||
v-for="application in getSendRenderData"
|
||||
:key="application[!isGroupApplication ? 'toUserID' : 'groupID']"
|
||||
>
|
||||
<application-item :application="application" />
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<view v-else class="empty">
|
||||
<image src="@/static/images/block_empty.png"></image>
|
||||
<text class="empty_text">暂无数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="application_list_container">
|
||||
<custom-nav-bar :title="isGroupApplication ? '新的群聊' : '新的好友'" />
|
||||
<view class="pane_row" :style="{ transform: `translateX(${isRecv ? '0' : '-100%'})` }">
|
||||
<view class="pane_content">
|
||||
<u-list v-if="getRecvRenderData.length > 0" class="application_list">
|
||||
<u-list-item v-for="(application,index) in getRecvRenderData" :key="index">
|
||||
<application-item :isRecv="true" :application="application" />
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<u-list v-else-if="getSendRenderData.length > 0" class="application_list">
|
||||
<u-list-item v-for="(application,index1) in getSendRenderData"
|
||||
:key="index1">
|
||||
<application-item :application="application" />
|
||||
</u-list-item>
|
||||
</u-list>
|
||||
<view v-else class="empty">
|
||||
<image src="@/static/images/block_empty.png"></image>
|
||||
<text class="empty_text">暂无数据</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from "vuex";
|
||||
import { ContactMenuTypes } from "@/constant";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ApplicationItem from "./ApplicationItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
ApplicationItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
isRecv: true,
|
||||
isGroupApplication: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"storeRecvFriendApplications",
|
||||
"storeSentFriendApplications",
|
||||
"storeRecvGroupApplications",
|
||||
"storeSentGroupApplications",
|
||||
]),
|
||||
getRecvRenderData() {
|
||||
const tmpList = this.isGroupApplication
|
||||
? this.storeRecvGroupApplications
|
||||
: this.storeRecvFriendApplications;
|
||||
tmpList.sort((a, b) => (a.handleResult === 0 ? -1 : 1));
|
||||
return tmpList.slice(0, 4);
|
||||
},
|
||||
getSendRenderData() {
|
||||
const tmpList = this.isGroupApplication
|
||||
? this.storeSentGroupApplications
|
||||
: this.storeSentFriendApplications;
|
||||
tmpList.sort((a, b) => (a.handleResult === 0 ? -1 : 1));
|
||||
return tmpList.slice(0, 4);
|
||||
},
|
||||
tabList() {
|
||||
return [
|
||||
{
|
||||
name: this.isGroupApplication ? "入群申请" : "好友请求",
|
||||
},
|
||||
{
|
||||
name: "我的请求",
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
onLoad(params) {
|
||||
const { applicationType } = params;
|
||||
this.isGroupApplication = applicationType === ContactMenuTypes.NewGroup;
|
||||
},
|
||||
methods: {
|
||||
clickTab({ index }) {
|
||||
this.isRecv = index === 0;
|
||||
},
|
||||
previewAll() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/contact/applicationListDetails/index?isGroupApplication=${this.isGroupApplication}&isRecv=${this.isRecv}`,
|
||||
});
|
||||
},
|
||||
toSearch() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/searchUserOrGroup/index?isSearchGroup=${this.isGroupApplication}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
import {
|
||||
ContactMenuTypes
|
||||
} from "@/constant";
|
||||
import CustomNavBar from "@/components/CustomNavBar/index.vue";
|
||||
import ApplicationItem from "./ApplicationItem.vue";
|
||||
export default {
|
||||
components: {
|
||||
CustomNavBar,
|
||||
ApplicationItem,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
keyword: "",
|
||||
isRecv: true,
|
||||
isGroupApplication: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
"storeRecvFriendApplications",
|
||||
"storeSentFriendApplications",
|
||||
"storeRecvGroupApplications",
|
||||
"storeSentGroupApplications",
|
||||
]),
|
||||
getRecvRenderData() {
|
||||
const tmpList = this.isGroupApplication ?
|
||||
this.storeRecvGroupApplications :
|
||||
this.storeRecvFriendApplications;
|
||||
tmpList.sort((a, b) => (a.handleResult === 0 ? -1 : 1));
|
||||
return tmpList.slice(0, 4);
|
||||
},
|
||||
getSendRenderData() {
|
||||
const tmpList = this.isGroupApplication ?
|
||||
this.storeSentGroupApplications :
|
||||
this.storeSentFriendApplications;
|
||||
tmpList.sort((a, b) => (a.handleResult === 0 ? -1 : 1));
|
||||
return tmpList.slice(0, 4);
|
||||
},
|
||||
tabList() {
|
||||
return [{
|
||||
name: this.isGroupApplication ? "入群申请" : "好友请求",
|
||||
},
|
||||
{
|
||||
name: "我的请求",
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
// watch:{
|
||||
// getRecvRenderData:{
|
||||
// handler(v){
|
||||
// console.log(v)
|
||||
// },
|
||||
// immediate: true, // 立即执行一次
|
||||
// deep: true // 开启深度监听
|
||||
// },
|
||||
// getSendRenderData:{
|
||||
// handler(v){
|
||||
// console.log(v)
|
||||
// },
|
||||
// immediate: true, // 立即执行一次
|
||||
// deep: true // 开启深度监听
|
||||
// }
|
||||
// },
|
||||
onLoad(params) {
|
||||
const {
|
||||
applicationType
|
||||
} = params;
|
||||
this.isGroupApplication = applicationType === ContactMenuTypes.NewGroup;
|
||||
},
|
||||
methods: {
|
||||
clickTab({
|
||||
index
|
||||
}) {
|
||||
this.isRecv = index === 0;
|
||||
},
|
||||
previewAll() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/contact/applicationListDetails/index?isGroupApplication=${this.isGroupApplication}&isRecv=${this.isRecv}`,
|
||||
});
|
||||
},
|
||||
toSearch() {
|
||||
uni.navigateTo({
|
||||
url: `/pages/common/searchUserOrGroup/index?isSearchGroup=${this.isGroupApplication}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.empty {
|
||||
@include centerBox();
|
||||
flex-direction: column;
|
||||
margin-top: 25vh !important;
|
||||
.empty {
|
||||
@include centerBox();
|
||||
flex-direction: column;
|
||||
margin-top: 25vh !important;
|
||||
|
||||
&_text {
|
||||
margin-top: 26rpx;
|
||||
color: #8e9ab0;
|
||||
}
|
||||
image {
|
||||
width: 237rpx;
|
||||
height: 244rpx;
|
||||
}
|
||||
}
|
||||
.application_list_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
background-color: #f8f9fa;
|
||||
overflow-x: hidden;
|
||||
&_text {
|
||||
margin-top: 26rpx;
|
||||
color: #8e9ab0;
|
||||
}
|
||||
|
||||
.search_bar_wrap {
|
||||
height: 34px;
|
||||
padding: 12px 22px;
|
||||
background-color: #fff;
|
||||
}
|
||||
image {
|
||||
width: 237rpx;
|
||||
height: 244rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.u-tabs {
|
||||
background-color: #fff;
|
||||
}
|
||||
.application_list_container {
|
||||
@include colBox(false);
|
||||
height: 100vh;
|
||||
background-color: #f8f9fa;
|
||||
overflow-x: hidden;
|
||||
|
||||
.pane_row {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
transition: all 0.3s ease 0s !important;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
.search_bar_wrap {
|
||||
height: 34px;
|
||||
padding: 12px 22px;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.pane_content {
|
||||
@include colBox(false);
|
||||
height: 100%;
|
||||
flex: 0 0 100%;
|
||||
.u-tabs {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.pane_title {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
padding: 12rpx 44rpx;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
.pane_row {
|
||||
display: flex;
|
||||
//flex: 1;
|
||||
transition: all 0.3s ease 0s !important;
|
||||
background-color: #fff;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.application_list {
|
||||
flex: 1;
|
||||
height: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
.pane_content {
|
||||
@include colBox(false);
|
||||
width: 100%;
|
||||
//height: 100%;
|
||||
//flex: 0 0 100%;
|
||||
|
||||
.view_all {
|
||||
background-color: #fff;
|
||||
padding: 44rpx 44rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
.pane_title {
|
||||
font-size: 28rpx;
|
||||
color: #999;
|
||||
padding: 12rpx 44rpx;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.application_list {
|
||||
flex: 1;
|
||||
height: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.view_all {
|
||||
background-color: #fff;
|
||||
padding: 44rpx 44rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -14,9 +14,26 @@
|
||||
<SearchbarPlace @click="toSearch">搜索</SearchbarPlace>
|
||||
</view>
|
||||
<uni-list class="contact_menus">
|
||||
<uni-list-item title="新的好友" :showBadge="storeUnHandleFriendApplicationNum>0" :badgeText="storeUnHandleFriendApplicationNum+''" badgeType="error" thumbSize="lg" to="/pages/contact/applicationList/index?applicationType=NewFriend" thumb="/static/images/contact_new_friend.png"></uni-list-item>
|
||||
<!-- <uni-list-item title="新的群组" thumbSize="lg" to="/pages/contact/applicationList/index?applicationType=NewGroup" thumb="/static/images/contact_new_group.png"></uni-list-item> -->
|
||||
<uni-list-item title="群聊" thumbSize="lg" to="/pages/contact/groupList/index" thumb="/static/images/contact_my_group.png"></uni-list-item>
|
||||
<uni-list-item title="新的好友"
|
||||
:showBadge="storeUnHandleFriendApplicationNum>0"
|
||||
:badgeText="storeUnHandleFriendApplicationNum+''"
|
||||
badgeType="error"
|
||||
thumbSize="lg"
|
||||
to="/pages/contact/applicationList/index?applicationType=NewFriend"
|
||||
thumb="/static/images/contact_new_friend.png"></uni-list-item>
|
||||
<uni-list-item
|
||||
title="新的群组"
|
||||
:showBadge="storeUnHandleGroupApplicationNum>0"
|
||||
:badgeText="storeUnHandleGroupApplicationNum+''"
|
||||
badgeType="error"
|
||||
thumbSize="lg"
|
||||
to="/pages/contact/applicationList/index?applicationType=NewGroup"
|
||||
thumb="/static/images/contact_new_group.png"></uni-list-item>
|
||||
<uni-list-item
|
||||
title="群聊"
|
||||
thumbSize="lg"
|
||||
to="/pages/contact/groupList/index"
|
||||
thumb="/static/images/contact_my_group.png"></uni-list-item>
|
||||
</uni-list>
|
||||
|
||||
<choose-index-list v-if="getIndexData.dataList.length > 0" @itemClick="userClick" :height="`${listHeight}px`"
|
||||
@@ -46,7 +63,11 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["storeFriendList",'storeUnHandleFriendApplicationNum']),
|
||||
...mapGetters([
|
||||
"storeFriendList",
|
||||
'storeUnHandleFriendApplicationNum',
|
||||
'storeUnHandleGroupApplicationNum'
|
||||
]),
|
||||
getIndexData() {
|
||||
return formatChooseData(this.storeFriendList);
|
||||
},
|
||||
@@ -54,9 +75,6 @@
|
||||
mounted() {
|
||||
this.getListHeight();
|
||||
},
|
||||
async onShow() {
|
||||
//await this.getFriendList();
|
||||
},
|
||||
methods: {
|
||||
...mapActions('contact',['getFriendList']),
|
||||
toSearch(){
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
<view class="mute_tip" v-else>您被禁言至{{date(storeCurrentMemberInGroup.muteEndTime)}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else-if="!isSingle && !storeCurrentMemberInGroup.userID">
|
||||
<view class="forbidden_footer">
|
||||
<view class="mute_tip">您不是群成员</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class="chat_footer">
|
||||
<!-- 语音信息 -->
|
||||
@@ -57,7 +62,7 @@
|
||||
import {getPurePath,html2Text,getVideoCover,getVideoInfo} from "@/util/common";
|
||||
import {offlinePushInfo,date} from "@/util/imCommon";
|
||||
import {ChatingFooterActionTypes,UpdateMessageTypes,} from "@/constant";
|
||||
import IMSDK, {IMMethods,MessageStatus,MessageType,} from "openim-uniapp-polyfill";
|
||||
import IMSDK, {IMMethods,MessageStatus,MessageType,SessionType} from "openim-uniapp-polyfill";
|
||||
import CustomEditor from "./CustomEditor";
|
||||
import SimpleEditor from "./SimpleEditor";
|
||||
import ChatingActionBar from "./ChatingActionBar";
|
||||
@@ -111,6 +116,11 @@
|
||||
"storeCurrentUserID",
|
||||
"storeCurrentMemberInGroup"
|
||||
]),
|
||||
isSingle() {
|
||||
return (
|
||||
this.storeCurrentConversation.conversationType === SessionType.Single
|
||||
);
|
||||
},
|
||||
hasContent() {
|
||||
return html2Text(this.inputHtml) !== "";
|
||||
},
|
||||
@@ -118,6 +128,9 @@
|
||||
return this.storeCurrentMemberInGroup && this.storeCurrentMemberInGroup?.roleLevel>20;
|
||||
},
|
||||
isMute(){
|
||||
if(this.isSingle){
|
||||
return false;
|
||||
}
|
||||
if(this.storeCurrentGroup && this.storeCurrentGroup.status === 3 && !this.isAdminOrOwner){
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -193,12 +193,7 @@
|
||||
},
|
||||
methods: {
|
||||
viewDetail(){
|
||||
if(this.isSender){
|
||||
}else{
|
||||
uni.navigateTo({
|
||||
url:"/pages/common/userCard/index?sourceID="+this.source.sendID
|
||||
})
|
||||
}
|
||||
this.$emit('userEvent',{type:"avatarClick"},this.source);
|
||||
},
|
||||
toAnnouncement(){
|
||||
uni.navigateTo({
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
import SelectHeader from "./components/SelectHeader";
|
||||
import SelectFooter from "./components/SelectFooter";
|
||||
import {markConversationAsRead} from "@/util/imCommon";
|
||||
import IMSDK, {MessageType,GroupMemberRole} from "openim-uniapp-polyfill";
|
||||
import IMSDK, {MessageType,GroupMemberRole,SessionType} from "openim-uniapp-polyfill";
|
||||
import util from "@/util/index.js"
|
||||
export default {
|
||||
components: {
|
||||
@@ -59,6 +59,11 @@
|
||||
"storeCurrentGroup",
|
||||
"storeCurrentMemberInGroup"
|
||||
]),
|
||||
isSingle() {
|
||||
return (
|
||||
this.storeCurrentConversation.conversationType === SessionType.Single
|
||||
);
|
||||
},
|
||||
isOwner() {
|
||||
return this.storeCurrentMemberInGroup.roleLevel === GroupMemberRole.Owner;
|
||||
},
|
||||
@@ -398,6 +403,20 @@
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (e.type == 'avatarClick'){
|
||||
if(data.sendID == this.storeCurrentUserID){
|
||||
return ;
|
||||
}
|
||||
if(!_this.isSingle){
|
||||
if(this.storeCurrentMemberInGroup.roleLevel < 60 && this.storeCurrentGroup.lookMemberInfo!=0){
|
||||
return ;
|
||||
}
|
||||
}
|
||||
uni.navigateTo({
|
||||
url:"/pages/common/userCard/index?sourceID="+data.sendID
|
||||
})
|
||||
return ;
|
||||
}
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
</view>
|
||||
<view class="lastest_msg_wrap">
|
||||
<text class="lastest_msg_content">{{ latestMessage }}</text>
|
||||
<uni-icons v-if="source.recvMsgOpt===2" custom-prefix="imfont" type="im-bell-off" size="16" color="#ddd"></uni-icons>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -47,6 +48,7 @@
|
||||
parsedMessage = JSON.parse(this.source.latestMsg);
|
||||
} catch (e) {}
|
||||
if (!parsedMessage) return "";
|
||||
//console.log(parsedMessage);
|
||||
return getConversationContent(parsedMessage);
|
||||
},
|
||||
latestMessageTime() {
|
||||
@@ -64,7 +66,7 @@
|
||||
},
|
||||
methods: {
|
||||
clickConversationItem() {
|
||||
console.log(this.source);
|
||||
//console.log(this.source);
|
||||
prepareConversationState(this.source);
|
||||
},
|
||||
longtapConversationItem() {
|
||||
@@ -148,6 +150,7 @@
|
||||
|
||||
.lastest_msg_wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
margin: 10rpx 0;
|
||||
color: #666;
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
<view class="conversation_container">
|
||||
<chat-header ref="chatHeaderRef" />
|
||||
<uni-swipe-action ref="swipe_action">
|
||||
<template v-for="item in storeConversationList" >
|
||||
<uni-swipe-action-item
|
||||
v-if="item.sendID !='system1'"
|
||||
:right-options="swipe_actions"
|
||||
@click="actionClick($event,item)"
|
||||
v-for="item in storeConversationList"
|
||||
:key="item.conversationID" >
|
||||
<conversation-item @longtapEvent="showExtendMenu(item)" :source="item"/>
|
||||
</uni-swipe-action-item>
|
||||
</template>
|
||||
</uni-swipe-action>
|
||||
<view class="loading_wrap" v-if="storeProgress > 0 && storeProgress < 100">
|
||||
<u-loading-icon :vertical="true" :text="storeProgress + '%'"></u-loading-icon>
|
||||
@@ -59,7 +61,12 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(["storeConversationList", "storeIsSyncing", "storeProgress",'storeCurrentUserID']),
|
||||
...mapGetters([
|
||||
"storeConversationList",
|
||||
"storeIsSyncing",
|
||||
"storeProgress",
|
||||
'storeCurrentUserID'
|
||||
]),
|
||||
},
|
||||
onReady() {
|
||||
// #ifdef APP
|
||||
@@ -87,33 +94,33 @@
|
||||
},
|
||||
showExtendMenu(item){
|
||||
const _this = this;
|
||||
const menu = [item.recvMsgOpt===0 ? '关闭免打扰':'免打扰',item.isPrivateChat? '关闭阅后即焚':'开启阅后即焚','隐藏',item.isPinned ? '取消置顶':'置顶','删除'];
|
||||
const menu = [item.recvMsgOpt===0 ? '免打扰':'关闭免打扰',item.isPrivateChat? '关闭阅后即焚':'开启阅后即焚','隐藏',item.isPinned ? '取消置顶':'置顶','删除'];
|
||||
uni.showActionSheet({
|
||||
itemList:menu,
|
||||
success(e) {
|
||||
switch(menu[e.tapIndex]){
|
||||
case '免打扰':
|
||||
IMSDK.asyncApi('setConversation', IMSDK.uuid(), {
|
||||
conversationID: conversationId,
|
||||
_this.setConversation({
|
||||
conversationID: item.conversationID,
|
||||
recvMsgOpt: 2
|
||||
})
|
||||
break;
|
||||
case '关闭免打扰':
|
||||
IMSDK.asyncApi('setConversation', IMSDK.uuid(), {
|
||||
conversationID: conversationId,
|
||||
_this.setConversation({
|
||||
conversationID: item.conversationID,
|
||||
recvMsgOpt: 0
|
||||
})
|
||||
break;
|
||||
case '开启阅后即焚':
|
||||
IMSDK.asyncApi('setConversation', IMSDK.uuid(), {
|
||||
conversationID: conversationId,
|
||||
_this.setConversation({
|
||||
conversationID: item.conversationID,
|
||||
isPrivateChat: true,
|
||||
burnDuration:60
|
||||
})
|
||||
break;
|
||||
case '关闭阅后即焚':
|
||||
IMSDK.asyncApi('setConversation', IMSDK.uuid(), {
|
||||
conversationID: conversationId,
|
||||
_this.setConversation({
|
||||
conversationID: item.conversationID,
|
||||
isPrivateChat: false
|
||||
})
|
||||
break;
|
||||
@@ -121,10 +128,16 @@
|
||||
IMSDK.asyncApi('hideConversation', IMSDK.uuid(), item.conversationID)
|
||||
break;
|
||||
case '置顶':
|
||||
_this.setPinConversation(item.conversationID,true);
|
||||
_this.setConversation({
|
||||
conversationID: item.conversationID,
|
||||
isPinned: true
|
||||
});
|
||||
break;
|
||||
case '取消置顶':
|
||||
_this.setPinConversation(item.conversationID,false);
|
||||
_this.setConversation({
|
||||
conversationID: item.conversationID,
|
||||
isPinned: false
|
||||
})
|
||||
break;
|
||||
case '删除':
|
||||
_this.deleteConversation(item.conversationID);
|
||||
@@ -155,11 +168,9 @@
|
||||
|
||||
})
|
||||
},
|
||||
setPinConversation(conversationId,status){
|
||||
IMSDK.asyncApi('setConversation', IMSDK.uuid(), {
|
||||
conversationID: conversationId,
|
||||
isPinned: status
|
||||
})
|
||||
|
||||
async setConversation(data){
|
||||
await IMSDK.asyncApi('setConversation', IMSDK.uuid(), data);
|
||||
},
|
||||
|
||||
onRefresh() {
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<uni-list-item title="设置管理员" @click="setAdmin" showArrow clickable></uni-list-item>
|
||||
<uni-list-item title="进群验证" @switchChange="updateGroupInfo('needVerification',storeCurrentGroup.needVerification==1 ? 2: 1)" showSwitch :switchChecked="!(storeCurrentGroup.needVerification != 1)"></uni-list-item>
|
||||
<!-- <uni-list-item title="进群验证" :rightText="verifyTypeText" @click="changeVerify" clickable></uni-list-item> -->
|
||||
<uni-list-item title="允许查看成员资料" @switchChange="updateGroupInfo('lookMemberInfo',storeCurrentGroup.applyMemberFriend == 1 ? 0 : 1)" showSwitch :switchChecked="storeCurrentGroup.applyMemberFriend==0"></uni-list-item>
|
||||
<uni-list-item title="允许群内添加好友" @switchChange="updateGroupInfo('applyMemberFriend',storeCurrentGroup.applyMemberFriend == 1 ? 0 : 1)" showSwitch :switchChecked="storeCurrentGroup.applyMemberFriend==0"></uni-list-item>
|
||||
<uni-list-item title="允许查看成员资料" @switchChange="updateGroupInfo('lookMemberInfo',storeCurrentGroup.lookMemberInfo == 1 ? 0 : 1)" showSwitch :switchChecked="storeCurrentGroup.lookMemberInfo==0"></uni-list-item>
|
||||
<!-- <uni-list-item title="允许群内添加好友" @switchChange="updateGroupInfo('applyMemberFriend',storeCurrentGroup.applyMemberFriend == 1 ? 0 : 1)" showSwitch :switchChecked="storeCurrentGroup.applyMemberFriend==0"></uni-list-item> -->
|
||||
<uni-list-item title="全员禁言" @switchChange="updateMute" showSwitch :switchChecked="isMute"></uni-list-item>
|
||||
|
||||
</uni-list>
|
||||
@@ -42,7 +42,7 @@
|
||||
},
|
||||
onLoad() {
|
||||
this.isMute = this.storeCurrentGroup.status == 3;
|
||||
//console.log(this.storeCurrentGroup);
|
||||
console.log(this.storeCurrentGroup);
|
||||
// IMSDK.asyncApi('getSpecifiedGroupsInfo', IMSDK.uuid(), [this.storeCurrentGroup.groupID]).then(res=>{
|
||||
// console.log(res);
|
||||
// }).catch(e=>{
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
|
||||
<script>
|
||||
let moreActionArea;
|
||||
import {mapActions,mapGetters} from "vuex";
|
||||
import {GroupMemberListTypes} from "@/constant";
|
||||
import IMSDK, {GroupMemberRole} from "openim-uniapp-polyfill";
|
||||
import UserItem from "@/components/UserItem/index.vue";
|
||||
@@ -86,6 +87,11 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'storeCurrentUserID',
|
||||
'storeCurrentGroup',
|
||||
"storeCurrentMemberInGroup"
|
||||
]),
|
||||
getChoosedData() {
|
||||
const tmpList = [...this.choosedMemberIDList];
|
||||
return this.groupMemberList.filter(
|
||||
@@ -112,13 +118,13 @@
|
||||
},
|
||||
isOwner() {
|
||||
return (
|
||||
this.$store.getters.storeCurrentMemberInGroup.roleLevel ===
|
||||
this.storeCurrentMemberInGroup.roleLevel ===
|
||||
GroupMemberRole.Owner
|
||||
);
|
||||
},
|
||||
isAdmin() {
|
||||
return (
|
||||
this.$store.getters.storeCurrentMemberInGroup.roleLevel === GroupMemberRole.Admin
|
||||
this.storeCurrentMemberInGroup.roleLevel === GroupMemberRole.Admin
|
||||
);
|
||||
},
|
||||
canCheck() {
|
||||
@@ -128,17 +134,16 @@
|
||||
}) => {
|
||||
if (this.type === GroupMemberListTypes.Kickout) {
|
||||
return (
|
||||
(this.isOwner ||
|
||||
(this.isAdmin && roleLevel !== GroupMemberRole.Owner)) &&
|
||||
userID !== this.$store.getters.storeCurrentUserID
|
||||
(this.isOwner || (this.isAdmin && roleLevel !== GroupMemberRole.Owner)) &&
|
||||
userID !== this.$store.storeCurrentUserID
|
||||
);
|
||||
}
|
||||
|
||||
return userID !== this.$store.getters.storeCurrentUserID;
|
||||
return userID !== this.$store.storeCurrentUserID;
|
||||
};
|
||||
},
|
||||
groupMemberLength() {
|
||||
return this.$store.getters.storeCurrentGroup?.memberCount ?? 0;
|
||||
return this.storeCurrentGroup?.memberCount ?? 0;
|
||||
},
|
||||
|
||||
},
|
||||
@@ -284,10 +289,16 @@
|
||||
},
|
||||
userClick(member) {
|
||||
if (this.type === GroupMemberListTypes.Transfer) {
|
||||
if (member.userID === this.$store.getters.storeCurrentUserID) return;
|
||||
if (member.userID === this.storeCurrentUserID) return;
|
||||
this.choosedTransferMember = member;
|
||||
this.showConfirmModal = true;
|
||||
} else {
|
||||
if(member.userID == this.storeCurrentUserID){
|
||||
return ;
|
||||
}
|
||||
if(this.storeCurrentMemberInGroup.roleLevel < 60 && this.storeCurrentGroup.lookMemberInfo!=0){
|
||||
return ;
|
||||
}
|
||||
const s = util.aesencode(member);
|
||||
uni.$u.route("/pages/common/userCard/index", {
|
||||
sourceID: member.userID,
|
||||
@@ -334,7 +345,7 @@
|
||||
if(!this.isOwner&&!this.isAdmin){
|
||||
return ;
|
||||
}
|
||||
if(this.$store.getters.storeCurrentMemberInGroup.roleLevel <= member.roleLevel ){
|
||||
if(this.storeCurrentMemberInGroup.roleLevel <= member.roleLevel ){
|
||||
return ;
|
||||
}
|
||||
let itemList = [];
|
||||
|
||||
@@ -76,14 +76,12 @@
|
||||
<videoPlayer :previewVideoFlag="previewVideoFlag" :previewVideoSrc="previewVideoSrc" @quitPlay="previewVideoFlag=false"></videoPlayer>
|
||||
</view>
|
||||
<!-- 删除朋友圈确认框 -->
|
||||
<view v-if="delCircleObj.delCircleModelFlag==true">
|
||||
<u-modal v-model="delCircleObj.delCircleModelFlag" :show-title="false"
|
||||
:show-confirm-button="true" confirm-text="删除" confirm-color="#fa3534"
|
||||
:show-cancel-button="true" cancel-text="取消" cancel-color="#000000"
|
||||
content="删除该朋友圈?" :content-style="{color:'#000000',fontSize:'32rpx',fontWeight:'bold'}"
|
||||
<u-modal :show="delCircleObj.delCircleModelFlag"
|
||||
:showConfirmButton="true" confirmText="删除" confirmColor="#fa3534"
|
||||
:showCancelButton="true" cancelText="取消" cancelColor="#000000"
|
||||
content="删除该朋友圈?"
|
||||
@confirm="confirmDelCircle()" @cancel="cancelDelCircle()">
|
||||
</u-modal>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -130,7 +128,7 @@
|
||||
//vuex变量
|
||||
watch:{
|
||||
storeCircleData:function(val){
|
||||
console.log("监听到朋友圈内容有变动",val.length);
|
||||
//console.log("监听到朋友圈内容有变动",val.length);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -303,16 +301,9 @@
|
||||
let param={
|
||||
id:delCircleId
|
||||
};
|
||||
deleteCircle(param).then(res => {
|
||||
if(res.code==200){
|
||||
that.delCircleObj.delCircleModelFlag=false;
|
||||
that.delCircleObj.tempDelCircleId="";
|
||||
that.delCircleObj.tempDelIndex="";
|
||||
let tempData=that.storeCircleData;
|
||||
tempData.splice(delIndex,1);
|
||||
this.$store.commit('circle/SET_LIST',tempData);
|
||||
}
|
||||
});
|
||||
that.delCircleObj.delCircleModelFlag=false;
|
||||
this.$store.dispatch('circle/deleteFriendCircleList',param);
|
||||
|
||||
},
|
||||
cancelDelCircle:function(){
|
||||
let that=this;
|
||||
@@ -458,6 +449,9 @@
|
||||
case 'handleComment':
|
||||
this.handleComment(e.comment,e.index);
|
||||
break;
|
||||
case 'deleteCircle':
|
||||
this.deleteCircle(e.item,e.index);
|
||||
break;
|
||||
case 'linkToBusinessCard':
|
||||
this.linkToBusinessCard(e.userID);
|
||||
break;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<info-item v-if="1==2" @click="goto('/pages/common/article?type=spage&name=cooperation&title=商务合作')" class="check" title="商务合作" />
|
||||
<info-item @click="goto('/pages/common/article?type=spage&name=terms_of_service&title=用户协议')" class="check" title="用户协议" />
|
||||
<info-item @click="goto('/pages/common/article?type=spage&name=privacy_policy&title=隐私政策')" class="check" title="隐私政策" />
|
||||
<info-item @click="goto('/pages/common/article?type=spage&name=aboutus&title=关于我们')" class="check" title="关于我们" />
|
||||
<!-- <info-item @click="goto('/pages/common/article?type=spage&name=aboutus&title=关于我们')" class="check" title="关于我们" /> -->
|
||||
<info-item @click="clearcache" class="check" title="清除缓存" />
|
||||
<info-item v-if="1==2" @click="show = true" class="check" title="上传调试日志" />
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
@font-face {
|
||||
font-family: "imfont"; /* Project id 5108944 */
|
||||
src: url('/static/imfont/iconfont.ttf?t=1768272147036') format('truetype');
|
||||
}
|
||||
|
||||
.imfont {
|
||||
font-family: "imfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.im-bell_slash:before {
|
||||
content: "\e7e5";
|
||||
}
|
||||
|
||||
.im-bell-off:before {
|
||||
content: "\e87f";
|
||||
}
|
||||
|
||||
.im-user-plus:before {
|
||||
content: "\e9d4";
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -12,6 +12,7 @@ export default {
|
||||
storeRecvGroupApplications: (state) => state.contact.recvGroupApplications,
|
||||
storeSentGroupApplications: (state) => state.contact.sentGroupApplications,
|
||||
storeUnHandleFriendApplicationNum: (state) => state.contact.unHandleFriendApplicationNum,
|
||||
storeUnHandleGroupApplicationNum: (state) => state.contact.unHandleGroupApplicationNum,
|
||||
storeHistoryMessageList: (state) => state.message.historyMessageList,
|
||||
storeHasMoreMessage: (state) => state.message.hasMoreMessage,
|
||||
storeCurrentMsg: (state) => state.message.currentMsg,
|
||||
|
||||
+11
-10
@@ -11,16 +11,6 @@ const mutations = {
|
||||
},
|
||||
SET_UNREAD_COUNT(state, count) {
|
||||
state.unread_count = count;
|
||||
if(count<1){
|
||||
uni.removeTabBarBadge({
|
||||
index:2
|
||||
})
|
||||
}else{
|
||||
uni.setTabBarBadge({
|
||||
index:2,
|
||||
text:count
|
||||
})
|
||||
}
|
||||
},
|
||||
SET_TOP_UNREAD_ITEMS(state, data) {
|
||||
state.top_unread_items = [...data];
|
||||
@@ -102,6 +92,17 @@ const actions = {
|
||||
async updateUnreadCount({commit,state},v) {
|
||||
commit("SET_UNREAD_COUNT", state.unread_count+v);
|
||||
},
|
||||
async deleteFriendCircleList({commit,state},params){
|
||||
uni.$u.http.post('/friendcircle/delete',params).then(res=>{
|
||||
var list = state.list.filter(item=>{
|
||||
return item.id!=params.id;
|
||||
})
|
||||
commit("SET_LIST", list);
|
||||
}).catch(e=>{
|
||||
console.log(e);
|
||||
uni.$u.toast(typeof e == Object ? e?.msg : e);
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
export default {
|
||||
|
||||
@@ -29,22 +29,14 @@ const mutations = {
|
||||
state.recvFriendApplications = [...list];
|
||||
const count = list.filter((item) => item.handleResult === 0);
|
||||
state.unHandleFriendApplicationNum = count.length;
|
||||
if(state.unHandleFriendApplicationNum>0){
|
||||
uni.setTabBarBadge({
|
||||
index:1,
|
||||
text:(state.unHandleFriendApplicationNum<100?state.unHandleFriendApplicationNum:'···')+'',
|
||||
});
|
||||
}else{
|
||||
uni.hideTabBarRedDot({
|
||||
index:1
|
||||
})
|
||||
}
|
||||
},
|
||||
SET_SENT_FRIEND_APPLICATIONS(state, list) {
|
||||
state.sentFriendApplications = [...list];
|
||||
},
|
||||
SET_RECV_GROUP_APPLICATIONS(state, list) {
|
||||
state.recvGroupApplications = [...list];
|
||||
const count = list.filter((item) => item.handleResult === 0);
|
||||
state.unHandleGroupApplicationNum = count.length;
|
||||
},
|
||||
SET_SENT_GROUP_APPLICATIONS(state, list) {
|
||||
state.sentGroupApplications = [...list];
|
||||
@@ -135,7 +127,7 @@ const actions = {
|
||||
commit("SET_SENT_FRIEND_APPLICATIONS", data);
|
||||
});
|
||||
},
|
||||
getRecvGroupApplications({ commit }) {
|
||||
getRecvGroupApplications({ commit,state}) {
|
||||
//#ifndef APP
|
||||
return [];
|
||||
//#endif
|
||||
@@ -244,6 +236,7 @@ const actions = {
|
||||
commit("SET_RECV_FRIEND_APPLICATIONS", [...tmpList, application]);
|
||||
},
|
||||
updateRecvFriendApplition({commit,state,rootState}, {application,isRemove = false}, ) {
|
||||
console.log(application);
|
||||
const tmpList = [...state.recvFriendApplications];
|
||||
const idx = tmpList.findIndex(
|
||||
(item) => item.fromUserID === application.fromUserID,
|
||||
@@ -294,6 +287,10 @@ const actions = {
|
||||
tmpList.splice(idx, 1);
|
||||
}
|
||||
commit("SET_RECV_GROUP_APPLICATIONS", [...tmpList, application]);
|
||||
// const newList = state.recvGroupApplications.filter((item)=>{
|
||||
// item.userID !== application.userID
|
||||
// });
|
||||
// commit("SET_RECV_GROUP_APPLICATIONS", [...newList, application]);
|
||||
},
|
||||
updateRecvGroupApplition({commit,state,rootState}, {application,isRemove = false}, ) {
|
||||
const tmpList = [...state.recvGroupApplications];
|
||||
|
||||
@@ -19,16 +19,6 @@ const mutations = {
|
||||
};
|
||||
},
|
||||
SET_UNREAD_COUNT(state, count) {
|
||||
if (count>0) {
|
||||
uni.setTabBarBadge({
|
||||
index: 0,
|
||||
text: count < 99 ? count + "" : "99+",
|
||||
});
|
||||
} else {
|
||||
uni.removeTabBarBadge({
|
||||
index: 0,
|
||||
});
|
||||
}
|
||||
state.unReadCount = count;
|
||||
},
|
||||
SET_CURRENT_GROUP(state, group) {
|
||||
|
||||
+1
-1
@@ -537,4 +537,4 @@ export const getVideoInfo = async (src)=>{
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -402,4 +402,26 @@ export const getConversationContent = (message) => {
|
||||
return `${message.senderNickname}:${parseMessageByType(message)}`;
|
||||
}
|
||||
return parseMessageByType(message);
|
||||
};
|
||||
export const updateDot = (index,count) =>{
|
||||
if(count>0){
|
||||
uni.setTabBarBadge({
|
||||
index:index,
|
||||
text:(count<100?count:'99+')+'',
|
||||
});
|
||||
}else{
|
||||
uni.hideTabBarRedDot({index:index})
|
||||
}
|
||||
}
|
||||
export const updateTabbar = (index)=>{
|
||||
if(index===0 || index === undefined){
|
||||
updateDot(0,store.getters.storeUnReadCount);
|
||||
}
|
||||
if(index===1 || index === undefined){
|
||||
updateDot(1,store.getters.storeUnHandleFriendApplicationNum+store.getters.storeUnHandleGroupApplicationNum);
|
||||
}
|
||||
if(index===2 || index === undefined){
|
||||
updateDot(2,store.getters.storeCircleUnreadCount);
|
||||
}
|
||||
|
||||
};
|
||||
+9
-8
@@ -1,12 +1,13 @@
|
||||
|
||||
module.exports = {
|
||||
// configureWebpack: {
|
||||
// // 开启缓存
|
||||
// cache: true,
|
||||
// // 并行构建
|
||||
// parallel: true,
|
||||
// // 关闭sourcemap加速生产构建
|
||||
// productionSourceMap: false
|
||||
// },
|
||||
configureWebpack: {
|
||||
// 开启缓存
|
||||
cache: true,
|
||||
// // 并行构建
|
||||
// parallel: true,
|
||||
// // 关闭sourcemap加速生产构建
|
||||
// productionSourceMap: false
|
||||
},
|
||||
// 关闭文件hash (开发环境)
|
||||
filenameHashing: process.env.NODE_ENV !== 'production'
|
||||
}
|
||||
Reference in New Issue
Block a user