<template>
  <div class="fissionCouponListNewAll">
    <div
      class="fissionCouponListCouponBox"
      ref="fissionCouponList"
      @click.stop="styleClick('click', 'fissionCouponList')"
      @mousemove="styleClick('mousemove', 'fissionCouponList')"
      @mouseout="styleClick('mouseout')"
      :style="styleData.mainCoupon"
    >
      <div class="tixingStyle" :style="styleData.tixingStyle">
        <van-notice-bar>
          <img class="tixingImage" :style="styleData.tixingImage" :src="styleData.tixingImage.imageUrl" />
          <div v-if="type == '1'" style="tixingText" :style="styleData.tixingText">
            重要提示：列表中的券，每人只能以团长或团员的身份成功参与一次（开团数量不限制），每组奖励每人仅可获得一份
          </div>
          <div v-else-if="type == '0'" style="tixingText" :style="styleData.tixingText">
            重要提示：每人只能以团长或团员的身份成功参与一次（开团数量不限制），每组奖励每人仅可获得一份
          </div>
        </van-notice-bar>
      </div>
      <div class="listTitleDivAll"><img class="listTitleImgAll" src="//img10.360buyimg.com/imgzone/jfs/t1/182569/12/24349/3713/629dc0f4Ef273348e/35f98e943d3accdb.png" /></div>

      <div class="couponAllList" v-if="showCouponPage">
        <div :style="styleData.coupon" class="couponListDivAll" v-for="item in prizeInfoList">
          <div class="tuanzhangDivAll" :style="styleData.tuanzhangDivAll">
            <div class="leftDivAll">
              <div class="couponPriceDivAll" :style="styleData.priceStyle">
                <span>¥</span>
                <span class="couponPriceSpan">{{ item.captainDenomination }}</span>
              </div>

              <div class="couponDetailDivAll">
                <div class="prizeNameDiv">{{item.captainPrizeName}}</div>
                <div class="conditionDiv">{{ item.captainCondition }}</div>
                <div class="teamCntDiv">邀请{{ item.maxMembersCount }}人可成团</div>
                <div class="progressDivAll">
                  <div class="progressContainer">
                     <!-- :style="'width:'+ item.captainRobbedPercent +'%'" -->
                    <div class="van-progress">
                      <van-progress
                        :percentage="item.captainRobbedPercent"
                        v-if="!isNaN(parseInt(item.captainRobbedPercent))"
                        track-color="#ffb3a9"
                        pivot-text=""
                        text-color="#fff"
                        color="#f10400"
                        show-pivot
                        style="border-radius: 11px;width: 100%;border: 2px solid #f10400;display: flex;justify-content: center;align-items: center;"
                      />
                      <!-- {{ item.captainRobbedPercent }} -->
                      <div class="pinPercentDiv">{{item.captainRobbedPercent}}%</div>
                    </div>
                  </div>
                  <div class="dispKbnDiv">已抢{{ item.captainRobbedPercent }}%</div>
                </div>
              </div>
            </div>

            <div class="rightDivAll">
              <div class="friendDivAll" v-if="item.dispKbn != '1'" @click="btnClick(4, item)">助力好友 ></div>
              <div class="couponBtnDivAll">
                <!-- 表示区分 1:立即抢券(未成团) 2:邀请好友（拼卷中）3:已抢完  4:组队成功（发奖失败） 5 来晚了 8已拼成 9:去使用（已成团） -->
                <div class="couponBtn1" :style="styleData.couponBtn1" v-if="item.dispKbn == '1'" @click="btnClick(1, item)">立即开团</div>
                <div class="couponBtn2" :style="styleData.couponBtn2" v-else-if="item.dispKbn == '9' && item.isCaptain == 1 " @click="btnClick(2, item)">去使用</div>
                <div class="couponBtn3" :style="styleData.couponBtn3" v-else-if="item.dispKbn == '9' && item.isCaptain != 1 ">去使用</div>
                <div class="couponBtn1" :style="styleData.couponBtn1" v-else-if="item.dispKbn == '2'" @click="btnClick(3, item)">邀请好友</div>
                <div class="couponBtn3" :style="styleData.couponBtn3" v-else-if="item.dispKbn == '4'">领券失败</div>
                <div class="couponBtn3" :style="styleData.couponBtn3" v-else-if="item.dispKbn == '3'">券已抢完</div>
              </div>

              <!-- 已经开团显示状态 isCaptain 1团长-->
              <div class="couponStatusDivAll" v-if="item.dispKbn != '1'">
                <div class="loginShenFenDiv" v-if='item.isCaptain == 1'><img class="loginShenFenImage" :src="item.userImg" /></div>
                <div class="couponStaus1" :style="styleData.couponStaus1" v-if="item.dispKbn == '1'">待拼券</div>
                <div class="couponStaus2" :style="styleData.couponStaus2" v-else-if="item.dispKbn == '9'">领取成功</div>
                <div class="couponStaus4" :style="styleData.couponStaus4" v-else-if="item.dispKbn == '3'">拼券结束</div>
                <div class="couponStaus4" :style="styleData.couponStaus4" v-else-if="item.dispKbn == '4'">领券失败</div>
                <div class="couponStaus3" :style="styleData.couponStaus3" v-else-if="item.dispKbn == '2'">拼券中...</div>
              </div>

              <!-- //只有立即开团显示团长身份 -->
              <div class="tzsfDiv" v-if="item.dispKbn == '1'">
                <span v-if="item.captainMarkingId">限{{ item.captainMarkingId }}参与</span>
                <span v-else>不限制</span>
              </div>
            </div>
          </div>
          <div class="tuanyuanDivAll" :style="styleData.tuanyuanDivAll">
            <div class="leftDivAll1">
              <div class="left-leftDiv">
                <div class="couponPriceDivAll1" :style="styleData.priceStyle1">
                  <span>¥</span>
                  <span class="couponPriceSpan1">{{ item.memberDenomination }}</span>
                </div>
                <div class="tuenImageDiv"><img src="//img10.360buyimg.com/imgzone/jfs/t1/38943/13/20873/4098/638ffd92E6d4e7598/1de57697865ffaba.png" /></div>
              </div>

              <div class="couponDetailDivAll1">
                <div class="prizeNameDiv">{{item.memberPrizeName}}</div>
                <div class="conditionDiv">{{ item.memberCondition }}</div>
              </div>
            </div>
            <div class="rightDivAll1">
              <div class="tysfDiv" v-if="item.dispKbn == '1'">
                <span v-if="item.memberMarkingId">限{{ item.memberMarkingId }}参团</span>
                <span v-else>不限制</span>
              </div>
              <!-- 发放成功 有头像 2团员 -->

              <div class="loginShenFenDiv" v-if="item.dispKbn == '9' && item.isCaptain == 2"><img class="loginShenFenImage" :src="item.userImg" /></div>

              <div v-if="item.dispKbn == '2'" :style="styleData.tycouponStaus3" class="tycouponStaus3">团员组队中...</div>
              <div v-if="item.dispKbn == '9' && item.isCaptain == 2" :style="styleData.tycouponStaus2" class="tycouponStaus2" @click="btnClick(2, item)">发放成功 ></div>
              <div v-if="item.dispKbn == '9' && item.isCaptain != 2" :style="styleData.tycouponStaus2" class="tycouponStaus2">团员奖励已发放</div>

              <div v-if="item.dispKbn == '4'" :style="styleData.tycouponStaus4" class="tycouponStaus4">团员拼券失败</div>
              <div v-if="item.dispKbn == '3'" :style="styleData.tycouponStaus4" class="tycouponStaus4">团员拼券结束</div>
            </div>
          </div>
        </div>
      </div>

      <div v-if="showCouponInvitePage" class="couponInvite" :style="styleData.couponInvite">
        <div class="topDivAll">
          <div class="leftDivAll leftDivAll1">
            <div class="couponPriceDivAll" :style="styleData.couponPriceDivAll">
              <span>¥</span>
              <span class="couponPriceSpan">{{ prizeDetailInfo.captainDenomination }}</span>
            </div>

            <div class="couponDetailDivAll">
              <div class="prizeNameDiv">优惠券</div>
              <div class="conditionDiv">{{ prizeDetailInfo.captainCondition }}</div>
              <div class="teamCntDiv">邀请{{ prizeDetailInfo.maxMembersCount }}人可成团</div>
              <div class="progressDivAll">
                <div class="progressContainer">
                  <div class="van-progress">
                    <van-progress
                      :percentage="prizeDetailInfo.captainRobbedPercent"
                      v-if="!isNaN(parseInt(prizeDetailInfo.captainRobbedPercent))"
                      track-color="#ffb3a9"
                      pivot-text=""
                      text-color="#fff"
                      color="#f10400"
                      show-pivot
                      style="border-radius: 11px;width: 100%;border: 2px solid #f10400;display: flex;justify-content: center;align-items: center;"
                    />
                    <div class="pinPercentDiv">{{ prizeDetailInfo.captainRobbedPercent }}%</div>
                  </div>
                </div>
                <div class="dispKbnDiv">已抢{{ prizeDetailInfo.captainRobbedPercent }}%</div>
              </div>
            </div>
          </div>
          <!--   // dispKbn: 1:立即抢券(未成团),2:邀请好友（拼卷中）,3:优惠券已抢完，4：跟其他队伍拼了券，5：队伍已满，6发奖失败,9:去使用 -->
          <div class="topRight">
            <div class="loginShenFenDiv"><img class="loginShenFenImage" :src="prizeDetailInfo.captainUserImg" /></div>
            <div class="rightDiv3" v-if="prizeDetailInfo.dispKbn == '9'"><div>团长拼券成功</div></div>
            <div class="rightDiv1" v-else-if="prizeDetailInfo.dispKbn == '2' || prizeDetailInfo.dispKbn == '1'"><div>拼券中...</div></div>
            <div class="rightDiv2" v-else-if="prizeDetailInfo.dispKbn == '3' || prizeDetailInfo.dispKbn == '4' || prizeDetailInfo.dispKbn == '5' || prizeDetailInfo.dispKbn == '6'">
              <div>拼券结束</div>
            </div>
          </div>
        </div>

        <div class="kdBottomDivAll">
          <div class="kdTopDivAll">
            <div class="leftDivAll1">
              <div class="left-leftDiv">
                <div class="couponPriceDivAll1" :style="styleData.priceStyle1">
                  <span>¥</span>
                  <span class="couponPriceSpan1">{{ prizeDetailInfo.memberDenomination }}</span>
                </div>
                <div class="tuenImageDiv"><img src="//img10.360buyimg.com/imgzone/jfs/t1/38943/13/20873/4098/638ffd92E6d4e7598/1de57697865ffaba.png" /></div>
              </div>

              <div class="couponDetailDivAll1">
                <div class="prizeNameDiv">优惠券</div>
                <div class="conditionDiv">{{ prizeDetailInfo.memberCondition }}</div>
              </div>
            </div>
            <div class="rightDivAll1">
              <!-- <div class="tysfDiv" v-if="prizeDetailInfo.dispKbn == '1'">限店铺新客参团</div> -->
              <div @click="btnClick(3, prizeDetailInfo)" v-if="prizeDetailInfo.dispKbn == '2'" :style="styleData.kttycouponStaus3" class="kttycouponStaus3">邀请好友></div>
              <div v-else-if="prizeDetailInfo.dispKbn == '9'" :style="styleData.kttycouponStaus2" class="kttycouponStaus2">团员奖励已发放</div>
              <div v-else-if="prizeDetailInfo.dispKbn == '4'" :style="styleData.kttycouponStaus4" class="kttycouponStaus4">团员拼券失败</div>
              <div v-else-if="prizeDetailInfo.dispKbn == '3'" :style="styleData.kttycouponStaus4" class="kttycouponStaus4">团员拼券结束</div>
            </div>
          </div>

          <div class="promptDiv1">
            <span class="promptDiv2" v-if="prizeDetailInfo.dispKbn == '2' || prizeDetailInfo.dispKbn == '1'">拼券成功后，所有成员均可获得优惠哦~</span>
            <span class="promptDiv3" v-else-if="prizeDetailInfo.dispKbn == '3'">抱歉，您晚到一步，团员拼券结束！</span>
            <span class="promptDiv4" v-else-if="prizeDetailInfo.dispKbn == '9'">拼券成功，恭喜获得神券！</span>
            <span class="promptDiv3" v-else-if="prizeDetailInfo.dispKbn == '4'">该优惠您已经发起或参与过拼券啦！</span>
            <span class="promptDiv3" v-else-if="prizeDetailInfo.dispKbn == '5'">该队伍已经满员啦，赶紧看看其他优惠吧！</span>
            <span class="promptDiv3" v-else-if="prizeDetailInfo.dispKbn == '6'">抱歉，发奖失败！</span>
          </div>
          <div :class="[isWebClick ? 'friendListDivAll friendListDivAll1' : 'friendListDivAll']">
            <div class="friendItemDivAll" v-for="(items, index) in teamMemberList">
              <div class="friendDetailDivAll" v-if="items.captainKbn != 0">
                <div class="userImgDiv"><img class="userImg" :src="items.userImg" /></div>
                <div class="nickNameDiv">{{ items.nickName }}</div>
              </div>
            </div>
          </div>
          <!--   // dispKbn: 1:立即抢券(未成团),2:邀请好友（拼卷中）,3:优惠券已抢完，4：跟其他队伍拼了券，5：队伍已满，6发奖失败,9:去使用 -->
          <div class="btnDivAll">
            <div class="bottomBtnDiv" :style="styleData.bottomBtnDiv" v-if="prizeDetailInfo.dispKbn == '1'" @click="ktJoinTeam"><span id="invite-btn">参与拼团</span></div>
            <div class="bottomBtnDiv" :style="styleData.bottomBtnDiv" v-else-if="prizeDetailInfo.dispKbn == '9'" @click="btnClick(2, prizeDetailInfo)">
              <span id="invite-btn">去使用</span>
            </div>
            <div class="bottomBtnDiv" :style="styleData.bottomBtnDiv" v-else-if="prizeDetailInfo.dispKbn == '2'" @click="btnClick(3, prizeDetailInfo)">
              <span id="invite-btn">邀请好友</span>
            </div>

            <div
              class="bottomBtnDivRight"
              :style="styleData.bottomBtnDivRight"
              v-if="prizeDetailInfo.dispKbn == '1' || prizeDetailInfo.dispKbn == '2' || prizeDetailInfo.dispKbn == '9'"
            >
              <span id="invite-btn" @click="btnClick(5, prizeDetailInfo)">发现更多优惠</span>
            </div>
            <div class="bottomBtnDivRight1" :style="styleData.bottomBtnDivRight1" v-else><span id="invite-btn" @click="btnClick(5, prizeDetailInfo)">发现更多优惠</span></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import apis1 from '../../../util/apis1.js';
