|
@@ -6,7 +6,7 @@
|
|
|
<van-empty :image="require('@assets/empty_img_asset.png')" v-if="empty" description="没有任何藏品哦~" />
|
|
<van-empty :image="require('@assets/empty_img_asset.png')" v-if="empty" description="没有任何藏品哦~" />
|
|
|
</van-list> -->
|
|
</van-list> -->
|
|
|
<van-sticky>
|
|
<van-sticky>
|
|
|
- <van-nav-bar :title="title" left-text="" right-text="按钮" left-arrow @click-left="$router.go(-1)" />
|
|
|
|
|
|
|
+ <van-nav-bar :title="title" left-text="" right-text="" left-arrow @click-left="$router.go(-1)" />
|
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
@@ -43,7 +43,10 @@
|
|
|
|
|
|
|
|
<div class="btn-content" :style="{ width: message ? '60px' : '28px' }">
|
|
<div class="btn-content" :style="{ width: message ? '60px' : '28px' }">
|
|
|
<van-button size="mini" v-if="message" @click="send" type="primary">发送</van-button>
|
|
<van-button size="mini" v-if="message" @click="send" type="primary">发送</van-button>
|
|
|
- <img class="file-btn" v-else src="@assets/icon_liaotian_gengduo.png" alt="" />
|
|
|
|
|
|
|
+ <div class="file-upload" v-else>
|
|
|
|
|
+ <img class="file-btn" src="@assets/icon_liaotian_tupian.png" alt="" />
|
|
|
|
|
+ <van-uploader :after-read="afterRead" result-type="file" />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="emoji-list" v-if="showEmoji">
|
|
<div class="emoji-list" v-if="showEmoji">
|
|
@@ -56,12 +59,15 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref, onMounted, computed } from 'vue';
|
|
|
|
|
|
|
+import { ref, onMounted, computed, getCurrentInstance } from 'vue';
|
|
|
import ChatInfo from '../../components/ChatInfo.vue';
|
|
import ChatInfo from '../../components/ChatInfo.vue';
|
|
|
import emojis from '../../emojis.json';
|
|
import emojis from '../../emojis.json';
|
|
|
import { useToggle } from '@vant/use';
|
|
import { useToggle } from '@vant/use';
|
|
|
-import { getTeam, getHistroy, sendMsg, getPushMsg } from '../../plugins/chat';
|
|
|
|
|
|
|
+import { nim, getTeam, getHistroy, sendMsg, getPushMsg } from '../../plugins/chat';
|
|
|
import { nextTick } from 'process';
|
|
import { nextTick } from 'process';
|
|
|
|
|
+import { useRoute } from 'vue-router';
|
|
|
|
|
+import { useStore } from 'vuex';
|
|
|
|
|
+import store from '../../store';
|
|
|
|
|
|
|
|
const emojisPeople = Object.keys(emojis)
|
|
const emojisPeople = Object.keys(emojis)
|
|
|
.filter(key => {
|
|
.filter(key => {
|
|
@@ -71,6 +77,12 @@ const emojisPeople = Object.keys(emojis)
|
|
|
return emojis[key];
|
|
return emojis[key];
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+const {
|
|
|
|
|
+ appContext: {
|
|
|
|
|
+ config: { globalProperties: global }
|
|
|
|
|
+ }
|
|
|
|
|
+} = getCurrentInstance();
|
|
|
|
|
+
|
|
|
const message = ref('');
|
|
const message = ref('');
|
|
|
const teamInfo = ref({});
|
|
const teamInfo = ref({});
|
|
|
const list = ref([]);
|
|
const list = ref([]);
|
|
@@ -112,19 +124,59 @@ function submit(e) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
- setTimeout(() => {
|
|
|
|
|
- getTeam(teamId.value).then(value => {
|
|
|
|
|
- teamInfo.value = value;
|
|
|
|
|
- });
|
|
|
|
|
- getHistroy(teamId.value).then(value => {
|
|
|
|
|
- console.log(value);
|
|
|
|
|
- list.value = value;
|
|
|
|
|
|
|
+function afterRead(e) {
|
|
|
|
|
+ sendMsg(
|
|
|
|
|
+ e.file,
|
|
|
|
|
+ teamId.value,
|
|
|
|
|
+ msg => {
|
|
|
|
|
+ console.log(msg);
|
|
|
|
|
+ list.value = getPushMsg(msg, list.value);
|
|
|
|
|
+
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
goBottom();
|
|
goBottom();
|
|
|
});
|
|
});
|
|
|
- });
|
|
|
|
|
- }, 1000);
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ 'Image'
|
|
|
|
|
+ );
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+const route = new useRoute();
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ if (route.query.teamId) {
|
|
|
|
|
+ teamId.value = route.query.teamId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ setTimeout(
|
|
|
|
|
+ () => {
|
|
|
|
|
+ global.$toast.loading({
|
|
|
|
|
+ message: '加载中...',
|
|
|
|
|
+ forbidClick: true
|
|
|
|
|
+ });
|
|
|
|
|
+ getTeam(teamId.value).then(value => {
|
|
|
|
|
+ teamInfo.value = value;
|
|
|
|
|
+ });
|
|
|
|
|
+ getHistroy(teamId.value).then(value => {
|
|
|
|
|
+ console.log(value);
|
|
|
|
|
+ list.value = getPushMsg(value, list.value);
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ global.$toast.clear();
|
|
|
|
|
+ goBottom();
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ nim.on('msg', msg => {
|
|
|
|
|
+ console.log(msg);
|
|
|
|
|
+ if (msg.to === teamId.value) {
|
|
|
|
|
+ list.value = getPushMsg(msg, list.value);
|
|
|
|
|
+
|
|
|
|
|
+ nextTick(() => {
|
|
|
|
|
+ goBottom();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ store.state.neteaseUser ? 50 : 1000
|
|
|
|
|
+ );
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
@@ -193,4 +245,31 @@ onMounted(() => {
|
|
|
font-size: 24px;
|
|
font-size: 24px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+.file-upload {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ .van-uploader {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+/deep/input:-webkit-autofill {
|
|
|
|
|
+ box-shadow: 0 0 0px 1000px #222426 inset;
|
|
|
|
|
+ -webkit-text-fill-color: #898989;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.van-nav-bar {
|
|
|
|
|
+ --van-nav-bar-background-color: #1c1c1c;
|
|
|
|
|
+ --van-nav-bar-icon-color: #fff;
|
|
|
|
|
+ --van-nav-bar-title-text-color: #fff;
|
|
|
|
|
+ --van-nav-bar-text-color: #fff;
|
|
|
|
|
+ --van-border-color: #1c1c1c;
|
|
|
|
|
+ --van-nav-bar-title-font-size: 16px;
|
|
|
|
|
+ --van-font-weight-bold: bold;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|