mixins优化
This commit is contained in:
@@ -34,8 +34,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
|
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
callActions: [{
|
callActions: [{
|
||||||
@@ -64,15 +68,11 @@
|
|||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
sender() {
|
|
||||||
return this.$store.getters.sender
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
singleCall(e) {
|
singleCall(e) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type + '&isCall=true'
|
url: '/pages/im/private/call?targetId=' + this.targetId + '&mediaType=' + e.type +
|
||||||
|
'&isCall=true'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
onPopupsItem(type) {
|
onPopupsItem(type) {
|
||||||
@@ -140,13 +140,14 @@
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.sent--popups {
|
.sent--popups {
|
||||||
background: white;
|
background: white;
|
||||||
padding: 30rpx 15rpx;
|
padding: 30rpx 15rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
margin: 15rpx;
|
margin: 15rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.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 '../mixins/imBase.js'
|
||||||
export default {
|
|
||||||
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
conversationType: {
|
conversationType: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -23,9 +27,6 @@
|
|||||||
computed: {
|
computed: {
|
||||||
disabled() {
|
disabled() {
|
||||||
return this.inputTxt.length === 0
|
return this.inputTxt.length === 0
|
||||||
},
|
|
||||||
sender() {
|
|
||||||
return this.$store.getters.sender
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@@ -14,8 +14,12 @@
|
|||||||
<script>
|
<script>
|
||||||
import im from '@/utils/im/index.js'
|
import im from '@/utils/im/index.js'
|
||||||
import permision from '@/utils/permission.js'
|
import permision from '@/utils/permission.js'
|
||||||
|
import imBase from '../mixins/imBase.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [
|
||||||
|
imBase
|
||||||
|
],
|
||||||
props: {
|
props: {
|
||||||
conversationType: {
|
conversationType: {
|
||||||
type: Number,
|
type: Number,
|
||||||
@@ -35,11 +39,6 @@
|
|||||||
recorderManager: null
|
recorderManager: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
|
||||||
sender() {
|
|
||||||
return this.$store.getters.sender
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
created() {
|
||||||
this.recorderManager = uni.getRecorderManager()
|
this.recorderManager = uni.getRecorderManager()
|
||||||
},
|
},
|
||||||
@@ -100,8 +99,8 @@
|
|||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.send--voice {
|
.send--voice {
|
||||||
.voice {
|
.voice {
|
||||||
display: flex;
|
display: flex;
|
||||||
background: $window-color;
|
background: $window-color;
|
||||||
height: 70rpx;
|
height: 70rpx;
|
||||||
line-height: 70rpx;
|
line-height: 70rpx;
|
||||||
@@ -110,13 +109,14 @@
|
|||||||
width: 500rpx;
|
width: 500rpx;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
margin-right: 15rpx;
|
margin-right: 15rpx;
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
display: flex;
|
display: flex;
|
||||||
background: rgba(0, 0, 0, .6);
|
background: rgba(0, 0, 0, .6);
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@@ -129,6 +129,7 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 88rpx;
|
width: 88rpx;
|
||||||
height: 88rpx;
|
height: 88rpx;
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
import utils from '@/utils/index.js'
|
import utils from '@/utils/index.js'
|
||||||
|
|
||||||
const imBase = {
|
export default {
|
||||||
onLoad() {
|
onLoad() {},
|
||||||
console.log('IM BASE MININX');
|
data() {
|
||||||
},
|
return {}
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
contact() {
|
contact() {
|
||||||
@@ -17,8 +13,9 @@ const imBase = {
|
|||||||
},
|
},
|
||||||
avatarSize() {
|
avatarSize() {
|
||||||
return utils.rpx2px(84)
|
return utils.rpx2px(84)
|
||||||
|
},
|
||||||
|
sender() {
|
||||||
|
return this.$store.getters.sender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default imBase
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// 监听群解散的消息,直接跳转到会话列表页面
|
// 监听群解散的消息,直接跳转到会话列表页面
|
||||||
const onGroupDismiss = {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentTargetId: ''
|
currentTargetId: ''
|
||||||
@@ -31,6 +31,4 @@ const onGroupDismiss = {
|
|||||||
uni.$off('onGroupDismiss_' + this.currentTargetId)
|
uni.$off('onGroupDismiss_' + this.currentTargetId)
|
||||||
uni.$off('onGroupRemoveYou_' + this.currentTargetId)
|
uni.$off('onGroupRemoveYou_' + this.currentTargetId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default onGroupDismiss
|
|
||||||
|
|||||||
Reference in New Issue
Block a user