import store from '../../../store/store';
import Vue from 'vue';
import { Progress } from 'vant';
import { getUrlQueryValueByKey, goToShopPage, goUseCoupon, moreCoupon } from '../../../util/tools.js';
import { callShare4MiniProgram } from '../../../util/share';
import { BargainMemberPopComService1, joinVipService1 } from '../../../util/comCreate.js';
import { hdzxtFailPopService, hdzxtSuccessPopService, hdzxtCouponPopPopServiceNew, hdzxtCouponFriendPopPopService, generalDialogService } from '../../../util/hdzxtcomCreate.js';
import ButtomBtn from '../buttomBtn/buttomBtn';
import dateUtil from '../../../util/dateUtil';
import { teamShare } from '../../../js/share.js';

Vue.use(Progress);

let {
  newFissionCouponActivity,
  newFissionCouponShareActivity,
  newFissionCouponJoinCoupon,
  newFissionCouponFight,
  newFissionCouponGetCanJumpInLine,
  newFissionCouponCheckUser,
  newFissionCouponJoinTeam,
  newFissionCouponGetTeamMembers
} = apis1;

export default {
  components: { ButtomBtn },
  props: ['datas', 'keyData', 'styleData', 'isTemplate', 'templateData', 'isWebClick', 'modifyContent', 'typeNameValue'],
  data() {
    return {
      showCouponPage: false, // 是否显示列表页面 true 表示 false 不表示
      showCouponInvitePage: false, // 是否显示优惠券详情页面 true 表示 false 不表示
      shopName: '', // 店铺名
      teamMemberList: [], // 队伍成员列表
      prizeInfoList: [], // 优惠券列表
      prizeDetailInfo: [], // 优惠券详情
      prizeDetailInfo1: [],
      currentRate: 0, // 当前比例
      type: '1', // 类型 1 主端 0 客端
      shopId: '', // 店铺ID
      teamId: '', // 队伍ID
      autoWidth: {
        width: ''
      }, // 队伍列表的宽度
      text: '',
      styleDataOld: {}
    };
  },
  created() {
    //深拷贝重置需要
    this.styleDataOld = JSON.parse(JSON.stringify(this.styleData));
    this.initData();

    //是否是被邀请者
    this.shareUserId = store.state.shareUserId;
  },

  methods: {
    styleClick(type, refName) {
      if (this.isWebClick) {
        //传值给B端
        let byValue = {
          modifyContent: this.modifyContent,
          refName: refName,
          styleData: this.styleData,
          isCustomSwitching: this.isCustomSwitching, //有tab切换时
          c_this: this,
          styleDataOld: this.styleDataOld
        };
        this.$emit('opertaionCom', type, byValue);
      }
    },

    initData() {
      // console.log(location.origin, 'location.origin ');
      // this.publicData.$emit('isKe', false);
      var datasAll = this.templateData;
      // console.log(this.isTemplate, 'typeNameValue');
      if (this.isTemplate == true) {
        if (!this.isWebClick) {
          this.$toast('活动预览，仅供查看');
        } else {
          if (this.typeNameValue == 3) {
            console.log(this.isWebClick, 'zxcccccccx1111111');
            this.styleClick('click', 'fissionCouponList');
            //客端
            this.showCouponPage = false;
            this.showCouponInvitePage = true;
            var shareData = {
              data: {
                newFissionPrizeInfoVOList: [
                  {
                    captainPrizeInfoId: '1588376287786209282',
                    teamId: '1588377062930575361',
                    captainPrizeName: '21',
                    captainPrizeImg: '//img10.360buyimg.com/imgzone/jfs/t1/215393/22/4731/33329/61946651E535ea01f/5cee5951d6bd1612.png',
                    captainDenomination: 5,
                    captainCondition: '满20元使用',
                    dispKbn: '2',
                    captainRobbedPercent: 0,
                    memberPrizeInfoId: '', //-----团员奖品id
                    memberPrizeName: '', //---团员奖品名称
                    memberPrizeImg: '', //-----团员奖品图片
                    memberDenomination: 10, // ---团员品面额
                    memberCondition: '满5元使用', //团员满减
                    userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
                    maxMembersCount: 3, //----邀请几人可成团
                    captainMarkingId: '店铺新客', //----需要开团团长的身份
                    memberMarkingId: '店铺老客', //----需要开团的身份
                    isCaptain: '' //----1团长 2团员
                  }
                ],
                status: 0,
                joinFlag: false
              },
              resp_code: 0,
              resp_msg: ''
            };
            var prizeInfoList0 = shareData.data.prizeInfoList[0];
            this.prizeDetailInfo = prizeInfoList0;
            this.teamMemberList = [
              {
                userImg: '//img10.360buyimg.com/imgzone/jfs/t1/192914/13/31573/4024/6391470dE371db7a7/019e54628504b2dc.png'
              },
              {
                userImg: '//img10.360buyimg.com/imgzone/jfs/t1/192914/13/31573/4024/6391470dE371db7a7/019e54628504b2dc.png'
              }
            ];
          } else if (this.typeNameValue == 0) {
            this.prizeInfoList = [];
            this.showCouponInvitePage = false;
            this.showCouponPage = true;
            // 没有模板的数据-创建之前
            this.prizeInfoList = [
              {
                captainPrizeInfoId: '1588376287786209282',
                teamId: '1588377062930575361',
                captainPrizeName: '21',
                captainPrizeImg: '//img10.360buyimg.com/imgzone/jfs/t1/215393/22/4731/33329/61946651E535ea01f/5cee5951d6bd1612.png',
                captainDenomination: 5,
                captainCondition: '满20元使用',
                dispKbn: '2',
                captainRobbedPercent: 0,
                memberPrizeInfoId: '', //-----团员奖品id
                memberPrizeName: '', //---团员奖品名称
                memberPrizeImg: '', //-----团员奖品图片
                memberDenomination: 10, // ---团员品面额
                memberCondition: '满5元使用', //团员满减
                userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
                maxMembersCount: 3, //----邀请几人可成团
                captainMarkingId: '店铺新客', //----需要开团团长的身份
                memberMarkingId: '店铺老客', //----需要开团的身份
                isCaptain: '' //----1团长 2团员
              },
              {
                captainPrizeInfoId: '1588376287786209282',
                teamId: '1588377062930575361',
                captainPrizeName: '21',
                captainPrizeImg: '//img10.360buyimg.com/imgzone/jfs/t1/215393/22/4731/33329/61946651E535ea01f/5cee5951d6bd1612.png',
                captainDenomination: 5,
                captainCondition: '满20元使用',
                dispKbn: '2',
                captainRobbedPercent: 0,
                memberPrizeInfoId: '', //-----团员奖品id
                memberPrizeName: '', //---团员奖品名称
                memberPrizeImg: '', //-----团员奖品图片
                memberDenomination: 10, // ---团员品面额
                memberCondition: '满5元使用', //团员满减
                userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
                maxMembersCount: 3, //----邀请几人可成团
                captainMarkingId: '店铺新客', //----需要开团团长的身份
                memberMarkingId: '店铺老客', //----需要开团的身份
                isCaptain: '' //----1团长 2团员
              },
              {
                captainPrizeInfoId: '1588376287786209282',
                teamId: '1588377062930575361',
                captainPrizeName: '21',
                captainPrizeImg: '//img10.360buyimg.com/imgzone/jfs/t1/215393/22/4731/33329/61946651E535ea01f/5cee5951d6bd1612.png',
                captainDenomination: 5,
                captainCondition: '满20元使用',
                dispKbn: '2',
                captainRobbedPercent: 0,
                memberPrizeInfoId: '', //-----团员奖品id
                memberPrizeName: '', //---团员奖品名称
                memberPrizeImg: '', //-----团员奖品图片
                memberDenomination: 10, // ---团员品面额
                memberCondition: '满5元使用', //团员满减
                userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
                maxMembersCount: 3, //----邀请几人可成团
                captainMarkingId: '店铺新客', //----需要开团团长的身份
                memberMarkingId: '店铺老客', //----需要开团的身份
                isCaptain: '' //----1团长 2团员
              }
            ];
          }
          return;
        }
        console.log(datasAll, 'datasAll');

        if (datasAll) {
          let fissionCouponPrizeList = datasAll.newFissionCoupon.rules;
          // 没有模板的数据-创建之后
          for (let index = 0; index < fissionCouponPrizeList.length; index++) {
            const element = fissionCouponPrizeList[index];
            // console.log(element, 'elementelement');
            if (element.captainDraw.prizeList[0].prizeJson) {
              var captainPrizeJson = JSON.parse(element.captainDraw.prizeList[0].prizeJson).list[0];
            } else if (element.captainDraw.prizeList[0].couponData) {
              var captainPrizeJson = element.captainDraw.prizeList[0].couponData;
            }

            if (element.memberDraw.prizeList[0].prizeJson) {
              var memberPrizeJson = JSON.parse(element.memberDraw.prizeList[0].prizeJson).list[0];
            } else if (element.captainDraw.prizeList[0].couponData) {
              var memberPrizeJson = element.memberDraw.prizeList[0].couponData;
            }

            // console.log(captainPrizeJson, 'prizeJsonprizeJson');
            // console.log(memberPrizeJson, 'prizeJsonprizeJson');

            const prizeCoupon = {
              captainPrizeInfoId: '1588376287786209282',
              teamId: '1588377062930575361',
              captainPrizeName: '21',
              captainPrizeImg: '//img10.360buyimg.com/imgzone/jfs/t1/215393/22/4731/33329/61946651E535ea01f/5cee5951d6bd1612.png',
              captainDenomination: captainPrizeJson.couponType == 1 ? captainPrizeJson.couponDiscount : captainPrizeJson.couponDiscount,
              captainCondition: captainPrizeJson.couponType == 1 ? '满' + captainPrizeJson.couponQuota + '元使用' : '无门槛使用',
              dispKbn: '1',
              captainRobbedPercent: 0,
              memberPrizeInfoId: '', //-----团员奖品id
              memberPrizeName: '', //---团员奖品名称
              memberPrizeImg: '', //-----团员奖品图片
              memberDenomination: memberPrizeJson.couponType == 1 ? memberPrizeJson.couponDiscount : memberPrizeJson.couponDiscount, // ---团员品面额
              memberCondition: memberPrizeJson.couponType == 1 ? '满' + memberPrizeJson.couponQuota + '元使用' : '无门槛使用', //团员满减
              userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
              maxMembersCount: element.maxMembersCount, //----邀请几人可成团
              captainMarkingId: element.captainMarkingId, //----需要开团团长的身份
              memberMarkingId: element.memberMarkingId, //----需要开团的身份
              needPeopleCnt: element.maxMembersCount, //----需要人数
              isCaptain: '' //----1团长 2团员
            };
            // console.log(prizeCoupon, 'prizeCoupon');

            this.prizeInfoList.push(prizeCoupon);
            this.showCouponPage = true;
          }
        } else {
          // 没有模板的数据-创建之前
          let type = store.state.shareUserId ? '0' : '1'; // 1 主端 0 客端
          // console.log(type, 'typetypetyp123123e');

          if (type == '1') {
            for (let index = 0; index < 5; index++) {
              const prizeCoupon = {
                captainPrizeInfoId: '1588376287786209282',
                teamId: '1588377062930575361',
                captainPrizeName: '21',
                captainPrizeImg: '//img10.360buyimg.com/imgzone/jfs/t1/215393/22/4731/33329/61946651E535ea01f/5cee5951d6bd1612.png',
                captainDenomination: 5,
                captainCondition: '满20元使用',
                dispKbn: '2',
                captainRobbedPercent: 0,
                memberPrizeInfoId: '', //-----团员奖品id
                memberPrizeName: '', //---团员奖品名称
                memberPrizeImg: '', //-----团员奖品图片
                memberDenomination: 10, // ---团员品面额
                memberCondition: '满5元使用', //团员满减
                userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
                maxMembersCount: 3, //----邀请几人可成团
                captainMarkingId: '店铺新客', //----需要开团团长的身份
                memberMarkingId: '店铺老客', //----需要开团的身份
                needPeopleCnt: '2', //----需要人数
                isCaptain: '' //----1团长 2团员
              };
              this.prizeInfoList.push(prizeCoupon);
              console.log(this.prizeInfoList, 'this.prizeInfoList');
              // console.log(this.prizeInfoList,'this.prizeInfoList')
            }
            if (!this.isWebClick) {
              this.showCouponPage = true;
            }
            this.prizeInfoList[0].dispKbn = '1';
            this.prizeInfoList[1].dispKbn = '2';
            this.prizeInfoList[2].dispKbn = '3';
            this.prizeInfoList[3].dispKbn = '4';
            this.prizeInfoList[4].dispKbn = '9';
          } else if (type == '0') {
            this.showCouponInvitePage = true;
            this.showCouponPage = false;
            this.prizeDetailInfo = {
              captainPrizeInfoId: '', //----团长奖品id
              teamId: '', //---队伍ID
              captainPrizeName: '', //---团长奖品名称
              captainPrizeImg: '', //----团长奖品图片
              captainDenomination: '10', //---团长奖品面额
              captainCondition: '满3元可用', //----满减
              captainRobbedPercent: 40, //----已抢百分比
              dispKbn: '2', //----表示区分 1:立即抢券(未成团) 2:邀请好友（拼卷中） 3:已抢完 4：发奖失败 5来晚了 8:已拼成 9:去使用（已成团）
              memberPrizeInfoId: '', //-----团员奖品id
              memberPrizeName: '', //---团员奖品名称
              memberPrizeImg: '', //-----团员奖品图片
              memberDenomination: '20', //---团员品面额
              userImg: 'https://img10.360buyimg.com/imgzone/jfs/t20782/85/568972117/2758/78eafc28/5b0fd507Ne2b074cc.png', //---头像
              maxMembersCount: 5, //----邀请几人可成团
              captainMarkingId: '店铺老客', //----需要开团团长的身份
              memberMarkingId: '店铺新客', //----需要开团的身份
              needPeopleCnt: 3, //----需要人数
              isCaptain: '0' //----1团长 2团员 0没在团里
            };
            this.teamMemberList = [
              {
                userImg: '//img10.360buyimg.com/imgzone/jfs/t1/23298/11/20021/38692/6386f0ecE026e69ad/f0bd31280dce2d2a.png',
                nickName: 'j***a'
              },
              {
                userImg: '//img10.360buyimg.com/imgzone/jfs/t1/192914/13/31573/4024/6391470dE371db7a7/019e54628504b2dc.png'
              }
            ];
          }
        }
      } else {
        this.type = store.state.shareUserId ? '0' : '1'; // 1 主端 0 客端
        this.teamId = store.state.teamId;
        if (this.type == 0) {
          this.showCouponPage = false;
          this.showCouponInvitePage = true;
          this.setPrizeDetail();
        } else {
          newFissionCouponActivity(fission => {
            this.prizeInfoList = fission.data.newFissionPrizeInfoVOList;
          });
          this.showCouponPage = true;
          this.showCouponInvitePage = false;
        }
      }
      this.publicData.$emit('isDrawRolled', true, this.isTemplate);
    },
    //1立即拼券 2去使用 3 邀请 4 查看助力好友 5 查看更多优惠
    btnClick(flag, couponItemData) {
      console.log(couponItemData,'couponItemDatabtnClick');
      let actStatus = sessionStorage.getItem('actStatus');
      // console.log(couponItemData, 'couponItemData');
      if (this.isTemplate == true) {
        if (!this.isWebClick) {
          this.$toast('活动预览，仅供查看');
        }
        return;
      }
      if (actStatus == 2) {
        this.$toast('活动已结束');
        return;
      }
      if (actStatus == 1) {
        this.$toast('活动尚未开始');
        return;
      }

      switch (flag) {
        case 1:
          console.log('立即拼券');
          newFissionCouponGetCanJumpInLine(couponItemData.captainPrizeInfoId, couponItemData.memberPrizeInfoId, getCanJumpInLineData => {
            console.log(getCanJumpInLineData, '查看优惠券下可插入的队伍');
            if (getCanJumpInLineData.data.length == 0) {
              //没有可插队的团则直接发起开团
              this.fissionCouponFightData(couponItemData);
            } else {
              //又可插队的则显示插队弹框
              getCanJumpInLineData.pinCouponData = couponItemData;
              hdzxtCouponPopPopServiceNew.create(getCanJumpInLineData, this.isTemplate, this.styleDataOld, callBackData => {
                console.log(callBackData, 'callBackData');
                if (callBackData) {
                  let flag = callBackData.flag;
                  if (flag == 1) {
                    //发起开团 // 判断开团是否达到上线
                    this.fissionCouponFightData(callBackData.couponItemData);
                  } else if (flag == 2) {
                    //插队
                    this.getJoinTeamData(callBackData.couponItemData);
                  }
                } else {
                  hdzxtCouponPopPopServiceNew.close();
                }
              });
            }
          });
          // }
          break;
        case 2:
          let shopId = store.state.shopId;
          goUseCoupon();
          break;
        case 3:
          if (store.state.teamId) {
            couponItemData.teamId = store.state.teamId;
          }
          console.log(couponItemData, 'couponItemData1111');
          teamShare(this.isTemplate, couponItemData.teamId, this, callBackData => {
            // console.log(callBackData, 'callBackData');
          });
          break;
        case 4:
          newFissionCouponGetTeamMembers(couponItemData.captainPrizeInfoId, couponItemData.memberPrizeInfoId, couponItemData.teamId, data => {
            // this.teamMemberList = data.data.teamMemberList;
            hdzxtCouponFriendPopPopService.create(data.data, this.isTemplate, this.styleDataOld, () => {
              hdzxtCouponFriendPopPopService.close();
            });
          });

          break;
        case 5:
          this.goBackMainPage();
          break;
      }
    },
    //开团
    fissionCouponFightData(couponItemData) {
      //判断是否符合团长身份
      newFissionCouponCheckUser(couponItemData.captainPrizeInfoId, couponItemData.memberPrizeInfoId, '1', responseData => {
        if (responseData.resp_code == 0) {
          if (responseData.data.status == 3) {
            let data = {
              type: '1',
              eventType: 'intoShop',
              oneText: '进店逛逛',
              content: '您不符合活动要求，只有' + responseData.data.marketingId + '才能发起拼团哦~'
            };
            this.generalDialogCheck(data);
          } else {
            //没有可插队的团则直接发起拼团
            newFissionCouponFight(couponItemData.captainPrizeInfoId, couponItemData.memberPrizeInfoId, data => {
              // "status":""  1开团成功，2参加过别人的团，3不符合身份，5来晚了
              hdzxtCouponPopPopServiceNew.close();
              let status = data.data.status;
              if (status == 1) {
                //参团成功 0 组队成功
                data.data.btnText = '邀请好友';
                let needPeopleCnt = data.data.needPeopleCnt;
                console.log(data, 'couponItemDatadata');
                data.data.prizeDetailInfo = data.data;

                data.data.essmsg = '还差' + needPeopleCnt + '人即有机会获得优惠，赶紧邀请好友加速组队~';
                data.data.essmsgTitle = '成功开团！';

                this.styleDataOld.failPopBackground.backgroundImage = "url('//img10.360buyimg.com/imgzone/jfs/t1/181874/38/31382/48783/63917e21Ecd6b1618/b77e414a2c6b1c1a.png')";
                hdzxtFailPopService.create(data.data, this.isTemplate, this.styleDataOld, () => {
                  hdzxtFailPopService.close();
                });
                this.initData();
              } else if (status == 2) {
                data.data.essmsg = '该优惠您已经参加过啦，同一优惠活动期间只能参与一次';
                data.data.essmsgTitle = '拼券失败';
                data.data.btnText = '发现更多优惠';
                hdzxtFailPopService.create(data.data, this.isTemplate, this.styleDataOld, () => {
                  hdzxtFailPopService.close();
                });
                return;
              } else if (status == 3) {
                let data1 = {
                  type: '1',
                  eventType: 'intoShop',
                  oneText: '进店逛逛',
                  content: '您不符合活动要求，只有' + data.data.marketingId + '才能发起拼团哦~'
                };
                this.generalDialogCheck(data1);
              } else if (status == 5) {
                //拼券成功重新请求接口
                this.$toast('开团数量已达上限');
              }
              this.teamId = data.data.teamId;
            });
          }
        } else {
          this.$toast(responseData.resp_msg);
        }
      });
    },
    //去插队通用提示
    getJoinTeamData(couponItemData) {
      console.log(couponItemData, '去插队通用提示');

      newFissionCouponCheckUser(couponItemData.captainPrizeInfoId, couponItemData.memberPrizeInfoId, '2', responseData => {
        this.couponItemData = couponItemData;
        if (responseData.resp_code == 0) {
          if (responseData.data.status == 3) {
            let data = {
              type: '1',
              eventType: 'intoShop',
              oneText: '进店逛逛',
              content: '您不符合活动要求，只有' + responseData.data.marketingId + '才能发起拼团哦~'
            };
            this.generalDialogCheck(data);
          } else {
            let data = {
              type: '2',
              leftEventType: 'sureJumpTeam',
              rightEventType: 'backMainPage',
              twoLeftText: '确认插队',
              twoRightText: '不，我要成为团长',
              content: '拼团成功后您可得团员奖励，但无法再次开团并获得团长奖励，确定要插队吗？'
            };
            this.generalDialogCheck(data);
          }
        } else {
          this.$toast(responseData.resp_msg);
        }
      });
    },

    //被邀请者
    setPrizeDetail() {
      //被邀请人进入调用接口
      newFissionCouponShareActivity(shareData => {
        this.shareActivityStatus = shareData.data.status;
        var prizeInfoList0 = shareData.data.newFissionPrizeInfoVO;

        let teamMemberList = shareData.data.teamMemberList;

        for (var i = 0; i < teamMemberList.length; i++) {
          if (teamMemberList[i].captainKbn == 0) {
            prizeInfoList0.captainUserImg = teamMemberList[i].userImg;
          }
        }

        if (prizeInfoList0.maxMembersCount > shareData.data.teamMemberList.length - 1) {
          var obj = {
            userImg: '//img10.360buyimg.com/imgzone/jfs/t1/192914/13/31573/4024/6391470dE371db7a7/019e54628504b2dc.png'
          };
          for (var i = 0; i < shareData.data.teamMemberList.length; i++) {
            if (teamMemberList[i].captainKbn == 0) {
              shareData.data.teamMemberList.splice(i, 1);
            }
          }
          this.teamMemberList = shareData.data.teamMemberList.concat(obj);
        } else {
          for (var i = 0; i < shareData.data.teamMemberList.length; i++) {
            if (teamMemberList[i].captainKbn == 0) {
              shareData.data.teamMemberList.splice(i, 1);
            }
          }
          this.teamMemberList = shareData.data.teamMemberList;
        }

        this.prizeDetailInfo = prizeInfoList0;
        this.teamId = store.state.teamId;
        console.log(store.state.teamId, 'store.state.teamId');
        this.showCouponPage = false;
        this.showCouponInvitePage = true;
      });
    },

    // 被邀请者参与拼团（只有客端会调用）
    ktJoinTeam() {
      if (this.isWebClick) {
        return;
      }
      if (!this.isWebClick) {
        let actStatus = sessionStorage.getItem('actStatus');
        if (this.isTemplate == true) {
          if (!this.isWebClick) {
            this.$toast('活动预览，仅供查看');
          }
          return;
        }
        if (actStatus == 2) {
          this.$toast('活动已结束');
          return;
        }
        if (actStatus == 1) {
          this.$toast('活动尚未开始');
          return;
        }
      }
      //调用接口（TODO） 判断是否符合身份 符合身份判断是否已参与过没有参与过则提示
      newFissionCouponCheckUser(this.prizeDetailInfo.captainPrizeInfoId, this.prizeDetailInfo.memberPrizeInfoId, '2', responseData => {
        if (responseData.data.status == 3) {
          let data = {
            type: '1',
            eventType: 'intoShop',
            oneText: '进店逛逛',
            content: '您不符合活动要求，只有' + responseData.data.marketingId + '才能发起拼团哦~'
          };
          this.generalDialogCheck(data);
        } else {
          if (this.shareActivityStatus == 7) {
            let data = {
              type: '1',
              eventType: 'backMainPage',
              oneText: '去看更多好券',
              content: '抱歉，您已参加过此活动只能为一位好友助力哦~'
            };

            this.generalDialogCheck(data);
            return;
          } else {
            console.log('zxccccccczxczczxc');

            let data = {
              type: '2',
              leftEventType: 'sureJoinTeam',
              rightEventType: 'backMainPage',
              twoLeftText: '确认参与',
              twoRightText: '不，我要成为团长',
              content: '拼团成功后您可得团员奖励，但无法再次开团并获得团长奖励，确定要参与拼券吗？'
            };
            this.generalDialogCheck(data);
          }
        }
      });
    },
    //调用通用弹窗
    generalDialogCheck(data) {
      console.log(data, '调用通用弹窗');

      generalDialogService.create(data, this.styleData, submit => {
        console.log(submit, 'submit');
        let btnClickType = submit.btnClickType;
        // generalDialogService.close();
        if (btnClickType == '0') {
          //直接关闭弹框
          generalDialogService.close();
        } else if (btnClickType == 'backMainPage') {
          generalDialogService.close();
          this.goBackMainPage();
        } else if (btnClickType == 'sureJoinTeam') {
          generalDialogService.close();
          this.sureJoinTeam();
        } else if (btnClickType == 'intoShop') {
          generalDialogService.close();
          goToShopPage(store.state.shopId);
        } else if (btnClickType == 'sureJumpTeam') {
          generalDialogService.close();
          this.getJoinTeam();
        }
      });
    },
    //主端确认插队
    getJoinTeam() {
      let couponItemData = this.couponItemData;
      console.log(couponItemData, '主端确认插队');

      newFissionCouponJoinTeam(couponItemData.captainPrizeInfoId, couponItemData.memberPrizeInfoId, couponItemData.teamId, joinTeamData => {
        console.log(joinTeamData, '插队信息');
        hdzxtCouponPopPopServiceNew.close();
        // "status":-----0组队成功，1，发奖成功，2已参加过别人的券，3不符合要求，4券已被抢完 ,5队伍已满，6发奖失败
        if (joinTeamData.data.status == 0) {
          //参团成功 0 组队成功
          let needPeopleCnt = joinTeamData.data.needPeopleCnt;
          joinTeamData.data.btnText = '邀请好友';
          joinTeamData.data.essmsg = '还差' + needPeopleCnt + '人即有机会获得优惠，赶紧邀请好友加速组队~';
          joinTeamData.data.essmsgTitle = '插队成功！';
          joinTeamData.data.prizeDetailInfo = couponItemData;
          this.styleDataOld.failPopBackground.backgroundImage = "url('//img10.360buyimg.com/imgzone/jfs/t1/181874/38/31382/48783/63917e21Ecd6b1618/b77e414a2c6b1c1a.png')";

          hdzxtFailPopService.create(joinTeamData.data, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
        } else if (joinTeamData.data.status == 2) {
          // joinTeamData.essmsg = '您已经参与过拼券，无法再次参与';
          // joinTeamData.essmsgTitle = '插队失败';
          // joinTeamData.btnText = '发现更多优惠';
          // hdzxtFailPopService.create(joinTeamData, this.isTemplate, this.styleDataOld, () => {
          //   hdzxtFailPopService.close();
          // });
          this.$toast('数量已达上限，无法插队');
        } else if (joinTeamData.data.status == 3) {
          let data = {
            type: '1',
            eventType: 'intoShop',
            oneText: '进店逛逛',
            content: '您不符合活动要求，只有' + joinTeamData.data.marketingId + '才能发起拼团哦~'
          };
          this.generalDialogCheck(data);
        } else if (joinTeamData.data.status == 4) {
          joinTeamData.essmsg = '优惠券已经抢完';
          joinTeamData.essmsgTitle = '插队失败';
          joinTeamData.btnText = '发现更多优惠';
          hdzxtFailPopService.create(joinTeamData, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
        } else if (joinTeamData.data.status == 5) {
          joinTeamData.essmsg = '该队伍已经完成拼团，请选择其他团';
          joinTeamData.essmsgTitle = '插队失败';
          joinTeamData.btnText = '发现更多优惠';
          hdzxtFailPopService.create(joinTeamData, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
        } else if (joinTeamData.data.status == 1) {
          let prizeDetailInfo = joinTeamData.data.newFissionPrizeGrantVo;
          hdzxtSuccessPopService.create(prizeDetailInfo, this.isTemplate, this.styleDataOld, () => {
            hdzxtSuccessPopService.close();
          });
        } else if (joinTeamData.data.status == 6) {
          joinTeamData.essmsg = '发奖失败';
          joinTeamData.essmsgTitle = '发奖失败';
          joinTeamData.btnText = '发现更多优惠';
          hdzxtFailPopService.create(joinTeamData, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
        }
        this.initData();
      });
    },
    // 客端确认参与拼团
    sureJoinTeam() {
      var obj = document.getElementById('index');
      // return;
      document.getElementById('invite-btn').disabled = true;
      console.log(store.state.teamId, 'teamId111');

      newFissionCouponJoinCoupon(fission => {
        let newFissionPrizeInfoVO = fission.data.newFissionPrizeGrantVo;
        // 0:拼券成功，1:发奖成功，2已参加过别人的券，3不符合要求，4券已被抢完 , 5来晚了 ,6发奖失败
        if (fission.data.status == 1) {
          //参团成功 0 组队成功
          let prizeDetailInfo = newFissionPrizeInfoVO;
          hdzxtSuccessPopService.create(prizeDetailInfo, this.isTemplate, this.styleDataOld, () => {
            hdzxtSuccessPopService.close();
          });
        } else if (fission.data.status == 0) {
          let needPeopleCnt = fission.data.needPeopleCnt;
          fission.data.btnText = '邀请好友';
          fission.data.essmsg = '还差' + needPeopleCnt + '人即有机会获得优惠，赶紧邀请好友 加速组队~';
          fission.data.essmsgTitle = '成功加入拼券！';
          this.prizeDetailInfo.teamId = store.state.teamId;
          fission.data.prizeDetailInfo = this.prizeDetailInfo;
          this.styleDataOld.failPopBackground.backgroundImage = "url('//img10.360buyimg.com/imgzone/jfs/t1/181874/38/31382/48783/63917e21Ecd6b1618/b77e414a2c6b1c1a.png')";
          hdzxtFailPopService.create(fission.data, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
        } else if (fission.data.status == 5) {
          // this.$toast('该队伍已经满员啦，赶紧看看其他优惠吧');
          fission.data.essmsg = '该队伍已经满员啦，赶紧看看其他优惠吧';
          fission.data.essmsgTitle = '拼券失败';
          fission.data.btnText = '发现更多优惠';
          fission.data.prizeDetailInfo = this.prizeDetailInfo;
          hdzxtFailPopService.create(fission.data, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
          return;
        } else if (fission.data.status == 2) {
          // this.$toast('该优惠您已经发起或参与过拼券啦');
          fission.data.essmsg = '您已参加过别人的团'; //'该优惠您已经发起或参与过拼券啦';
          fission.data.essmsgTitle = '拼券失败';
          fission.data.btnText = '发现更多优惠';
          fission.data.prizeDetailInfo = this.prizeDetailInfo;
          hdzxtFailPopService.create(fission.data, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
          return;
        } else if (fission.data.status == 4) {
          // this.$toast('优惠券已经抢完');
          fission.data.essmsg = '优惠券已经抢完';
          fission.data.essmsgTitle = '拼券失败';
          fission.data.btnText = '发现更多优惠';
          fission.data.prizeDetailInfo = this.prizeDetailInfo;
          hdzxtFailPopService.create(fission.data, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
          return;
        } else if (fission.data.status == 6) {
          // this.$toast('优惠券已经抢完');
          fission.data.essmsg = '奖品发放失败';
          fission.data.essmsgTitle = '发奖失败';
          fission.data.btnText = '发现更多优惠';
          fission.data.prizeDetailInfo = this.prizeDetailInfo;
          hdzxtFailPopService.create(fission.data, this.isTemplate, this.styleDataOld, () => {
            hdzxtFailPopService.close();
          });
          return;
        } else if (fission.data.status == 3) {
          // this.$toast('优惠券已经抢完');
          let data1 = {
            type: '1',
            eventType: 'intoShop',
            oneText: '进店逛逛',
            content: '您不符合活动要求，只有' + data.data.marketingId + '才能发起拼团哦~'
          };
          this.generalDialogCheck(data1);
        } else if (fission.data.status == 8) {
          this.$toast('您已是团长');
        }
        this.showCouponPage = false;
        this.showCouponInvitePage = true;

        this.setPrizeDetail(); //初始化客端主接口
      });
    },

    //返回主页
    goBackMainPage() {
      let queryData = {
        activityType: sessionStorage.getItem('activityType'),
        templateId: sessionStorage.getItem('templateId'),
        activityId: sessionStorage.getItem('activityId'),
        nodeId: sessionStorage.getItem('nodeId'),
        teamId: sessionStorage.getItem('teamId'),
        giftType: sessionStorage.getItem('giftType'),
        isGiftTrue: sessionStorage.getItem('isGiftTrue'),
        prd: sessionStorage.getItem('prd')
      };
      for (let i in queryData) {
        if (!queryData[i] || queryData[i] == 'null') {
          delete queryData[i];
        }
      }
      var aa = '';
      var lastkey = '';
      for (let i in queryData) {
        lastkey = i;
      }
      for (let i in queryData) {
        if (lastkey == i) {
          aa = aa + `${i}=${queryData[i]}`;
        } else {
          aa = aa + `${i}=${queryData[i]}&`;
        }
      }
      // console.log( 'https://' + location.host + '/interact/index?'+ aa,'aa111111111111');
      // alert('https://' + location.host + '/interact/index?'+ aa)
      // location.replace('https://' + location.host + '/interact/index?' + aa);
      location.replace(process.env.ACTIVITYDOMAIN + 'index?' + aa);
    }
  },
  filters: {
    //时间转换
    dateTime(val) {
      if (val) {
        return dateUtil.formatTime(val, 'yyyy-MM-dd hh:mm');
      }
      return val;
    },
    twostar: function(value) {
      if (!value) {
        return '';
      }
      return value.substr(0, 1) + '**' + value.substr(-1, 1);
    }
  }
};
</script>

<style lang="scss">
.fissionCouponListNewAll {
  .van-notice-bar {
    background: transparent;
    background-color: transparent;
  }
  .van-notice-bar__content {
    display: flex !important;
  }
  .couponAllList {
    .tuanzhangDivAll {
      width: 100%;
      display: flex;
      justify-content: space-between;
      // align-items: center;
      .couponDetailDivAll {
        margin-left: 0.3rem;
        display: flex;
        flex-direction: column;
        text-align: initial;
        margin-top: 0.24rem;
        .prizeNameDiv {
          font-size: 0.3rem;
          color: #262626;
          font-weight: bold;
          line-height: 0.3rem;
        }
        .conditionDiv {
          font-size: 0.24rem;
          color: #262626;
          line-height: 0.24rem;
          margin-top: 0.08rem;
          margin-bottom: 0.18rem;
        }
        .teamCntDiv {
          font-size: 0.24rem;
          color: #f2270c;
          line-height: 0.24rem;
          font-weight: bold;
        }
        .progressDivAll {
          display: flex;
          align-items: center;
          margin-top: 0.12rem;
          .progressContainer {
            width: 1.2rem;
            height: 0.28rem;
            // border: 2px solid #f10400;
            border-radius: 20px;
            font-size: 0.17rem;
            color: #ffc15a;

            overflow: hidden;
            position: relative;
            line-height: 0.28rem;
            box-sizing: border-box;
            .van-progress {
              width: 100%;
              height: 100%;
              float: right;
              .pinPercentDiv {
                position: absolute;
                left: 0.1rem;
                top: 0;
                width: 100%;
                color: #ffffff;
              }

            }
          }
          .dispKbnDiv {
            color: #8c8c8c;
            font-size: 0.2rem;
            line-height: 0.2rem;
            margin-left: 0.14rem;
          }
        }
      }
      .rightDivAll {
        margin-right: 0.62rem;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        .friendDivAll {
          font-size: 0.24rem;
          line-height: 0.24rem;
          color: #3399ff;
        }
        .tzsfDiv {
          font-size: 0.2rem;
          font-weight: 400;
          color: #f2270c;
        }
      }
      .couponBtnDivAll {
        margin: 0.18rem 0 0.14rem 0;
        .couponBtn1 {
          padding: 0.2rem 0rem;
          color: #ffffff;
          background: linear-gradient(to right, #f2270c, #fe621f);
          border-radius: 0.34rem;
          font-size: 0.24rem;
          line-height: 0.24rem;
          width: 1.5rem;
        }
        .couponBtn2 {
          padding: 0.2rem 0rem;
          color: #ffffff;
          background: linear-gradient(to right, #ff9900, #ff9900);
          border-radius: 0.34rem;
          font-size: 0.24rem;
          line-height: 0.24rem;
          width: 1.5rem;
        }
        .couponBtn3 {
          padding: 0.2rem 0rem;
          color: #ffffff;
          background: linear-gradient(to right, #bfbfbf, #bfbfbf);
          border-radius: 0.34rem;
          font-size: 0.24rem;
          line-height: 0.24rem;
          width: 1.5rem;
        }
      }
      .couponStatusDivAll {
        display: flex;
        align-items: center;
        .loginShenFenDiv {
          width: 0.4rem;
          height: 0.4rem;
          margin-right: 0.1rem;
          .loginShenFenImage {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 0.01rem solid #ffffff;
          }
        }
        .couponStaus1 {
          font-size: 0.24rem;
          line-height: 0.24rem;
          color: #c;
        }
        .couponStaus2 {
          font-size: 0.24rem;
          line-height: 0.24rem;
          color: #00bb66;
        }
        .couponStaus3 {
          font-size: 0.24rem;
          line-height: 0.24rem;
          color: #ff9900;
        }
        .couponStaus4 {
          font-size: 0.24rem;
          line-height: 0.24rem;
          color: #bfbfbf;
        }
      }
      .leftDivAll {
        display: flex;
        flex-direction: row;
        position: relative;
        padding-left: 0.3rem;
        .couponPriceDivAll {
          font-size: 0.3rem;
          color: #f2270c;
          width: 1.5rem;
          font-weight: bold;
          .couponPriceSpan {
            font-size: 0.5rem;
            line-height: 0.5rem;
            font-family: PingFang SC;
            font-weight: bold;
            color: #f2270c;
          }
        }
      }
    }

    .tuanyuanDivAll {
      display: flex;
      justify-content: space-between;
      .leftDivAll1 {
        display: flex;
        flex-direction: row;
        position: relative;
        padding: 0.17rem 0 0.15rem 0.3rem;
        .left-leftDiv {
          display: flex;
          flex-direction: column;
          align-items: center;
        }
        .couponDetailDivAll1 {
          margin-left: 0.3rem;
          display: flex;
          flex-direction: column;
          text-align: initial;
          // margin-top: 0.24rem;
          .prizeNameDiv {
            font-size: 0.3rem;
            color: #262626;
            font-weight: bold;
            line-height: 0.3rem;
          }
          .conditionDiv {
            font-size: 0.24rem;
            color: #262626;
            line-height: 0.24rem;
            margin-top: 0.08rem;
            margin-bottom: 0.18rem;
          }
        }

        .couponPriceDivAll1 {
          font-size: 0.2rem;
          color: #f2270c;
          width: 1.5rem;
          font-weight: bold;
          .couponPriceSpan1 {
            font-size: 0.36rem;
            line-height: 0.36rem;
            font-family: PingFang SC;
            font-weight: bold;
            color: #f2270c;
          }
        }
        .tuenImageDiv {
          width: 1rem;
          height: 0.27rem;
          img {
            width: 1rem;
            height: 0.27rem;
          }
        }
      }
      .rightDivAll1 {
        margin-right: 0.62rem;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: 0.2rem;
        font-weight: 400;
        color: #f2270c;
        display: flex;
        min-width: 1.5rem;
        .loginShenFenDiv {
          width: 0.4rem;
          height: 0.4rem;
          margin-right: 0.1rem;
          .loginShenFenImage {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 0.01rem solid #ffffff;
          }
        }

        .tysfDiv {
          font-size: 0.2rem;
          font-weight: 400;
          color: #f2270c;
          width: 100%;
        }
        .tycouponStaus2 {
          font-size: 0.24rem;
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: #00bb66;
        }
        .tycouponStaus3 {
          font-size: 0.24rem;
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: #ff9900;
        }
        .tycouponStaus4 {
          font-size: 0.24rem;
          font-family: Source Han Sans CN;
          font-weight: 400;
          color: #bfbfbf;
        }
      }
    }
  }

  .listTitleDivAll {
    display: flex;
    justify-content: center;
    .listTitleImgAll {
      width: 2.03rem;
      height: 0.34rem;
      margin: 0.2rem 0 0.28rem 0;
    }
  }

  .couponInvite {
    display: flex;
    flex-direction: column;
    .topDivAll {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      width: 100%;
      height: 1.8rem;
      margin-top: 0.25rem;
      .leftDivAll {
        display: flex;
        flex-direction: row;
        position: relative;
        padding-left: 0.3rem;
        .couponPriceDivAll {
          font-size: 0.3rem;
          color: #f2270c;
          width: 1.5rem;
          font-weight: bold;
          margin-top: 0.77rem;
          .couponPriceSpan {
            font-size: 0.5rem;
            line-height: 0.5rem;
            font-family: PingFang SC;
            font-weight: bold;
            color: #f2270c;
          }
        }
      }

      .couponDetailDivAll {
        margin-left: 0.3rem;
        display: flex;
        flex-direction: column;
        text-align: initial;
        margin-top: 0.24rem;
        .prizeNameDiv {
          font-size: 0.3rem;
          color: #262626;
          font-weight: bold;
          line-height: 0.3rem;
        }
        .conditionDiv {
          font-size: 0.24rem;
          color: #262626;
          line-height: 0.24rem;
          margin-top: 0.08rem;
          margin-bottom: 0.18rem;
        }
        .teamCntDiv {
          font-size: 0.24rem;
          color: #f2270c;
          line-height: 0.24rem;
          font-weight: bold;
        }
        .progressDivAll {
          display: flex;
          align-items: center;
          margin-top: 0.12rem;
          .progressContainer {
            width: 1.2rem;
            height: 0.28rem;
            // border: 2px solid #f10400;
            border-radius: 20px;
            font-size: 0.17rem;
            color: #ffc15a;

            overflow: hidden;
            position: relative;
            line-height: 0.28rem;
            box-sizing: border-box;
            .van-progress {
              width: 100%;
              height: 100%;
              .pinPercentDiv {
                position: absolute;
                left: 0.1rem;
                top: 0;
                width: 100%;
                color: #ffffff;
              }

            }
          }
          .dispKbnDiv {
            color: #8c8c8c;
            font-size: 0.2rem;
            line-height: 0.2rem;
            margin-left: 0.14rem;
          }
        }
      }
      .topRight {
        display: flex;
        align-items: center;
        padding-right: 0.25rem;
        .rightDiv1 {
          height: 2.02rem;
          display: flex;
          justify-content: center;
          align-items: center;
          color: #ff9900;
          font-size: 0.24rem;
          line-height: 0.24rem;
          margin-right: 0.26rem;
        }
        .rightDiv2 {
          height: 2.02rem;
          display: flex;
          justify-content: center;
          align-items: center;
          color: #c4c4c4;
          font-size: 0.24rem;
          line-height: 0.24rem;
          margin-right: 0.26rem;
        }
        .rightDiv3 {
          height: 2.02rem;
          display: flex;
          justify-content: center;
          align-items: center;
          color: #00bb66;
          font-size: 0.24rem;
          line-height: 0.24rem;
          margin-right: 0.26rem;
        }
        .loginShenFenDiv {
          width: 0.4rem;
          height: 0.4rem;
          margin-right: 0.1rem;
          .loginShenFenImage {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 0.01rem solid #ffffff;
          }
        }
      }
    }
    .kdBottomDivAll {
      margin-top: 0.18rem;
      .kdTopDivAll {
        display: flex;
        justify-content: space-between;
        .leftDivAll1 {
          display: flex;
          flex-direction: row;
          position: relative;
          padding: 0.17rem 0 0.15rem 0.3rem;
          .left-leftDiv {
            display: flex;
            flex-direction: column;
            align-items: center;
          }
          .couponDetailDivAll1 {
            margin-left: 0.3rem;
            display: flex;
            flex-direction: column;
            text-align: initial;
            // margin-top: 0.24rem;
            .prizeNameDiv {
              font-size: 0.3rem;
              color: #262626;
              font-weight: bold;
              line-height: 0.3rem;
            }
            .conditionDiv {
              font-size: 0.24rem;
              color: #262626;
              line-height: 0.24rem;
              margin-top: 0.08rem;
              margin-bottom: 0.18rem;
            }
          }

          .couponPriceDivAll1 {
            font-size: 0.2rem;
            color: #f2270c;
            width: 1.5rem;
            font-weight: bold;
            .couponPriceSpan1 {
              font-size: 0.36rem;
              line-height: 0.36rem;
              font-family: PingFang SC;
              font-weight: bold;
              color: #f2270c;
            }
          }
          .tuenImageDiv {
            width: 1rem;
            height: 0.27rem;
            img {
              width: 1rem;
              height: 0.27rem;
            }
          }
        }
        .rightDivAll1 {
          margin-right: 0.62rem;
          display: flex;
          justify-content: center;
          align-items: center;
          font-size: 0.2rem;
          font-weight: 400;
          color: #f2270c;
          display: flex;
          justify-content: space-between;
          .tysfDiv {
            font-size: 0.2rem;
            font-weight: 400;
            color: #f2270c;
          }
          .kttycouponStaus2 {
            font-size: 0.24rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: #00bb66;
          }
          .kttycouponStaus3 {
            font-size: 0.24rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: #ff9900;
          }
          .kttycouponStaus4 {
            font-size: 0.24rem;
            font-family: Source Han Sans CN;
            font-weight: 400;
            color: #bfbfbf;
          }
        }
      }
      .promptDiv1 {
        font-size: 0.24rem;
        left: 0.24rem;
        color: #262626;
      }
      .promptDiv4 {
        font-size: 0.24rem;
        font-weight: 400;
        color: #f2270c;
      }
    }
    .btnDivAll {
      display: flex;
      padding: 0 0.95rem;
      .bottomBtnDiv {
        width: 6rem;
        color: #ffffff;
        font-size: 0.3rem;
        line-height: 0.3rem;
        background: linear-gradient(to right, #f2270d, #fe631f);
        padding: 0.28rem 0;
        text-align: center;
        border-radius: 0.45rem;
        margin-top: 0.26rem;
        margin-right: 0.1rem;
      }
      .bottomBtnDivRight {
        width: 6rem;
        color: #ffffff;
        font-size: 0.3rem;
        line-height: 0.3rem;
        background: linear-gradient(to right, #ff9900, #ff9900);
        padding: 0.28rem 0;
        text-align: center;
        border-radius: 0.45rem;
        margin-top: 0.26rem;
        // border: 2px solid #f2270d;
        margin-left: 0.1rem;
      }
      .bottomBtnDivRight1 {
        // width: 6rem;
        width: 100%;
        color: #ffffff;
        font-size: 0.3rem;
        line-height: 0.3rem;
        background: linear-gradient(to right, #ff9900, #ff9900);
        padding: 0.28rem 0.45rem;
        text-align: center;
        border-radius: 0.45rem;
        margin-top: 0.26rem;
      }
      .bottomBtnDivGray {
        width: 6rem;
        color: #ffffff;
        font-size: 0.3rem;
        line-height: 0.3rem;
        background: linear-gradient(to right, #bfbfbf, #bfbfbf);
        padding: 0.28rem 0;
        text-align: center;
        border-radius: 0.45rem;
        margin-top: 0.26rem;
      }
    }
    .friendListDivAll {
      display: flex;
      flex-direction: row;
      margin-top: 0.43rem;
      overflow-x: scroll;
      padding: 0 0.1rem;
      margin-left: 0.79rem;
      margin-right: 0.79rem;
      .friendItemDivAll {
        width: 1rem;
        // height: 1rem;
        margin-right: 0.26rem;
        .friendDetailDivAll {
          display: flex;
          flex-direction: column;
          width: 1rem;

          .userImgDiv {
            .userImg {
              width: 1rem;
              height: 1rem;
              border-radius: 50%;
              border: 0.01rem solid #ffffff;
            }
          }
          .nickNameDiv {
            font-size: 0.18rem;
            left: 0.18rem;
            color: #262626;
          }
        }
      }
    }
    .friendListDivAll1 {
      overflow-x: hidden;
    }
  }
}
</style>
