调整目录结构

This commit is contained in:
2022-02-24 09:25:35 +08:00
parent ef785ab05f
commit 358372cdba
27 changed files with 238 additions and 217 deletions

View File

@@ -2,8 +2,8 @@
"name" : "ZH-HEALTH", "name" : "ZH-HEALTH",
"appid" : "__UNI__C29473D", "appid" : "__UNI__C29473D",
"description" : "ZH-HEALTH您手上的健康管理专家", "description" : "ZH-HEALTH您手上的健康管理专家",
"versionName" : "1.0.15", "versionName" : "1.0.16",
"versionCode" : 113, "versionCode" : 100,
"transformPx" : false, "transformPx" : false,
/* 5+App */ /* 5+App */
"app-plus" : { "app-plus" : {

View File

@@ -1,7 +1,7 @@
<template> <template>
<view class="apply--cell"> <view class="apply--cell">
<view class="avatar"> <view class="avatar">
<u-avatar :src="user.portraitUrl || require('@/static/user/cover.png')" shape="square" size="46" /> <u-avatar :src="user.portraitUrl || require('@/static/user/cover.png')" shape="square" :size="avatarSize" />
</view> </view>
<view class="info"> <view class="info">
<view class="name"> {{ user.name }}</view> <view class="name"> {{ user.name }}</view>
@@ -20,8 +20,12 @@
resolveFriend, resolveFriend,
rejectFriend rejectFriend
} from '@/apis/interfaces/im.js' } from '@/apis/interfaces/im.js'
import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [
imBase
],
props: { props: {
message: { message: {
type: Object, type: Object,
@@ -35,7 +39,7 @@
}, },
methods: { methods: {
resolve() { resolve() {
resolveFriend(this.message.sourceUserId).then(res => { resolveFriend(this.message.sourceUserId).then(res => {
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '通过好友申请' title: '通过好友申请'
@@ -46,8 +50,8 @@
icon: 'none', icon: 'none',
title: err.message title: err.message
}) })
}).finally(() => { }).finally(() => {
this.clearMessages() this.clearMessages()
}) })
}, },
reject() { reject() {
@@ -68,11 +72,11 @@
}) })
}, },
// 不管是通过还是拒绝,都要把相关的信息清理 // 不管是通过还是拒绝,都要把相关的信息清理
clearMessages() { clearMessages() {
RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId) RongIMLib.deleteMessages(RongIMLib.ConversationType.SYSTEM, this.message.sourceUserId)
this.$emit('success') this.$emit('success')
uni.$emit('onNewContactConversation') uni.$emit('onNewContactConversation')
uni.$emit('onNewContactFriends') uni.$emit('onNewContactFriends')
uni.$emit('onNewContactPendings') uni.$emit('onNewContactPendings')
} }
} }

View File

