common.js 2.38 KB
import http from '../request/http'
const common = 'scrm.api.carlife.common.'
module.exports = {
  /**上传图片
   */
  uploadImg(data) {
    return http.post({
      method: `${common}uploadImg`,
      ...data,
      noSignAttr: ["file"],
    });
  },
  /**视频上传
   */
  uploadVideo(data) {
    return http.post({
      method: `${common}uploadVideo`,
      ...data,
      noSignAttr: ["file"],
    });
  },
  /** 首页、发现列表 搜索接口 */
  search(data) {
    return http.post({
      method: "scrm.api.carlife.weapp.homeSearch.search",
      pageSize: 10,
      ...data,
    });
  },
  /** 根据sap编码获取商户详情 */
  getBySapCode(data) {
    return http.fetch(`scrm.api.carlife.merchant.getBySapCode`,data);
  },
  /**获取图片版本号 */
  getImgVersion() {
    return http.getMock();
  },
  /**手机号验证码登录 */
  phoneSmsLogin(data) {
    return http.fetch('scrm.api.sso.sms.login', {
      source: 'MINIAPP',
      ...data
    })
  },
  /**微信授权手机号登录 */
  authPhoneLogin(data) {
    return http.fetch('scrm.api.sso.weapp.auth.phone', {
      source: 'MINIAPP',
      ...data
    })
  },
  /**获取积分渠道列表 */
  getPointsSourceList(data) {
    return http.fetch('scrm.api.shopmall.score.get.channelSource', {
      ...data
    })
  },
  /**查询积分钱包 */
  getPointsWalletData(data) {
    return http.fetch('scrm.api.shopmall.pointswallet.get', {
      ...data
    })
  },
  /**开通积分钱包 */
  openPointsWallet(data) {
    return http.fetch('scrm.api.shopmall.pointswallet.open', {...data})
  },
  /**替换积分钱包昵称 */
  replaceWalletName(data) {
    return http.fetch('scrm.api.sso.nickName.replace', {...data})
  },
  /**获取积分汇总数据 */
  getPointsSummary(data) {
    return http.fetch('scrm.api.shopmall.score.summary.search', {...data})
  },
  /**获取用户信息 */
  getLoginInfo(data) {
    return http.fetch('scrm.api.sso.weapp.loginfo.get', {...data})
  },
  /**获取门店数据 */
  getMerchantData(data) {
    return http.fetch('scrm.api.shopmall.score.list.merchant', {...data})
  },
  /**进入商品详情页面埋点 */
  dynamicRecordAdd(data) {
    return http.fetch('scrm.api.shopmall.scrm.customer.dynamic.record.add', {...data})
  },
  /**离开商品详情页面埋点 */
  dynamicRecordLeave(data) {
    return http.fetch('scrm.api.shopmall.scrm.customer.dynamic.record.leave', {...data})
  }
};