import Vue from "vue";
import $ajax from "./request";
import store from "../store/store";
import { initBuriedPoint } from "./tools.js";
import { XViewClose } from './shopGiftBag.js';
// const JDSDK = JSSDK;
import { Notify, Toast } from "vant";

Vue.use(Toast, Notify);

console.log(process);
console.log("***ENV_CONFIG***", process.env.ENV_CONFIG);
console.log("***NODE_ENV***", process.env.NODE_ENV);
console.log("***API_HOST1111***", process.env.API_HOST);
// console.log('***env_build***', process.argv.progress)
console.log(store.state.clientType, '运行环境')
const BASE_URL = process.env.API_HOST //'https://lzdz3-isv.isvjcloud.com/api';
console.log('BASE_URL', BASE_URL)
let tokens = '0D4323E780EF7271121C4CF002E1BD9F536CA4AEF733BB4C88701E46386E9BD2B83F28FC0FCEF83361F49105C838CD66'
export default {
  async initPage1(callback) {
    callback && callback("success");
  },
  async getTemplate(callback) {
    var url =
      BASE_URL +
      "/basic/template/" +
      sessionStorage.getItem("templateId") +
      "?" +
      "activityId=" +
      sessionStorage.getItem("activityId") +
      "&shopId=" +
      sessionStorage.getItem("shopId");
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },

  async priviewDate(callback) {
    var url = BASE_URL + "/active/getPreview/" + store.state.priviewId;
    let { data } = await $ajax.get(url);
    callback && callback(data.data);
  },

  //客态变主态
  async changeState(callback) {
    let { data } = await $ajax.post(BASE_URL + "/join/check", {
      status: store.state.shareUserId ? "0" : "1" // 1 主端 0 客端
    });
    console.log(data);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 身份验证，所有接口调用前使用
  async getToken(params, callback) {
    console.log(store.state.shareUserId, "shareUserId");
    let actTypes = sessionStorage.getItem("activityType");
    let envInfos = '';
    let jsVersions = '';
    try {
      var env = window.getJdEnvInfo();
      envInfos = env.data;
      jsVersions = env.version
    } catch (e) { }
    let {
      data
      // BASE_URL + "/user-info/login"https://lzkj-isv.jdfw1.com/api/user-info/login
    } = await $ajax.post(BASE_URL + "/user-info/login", {
      //保存token 之后调用主接口
      status: store.state.shareUserId ? "0" : "1", // 1 主端 0 客端
      activityId: store.state.activityId,
      // 下方的initPinToken接口也需要替换
      tokenPin: process.env.ENV_CONFIG == "dev" ? tokens : sessionStorage.getItem("lz_wq_auth_token"),
      source: store.state.clientType == "01" ? "01" : "02", //'02', //store.state.clientType,
      shareUserId: store.state.shareUserId,
      uuid: params.uuid,
      clientArr: params.clientArr,
      client: params.client,
      clientVersion: params.clientVersion,
      osVersion: params.osVersion,
      model: params.model,
      userAgent: params.userAgent,
      envInfo: envInfos ? envInfos : '',
      jsVersion: jsVersions ? jsVersions : ''
    });
    if (data.resp_code == 0) {
      store.commit("setToken", data.data.token);
      store.commit("setUserPin", data.data.userPin);
      store.commit("setShopId", data.data.shopId);
      store.commit("setCustomerId", data.data.customerId);
      store.commit("setNickName", data.data.nickName);
      store.commit("setShareUserPin", data.data.shareUserPin);
      store.commit("setJdActivityId", data.data.jdActivityId);
      store.commit("setActName", data.data.actName);
      store.commit("setUserImg", data.data.userImg);
      sessionStorage.setItem("shopId", data.data.shopId);
      sessionStorage.setItem("jdActType", data.data.jdActType);
      sessionStorage.setItem("joinInfo", JSON.stringify(data.data));
      localStorage.setItem("token", data.data.token);
      window.sessionStorage.setItem("prd", data.data.joinInfo.joinCodeInfo.prd);
      document.title = data.data.actName ? data.data.actName : "京东";
      if (data.data.joinInfo.joinCodeInfo.joinCode == "1001") {
        callback && callback("success");
      } else if (data.data.joinInfo.joinCodeInfo.joinCode == "1002") {
        callback && callback(data.data);
      } else if (data.data.joinInfo.joinCodeInfo.joinCode == "1003") {
        callback && callback(data.data);
      } else if (data.data.joinInfo.joinCodeInfo.joinCode == "1004") {
        callback && callback(data.data);
      } else if (data.data.joinInfo.joinCodeInfo.joinCode == "1005") {
        callback && callback(data.data);
      } else if (data.data.joinInfo.joinCodeInfo.joinCode == "1006") {
        callback && callback(data.data);
      } else if (data.data.joinInfo.joinCodeInfo.joinCode == "1007") {
        callback && callback(data.data);
      }
      initBuriedPoint(data.data);
      $ajax.post(BASE_URL + "/front/doFrontBuryPoint", {
        prd: "cjwx",
        te: "c",
        sid: sessionStorage.getItem("shopId"),
        uid: store.state.userPin,
        t: new Date().getTime(),
        at: sessionStorage.getItem("activityType"),
        opid: store.state.activityId,
        ver: "1",
        c: `{code:'sy-fwhd',value:'${store.state.activityId}'}`,
        e: "pv",
        l: "1",
        url: location.href,
        ch: ""
      });
    } else if (data.resp_code == 70000) {
      if (actTypes == '10058') {
        XViewClose()
      }
      location.replace(process.env.ACTIVITY_HOST + "/errorPage?ajcode=70000");
    } else if (data.resp_code == 70003) {
      location.replace(process.env.ACTIVITY_HOST + "/errorPage");
    } else {
      if (actTypes == '10058') {
        XViewClose()
      }
      Toast(data.resp_msg);
    }
  },
  //让福袋飞数据
  async getFudai(callback) {
    let { data } = await $ajax.post(BASE_URL + "/fudai/getFudai", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //让福袋飞领奖
  async getFudaiPrize(callback) {
    let { data } = await $ajax.post(BASE_URL + "/fudai/grant", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //关注店铺
  async focusShop(callback) {
    let { data } = await $ajax.post(BASE_URL + "/fudai/getFudaiRule", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //帮助打开福袋
  async helpOpenBag(callback) {
    let { data } = await $ajax.post(BASE_URL + "/fudai/help", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 获取页面初始化数据
  async initPage(callback) {
    sessionStorage.removeItem("shopCps")
    let { data } = await $ajax.post(BASE_URL + "/active/basicInfo", {
      activityId: store.state.activityId
    });
    if (data.resp_code == 0) {
      if (data.data.needAddress == "0" || data.data.needAddress == "1") {
        sessionStorage.setItem("needAddress", data.data.needAddress);
      } else {
        sessionStorage.setItem("needAddress", 1);
      }
      store.commit("setShareTitle", data.data.shareTitle);
      store.commit("setShareImage", data.data.shareImage);
      if (data.data.cpsUrl) {
        sessionStorage.setItem("shopCps", data.data.cpsUrl)
      }
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //c端迁移超级无线签到主接口
  async getSign(callback) {
    // maxNumber 做多完成签到次数
    let { data } = await $ajax.post(BASE_URL + "/sign/prize/getSign", {});
    console.log(data, "============999999");
    if (data.resp_code == 0) {
      console.log(data, "============999999");
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 抽奖中心
  async lotteryCenter(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/lotteryCenter/activity", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //分享有礼接口
  async setSharePrize(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/sharePolitely/activity", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //c端迁移超级无线签到点击签到接口
  async getSignClick(callback) {
    // maxNumber 做多完成签到次数
    let { data } = await $ajax.post(BASE_URL + "/sign/prize/getSignClick", {});
    console.log(data, "============999999");
    if (data.resp_code == 0) {
      console.log(data, "============999999");
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //签到主接口
  async signMainRequest(callback) {
    // maxNumber 做多完成签到次数
    let { data } = await $ajax.post(BASE_URL + "/task/sign/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //每日签到主接口
  async daySignMainRequest(callback) {
    // maxNumber 做多完成签到次数
    let { data } = await $ajax.post(BASE_URL + "/task/daySign/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //每日签到签到接口
  async getDaySignClick(callback) {
    // maxNumber 做多完成签到次数
    let { data } = await $ajax.post(
      BASE_URL + "/task/daySign/getSignClick",
      {}
    );
    console.log(data, "============999999");
    if (data.resp_code == 0) {
      console.log(data, "============999999");
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //评论主接口
  async evaluationMainRequest(callback) {
    // 抽奖次数
    let { data } = await $ajax.post(BASE_URL + "/task/evaluation/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //订单新评论主接口
  async evaluationOrderMainRequest(callback) {
    // 抽奖次数
    let { data } = await $ajax.post(
      BASE_URL + "/task/newEvaluation/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //九宫格接口
  async jiugonggeRequest(callback) {
    // 抽奖次数
    let { data } = await $ajax.post(BASE_URL + "/task/jiugongge/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      // Toast(data.resp_msg);
    }
  },

  // 抽奖中心
  async lotteryCenter(callback) {
    console.log("抽奖中心");
    // 抽奖次数
    let { data } = await $ajax.post(BASE_URL + "/task/lotteryCenter/activity", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //投票有礼
  async votePolitely(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/votePolitely/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //完成投票后显示接口
  async voteSavePkResult(selectVote, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/votePolitely/savePkResult",
      {
        selectVote: selectVote
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //扭蛋机接口
  async niudanjiRequest(callback) {
    // 抽奖次数
    let { data } = await $ajax.post(BASE_URL + "/task/niudanji/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 拼手速做任务
  async pinshousuTaskRequest(taskId, skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/dmpss/toDo", {
      taskId: taskId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 拼手速抽奖
  async drawRequest(canDrawFlag, differenceTime, challengeTime, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/dmpss/draw", {
      canDrawFlag: canDrawFlag,
      differenceTime: differenceTime,
      challengeTime: challengeTime
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 拼手速初始化
  async pinshousuRequest(shareUserId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/dmpss/activity", {
      shareUserId: shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 拼手速开始游戏
  async pinshousuStart(roomId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/dmpss/startGame", {
      roomId: roomId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 1000) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 拼手速开始游戏
  async pinshousuEnd(result, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/dmpss/draw", {
      result: result
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // // 拼手速店铺信息
  // async readSecondsShopInfo(callback) {
  //   let {
  //     data
  //   } = await $ajax.post(BASE_URL + '/task/dmpss/shopInfo', {});
  //   if (data.resp_code == 0) {
  //     callback && callback(data);
  //   } else {
  //     Toast(data.resp_msg);
  //   }
  // },

  // //拼手速关注店铺
  // async pinshousuFollowShop(callback) {
  //   let {
  //     data
  //   } = await $ajax.post(BASE_URL + '/task/dmpss/followShop', {});
  //   if (data.resp_code == 0) {
  //     callback && callback(data);
  //   } else {
  //     Toast(data.resp_msg);
  //   }
  // },

  // // 拼手速加入会员
  // async readSecondsFollow(callback) {
  //   let {
  //     data
  //   } = await $ajax.post(BASE_URL + '/task/dmpss/member', {});
  //   if (data.resp_code == 0) {
  //     callback && callback(data);
  //   } else {
  //     Toast(data.resp_msg);
  //   }
  // },
  //评论规则
  async selRuleRequest(callback) {
    // 活动规则
    let { data } = await $ajax.post(BASE_URL + "/task/evaluation/selRule", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //订单新评论规则
  async selOrderRuleRequest(callback) {
    // 活动规则
    let { data } = await $ajax.post(
      BASE_URL + "/task/newEvaluation/selRule",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //点击签到
  async signDayRequest(callback) {
    // console.log("1223334")
    let { data } = await $ajax.post(BASE_URL + "/task/sign/add", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg); startDraw
    }
  },
  // 获取奖品信息
  async drawPrize(callback) {
    let { data } = await $ajax.post(BASE_URL + "/prize/drawPrize", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //抽奖
  async startDraw(callback) {
    let { data } = await $ajax.post(BASE_URL + "/prize/draw", {
      consumePoints: 0
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50009) {
      callback && callback(data);
    } else {
      callback && callback(data);
      Toast(data.resp_msg);
    }
  },
  //积分抽奖
  async startDraw1(points, callback) {
    let { data } = await $ajax.post(BASE_URL + "/prize/draw", {
      consumePoints: points
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50009 || data.resp_code == 73002 || data.resp_code == 73001) {
      callback && callback(data);
    } else {
      callback && callback(data);
      Toast(data.resp_msg);
    }
  },

  //获取签到规则
  async getRule(callback) {
    let { data } = await $ajax.post(BASE_URL + "/active/getRule", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //中奖名单
  async getWinnerData(callback) {
    let { data } = await $ajax.post(BASE_URL + "/my/prize/listGrant", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //获取入会有礼排行榜
  async getInviteRanking(callback) {
    let { data } = await $ajax.get(BASE_URL + "/task/rank/getRankInfo", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //知识超人主接口
  async getKnowData(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/know/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //知识超人开始答题接口
  async startAnswer(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/know/startAnswer", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //知识超人答题接口
  async knowAnswer(recordId, questionId, answersId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/know/answer", {
      recordId: recordId,
      questionId: questionId,
      answersId: answersId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async myprize(callback) {
    // console.log("myprize")
    let { data } = await $ajax.post(BASE_URL + "/my/prize/list", {
      current: 1,
      size: 10000
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async reviseaddress(values, callback) {
    // console.log("reviseaddress", values)
    let { data } = await $ajax.post(BASE_URL + "/my/prize/update", values);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  async orderUpdateAddress(values, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/orderGift/updateAddress",
      values
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async showaddress(prizeGrantId, callback) {
    // console.log("showaddress")
    let { data } = await $ajax.post(BASE_URL + "/my/prize/getGrant", {
      prizeGrantId: prizeGrantId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async orderGetAddress(prizeInfoId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/orderGift/getAddress",
      {
        prizeInfoId: prizeInfoId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //奖品列表
  async getPrizeList(callback) {
    // console.log("getPrizeList")
    let { data } = await $ajax.post(BASE_URL + "/task/sign/prizeList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async inviteFollowShop(callback) {
    // console.log("getPrizeList")
    let { data } = await $ajax.post(
      BASE_URL + "/task/inviteFollowShop/prizeList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //会员领取列表
  async invitationList(callback) {
    // console.log("invitationList")
    let { data } = await $ajax.post(BASE_URL + "/task/member/prizeList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //每日抢好礼
  async dailyGiftRequest(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/dailyGrabs/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 开始抢好礼
  async grabNow(callback) {
    // 抽奖次数
    let { data } = await $ajax.post(BASE_URL + "/task/dailyGift/todo", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 积分抽奖 获取消耗积分数
  async consumePoints(callback) {
    // 获取消耗积分数
    let { data } = await $ajax.post(
      BASE_URL + "/task/points/consumePoints",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 积分猜大小 获取用户积分信息
  async getPoints(callback) {
    // 获取消耗积分数
    let { data } = await $ajax.post(BASE_URL + "/task/points/getPoints", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //积分猜大小 猜大小接口
  async pointsDraw(points, bigOrSmall, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/points/draw", {
      points: points,
      bigOrSmall: bigOrSmall
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //积分猜大小 游戏记录接口
  async pointGuessResult(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/points/pointGuessResult",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //积分PK领奖
  async pointsGrant(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/points/pointsGrant", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 积分PK 获取pk信息
  async getPkInfo(callback) {
    // 获取消耗积分数
    let { data } = await $ajax.post(BASE_URL + "/task/points/getPkInfo", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 积分PK 积分打call
  async savePkResult(selectImg, callback) {
    // 获取消耗积分数
    let { data } = await $ajax.post(BASE_URL + "/task/points/savePkResult", {
      selectImg: selectImg
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //点击立即领取按钮
  async immediatelyDraw(prizeInfoId, callback) {
    // console.log("immediatelyDraw")
    let { data } = await $ajax.post(BASE_URL + "/prize/receive/acquire", {
      prizeInfoId: prizeInfoId,
      status: 1
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50010) {
      callback && callback(data);
      // location.reload();
    } else if (
      ((data.resp_code == 60010 ||
        data.resp_code == 50009 ||
        data.resp_code == 1000) &&
        (sessionStorage.getItem("activityType") === "10016" ||
          sessionStorage.getItem("activityType") === "10014" ||
          sessionStorage.getItem("activityType") === "10013" ||
          sessionStorage.getItem("activityType") === "10068" ||
          sessionStorage.getItem("activityType") === "10078" ||
          sessionStorage.getItem("activityType") === "10070" ||
          sessionStorage.getItem("activityType") === "10088" ||
          sessionStorage.getItem("activityType") === "10097" ||
          sessionStorage.getItem("activityType") === "10098" ||
          sessionStorage.getItem("activityType") === "10099" ||
          sessionStorage.getItem("activityType") === "10101" ||
          sessionStorage.getItem("activityType") === "10998" ||
          sessionStorage.getItem("activityType") === "10106"))
    ) {
      callback && callback(data);
      // location.reload();
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿活动点击立即领取按钮
  async immediatelyDraw1(prizeInfoId, callback) {
    // console.log("immediatelyDraw")
    let { data } = await $ajax.post(BASE_URL + "/prize/receive/acquire", {
      prizeInfoId: prizeInfoId,
      status: 1
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 60010) {
      callback && callback(data);
      // location.reload();
    } else if (data.resp_code == 50010) {
      callback && callback(data);
      // location.reload();
    } else {
      Toast(data.resp_msg);
    }
  },

  // 每日抢好礼领取按钮
  async immediatelyDraw2(prizeInfoId, callback) {
    // console.log("immediatelyDraw")
    let { data } = await $ajax.post(BASE_URL + "/task/dailyGrabs/dayReceive", {
      prizeInfoId: prizeInfoId
    });
    if (data.resp_code == 0 || data.resp_code == 1000) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 新人专享价领取按钮
  async immediatelyDraw3(prizeInfoId, callback) {
    // console.log("immediatelyDraw")
    let { data } = await $ajax.post(
      BASE_URL + "/task/couponMarketing/receive",
      {
        prizeInfoId: prizeInfoId
      }
    );
    if (data.resp_code == 0 || data.resp_code == 1000) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //按钮置灰,可领取奖品
  async immediatelyDrawGray(callback) {
    // console.log("immediatelyDraw")
    let { data } = await $ajax.post(BASE_URL + "/prize/receive/list", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //限时抢券
  async robCoupons(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/robCoupons/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //点击抢券按钮
  async robCouponsClick(prizeInfoId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/robCoupons/robCoupons", {
      prizeInfoId: prizeInfoId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //盖楼有礼主接口
  async building(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/building/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //盖楼接口
  async build(buildText, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/building/build", {
      buildText: buildText
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //盖楼点赞接口
  async giveLike(buildRecordId, likeStatus, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/building/giveLike", {
      buildRecordId: buildRecordId,
      likeStatus: likeStatus
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //分享
  async setShare(callback) {
    console.log("setShare");
    let { data } = await $ajax.post(BASE_URL + "/task/share/getUserId", {});
    console.log(data, "data111111");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //是否是会员
  async getMember(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/member/getMember", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //是否是会员
  async getMemberRanking(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/member/rank/getMember", {
      shareUserId: store.state.shareUserId
    });
    callback && callback(data);
  },
  //主态砍价主页面
  async bargain(callback) {
    console.log(BASE_URL + "/task/bargain/main/activity");
    let { data } = await $ajax.post(
      BASE_URL + "/task/bargain/main/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //客态砍价主页面
  async guest(callback) {
    console.log(BASE_URL + "/task/bargain/guest/activity");
    let { data } = await $ajax.post(BASE_URL + "/task/bargain/guest/activity", {
      // shareUserId: "1349544967639875585"
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //砍价我也要参加
  async toJoin(callback) {
    console.log(BASE_URL + "/task/bargain/guest/toJoin");
    let { data } = await $ajax.post(
      BASE_URL + "/task/bargain/guest/toJoin",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //砍价好友记录
  async bargainFriends(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/share/friends", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //帮砍价
  async toBargain(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/bargain/guest/toBargain",
      {
        // shareUserId: "1349544967639875585"
        shareUserId: store.state.shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //是否是分享者本人
  async myselfBargain(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/bargain/guest/myself", {
      // shareUserId: "1349544967639875585"
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //许愿灯首页基本信息
  async lightWishLamp(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/wish/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //点亮许愿灯
  async lightUp(prizeId, userAddressVO, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/wish/lightUp", {
      prizeId: prizeId,
      userAddressVO: userAddressVO
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿灯主页面任务状态
  async getTaskWishCard(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/wishCard/getTaskWishCard",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿灯活动状态
  async getTaskType(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/wishCard/getTaskType",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //我的许愿卡
  async getTaskCardSend(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/wishCard/getTaskCardSend",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿获奖名单
  async getTaskPrizeUser(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/wishCard/getTaskPrizeUser",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿公示时间中奖信息
  async getPrizeInfo(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/wishCard/getPrizeInfo",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿领取奖品
  async wishGetPrize(cardId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/wishCard/getPrize", {
      cardId: cardId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //会员许愿领取奖品
  async getTaskWishCardShare(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/wishCard/getTaskWishCardShare",
      {}
    );
    if (data.resp_code == 0) {
      console.log("会员许愿领取奖品");
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //裂变抽奖主接口
  async getGroupDraw(type, callback) {
    //type 0/1    0:返回status  0     1:返回status1/2/3
    if (type == 0) {
      let { data } = await $ajax.post(BASE_URL + "/group/draw/getGroupDraw", {
        shareUserId: ""
      });
      if (data.resp_code == 0) {
        callback && callback(data);
      } else {
        Toast(data.resp_msg);
      }
    } else if (type == 1) {
      let { data } = await $ajax.post(BASE_URL + "/group/draw/getGroupDraw", {
        shareUserId: store.state.shareUserId
      });
      if (data.resp_code == 0) {
        callback && callback(data);
      } else {
        Toast(data.resp_msg);
      }
    }
  },

  //裂变抽奖任务接口
  async fissionTask(taskId, skuId, callback) {
    console.log("333333333333333333");
    let { data } = await $ajax.post(BASE_URL + "/group/draw/toDo", {
      taskId: taskId,
      skuId: skuId
    });
    // if (data.resp_code == 0) {
    callback && callback(data);
    // } else {
    //     Toast(data.resp_msg);
    // }
  },

  //加购主接口任务接口
  async addSkuTask(callback) {
    // 抽奖次数
    let { data } = await $ajax.post(BASE_URL + "/task/addSku/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //分享任务接口
  async shareTask(taskId, skuId, callback) {
    console.log("333333333333333333");
    let url = ''
    if (sessionStorage.getItem('activityType') == '10107') {
      url = '/task/timedDraw/toDo'
    } else {
      url = '/basic/task/toDo'
    }
    let { data } = await $ajax.post(BASE_URL + url, {
      taskId: taskId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //加购商品任务接口
  async addSkuTaskTodo(taskId, skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/addSku/toDo", {
      taskId: taskId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //组队瓜分列表
  async skuInfoList(shareUserId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/organizeTeam/activity", {
      shareUserId: shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //集卡有礼列表
  async getTeamIdList(teamId, shareUserId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/organizeTeam/saveMember",
      {
        teamId: teamId,
        shareUserId: shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //集卡有礼列表
  async getCaptainList(callback) {
    // debugger
    let { data } = await $ajax.post(
      BASE_URL + "/task/organizeTeam/saveCaptain",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //关注商品任务接口
  async followSkuTask(taskId, skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/jiugongge/toDo", {
      taskId: taskId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //关注商品任务接口
  async niudanjiSkuTask(taskId, skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/niudanji/toDo", {
      taskId: taskId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //关注店铺有礼任务接口
  async followShopTask(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/followShop/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //关注店铺有礼任务接口
  async followTeam(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/organizeTeam/followShop",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //关注店铺有礼砸蛋任务接口
  async followShopAddTask(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/followShop/add", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //关注店铺
  async followShop(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/followShop/follow", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //关注店铺加抽奖机会
  async followShopAdd(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/followShop/followAdd",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async buyersShow(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/buyersShow/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //买家秀抽奖接口
  async buyersDraw(resultId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/buyersShow/draw", {
      recordById: resultId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //买家秀晒单接口
  async buyersGetMyOrders(myStatus, orderStatus, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/buyersShow/getMyOrders", {
      myStatus: myStatus,
      orderStatus: orderStatus
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async buyersGetMyOrder(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/buyersShow/getMyOrder",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //买家秀点赞接口
  async buyersGiveLike(commentId, skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/buyersShow/giveLike", {
      commentId: commentId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 前n名优惠取得
  async getFrontNDiscount(callback) {
    let { data } = await $ajax.get(
      BASE_URL + "/task/topNDiscount/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 专享商品取得
  async getExclusiveGoods(callback) {
    let { data } = await $ajax.get(BASE_URL + "/exclusive/price/get", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 曝光商品取得  taskYype 0 曝光商品 11、加购商品
  async getGoods(taskType, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/goods/getGoods", {
      taskType: taskType
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //下单有礼我的奖品列表
  async orderPrizeList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderGift/prizeList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单有礼订单校验列表
  async orderCheckList(orderIds, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderGift/orderCheck", {
      orderIds: orderIds
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单有礼列表
  async exposureList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderGift/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单有礼获取店铺信息
  async orderGiftShop(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderGift/shopInfo", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单有礼获取商品信息
  async orderGiftSku(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderGift/skuList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 下单有礼关注店铺
  async orderGiftFollowShop(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/orderGift/followShop",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //关注店铺
  async followShop(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/followShop/follow", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //购物车锦鲤开奖
  async addSkuDraw(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/addSkuPrice/draw", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //购物车锦鲤关注店铺
  async addSkuFollowShop(shopId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/addSkuPrice/followShop", {
      shopId: shopId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //购物车锦鲤加购
  async addSku(skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/addSkuPrice/addSku", {
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //购物车锦鲤我的好友
  async addSkuHelpFriend(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/addSkuPrice/shareList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //粉丝互动获取任务列表
  async getFansTaskList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fansInteraction/taskList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //粉丝互动关注店铺列表
  async fansfollowStatus(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fansInteraction/followStatus",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //粉丝互动任务列表
  async fansTaskList(taskId, skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/fansInteraction/toDo", {
      taskId: taskId,
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //粉丝互动抽奖列表
  async fansDrawList(prizeInfoId, status, callback) {
    let { data } = await $ajax.post(BASE_URL + "/prize/receive/acquire", {
      prizeInfoId: prizeInfoId,
      status: status
    });
    if (
      data.resp_code == 0 ||
      data.resp_code == 60010 ||
      data.resp_code == 60002
    ) {
      //6002领奖失败
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //助力抢红包拆红包
  async hbShareDrawList(prizeInfoId, status, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/hbShare/acquire", {
      prizeInfoId: prizeInfoId,
      status: status
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 60010) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //粉丝互动列表
  async fansPlayList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fansInteraction/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //粉丝互动关注店铺
  async fansfollowList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fansInteraction/follow",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //优惠券营销主接口
  async couponMarketingList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/couponMarketing/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //优惠券营销领取优惠券接口
  async couponReceive(prizeId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/couponMarketing/receive",
      {
        prizeId: prizeId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //优惠券营销关注店铺接口
  async couponFollow(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/couponMarketing/follow",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //助力抢红包我的红包列表
  async hbShareList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/hbShare/list", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //助力抢红包曝光商品
  async hbShareSkuList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/hbShare/skuList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //助力抢红包关注店铺
  async hbShareFollowList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/hbShare/follow", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //助力抢红包初始化列表
  async hbShareActivityList(shareUserId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/hbShare/activity", {
      shareUserId: shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //助力抢红包帮好友助力
  async hbShareHelpFriendsList(shareUserId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/hbShare/shareFriends", {
      shareUserId: shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //集卡有礼列表
  async cardInfoList(shareUserId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/collectCard/activity", {
      shareUserId: shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //集卡有礼列表
  async cardfollowShop(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/collectCard/followShop",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //集卡有礼抽卡
  async drawCardInfoList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/collectCard/drawCard",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //集卡有礼抽卡
  async cardShopInfo(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/collectCard/shopInfo",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //集卡有礼抽卡
  async cardSkuList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/collectCard/skuList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //集卡有礼抽卡
  async cardFriendsHelpList(shareUserId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/collectCard/activityHelp",
      {
        shareUserId: shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //购物车锦鲤
  async shoppingCard(shareUserId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/addSkuPrice/activity", {
      shareUserId: shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //购物车锦鲤
  async shoppingCard1(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/addSkuPrice/activity1",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //购物车锦鲤
  async shoppingCard2(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/addSkuPrice/activity2",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //集卡有礼好友助力
  async cardFriendHelpList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/collectCard/helpList", {
      pageNo: 1,
      pageSize: 100
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 裂变神券
  async fissionCoupon(type, callback) {
    if (type == 1) {
      let { data } = await $ajax.post(
        BASE_URL + "/task/fissionCoupon/activity",
        {
          shareUserId: "",
          teamId: ""
        }
      );
      if (data.resp_code == 0) {
        callback && callback(data);
      } else {
        Toast(data.resp_msg);
      }
    } else {
      let { data } = await $ajax.post(
        BASE_URL + "/task/fissionCoupon/activity",
        {
          shareUserId: store.state.shareUserId,
          teamId: store.state.teamId
        }
      );
      if (data.resp_code == 0) {
        callback && callback(data);
      } else {
        Toast(data.resp_msg);
      }
    }
  },

  // 裂变神券的立即拼券
  async fissionCouponFight(prizeId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/fissionCoupon/fight", {
      prizeInfoId: prizeId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 裂变神券
  async fissionCouponShare(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fissionCoupon/shareActivity",
      {
        shareUserId: store.state.shareUserId,
        teamId: store.state.teamId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 裂变神券
  async fissionJoinCoupon(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fissionCoupon/joinCoupon",
      {
        shareUserId: store.state.shareUserId,
        teamId: store.state.teamId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 裂变神券的查看队伍
  async fissionCouponTeamMember(prizeInfoId, teamId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fissionCoupon/getTeamMembers",
      {
        prizeInfoId: prizeInfoId,
        teamId: teamId,
        activityId: store.state.activityId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 拉人砍价初始化
  async taskBargaining(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/taskBargaining/activity",
      {
        shareUserId: store.state.shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // N元试用关注商品
  async apply(phoneNumber, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/trail/apply", {
      phoneNumber: phoneNumber
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // N元试用关注商品
  async followSku(skuId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/trail/followSku", {
      skuId: skuId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // N元试用店铺信息
  async followShopList(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/trail/followShop", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // N元试用初始化
  async taskYuanTrial(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/trail/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //拉人砍价关注店铺
  async barginFollowShop(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/taskBargaining/followShop",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //拉人砍价帮他砍一刀
  async barginToBargain(shareUserId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/taskBargaining/toBargain",
      {
        shareUserId: shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //拉人砍价好友列表
  async barginShareUserList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/taskBargaining/shareUserList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //拉人砍价商品
  async barginSkuList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/taskBargaining/skuList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 拉人砍价初始化
  async taskBargaining(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/taskBargaining/activity",
      {
        shareUserId: store.state.shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 0元砍店铺信息
  async followShopZero(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/lingyuankan/followShop",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //0元砍
  async freeBargain(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/lingyuankan/activity", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //0元砍 领取优惠券
  async receiveCoupon(pointStatus, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/lingyuankan/sendPrize", {
      pointStatus: pointStatus
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //排行榜列表
  async getLeaderBroad(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/member/getLeaderBroad",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  /**
   * 答题/问卷活动内容信息
   * @param taskId
   * @param data
   * @param options
   * @returns {Promise | Promise<unknown>}
   */
  taskQaActivity(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/qa/activity", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 答题/问卷活动提交答案及收集信息
   * @param taskId
   * @param data
   * @param options
   * @returns {Promise | Promise<unknown>}
   */
  taskQaSubmit(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/qa/submit", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 会员判断
   * @returns {Promise | Promise<unknown>}
   */
  checkMember() {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/common/user/checkMember", {})
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 分享图片视频有礼
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  taskShareResourceActivity(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/shareResource/activity", data)
        .then(res => {
          console.log(res);
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else if (
            res.data.resp_code == 50009 ||
            res.data.resp_code == 60010 ||
            res.data.resp_code == 50023 ||
            res.data.resp_code == 50024 ||
            res.data.resp_code == 50013
          ) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },
  /**
   * 点击获得积分
   * @param prizeInfoId
   * @param resourceId
   * @returns {Promise | Promise<unknown>}
   */
  taskShareResourceClicks(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/shareResource/clicks", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else if (
            res.data.resp_code == 50013 ||
            res.data.resp_code == 60010 ||
            res.data.resp_code === 50009 ||
            res.data.resp_code === 50013
          ) {
            resolve(res.data); //今日任务次数已达上限/奖品已发完
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 上传图片
   * @param file
   * @returns {Promise | Promise<unknown>}
   */
  upLoadPictures(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/upLoadPraise/upload", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 初期显示
   * @param
   * @returns {Promise | Promise<unknown>}
   */
  activityQueryIndex(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/upLoadPraise/queryIndex", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else if (
            res.data.resp_code == 50009 ||
            res.data.resp_code == 60010 ||
            res.data.resp_code == 50003 ||
            res.data.resp_code == 60008
          ) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 点赞
   * @param detailsId
   * @returns {Promise | Promise<unknown>}
   */
  clickPraise(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/upLoadPraise/clickPraise", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else if (res.data.resp_code == 50023) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 好友点赞图片
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  imgClickPraise(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/upLoadPraise/imgClickPraise", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else if (res.data.resp_code == 50023) {
            resolve(res.data);
          } else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 查询会员试用商品
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  getMemberTrial() {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/memberTrial/getMemberTrial")
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          }
          // else if (res.data.resp_code == 50009 || res.data.resp_code == 60010
          //     || res.data.resp_code == 50023 || res.data.resp_code == 50024 || res.data.resp_code == 50013) {
          //     resolve(res.data);
          // }
          else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },
  /**
   * 查询关注商品
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  getFollowGoods() {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + `/task/followGoods/getFollowGoods`)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            resolve(res.data);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },
  //关注商品任务接口
  followProTask(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/followGoods/followGoods", data)
        .then(res => {
          console.log(res);
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            // Toast(res.data.resp_msg);
            resolve(res.data);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },
  //关注商品--点击关注店铺
  followShopDefine(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/followGoods/followShopDefine", data)
        .then(res => {
          console.log(res);
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            // Toast(res.data.resp_msg);
            resolve(res.data);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  //申请记录
  async applyRecord(callback) {
    // console.log("myprize")
    let { data } = await $ajax.post(
      BASE_URL + "/task/memberTrial/getApplyGoods",
      {
        current: 1,
        size: 10000
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  /**
   * 申请试用商品
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  applyTrialGood(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/memberTrial/getMemberTrialCheck", data)
        .then(res => {
          console.log(res);
          if (res.data.resp_code == 0) {
            resolve(res.data);
          }
          // else if (res.data.resp_code == 50009 || res.data.resp_code == 60010
          //     || res.data.resp_code == 50023 || res.data.resp_code == 50024 || res.data.resp_code == 50013) {
          //     resolve(res.data);
          // }
          else {
            // Toast(res.data.resp_msg);
            reject(res.data);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },
  //申请试用商品
  memberTrial(data) {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/memberTrial/apply", data)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else {
            reject(res.data);
          }
        })
        .catch(e => {
          Toast(e);
          reject(e);
        });
    });
  },

  /**
   * 查询完善用户信息
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  getCompleteInfo() {
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/perfectInfo/activity")
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          } else if (res.data.resp_code == 50009) {
            // debugger
            reject(res.data);
          }
          // else if (res.data.resp_code == 50009 || res.data.resp_code == 60010
          //     || res.data.resp_code == 50023 || res.data.resp_code == 50024 || res.data.resp_code == 50013) {
          //     resolve(res.data);
          // }
          else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },

  /**
   * 提交完善用户信息
   * @param shareUserId
   * @returns {Promise | Promise<unknown>}
   */
  addCompleteInfo(values, callback) {
    console.log("addCompleteInfo", values);
    return new Promise((resolve, reject) => {
      $ajax
        .post(BASE_URL + "/task/perfectInfo/addInfo", values)
        .then(res => {
          if (res.data.resp_code == 0) {
            resolve(res.data);
          }
          // else if (res.data.resp_code == 50009 || res.data.resp_code == 60010
          //     || res.data.resp_code == 50023 || res.data.resp_code == 50024 || res.data.resp_code == 50013) {
          //     resolve(res.data);
          // }
          else {
            Toast(res.data.resp_msg);
            reject(res.data.resp_msg);
          }
        })
        .catch(e => {
          Toast(e.message);
          reject(e.message);
        });
    });
  },
  // 完善信息有礼领取按钮
  async immediatelyDrawWSXX(prizeInfoId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/prize/receive/acquire", {
      prizeInfoId: prizeInfoId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50010) {
      callback && callback(data);
      // location.reload();
    } else if (data.resp_code == 60010 || data.resp_code == 50009) {
      callback && callback(data);
      // location.reload();
    } else if (
      (data.data && data.data.status) != 1 ||
      data.resp_code == 60002
    ) {
      Toast("领取失败");
    } else {
      Toast(data.resp_msg);
    }
  },
  // 抽奖中心
  async upperSign(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/upperSign/getTask", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 店铺礼包主接口 shopGiftMain
  async shopGiftMain(callback) {
    let { data } = await $ajax.post(BASE_URL + "/shopGift/shopGiftMain", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      XViewClose()
      Toast(data.resp_msg);
    }
  },
  async shopGiftMainCheck(callback) {
    let { data } = await $ajax.post(BASE_URL + "/shopGift/shopGiftMainCheck", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      XViewClose()
      Toast(data.resp_msg);
    }
  },

  // 店铺礼包收下礼包 drawShopGift
  async drawShopGift(getPrizeData, callback) {
    // console.log(getPrizeData,'getPrizeData')
    let { data } = await $ajax.post(
      BASE_URL + "/shopGift/drawShopGift",
      getPrizeData
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 邀请详情查询接口
  async getInviteInfo(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/inviteFollowShop/getInviteInfo",
      {
        shareUserId: store.state.shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      // Toast(data.resp_msg);
    }
  },

  // 邀请关注接口
  async setShareFollow(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/inviteFollowShop/follow",
      {
        shareUserId: store.state.shareUserId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 获取悬浮图标信息 getInteractiveCity
  async getInteractiveCity(callback) {
    if (
      typeof process.env.showInteractCityIcon != undefined &&
      process.env.showInteractCityIcon == false
    ) {
      return;
    }

    let { data } = await $ajax.post(
      BASE_URL + "/active/getInteractiveCity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 获取分享方式 getPageShareConfig
  async getPageShareConfig(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/user-info/getPageShareConfig",
      {
        activityId: store.state.activityId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 新的关注店铺有礼获取店铺是否关注
  async getUserFollowInfo(callback) {
    var url = BASE_URL + "/task/lkFollowShop/getUserFollowInfo";
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },

  // 新的关注店铺后发奖
  async saveFollowInfo(callback) {
    var url =
      BASE_URL +
      "/task/lkFollowShop/saveFollowInfo?actType=" +
      sessionStorage.getItem("activityType");
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },

  // 新的合成大赢家
  async getBigWinnerTask(callback) {
    let { data } = await $ajax.post(BASE_URL + "/bigwinner/getTask", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  async bigWinnerAct(params, callback) {
    let { data } = await $ajax.post(BASE_URL + "/bigwinner/getBigwinner", {
      gameUrl: params,
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 福禄领取提交信息
  async submitGetFuLu(param, callback) {
    let { data } = await $ajax.post(BASE_URL + "/my/prize/getFulu", param);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  // 盖楼有礼奖品
  async buildPrize(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/building/prizeList", {});
    callback && callback(data);
  },
  // 查看优惠券下可插入的队伍
  async getCanJumpInLine(prizeInfoId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/fissionCoupon/getCanJumpInLine",
      {
        prizeInfoId: prizeInfoId
      }
    );
    callback && callback(data);
  },
  // 插入队伍
  async getJoinTeam(prizeInfoId, teamId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/fissionCoupon/joinTeam", {
      prizeInfoId: prizeInfoId,
      teamId: teamId
    });
    callback && callback(data);
  },

  // 积分PK查询活动信息
  async queryPkActivity(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/integralPk/activity", {
      shareUserId: store.state.shareUserId
    });
    callback && callback(data);
  },
  // 积分pk投票
  async pkVote(param, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/integralPk/pkClick/" + param
    );
    callback && callback(data);
  },
  // 积分pk积分领取
  async getPkIntegral(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/integralPk/pkClickAward");
    callback && callback(data);
  },
  // 浏览店铺、商品埋点
  async storeGoodsPoint(type) {
    await $ajax.get(BASE_URL + `/buy/point/basePoint?type=${type}`, {});
  },
  // 76积分猜大小
  async getIntegralInfo(params, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/integral/size/getActivityBasic",
      params
    );
    callback && callback(data);
  },
  // 76积分猜大小押宝
  async doGame(params, callback) {
    let { data } = await $ajax.post(BASE_URL + "/integral/size/doGame", params);
    if (data.resp_code == 0 || data.resp_code == 73002 || data.resp_code == 73001) {
      callback && callback(data);
    }
  },
  // 游戏记录
  async getGameRecord(callback) {
    let { data } = await $ajax.post(BASE_URL + "/integral/size/getGameRecord ");
    callback && callback(data);
  },

  // 首购有礼主接口
  async getDoFirstBuy(callback) {
    let { data } = await $ajax.post(BASE_URL + "/first/buy/doFirstBuy");
    callback && callback(data);
  },

  // 查询购买条件
  async getActivityBasic(callback) {
    let { data } = await $ajax.post(BASE_URL + "/first/buy/getActivityBasic");
    callback && callback(data);
  },

  // 查询我的订单
  async getMyOrder(callback) {
    let { data } = await $ajax.get(BASE_URL + "/consumptionGift/getMyOrder");
    callback && callback(data);
  },

  //首购有礼参与商品
  async getOrderGoods(pageNo, pageSize, callback) {
    var url = BASE_URL + `/first/buy/getShop/${pageNo}/1000`;
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },

  // 复购有礼主接口
  async getDoRepurchase(callback) {
    let { data } = await $ajax.post(BASE_URL + "/another/buy/doAnotherBuy");
    callback && callback(data);
  },

  // 复购查询购买条件
  async getActivityBasicRepurchase(callback) {
    let { data } = await $ajax.post(BASE_URL + "/another/buy/getActivityBasic");
    callback && callback(data);
  },

  // 复购查询我的订单
  async getMyOrderRepurchase(callback) {
    let { data } = await $ajax.get(BASE_URL + "/another/buy/getMyOrder");
    callback && callback(data);
  },

  //复购有礼参与商品
  async getOrderGoodsRepurchase(pageNo, pageSize, callback) {
    var url = BASE_URL + `/another/buy/getShop/${pageNo}/${pageSize}`;
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },

  // 消费有礼主接口
  async consumptionGift(callback) {
    let { data } = await $ajax.get(BASE_URL + "/consumptionGift/activity");
    callback && callback(data);
  },
  // 积分兑换主接口
  async pointExchange(callback) {
    let { data } = await $ajax.get(BASE_URL + "/pointsExchange/activity");
    callback && callback(data);
  },
  // 积分兑换兑换接口
  async pointExchangeExchange(params, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/pointsExchange/exchange",
      params
    );
    callback && callback(data);
  },

  // 判断是否显示同步订单
  async checkOrderByActType(actType, callback) {
    let { data } = await $ajax.post(BASE_URL + "/active/checkOrderByActType", {
      actType: actType
    });
    callback && callback(data);
  },

  async checkOrderByIds(orderIds, callback) {
    let { data } = await $ajax.get(
      BASE_URL + "/active/checkOrderByIds?orderIds=" + orderIds,
      {}
    );
    callback && callback(data);
  },

  // 问卷调查主接口
  async questionnaireMain(callback) {
    let { data } = await $ajax.post(BASE_URL + "/questionnaire/activity", {
      shareUserId: store.state.shareUserId
    });
    callback && callback(data);
  },

  // 是否能邀请好友
  async questionnaireShare(callback) {
    let { data } = await $ajax.get(BASE_URL + "/questionnaire/isShare", {});
    callback && callback(data);
  },

  // 答题接口
  async questionnaireAnswer(checkEndNow, callback) {
    console.log(checkEndNow);
    let { data } = await $ajax.post(
      BASE_URL + "/questionnaire/answer",
      checkEndNow
    );
    callback && callback(data);
  },

  // 获取问题数据
  async getQuestion(callback) {
    let { data } = await $ajax.get(BASE_URL + "/questionnaire/getQuestion", {});
    callback && callback(data);
  },
  // 邀请入会-排行榜
  async getRankingPrize(activityId, callback) {
    let { data } = await $ajax.get(
      BASE_URL + "/task/rank/getRankPrizeInfo?" + "activityId=" + activityId
    );
    callback && callback(data);
  },
  //邀请入会排行榜奖品
  async getMemderPrizeList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/member/rank/prizeList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //邀请入会排行榜领奖
  async getMemderGetPrize(prizeInfoId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/rank/acquireRank", {
      prizeInfoId: prizeInfoId,
      status: 1
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50010) {
      callback && callback(data);
      // location.reload();
    } else if (
      (data.resp_code == 60010 ||
        data.resp_code == 50009 ||
        data.resp_code == 1000) &&
      sessionStorage.getItem("activityType") === "10070"
    ) {
      callback && callback(data);
      // location.reload();
    } else {
      Toast(data.resp_msg);
    }
  },
  //邀请入会排行榜奖品
  async getMemderInviteNum(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/member/rank/getMemberRules",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //获取游戏信息-新版
  async getGameInfo(params, callback) {
    let { data } = await $ajax.post(BASE_URL + "/game/getGameInfo", {
      gameUrl: params,
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //游戏初始化
  async gameInit(templateId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/game/init", {
      templateId: templateId
    });

    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
      location.replace(process.env.ACTIVITY_HOST + "/errorPage");
    }
  },

  //游戏开始
  async gameStart(callback) {
    let { data } = await $ajax.post(BASE_URL + "/game/start", {});
    callback && callback(data);
  },

  //游戏结束
  async gameEnd(params, callback) {
    let { data } = await $ajax.post(BASE_URL + "/game/end", params);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
      location.replace(process.env.ACTIVITY_HOST + "/errorPage");
    }
  },

  async getDrawRecord(callback) {
    let { data } = await $ajax.post(BASE_URL + "/prize/drawRecord");
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券主态主接口
  async newFissionCouponActivity(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/activity",
      {
        shareUserId: store.state.shareUserId,
        teamId: ""
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券客态主接口
  async newFissionCouponShareActivity(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/shareActivity",
      {
        shareUserId: store.state.shareUserId,
        teamId: store.state.teamId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券分享进来进行组队
  async newFissionCouponJoinCoupon(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/joinCoupon",
      {
        shareUserId: store.state.shareUserId,
        teamId: store.state.teamId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券主端立即拼团
  async newFissionCouponFight(captainPrizeInfoId, memberPrizeInfoId, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/newFissionCoupon/fight", {
      captainPrizeInfoId: captainPrizeInfoId,
      memberPrizeInfoId: memberPrizeInfoId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券查看优惠券下可插入的队伍
  async newFissionCouponGetCanJumpInLine(
    captainPrizeInfoId,
    memberPrizeInfoId,
    callback
  ) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/getCanJumpInLine",
      {
        captainPrizeInfoId: captainPrizeInfoId,
        memberPrizeInfoId: memberPrizeInfoId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券校验身份
  async newFissionCouponCheckUser(
    captainPrizeInfoId,
    memberPrizeInfoId,
    type,
    callback
  ) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/checkUser",
      {
        captainPrizeInfoId: captainPrizeInfoId,
        memberPrizeInfoId: memberPrizeInfoId,
        type: type
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },
  // 新裂变神券插队
  async newFissionCouponJoinTeam(
    captainPrizeInfoId,
    memberPrizeInfoId,
    teamId,
    callback
  ) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/joinTeam",
      {
        captainPrizeInfoId: captainPrizeInfoId,
        memberPrizeInfoId: memberPrizeInfoId,
        teamId: teamId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 新裂变神券插队
  async newFissionCouponGetTeamMembers(
    captainPrizeInfoId,
    memberPrizeInfoId,
    teamId,
    callback
  ) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/newFissionCoupon/getTeamMembers",
      {
        captainPrizeInfoId: captainPrizeInfoId,
        memberPrizeInfoId: memberPrizeInfoId,
        teamId: teamId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },

  // 下单冲榜-主接口
  async orderCourtesy(callback) {
    let { data } = await $ajax.get(BASE_URL + "/task/orderCourtesy/activity");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 下单冲榜-报名
  async orderCourtesySignApi(callback) {
    let { data } = await $ajax.get(BASE_URL + "/task/orderCourtesy/receive");
    if (data.resp_code == 0) {
      callback && callback(data);
    }
  },


  // 下单冲榜-排行榜奖品
  async orderCourtesyPrizeList(activityId, callback) {
    let { data } = await $ajax.get(
      BASE_URL + "/task/orderCourtesy/rankPrize?" + "activityId=" + activityId
    );
    callback && callback(data);
  },

  // 下单冲榜-排行榜
  async orderCourtesyRanking(callback) {
    let { data } = await $ajax.get(
      BASE_URL + "/task/orderCourtesy/getRankInfo",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  //下单冲榜-参与商品
  async orderCourtesyskuList(pageNo, pageSize, callback) {
    var url = BASE_URL + `/first/buy/getShop/${pageNo}/1000`;
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },

  // 积分竞拍查询商品信息
  async queryAuctionActivity(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/auction/activity", {});
    callback && callback(data);
  },
  // 积分竞拍查询剩余积分
  async queryAuctionPointActivity(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/auction/getUserPoint",
      {}
    );
    callback && callback(data);
  },
  // 积分竞拍竞拍商品
  async participateAuction(prizeInfoId, point, prizeName, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/auction/participateAuction",
      {
        prizeInfoId,
        point,
        prizeName
      }
    );
    callback && callback(data);
  },
  // 积分竞拍查询所有人竞拍记录
  async getAuctionUserInfo(self, callback, id) {
    var url =
      BASE_URL +
      "/task/auction/getAuctionUserInfo/" +
      self +
      (id ? "?prizeId=" + id : "");
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },
  // 积分竞拍查询当前人竞拍记录
  async getAuctionRrawRecord(activityId, callback) {
    var url = BASE_URL + "/auctionRecord/drawRecord/" + activityId + "/1/99";
    let { data } = await $ajax.get(url);
    callback && callback(data);
  },
  // 积分竞拍领取奖品
  async auctionClaimPrize(position, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/auction/claimPrize", {
      position
    });
    callback && callback(data);
  },
  // 下单阶梯有礼主页面查询
  async breakThroughActivity(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/breakThrough/activity",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单阶梯有礼获取商品信息
  async breakThroughSkuList(assignGoodsFlag, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/breakThrough/skuList", {
      assignGoodsFlag
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单阶梯有礼订单校验列表
  async breakThroughOrdCheck(prizeId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/breakThrough/orderCheck",
      {
        prizeId: prizeId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //下单阶梯有利奖品列表
  async breakThroughPrizeList(callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/breakThrough/prizeList",
      {}
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 下单阶梯有礼获取订单
  async breakThroughOrdList(callback) {
    let { data } = await $ajax.get(BASE_URL + "/consumptionGift/getMyOrder");
    callback && callback(data);
  },
  //复购有礼曝光商品
  async getbuyExposureShop(callback) {
    let { data } = await $ajax.get(BASE_URL + "/second/buy/getShop/1/1000");
    callback && callback(data);
  },
  //复购有礼主接口
  async getbuyAct(callback) {
    let { data } = await $ajax.post(BASE_URL + "/second/buy/doSecondBuy");
    callback && callback(data);
  },
  // 复购有礼报名领取
  async getbuyOrder(params, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/second/buy/orderCheck",
      params
    );
    callback && callback(data);
  },
  //下单类活动商品列表
  async getOrderActivityGoods(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderGift/skuList", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //接收防刷接口
  async getDefenseUrls(callback) {
    let { data } = await $ajax.get(BASE_URL + "/user-info/getDefenseUrls");
    console.log(data, "//user-info/getDefenseUrls");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //处理防刷后端数据
  async initPinToken(callback) {
    let { data } = await $ajax.get(BASE_URL + "/user-info/initPinToken", {
      status: store.state.shareUserId ? "0" : "1", // 1 主端 0 客端
      activityId: store.state.activityId,

      // F749F90CFBC6956CC54CFCD73190C57E764A3217BE43EBC1C813C9F86D16C933C5EE73963AB1CEDABA6C444F022CB6C9
      // E53378228CE4AA7BE78CBCCFC72E1127272F1E253D1A2F5C31EA26D04919940AC5EE73963AB1CEDABA6C444F022CB6C9
      jdToken:
        process.env.ENV_CONFIG == "dev"
          ? tokens
          : sessionStorage.getItem("lz_wq_auth_token"), // AD72173BA251E3E0EAA1C3B9490AABF34FCCD1ECE447213A5C35115CED878439B83F28FC0FCEF83361F49105C838CD66 D0117FDEE1D16A98CB0453F66F2C6A71BA785F99BD0448CBC2A2296AC3328FECC5EE73963AB1CEDABA6C444F022CB6C9 5DD04D1D418B008B56E860DAB621370A22B333753A6323C717214CFC4E615E30B83F28FC0FCEF83361F49105C838CD66 FAAFEBAACF94F0DCF1D69767A5AB44F16F77AC42835C74C67F6CC63BFF6AFDF1 3D63251CBE72FF85116BA1854803948EB11648527DAB70E94A6A81674EE95009 9AF9D95AC149DEE56B7881A7AA1782DB0FCDAF3A90B8866C112280501958BDA0 4A5112DA4063012BEFC023EB96312373C40589B2CF9FEC4D2BA4B79285CB388B D888F053BC73B8B3DC6AFBFB72CB6D0498756BD0CD625420F9E682CB22E38226
      source: store.state.clientType == "01" ? "01" : "02", //'02', //store.state.clientType,
      // source: store.state.clientType,
      shareUserId: store.state.shareUserId,
      uuid: sessionStorage.getItem("uuid"),
      clientTime: Date.now(),
      shopId: store.state.shopId
    });
    console.log(data, "//user-info/initPinToken");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      // Toast(data.resp_msg);
      window.location.replace(process.env.ACTIVITY_HOST + "/errorPage?soHot=0")
    }
  },
  //邀请好友享团购活动商品列表
  async getActivity10101Goods(params, callback) {
    let url = "";
    if (params.shareUserId) {
      url =
        BASE_URL +
        "/task/pieceTogether/activity?shareUserId=" +
        params.shareUserId +
        "&prizeInfoId=" +
        params.prizeInfoId;
    } else {
      url = BASE_URL + "/task/pieceTogether/activity";
    }
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
      callback && callback(data);
    }
  },
  //开团：分享好友之前调用一下
  async pieceTogetherOpenTeam(params, callback) {
    let url = BASE_URL + "/task/pieceTogether/openTeam";
    let { data } = await $ajax.post(url, params);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //邀请好友享团购-获取商品信息
  async pieceTogetherPrizeInfo(prizeInfoId, callback) {
    let url =
      BASE_URL + "/task/pieceTogether/prizeInfo?prizeInfoId=" + prizeInfoId;
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  //添加埋点接口
  async doFrontBuryPoint(params) {
    console.log(params);
    let { data } = await $ajax.post(BASE_URL + "/front/doFrontBuryPoint", {
      prd: "cjwx",
      te: "c",
      sid: sessionStorage.getItem("shopId"),
      uid: store.state.userPin,
      t: new Date().getTime(),
      at: sessionStorage.getItem("activityType"),
      opid: store.state.activityId,
      ver: "1",
      c: `{code:${params.code},value:${params.value}}`,
      e: params.event,
      l: "1",
      url: location.href,
      ch: ""
    });
    if (data.resp_code == 0) {
    } else {
      Toast(data.resp_msg);
    }
  },
  // 下单阶梯有礼主页面查询
  async collectionTankActivity(callback) {
    let { data } = await $ajax.get(BASE_URL + "/collectionTank/activity", {});
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // N元M件页面查询
  async totalPricePromo(callback) {
    let url = BASE_URL + "/task/totalPricePromo/activity";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // N元M件加购接口
  async totalPricePromoAddCart(params, callback) {
    let url = BASE_URL + "/task/totalPricePromo/addCart";
    let { data } = await $ajax.post(url, {
      totalPricePromoAddSkuLogList: params
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 实物奖品发货时间
  async getDeliveryInfo(callback) {
    let url = BASE_URL + "/prize/getDeliveryInfo";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      console.log(data, 'dataxxzzzzzzzzzzz');
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 新会员限时专享价主接口
  async newMemberPromoApi(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/newMemberPromo/activity");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 试用回购礼主接口
  async buyBackGiftApi(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/buyBackGift/activity");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  // 订单校验
  async getOrderInfoApi(orderId, callback) {
    let url =
      BASE_URL + "/orderCheck/getOrderInfoList?orderId=" + orderId;
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getDrawChanceSourceApi(callback) {
    let url =
      BASE_URL + "/task/lotteryCenter/getDrawChanceSource";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getTaskConfigApi(callback) {
    let url =
      BASE_URL + "/orderCheck/getTaskConfig";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async updateAddressApi(values, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/orderCourtesy/updateAddress", values);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  async getAddressApi(prizeInfoId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/orderCourtesy/getAddress",
      {
        prizeInfoId: prizeInfoId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },

  async timedDrawApi(callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/timedDraw/activity", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async timedDrawReceiveApi(callback) {
    let url =
      BASE_URL + "/task/timedDraw/receive";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async timedDrawPrizeApi(callback) {
    let url =
      BASE_URL + "/task/timedDraw/getPrizeList";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async timedDrawUpdateAddressApi(values, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/timedDraw/updateAddress", values);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getMyCycleDrawCodeApi(callback) {
    let url =
      BASE_URL + "/task/timedDraw/getMyCycleDrawCode";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getMyCyclePrizeApi(callback) {
    let url =
      BASE_URL + "/task/timedDraw/getMyCyclePrize";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async cycleAcquireDrawApi(prizeInfoId, drawCode, callback) {
    let { data } = await $ajax.post(BASE_URL + "/task/timedDraw/cycleAcquire", {
      prizeInfoId: prizeInfoId,
      drawCode: drawCode,
      status: 1
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50010) {
      callback && callback(data);
    } else if (
      ((data.resp_code == 60010 ||
        data.resp_code == 50009 ||
        data.resp_code == 1000) &&
        (sessionStorage.getItem("activityType") === "10107"))
    ) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async timedDrawGetAddressApi(addressCode, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/timedDraw/getAddress",
      {
        addressCode: addressCode
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getMyNowDrawCodeApi(callback) {
    let url =
      BASE_URL + "/task/timedDraw/getMyNowDrawCode";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getDrawCountInfoApi(callback) {
    let url =
      BASE_URL + "/prize/getDrawCountInfo";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async updateCycleStatusApi(cycleId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/task/timedDraw/updateCycleStatus",
      {
        cycleId: cycleId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async appointmentActivityApi(prizeId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/consumptionGift/appointmentActivity",
      {
        prizeId: prizeId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async cancelAppointmentApi(prizeId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/consumptionGift/cancelAppointment",
      {
        prizeId: prizeId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async consumptionGiftGetAddressApi(prizeInfoId, callback) {
    let { data } = await $ajax.post(
      BASE_URL + "/consumptionGift/getAddress",
      {
        prizeInfoId: prizeInfoId
      }
    );
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async consumptionGiftUpdateAddressApi(values, callback) {
    let { data } = await $ajax.post(BASE_URL + "/consumptionGift/updateAddress", values);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async getRankInfoNewApi(callback) {
    let url =
      BASE_URL + "/task/orderCourtesy/getRankInfoNew";
    let { data } = await $ajax.get(url);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async guessMainApi(callback) {
    let { data } = await $ajax.post(BASE_URL + "/guess/main", {
      shareUserId: store.state.shareUserId
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async guessVoteApi(competitionId, guessResult, callback) {
    let { data } = await $ajax.post(BASE_URL + "/guess/vote", {
      competitionId: competitionId,
      guessResult: guessResult,
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async activityListApi(activityObj, callback) {
    let { data } = await $ajax.post(BASE_URL + "/active/activityList", activityObj);
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
  async guessAcquireApi(prizeInfoId, callback) {
    // console.log("immediatelyDraw")
    let { data } = await $ajax.post(BASE_URL + "/guess/acquire", {
      prizeInfoId: prizeInfoId,
      status: 1
    });
    if (data.resp_code == 0) {
      callback && callback(data);
    } else if (data.resp_code == 50010) {
      callback && callback(data);
      // location.reload();
    } else {
      Toast(data.resp_msg);
    }
  },

  async guessWinnerApi(callback) {
    let { data } = await $ajax.post(BASE_URL + "/guess/winnerList");
    if (data.resp_code == 0) {
      callback && callback(data);
    } else {
      Toast(data.resp_msg);
    }
  },
};