@@ -1,126 +1,147 @@
<template> <template>
<view class="friend-apply"> <view class="friend-apply">
<block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index"> <block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index">
<view class="lists"> <view class="lists">
<view class="" style="width: 100rpx;height: 100rpx;"> <view class="" style="width: 100rpx;height: 100rpx;">
<u-avatar :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" size="44" /> <u-avatar :src="JSON.parse(item.latestMessage.extra).portraitUrl" shape="square" :size="avatarSize" />
</view> </view>
<view class="right"> <view class="right">
<view class="title"> <view class="title">
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
<view class="des">{{ item.latestMessage.message || '--' }}</view> <view class="des">{{ item.latestMessage.message || '--' }}</view>
</view> </view>
<view class="agress-btn"> <view class="agress-btn">
<span v-if="isAgree" @click="action('agree', item)">通过</span> <span v-if="isAgree" @click="action('agree', item)">通过</span>
<span v-if="isAgree" @click="action('reject', item)">拒绝</span> <span v-if="isAgree" @click="action('reject', item)">拒绝</span>
<span v-if="isApply && !item.is_friend" @click="action('apply', item)">查看</span> <span v-if="isApply && !item.is_friend" @click="action('apply', item)">查看</span>
<span class="isFri" v-if="isApply && item.is_friend" @click="action('isFriend', item)">已是好友</span> <span class="isFri" v-if="isApply && item.is_friend"
</view> @click="action('isFriend', item)">已是好友</span>
</view> </view>
</view> </view>
</block> </view>
</view> </block>
</template> </view>
</template>
<script>
export default { <script>
name: 'friend-apply-reject-agree', import imBase from '../mixins/imBase.js'
props: {
lists: { export default {
type: Array, mixins:[
default: [] imBase
}, ],
isAgree: { name: 'friend-apply-reject-agree',
type: Boolean, props: {
default: false lists: {
}, type: Array,
isReject: { default: []
type: Boolean, },
default: false isAgree: {
}, type: Boolean,
isApply: { default: false
type: Boolean, },
default: false isReject: {
} type: Boolean,
}, default: false
created() { },
console.log(this.lists); isApply: {
}, type: Boolean,
methods: { default: false
action(type, item) { }
if (type === 'isFriend') { },
// ,后期可以跳转到信息介绍页面,先留在这里 created() {
return uni.showToast({ title: '已是好友,无需重复添加', icon: 'none', duration:2000}); console.log(this.lists);
} },
this.$emit('action', { type, item }); methods: {
} action(type, item) {
} if (type === 'isFriend') {
}; // ,后期可以跳转到信息介绍页面,先留在这里
</script> return uni.showToast({
title: '已是好友,无需重复添加',
<style lang="scss" scoped> icon: 'none',
.lists { duration: 2000
padding: 0 $padding; });
display: flex; }
flex-direction: row; this.$emit('action', {
align-items: center; type,
justify-content: flex-start; item
box-sizing: border-box; });
font-size: $title-size; }
color: $text-gray; }
};
.cover { </script>
background-color: #ffffff;
} <style lang="scss" scoped>
.right { .lists {
width: 570rpx; padding: 0 $padding;
margin-left: $margin - 10; display: flex;
display: flex; flex-direction: row;
flex-direction: row; align-items: center;
align-items: center; justify-content: flex-start;
justify-content: space-between; box-sizing: border-box;
padding: $padding 0; font-size: $title-size;
border-bottom: solid 1rpx #f9f9f9; color: $text-gray;
.title {
width: 370rpx; .cover {
.name { background-color: #ffffff;
width: 100%; }
color: $text-color;
font-size: $title-size + 2; .right {
overflow: hidden; width: 570rpx;
text-overflow: ellipsis; margin-left: $margin - 10;
white-space: nowrap; display: flex;
} flex-direction: row;
.des { align-items: center;
width: 100%; justify-content: space-between;
flex: 1; padding: $padding 0;
overflow: hidden; border-bottom: solid 1rpx #f9f9f9;
text-overflow: ellipsis;
white-space: nowrap; .title {
font-size: $title-size-m; width: 370rpx;
margin-top: $margin - 10;
color: $text-gray-m; .name {
} width: 100%;
} color: $text-color;
.agress-btn { font-size: $title-size + 2;
display: flex; overflow: hidden;
color: #fff; text-overflow: ellipsis;
font-size: $title-size-m; white-space: nowrap;
span { }
display: inline-block;
padding: 6rpx 14rpx; .des {
background-color: $text-price; width: 100%;
border-radius: 10rpx; flex: 1;
} overflow: hidden;
span:nth-child(1) { text-overflow: ellipsis;
background-color: $main-color; white-space: nowrap;
margin-right: 10rpx; font-size: $title-size-m;
} margin-top: $margin - 10;
.isFri { color: $text-gray-m;
background-color: #f9f9f9 !important; }
color: #666; }
}
} .agress-btn {
} display: flex;
} color: #fff;
font-size: $title-size-m;
span {
display: inline-block;
padding: 6rpx 14rpx;
background-color: $text-price;
border-radius: 10rpx;
}
span:nth-child(1) {
background-color: $main-color;
margin-right: 10rpx;
}
.isFri {
background-color: #f9f9f9 !important;
color: #666;
}
}
}
}
</style> </style>

View File

@@ -3,7 +3,7 @@
<block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index"> <block v-for="(item, index) in lists" v-if="lists.length > 0" :key="index">
<view class="lists"> <view class="lists">
<view class="" style="width: 100rpx;height: 100rpx;"> <view class="" style="width: 100rpx;height: 100rpx;">
<u-avatar :src="item.portraitUrl || require('@/static/user/cover.png')" shape="square" size="44" /> <u-avatar :src="item.portraitUrl || require('@/static/user/cover.png')" shape="square" :size="avatarSize" />
</view> </view>
<view class="right"> <view class="right">
<view class="title"> <view class="title">
@@ -21,7 +21,12 @@
</template> </template>
<script> <script>
import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [
imBase
],
name: 'friend-apply-reject-agree', name: 'friend-apply-reject-agree',
props: { props: {
lists: { lists: {

View File

@@ -38,7 +38,7 @@
transferGroupOwner transferGroupOwner
} from '@/apis/interfaces/im.js' } from '@/apis/interfaces/im.js'
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -21,7 +21,7 @@
<script> <script>
import messagePreview from './messagePreview' import messagePreview from './messagePreview'
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -10,9 +10,13 @@
<script> <script>
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import moment from 'moment' import moment from 'moment'
import imBase from '../../mixins/imBase.js'
export default { export default {
mixins: [
imBase
],
name: 'showText', name: 'showText',
props: { props: {
message: { message: {
@@ -38,11 +42,6 @@
isRemote() { isRemote() {
return this.message.messageDirection == 2 return this.message.messageDirection == 2
}, },
contact() {
return function(targetId) {
return this.$store.getters.contactInfo(targetId)
}
},
duration() { duration() {
if (this.message.duration > 3600) { if (this.message.duration > 3600) {
return moment.utc(this.message.duration * 1000).format('HH:mm:ss') return moment.utc(this.message.duration * 1000).format('HH:mm:ss')

View File

@@ -14,8 +14,12 @@
<script> <script>
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
import messageState from './messageState' import messageState from './messageState'
import imBase from '../../mixins/imBase.js'
export default {
export default {
mixins: [
imBase
],
name: 'showImage', name: 'showImage',
props: { props: {
message: { message: {
@@ -38,11 +42,6 @@
}, },
content() { content() {
return this.message.content return this.message.content
},
contact() {
return function(targetId) {
return this.$store.getters.contactInfo(targetId)
}
} }
}, },
methods: { methods: {

View File

@@ -11,7 +11,8 @@
<script> <script>
import messageState from './messageState' import messageState from './messageState'
import imBase from '../../mixins/imBase.js'
export default { export default {
name: 'showText', name: 'showText',
props: { props: {
@@ -35,11 +36,6 @@
}, },
content() { content() {
return this.message.content.content return this.message.content.content
},
contact() {
return function(targetId) {
return this.$store.getters.contactInfo(targetId)
}
} }
} }
} }

View File

@@ -23,7 +23,8 @@
<script> <script>
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
import messageState from './messageState' import messageState from './messageState'
import imBase from '../../mixins/imBase.js'
export default { export default {
props: { props: {
message: { message: {
@@ -54,11 +55,6 @@
isRemote() { isRemote() {
return this.message.messageDirection == 2 return this.message.messageDirection == 2
}, },
contact() {
return function(targetId) {
return this.$store.getters.contactInfo(targetId)
}
},
width() { width() {
if (this.duration > 3) { if (this.duration > 3) {
return (this.duration * 5) + 150 return (this.duration * 5) + 150

View File

@@ -32,7 +32,7 @@
import showText from './show/showText' import showText from './show/showText'
import showCall from './show/showCall' import showCall from './show/showCall'
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [
@@ -72,7 +72,7 @@
toAnnounce(targetId) { toAnnounce(targetId) {
if (targetId) { if (targetId) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/im/group/announceCreate?targetId=' + this.targetId url: '/pages/im/group/announceCreate?type=check&targetId=' + this.targetId
}) })
} else { } else {
uni.showToast({ uni.showToast({

View File

@@ -39,7 +39,7 @@
} from '@/apis/interfaces/im'; } from '@/apis/interfaces/im';
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
import im from '@/utils/im/index.js' import im from '@/utils/im/index.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -23,7 +23,8 @@
<script> <script>
import { import {
getUserInfo getUserInfo
} from '@/apis/interfaces/im' } from '@/apis/interfaces/im.js'
export default { export default {
data() { data() {
return { return {

View File

@@ -10,11 +10,11 @@
<view v-for="(item, index) in pendings" :key="index"> <view v-for="(item, index) in pendings" :key="index">
<apply-cell :message="item.latestMessage" @success="getPendingList" /> <apply-cell :message="item.latestMessage" @success="getPendingList" />
</view> </view>
</block> </block>
<view class="no-lists" v-else> <view class="no-lists" v-else>
<u-image class="cover" radius="4" width="400rpx" height="400rpx" <u-image class="cover" radius="4" width="400rpx" height="400rpx"
:src="require('@/static/imgs/no-friend.png')" :lazy-load="true" /> :src="require('@/static/imgs/no-friend.png')" :lazy-load="true" />
<span> 暂无好友申请 ~ </span> <span> 暂无好友申请 ~ </span>
</view> </view>
</view> </view>
</template> </template>
@@ -29,25 +29,25 @@
}, },
data() { data() {
return { return {
pendings: [], pendings: [],
bg: '#fff' bg: '#fff'
} }
}, },
onShow() { onShow() {
this.getPendingList() this.getPendingList()
uni.$on('onNewContactPendings', this.getPendingList) uni.$on('onNewContactPendings', this.getPendingList)
}, },
onUnload() { onUnload() {
uni.$off('onNewContactPendings') uni.$off('onNewContactPendings')
}, },
methods: { methods: {
getPendingList() { getPendingList() {
im.getPendingList((pendings) => { im.getPendingList((pendings) => {
console.log(pendings,'res......') console.log(pendings, 'res......')
if (pendings.length > 0) { if (pendings.length > 0) {
this.bg = '#f9f9f9' this.bg = '#f9f9f9'
} else { } else {
this.bg = '#fff' this.bg = '#fff'
} }
this.pendings = pendings this.pendings = pendings
}) })
@@ -62,18 +62,18 @@
background: $window-color; background: $window-color;
} }
.no-lists { .no-lists {
padding-top: $padding * 5; padding-top: $padding * 5;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
font-size: $title-size-m; font-size: $title-size-m;
color: $text-gray-m; color: $text-gray-m;
span { span {
padding-top: $padding; padding-top: $padding;
} }
} }
</style> </style>

View File

@@ -32,6 +32,7 @@
pedingFriend pedingFriend
} from '@/apis/interfaces/im.js'; } from '@/apis/interfaces/im.js';
import applyFriend from '../components/friendSearchList.vue'; import applyFriend from '../components/friendSearchList.vue';
export default { export default {
components: { components: {
applyFriend applyFriend

View File

@@ -16,7 +16,7 @@
createGroupAnnouncement, createGroupAnnouncement,
getGroupAnnouncement getGroupAnnouncement
} from '@/apis/interfaces/im.js' } from '@/apis/interfaces/im.js'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -35,8 +35,8 @@
deleteGroupAnnouncement, deleteGroupAnnouncement,
topGroupAnnouncement topGroupAnnouncement
} from '@/apis/interfaces/im.js' } from '@/apis/interfaces/im.js'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -20,8 +20,8 @@
joinGroupPre, joinGroupPre,
joinGroup joinGroup
} from '@/apis/interfaces/im.js' } from '@/apis/interfaces/im.js'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -21,8 +21,8 @@
import sentMessageBar from '../components/sentMessageBar' import sentMessageBar from '../components/sentMessageBar'
import showMessageCell from '../components/showMessageCell' import showMessageCell from '../components/showMessageCell'
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -57,8 +57,8 @@
} from '@/apis/interfaces/uploading' } from '@/apis/interfaces/uploading'
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
import groupUserList from '../components/groupUserList' import groupUserList from '../components/groupUserList'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
components: { components: {

View File

@@ -47,7 +47,7 @@
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '@/utils/im/onGroupDismiss.js'
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -34,8 +34,8 @@
} from "@/apis/interfaces/im.js" } from "@/apis/interfaces/im.js"
import im from '@/utils/im/message.js' import im from '@/utils/im/message.js'
import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index' import * as RongIMLib from '@/uni_modules/RongCloud-IMWrapper/js_sdk/index'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -4,7 +4,7 @@
<script> <script>
import groupUserList from '../components/groupUserList' import groupUserList from '../components/groupUserList'
import onGroupDismiss from '@/utils/im/onGroupDismiss.js' import onGroupDismiss from '../mixins/onGroupDismiss.js'
export default { export default {
mixins: [ mixins: [

View File

@@ -39,14 +39,15 @@
import im from '@/utils/im/index.js' import im from '@/utils/im/index.js'
import userAuth from '@/public/userAuth' import userAuth from '@/public/userAuth'
import conversationList from './components/conversationList' import conversationList from './components/conversationList'
import connectionStatus from './components/connectionStatus' import connectionStatus from './components/connectionStatus'
export default { export default {
data() { data() {
return { return {
conversations: [], // 会话列表 conversations: [], // 会话列表
connection: 0, connection: 0,
hasNewFriends: 0 hasNewFriends: 0,
perPage: 200
} }
}, },
components: { components: {
@@ -101,9 +102,7 @@
}, },
// 获取会话列表,最新的一千条 // 获取会话列表,最新的一千条
getConversationList() { getConversationList() {
const count = 200 RongIMLib.getConversationList([1, 3], this.perPage, 0, ({
const timestamp = 0
RongIMLib.getConversationList([1, 3], count, timestamp, ({
code, code,
conversations conversations
}) => { }) => {

View File

@@ -18,7 +18,7 @@
import sentMessageBar from '../components/sentMessageBar' import sentMessageBar from '../components/sentMessageBar'
import showMessageCell from '../components/showMessageCell' import showMessageCell from '../components/showMessageCell'
import utils from '@/utils/index.js' import utils from '@/utils/index.js'
import imBase from '@/utils/im/imBase.js' import imBase from '../mixins/imBase.js'
export default { export default {
mixins: [ mixins: [