<template>
  <view class="my-container">
    <view v-if="cfgStatus.showDetail" class="wheel-selector-fixed">
      <WheelSelector :options="wheelOptions" :selectedIndex="wheelSelectedIndex"
        :bgImg="$baseUrl + 'my/track/track.png'" :iconNormal="$baseUrl + 'my/track/icon_stage_nor.png'"
        :iconSelected="$baseUrl + 'my/track/icon_stage_sel.png'"
        @update:selectedIndex="(val) => (wheelSelectedIndex = val)" @change="handleWheelChange" />
    </view>
    <view class="bg-container" :data-log="{
      xcxClick: '我的页面点击',
      pageName: '我的页面',
      buttonName: '个人信息修改',
    }" @click="handleEditProfile">
      <image class="bg-img" :src="babyInfo?.content?.backgroundImg || $baseUrl + 'my/default_bg.png'
        " mode="widthFix" lazy-load="false" binderror="" bindload="" />
      <image class="banner_cover" :src="$baseUrl + 'my/cover_white.png'" mode="aspectFill" />
    </view>

    <button v-if="!cfgStatus.isRegister" type="primary" class="phone-button" open-type="getPhoneNumber"
      @getphonenumber="getRealtimePhoneNumber" />

    <!-- 用户信息区域 -->
    <view class="user-info" :style="{ 'min-height': cfgStatus.showDetail ? '343rpx' : '180rpx' }">
      <view class="user-header">
        <view class="avatar-container" :data-log="{
          xcxClick: '我的页面点击',
          pageName: '我的页面',
          buttonName: '个人信息修改',
        }" @click="handleEditProfile">
          <image class="avatar" :src="babyInfo?.content?.babyAvatar ||
            $baseUrl + 'common/default_avatar.png'
            " mode="widthFix" />
        </view>
        <image class="avatar-modify" :src="$baseUrl + 'my/icon_modify.png'" mode="aspectFit" lazy-load="false" />

        <view class="user-detail">
          <view class="user-detail-nickname" :data-log="{
            xcxClick: '我的页面点击',
            pageName: '我的页面',
            buttonName: '宝宝信息切换',
          }" @click="handleChangeBaby">
            <text class="nickname">{{
              babyInfo?.babyStage === 0
                ? "备孕"
                : babyInfo?.babyStage === 1
                  ? "孕中"
                  : babyInfo.babyName || "暂无昵称"
            }}</text>
            <image class="user-detail-nickname-icon" :src="$baseUrl + 'registerLayer/icon_arrow_yellow.png'"
              mode="aspectFit" />
          </view>
          <!-- 积分账户 -->
          <view class="integral-account">
            <text class="integral-account-text"> 账号： </text>
            <text class="integral-account-value">
              {{ userStore.memberInfo?.mobile || '' }}</text>
          </view>

          <BabySwitcher v-if="showBabySwitcher" :show="showBabySwitcher" :babyList="babyInfo.allBabyBaseInfo || []"
            :addIcon="$baseUrl + 'my/baby_add_btn.png'" @close="showBabySwitcher = false" @select="onSelectBaby"
            @add="onAddBaby" />
        </view>

        <view class="integralContainer" @click="handleIntegralClick">
            <image
              class="integralIcon"
              src="https://course.feihe.com/momclub-picture/my/integralBg.png"
              mode="aspectFit"
            />
            <text class="integralText0">{{ babyInfo.points || "0" }}</text>
            <text class="integralText1">积分</text>
          </view>
      </view>
      <!-- user desc -->
      <view v-if="cfgStatus.showDetail" class="user-desc">
        <view class="desc-top">
          <text class="desc-title">宝宝变化</text>
          <text class="desc-age">
            {{ wheelOptions[wheelSelectedIndex]?.label }}
          </text>
        </view>

        <view class="desc-content">
          <text class="desc-text">{{
            wheelOptions[wheelSelectedIndex]?.desc.length > 46
              ? cfgStatus.openBabyCardDesc
                ? wheelOptions[wheelSelectedIndex]?.desc
                : wheelOptions[wheelSelectedIndex]?.desc.slice(0, 46) + "..."
              : wheelOptions[wheelSelectedIndex]?.desc
          }}
          </text>
          <text v-if="wheelOptions[wheelSelectedIndex]?.desc.length > 46" class="desc-more" @click="handleOpenClick">{{
            cfgStatus.openBabyCardDesc ? "点击收起" : "点击展开" }}</text>
        </view>
      </view>
    </view>
    <!-- 工具 -->
    <view class="tool-container">
      <text class="tool-title"> 工具 </text>
      <view class="tool-list">
        <view class="tool-item" v-for="item in toolList" :key="item.title" @click="handleToolClick(item)">
          <image class="tool-icon" :src="$baseUrl + item.bgUrl" mode="aspectFit" />
          <!-- || item.title == '产检提醒' || item.title == '喂养记录' || item.title == '生长测评' -->
          <button
            v-if="(item.title == '医生问诊') && !cfgStatus.isRegister"
            class="tool-btn-register" type="primary" open-type="getPhoneNumber"
            @getphonenumber="getRealtimePhoneNumber" />
        </view>
      </view>
    </view>

    <view class="vip-active-area" v-if="pageCfgStore?.contentCfg?.activeInfo?.length > 0">
      <text class="vip-title">精彩活动</text>
      <swiper class="vip-active-swiper" :indicator-dots="pageCfgStore?.contentCfg?.activeInfo?.length > 1"
        :autoplay="true" :circular="true" indicator-color="#dfddd9" indicator-active-color="#b27c1e"
        :indicator-top="32">
        <swiper-item v-for="(item, index) in pageCfgStore?.contentCfg?.activeInfo" :key="index">
          <image class="vip-active-img" :src="item?.img" mode="aspectFit" @click="handleVipActiveClick(index, item)" />
        </swiper-item>
      </swiper>
    </view>

    <!-- 协议 -->
    <view class="protocol-container">
      <image :src="$baseUrl + 'my/protocol.png'" mode="aspectFit" />
      <view class="hot-member" :data-log="{
        xcxClick: '我的页面点击',
        pageName: '我的页面',
        buttonName: '会员规则',
      }" @click="handleHot" data-type="member"></view>
      <view class="hot-privacy" :data-log="{
        xcxClick: '我的页面点击',
        pageName: '我的页面',
        buttonName: '隐私协议',
      }" @click="handleHot" data-type="privacy"></view>
    </view>
    <RegisterLayer v-model="showRegisterLayer" @confirm="onRegisterConfirm" />
  </view>

  <!-- 生日弹窗  type  3 钻石、4 星光、5 星耀 -->
  <!-- <popup-shengri v-if="isTip" type="3" @close="isTip = false"></popup-shengri> -->


  <!-- 精选好卷弹窗 isUnlock  // 是否解锁 商品兑换券  type  1 黄金、2 铂金、3 钻石、4 星光、5 星耀 -->
  <!-- <popup-jingxuan v-if="isTip" type="1" isUnlock="true" @close="isTip = false"></popup-jingxuan> -->

  <!-- 新人礼券弹窗  type 1 黄金、2 铂金、3 钻石、4 星光、5 星耀-->
  <!-- <popup-xinren v-if="isTip" type="1" @close="isTip = false"></popup-xinren> -->

