<template>
  <view class="content">
    <view class="top_bg pdx-32">
      <view class="w h-88 mgt-88" @click="$navTo('/pages/index/search')">
        <view class="input_box flex ai_center jc_between">
          <view class="text-32 text-400 text-C0C0C0">任务标题、用户ID</view>
          <image class="w-48 h-48" src="/static/logo.png" mode="scaleToFill" />
        </view>
      </view>
    </view>

    <view class="banner">
      <u-swiper
        :list="list6"
        @change="(e) => (currentNum = e.current)"
        :autoplay="false"
        indicatorStyle="right: 20px"
      >
        <view slot="indicator" class="indicator-num">
          <text class="indicator-num__text"
            >{{ currentNum + 1 }}/{{ list6.length }}</text
          >
        </view>
      </u-swiper>
    </view>

    <view
      class="w h-88 pdx-32 flex jc_between ai_center mgt-24"
      @click="$navTo('/pages/index/notice')"
    >
      <view class="flex ai_center">
        <image class="w-48 h-48" src="/static/logo.png" mode="scaleToFill" />
        <view class="mgl-24 text-32 text-500 text-070602">这是一条公告</view>
      </view>
      <view class="text-28 text-400 text-7E7E7E">2025.1.1</view>
    </view>
    <view class="affiche"></view>

    <view class="w h-196 pdx-32 flex mgt-24 jc_between ai_center text-24">
      <view
        class="flex fd_c ai_center"
        v-for="item in menu"
        :key="item.name"
        @click="$navTo(item.pagePath)"
      >
        <image class="w-96 h-96" :src="item.icon" mode="scaleToFill" />
        <view class="mgt-16 text-26 text-400 text-303030">{{ item.name }}</view>
      </view>
    </view>

    <view
      class="w h-224 pdx-32 text-white mgt-16"
      @click="$navTo('/pages/index/newcomerTasks')"
    >
      <image class="w h radio-24" src="/static/logo.png" mode="scaleToFill" />
    </view>

    <view class="w flex1 pdx-32 mgt-16">
      <view class="h-72 text-32 text-500 text-070602 flex ai_center">
        推荐悬赏
      </view>
      <view class="w flex1">
        <scroll-view scroll-y class="scroll">
          <view v-for="item in 10" :key="item" class="bounty">
            <BountyItem class="mgb-10"></BountyItem>
          </view>
          <view class="loading">上拉加载更多 ></view>
        </scroll-view>
      </view>
    </view>
  </view>
</template>

<script>
import BountyItem from "components/bountyItem.vue";
export default {
  components: { BountyItem },
  data() {
    return {
      title: "首页",
      menu: [
        {
          icon: "/static/logo.png",
          name: "新手入门",
          pagePath: "/pages/index/gettingStarted",
        },
        {
          icon: "/static/logo.png",
          name: "热门悬赏",
          pagePath: "/pages/index/popularBounty",
        },
        {
          icon: "/static/logo.png",
          name: "最新悬赏",
          pagePath: "/pages/index/newestBounty",
        },
        {
          icon: "/static/logo.png",
          name: "急速快审",
          pagePath: "/pages/index/quickCheck",
        },
        {
          icon: "/static/logo.png",
          name: "邀请赚钱",
          pagePath: "/pages/index/inviteEarnMoney",
        },
      ],
      currentNum: 0,
      list6: [
        "https://uviewui.com/swiper/swiper2.png",
        "https://uviewui.com/swiper/swiper3.png",
        "https://uviewui.com/swiper/swiper1.png",
      ],
    };
  },
  onLoad() {},
  methods: {},
};
</script>

<style lang="scss" scope>
.content {
  //   height: calc(100vh - 120rpx);
  /* background-color: red; */
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */

  .top_bg {
    width: 100%;
    height: 358rpx;
    flex-shrink: 0;
    /* background: linear-gradient(181deg, #ffffff00 39.21%, #fff 99.52%),
      linear-gradient(107deg, #fe6505 0%, #ff883d 106.14%); */
    background: linear-gradient(to bottom, #fe6505, #ffffff);

    .input_box {
      width: 100%;
      height: 88rpx;
      background-color: #fff;
      padding: 0 32rpx;
      border-radius: 40rpx;
    }
  }

  .banner {
    margin-top: -158rpx;
    padding: 0 32rpx;
    width: 100%;
    height: 272rpx;
  }
}
.affiche {
  width: 100%;
  height: 2rpx;
  background: linear-gradient(
    90deg,
    #fe650500 0%,
    #fe65051a 46.15%,
    #fe650500 100%
  );
}
.scroll {
  flex: 1;
  //   height: calc(100vh - 1250rpx);
  //   height: 1010rpx;
  overflow: hidden;
}

.loading {
  text-align: center;
  margin-top: 50rpx;
  padding-bottom: 86rpx;
  font-size: 20rpx;
  font-weight: 400;
  color: #c0c0c0;
}

.indicator {
  @include flex(row);
  justify-content: center;

  &__dot {
    height: 6px;
    width: 6px;
    border-radius: 100px;
    background-color: rgba(255, 255, 255, 0.35);
    margin: 0 5px;
    transition: background-color 0.3s;

    &--active {
      background-color: #ffffff;
    }
  }
}

.indicator-num {
  padding: 2px 0;
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 100px;
  width: 35px;
  display: flex;
  justify-content: center;

  &__text {
    color: #ffffff;
    font-size: 12px;
  }
}
</style>