<template>
  <!--在线客服-->
  <div class="kefu">
    <div class="kefu_itemKf">
      <a :href="bottomBase.online_service" target="_blank">
        <img src="http://192.168.1.234:19000/pre/image/png/20251226/1766713607126883.png">
        <p>在线客服</p>
      </a>
    </div>
    <div class="kefu_itemQQ">
      <img src="http://192.168.1.234:19000/pre/image/png/20251226/1766713568946747.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="http://192.168.1.234:19000/pre/image/png/20251226/1766713594992328.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>