<template>
  <view class="container container-end-actibity">
    <!-- 筛选部分 -->
    <view class="select-content-activity">
      <view class="screen-item">
        <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' : '#2C83FF'" 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">
        <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-ul" v-if="haveData">
      <view @click="goThemeActivity(item)" class="item-text text_oneLine" v-for="item in dataList" :key="item.ActivityId">
        {{ item.KeyWord }}
      </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,
    };
  },
  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() {
    this.getActivityList();
  },
};
</script>

<style lang="scss" scoped>
.container-end-actibity {
  .content-ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 30rpx 70rpx;
    .item-text {
      text-align: center;
      line-height: 53rpx;
      width: 290rpx;
      height: 53rpx;
      background: #f5f5f5;
      border-radius: 65rpx;
      box-shadow: 0px 2rpx 9rpx 0rpx rgba(0, 0, 0, 0.16), inset 0rpx 4rpx 4rpx 0rpx rgba(255, 255, 255, 0.49);
      margin-bottom: 30rpx;
    }
  }
  @import "../components/selectCss.scss";
}
</style>
