<script setup lang="ts">
import { useUserStore } from '@/store';
const userStore = useUserStore();

function navigateTo(url: string) {
  if(userStore.checkLogin()) {
    uni.navigateTo({
      url,
    });
  }
}


function onFabClick() {
  navigateTo('/pages/ai/recommend/index')
}
</script>

<template>
  <!-- 仅 AI 跳转做右侧球体悬浮 -->
  <view
    class="ai-floating"
  >
    <view class="ai-fab" @click="onFabClick">
      <image src="@/static/app/images/aidiancan.gif" class="ai-icon"></image>
    </view>
  </view>
</template>

<style scoped lang="scss">
.ai-floating {
  position: fixed;
  right: 12rpx;
  top: 83%;
  z-index: 88;
  display: block;
  transform: translateY(-50%) translateX(0);
  transition: transform 0.22s ease;
}

.ai-floating.is-collapsed {
  transform: translateY(-50%) translateX(55rpx);
}

.ai-icon {
  width: 260rpx;
  height: 260rpx;
  margin-right:-70rpx !important;
}
</style>