import request from "../utils/request";

export default {
  homeList(data) {
    return request.get(
      `/weapp/kujis/v2/${data.size}/${data.sort}/${data.order}/${data.lastId}`
    );
  },
  homeListV3(data = {}) {
    return request.get(
      `/weapp/kujis/v3?play_type=${data.play_type || ""}&last_id=${
        data.last_id || 0
      }&session=${data.session || ""}`
    );
  },
  homeModule(id) {
    return request.get("/weapp/kujis/module/" + id + "?ver=beta");
  },
  getSingInfo(session) {
    return request.get("/weapp/getSingInfo/" + session);
  },
  userSingIn(data) {
    return request.post("/weapp/userSingIn", data);
  },
  userNewSingIn(data) {
    return request.post("/weapp/userNewSingIn", data);
  },
  getTaskInfo(session) {
    return request.get("/weapp/getTaskInfo/" + session);
  },
  //首页模块
  homeModules() {
    return request.get("/weapp/index/module");
  },
  // 详情
  detail(id) {
    return request.get(`/weapp/kujis/fudai_detail/${id}`);
  },
  // 详情
  detailDanmu(id) {
    return request.get(`/weapp/kujis/detail_danmu/${id}`);
  },
  getFriendsList(session) {
    return request.get(`/weapp/getFriendsList/${session}`);
  },
  beTo() {
    return request.get("/weapp/kujis/will");
  },
  danmu() {
    return request.get("/weapp/kujis/danmu");
  },
  goodsDetail(id, session) {
    return request.get("/weapp/kujis/" + id + "?session=" + session);
  },
  pincheDetail(id, session) {
    return request.get("/weapp/kujis/pinche/" + id + "?session=" + session);
  },
  goodsRecords(id, session) {
    return request.get("/weapp/kujis/" + id + "/payList?session=" + session);
  },
  goodsPay(data) {
    return request.post("/weapp/kujis/pay", data);
  },
  balancePay(data) {
    return request.post("/weapp/kujis/balance/fudai_pay", data);
  },
  pBalancePay(data) {
    return request.post("/weapp/kujis/pinche/balance/pay", data);
  },
  prePay(data) {
    return request.post("/weapp/kujis/fudai_prepay", data);
    // return request.post("/weapp/kujis/prepay", data);
  },
  pPrePay(data) {
    return request.post("/weapp/kujis/pinche/prepay", data);
  },
  pSubSeats(data) {
    return request.post("/weapp/kujis/pinche/subSeat", data);
  },
  completePay(data) {
    return request.post("/weapp/kujis/complete/pay", data);
  },
  queryPay(data) {
    return request.post("/weapp/kujis/query/pay", data);
  },
  getPrepay(data) {
    return request.post("/weapp/invest/prepay", data);
  },
  getPrepayStatus(data) {
    return request.post("/weapp/invest/complete/pay", data);
  },
  getPrepaySucceed(data) {
    return request.post("/weapp/invest/query/pay", data);
  },

  getRealSeat(id, session) {
    return request.get("/weapp/kujis/carPoolMap/" + id + "?session=" + session);
  },

  getPrepaySucceedOrder(data) {
    return request.post("/weapp/sendout/query/pay", data);
  },
  getPrepayStatusOrder(data) {
    return request.post("/weapp/sendout/complete/pay", data);
  },

  unSendList(token) {
    return request.get("/weapp/order/skus/unSendList?session=" + token);
  },
  userInfo(token) {
    return request.get("/weapp/userInfo/" + token);
  },
  sendList(token) {
    return request.get("/weapp/order/skus/sendList?session=" + token);
  },
  orderList(token) {
    return request.get("/weapp/order/list?session=" + token);
  },
  addressList(token) {
    return request.get("/weapp/address/list?session=" + token);
  },
  balanceRecords(token) {
    return request.get("/weapp/balance/records/" + token);
  },
  addAddress(data) {
    return request.post("/weapp/address/add", data);
  },
  updateAddress(data) {
    return request.post("/weapp/address/modify", data);
  },
  delAddress(data) {
    return request.post("/weapp/address/del", data);
  },
  sendOrder(data) {
    return request.post("/weapp/order/send", data);
  },
  orderRecovery(data) {
    return request.post("/weapp/order/retrieve", data);
  },
  saveUserInfo(data) {
    return request.post("/weapp/saveUserInfo", data);
  },
  getShare(data) {
    return request.post("/weapp/share", data);
  },
  preSkuRetrieve(data) {
    return request.post("/weapp/order/sku/preRetrieve", data);
  },
  finalSkuRetrieve(data) {
    return request.post("/weapp/order/sku/finalRetrieve", data);
  },
  // 查询是否领取过升级大礼包
  checkCoupons(session) {
    return request.get("/weapp/checkCoupons/" + session);
  },
  // 查询优惠券活动
  getActivity(session) {
    return request.get("/weapp/getActivity/" + session);
  },
  // 绑定升级大礼包优惠券
  bindCounpos(data) {
    return request.post("/weapp/bindCounpos", data);
  },
  //查询可用优惠券信息
  getUserCoupons(data) {
    return request.post("/weapp/getUserCoupons", data);
  },
  //查询新人专享优惠券接口
  getNewUserActivity() {
    return request.get("/weapp/getNewUserActivity");
  },
  //我的优惠券页面
  myCouponList(session) {
    return request.get("/weapp/myCouponList/" + session);
  },
  //查询社群分享活动是否结束接口
  checkCommunal(activity_id) {
    return request.get("/weapp/kujis/checkCommunalSharing/" + activity_id);
  },
  //查询用户是否领取社群分享优惠券
  communalSharing(activity_id, session) {
    return request.get(
      "/weapp/kujis/communalSharing/" + activity_id + "/" + session
    );
  },
  //绑定社群分享优惠券
  bindCommunalSharing(data) {
    return request.post("/weapp/kujis/bindCommunalSharing", data);
  },
  activityList() {
    return request.get("/weapp/getFeatureActivity");
  },
  activityDetail(id, session = "") {
    return request.get(
      `/weapp/getFeatureList/${id}${session ? `/${session}` : ""}`
    );
  },
  joinActivity(data) {
    return request.post(`/weapp/participateInActivities`, data);
  },
  checkIsFreeShipping(data) {
    return request.post(`/weapp/order/checkIsFreeShipping`, data);
  },
  setAdTask(data) {
    return request.post(`/weapp/getAdTask`, data);
  },
  getTaskScore(data) {
    return request.post(`/weapp/getTaskScore`, data);
  },

  /* 一番赏 */
  getYfsList(data) {
    return request.get(
      `/weapp/kujis/yfs_v2/${data.size}/${data.sort}/${data.order}/${data.lastId}`
    );
  },

  removeLineUp(data) {
    return request.post(`/weapp/kujis/removeLineUp`, data);
  },

  addLineUp(data) {
    return request.post(`/weapp/kujis/addLineUp`, data);
  },

  getLineUp(id, session) {
    return request.get(
      `/weapp/kujis/getLineUp/${id}${session ? `/${session}` : ""}`
    );
  },
  getYfsDetail(id) {
    return request.get(`/weapp/kujis/${id}`);
  },
  getYfsPayList(id) {
    return request.get(`/weapp/kujis/${id}/payList`);
  },
  yfsBalancePay(data) {
    return request.post("/weapp/kujis/balance/pay", data);
  },
  yfsPrePay(data) {
    return request.post("/weapp/kujis/prepay", data);
  },
  yfsQueryPay(data) {
    return request.post("/weapp/kujis/query/yfs_pay", data);
  },
  yfsCompletePay(data) {
    return request.post("/weapp/kujis/complete/fudai_pay", data);
  },
  getMessage(page = 1, sesstion) {
    return request.get(`/weapp/kujis/notice_info/${page}/${sesstion}`);
  },
  readMessage(data) {
    return request.post("/weapp/kujis/update_notice", data);
  },
  getFudaiPayList(id, query) {
    return request.get(
      `/weapp/kujis/${id}/fudaiPayList?session=${query.session || ""}&status=${
        query.status || 0
      }&last_id=${query.lastId || 0}`
    );
  },
  getDetail(id, session = "") {
    return request.get(`/weapp/kujis/new_detail/${id}?session=${session}`);
  },
  getWxsUsers(id) {
    return request.get(`/weapp/kujis/wxs_users/${id}`);
  },
};