</template>

<script setup>
import { ref, onMounted, getCurrentInstance, computed, watch } from "vue";
import RegisterLayer from "../components/RegisterLayer.vue";
import BabySwitcher from "../components/BabySwitcher.vue";
import WheelSelector from "../components/WheelSelector.vue";
import { useUserStore } from "@/stores/user";
import { usePageCfgStore } from "@/stores/pageCfg";
import { jump, JumpType } from "@/utils";
import { getHealthField } from "@/api/common";
import { hideLoading, showLoading } from "../utils";
import md from "../md.js";

const { proxy } = getCurrentInstance();
const $baseUrl = proxy.$baseUrl;

const userStore = useUserStore();
const pageCfgStore = usePageCfgStore();
const cfgStatus = ref({
  openBabyCardDesc: false,
  showDetail: false,
  isRegister: true,
});

const wheelOptions = ref([]);
const wheelSelectedIndex = ref(0);

const toolList = computed(() => pageCfgStore?.toolList || []);

const babyInfo = computed(() => userStore?.babyInfo || {});

const showRegisterLayer = ref(false);
const showBabySwitcher = ref(false);

const babyId = ref(0);

const handleHot = (e) => {
  const type = e.currentTarget.dataset.type;
  md.sensorLog(e);

  console.log("handleHot", type);
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "查看协议",
    componentContent: type === "member" ? "会员规则" : "隐私协议"
  })
  if (type === "member") {
    
    navigateTo("/pages/webview/webview?type=MEMBER_URL");
  } else if (type === "privacy") {
    navigateTo("/pages/webview/webview?type=PRIVACY_URL");
  }
};


