<template>
  <view class="container container-end-actibity">
    <!-- 筛选部分 -->
    <view class="select-content-activity">
      <view class="screen-item" v-if="endType == 'hongze'">
        <text :class="[isShowJurisdiction ? 'active' : '', 'text-item']" @click="permissioActivity">有权限行业</text>
        <!-- 各种状态选择 -->
        <view class="select-conyent" ref="select-conyent">
          <van-dropdown-menu active-color="#333333">
            <van-dropdown-item id="industry" :title="chartPermissionName">
              <view class="menu-items">
                <view class="menu-items-box" v-for="item in listChartPermission" :key="item.ChartPermissionId" @click="overallClick(item)">
                  <view class="items-box">
                    <u-icon v-if="item.IsChoose" name="checkbox-mark" :color="isShowJurisdiction ? '#ccc' : '#376cbb'" size="24"></u-icon>
                  </view>
                  <text>{{ item.PermissionName }}</text>
                </view>
              </view>
              <view class="replacement">
                <text @click="replacementBtn" class="replacement-box">重置</text>
                <text @click="replacementConfirm">确定</text>
              </view>
            </van-dropdown-item>
          </van-dropdown-menu>
        </view>
        <text @click="selectMultipleHandler(item, '类型')" v-for="item in activityTypeList" :key="item.Id" :class="['select-item-multiple', item.IsChoose && 'active']">{{ item.StatusName }}</text>
      </view>
      <view class="screen-item screen-item-ul" :style="endType == 'research' ? 'margin-top:0' : ''">
        <text @click="monthWeekHandler(item)" v-for="item in activityMonthWeekList" :key="item.Id" :class="['text-item', item.IsChoose && 'active']">{{ item.StatusName }}</text>
      </view>
    </view>
    <view class="content-box" v-if="haveData">
      <view class="content-ul">
        <view @click="goThemeActivity(item)" class="item-text text_oneLine" v-for="item in dataList" :key="item.ActivityId">
          {{ item.KeyWord }}
        </view>
      </view>
    </view>
    <view class="nodata" v-else>
      <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
      <text>暂时没有符合条件的活动</text>
    </view>
    <Loading />
  </view>
</template>

<script>
import selectMixins from "../components/selectMixins.js";
import { activity } from "@/config/api";
export default {
  mixins: [selectMixins],
  data() {
    return {
      dateType: "", //日期的类型
      selectMultipleType: "", // 筛选的类型
      dataList: [],
      haveData: true,
      // hongze 弘则活动 research 研选活动
      endType: "",
      hideResearch: true,
    };
  },
  methods: {
    async getActivityList() {
      const res = await activity.activityOverActivityList({
        WhichDay: this.whichDay,
        TypeName: this.selectActiveId,
        IsPower: this.isGetJurisdiction,
        ChartPermissionIds: this.chartPermissionIds,
      });
      if (res.Ret === 200) {
        this.dataList = res.Data.List || [];
        this.haveData = this.dataList.length ? true : false;
      }
    },

    // 跳转到主题详情
    goThemeActivity(item) {
      let obj = {
        select_type: "end",
        data_activeId: this.whichDay,
        select_activeId: this.selectActiveId,
      };
      uni.navigateTo({
        url: "/activityPages/themeActivity/themeActivity?title=" + item.KeyWord + "&id=" + item.ActivityId + "&endList=" + JSON.stringify(obj),
      });
    },
  },
  onLoad(options) {
    this.endType = options.type ? options.type : "hongze";
    this.getActivityList();
  },
};
</script>

<style lang="scss" scoped>
.container-end-actibity {
  background-color: $uni-bg-color;
  .content-box {
    padding: 25rpx;
  }
  .content-ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 30rpx 20rpx;
    background-color: #fff;
    border-radius: 8rpx;
    .item-text {
      text-align: center;
      line-height: 52rpx;
      width: 321rpx;
      height: 52rpx;
      background: #e5efff;
      color: $uni-color-new;
      border-radius: 8rpx;
      margin-bottom: 30rpx;
      padding: 0 20rpx;
    }
  }
  @import "../components/selectCss.scss";
}
</style>
