<template>
  <!--在线客服-->
  <div class="kefu">
    <div class="kefu_itemKf">
      <a :href="bottomBase.online_service" target="_blank">
        <img src="https://img.bjzxtw.org.cn/pre/public/image/online1.png">
        <p>在线客服</p>
      </a>
    </div>
    <div class="kefu_itemQQ">
      <img src="https://img.bjzxtw.org.cn/pre/public/image/qq1.png">
      <p>QQ客服</p>
      <div class="kefu_item_content_QQ">
          <div @click="addQQFriend(bottomBase.customer_service_qq)" class="qqadd">
              <img :src="bottomBase.service_qq_img" width="100" v-if="bottomBase.service_qq_img">
              <div class="qqfs">{{bottomBase.customer_service_qq}}</div>
          </div>
          <div @click="addQQFriend(bottomBase.communications)" class="qqadd">
              <img :src="bottomBase.communications_img" width="100" v-if="bottomBase.communications_img">
              <div class="qqfs">{{bottomBase.communications}}</div>
          </div>
          <div class="arrow"></div>
      </div>
    </div>
    <div class="kefu_itemPhone">
      <img src="https://img.bjzxtw.org.cn/pre/public/image/dianhua1.png">
      <p>电话客服</p>
      <div class="kefu_item_content_phone">
          <div class="kefu_item_content_phone_title">联系电话：</div>
          <div>{{bottomBase.customer_service}}</div>
          <div class="arrow"></div>
      </div>
    </div>
  </div>
</template>

<script setup>
  const props = defineProps({
    bottomBase: {
      type: Object,
      required: true
    }
  })

  //添加网站客服
  function addQQFriend(qqNumber) {
    let qq = qqNumber.match(/\d+/g);
    // 使用tencent协议唤起QQ客户端并添加好友
    window.location.href = `tencent://message/?uin=${qq}&Site=&Menu=yes`;
  }
</script>

<style lang="less" scoped>
  @import url('@/assets/css/public/kefu.less');
</style>