// 页面跳转
const navigateTo = (url) => {
  uni.navigateTo({
    url,
    animationDuration: 0,
    fail: (err) => {
      console.error("页面跳转失败:", err);
      uni.showToast({
        title: "页面跳转失败",
        icon: "none",
      });
    },
  });
};

const handleToolClick = async (item) => {
  md.sensorLogTake({
    xcxClick: "我的页面点击",
    pageName: "我的页面",
    buttonName: item.title,
  });
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "工具",
    componentContent: item.title
  })
  // 跳转产检提醒页面判断

  // let listData = userStore.babyInfo ? userStore.babyInfo.allBabyBaseInfo : []

  if (item.title === "医生问诊") {
    if (!cfgStatus.value.isRegister) return;

    const res = await getHealthField();

    if (!res.success) {
      uni.showToast({
        title: "获取健康字段失败",
        icon: "none",
      });
      return;
    }

    const { sign, timestamp, appId, partnerUserId, env } = res.data;

    jump({
      type: JumpType.MINI,
      url: "/pages/partner/redirect",
      extra: {
        appId: "wx81ecfb5aa3fb512f",
        envVersion: env,
        extraData: {
          sign, // 参考 4.请求参数
          timestamp, // 参考 4.请求参数
          appId, // 参考 4.请求参数
          partnerUserId, // 参考 4.请求参数
          targetApp:
            "/h5/partner/shining-like-a-start/landing-free-consult?sysType=CRF",
        },
      },
    });
  }
  // 三个工具校验是否授权
  else if (item.title === "生长测评" || item.title === "喂养记录" || item.title === "产检提醒") {
    // if (!cfgStatus.value.isRegister) return;
    jump({ type: item.link.type, url: item.link.url });
  }
  else {
    jump({ type: item.link.type, url: item.link.url });
    // const extra = item.link.extra;
    // if(extra && extra.babyId){
    //   jump({ type: item.link.type, url: item.link.url+'?babyId='+extra.babyId});
    // }else{
    //   jump({ type: item.link.type, url: item.link.url});
    // }
  }
};
//跳转到ai取名页面
// const toAiNaming = () => {
// 	jump({
//       type: JumpType.INNER,
//       url: "/pages/naming/naming",
// 	})
// };

// 编辑个人资料
const handleEditProfile = (e) => {

  
  if (
    !cfgStatus.value.isRegister ||
    !userStore.userInfo ||
    JSON.stringify(userStore.userInfo) === "{}"
  ) {
    return;
  }

  md.sensorLog(e);
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "资料编辑"
  })

  const type = userStore.babyInfo?.allBabyBaseInfo?.length == 0 ? "add" : "edit";
  babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
    (item) => item.selected
  )?.id;

  if (type === "edit") {
    navigateTo(`/pages/person/person?type=${type}&id=${babyId.value}`);
  } else {
    navigateTo(`/pages/person/person?type=${type}`);
  }
};

const onRegisterConfirm = (data) => {
  showRegisterLayer.value = false;
};

const handleWheelChange = (val) => {
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "月龄定位器",
    componentContent: babyInfo.value.babyStage == 2
      ? "月龄滑动切换-" + val
      : "孕周滑动切换-" + val
  });
}

const initExposure = () => {

  md.sensorComponentLogTake({
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "资料编辑"
  });

  toolList.value.forEach((item, index) => {
    md.sensorComponentLogTake({
      xcxComponentExposure: "true",
      pageName: "我的页面",
      componentName: "工具",
      componentContent: item.title
    });
  });
  if (pageCfgStore?.contentCfg?.activeInfo?.length > 0) {
    pageCfgStore.contentCfg.activeInfo.forEach((item, index) => {
      md.sensorComponentLogTake({
        xcxComponentExposure: "true",
        pageName: "我的页面",
        componentName: "精彩活动",
        componentContent: "精彩活动-" + item.title
      });
    });
  }
  md.sensorComponentLogTake({
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "查看协议",
    componentContent: "会员规则"
  });
  md.sensorComponentLogTake({
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "查看协议",
    componentContent: "隐私协议"
  });

  md.sensorComponentLogTake({
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "月龄定位器",
    componentContent: babyInfo.value.babyStage == 2 ? "月龄滑动切换" : "孕周滑动切换"
  });




}

