detail.js 2.12 KB
import api from '../../common/api';

export default {
  /**
   * 商品信息
   * @param skn
   * @returns {*}
   */
  productInfo(uid, limitProductCode) {
    let data = {
      method: 'app.limitProduct.limitProductDetail'
    };

    if (uid) {
      data.uid = uid;
    }

    data.limitProductCode = limitProductCode;

    return api.get({
      url: '',
      data
    });
  },

  /**
   * 查询助力信息
   *
   * @param {*} uid
   * @param {*} limitCode
   * @returns
   */
  getAssistInfo(uid, limitCode) {
    return api.get({
      url: '',
      data: {
        userId: uid,
        limitProductCode: limitCode,
        method: 'app.limitProduct.queryHelpInfo'
      }
    });
  },

  /**
   * 增加助力
   *
   * @param {*} params
   * @returns
   */
  addAssist({userId, helpUserId, helpUserName, helpUserImgUrl, limitProductCode}) {
    return api.get({
      url: '',
      data: {
        method: 'app.limitProduct.addHelpUserInfo',
        userId,
        helpUserId,
        helpUserName,
        helpUserImgUrl,
        limitProductCode
      }
    });
  },

  addQueue(userId, activityId, unionId) {
    return api.post({
      url: '',
      data: {
        method: 'app.drawline.addQueueForHelp',
        userId,
        activityId,
        openId: unionId
      }
    });
  },

  /**
   * 分享过该商品,记录一下
   * @param {} uid
   * @param {*} limitProductCode
   */
  addShareAction(userId, limitProductCode) {
    return api.post({
      url: '',
      data: {
        method: 'app.limitProduct.addShareInfo',
        userId,
        limitProductCode,
        isShare: 'Y'
      }
    });
  },

  /**
   * 发限购码
   * @param {*} uid
   * @param {*} limitProductCode
   */
  getLimitCode(userId, limitProductCode) {
    return api.post({
      url: '',
      data: {
        method: 'app.limitcode.addForHelp',
        userId,
        limitProductCode
      }
    });
  },

  getUserInfoByUnionId(name, unionId) {
    return api.get({
      url: '',
      data: {
        nickname: name,
        openId: unionId,
        source_type: 'wechat',
        method: 'app.passport.signinByOpenID'
      }
    });
  }
};