交易所前端蓝色ui, 4.5 jiem
lxf
2025-04-18 66a33e936d39ec4db7fdffed5d646e044ccc43e9
src/page/customerService/index.vue
@@ -2,7 +2,7 @@
    <div class="service-box pb-150 flex flex-col">
        <van-nav-bar :title="$t('在线客服')" left-arrow @click-left="onClickLeft" fixed />
        <div class="flex-1" v-if="kefu_url">
            <iframe :src="kefu_url" width="100%" height="100%" frameborder="0"></iframe>
            <iframe :src="kefu_url+'?visiter_id='+userInfo.usercode+'&visiter_name='+userInfo.username+'&visiter_id='+userInfo.usercode" width="100%" height="100%" frameborder="0"></iframe>
        </div>
        <div v-else class="localKefu flex-1 flex">
            <div class="flex flex-col px-32 box-border flex-1" ref="boxScroll" style="overflow:auto;">
@@ -49,7 +49,7 @@
<script>
import { mapGetters } from "vuex";
import { _getMsg, _getUnreadMsg, _sendMsg } from '@/API/im.api'
import { _uploadImage } from '@/API/fund.api'
import { _uploadImage,_getIdentify } from '@/API/fund.api'
import { Uploader, ImagePreview } from 'vant'
export default {
    name: 'CustomerService',
@@ -65,19 +65,35 @@
            unread: 0,
            finished: false, // 没有历史消息
            currentScrollTop: 0,
            isScrollBottom: false
            isScrollBottom: false,
         userid:'',
         username:'',
        }
    },
    computed: {
        ...mapGetters('home', ['kefu_url'])
        ...mapGetters('home', ['kefu_url']),
      ...mapGetters({
          userInfo: 'user/userInfo',
          theme: 'home/theme'
      }),
      // kefu_url() {
      //       return `https://kf.serverspay.com/index/index/home?visiter_id=${this.visiterId}&visiter_name=${encodeURIComponent(this.visiterName)}&avatar=&business_id=${this.businessId}&groupid=${this.groupId}&special=${this.special}`;
      //     }
    },
    created() {
        this.fetchList()
    },
    mounted() {
        window.addEventListener('scroll', this.handleScroll, true)
      // this.getIdentify()
    },
    methods: {
      // getIdentify() {
      //     _getIdentify().then(data => {
      //         this.userid = data.id
      //         this.username = data.name
      //     })
      // },
        onOversize(file) {
            console.log(file);
            this.$toast(this.$t('文件大小不能超过10m'));
@@ -130,7 +146,8 @@
                    if (this.isScrollBottom) {
                        this.$refs.boxScroll.scrollTop = this.$refs.boxScroll.scrollHeight - this.$refs.boxScroll.offsetHeight
                    }
                    this.currentScrollTop = this.$refs.boxScroll.scrollTop;
                    // this.currentScrollTop = this.$refs.boxScroll.scrollTop;
               this.currentScrollTop = '100';
                    if (data.length < 10) {
                        this.finished = true
                    }