customer.ts 1.66 KB
import { customerFetch } from '.';

export class LoginParams {
  /** 登陆标识 */
  code?: string;
  /** 账号 */
  loginAccount?: string;
  /** 密码 */
  password?: string;
}
export const appLogin = (data: LoginParams) =>
  customerFetch({
    url: '/dcxy/wechat/applet/login/',
    method: 'POST',
    data: data,
  });

export const appLogout = () =>
  customerFetch({
    url: '/dcxy/wechat/applet/login/out',
  });

export class PwdParams {
  /** 账号 */
  loginAccount: string;
  /** 密码 */
  password: string;
  /** 验证码 */
  verification: string;
}
export const changePwdByCellphone = (data: PwdParams) =>
  customerFetch({
    url: '/app/customer/forget/pwd',
    method: 'POST',
    data: data,
  });

type RegisiterPramas = {};
// type RegisiterReponseData = {};

export const wxUserRegister = (entity: RegisiterPramas) =>
  customerFetch({
    url: '/dcxy/wechat/applet/register/',
    method: 'POST',
    data: entity,
  });

type perfectionCustomerParams = {
  birthDay?: string;
  customerHead?: string;
  customerId: number;
  customerName: string;
  customerSex: string;
  email?: string;
  entranceDate?: string;
  idCard?: string;
  studentNo?: string;
};

export const perfectionUserInfo = (entity: perfectionCustomerParams) =>
  customerFetch({
    url: '/dcxy/wechat/applet/perfection/customer',
    method: 'POST',
    data: entity,
  });

type CustomerParam = {
  areaId: number;
  areaName: string;
  customerId: number;
  customerName: string;
  customerPhone: string;
  feedbackContent: string;
};
export const fetchFeedback = (entity: CustomerParam) =>
  customerFetch({
    url: '/app/customer/feed/back',
    method: 'POST',
    data: entity,
  });