新版交易所前段管理后台
1
jhzh
2025-08-18 1107fcd6f49bf9543b23e1b74160f2dc9162bb3d
src/views/main.vue
@@ -1,13 +1,11 @@
<template>
  <div
    class="site-wrapper"
    :class="{ 'site-sidebar--fold': sidebarFold }"
    v-loading.fullscreen.lock="loading"
   <div class="site-wrapper" :class="{ 'site-sidebar--fold': sidebarFold }" v-loading.fullscreen.lock="loading"
    element-loading-text="拼命加载中">
    <template v-if="!loading">
      <main-navbar />
      <main-sidebar v-if="!isShowService"/>
      <div class="site-content__wrapper" :style="{ 'min-height': documentClientHeight + 'px' }" v-if="!isShowService">
         <div class="site-content__wrapper" :style="{ 'min-height': documentClientHeight + 'px' }"
            v-if="!isShowService">
        <main-content />
      </div>
      <div class="site-content__wrapper" :style="{
@@ -26,7 +24,9 @@
  import MainSidebar from './main-sidebar'
  import MainContent from './main-content'
  import MainService from './main-service.vue'
  import {menuTipAdd} from '../config'
   import {
      menuTipAdd
   } from '../config'
  export default {
    data () {
      return {
@@ -43,29 +43,49 @@
    },
    computed: {
      documentClientHeight: {
        get () { return this.$store.state.common.documentClientHeight },
        set (val) { this.$store.commit('common/updateDocumentClientHeight', val) }
            get() {
               return this.$store.state.common.documentClientHeight
            },
            set(val) {
               this.$store.commit('common/updateDocumentClientHeight', val)
            }
      },
      sidebarFold: {
        get () { return this.$store.state.common.sidebarFold }
            get() {
               return this.$store.state.common.sidebarFold
            }
      },
      userId: {
        get () { return this.$store.state.user.id },
        set (val) { this.$store.commit('user/updateId', val) }
            get() {
               return this.$store.state.user.id
            },
            set(val) {
               this.$store.commit('user/updateId', val)
            }
      },
      userName: {
        get () { return this.$store.state.user.name },
        set (val) { this.$store.commit('user/updateName', val) }
            get() {
               return this.$store.state.user.name
            },
            set(val) {
               this.$store.commit('user/updateName', val)
            }
      },
      googleAuthBind:{
        get () { return this.$store.state.user.googleAuthBind },
        set (val) { this.$store.commit('user/googleAuthBind', val) }
            get() {
               return this.$store.state.user.googleAuthBind
            },
            set(val) {
               this.$store.commit('user/googleAuthBind', val)
            }
      },
      kefuInfo: {
        get () { 
          return this.$store.state.common.kefuInfo 
        },
        set (val) { this.$store.commit('common/updateKefuInfo', val) }
            set(val) {
               this.$store.commit('common/updateKefuInfo', val)
            }
      },
    },
    created () {
@@ -103,7 +123,9 @@
          url: this.$http.adornUrl('/sys/user/info'),
          method: 'get',
          params: this.$http.adornParams()
        }).then(({data}) => {
            }).then(({
               data
            }) => {
          this.loading = false
          this.userId = data.userId
          this.userName = data.username
@@ -131,7 +153,9 @@
          url: this.$http.adornUrl("/normal/adminPersonalCustomerAction!personalCustomer.action"),
          method: "get",
          data: this.$http.adornData({}),
        }).then(({ data }) => {
            }).then(({
               data
            }) => {
          console.log("personalCustomer = " + JSON.stringify(data));
          if(data.code == 0){
            let dataForm = data.data;
@@ -166,26 +190,27 @@
      },
      getNewTips2(){
        var time_stamp = localStorage.getItem("timeStamp");
        var params = {"timeStamp":time_stamp};//1688432842000
            var params = {
               "timeStamp": time_stamp
            }; //1688432842000
        localStorage.setItem("timeStamp",new Date().getTime());
        //start
        this.$http({
          url: this.$http.adornUrl('/tip/getNewTips'),
          method: 'get',
          params: this.$http.adornParams(Object.assign(
            {
            },
               params: this.$http.adornParams(Object.assign({},
            params
        ))
        }).then(({data}) => {
            }).then(({
               data
            }) => {
          // console.log("getNewTips data = " + JSON.stringify(data));
          if(data.code == 0){
            for(let i = 0 ; i < data.data.length ; i++){
              if(data.data[i].tip_message != null){
                setTimeout(()=>{
                  let type = data.data[i].tip_type;
                  switch(type)
                  {
                           switch (type) {
                    case "1": //充值
                      this.playAudioOfRecharge();
                      break;
@@ -195,8 +220,12 @@
                    case "3": //认证
                    this.playAudioOfRzzt();
                      break;
                              case "5": //合约
                                 this.playAudioOfContract();
                                 break;
                  }
                  this.openNewURL(data.data[i].tip_content_num,data.data[i].tip_url,data.data[i].tip_message);
                           this.openNewURL(data.data[i].tip_content_num, data.data[i].tip_url,
                              data.data[i].tip_message);
                },100*i)
                //this.openURL(data.data[i]);
              }
@@ -265,7 +294,9 @@
          url: this.$http.adornUrl('/tip/getTips'),
          method: 'get',
          params: this.$http.adornParams()
        }).then(({data}) => {
            }).then(({
               data
            }) => {
          // console.log("getTips data = " + JSON.stringify(data));
          var temp = data.data;
@@ -304,10 +335,10 @@
            //
            
            menuTipAdd.forEach((value,key) =>   {
              // console.log(key+":"+value);
              let all = 0;
              for(let i = 0 ; i < value.length ; i++){
                let num = this.tips[value[i]] || 0;
                        // let num =  0;
                all += num;
              }
              this.countHandle(key,all);
@@ -353,7 +384,7 @@
        // 业务
        this.countHandle(".automonitor_approve_order_untreated_cout", 0);
        this.countHandle(".automonitor_threshold_order_untreated_cout", 0);
        this.countHandle(".contract_order_untreated_cout", 0);
            this.countHandle(".contract_order_untreated_cout-0", 0);
        // 用户
        this.countHandle(".kyc_untreated_cout", 0);
        this.countHandle(".kyc_high_level_untreated_cout", 0);
@@ -373,6 +404,7 @@
          count = 0
        }
        this.tips[ele] = count;
            // this.tips[ele] = '10';
      },
      openNewURL(num,url,message) {
        let title = "新消息";
@@ -385,24 +417,29 @@
          position: 'bottom-right',
          customClass: 'notifyClass',// 这个样式只能放在无scoped的style中才能生效
          message: this.$createElement(
            'div',
            {class: 'notify_parent'},
                  'div', {
                     class: 'notify_parent'
                  },
            [
              this.$createElement(
                'div',
                { class: 'notify_div' },
                        'div', {
                           class: 'notify_div'
                        },
                [
                  this.$createElement(
                    'div',
                    { class: 'notify_title' },
                              'div', {
                                 class: 'notify_title'
                              },
                    [
                      this.$createElement(
                        'div',
                        { class: 'circle' },
                                    'div', {
                                       class: 'circle'
                                    },
                        [
                          this.$createElement(
                            'span',
                            {class: num < 10 ? 'text_num0' :  'text_num1'},
                                          'span', {
                                             class: num < 10 ? 'text_num0' : 'text_num1'
                                          },
                            num
                          )
                        ]
@@ -414,8 +451,9 @@
                      //   num
                      // ),
                      this.$createElement(
                        'span',
                        {class:'text'},
                                    'span', {
                                       class: 'text'
                                    },
                        title
                      )
                    ]
@@ -427,34 +465,31 @@
                ]
              ),
              this.$createElement(
                'div',
                {
                        'div', {
                  // domProps: {
                  //   innerHTML: '<em>你好啊</em>' // htmlString就是带HTML格式的字符串'<em>你好啊</em>'
                  // },
                  class: 'notifyContent'
                },
                [
                  this.$createElement('img',
                  {
                           this.$createElement('img', {
                    style: 'width: 46px;height: 46px;margin-top:20px; margin-left: 18px;',
                    attrs: {src: '/admin/new.png'}
                              attrs: {
                                 src: '/admin/new.png'
                              }
                  }),
                  this.$createElement('div',
                    {
                           this.$createElement('div', {
                      class: 'notifyContent1',
                    },
                    [
                      this.$createElement('div',
                      {
                                 this.$createElement('div', {
                        class: 'notifyContent2',
                        domProps: {
                          // innerHTML: '你<span style="color:#E05561">好啊</span>asasasss'
                          innerHTML: message
                        }
                      }),
                      this.$createElement('a',
                      {
                                 this.$createElement('a', {
                        class: 'notifyContent3',
                        style:"cursor:pointer;",
                        domProps: {
@@ -480,11 +515,21 @@
        this.$router.push({
          path: url
        });
        this.$bus.$emit('updateOfBasics',{flag:true});
        this.$bus.$emit('updateOfSenior',{flag:true});
        this.$bus.$emit('updateOfReset',{flag:true});
        this.$bus.$emit('updateOfRechange',{flag:true});
        this.$bus.$emit('updateOfWithdraw',{flag:true});
            this.$bus.$emit('updateOfBasics', {
               flag: true
            });
            this.$bus.$emit('updateOfSenior', {
               flag: true
            });
            this.$bus.$emit('updateOfReset', {
               flag: true
            });
            this.$bus.$emit('updateOfRechange', {
               flag: true
            });
            this.$bus.$emit('updateOfWithdraw', {
               flag: true
            });
        // this.$router.push({ path: "/user-relation-senior" });
      },
    }
@@ -492,19 +537,20 @@
</script>
<style lang="scss">
.notifyClass {
  background-color: #4F5158;
  border-radius: 10px;
  width: 360px;
  height: 116px;
}
.notify_title {
  margin-top: 5px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}
.notifyContent {
  display: flex;
  justify-content: space-between;
@@ -512,15 +558,18 @@
  height: 100px;
  overflow-y: auto;
  padding-right: 6px;
  &::-webkit-scrollbar {
    width: 5px;
    height: 7px;
    background-color: #fff;
  }
  &::-webkit-scrollbar-track {
    border-radius: 10px;
    background-color: #fff;
  }
  &::-webkit-scrollbar-thumb {
    height: 20px;
    border-radius: 10px;
@@ -564,6 +613,7 @@
  color: #f75343;
  margin-right: 5px;
}
.notify_div {
  display: flex;
  justify-content: space-between;
@@ -631,6 +681,4 @@
  text-align: left;
  margin-left: 10px;
}
</style>