<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2019-11-18 10:37:02
 * @LastEditors  : 无尘
 * @LastEditTime : 2020-01-09 09:49:21
 -->
<!--
<reward-config @submitBack="submitBack" @submitNext="submitNext"></reward-config>

import rewardConfig from '@/components/active-config/reward-config.vue';
-->
<template>
  <div class="reward-config-content">
    <div class="config-title font-14 color-303133">奖励配置</div>
    <el-form
      label-width="154px"
      :model="activeInfoData"
      ref="rewardForm"
      :rules="rules"
    >
      <el-form-item
        label="奖励模式："
        prop="awardMode"
      >
        <ul class="flex">
          <template v-for="(item, index) in awardData">
            <li
              :class="['li-cell flex-1 ', activeInfoData.awardMode == item.goalId ? 'li-cell-active' : '']"
              :key="index + 'first'"
              @click="selectMode(item)"
            >
              <div class="li-cell-inner flex ">
                <div class="li-cell-left flex flex-align-center flex-pack-center">
                  <img
                    :src="activeInfoData.awardMode == item.goalId ? item.selectedIconUrl : item.iconUrl"
                    alt=""
                  />
                </div>
                <div class="li-cell-right border-box flex flex-column ">
                  <div class="li-cell-active_name flex flex-align-center  font-18 color-303133">{{ item.goalName }}</div>
                  <div class="li-cell-active_describe flex flex-align-center  font-14 color-606266">{{ item.describe }}</div>
                </div>
              </div>
              <div class="common-cell-check">
                <div class="common-cell-triangle">
                  <div class="common-cell-outer">
                    <i class="el-icon-upload-success el-icon-check"></i>
                  </div>
                </div>
              </div>
            </li>
          </template>
        </ul>
      </el-form-item>
      <el-form-item
        v-if="activeInfoData.awardMode == 1"
        label="奖励方案（多选）："
        prop=""
      >
        <ul class="flex  m-t-48">
          <template v-for="(item, index) in awardTypeData">
            <li
              :class="['li-cell li-second-cell flex-1 ', activeInfoData[item.key] ? 'li-second-active' : '']"
              :key="index + 'second'"
              @click="selectModeType(item, activeInfoData)"
            >
              <div class="li-cell-inner">
                <div class="li-cell-bottom border-box">
                  <div class="li-cell-scene">
                    <div class="li-cell-scene_title font-14 color-303133">{{ item.goalName }}</div>
                    <div class="li-cell-scene_text font-14 color-606266">{{ item.describe }}</div>
                  </div>
                </div>
              </div>
              <div class="common-cell-check">
                <div class="common-cell-triangle">
                  <div class="common-cell-outer">
                    <i class="el-icon-upload-success el-icon-check"></i>
                  </div>
                </div>
              </div>
            </li>
          </template>
        </ul>
      </el-form-item>
      <el-form-item
        v-if="activeInfoData.awardMode == 1"
        class="m-t-50"
      >
        <el-tabs
          v-model="activeName"
          type="card"
          @tab-click="handleClick"
        >
          <el-tab-pane
            v-if="basePath.map(ele => ele.transName).includes('消费')"
            label="消费行为控制"
            name="first"
          >
            <!-- 消费行为控制 -->
            <consume-config
              ref="singleConsume"
              v-model="activeInfoData.consumeAction"
            ></consume-config>
          </el-tab-pane>
          <el-tab-pane
            v-if="activeInfoData.instantAwardFlag"
            label="即时奖励配置"
            name="second"
          >
            <!-- 即时奖励配置 -->
            <spot-award
              ref="singleSpot"
              v-model="activeInfoData.instanceAward"
            ></spot-award>
          </el-tab-pane>
          <el-tab-pane
            v-if="activeInfoData.passAwardFlag"
            label="闯关奖励配置"
            name="third"
          >
            <!-- 闯关奖励配置 -->
            <entry-award
              ref="singleEntry"
              v-model="activeInfoData.passAward"
            ></entry-award>
          </el-tab-pane>
          <el-tab-pane
            v-if="activeInfoData.competitionAwardFlag"
            label="竞赛奖励配置"
            name="four"
          >
            <competition-award
              ref="singleCompetition"
              v-model="activeInfoData.compitionAward"
            ></competition-award>
            <!-- 竞赛奖励配置 -->
          </el-tab-pane>
          <el-tab-pane
            label="受邀人奖励"
            name="five"
          >
            <!-- 受邀人奖励 -->
            <invitee-reward
              ref="singleInvitee"
              v-model="activeInfoData.invitedAward"
            ></invitee-reward>
          </el-tab-pane>
          <el-tab-pane
            v-if="basePath.map(ele => ele.transName).includes('消费')"
            label="防欺诈风险控制"
            name="six"
          >
            <!-- 防欺诈风险控制 -->
            <fraud-control
              ref="singleFreeze"
              :notEdit="notEdit"
              v-model="activeInfoData.pointFreeze"
            ></fraud-control>
          </el-tab-pane>
        </el-tabs>
      </el-form-item>
      <el-form-item
        v-if="activeInfoData.awardMode == 2"
        class="m-t-50"
      >
        <ul class="active-big-class">
          <template v-for="(parentItem, ind) in ProgressiveData">
            <li
              :key="ind + 'set'"
              :class="['parent-li-cell border-box', parentItem.switchFlag ? 'show-active-li' : '']"
            >
              <div class="progress-active-title flex  flex-space-between border-box">
                <div class="active-title-left">
                  <div class="active-title-title font-16 color-303133">{{ parentItem.title }}</div>
                  <div class="active-title-subtitle font-14 color-606266 m-t-7">{{ parentItem.subTitle }}</div>
                </div>
                <div class="active-title-right flex flex-align-center">
                  <el-switch
                    :disabled="ind == ProgressiveData.length-1 || $route.query.editFlag"
                    v-model="parentItem.switchFlag"
                    active-text=""
                    inactive-text=""
                  > </el-switch>
                </div>
              </div>
              <div
                v-if="parentItem.switchFlag"
                class="set-body"
              >
                <div
                  data-v-6033a8b1=""
                  class="el-form-item m-t-44"
                >
                  <label
                    for=""
                    class="el-form-item__label"
                    style="width: 115px;"
                  >奖励方案：</label>
                  <div
                    class="el-form-item__content"
                    style="margin-left: 115px;"
                  >
                    <ul class="flex  m-t-48">
                      <template v-for="(item, index) in awardTypeData">
                        <li
                          :class="['li-cell li-second-cell flex-1 ', parentItem[item.key] ? 'li-second-active' : '']"
                          :key="index + 'second'"
                          @click="selectModeType(item, parentItem)"
                        >
                          <div class="li-cell-inner">
                            <div class="li-cell-bottom border-box">
                              <div class="li-cell-scene">
                                <div class="li-cell-scene_title font-14 color-303133">{{ item.goalName }}</div>
                                <div class="li-cell-scene_text font-14 color-606266">{{ item.describe }}</div>
                              </div>
                            </div>
                          </div>
                          <div class="common-cell-check">
                            <div class="common-cell-triangle">
                              <div class="common-cell-outer">
                                <i class="el-icon-upload-success el-icon-check"></i>
                              </div>
                            </div>
                          </div>
                        </li>
                      </template>
                    </ul>
                  </div>
                </div>
                <el-tabs
                  class="m-t-30"
                  v-model="parentItem.activeName"
                  type="card"
                  @tab-click="handleClick"
                >
                  <el-tab-pane
                    v-if="parentItem.stepType == 6"
                    label="消费行为控制"
                    name="first"
                  >
                    <!-- 消费行为控制 -->
                    <consume-config
                      ref="multConsume"
                      v-model="parentItem.consumeAction"
                    ></consume-config>
                  </el-tab-pane>
                  <el-tab-pane
                    v-if="parentItem.instantAwardFlag"
                    label="即时奖励配置"
                    name="second"
                  >
                    <!-- 即时奖励配置 -->
                    <spot-award
                      ref="multSpot"
                      :awardMode="activeInfoData.awardMode"
                      v-model="parentItem.instanceAward"
                    ></spot-award>
                  </el-tab-pane>
                  <el-tab-pane
                    v-if="parentItem.passAwardFlag"
                    label="闯关奖励配置"
                    name="third"
                  >
                    <!-- 闯关奖励配置 -->
                    <entry-award
                      ref="multEntry"
                      v-model="parentItem.passAward"
                    ></entry-award>
                  </el-tab-pane>
                  <el-tab-pane
                    v-if="parentItem.competitionAwardFlag"
                    label="竞赛奖励配置"
                    name="four"
                  >
                    <competition-award
                      ref="multCompetition"
                      v-model="parentItem.compitionAward"
                    ></competition-award>
                    <!-- 竞赛奖励配置 -->
                  </el-tab-pane>
                  <el-tab-pane
                    label="受邀人奖励"
                    name="five"
                  >
                    <!-- 受邀人奖励 -->
                    <invitee-reward
                      ref="multInvitee"
                      v-model="parentItem.invitedAward"
                    ></invitee-reward>
                  </el-tab-pane>
                  <el-tab-pane
                    v-if="parentItem.stepType == 6"
                    label="防欺诈风险控制"
                    name="six"
                  >
                    <!-- 防欺诈风险控制 -->
                    <fraud-control
                      :notEdit="notEdit"
                      ref="multFreeze"
                      v-model="parentItem.pointFreeze"
                    ></fraud-control>
                  </el-tab-pane>
                </el-tabs>
              </div>
            </li>

          </template>
        </ul>
      </el-form-item>
      <el-form-item class="m-t-50">
        <el-button
          type="primary"
          @click="submitBack"
        >上一步</el-button>
        <el-button
          v-if="!$route.query.hasOwnProperty('editFlag')"
          type="primary"
          @click="submitForm('rewardForm')"
        > {{$route.query.hasOwnProperty('activityId') ?'确认编辑':'确认新建'}}</el-button>
        <el-button
          v-if="$route.query.hasOwnProperty('editFlag')"
          type="primary"
          @click="submitForm('rewardForm')"
        >返回活动列表</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