// 获取用户信息
const initData = async () => {
  if (
    userStore?.userInfo?.memberId &&
    userStore?.userInfo?.memberId == "not_login"
  ) {
    cfgStatus.value.isRegister = false;
    cfgStatus.value.showDetail = false;
    return;
  }
  const __showDetail = [1, 2].includes(babyInfo.value.babyStage);

  cfgStatus.value.isRegister = true;
  // 已出生或孕中显示
  cfgStatus.value.showDetail = __showDetail;



  if (__showDetail) {
    wheelOptions.value =
      babyInfo.value.babyStage == 2
        ? pageCfgStore.wheelOptionsYL
        : pageCfgStore.wheelOptionsYZ;
    const index = wheelOptions.value.findIndex(
      (item) => item.label == babyInfo.value.babyAge
    );
    wheelSelectedIndex.value = index > 0 ? index : 0;
  }
};

const handleIntegralClick = () => {
  md.sensorLogTake({
    xcxClick: "我的页面-首屏页面点击",
    pageName: "我的页面-首屏",
    buttonName: "积分明细",
  });
  const urlStr = 'https://mom.feihe.com/member/mine/newPointDetail?crmId={crmid}&appCode=XMH';
  const url = urlStr.replace("{crmid}", userStore.babyInfo?.memberId);
  console.log('积分明细链接：==',url)

  jump({
    type: 3,
    url: url
  })
}

const getRealtimePhoneNumber = async (e) => {
  console.log("获取手机号码", e);

  if (e.detail.errMsg !== "getPhoneNumber:ok") {
    uni.showToast({
      title: "请授权使用手机号",
      icon: "none",
    });
    return;
  }
  await userStore.phoneCallback(e.detail, () => {
    showRegisterLayer.value = true;
  });
};

const handleChangeBaby = (e) => {
  if (!cfgStatus.value.isRegister) {
    return;
  }

  md.sensorLog(e);
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "展开"
  })
  md.sensorComponentLogTake({
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "新增"
  })
  md.sensorComponentLogTake({
    xcxComponentExposure: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "状态切换"
  })

  showBabySwitcher.value = true;
};

async function onSelectBaby(baby) {
  // 处理宝宝切换逻辑
  showBabySwitcher.value = false;

  showLoading();
  await userStore.changeBabySelected(baby.id);

  hideLoading();
  console.log("onSelectBaby", baby);
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "状态切换"
  })
}

function onAddBaby() {
  md.sensorLogTake({
    xcxClick: "我的页面点击",
    pageName: "我的页面",
    buttonName: "新增入口",
  });
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "资料编辑",
    componentContent: "新增"
  })

  // 跳转到新增宝宝页面
  showBabySwitcher.value = false;
  navigateTo("/pages/person/person?type=add");
}

const handleOpenClick = () => {
  md.sensorLogTake({
    xcxClick: "我的页面点击",
    pageName: "我的页面",
    buttonName: cfgStatus.value.openBabyCardDesc ? "收起" : "展开",
  });
  cfgStatus.value.openBabyCardDesc = !cfgStatus.value.openBabyCardDesc;
};