/* eslint-disable */
import consumeConfig from '@/components/active-config/configs/consume-config.vue';
import spotAward from '@/components/active-config/configs/spot-award.vue';
import entryAward from '@/components/active-config/configs/entry-award.vue';
import competitionAward from '@/components/active-config/configs/competition-award.vue';
import inviteeReward from '@/components/active-config/configs/invitee-reward.vue';
import fraudControl from '@/components/active-config/configs/fraud-control.vue';
import { _debounce } from '@/common/js/public';
import showMsg from '@/common/js/showmsg';
import errMsg from '@/common/js/error';

import { getRequest, postJson } from '@/api/api';
export default {
  name: 'reward-config',
  props: {},
  components: {
    consumeConfig,
    spotAward,
    entryAward,
    competitionAward,
    inviteeReward,
    fraudControl
  },
  data() {
    return {
      basePath: [],
      stepObj: {
        '服务号关注': 1 ,// 1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        '访问活动营销页': 2,
        '会员认证':3,
        '游戏参与': 4,
        '卡券领取': 5,
        '消费': 6
      },
      switchObj: {
        serviceAttentionFlag: '服务号关注',
        entryActivityFlag: '访问活动营销页',
        authorizeOpenCardFlag: '会员认证',
        enjoyGameFlag: '游戏参与',
        receiveCardFlag: '卡券领取',
        consumeAwardFlag: '消费'
      },
      stepTypeNum: 1,
      activeInfoData: {
        activityId: '',
        awardMode: '1',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        serviceAttentionFlag: 0, // 服务号关注开关
        entryActivityFlag: 0, // 活动着陆页开关
        authorizeOpenCardFlag: 0, // 认证开卡奖励开关
        enjoyGameFlag: 0, // 参与游戏开关
        receiveCardFlag: 0, // 领取卡券开关
        consumeAwardFlag: 0, // 消费奖开关
        stepType: this.stepTypeNum,
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": this.stepTypeNum //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
      rules: {
        awardMode: [{ required: true, message: '请选择奖励模式', trigger: 'blur' }]
      },
      awardData: [
        {
          goalId: 1,
          selectedIconUrl: require('../../assets/images/jl-pre.png'),
          iconUrl: require('../../assets/images/jl.png'),
          goalName: '单次奖励（推荐）',
          describe: '无论活动的转化路径分多少步，只有当受邀人完成了最后一步的行为，邀请人才能得到奖励。',
          check: false
        },
        {
          goalId: 2,
          selectedIconUrl: require('../../assets/images/lc-pre.png'),
          iconUrl: require('../../assets/images/lc.png'),
          goalName: '渐进式奖励',
          describe: '可以对转化路径当中的每一步单独配置奖励信息，即可以将转化路径理解为漏斗模型，邀请人可以分层获得奖励。'
        }
      ],
      awardTypeData: [
        {
          goalId: 1,
          key: 'instantAwardFlag',
          goalName: '即时奖励（推荐）',
          describe: '当受邀人满足完成了相关的行为，即时发放邀请人或受邀人的奖励。',
          check: false
        },
        {
          goalId: 2,
          key: 'passAwardFlag',
          goalName: '闯关奖励',
          describe: '满足相关行为的受邀人数量满足条件后，邀请人即可领取相关奖励，可设置难度逐级递增的多个阶段目标。',
          check: false
        },
        {
          goalId: 3,
          key: 'competitionAwardFlag',
          goalName: '竞赛奖励',
          describe: '活动结束后进行统一排名结算和奖励发放的模式，奖项信息可自定义设置。',
          check: false
        }
      ],
      // el-tabs
      activeName: 'first',
      // 渐进式奖励
      serviceAttentionFlag: {
        activeName: 'first', // tab,
        serviceAttentionFlag: false, // 服务号关注开关
        entryActivityFlag: false, // 活动着陆页开关
        authorizeOpenCardFlag: false, // 认证开卡奖励开关
        enjoyGameFlag: false, // 参与游戏开关
        receiveCardFlag: false, // 领取卡券开关
        consumeAwardFlag: false, // 消费奖开关
        switchFlag: false, //通用开关
        "stepType": 1,
        title: '服务号关注奖励',
        subTitle: '当受邀人成功关注了服务号之后触发的奖励，开启后可配置相关奖励内容，若该行为无奖励则保持关闭状态即可。',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": 1
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: 1 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 1 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 1 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": 1 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": 1 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      entryActivityFlag: {
        activeName: 'first',
        serviceAttentionFlag: false, // 服务号关注开关
        entryActivityFlag: false, // 活动着陆页开关
        authorizeOpenCardFlag: false, // 认证开卡奖励开关
        enjoyGameFlag: false, // 参与游戏开关
        receiveCardFlag: false, // 领取卡券开关
        consumeAwardFlag: false, // 消费奖开关
        switchFlag: false, //通用开关
        "stepType": 2,
        title: '活动营销页访问奖励',
        subTitle: '当受邀人成功访问了指定活动营销页之后触发的奖励，开启后可配置相关奖励内容，若该行为无奖励则保持关闭状态即可。',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": 2
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: 2 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 2 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 2 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": 2//步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": 2 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      authorizeOpenCardFlag: {
        activeName: 'first',
        serviceAttentionFlag: false, // 服务号关注开关
        entryActivityFlag: false, // 活动着陆页开关
        authorizeOpenCardFlag: false, // 认证开卡奖励开关
        enjoyGameFlag: false, // 参与游戏开关
        receiveCardFlag: false, // 领取卡券开关
        consumeAwardFlag: false, // 消费奖开关
        switchFlag: false, //通用开关
        "stepType": 3,
        title: '会员认证奖励',
        subTitle: '当受邀人完成了会员认证之后触发的奖励，开启后可配置相关奖励内容，若该行为无奖励则保持关闭状态即可。',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": 3
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: 3 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [
            {
              achieve: 5,
              point: 1,
              pointCheck: false,
              cardId: '',
              cardName: '',
              cardCheck: false
            }
          ], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [
            {
              achieve: 5,
              point: 1,
              pointCheck: false,
              cardId: '',
              cardName: '',
              cardCheck: false
            }
          ], //成交额奖项 成交额奖项json
          stepType: 3 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 3 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": 3 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": 3 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      enjoyGameFlag: {
        activeName: 'first',
        serviceAttentionFlag: false, // 服务号关注开关
        entryActivityFlag: false, // 活动着陆页开关
        authorizeOpenCardFlag: false, // 认证开卡奖励开关
        enjoyGameFlag: false, // 参与游戏开关
        receiveCardFlag: false, // 领取卡券开关
        consumeAwardFlag: false, // 消费奖开关
        switchFlag: false, //通用开关
        "stepType": 4,
        title: '游戏参与奖励',
        subTitle: '当受邀人成功参与了指定游戏之后触发的奖励，开启后可配置相关奖励内容，若该行为无奖励则保持关闭状态即可。',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": 4
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: 4 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 4 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 4 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": 4 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": 4 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      receiveCardFlag: {
        activeName: 'first',
        serviceAttentionFlag: false, // 服务号关注开关
        entryActivityFlag: false, // 活动着陆页开关
        authorizeOpenCardFlag: false, // 认证开卡奖励开关
        enjoyGameFlag: false, // 参与游戏开关
        receiveCardFlag: false, // 领取卡券开关
        consumeAwardFlag: false, // 消费奖开关
        switchFlag: false, //通用开关
        "stepType": 5,
        title: '卡券领取奖励',
        subTitle: '当受邀人成功领取了指定卡券之后触发的奖励，开启后可配置相关奖励内容，若该行为无奖励则保持关闭状态即可。',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": 5 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: 5 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 5 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 5 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": 5 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": 5 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      consumeAwardFlag: {
        activeName: 'first',
        serviceAttentionFlag: false, // 服务号关注开关
        entryActivityFlag: false, // 活动着陆页开关
        authorizeOpenCardFlag: false, // 认证开卡奖励开关
        enjoyGameFlag: false, // 参与游戏开关
        receiveCardFlag: false, // 领取卡券开关
        consumeAwardFlag: false, // 消费奖开关
        switchFlag: false, //通用开关
        "stepType": 6,
        title: '消费奖励',
        subTitle: '当受邀人进行了消费之后触发的奖励，开启后可配置相关奖励内容，若该行为无奖励则保持关闭状态即可。',
        instantAwardFlag: 1, // 即时
        passAwardFlag: 0, // 闯关
        competitionAwardFlag: 0, // 竞赛
        // 消费行为控制
        consumeAction: {
          consumeStoreControlFlag: 0, //消费门店控制开关 1控制，0不控制
          consumeStoreName: '', //消费门店文案
          dealAmountControlFlag: 0, //成交额控制开关 0不控制，1控制区间
          dealAmountControlMin: 1, //成交额控制最小值
          dealAmountControlMax: 1, //成交额控制最大值
          singleDealNumberControlFlag: 0, //单笔成交件数控制开关 0不控制，1控制区间
          singleDealNumberControlMin: 1, //单笔成交件数最小值
          singleDealNumberControlMax: 1, //单笔成交件数最大值
          uuid: '',
          storeList: [],
          "stepType": 6 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 即时奖励
        instanceAward: {
          instanceMade: 1, //即时奖励模式 1、定额奖励，2阶梯奖励，3成交额等比奖励
          instancePoint: 1, //奖励积分（定额中的积分，等比中的积分）
          instanceNumber: 1, //等比奖励种的每多少元
          instanceContent: [
            {
              start: 0,
              end: 5,
              point: 1,
              infinity: false
            },
            {
              start: 10,
              end: 20,
              point: 1,
              infinity: false
            }
          ], //即时奖励内容（阶梯内容） 奖励内容json字符串
          awardLimitType: 1, //奖励限制类型 1、不限制奖励（推荐），2、限制奖励次数，3、限制奖励额度
          awardLimitNumber: 1, //限制奖励次数
          awardLimitPoint: 1, //限制奖励额度
          stepType: 6 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 闯关奖励
        passAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 6 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 竞赛奖励
        compitionAward: {
          dealNumberFlag: 1, //成交人数开关 1开启
          dealAmountFlag: 0, //成交额开关 1开启
          dealNumberSettingParam: [], //成交人数奖项 成交人数奖项json
          dealAmountSettingParam: [], //成交额奖项 成交额奖项json
          stepType: 6 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 受邀人奖励
        invitedAward: {
          pointSettingFlag: true, //积分奖励开关 1开启
          cardSettingFlag: false, //卡券开关 1开启
          pointAwardMode: 1, //1、定额，2、阶梯，3、等比
          pointAwardPoint: 1, //定额奖励积分
          pointAwardStepParam: [

          ],
          pointAwardPerAmount: 1, //等比奖励中的每成交多少元
          pointAwardPerPoint: 1, //等比奖励中积分
          cardAwardMode: 1,
          cardId: '',
          cardName: '',
          cardAwardStepParam: [
            {
              achieve: 1,
              cardId: '',
              cardName: ''
            }
          ],
          "stepType": 6 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        },
        // 防欺诈
        pointFreeze: {
          amountLimitFlag: 0,
          amountLimitAmount: 1,
          pointProgram: 1, //0、不限制，1、延时发放（推荐），2积分冻结
          pointControlDay: 1, //限制延时
          "stepType": 6 //步骤类型 类型：1服务号关注，2活动营销页访问奖励，3会员认证奖励，4游戏参与奖励，5卡券领取奖励6，消费奖励
        }
      },
      ProgressiveData: [], //根据路径添加
      notEdit: true, //判断未开始的未进入这一步的时候，是不禁止修改的
    };
  },
  methods: {
    /**
     * 选择模式
     */
    selectMode(item) {
      const that = this;
      if (that.$route.query.hasOwnProperty('activityId') && !that.notEdit) {
        showMsg.showmsg('奖励模式禁止修改', 'warning');
        return false;
      }
      that.activeInfoData.awardMode = item.goalId;
      if (item.goalId == 2 && !that.ProgressiveData.length) {
        that.changeModeData();
      }
    },
    selectModeType(item, pItem) {
      const that = this;
      if (that.$route.query.hasOwnProperty('editFlag')) {
        return false;
      }
      pItem[item.key] = pItem[item.key] ? 0 : 1;
      // 修改tab
      const type = that.stepObj[that.basePath[that.basePath.length-1].transName];
      if (that.activeInfoData.awardMode == 1 && type != 6 && pItem.instantAwardFlag == 0 && that.activeName == 'second') {
        that.activeName = 'five';
      }
      if (that.activeInfoData.awardMode == 1 && type != 6 && pItem.passAwardFlag == 0 && that.activeName == 'third') {
        that.activeName = 'five';
      }
      if (that.activeInfoData.awardMode == 1 && type != 6 && pItem.competitionAwardFlag == 0 && that.activeName == 'four') {
        that.activeName = 'five';
      }
      if (that.activeInfoData.awardMode == 1 && type == 6 && pItem[item.key] == 0 && pItem.instantAwardFlag == 0 && that.activeName == 'second') {
        that.activeName = 'first';
      }
      if (that.activeInfoData.awardMode == 1 && type == 6 && pItem[item.key] == 0 && pItem.passAwardFlag == 0 && that.activeName == 'third') {
        that.activeName = 'first';
      }
      if (that.activeInfoData.awardMode == 1 && type == 6 && pItem[item.key] == 0 && pItem.competitionAwardFlag == 0 && that.activeName == 'four') {
        that.activeName = 'first';
      }
      if (that.activeInfoData.awardMode == 2 && pItem.stepType != 6 && pItem.instantAwardFlag == 0 && pItem.activeName == 'second') {
        pItem.activeName = 'five';
      }
      if (that.activeInfoData.awardMode == 2 && pItem.stepType != 6 && pItem.passAwardFlag == 0 && pItem.activeName == 'third') {
        pItem.activeName = 'five';
      }
      if (that.activeInfoData.awardMode == 2 && pItem.stepType != 6 && pItem.competitionAwardFlag == 0 && pItem.activeName == 'four') {
        pItem.activeName = 'five';
      }
      if (that.activeInfoData.awardMode == 2 && pItem.stepType == 6 && pItem.instantAwardFlag == 0 && pItem.activeName == 'second') {
        pItem.activeName = 'first';
      }
      if (that.activeInfoData.awardMode == 2 && pItem.stepType == 6 && pItem.passAwardFlag == 0 && pItem.activeName == 'third') {
        pItem.activeName = 'first';
      }
      if (that.activeInfoData.awardMode == 2 && pItem.stepType == 6 && pItem.competitionAwardFlag == 0 && pItem.activeName == 'four') {
        pItem.activeName = 'first';
      }
    },
    /**
     * 修改 奖励模式，修改数据
     */
    changeModeData() {
      const that = this;
      // 根据路径
      for (const i in that.switchObj) {
        that.basePath.forEach(ele => {
          if (ele.transName == that.switchObj[i]) {
            that.ProgressiveData.push(that[i]);
          }
        });
      }
      that.$nextTick(() => {
        that.ProgressiveData[that.ProgressiveData.length-1].switchFlag = true;
        that.ProgressiveData.forEach(ele => {
          if (that.basePath.map(ele => ele.transName).includes('消费') && ele.stepType == 6) {
            ele.activeName = 'first';
          }else {
            ele.activeName = 'second';
          }
        })
        that.$forceUpdate();
      })

      console.log(that.ProgressiveData);
    },
    /**
     * 选择tab
     */
    handleClick(tab, event) {
      console.log(tab, event);
    },
    /**
     * 上一步
     */
    async submitBack() {
      const that = this;
      if (that.activeInfoData.awardMode == 1) {
        that.basePath.map(ele => ele.transName).includes('消费') ? await that.$refs.singleConsume.submitForm(): '';
        that.activeInfoData.instantAwardFlag == 1 ? await that.$refs.singleSpot.submitForm() : true;
        that.activeInfoData.passAwardFlag == 1 ? await that.$refs.singleEntry.submitForm() : true;
        that.activeInfoData.competitionAwardFlag == 1 ? await that.$refs.singleCompetition.submitForm() : true;
        await that.$refs.singleInvitee.submitForm();
        that.basePath.map(ele => ele.transName).includes('消费') ? await that.$refs.singleFreeze.submitForm() : true;
        that.$store.dispatch('saveRewardInfo', that.activeInfoData);
      }else {
        let flag = true;
        if (!!that.$refs.hasOwnProperty('multConsume') && that.$refs.multConsume.length ) {
          for (let index = 0; index < that.$refs.multConsume.length; index++) {
            flag = await that.$refs.multConsume[index].submitForm();
          }
        }

        let spot = true;
        if (!!that.$refs.hasOwnProperty('multSpot') && that.$refs.multSpot.length ) {
          for (let index = 0; index < that.$refs.multSpot.length; index++) {
            spot = await that.$refs.multSpot[index].submitForm();
          }
        }

        let entry = true;
        if (!!that.$refs.hasOwnProperty('multEntry') && that.$refs.multEntry.length ) {
          for (let index = 0; index < that.$refs.multEntry.length; index++) {
            entry = await that.$refs.multEntry[index].submitForm();
          }
        }

        let competition = true;
        if (!!that.$refs.hasOwnProperty('multCompetition') && that.$refs.multCompetition.length ) {
          for (let index = 0; index < that.$refs.multCompetition.length; index++) {
            competition = await that.$refs.multCompetition[index].submitForm()
          }
        }

        let invitee =  true;
        if (!!that.$refs.hasOwnProperty('multInvitee') && that.$refs.multInvitee.length ) {
          for (let index = 0; index < that.$refs.multInvitee.length; index++) {
            invitee = await that.$refs.multInvitee[index].submitForm();
          }
        }

        let freeze = true;
        if (!!that.$refs.multFreeze && that.$refs.multFreeze.length ) {
          for (let index = 0; index < that.$refs.multFreeze.length; index++) {
            freeze = await that.$refs.multFreeze[index].submitForm();
          }
        }
        that.$store.dispatch('saveRewardInfo', that.activeInfoData);
        that.$store.dispatch('saveMultRewardInfo', that.ProgressiveData);
      }
      that.$emit('submitBack');
    },
    /**
     * 下一步
     */
    submitForm: _debounce(function(formName) {
      const that = this;
      that.$refs[formName].validate(valid => {
        if (valid) {
          if (that.$route.query.hasOwnProperty('editFlag')) {
            that.$store.dispatch('clearActiveData');
            that.$router.push(`/shareIndex`);
            return false
          }
          if (that.activeInfoData.awardMode == 1) {
            that.singleCheck(); // 判断单次
          } else {
            that.moreCheck(); // 判断渐进式
          }
        } else {
          return false;
        }
      });
    }, 500),
    async singleCheck() {
      const that = this;
      const flag = that.basePath.map(ele => ele.transName).includes('消费') ? await that.$refs.singleConsume.submitForm() : true;
      if (flag.hasOwnProperty('flag')&& !flag.flag) {
        showMsg.showmsg(flag.msg, 'warning');
        return false;
      }
      const spot = that.activeInfoData.instantAwardFlag == 1 ? await that.$refs.singleSpot.submitForm() : true;
      if (spot.hasOwnProperty('flag')&& !spot.flag) {
        showMsg.showmsg(spot.msg, 'warning');
        return false;
      }
      const entry = that.activeInfoData.passAwardFlag == 1 ? await that.$refs.singleEntry.submitForm() : true;
      if (entry.hasOwnProperty('flag')&& !entry.flag) {
        showMsg.showmsg(entry.msg, 'warning');
        return false;
      }
      const competition = that.activeInfoData.competitionAwardFlag == 1 ? await that.$refs.singleCompetition.submitForm() : true;
      if (competition.hasOwnProperty('flag')&& !competition.flag) {
        showMsg.showmsg(competition.msg, 'warning');
        return false;
      }
      const invitee = await that.$refs.singleInvitee.submitForm();
      if (invitee.hasOwnProperty('flag')&& !invitee.flag) {
        showMsg.showmsg(invitee.msg, 'warning');
        return false;
      }
      const freeze = that.basePath.map(ele => ele.transName).includes('消费') ? await that.$refs.singleFreeze.submitForm() : true;
      if (freeze.hasOwnProperty('flag')&& !freeze.flag) {
        showMsg.showmsg(freeze.msg, 'warning');
        return false;
      }
      // console.log('单次数据', that.activeInfoData);
      const names = that.basePath.map(ele => ele.transName);
      that.activeInfoData.stepType = that.stepObj[names[names.length - 1]];
      if (that.activeInfoData.hasOwnProperty('consumeAction')) {
        that.activeInfoData.consumeAction.stepType = that.stepObj[names[names.length - 1]];
      }
      if (that.activeInfoData.hasOwnProperty('instanceAward')) {
        that.activeInfoData.instanceAward.stepType = that.stepObj[names[names.length - 1]];
      }
      if (that.activeInfoData.hasOwnProperty('passAward')) {
        that.activeInfoData.passAward.stepType = that.stepObj[names[names.length - 1]];
      }
      if (that.activeInfoData.hasOwnProperty('compitionAward')) {
        that.activeInfoData.compitionAward.stepType = that.stepObj[names[names.length - 1]];
      }
      if (that.activeInfoData.hasOwnProperty('invitedAward')) {
        that.activeInfoData.invitedAward.stepType = that.stepObj[names[names.length - 1]];
        that.activeInfoData.invitedAward.pointSettingFlag = that.activeInfoData.invitedAward.pointSettingFlag ? 1:0;
        that.activeInfoData.invitedAward.cardSettingFlag = that.activeInfoData.invitedAward.cardSettingFlag ? 1: 0;
      }
      if (that.activeInfoData.hasOwnProperty('pointFreeze')) {
        that.activeInfoData.pointFreeze.stepType = that.stepObj[names[names.length - 1]];
      }
      //本来不用判断具体提交数据，后端只保存选择的，判断所有不选的去掉字段
      let filterData = JSON.parse(JSON.stringify(that.activeInfoData));
      await that.resetKey(filterData);
      if (!!filterData.passAward && filterData.passAward.dealNumberFlag == 1) {
        filterData.passAward.dealNumberSettingParam.forEach(ele => {
          ele.oldData = true;
          if (!ele.cardCheck && ele.cardId){
            ele.cardId = '';
            ele.cardName = '';
          }

          if(!ele.pointCheck && ele.point) {
            ele.point = '';
          }
        });
      }
      if (!!filterData.passAward && filterData.passAward.dealAmountFlag == 1) {
        filterData.passAward.dealAmountSettingParam.forEach(ele => {
          ele.oldData = true;
          if (!ele.cardCheck && ele.cardId){
            ele.cardId = '';
            ele.cardName = '';
          }

          if(!ele.pointCheck && ele.point) {
            ele.point = '';
          }
        });
      }
      const postData = {
        activityId: filterData.activityId,
        awardMode: filterData.awardMode,
        awardItems: [filterData]
      };
      // console.log(filterData)
      that.postSave(postData);
    },
    async resetKey(filterData) {
      const that = this;
      const names = that.basePath.map(ele => ele.transName);
      if (!names.includes('消费')) {
        that.$set(filterData, 'consumeAction', null);
        that.$set(filterData, 'pointFreeze', null);
      }
      if (filterData.instantAwardFlag == 0) {
        that.$set(filterData, 'instanceAward', null);
      }
      if (filterData.passAwardFlag == 0) {
        that.$set(filterData, 'passAward', null);
      }
      if (filterData.competitionAwardFlag == 0) {
        that.$set(filterData, 'compitionAward', null);
      }

      // 消费行为控制
      if (names.includes('消费') && filterData.consumeAction.consumeStoreControlFlag == 0) {
        that.$set(filterData.consumeAction, 'consumeStoreName','');
        that.$set(filterData.consumeAction, 'storeList',[]);
        that.$set(filterData.consumeAction, 'uuid','');
      }
      if (names.includes('消费') && filterData.consumeAction.dealAmountControlFlag == 0) {
        that.$set(filterData.consumeAction, 'dealAmountControlMin','');
        that.$set(filterData.consumeAction, 'dealAmountControlMax','');
      }
      if (names.includes('消费') && filterData.consumeAction.singleDealNumberControlFlag == 0) {
        that.$set(filterData.consumeAction, 'singleDealNumberControlMin','');
        that.$set(filterData.consumeAction, 'singleDealNumberControlMax','');
      }
      // 反欺诈
      if (names.includes('消费') && filterData.pointFreeze.amountLimitFlag == 0) {
        that.$set(filterData.pointFreeze, 'amountLimitAmount', '');
      }
      if (names.includes('消费') && filterData.pointFreeze.pointProgram == 0) {
        that.$set(filterData.pointFreeze, 'pointControlDay', '');
      }
      // 判断即时消费
      if (filterData.instantAwardFlag == 1 && filterData.instanceAward.instanceMade == 1) {
        that.$set(filterData.instanceAward, 'instanceContent',[]);
        that.$set(filterData.instanceAward, 'instanceNumber','');
      }
      if (filterData.instantAwardFlag == 1 && filterData.instanceAward.instanceMade == 2) {
        that.$set(filterData.instanceAward, 'instancePoint','');
        that.$set(filterData.instanceAward, 'instanceNumber','');
      }
      if (filterData.instantAwardFlag == 1 && filterData.instanceAward.instanceMade == 3) {
        that.$set(filterData.instanceAward, 'instanceContent',[]);
      }
      if (filterData.instantAwardFlag == 1 && filterData.instanceAward.awardLimitType == 1) {
        that.$set(filterData.instanceAward, 'awardLimitNumber','');
        that.$set(filterData.instanceAward, 'awardLimitPoint','');
      }
      if (filterData.instantAwardFlag == 1 && filterData.instanceAward.awardLimitType == 2) {
        that.$set(filterData.instanceAward, 'awardLimitPoint','');
      }
      if (filterData.instantAwardFlag == 1 && filterData.instanceAward.awardLimitType == 3) {
        that.$set(filterData.instanceAward, 'awardLimitNumber','');
      }
      // 闯关奖励
      if (filterData.passAwardFlag == 1 && filterData.passAward.dealNumberFlag == 0) {
        that.$set(filterData.passAward, 'dealNumberSettingParam',[]);
      }
      if (filterData.passAwardFlag == 1 && filterData.passAward.dealAmountFlag == 0) {
        that.$set(filterData.passAward, 'dealAmountSettingParam',[]);
      }
      // 竞赛奖励
     if (filterData.competitionAwardFlag == 1 && filterData.compitionAward.dealNumberFlag == 0) {
        that.$set(filterData.compitionAward, 'dealNumberSettingParam',[]);
      }
      if (filterData.competitionAwardFlag == 1 && filterData.compitionAward.dealAmountFlag == 0) {
        that.$set(filterData.compitionAward, 'dealAmountSettingParam',[]);
      }
      // 受邀奖励
      if (filterData.invitedAward.pointSettingFlag == 0 ) {
        that.$set(filterData.invitedAward, 'pointAwardMode', 1);
        that.$set(filterData.invitedAward, 'pointAwardPoint', '');
        that.$set(filterData.invitedAward, 'pointAwardStepParam', []);
        that.$set(filterData.invitedAward, 'pointAwardPerAmount','');
        that.$set(filterData.invitedAward, 'pointAwardPerPoint','');
      }
      if (filterData.invitedAward.pointSettingFlag == 1 && filterData.invitedAward.pointAwardMode == 1 ) {
        that.$set(filterData.invitedAward, 'pointAwardStepParam',[]);
        that.$set(filterData.invitedAward, 'pointAwardPerAmount','');
        that.$set(filterData.invitedAward, 'pointAwardPerPoint','');
      }
      if (filterData.invitedAward.pointSettingFlag == 1 && filterData.invitedAward.pointAwardMode == 2 ) {
        that.$set(filterData.invitedAward, 'pointAwardPoint','');
        that.$set(filterData.invitedAward, 'pointAwardPerAmount','');
        that.$set(filterData.invitedAward, 'pointAwardPerPoint','');
      }
      if (filterData.invitedAward.pointSettingFlag == 1 && filterData.invitedAward.pointAwardMode == 3 ) {
        that.$set(filterData.invitedAward, 'pointAwardPoint','');
        that.$set(filterData.invitedAward, 'pointAwardStepParam',[]);
      }
      if (filterData.invitedAward.cardSettingFlag == 0 ) {
        that.$set(filterData.invitedAward, 'cardAwardMode',1);
        that.$set(filterData.invitedAward, 'cardId','');
        that.$set(filterData.invitedAward, 'cardName','');
        that.$set(filterData.invitedAward, 'cardAwardStepParam',[]);
      }
      if (filterData.invitedAward.cardSettingFlag == 1 && filterData.invitedAward.cardAwardMode==1) {
        that.$set(filterData.invitedAward, 'cardAwardStepParam',[]);
      }
      if (filterData.invitedAward.cardSettingFlag == 1 && filterData.invitedAward.cardAwardMode==2) {
        that.$set(filterData.invitedAward, 'cardId','');
        that.$set(filterData.invitedAward, 'cardName','');
      }
    },
    async moreCheck() {
      const that = this;
      let flag = true;

      if (!!that.$refs.hasOwnProperty('multConsume') && that.$refs.multConsume.length ) {
        console.log(that.$refs)
        for (let index = 0; index < that.$refs.multConsume.length; index++) {
          flag = await that.$refs.multConsume[index].submitForm();
          if (!flag) {
            break;
          }
        }
      }
      if (flag.hasOwnProperty('flag')&& !flag.flag) {
        showMsg.showmsg(flag.msg, 'warning');
        return false;
      }
      let spot = true;
      if (!!that.$refs.hasOwnProperty('multSpot') && that.$refs.multSpot.length ) {
        for (let index = 0; index < that.$refs.multSpot.length; index++) {
          spot = await that.$refs.multSpot[index].submitForm();
          // console.log('spot:',spot)
          if (!spot) {
            break;
          }
        }
      }
      if (spot.hasOwnProperty('flag')&& !spot.flag) {
        showMsg.showmsg(spot.msg, 'warning');
        return false;
      }
      let entry = true;
      if (!!that.$refs.hasOwnProperty('multEntry') && that.$refs.multEntry.length ) {
        for (let index = 0; index < that.$refs.multEntry.length; index++) {
          entry = await that.$refs.multEntry[index].submitForm();
          if (!entry) {
            break;
          }
        }
      }
      if (entry.hasOwnProperty('flag')&& !entry.flag) {
        showMsg.showmsg(entry.msg, 'warning');
        return false;
      }
      let competition = true;
      if (!!that.$refs.hasOwnProperty('multCompetition') && that.$refs.multCompetition.length ) {
        for (let index = 0; index < that.$refs.multCompetition.length; index++) {
          competition = await that.$refs.multCompetition[index].submitForm()
          if (!competition) {
            break;
          }
        }
      }
      if (competition.hasOwnProperty('flag')&& !competition.flag) {
        showMsg.showmsg(competition.msg, 'warning');
        return false;
      }
      let invitee =  true;
      if (!!that.$refs.hasOwnProperty('multInvitee') && that.$refs.multInvitee.length ) {
        for (let index = 0; index < that.$refs.multInvitee.length; index++) {
          invitee = await that.$refs.multInvitee[index].submitForm()
          if (!invitee) {
            break;
          }
        }
      }
      if (invitee.hasOwnProperty('flag')&& !invitee.flag) {
        showMsg.showmsg(invitee.msg, 'warning');
        return false;
      }
      let freeze = true;
      if (!!that.$refs.multFreeze && that.$refs.multFreeze.length ) {
        for (let index = 0; index < that.$refs.multFreeze.length; index++) {
          freeze = await that.$refs.multFreeze[index].submitForm()
          if (!freeze) {
            break;
          }
        }
      }
      if (freeze.hasOwnProperty('flag')&& !freeze.flag) {
        showMsg.showmsg(freeze.msg, 'warning');
        return false;
      }
      // true--->1; false--->0
      that.ProgressiveData.forEach(ele => {
        if (ele.hasOwnProperty('invitedAward')) {
          ele.invitedAward.pointSettingFlag = ele.invitedAward.pointSettingFlag ? 1:0;
          ele.invitedAward.cardSettingFlag = ele.invitedAward.cardSettingFlag ? 1: 0;
        }
        if (!!ele.passAward && ele.passAward.dealNumberFlag == 1) {
          ele.passAward.dealNumberSettingParam.forEach(ele => {
            ele.oldData = true;
            if (!ele.cardCheck && ele.cardId){
              ele.cardId = '';
              ele.cardName = '';
            }

            if(!ele.pointCheck && ele.point) {
              ele.point = '';
            }
          });
        }
        if (!!ele.passAward && ele.passAward.dealAmountFlag == 1) {
          ele.passAward.dealAmountSettingParam.forEach(ele => {
            ele.oldData = true;
            if (!ele.cardCheck && ele.cardId){
              ele.cardId = '';
              ele.cardName = '';
            }

            if(!ele.pointCheck && ele.point) {
              ele.point = '';
            }
          });
        }
      })
      for (let index = 0; index < that.ProgressiveData.length; index++) {
        let element = that.ProgressiveData[index];
        await that.resetKey(element)
      }
      // console.log(that.ProgressiveData);
      const postData = {
        activityId: that.activeInfoData.activityId,
        awardMode: that.activeInfoData.awardMode,
        awardItems: that.ProgressiveData
      };
      that.postSave(postData);
    },
    postSave(data) {
      const that = this;
      let para = JSON.parse(JSON.stringify(data));
      // 最后需要中心组装数据， [{}] json数组形式传递
      postJson('/sharing-core-web/edit-activity-award', para)
        .then(res => {
          let resData = res.data;
          if (resData.errorCode == 1) {
            showMsg.showmsg('活动创建成功', 'success');
            that.$store.dispatch('clearActiveData');
            that.$router.push(`/createCompletion?url=${resData.result}`);
            return;
          }
          errMsg.errorMsg(resData);
        })
        .catch(function(error) {
          that.$message.error({
            duration: 1000,
            message: error.message
          });
        });
    },
    /**
     * 获取活动中心数据
     */
    getData() {
      const that = this;
      let para = {
        activityId: that.$route.query.activityId
      };
      getRequest('/sharing-core-web/get-activity-award', para)
        .then(res => {
          let resData = res.data;
          if (resData.errorCode == 1) {
            if (!resData.result) {
              that.notEdit = true; // 判断未开始的未进入这一步的时候，是不禁止修改的
              return false;
            }
            that.notEdit = false; // 判断未开始的未进入这一步的时候，是不禁止修改的
            if (resData.result.awardMode == 1) {
              that.consumeAction.stepType = resData.result.awardItems[0].stepType;
              that.instanceAward.stepType = resData.result.awardItems[0].stepType;
              that.passAward.stepType = resData.result.awardItems[0].stepType;
              that.compitionAward.stepType = resData.result.awardItems[0].stepType;
              that.invitedAward.stepType = resData.result.awardItems[0].stepType;
              that.pointFreeze.stepType = resData.result.awardItems[0].stepType;
              const obj = {
                activityId: resData.result.activityId,
                awardMode: resData.result.awardMode,
                stepType: resData.result.awardItems[0].stepType,
                instantAwardFlag: resData.result.awardItems[0].instantAwardFlag, // 即时
                passAwardFlag: resData.result.awardItems[0].passAwardFlag, // 闯关
                competitionAwardFlag: resData.result.awardItems[0].competitionAwardFlag, // 竞赛
                serviceAttentionFlag: resData.result.awardItems[0].serviceAttentionFlag, // 服务号关注开关
                entryActivityFlag: resData.result.awardItems[0].entryActivityFlag, // 活动着陆页开关
                authorizeOpenCardFlag: resData.result.awardItems[0].authorizeOpenCardFlag, // 认证开卡奖励开关
                enjoyGameFlag: resData.result.awardItems[0].enjoyGameFlag, // 参与游戏开关
                receiveCardFlag: resData.result.awardItems[0].receiveCardFlag, // 领取卡券开关
                consumeAwardFlag: resData.result.awardItems[0].consumeAwardFlag, // 消费奖开关
                // 消费行为控制
                consumeAction: resData.result.awardItems[0].consumeAction? resData.result.awardItems[0].consumeAction : that.consumeAction,
                instanceAward: resData.result.awardItems[0].instanceAward? resData.result.awardItems[0].instanceAward : that.instanceAward,
                passAward: resData.result.awardItems[0].passAward? resData.result.awardItems[0].passAward: that.passAward,
                compitionAward: resData.result.awardItems[0].compitionAward? resData.result.awardItems[0].compitionAward : that.compitionAward,
                invitedAward: resData.result.awardItems[0].invitedAward? resData.result.awardItems[0].invitedAward : that.invitedAward,
                pointFreeze: resData.result.awardItems[0].pointFreeze?  resData.result.awardItems[0].pointFreeze : that.pointFreeze
              };
              if (obj.invitedAward) {
                obj.invitedAward.pointSettingFlag = obj.invitedAward.pointSettingFlag==1 ? true:false;
                obj.invitedAward.cardSettingFlag = obj.invitedAward.cardSettingFlag==1 ? true: false;
              }
              that.activeInfoData = obj;
            }else {
              that.activeInfoData.activityId = resData.result.activityId;
              that.activeInfoData.awardMode = resData.result.awardMode;
              let ProgressiveData =  resData.result.awardItems;
              ProgressiveData.forEach(ele => {
                if (ele.stepType == 6) {
                  ele.activeName = 'first';
                }else {
                  ele.activeName = ele.instanceAward? 'second' : 'five';
                }
                let consumeAction = JSON.parse(JSON.stringify(that.consumeAction));
                let instanceAward = JSON.parse(JSON.stringify(that.instanceAward));
                let passAward = JSON.parse(JSON.stringify(that.passAward));
                let compitionAward = JSON.parse(JSON.stringify(that.compitionAward));
                let invitedAward = JSON.parse(JSON.stringify(that.invitedAward));
                let pointFreeze = JSON.parse(JSON.stringify(that.pointFreeze));
                consumeAction.stepType = ele.stepType;
                instanceAward.stepType = ele.stepType;
                passAward.stepType = ele.stepType;
                compitionAward.stepType = ele.stepType;
                invitedAward.stepType = ele.stepType;
                pointFreeze.stepType = ele.stepType;
                ele.consumeAction = ele.consumeAction?ele.consumeAction : consumeAction,
                ele.instanceAward = ele.instanceAward?ele.instanceAward : instanceAward,
                ele.passAward = ele.passAward?ele.passAward: passAward,
                ele.compitionAward = ele.compitionAward?ele.compitionAward : compitionAward,
                ele.invitedAward = ele.invitedAward?ele.invitedAward : invitedAward,
                ele.pointFreeze = ele.pointFreeze? ele.pointFreeze : pointFreeze
                // console.log(compitionAward)
                if (ele.invitedAward) {
                  ele.invitedAward.pointSettingFlag = ele.invitedAward.pointSettingFlag==1 ? true:false;
                  ele.invitedAward.cardSettingFlag = ele.invitedAward.cardSettingFlag==1 ? true: false;
                }
              })
              that.ProgressiveData = JSON.parse(JSON.stringify(ProgressiveData));
            return false;
            }
          }else {
            errMsg.errorMsg(resData);
          }

        })
        .catch(function(error) {
          that.$message.error({
            duration: 1000,
            message: error.message
          });
        });
    }
  },
  mounted() {
    const that = this;
    if (that.$route.query.hasOwnProperty('activityId')) {
      that.getData();
    }
    if (Object.keys(that.$store.state.baseInfo).length) {
      that.basePath = JSON.parse(JSON.stringify(that.$store.state.baseInfo)).router;
      const names = that.basePath.map(ele => ele.transName);
      if (names.includes('消费')) {
        that.activeName = 'first';
      } else {
        that.activeName = 'second';
      }
      for (const i in that.switchObj) {
        that.activeInfoData[i] = names[names.length - 1].includes(that.switchObj[i]) ? 1 : 0;
      }
      if (names[names.length - 1].includes('领取卡券')) {
        that.activeInfoData.consumeAwardFlag = 1;
      }
      that.stepTypeNum = that.stepObj[names[names.length - 1]];
      that.activeInfoData.stepType = that.stepTypeNum;
      that.activeInfoData.consumeAction.stepType = that.stepTypeNum;
      that.activeInfoData.instanceAward.stepType = that.stepTypeNum;
      that.activeInfoData.passAward.stepType = that.stepTypeNum;
      that.activeInfoData.compitionAward.stepType = that.stepTypeNum;
      that.activeInfoData.invitedAward.stepType = that.stepTypeNum;
      that.activeInfoData.pointFreeze.stepType = that.stepTypeNum;
      that.activeInfoData.activityId = JSON.parse(JSON.stringify(that.$store.state.baseInfo)).activityId;
    }
    if (Object.keys(that.$store.state.rewardInfo).length) {
      that.$nextTick(() => {
        that.activeInfoData = JSON.parse(JSON.stringify(that.$store.state.rewardInfo));
        console.log(that.activeInfoData)
        if (that.activeInfoData.awardMode == 2) {
          that.ProgressiveData = JSON.parse(JSON.stringify(that.$store.state.multRewardInfo));
        }
      });
    }
  }
};
</script>
<style lang="less" scoped>
.reward-config-content {
  padding: 48px 0 0 0;
  .config-title {
    font-weight: 600;
    margin-bottom: 30px;
  }
  .m-t-30 {
    margin-top: 30px;
  }
  .m-t-50 {
    margin-top: 50px;
  }
  .el-form-item {
    /deep/ .el-form-item__label {
      color: #606266;
    }
  }
  ul {
    .li-cell {
      position: relative;
      width: 362px;
      height: 124px;
      background: rgba(255, 255, 255, 1);
      border-radius: 4px;
      border: 1px solid rgba(220, 223, 230, 1);
      margin-left: 10px;
      cursor: pointer;
      max-width: 30%;
      transition: all 0.3s;
      &:hover {
        -webkit-transform: translateY(-10px);
        -moz-transform: translateY(-10px);
        -o-transform: translateY(-10px);
        transform: translateY(-10px);
        box-shadow: 0px 2px 10px 0 rgba(174, 181, 189, 0.5);
      }
      &:first-child {
        margin-left: 0;
      }
      .li-cell-inner {
        border-radius: 4px;
        width: 100%;
        height: 100%;
        .li-cell-left {
          height: 100%;
          padding-left: 30px;
          img {
            max-width: 66px;
            max-height: 66px;
          }
        }
        .li-cell-right {
          height: 100%;
          padding: 16px 36px;
          .li-cell-active_name {
            font-weight: 600;
            line-height: 25px;
          }
          .li-cell-active_describe {
            height: 60px;
            margin-top: 10px;
            font-weight: 500;
            line-height: 20px;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3; //规定几行显示省略号
            -webkit-box-orient: vertical;
            overflow: hidden;
          }
        }
      }
      .common-cell-check {
        display: none;
        position: absolute;
        right: 0;
        bottom: 0;
        width: 22px;
        height: 22px;
        z-index: 1;
        .common-cell-triangle {
          position: relative;
          width: 100%;
          height: 100%;
          overflow: hidden;
          .common-cell-outer {
            position: absolute;
            right: -16px;
            bottom: -6px;
            width: 32px;
            height: 20px;
            background: #fff;
            text-align: center;
            -webkit-transform: rotate(-45deg);
            -moz-transform: rotate(-45deg);
            transform: rotate(-45deg);

            i {
              position: absolute;
              top: 0px;
              left: 7px;
              font-size: 12px;
              color: #1890ff;
              -webkit-transform: rotate(45deg);
              -moz-transform: rotate(45deg);
              transform: rotate(45deg);
            }
          }
        }
      }
      &.li-cell-active {
        background: linear-gradient(63deg, #357bdf 0%, #72b4fb 100%);
        box-shadow: 0px 2px 10px 0 rgba(174, 181, 189, 0.5);
        border-radius: 4px;
        border: none;
        .li-cell-inner {
          .li-cell-right {
            .li-cell-active_name {
              color: #fff;
            }
            .li-cell-active_describe {
              color: #fff;
            }
          }
        }
        .common-cell-check {
          display: block;
          .common-cell-triangle {
            border-bottom-right-radius: 4px;
          }
        }
      }
      /* 二级 */
      &.li-second-cell {
        max-width: 234px;
        height: 141px;
        padding: 20px;
        .li-cell-inner {
          .li-cell-bottom {
            height: 60px;
            background: #fff;
            border-radius: 0 0 4px 4px;
            .li-cell-scene {
              .li-cell-scene_title {
                font-weight: 600;
                line-height: 20px;
              }
              .li-cell-scene_text {
                margin-top: 10px;
                font-weight: 500;
                line-height: 20px;
                text-overflow: ellipsis;
                display: -webkit-box;
                -webkit-line-clamp: 4; //规定几行显示省略号
                -webkit-box-orient: vertical;
                overflow: hidden;
              }
            }
          }
        }
        .common-cell-check {
          .common-cell-triangle {
            .common-cell-outer {
              background: #1890ff;
              i {
                color: #fff;
              }
            }
          }
        }
      }
      &.li-second-active {
        border-radius: 4px;
        border: 2px solid rgba(24, 144, 255, 1);
        box-shadow: 0px 6px 8px 0px rgba(166, 181, 199, 0.34);
        .common-cell-check {
          display: block;
          .common-cell-triangle {
            border-bottom-right-radius: 1px;
          }
        }
      }
    }
  }

  .active-big-class {
    width: 1200px;
    .progress-active-title {
      width: 100%;
      padding: 0 20px;
      height: 70px;

      .active-title-left {
        padding-top: 12px;
      }
      .active-title-title {
        font-weight: 600;
        line-height: 22px;
      }
      .active-title-subtitle {
        font-weight: 500;
        line-height: 20px;
      }
    }
    .parent-li-cell {
      border-bottom: 1px solid rgba(220, 223, 230, 1);
      &:first-child {
        border-top: 1px solid rgba(220, 223, 230, 1);
      }
      .set-body {
        padding: 15px 20px 0 20px;
      }

      &.show-active-li {
        box-shadow: 0px 1px 8px 0px rgba(170, 170, 170, 0.32);
        border: 1px solid rgba(220, 223, 230, 1);
        background: #fff;
        &:not(:first-child) {
          border-top: none;
        }
        .progress-active-title {
          background: rgba(243, 246, 249, 1);
        }
      }
    }
  }
}
</style>