// 页面加载
onMounted(async () => {
  md.sensorLogTake({
    xcxPage: "我的页面浏览",
    pageName: "我的页面",
  });
  showLoading();
  await userStore.loadMemberInfo();

  await pageCfgStore.fetchCfg();

  console.log("pageCfgStore.contentCfg====", pageCfgStore.contentCfg);
  initData();
  initExposure();



  hideLoading();


  babyId.value = userStore.babyInfo?.allBabyBaseInfo?.find(
    (item) => item.selected
  )?.id;

  // const a = {
  //   "bgUrl": "my/shengzhangTools.png",
  //   "desc": "生长测评",
  //   "link": {
  //     "type": 1,
  //     "url": "/pages/shengzhangTools/shengzhangTools"
  //   },
  //   "title": "生长测评"
  // }
  // const b = {
  //   "bgUrl": "my/icon_feed.png",
  //   "desc": "喂养记录",
  //   "link": {
  //     "extra": { babyId: babyId.value },
  //     "type": 1,
  //     "url": "/pages/feedingIndex/feedingIndex"
  //   },
  //   "title": "喂养记录"
  // }
  // const c = {
  //   "bgUrl": "my/icon_remind.png",
  //   "desc": "产检提醒",
  //   "link": {
  //     "extra": { babyId: babyId.value },
  //     "type": 1,
  //     "url": "/pages/postnatalCheckUp/postnatalCheckUp"
  //   },
  //   "title": "产检提醒"
  // }

  // toolList.value.push(a);
  // toolList.value.push(b);
  // toolList.value.push(c);
});

watch([() => userStore.userInfo, () => userStore.babyInfo], () => {
  console.log("userInfo/babyInfo变化", userStore.userInfo, userStore.babyInfo);
  initData();
  babyId.value = userStore.babyInfo?.allBabyBaseInfo.find(
    (item) => item.selected
  )?.id;
});

//会员活动点击事件
const handleVipActiveClick = (index, item) => {
  let buttonName = '';
  switch (index) {
    case 0:
      buttonName = '第一张焦点图';
      break;
    case 1:
      buttonName = '第二张焦点图';
      break;
  }

  md.sensorLogTake({
    xcxClick: "我的页面点击",
    pageName: "我的页面",
    buttonName: buttonName,
  });
  md.sensorComponentLogTake({
    xcxComponentClick: "true",
    pageName: "我的页面",
    componentName: "精彩活动",
    componentContent: "精彩活动-" + item.title
  })
  const url = item?.url;
  const type = item?.type;
  const extra = item?.extra;

  jump({
    type: type,
    url: url,
    extra: extra
  })
}

// 定义页面配置
defineExpose({});
</script>
<style lang="less" scoped>
@import "@/common.less";

.my-container {
  min-height: 100vh;
  background-color: #f5f5f5;
  padding-bottom: 100rpx;
  overflow: hidden;

  .wheel-selector-fixed {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
  }

  .phone-button {
    position: absolute;
    z-index: 3;
    width: 686rpx;
    height: 180rpx;
    top: 676rpx;
    left: 50%;
    transform: translateX(-50%);
    border: none;
    background: transparent;
    opacity: 0;
  }

  .bg-container {
    width: 750rpx;
    height: 840rpx;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;

    .bg-img {
      width: 100%;
      height: 100%;
      display: block;
    }

    .banner_cover {
      width: 100%;
      height: 239rpx;
      position: absolute;
      bottom: -10rpx;
      left: 0;
      z-index: 1;
      display: block;
    }
  }

  .user-info {
    background-color: @color-white-soft;

    width: 686rpx;
    min-height: 343rpx;
    box-sizing: border-box;
    border-radius: 32rpx;
    position: relative;
    margin: 0 auto;
    margin-top: 676rpx;
    display: flex;

    .user-header {
      display: flex;
      align-items: center;
      position: absolute;
      width: 100%;

      .avatar-container {
        width: 100rpx;
        height: 100rpx;
        background-color: #f6f6f6;
        overflow: hidden;
        border-radius: 50%;

        position: absolute;
        left: 32rpx;
        top: 32rpx;
        z-index: 1;

        .avatar {
          width: 100%;
          height: 100%;
          display: block;
        }
      }

      .avatar-modify {
        width: 64rpx;
        height: 64rpx;
        position: absolute;
        left: 80rpx;
        top: 84rpx;
        z-index: 1;
        display: block;
        pointer-events: none;
      }

      .user-detail {
        display: flex;
        flex-direction: column;

        position: absolute;
        left: 148rpx;
        top: 48rpx;
        z-index: 1;

        .user-detail-nickname {
          display: flex;
          align-items: center;
        }

        .user-detail-nickname-icon {
          width: 20rpx;
          height: 12rpx;
          display: block;
          margin-left: 20rpx;
          margin-top: -10rpx;
        }

        .nickname {
          font-size: 32rpx;
          font-weight: 500;
          color: #333;
          margin-bottom: 10rpx;
        }

        .integral-account {
          display: flex;
          font-size: 24rpx;
          color: #1d1e25;

          .integral-account-text {
            color: #1d1e25;
          }
        }

      }


      .integralContainer {
          position: absolute;
          top: 0rpx;
          right: 0rpx;
            width: 226rpx;
            height: 166rpx;
          .integralIcon {
            position: absolute;
            width: 226rpx;
            height: 166rpx;
            right: 0rpx;
          }
          .integralText0 {
            position: absolute;
            font-size: 24rpx;
            color: #1d1e25;
            top: 45rpx;
            right: 0rpx;
            width: 167rpx;
            text-align: center;
          }
          .integralText1 {
            position: absolute;
            font-size: 24rpx;
            color: #1d1e25;
            width: 167rpx;
            text-align: center;
            right: 0rpx;
            top: 81rpx;

          }
        }

      .edit-btn {
        image {
          width: 40rpx;
          height: 40rpx;
        }
      }
    }

    .user-stats {
      display: flex;
      justify-content: space-around;

      .stat-item {
        display: flex;
        flex-direction: column;
        align-items: center;

        .num {
          font-size: 36rpx;
          font-weight: 500;
          color: #333;
          margin-bottom: 8rpx;
        }

        .label {
          font-size: 24rpx;
          color: #666;
        }
      }
    }

    .user-desc {
      width: 100%;
      height: calc(100% - 161rpx);
      background-color: #fff;
      border-radius: 32rpx;
      padding: 32rpx 30rpx;
      box-sizing: border-box;
      margin-top: 180rpx;

      .desc-top {
        display: flex;
        align-items: center;
      }

      .desc-title {
        font-size: 32rpx;
        font-weight: 500;
        color: @color-black-deep;
      }

      .desc-age {
        font-size: 24rpx;
        color: @color-gold-cover;
        background-color: #fef7f2;
        padding: 7rpx 10rpx;
        border-radius: 10rpx;
        margin-left: 8rpx;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
      }

      .desc-text {
        font-size: 24rpx;
        line-height: 34rpx;
        display: inline-block;
      }

      .desc-more {
        font-size: 24rpx;
        color: @color-gold-cover;
        line-height: 34rpx;
        display: block;

        text-align: right;
      }

      .desc-content {
        margin-top: 32rpx;
        position: relative;
      }
    }
  }

  .user-info-min {
    min-height: 180rpx;
  }

  .tool-container {
    margin: 0 auto;
    margin-top: 48rpx;
    width: 686rpx;

    .tool-title {
      font-size: 32rpx;
      font-weight: 500;
      color: @color-black-deep;
      margin-left: 21rpx;
    }

    .tool-list {
      display: flex;
      flex-wrap: wrap;

      margin-top: 20rpx;

      .tool-item {
        width: 152rpx;
        height: 152rpx;
        margin-left: 26rpx;
        margin-bottom: 24rpx;
        position: relative;

        .tool-icon {
          width: 100%;
          height: 100%;
          display: block;
        }

        &:nth-child(4n + 1) {
          margin-left: 0;
        }

        .tool-btn-register {
          position: absolute;
          width: 152rpx;
          height: 152rpx;
          top: 0;
          left: 0;
          opacity: 0;
        }
      }
    }
  }

  .vip-active-area {
    margin-left: 28rpx;
    margin-top: 60rpx;
    .vip-title {
      margin-left: 20rpx;
    }
    .vip-active-swiper {
      width: 692rpx;
      height: 204rpx;
			flex-shrink: 0;
			margin-top: 30rpx;
      margin-bottom: 100rpx;
			
			.vip-active-img {
				width: 100%;
				height: 100%;
				border-radius: 32rpx;
			}
    }
  }

  .protocol-container {
    width: 360rpx;
    height: 25rpx;
    margin: 8rpx auto 130rpx;
    position: relative;

    image {
      width: 100%;
      height: 100%;
      display: block;
    }

    .hot-member {
      width: 142rpx;
      height: 50rpx;
      display: block;
      position: absolute;
      left: 53rpx;
      top: -15rpx;
    }

    .hot-privacy {
      width: 147rpx;
      height: 50rpx;
      display: block;
      position: absolute;
      left: 210rpx;
      top: -15rpx;
    }
  }
}
</style>

