Commit 72200187 by 姜雷

完善部分请求逻辑

parent 7fb9bf61
declare namespace defs {
export class Area {
/** areaName */
areaName?: string;
/** areaType */
areaType?: string;
/** cityIdGroup */
cityIdGroup?: string;
/** cityName */
cityName?: string;
/** createDate */
createDate?: string;
/** director */
director?: string;
/** directorPhone */
directorPhone?: string;
/** hdVersion */
hdVersion?: string;
/** id */
id?: number;
/** initial */
initial?: string;
/** property */
property?: string;
/** rechargeOperateId */
rechargeOperateId?: number;
/** rechargeOperateName */
rechargeOperateName?: string;
/** rechargeOperatePhone */
rechargeOperatePhone?: string;
/** state */
state?: string;
/** updateDate */
updateDate?: string;
}
export class AreaListResp {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.Area[];
/** 具体的错误信息 */
msg?: string;
}
export class AreaNameOrderResp {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.AreaOrderVo[];
/** 具体的错误信息 */
msg?: string;
}
export class AreaOrderVo {
/** 区域名字 */
areaName?: string;
/** 首字母 */
initial?: string;
}
export class AreaResp {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.Area;
/** 具体的错误信息 */
msg?: string;
}
export class AreaSelfServiceVo {
/** 自助服务id */
serviceId?: number;
/** 自助服务名称 */
serviceName?: string;
}
export class AreaSwitch {
/** 区域id */
areaId?: number;
/** id */
id?: number;
/** 是否开启 0未开启 1开启 */
isEnabled?: number;
/** 类型 1咨询开关 2商场开关 */
type?: string;
}
export class AreaSwitchResponse {
/** areaSwitchs */
areaSwitchs?: defs.AreaSwitch[];
/** 响应码,非1000均表示出错 */
code?: number;
/** 具体的错误信息 */
msg?: string;
}
export class CallPayInfo {
/** outTradeNo */
outTradeNo?: string;
/** payStr */
payStr?: string;
}
export class CallPayResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.CallPayInfo;
/** 具体的错误信息 */
msg?: string;
}
export class CreditDepositResponse {
/** 金额 */
amount?: number;
/** 区域id */
areaId?: number;
/** 运营商id */
operateId?: number;
/** 展示类型 1授信额度 2保证金 */
showType?: string;
}
export class DeviceLoginConfResponse {
/** 是否关闭 1:是;0:否 */
isClose?: number;
}
export class DoActiveParam {
/** 支付活动id */
activeId?: number;
/** 活动处理结束回调api */
callbackApi?: string;
/** 会员id */
customerId?: number;
/** 订单id */
orderId?: number;
}
export class OperationModeConfResponse {
/** 运营模式 1授信 2保证金 3传统 */
mode?: string;
}
export class PayOrderQueryParams {
/** 运营商ID */
operateId?: number;
/** 交易订单号 */
outTradeNo?: string;
/** 支付时间 */
payDate?: string;
/** 支付类型:2、微信支付;3、支付宝支付;4、京东支付;5:招行一网通支付 */
payType?: string;
}
export class PayOrderQueryResponse {
/** 交易状态0、失败;1、成功 */
state?: number;
/** 交易状态描述 */
stateDes?: string;
}
export class PaymentAndActiveInfo {
/** 支付活动id */
activeId?: number;
/** 支付活动说明 */
avtiveComment?: string;
/** 抵扣比例 0-1之间的小数 */
deductionValue?: number;
/** 是否豆抵扣 1:是;0:否 */
isDeduction?: number;
/** 支付类型 */
payType?: string;
/** 支付类型名称 */
payTypeName?: string;
/** 支付版本 */
payVersion?: string;
}
export class PaymentAndActiveVo {
/** 支付配置与对应的活动明细 */
paymentAndActiveInfos?: defs.PaymentAndActiveInfo[];
/** 支付配置id */
paymentConfId?: number;
}
export class QnTokenResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.QntokenData;
/** 具体的错误信息 */
msg?: string;
}
export class QntokenData {
/** token */
token?: string;
}
export class ServerDataResponse<T0 = any> {
/** 响应码,非1000均表示出错 */
code?: number;
/** 响应数据体 */
data?: T0[];
/** 具体的错误信息 */
msg?: string;
}
export class ServerResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** 具体的错误信息 */
msg?: string;
}
export class ServiceEntity {
/** comment */
comment?: string;
/** createDate */
createDate?: string;
/** id */
id?: number;
/** selfSerId */
selfSerId?: number;
/** serviceName */
serviceName?: string;
/** serviceType */
serviceType?: string;
/** state */
state?: string;
/** updateDate */
updateDate?: string;
}
export class ServiceResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.ServiceEntity;
/** 具体的错误信息 */
msg?: string;
}
export class SingleOrderJsonResponseData {
/** charset */
charset?: string;
/** rspData */
rspData?: defs.SingleOrderRspData;
/** version */
version?: string;
}
export class SingleOrderRspData {
/** bankDate */
bankDate?: string;
/** bankSerialNo */
bankSerialNo?: string;
/** bankTime */
bankTime?: string;
/** branchNo */
branchNo?: string;
/** cardType */
cardType?: string;
/** currency */
currency?: string;
/** date */
date?: string;
/** dateTime */
dateTime?: string;
/** discountAmount */
discountAmount?: string;
/** fee */
fee?: string;
/** merchantNo */
merchantNo?: string;
/** merchantPara */
merchantPara?: string;
/** orderAmount */
orderAmount?: string;
/** orderNo */
orderNo?: string;
/** orderStatus */
orderStatus?: string;
/** rspCode */
rspCode?: string;
/** rspMsg */
rspMsg?: string;
/** settleAmount */
settleAmount?: string;
/** settleDate */
settleDate?: string;
/** settleTime */
settleTime?: string;
}
}
declare namespace API {
/**
* 区域接口
*/
export namespace area {
/**
* 根据区域id查询区域
* /area/queryArea
*/
export namespace queryArea {
export class Params {
/** id */
id: number;
}
export type Response = defs.AreaResp;
export const init: Response;
export function request(params: Params): Promise<defs.AreaResp>;
}
/**
* 查询区域
* /area/queryAreaList
*/
export namespace queryAreaList {
export class Params {}
export type Response = defs.AreaListResp;
export const init: Response;
export function request(params: Params): Promise<defs.AreaListResp>;
}
/**
* 首字母排序查询校区
* /area/queryOrderList
*/
export namespace queryOrderList {
export class Params {}
export type Response = defs.AreaNameOrderResp;
export const init: Response;
export function request(params: Params): Promise<defs.AreaNameOrderResp>;
}
/**
* 获取校区开关接口
* /area/switchs
*/
export namespace getByAreaAndOperator {
export class Params {
/** 区域id */
areaId: number;
}
export type Response = defs.AreaSwitchResponse;
export const init: Response;
export function request(params: Params): Promise<defs.AreaSwitchResponse>;
}
}
/**
* 公共接口
*/
export namespace common {
/**
* 删除七牛图片
* /common/deleteFiles
*/
export namespace deleteFiles {
export class Params {
/** fileNames */
fileNames: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 获取七牛的token
* /common/getQNToken
*/
export namespace getQNToken {
export class Params {}
export type Response = defs.QnTokenResponse;
export const init: Response;
export function request(params: Params): Promise<defs.QnTokenResponse>;
}
/**
* 招商一网通支付成功通知API
* /common/pay/ZsNetcomNotify
*/
export namespace zsNetcomNotify {
export class Params {
/** jsonRequestData */
jsonRequestData: string;
}
export type Response = any;
export const init: Response;
export function request(params: Params): Promise<any>;
}
/**
* 招商一网通支付订单状态查询接口
* /common/pay/ZsNetcomOrderState
*/
export namespace queryZsNetcomOrderState {
export class Params {
/** 交易号 */
outTradeNo?: string;
/** 交易日期 yyyyMMdd */
date?: string;
}
export type Response = defs.SingleOrderJsonResponseData;
export const init: Response;
export function request(
params: Params,
): Promise<defs.SingleOrderJsonResponseData>;
}
/**
* 招商一网通签约通知API
* /common/pay/ZsNetcomSignNotify
*/
export namespace ZsNetcomSignNotify {
export class Params {
/** jsonRequestData */
jsonRequestData: string;
}
export type Response = any;
export const init: Response;
export function request(params: Params): Promise<any>;
}
/**
* alipayNotifyBack
* /common/pay/aliNotify
*/
export namespace alipayNotifyBack {
export class Params {}
export type Response = any;
export const init: Response;
export function request(params: Params): Promise<any>;
}
/**
* 获取呼起第三方支付信息接口
* /common/pay/getCallThridPayInfo
*/
export namespace getCallThridPayInfo {
export class Params {
/** 会员ID */
customerId: number;
/** 商户平台订单编号 */
orderNo: string;
/** 支付类型(微信支付(2), 支付宝支付(3), 京东支付(4)) */
payType: string;
/** 支付金额 */
money: number;
/** 运营商ID */
operateId: number;
/** 区域ID */
areaId: number;
/** 服务id */
serviceId: number;
/** 支付标题 */
payTitle?: string;
/** 呼起方式 1:原生、2:APP-H5 */
callType: string;
/** 返回地址 */
returnUrl: string;
/** 业务回调地址 */
businessCallURL: string;
/** 业务回调所需参数,JSON格式的字符串 */
businessCallURLParams: string;
}
export type Response = defs.CallPayResponse;
export const init: Response;
export function request(params: Params): Promise<defs.CallPayResponse>;
}
/**
* jdpayNotify
* /common/pay/jdpayNotify
*/
export namespace jdpayNotify {
export class Params {
/** merchantId */
merchantId: string;
/** tradeNum */
tradeNum: string;
}
export type Response = string;
export const init: Response;
export function request(params: Params): Promise<string>;
}
/**
* 统一平台支付订单状态查询接口
* /common/pay/orderState
*/
export namespace queryOrderState {
export class Params {}
export type Response = defs.PayOrderQueryResponse;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.PayOrderQueryParams,
): Promise<defs.PayOrderQueryResponse>;
}
/**
* wxpayNotifyBack
* /common/pay/wxNotify
*/
export namespace wxpayNotifyBack {
export class Params {}
export type Response = string;
export const init: Response;
export function request(params: Params): Promise<string>;
}
}
/**
* 招行授信保证金
*/
export namespace creditDeposit {
/**
* 招行授信保证金查询接口
* /dcxy/api/creditDeposits
*/
export namespace get {
export class Params {
/** 区域id */
areaId: number;
}
export type Response = defs.ServerDataResponse<
defs.CreditDepositResponse
>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<defs.CreditDepositResponse>>;
}
}
/**
* 招行设备登录配置
*/
export namespace deviceLoginConf {
/**
* 招行设备登录配置查询接口
* /dcxy/api/deviceLoginConfs
*/
export namespace get {
export class Params {
/** 区域id */
areaId: number;
/** 运营商id */
operateId: number;
/** 服务类型id */
serviceId: number;
}
export type Response = defs.ServerDataResponse<
defs.DeviceLoginConfResponse
>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<defs.DeviceLoginConfResponse>>;
}
}
/**
* 运营模式配置
*/
export namespace operationModeConf {
/**
* 运营模式配置查询接口
* /dcxy/api/operationModeConf
*/
export namespace getByArea {
export class Params {
/** 区域id */
areaId: number;
}
export type Response = defs.ServerDataResponse<
defs.OperationModeConfResponse
>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<defs.OperationModeConfResponse>>;
}
}
/**
* 支付活动配置
*/
export namespace paymentAndActive {
/**
* 支付活动配置查询接口
* /dcxy/api/paymentAndActiveConf
*/
export namespace get {
export class Params {
/** 会员id */
customerId: string;
/** 运营商id */
operatorId: number;
/** 区域id */
areaId: number;
/** 会员类型 */
customerType: string;
/** 服务id */
serviceId: number;
/** 运营模式 1:先消费豆后消费艾米;0:先消费艾米后消费豆;2:只消费艾米 */
operationMode: number;
}
export type Response = defs.ServerDataResponse<defs.PaymentAndActiveVo>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<defs.PaymentAndActiveVo>>;
}
/**
* 支付活动接口
* /dcxy/api/paymentAndActiveConf/doActive
*/
export namespace doActive {
export class Params {}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.DoActiveParam,
): Promise<defs.ServerResponse>;
}
}
/**
* 自助服务API
*/
export namespace service {
/**
* 获取区域下的自助服务接口
* /dcxy/api/base/service
*/
export namespace get {
export class Params {
/** 服务id */
serviceId: number;
}
export type Response = defs.ServiceResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServiceResponse>;
}
/**
* 获取所有/自助/三方服务接口
* /dcxy/api/base/service/all/about/service
*/
export namespace allSelfService {
export class Params {
/** 登陆标识 */
token?: string;
/** 服务类型:null所有/1自助/2三方 */
serviceType?: string;
}
export type Response = defs.ServerDataResponse<Array<defs.ServiceEntity>>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<Array<defs.ServiceEntity>>>;
}
/**
* 获取区域下的自助服务接口
* /dcxy/api/base/service/selfservice
*/
export namespace allSelfServiceByArea {
export class Params {
/** areaId */
areaId?: number;
}
export type Response = defs.ServerDataResponse<
Array<defs.AreaSelfServiceVo>
>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<Array<defs.AreaSelfServiceVo>>>;
}
}
}
declare namespace defs {
export class AccountParams {
/** 区域id */
areaId?: number;
/** 会员电话 */
customerPhone?: string;
/** 会员id */
id?: number;
/** 服务id */
serviceIdList?: any[];
}
export class AppRechargeAccountSynchronizationParameters {
/** 豆金额 */
beanMoney?: number;
/** 会员id */
customerId?: number;
/** 操作人 */
handler?: string;
/** 艾米金额 */
money?: number;
/** 订单号 */
orderNum?: string;
/** 支付类型 */
payType?: string;
/** 服务类型id */
serviceId?: number;
}
export class BaseDataVo {
/** name */
name?: string;
/** value */
value?: string;
}
export class ConsumeOrder {
/** 实付金额 */
actualMoney?: number;
/** 区域id */
areaId?: number;
/** 区域名称 */
areaName?: string;
/** 消费类型 1专用豆 2艾米币 3通用豆 4混合消费 */
consumeType?: string;
/** 消费时间 */
createAt?: string;
/** 会员电话 */
customerCellphone?: string;
/** 会员id */
customerId?: number;
/** 会员名称 */
customerName?: string;
/** 抵扣豆 */
deductionBean?: number;
/** 抵扣金额 */
deductionMoney?: number;
/** 设备编号 */
equipmentNum?: string;
/** 设备位置 */
equipmentPosition?: string;
/** 主键id */
id?: number;
/** 运营商id */
operateId?: number;
/** 运营商名称 */
operateName?: string;
/** 运营模式 1:先消费豆后消费艾米;0:先消费艾米后消费豆;2:只消费艾米 */
operationMode?: string;
/** 订单名称 */
orderName?: string;
/** 订单编号 */
orderNumber?: string;
/** 订单状态 1未支付 2已支付 */
orderState?: string;
/** 上传交易号 */
outTradeNo?: string;
/** 支付类型(1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付 6:艾米币 7:专用豆 8通用豆) */
payType?: string;
/** 应付金额 */
payableMoney?: number;
/** 服务id */
serviceId?: number;
/** 服务名称 */
serviceName?: string;
/** 第三方优惠金额 */
thirdDiscountMoney?: number;
/** 第三方交易单号 */
thirdTradeNumber?: string;
/** 更新时间 */
updateDate?: string;
}
export class ConsumeOrderDeductionInfoResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** 订单抵扣信息 */
data?: defs.ConsumeOrderDeductionInfoVo;
/** 具体的错误信息 */
msg?: string;
}
export class ConsumeOrderDeductionInfoVo {
/** 艾米余额 */
amiAccount?: number;
/** 豆余额 */
beanAccount?: number;
/** 抵扣金额 */
deductionMoney?: number;
/** 抵扣类型:1专项豆抵扣、2通用豆抵扣、3艾米抵扣 */
deductionType?: string;
/** 订单金额 */
orderMoney?: number;
/** 支付金额 */
payMoney?: number;
/** 支付类型(1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付 6:艾米币 7:专用豆 8通用豆) */
payType?: string;
/** 结余金额 */
remainAccount?: number;
/** 标题前缀 */
titlePerfix?: string;
}
export class ConsumeOrderDetailAndPayResponse {
/** accounts */
accounts?: defs.CustomerBeanAccountVo[];
/** 响应码,非1000均表示出错 */
code?: number;
/** 具体的错误信息 */
msg?: string;
/** orderInfo */
orderInfo?: defs.ConsumeOrder;
/** payInfos */
payInfos?: defs.PaymentAndActiveVo;
}
export class ConsumeOrderDetailResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.ConsumeOrder;
/** 具体的错误信息 */
msg?: string;
}
export class ConsumeOrderGroupData {
/** data */
data?: defs.ConsumeOrder[];
/** groupName */
groupName?: string;
}
export class ConsumeOrderGroupResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.ConsumeOrderGroupData[];
/** 具体的错误信息 */
msg?: string;
}
export class ConsumeOrderPayInfoResponse {
/** 是否呼起支付 0否,1是 */
canCall?: number;
/** 响应码,非1000均表示出错 */
code?: number;
/** 具体的错误信息 */
msg?: string;
/** 商户交易订单号 */
outTradeNo?: string;
/** 当canCall为1时,APP需要的支付串信息 */
payStr?: string;
}
export class ConsumeOrderResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.ConsumeOrder[];
/** 具体的错误信息 */
msg?: string;
}
export class ConsumeOrderSingleResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.ConsumeOrder;
/** 具体的错误信息 */
msg?: string;
}
export class ConsumeOrderStateResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** 具体的错误信息 */
msg?: string;
/** rspCode */
rspCode?: string;
/** rspMsg */
rspMsg?: string;
}
export class Customer {
/** areaId */
areaId?: number;
/** areaName */
areaName?: string;
/** createAt */
createAt?: string;
/** customerHead */
customerHead?: string;
/** customerName */
customerName?: string;
/** customerPhone */
customerPhone?: string;
/** customerSex */
customerSex?: string;
/** customerType */
customerType?: string;
/** email */
email?: string;
/** id */
id?: number;
/** isFirstRecharge */
isFirstRecharge?: number;
/** state */
state?: string;
/** updateAt */
updateAt?: string;
}
export class CustomerAccountResp {
/** 响应码,非1000均表示出错 */
code?: number;
/** 响应数据体 */
data?: defs.CustomerBeanAccountVo[];
/** 具体的错误信息 */
msg?: string;
}
export class CustomerAndAccountData {
/** 服务豆余额 */
bean?: number;
/** campusId */
campusId?: number;
/** cellphone */
cellphone?: string;
/** 硬件账号 */
hardwareAccount?: string;
/** id */
id?: number;
/** 余额 */
mony?: number;
/** name */
name?: string;
/** 运营模式,1授信 2保证金 3传统 */
operationMode?: string;
/** schoolId */
schoolId?: number;
/** state */
state?: string;
/** studentNo */
studentNo?: string;
/** type */
type?: string;
}
export class CustomerAndAccountResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** data */
data?: defs.CustomerAndAccountData;
/** 具体的错误信息 */
msg?: string;
}
export class CustomerBaseResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** 响应数据体 */
data?: defs.Customer;
/** 具体的错误信息 */
msg?: string;
}
export class CustomerBeanAccountVo {
/** money */
money?: number;
/** serviceId */
serviceId?: string;
}
export class CustomerParams {
/** 区域id */
areaId?: number;
/** 区域名称 */
areaName?: string;
/** 出生年月 */
birthDay?: string;
/** 会员昵称 */
customerName?: string;
/** 会员联系方式 */
customerPhone?: string;
/** 会员性别 */
customerSex?: string;
/** 会员类别 1学生 2教师 3职工 4群众 5社区领导 6学校领导 7单位领导 */
customerType?: string;
/** 入学时间 */
entranceDate?: string;
/** 操作人 */
handler?: string;
/** 设备登录账号 */
hardwareAccount?: string;
/** 设备登录密码 */
hardwarePwd?: string;
/** 会员ID */
id?: number;
/** 会员条码 */
idBar?: string;
/** 身份证号 */
idCard?: string;
/** 操作类型 */
operType?: string;
/** app密码 */
password?: string;
/** 学生证号 */
studentNo?: string;
}
export class GivenInfosResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** givenInfos */
givenInfos?: any[];
/** 具体的错误信息 */
msg?: string;
}
export class LoginInfoVo {
/** areaId */
areaId?: number;
/** areaName */
areaName?: string;
/** birthDay */
birthDay?: string;
/** createAt */
createAt?: string;
/** createLoginDate */
createLoginDate?: string;
/** customerHead */
customerHead?: string;
/** customerId */
customerId?: number;
/** customerName */
customerName?: string;
/** customerPhone */
customerPhone?: string;
/** customerSex */
customerSex?: string;
/** customerType */
customerType?: string;
/** email */
email?: string;
/** entranceDate */
entranceDate?: string;
/** hardwareAccount */
hardwareAccount?: string;
/** hardwarePwd */
hardwarePwd?: string;
/** hardwareState */
hardwareState?: string;
/** hardwarelastDate */
hardwarelastDate?: string;
/** idBar */
idBar?: string;
/** idCard */
idCard?: string;
/** isFirstRecharge */
isFirstRecharge?: number;
/** lastLoginDate */
lastLoginDate?: string;
/** loginAccount */
loginAccount?: string;
/** loginPwd */
loginPwd?: string;
/** loginPwdSalt */
loginPwdSalt?: string;
/** loginState */
loginState?: string;
/** state */
state?: string;
/** studentNo */
studentNo?: string;
/** token */
token?: string;
/** updateAt */
updateAt?: string;
/** updateLoginDate */
updateLoginDate?: string;
/** version */
version?: string;
}
export class SelfConsumptionFlowSynchronizationParameter {
/** 消费艾米币 */
aimiMoney?: number;
/** 区域id */
areaId?: number;
/** 区域名称 */
areaName?: string;
/** 消费豆 */
beanCount?: number;
/** 通用豆 */
currencyBean?: number;
/** 会员电话 */
customerCellphone?: string;
/** 会员id */
customerId?: number;
/** 会员名称 */
customerName?: string;
/** 设备编号 */
equipmentNum?: string;
/** 设备位置 */
equipmentPosition?: string;
/** 运营商id */
operateId?: number;
/** 运营商名称 */
operateName?: string;
/** 服务id */
serviceId?: number;
/** 服务名称 */
serviceName?: string;
}
export class UnpaidConsumeOrderResponse {
/** 响应码,非1000均表示出错 */
code?: number;
/** 具体的错误信息 */
msg?: string;
/** orderId */
orderId?: number;
/** title */
title?: string;
}
}
declare namespace API {
/**
* APP和新系统对接接口
*/
export namespace appLoginInfo {
/**
* 更换手机账户接口
* /app/customer/account/{customerId}/{phoneAccount}/{password}
*/
export namespace updatePhoneAccount {
export class Params {
/** 会员号 */
customerId: string;
/** 账号 */
phoneAccount: string;
/** 密码 */
password: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* app忘记密码修改接口
* /app/customer/apwd/{loginAccount}/{password}/{verification}
*/
export namespace appPasswordUpdate {
export class Params {
/** 账号 */
loginAccount: string;
/** 密码 */
password: string;
/** 验证码 */
verification: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 检查电话号码是否被注册接口
* /app/customer/check/register
*/
export namespace checkWhetherRegister {
export class Params {
/** 电话号码 */
phoneAccount: string;
}
export type Response = defs.ServerDataResponse<boolean>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<boolean>>;
}
/**
* 设备密码修改接口
* /app/customer/hpwd/{customerId}/{password}
*/
export namespace hardwarePwdUpdate {
export class Params {
/** 账号 */
customerId: string;
/** 密码 */
password: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 知道密码的修改接口
* /app/customer/kpwd/{loginAccount}/{password}/{oldPassword}
*/
export namespace updateAppPwd {
export class Params {
/** loginAccount */
loginAccount: number;
/** 会员ID */
customerId: any;
/** 密码 */
password: string;
/** 密码 */
oldPassword: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* APP登录接口
* /app/customer/login
*/
export namespace appLogin {
export class Params {
/** 登陆标识 */
token?: string;
/** 账号 */
loginAccount?: string;
/** 密码 */
passWord?: string;
}
export type Response = defs.ServerDataResponse<defs.LoginInfoVo>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<defs.LoginInfoVo>>;
}
/**
* APP退出接口
* /app/customer/login/out
*/
export namespace appLoginOut {
export class Params {
/** 登陆标识 */
token: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 注册APP接口
* /app/customer/register
*/
export namespace appRegister {
export class Params {
/** 会员ID */
id?: number;
/** 会员昵称 */
customerName: string;
/** 会员联系方式 */
customerPhone: string;
/** 会员性别 1男 2女 */
customerSex: string;
/** 会员类别 1学生 2教师 3职工 4群众 5社区领导 6学校领导 7单位领导 */
customerType: string;
/** 区域id */
areaId: number;
/** 区域名称 */
areaName: string;
/** 出生年月 */
birthDay?: string;
/** 入学时间 */
entranceDate?: string;
/** 身份证号 */
idCard?: string;
/** 学生证号 */
studentNo?: string;
/** app密码 */
password: string;
/** 会员头像 */
customerHead?: string;
/** email */
email?: string;
/** 校区 */
campusId: number;
/** 短信验证码 */
verificationCode: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 开/关设备登陆密码接口
* /app/customer/switch/{customerId}/{state}
*/
export namespace switchPwd {
export class Params {
/** state */
state: string;
/** 密码 */
password?: any;
/** 会员号 */
customerId: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
}
/**
* 自助消费流水
*/
export namespace consume {
/**
* get的测试方法
* /consume/getTest/{id}
*/
export namespace getTest {
export class Params {
/** id */
id: string;
/** name */
name: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 消费流水同步
* /consume/synchronize
*/
export namespace synConsumer {
export class Params {}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.SelfConsumptionFlowSynchronizationParameter,
): Promise<defs.ServerResponse>;
}
}
/**
* 消费订单
*/
export namespace consumeOrder {
/**
* 确定支付接口
* /consumeOrder/confirmPay
*/
export namespace confirmPay {
export class Params {
/** 订单id */
orderId?: number;
/** 支付类型1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付6:艾米币 7:服务豆 */
payType?: string;
/** 活动id */
activeId?: number;
/** 呼起方式 1:原生、2:APP-H5 */
callType?: string;
/** 一网通支付需要的返回路径 */
returnUrl?: string;
/** 支付配置ID */
paymentConfId?: number;
}
export type Response = defs.ConsumeOrderPayInfoResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderPayInfoResponse>;
}
/**
* 创建消费订单
* /consumeOrder/create
*/
export namespace create {
export class Params {}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.ConsumeOrder,
): Promise<defs.ServerResponse>;
}
/**
* 获取订单抵扣信息
* /consumeOrder/getDeductionInfo
*/
export namespace getDeductionInfo {
export class Params {
/** 订单id */
orderId?: number;
/** 支付类型1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付6:艾米币 7:服务豆 */
payType?: string;
/** 支付配置ID */
paymentConfId?: number;
}
export type Response = defs.ConsumeOrderDeductionInfoResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderDeductionInfoResponse>;
}
/**
* 获取订单详情信息
* /consumeOrder/getDetail
*/
export namespace getDetail {
export class Params {
/** 订单id */
id?: number;
}
export type Response = defs.ConsumeOrderDetailResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderDetailResponse>;
}
/**
* 获取赠送记录滚动
* /consumeOrder/getGivenInfos
*/
export namespace getGivenInfos {
export class Params {
/** 区域ID */
areaId?: number;
}
export type Response = defs.GivenInfosResponse;
export const init: Response;
export function request(params: Params): Promise<defs.GivenInfosResponse>;
}
/**
* 获取订单详情和支付信息
* /consumeOrder/getOrderDetailAndPay
*/
export namespace getOrderDetailAndPay {
export class Params {
/** 订单id */
id?: number;
}
export type Response = defs.ConsumeOrderDetailAndPayResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderDetailAndPayResponse>;
}
/**
* 获取未支付订单信息
* /consumeOrder/getUnpaidOrder
*/
export namespace getUnpaidOrder {
export class Params {
/** 会员id */
customerId?: number;
}
export type Response = defs.UnpaidConsumeOrderResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.UnpaidConsumeOrderResponse>;
}
/**
* 消费订单全部分组分页查询
* /consumeOrder/pageAllList
*/
export namespace pageAllList {
export class Params {
/** 会员id */
customerId: number;
/** 最后一页最后一条订单ID */
lastOrderId?: number;
/** 每页条数 */
pageSize?: number;
}
export type Response = defs.ConsumeOrderGroupResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderGroupResponse>;
}
/**
* 消费订单分页查询
* /consumeOrder/pageList
*/
export namespace pageList {
export class Params {
/** 会员id */
customerId: number;
/** 订单状态 1未支付 2已支付 为空时查询的全部 */
orderState?: string;
/** 最后一页最后一条订单ID */
lastOrderId?: number;
/** 每页条数 */
pageSize?: number;
}
export type Response = defs.ConsumeOrderResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderResponse>;
}
/**
* 支付成功接口
* /consumeOrder/paySuccess
*/
export namespace paySuccess {
export class Params {
/** 订单id */
orderId?: number;
/** 支付类型1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付6:艾米币 7:服务豆 */
payType?: string;
/** 活动id */
activeId?: number;
/** 支付配置ID */
paymentConfId?: number;
/** 支付平台唯一交易号 */
tradNo?: string;
/** 平台优化金额 */
discountAmount?: number;
/** 商户平台交易号 */
outTradeNo?: string;
}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(params: Params): Promise<defs.ServerResponse>;
}
/**
* 获取支付状态
* /consumeOrder/queryPayState
*/
export namespace queryPayState {
export class Params {
/** 内部交易号 */
outTradeNo?: string;
}
export type Response = defs.ConsumeOrderStateResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ConsumeOrderStateResponse>;
}
/**
* 同步订单
* /consumeOrder/synOrder
*/
export namespace synOrder {
export class Params {}
export type Response = defs.ConsumeOrderSingleResponse;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.ConsumeOrder,
): Promise<defs.ConsumeOrderSingleResponse>;
}
}
/**
* 会员信息
*/
export namespace customer {
/**
* 根据手机号获取会员信息
* /dcxy/customerInfo/getCustomerByPhone
*/
export namespace getCustomerByPhone {
export class Params {
/** customerPhone */
customerPhone: string;
}
export type Response = defs.CustomerBaseResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.CustomerBaseResponse>;
}
/**
* 会员信息同步新增接口
* /dcxy/customerInfo/synchronous
*/
export namespace addCustomerFromOldSys {
export class Params {}
export type Response = defs.ServerResponse;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.CustomerParams,
): Promise<defs.ServerResponse>;
}
}
/**
* 会员账户详情
*/
export namespace customerAccount {
/**
* queryAccount
* /customerAccount/queryAccount
*/
export namespace queryAccount {
export class Params {}
export type Response = defs.CustomerAccountResp;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.AccountParams,
): Promise<defs.CustomerAccountResp>;
}
/**
* syanRechage
* /customerAccount/syanRechage
*/
export namespace syanRechage {
export class Params {}
export type Response = any;
export const init: Response;
export function request(
params: Params,
bodyParams: defs.AppRechargeAccountSynchronizationParameters,
): Promise<any>;
}
}
/**
* 会员类型
*/
export namespace customerType {
/**
* 会员类型查询接口
* /dcxy/api/customerType
*/
export namespace list {
export class Params {}
export type Response = defs.ServerDataResponse<Array<defs.BaseDataVo>>;
export const init: Response;
export function request(
params: Params,
): Promise<defs.ServerDataResponse<Array<defs.BaseDataVo>>>;
}
}
/**
* 硬件对接接口
*/
export namespace hardware {
/**
* 根据条码获取用户信息及资金账户余额
* /dcxy/hardware/barcodelogin
*/
export namespace barcodeLogin {
export class Params {
/** 订单id */
barcode?: string;
/** 区域id */
areaId?: number;
/** 服务id */
serviceId?: number;
}
export type Response = defs.CustomerAndAccountResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.CustomerAndAccountResponse>;
}
/**
* 硬件账号密码登陆,获取会员账户信息和基础信息
* /dcxy/hardware/login
*/
export namespace hardwareLogin {
export class Params {
/** 硬件账号 */
account: string;
/** 登陆密码 */
password: string;
/** 服务ID */
serviceId: number;
/** 校区id */
campusId: number;
}
export type Response = defs.CustomerAndAccountResponse;
export const init: Response;
export function request(
params: Params,
): Promise<defs.CustomerAndAccountResponse>;
}
}
}
import { baseFetch } from './index';
export const fetchAllArea = () =>
baseFetch({
url: '/area/queryAreaList',
});
export class AccountParams {
/** 区域id */
areaId = undefined;
/** 会员电话 */
customerPhone = '';
/** 会员id */
id = undefined;
/** 服务id */
serviceIdList = [];
}
export class AppRechargeAccountSynchronizationParameters {
/** 豆金额 */
beanMoney = undefined;
/** 会员id */
customerId = undefined;
/** 操作人 */
handler = '';
/** 艾米金额 */
money = undefined;
/** 订单号 */
orderNum = '';
/** 支付类型 */
payType = '';
/** 服务类型id */
serviceId = undefined;
}
export class BaseDataVo {
/** name */
name = '';
/** value */
value = '';
}
export class ConsumeOrder {
/** 实付金额 */
actualMoney = undefined;
/** 区域id */
areaId = undefined;
/** 区域名称 */
areaName = '';
/** 消费类型 1专用豆 2艾米币 3通用豆 4混合消费 */
consumeType = '';
/** 消费时间 */
createAt = '';
/** 会员电话 */
customerCellphone = '';
/** 会员id */
customerId = undefined;
/** 会员名称 */
customerName = '';
/** 抵扣豆 */
deductionBean = undefined;
/** 抵扣金额 */
deductionMoney = undefined;
/** 设备编号 */
equipmentNum = '';
/** 设备位置 */
equipmentPosition = '';
/** 主键id */
id = undefined;
/** 运营商id */
operateId = undefined;
/** 运营商名称 */
operateName = '';
/** 运营模式 1:先消费豆后消费艾米;0:先消费艾米后消费豆;2:只消费艾米 */
operationMode = '';
/** 订单名称 */
orderName = '';
/** 订单编号 */
orderNumber = '';
/** 订单状态 1未支付 2已支付 */
orderState = '';
/** 上传交易号 */
outTradeNo = '';
/** 支付类型(1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付 6:艾米币 7:专用豆 8通用豆) */
payType = '';
/** 应付金额 */
payableMoney = undefined;
/** 服务id */
serviceId = undefined;
/** 服务名称 */
serviceName = '';
/** 第三方优惠金额 */
thirdDiscountMoney = undefined;
/** 第三方交易单号 */
thirdTradeNumber = '';
/** 更新时间 */
updateDate = '';
}
export class ConsumeOrderDeductionInfoResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 订单抵扣信息 */
data = new ConsumeOrderDeductionInfoVo();
/** 具体的错误信息 */
msg = '';
}
export class ConsumeOrderDeductionInfoVo {
/** 艾米余额 */
amiAccount = undefined;
/** 豆余额 */
beanAccount = undefined;
/** 抵扣金额 */
deductionMoney = undefined;
/** 抵扣类型:1专项豆抵扣、2通用豆抵扣、3艾米抵扣 */
deductionType = '';
/** 订单金额 */
orderMoney = undefined;
/** 支付金额 */
payMoney = undefined;
/** 支付类型(1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付 6:艾米币 7:专用豆 8通用豆) */
payType = '';
/** 结余金额 */
remainAccount = undefined;
/** 标题前缀 */
titlePerfix = '';
}
export class ConsumeOrderDetailAndPayResponse {
/** accounts */
accounts = [];
/** 响应码,非1000均表示出错 */
code = undefined;
/** 具体的错误信息 */
msg = '';
/** orderInfo */
orderInfo = new ConsumeOrder();
/** payInfos */
payInfos = new PaymentAndActiveVo();
}
export class ConsumeOrderDetailResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new ConsumeOrder();
/** 具体的错误信息 */
msg = '';
}
export class ConsumeOrderGroupData {
/** data */
data = [];
/** groupName */
groupName = '';
}
export class ConsumeOrderGroupResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = [];
/** 具体的错误信息 */
msg = '';
}
export class ConsumeOrderPayInfoResponse {
/** 是否呼起支付 0否,1是 */
canCall = undefined;
/** 响应码,非1000均表示出错 */
code = undefined;
/** 具体的错误信息 */
msg = '';
/** 商户交易订单号 */
outTradeNo = '';
/** 当canCall为1时,APP需要的支付串信息 */
payStr = '';
}
export class ConsumeOrderResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = [];
/** 具体的错误信息 */
msg = '';
}
export class ConsumeOrderSingleResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new ConsumeOrder();
/** 具体的错误信息 */
msg = '';
}
export class ConsumeOrderStateResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 具体的错误信息 */
msg = '';
/** rspCode */
rspCode = '';
/** rspMsg */
rspMsg = '';
}
export class Customer {
/** areaId */
areaId = undefined;
/** areaName */
areaName = '';
/** createAt */
createAt = '';
/** customerHead */
customerHead = '';
/** customerName */
customerName = '';
/** customerPhone */
customerPhone = '';
/** customerSex */
customerSex = '';
/** customerType */
customerType = '';
/** email */
email = '';
/** id */
id = undefined;
/** isFirstRecharge */
isFirstRecharge = undefined;
/** state */
state = '';
/** updateAt */
updateAt = '';
}
export class CustomerAccountResp {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 响应数据体 */
data = [];
/** 具体的错误信息 */
msg = '';
}
export class CustomerAndAccountData {
/** 服务豆余额 */
bean = undefined;
/** campusId */
campusId = undefined;
/** cellphone */
cellphone = '';
/** 硬件账号 */
hardwareAccount = '';
/** id */
id = undefined;
/** 余额 */
mony = undefined;
/** name */
name = '';
/** 运营模式,1授信 2保证金 3传统 */
operationMode = '';
/** schoolId */
schoolId = undefined;
/** state */
state = '';
/** studentNo */
studentNo = '';
/** type */
type = '';
}
export class CustomerAndAccountResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new CustomerAndAccountData();
/** 具体的错误信息 */
msg = '';
}
export class CustomerBaseResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 响应数据体 */
data = new Customer();
/** 具体的错误信息 */
msg = '';
}
export class CustomerBeanAccountVo {
/** money */
money = undefined;
/** serviceId */
serviceId = '';
}
export class CustomerParams {
/** 区域id */
areaId = undefined;
/** 区域名称 */
areaName = '';
/** 出生年月 */
birthDay = '';
/** 会员昵称 */
customerName = '';
/** 会员联系方式 */
customerPhone = '';
/** 会员性别 */
customerSex = '';
/** 会员类别 1学生 2教师 3职工 4群众 5社区领导 6学校领导 7单位领导 */
customerType = '';
/** 入学时间 */
entranceDate = '';
/** 操作人 */
handler = '';
/** 设备登录账号 */
hardwareAccount = '';
/** 设备登录密码 */
hardwarePwd = '';
/** 会员ID */
id = undefined;
/** 会员条码 */
idBar = '';
/** 身份证号 */
idCard = '';
/** 操作类型 */
operType = '';
/** app密码 */
password = '';
/** 学生证号 */
studentNo = '';
}
export class GivenInfosResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** givenInfos */
givenInfos = [];
/** 具体的错误信息 */
msg = '';
}
export class LoginInfoVo {
/** areaId */
areaId = undefined;
/** areaName */
areaName = '';
/** birthDay */
birthDay = '';
/** createAt */
createAt = '';
/** createLoginDate */
createLoginDate = '';
/** customerHead */
customerHead = '';
/** customerId */
customerId = undefined;
/** customerName */
customerName = '';
/** customerPhone */
customerPhone = '';
/** customerSex */
customerSex = '';
/** customerType */
customerType = '';
/** email */
email = '';
/** entranceDate */
entranceDate = '';
/** hardwareAccount */
hardwareAccount = '';
/** hardwarePwd */
hardwarePwd = '';
/** hardwareState */
hardwareState = '';
/** hardwarelastDate */
hardwarelastDate = '';
/** idBar */
idBar = '';
/** idCard */
idCard = '';
/** isFirstRecharge */
isFirstRecharge = undefined;
/** lastLoginDate */
lastLoginDate = '';
/** loginAccount */
loginAccount = '';
/** loginPwd */
loginPwd = '';
/** loginPwdSalt */
loginPwdSalt = '';
/** loginState */
loginState = '';
/** state */
state = '';
/** studentNo */
studentNo = '';
/** token */
token = '';
/** updateAt */
updateAt = '';
/** updateLoginDate */
updateLoginDate = '';
/** version */
version = '';
}
export class PaymentAndActiveInfo {
/** 支付活动id */
activeId = undefined;
/** 余额,只有支付类型为艾米支付或者豆支付时才会有值 */
amount = undefined;
/** 支付活动说明 */
avtiveComment = '';
/** 抵扣比例 0-1之间的小数 */
deductionValue = undefined;
/** 是否豆抵扣 1:是;0:否 */
isDeduction = undefined;
/** 支付类型(1:线下支付 2:微信支付 3 :支付宝支付 4:京东支付 5:招行一网通支付 6:艾米币 7:专用豆 8通用豆) */
payType = '';
/** 支付版本 */
payVersion = '';
}
export class PaymentAndActiveVo {
/** 支付配置与对应的活动明细 */
paymentAndActiveInfos = [];
/** 支付配置id */
paymentConfId = undefined;
}
export class SelfConsumptionFlowSynchronizationParameter {
/** 消费艾米币 */
aimiMoney = undefined;
/** 区域id */
areaId = undefined;
/** 区域名称 */
areaName = '';
/** 消费豆 */
beanCount = undefined;
/** 通用豆 */
currencyBean = undefined;
/** 会员电话 */
customerCellphone = '';
/** 会员id */
customerId = undefined;
/** 会员名称 */
customerName = '';
/** 设备编号 */
equipmentNum = '';
/** 设备位置 */
equipmentPosition = '';
/** 运营商id */
operateId = undefined;
/** 运营商名称 */
operateName = '';
/** 服务id */
serviceId = undefined;
/** 服务名称 */
serviceName = '';
}
export class ServerDataResponse<T0 = any> {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 响应数据体 */
data = [];
/** 具体的错误信息 */
msg = '';
}
export class ServerResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 具体的错误信息 */
msg = '';
}
export class UnpaidConsumeOrderResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** 具体的错误信息 */
msg = '';
/** orderId */
orderId = undefined;
/** title */
title = '';
}
export class Area {
/** areaName */
areaName = '';
/** areaType */
areaType = '';
/** cityIdGroup */
cityIdGroup = '';
/** cityName */
cityName = '';
/** createDate */
createDate = '';
/** director */
director = '';
/** directorPhone */
directorPhone = '';
/** hdVersion */
hdVersion = '';
/** id */
id = undefined;
/** initial */
initial = '';
/** property */
property = '';
/** rechargeOperateId */
rechargeOperateId = undefined;
/** rechargeOperateName */
rechargeOperateName = '';
/** rechargeOperatePhone */
rechargeOperatePhone = '';
/** state */
state = '';
/** updateDate */
updateDate = '';
}
export class AreaListResp {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = [];
/** 具体的错误信息 */
msg = '';
}
export class AreaNameOrderResp {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = [];
/** 具体的错误信息 */
msg = '';
}
export class AreaOrderVo {
/** 区域名字 */
areaName = '';
/** 首字母 */
initial = '';
}
export class AreaResp {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new Area();
/** 具体的错误信息 */
msg = '';
}
export class AreaSelfServiceVo {
/** 自助服务id */
serviceId = undefined;
/** 自助服务名称 */
serviceName = '';
}
export class AreaSwitch {
/** 区域id */
areaId = undefined;
/** id */
id = undefined;
/** 是否开启 0未开启 1开启 */
isEnabled = undefined;
/** 类型 1咨询开关 2商场开关 */
type = '';
}
export class AreaSwitchResponse {
/** areaSwitchs */
areaSwitchs = [];
/** 响应码,非1000均表示出错 */
code = undefined;
/** 具体的错误信息 */
msg = '';
}
export class CallPayInfo {
/** outTradeNo */
outTradeNo = '';
/** payStr */
payStr = '';
}
export class CallPayResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new CallPayInfo();
/** 具体的错误信息 */
msg = '';
}
export class CreditDepositResponse {
/** 金额 */
amount = undefined;
/** 区域id */
areaId = undefined;
/** 运营商id */
operateId = undefined;
/** 展示类型 1授信额度 2保证金 */
showType = '';
}
export class DeviceLoginConfResponse {
/** 是否关闭 1:是;0:否 */
isClose = undefined;
}
export class DoActiveParam {
/** 支付活动id */
activeId = undefined;
/** 活动处理结束回调api */
callbackApi = '';
/** 会员id */
customerId = undefined;
/** 订单id */
orderId = undefined;
}
export class OperationModeConfResponse {
/** 运营模式 1授信 2保证金 3传统 */
mode = '';
}
export class PayOrderQueryParams {
/** 运营商ID */
operateId = undefined;
/** 交易订单号 */
outTradeNo = '';
/** 支付时间 */
payDate = '';
/** 支付类型:2、微信支付;3、支付宝支付;4、京东支付;5:招行一网通支付 */
payType = '';
}
export class PayOrderQueryResponse {
/** 交易状态0、失败;1、成功 */
state = undefined;
/** 交易状态描述 */
stateDes = '';
}
export class QnTokenResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new QntokenData();
/** 具体的错误信息 */
msg = '';
}
export class QntokenData {
/** token */
token = '';
}
export class ServiceEntity {
/** comment */
comment = '';
/** createDate */
createDate = '';
/** id */
id = undefined;
/** selfSerId */
selfSerId = undefined;
/** serviceName */
serviceName = '';
/** serviceType */
serviceType = '';
/** state */
state = '';
/** updateDate */
updateDate = '';
}
export class ServiceResponse {
/** 响应码,非1000均表示出错 */
code = undefined;
/** data */
data = new ServiceEntity();
/** 具体的错误信息 */
msg = '';
}
export class SingleOrderJsonResponseData {
/** charset */
charset = '';
/** rspData */
rspData = new SingleOrderRspData();
/** version */
version = '';
}
export class SingleOrderRspData {
/** bankDate */
bankDate = '';
/** bankSerialNo */
bankSerialNo = '';
/** bankTime */
bankTime = '';
/** branchNo */
branchNo = '';
/** cardType */
cardType = '';
/** currency */
currency = '';
/** date */
date = '';
/** dateTime */
dateTime = '';
/** discountAmount */
discountAmount = '';
/** fee */
fee = '';
/** merchantNo */
merchantNo = '';
/** merchantPara */
merchantPara = '';
/** orderAmount */
orderAmount = '';
/** orderNo */
orderNo = '';
/** orderStatus */
orderStatus = '';
/** rspCode */
rspCode = '';
/** rspMsg */
rspMsg = '';
/** settleAmount */
settleAmount = '';
/** settleDate */
settleDate = '';
/** settleTime */
settleTime = '';
}
import { CustomerBeanAccountVo, AccountParams } from './baseClass';
import { customerFetch, ResponseDataEntity } from '.';
export const fetchBeanCount = (
data: AccountParams,
): Promise<ResponseDataEntity<CustomerBeanAccountVo[]>> =>
customerFetch({
url: '/customerAccount/queryAccount',
method: 'POST',
data: data,
});
import createFetch from './index';
import { BASE_SERVER_URL } from '../constants/index';
const fetch = createFetch(BASE_SERVER_URL + '/dcxy/api');
export const fetchAllCampus = () =>
fetch({
url: '/campus/all',
});
import { customerFetch, ResponseDataEntity } from '.';
import { LoginInfoVo } from './baseClass';
export class LoginParams {
/** 登陆标识 */
token?: string;
/** 账号 */
loginAccount?: string;
/** 密码 */
passWord?: string;
}
export const appLogin = (data: LoginParams) =>
customerFetch({
url: '/app/customer/login',
data: data,
});
export class PwdParams {
/** 账号 */
loginAccount: string;
/** 密码 */
password: string;
/** 验证码 */
verification: string;
}
export const changePwdByCellphone = (data: PwdParams) =>
customerFetch({
url: `/app/customer/apwd/${data.loginAccount}/${data.password}/${
data.verification
}`,
method: 'PUT',
});
import Taro, { request } from '@tarojs/taro'; import Taro, { request } from '@tarojs/taro';
import store from '../store/index'; import store from '../store/index';
import {
OLD_BASE_SERVER_URL,
BASE_SERVER_URL,
CUSTOMER_SERVER_URL,
} from '../constants/index';
export type ResponseDataEntity<T> = { export type ResponseDataEntity<T> = {
code: number; code: number;
...@@ -14,7 +19,7 @@ type ResponseEntity = { ...@@ -14,7 +19,7 @@ type ResponseEntity = {
}; };
const createFetch = (basePath: string) => { const createFetch = (basePath: string) => {
return (entity: request.Param): Promise<ResponseEntity> => { return (entity: request.Param) => {
const token = store.getState().userinfo.token; const token = store.getState().userinfo.token;
return Taro.request({ return Taro.request({
...entity, ...entity,
...@@ -37,4 +42,8 @@ const createFetch = (basePath: string) => { ...@@ -37,4 +42,8 @@ const createFetch = (basePath: string) => {
}; };
}; };
export const oldBaseFetch = createFetch(OLD_BASE_SERVER_URL);
export const baseFetch = createFetch(BASE_SERVER_URL);
export const customerFetch = createFetch(CUSTOMER_SERVER_URL);
export default createFetch; export default createFetch;
import createFetch, { ResponseDataEntity } from './index'; import { ConsumeOrderResponse } from './baseClass';
import { CUSTOMER_SERVER_URL } from '../constants/index'; import { customerFetch, ResponseDataEntity } from './index';
const fetch = createFetch(CUSTOMER_SERVER_URL); export class Params {
export class AllParams {
/** 会员id */ /** 会员id */
customerId: number; customerId: number;
/** 订单状态 1未支付 2已支付 为空时查询的全部 */
orderState?: string;
/** 最后一页最后一条订单ID */ /** 最后一页最后一条订单ID */
lastOrderId?: number; lastOrderId?: number;
/** 每页条数 */ /** 每页条数 */
pageSize?: number; pageSize?: number;
} }
export const fetchAllOrder = (params: AllParams) => export const fetchAllOrder = (params: Params) =>
fetch({ customerFetch({
url: '/consumeOrder/pageAllList', url: '/consumeOrder/pageAllList',
data: params, data: params,
}); });
export const fetchOrder = (params: AllParams) => export const fetchPayOrder = (
fetch({ params: Params,
): Promise<ResponseDataEntity<ConsumeOrderResponse>> =>
customerFetch({
url: '/consumeOrder/pageList', url: '/consumeOrder/pageList',
data: { data: {
...params, ...params,
...@@ -31,7 +33,7 @@ type DetailParams = { ...@@ -31,7 +33,7 @@ type DetailParams = {
id: number; id: number;
}; };
export const fetchOrderDetail = (data: DetailParams) => export const fetchOrderDetail = (data: DetailParams) =>
fetch({ customerFetch({
url: '/consumeOrder/getDetail', url: '/consumeOrder/getDetail',
data: data, data: data,
}); });
import createFetch, { ResponseDataEntity } from './index'; import { oldBaseFetch, baseFetch, ResponseDataEntity } from './index';
import { BASE_SERVER_URL } from '../constants/index';
const fetch = createFetch(BASE_SERVER_URL + '/wx/api');
type LoginPramas = { type LoginPramas = {
code: string; code: string;
}; };
...@@ -14,24 +12,31 @@ export interface LoginReponse extends ResponseDataEntity<LoginReponseData> { ...@@ -14,24 +12,31 @@ export interface LoginReponse extends ResponseDataEntity<LoginReponseData> {
} }
export const login = (data: LoginPramas) => export const login = (data: LoginPramas) =>
fetch({ oldBaseFetch({
url: '/user/login2', url: '/wx/api/user/login2',
data: data, data: data,
}); });
export const fetchValidateCode = () => export const fetchValidateCode = () =>
fetch({ oldBaseFetch({
url: '/getValidateCode', url: '/wx/api/getValidateCode',
}); });
export const getImageVcode = () => type ImageVcodePramas = {
fetch({ effective?: number;
url: '/getImageValidateCode', loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
}); });
export const getVcode = entity => export const getVcode = entity =>
fetch({ oldBaseFetch({
url: '/getValidateCode', url: '/wx/api/getValidateCode',
method: 'POST', method: 'POST',
data: entity, data: entity,
}); });
...@@ -40,8 +45,8 @@ type RegisiterPramas = {}; ...@@ -40,8 +45,8 @@ type RegisiterPramas = {};
// type RegisiterReponseData = {}; // type RegisiterReponseData = {};
export const fetchWxUserRegister = (entity: RegisiterPramas) => export const fetchWxUserRegister = (entity: RegisiterPramas) =>
fetch({ baseFetch({
url: '/user/regisiter2', url: '/wx/api/user/regisiter2',
method: 'POST', method: 'POST',
data: entity, data: entity,
}); });
...@@ -24,9 +24,9 @@ class App extends Component { ...@@ -24,9 +24,9 @@ class App extends Component {
*/ */
config: Config = { config: Config = {
pages: [ pages: [
'pages/index/index',
'pages/Order/OrderPay/OrderPay', 'pages/Order/OrderPay/OrderPay',
'pages/Order/OrderList/OrderList', 'pages/Order/OrderList/OrderList',
'pages/index/index',
'pages/BarCode/BarCode', 'pages/BarCode/BarCode',
'pages/Home/Home', 'pages/Home/Home',
'pages/Announcement/Announcement', 'pages/Announcement/Announcement',
......
.Modal {
.mask {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: 100%;
background-color: rgba(25, 25, 25, 0.2);
z-index: 99;
}
.Modal-Dialog {
position: absolute;
top: 208px;
left: 50%;
transform: translate(-50%);
width: 540px;
background-color: #fff;
border-radius: 24px;
z-index: 100;
}
.Modal-title {
box-sizing: border-box;
padding: 0 20px;
height: 88px;
line-height: 88px;
width: 100%;
text-align: center;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-size: 32px;
border-bottom: 1px solid #eee;
}
.Modal-body {
padding: 30px 26px;
}
.Modal-footer {
border-top: 1px solid #eee;
display: flex;
height: 88px;
line-height: 88px;
.Modal-footerItem {
width: 100%;
text-align: center;
font-size: 32px;
color: #666;
}
.Modal-footerItem.cancel {
box-sizing: border-box;
border-right: 1px solid #eee;
}
.Modal-footerItem.confirm {
color: #6180f4;
}
}
}
import { Component } from '@tarojs/taro';
import { ComponentClass } from 'react';
import { View } from '@tarojs/components';
import './Modal.scss';
type PageOwnProps = {
children?: JSX.Element | JSX.Element[] | string;
visiabled: boolean;
title: string;
onCancel: () => void;
onSubmit: () => void;
};
type PageState = {};
interface Modal {
props: PageOwnProps;
state: PageState;
}
class Modal extends Component {
static externalClasses = ['body-class'];
static defaultProps = {
visiabled: false,
title: '提示',
};
cancelHandle() {
const { onCancel } = this.props;
onCancel && onCancel();
}
submitHandle() {
const { onSubmit } = this.props;
onSubmit && onSubmit();
}
render() {
const { visiabled, title } = this.props;
return visiabled ? (
<View className='Modal'>
<View className='mask' />
<View className='Modal-Dialog'>
<View className='Modal-title'>{title}</View>
<View className='Modal-body body-class'>{this.props.children}</View>
<View className='Modal-footer'>
<View
className='Modal-footerItem cancel'
onClick={this.cancelHandle}>
取消
</View>
<View
className='Modal-footerItem confirm'
onClick={this.submitHandle}>
确定
</View>
</View>
</View>
</View>
) : null;
}
}
export default Modal as ComponentClass<PageOwnProps, PageState>;
.Vcode-Content {
.Vcode-Content-box {
display: flex;
justify-content: space-between;
height: 76px;
}
.Vcode-input {
width: 308px;
height: 76px;
line-height: 76px;
text-align: center;
background-color: #e6ebfd;
border-radius: 12px;
}
.Vcode-canvas {
width: 146px;
height: 76px;
background-color: #6180f4;
border-radius: 12px;
overflow: hidden;
}
}
.Vcode.Counting { .Vcode.Counting {
color: #999; color: #999;
} }
import { ComponentClass } from 'react'; import { ComponentClass } from 'react';
import Taro, { Component } from '@tarojs/taro'; import Taro, { Component } from '@tarojs/taro';
import { View } from '@tarojs/components'; import { View, Input, Canvas } from '@tarojs/components';
import { getVcode, getImageVcode } from '../../api/wx';
import Modal from '../Modal/Modal';
import './Vcode.scss'; import './Vcode.scss';
import { getVcode } from '../../api/wx'; import { ResponseDataEntity } from 'src/api';
type PageOwnProps = { type PageOwnProps = {
text?: string; text?: string;
...@@ -14,6 +15,9 @@ type PageState = { ...@@ -14,6 +15,9 @@ type PageState = {
counting: boolean; counting: boolean;
count: number; count: number;
timer: number | null; timer: number | null;
showImgBox: boolean;
vcode: number | null;
inputCode: string;
}; };
interface Vcode { interface Vcode {
...@@ -32,6 +36,9 @@ class Vcode extends Component { ...@@ -32,6 +36,9 @@ class Vcode extends Component {
counting: false, counting: false,
count: 10, count: 10,
timer: null, timer: null,
showImgBox: false,
vcode: null,
inputCode: '',
}; };
} }
...@@ -42,9 +49,58 @@ class Vcode extends Component { ...@@ -42,9 +49,58 @@ class Vcode extends Component {
} }
} }
clickHandle() { showImgCode() {
const { cellphone } = this.props; const { cellphone } = this.props;
if (cellphone && cellphone.length == 11) { if (cellphone && cellphone.length == 11) {
getImageVcode({
loginName: cellphone,
})
.then((res: ResponseDataEntity<number>) => {
const { data } = res;
this.setState({
vcode: data,
});
this.renderImg(data);
})
.catch(console.error);
this.setState({
showImgBox: true,
});
this.renderImg(1234);
} else {
Taro.showToast({
title: '输入正确的手机号',
icon: 'none',
mask: true,
});
}
}
closeImageBox() {
const ctx = Taro.createCanvasContext('Vcode', this);
ctx.setFillStyle('#6180f4');
ctx.fillRect(0, 0, 73, 38);
ctx.draw();
this.setState({
showImgBox: false,
});
}
renderImg(vcode: number) {
const ctx = Taro.createCanvasContext('Vcode', this);
ctx.setFillStyle('#6180f4');
ctx.fillRect(0, 0, 73, 38);
ctx.font = '26px arial';
// ctx.font('normal', '500', 26, 'arial');
ctx.setFillStyle('#fff');
ctx.fillText(vcode.toString(), 10, 30, 146); //画布上添加验证码
ctx.draw();
}
clickHandle() {
const { vcode, inputCode } = this.state;
if (vcode && vcode.toString() == inputCode) {
const { cellphone } = this.props;
getVcode({ getVcode({
tel: cellphone, tel: cellphone,
}) })
...@@ -54,13 +110,17 @@ class Vcode extends Component { ...@@ -54,13 +110,17 @@ class Vcode extends Component {
title: res.msg, title: res.msg,
mask: true, mask: true,
}); });
this.setState({
vcode: null,
inputCode: '',
showImgBox: false,
});
}) })
.catch(console.error); .catch(console.error);
} else { } else {
Taro.showToast({ Taro.showToast({
title: '输入正确的手机号', title: '请输入正确的验证码',
icon: 'none', icon: 'none',
mask: true,
}); });
} }
} }
...@@ -90,12 +150,38 @@ class Vcode extends Component { ...@@ -90,12 +150,38 @@ class Vcode extends Component {
} }
render() { render() {
const { defaultText, counting, count } = this.state; const { defaultText, counting, count, showImgBox, inputCode } = this.state;
return counting ? ( return (
<View className='vcode-classname Vcode Counting'>{`${count}S后重发`}</View> <View>
) : ( {counting ? (
<View className='vcode-classname Vcode' onClick={this.clickHandle}> <View className='vcode-classname Vcode Counting'>{`${count}S后重发`}</View>
{defaultText} ) : (
<View className='vcode-classname Vcode' onClick={this.showImgCode}>
{defaultText}
</View>
)}
<Modal
visiabled={showImgBox}
title='请输入图形验证码'
onCancel={this.closeImageBox}
onSubmit={this.clickHandle}
body-class='Vcode-Content'>
<View className='Vcode-Content-box'>
<Input
className='Vcode-input'
type='number'
maxLength={4}
value={inputCode}
onInput={({ detail: { value } }) => {
this.setState({
inputCode: value,
});
return value;
}}
/>
<Canvas className='Vcode-canvas' canvasId='Vcode' />
</View>
</Modal>
</View> </View>
); );
} }
......
export const APP_ID = 'wxf5912b79bba23663'; export const APP_ID = 'wxf5912b79bba23663';
export const BASE_SERVER_URL = 'https://ex-dev-selfbase.168cad.top';
export const CUSTOMER_SERVER_URL = 'http://ex-dev-dcxy-customer-app.168cad.top'; export const OLD_BASE_SERVER_URL = 'https://ex-dev-selfbase.168cad.top';
export const BASE_SERVER_URL = 'https://ex-dev-dcxy-base-app.168cad.top';
export const CUSTOMER_SERVER_URL =
'https://ex-dev-dcxy-customer-app.168cad.top';
...@@ -7,16 +7,26 @@ import RefreshIcon from '../../images/barcode/icon_shuaxin@2x.png'; ...@@ -7,16 +7,26 @@ import RefreshIcon from '../../images/barcode/icon_shuaxin@2x.png';
import wxbarcode from 'wxbarcode'; import wxbarcode from 'wxbarcode';
import './BarCode.scss'; import './BarCode.scss';
import { UserState } from '../../store/rootReducers/userinfo';
import { connect } from '@tarojs/redux';
type PageStateProps = {
userinfo: UserState;
};
type PageOwnProps = {}; type PageOwnProps = {};
type PageState = { type PageState = {
showBig: boolean; showBig: boolean;
}; };
type IProps = PageStateProps & PageOwnProps;
interface BarCode { interface BarCode {
props: PageOwnProps; props: IProps;
state: PageState; state: PageState;
} }
@connect(({ userinfo }) => ({
userinfo,
}))
class BarCode extends Component { class BarCode extends Component {
constructor(props: PageOwnProps) { constructor(props: PageOwnProps) {
super(props); super(props);
...@@ -26,14 +36,16 @@ class BarCode extends Component { ...@@ -26,14 +36,16 @@ class BarCode extends Component {
} }
componentWillMount() { componentWillMount() {
wxbarcode.barcode('BarCode', '12345678901234567', 646, 188); const { userinfo } = this.props;
wxbarcode.barcode('BarCode', userinfo.idBar, 646, 188);
} }
drawBarCode(showBig: boolean) { drawBarCode(showBig: boolean) {
const { userinfo } = this.props;
if (showBig) { if (showBig) {
wxbarcode.barcode('BarCode', '12345678901234567', 646, 188); wxbarcode.barcode('BarCode', userinfo.idBar, 646, 188);
} else { } else {
wxbarcode.barcode('BarCode', '12345678901234567', 700, 364); wxbarcode.barcode('BarCode', userinfo.idBar, 700, 364);
} }
} }
......
...@@ -15,8 +15,56 @@ import UserHeaderM from '../../images/home/img_boy_touxiang@2x.png'; ...@@ -15,8 +15,56 @@ import UserHeaderM from '../../images/home/img_boy_touxiang@2x.png';
import UserHeaderF from '../../images/home/img_girl_touxiang@2x.png'; import UserHeaderF from '../../images/home/img_girl_touxiang@2x.png';
import './Home.scss'; import './Home.scss';
import { connect } from '@tarojs/redux';
import { UserState } from '../../store/rootReducers/userinfo';
import { fetchBeanCount } from '../../api/bean';
type PageStateProps = {
userinfo: UserState;
};
type PageState = {
commBean: number;
hairDryerBean: number;
};
interface Home {
props: PageStateProps;
state: PageState;
}
@connect(({ userinfo }) => ({
userinfo,
}))
class Home extends Component { class Home extends Component {
constructor(props) {
super(props);
this.state = {
commBean: 0.0,
hairDryerBean: 0.0,
};
}
componentWillMount() {
const { userinfo } = this.props;
fetchBeanCount({
id: userinfo.customerId,
areaId: userinfo.areaId,
customerPhone: userinfo.customerPhone,
serviceIdList: [],
})
.then(res => {
const data = res.data;
let commBeanItem = data.find(item => item.serviceId === '1');
let hairDryerBeanItem = data.find(item => item.serviceId === '1');
let commBean = commBeanItem ? commBeanItem.money : 0.0;
let hairDryerBean = hairDryerBeanItem ? hairDryerBeanItem.money : 0.0;
this.setState({
commBean,
hairDryerBean,
});
})
.catch(console.error);
}
goSetting() { goSetting() {
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/UserSetting/UserSetting', url: '/pages/UserSetting/UserSetting',
...@@ -34,7 +82,15 @@ class Home extends Component { ...@@ -34,7 +82,15 @@ class Home extends Component {
}); });
} }
goBarCode() {
Taro.navigateTo({
url: '/pages/BarCode/BarCode',
});
}
render() { render() {
const { userinfo } = this.props;
const { commBean, hairDryerBean } = this.state;
return ( return (
<View className='Home'> <View className='Home'>
<View className='Home-UserBox'> <View className='Home-UserBox'>
...@@ -46,33 +102,37 @@ class Home extends Component { ...@@ -46,33 +102,37 @@ class Home extends Component {
<Image className='bg' src={UserBoxBg} /> <Image className='bg' src={UserBoxBg} />
<View className='Home-UserBox-info'> <View className='Home-UserBox-info'>
<View className='Home-UserBox-other'> <View className='Home-UserBox-other'>
<View className='Home-UserBox-name'>中小</View> <View className='Home-UserBox-name'>{userinfo.customerName}</View>
<View className='Home-UserBox-tel'>16878964216</View> <View className='Home-UserBox-tel'>{userinfo.customerPhone}</View>
<View className='Home-UserBox-addr'>成都师范学校-温江小区</View> <View className='Home-UserBox-addr'>{userinfo.areaName}</View>
</View> </View>
<Image className='Home-UserBox-headimg' src={UserHeaderM} /> {userinfo.customerSex === '2' ? (
<Image className='Home-UserBox-headimg' src={UserHeaderM} />
) : (
<Image className='Home-UserBox-headimg' src={UserHeaderF} />
)}
</View> </View>
<View className='Home-UserBox-line' /> <View className='Home-UserBox-line' />
<View className='Home-UserBox-Bean'> <View className='Home-UserBox-Bean'>
<View className='Home-UserBox-BeanItem'> <View className='Home-UserBox-BeanItem'>
<Image className='Home-UserBox-BeanIcon' src={HBeanIcon} /> <Image className='Home-UserBox-BeanIcon' src={HBeanIcon} />
<Text>吹风豆:</Text> <Text>吹风豆:</Text>
<Text className='Home-UserBox-BeanCount'>2.35</Text> <Text className='Home-UserBox-BeanCount'>{hairDryerBean}</Text>
</View> </View>
<View className='Home-UserBox-BeanItem'> <View className='Home-UserBox-BeanItem'>
<Image className='Home-UserBox-BeanIcon' src={TBeanIcon} /> <Image className='Home-UserBox-BeanIcon' src={TBeanIcon} />
<Text>通用豆:</Text> <Text>通用豆:</Text>
<Text className='Home-UserBox-BeanCount'>2.35</Text> <Text className='Home-UserBox-BeanCount'>{commBean}</Text>
</View> </View>
</View> </View>
<View className='Home-UserBox-Order'> <View className='Home-UserBox-Order'>
<Text className='Home-UserBox-Order-text'>我的订单</Text> <Text className='Home-UserBox-Order-text'>我的订单</Text>
<View className='Home-UserBox-Order-right'> <View className='Home-UserBox-Order-right' onClick={this.goOrder}>
<Image className='Home-UserBox-Order-icon' src={ArrowIcon} /> <Image className='Home-UserBox-Order-icon' src={ArrowIcon} />
</View> </View>
</View> </View>
</View> </View>
<View className='Home-HairDryer'> <View className='Home-HairDryer' onClick={this.goBarCode}>
<Image className='bg' src={HairDryerBg} /> <Image className='bg' src={HairDryerBg} />
<View className='Home-HairDryer-shadow' /> <View className='Home-HairDryer-shadow' />
<View className='Home-HairDryer-text'> <View className='Home-HairDryer-text'>
...@@ -99,4 +159,4 @@ class Home extends Component { ...@@ -99,4 +159,4 @@ class Home extends Component {
} }
} }
export default Home as ComponentClass; export default Home as ComponentClass<PageStateProps, PageState>;
...@@ -3,6 +3,14 @@ import Taro, { Component, Config } from '@tarojs/taro'; ...@@ -3,6 +3,14 @@ import Taro, { Component, Config } from '@tarojs/taro';
import { View, Button, Text, Input, Navigator } from '@tarojs/components'; import { View, Button, Text, Input, Navigator } from '@tarojs/components';
import './Login.scss'; import './Login.scss';
import { appLogin } from '../../api/customer';
import { connect } from '@tarojs/redux';
import { updateUserInfo } from '../../store/rootReducers/userinfo';
import { LoginInfoVo } from '../../api/baseClass';
type PageDispatchProps = {
updateUserInfo: (e: LoginInfoVo) => void;
};
type PageState = { type PageState = {
account: string; account: string;
...@@ -10,9 +18,18 @@ type PageState = { ...@@ -10,9 +18,18 @@ type PageState = {
}; };
interface Login { interface Login {
props: PageDispatchProps;
state: PageState; state: PageState;
} }
@connect(
() => ({}),
dispatch => ({
updateUserInfo(data: LoginInfoVo) {
dispatch(updateUserInfo(data));
},
}),
)
class Login extends Component { class Login extends Component {
config: Config = { config: Config = {
navigationBarTitleText: '多彩校园', navigationBarTitleText: '多彩校园',
...@@ -26,11 +43,47 @@ class Login extends Component { ...@@ -26,11 +43,47 @@ class Login extends Component {
}; };
} }
loginHandle() { validataLoginData(): boolean {
console.log('in loginHandle'); const { account, pwd } = this.state;
if (!account || account.length !== 11) {
Taro.showToast({
title: '请输入手机号码',
icon: 'none',
});
return false;
}
if (!pwd || pwd.length < 6) {
Taro.showToast({
title: '请输入密码',
icon: 'none',
});
return false;
}
return true;
}
loginHandle(): void {
if (this.validataLoginData()) {
const { account, pwd } = this.state;
console.log('in loginHandle');
appLogin({
loginAccount: account,
passWord: pwd,
})
.then(res => {
const data = res.data;
console.log(data);
this.props.updateUserInfo(data);
Taro.navigateTo({
url: '/pages/Home/Home',
});
})
.catch(console.error);
}
} }
render() { render() {
const { account, pwd } = this.state;
return ( return (
<View className='Login'> <View className='Login'>
<View className='Login-title'>欢迎来到多彩校园</View> <View className='Login-title'>欢迎来到多彩校园</View>
...@@ -39,12 +92,27 @@ class Login extends Component { ...@@ -39,12 +92,27 @@ class Login extends Component {
className='Login-input' className='Login-input'
placeholder-class='Login-input-placeholder' placeholder-class='Login-input-placeholder'
placeholder='请输入账号手机号' placeholder='请输入账号手机号'
type='number'
value={account}
onInput={({ detail: { value } }) => {
this.setState({
account: value,
});
return value;
}}
/> />
<Input <Input
className='Login-input' className='Login-input'
placeholder-class='Login-input-placeholder' placeholder-class='Login-input-placeholder'
password password
placeholder='请输入密码' placeholder='请输入密码'
value={pwd}
onInput={({ detail: { value } }) => {
this.setState({
pwd: value,
});
return value;
}}
/> />
</View> </View>
...@@ -71,4 +139,4 @@ class Login extends Component { ...@@ -71,4 +139,4 @@ class Login extends Component {
} }
} }
export default Login as ComponentClass<{}, PageState>; export default Login as ComponentClass<PageDispatchProps, PageState>;
...@@ -9,10 +9,12 @@ import './OrderList.scss'; ...@@ -9,10 +9,12 @@ import './OrderList.scss';
import { toggleOrderState } from './actions'; import { toggleOrderState } from './actions';
import { StoreState } from './store'; import { StoreState } from './store';
import { fetchAllOrder } from '../../../api/order'; import { fetchAllOrder, fetchPayOrder } from '../../../api/order';
import { UserState } from '../../../store/rootReducers/userinfo';
type PageStateProps = { type PageStateProps = {
orderList: StoreState; orderList: StoreState;
userinfo: UserState;
}; };
type PageDispatchProps = { type PageDispatchProps = {
toggleOrderState: (state: String) => void; toggleOrderState: (state: String) => void;
...@@ -27,8 +29,9 @@ interface OrderList { ...@@ -27,8 +29,9 @@ interface OrderList {
} }
@connect( @connect(
({ OrderList }) => ({ ({ OrderList, userinfo }) => ({
orderList: OrderList, orderList: OrderList,
userinfo,
}), }),
dispatch => ({ dispatch => ({
toggleOrderState(state: String) { toggleOrderState(state: String) {
...@@ -43,6 +46,33 @@ class OrderList extends Component { ...@@ -43,6 +46,33 @@ class OrderList extends Component {
constructor(props: PageProps) { constructor(props: PageProps) {
super(props); super(props);
} }
componentWillMount() {
this.getPayOrderHandle();
}
getPayOrderHandle(lastOrderId?: number) {
const { userinfo } = this.props;
fetchPayOrder(
lastOrderId
? {
customerId: userinfo.customerId,
pageSize: 10,
lastOrderId,
}
: {
customerId: userinfo.customerId,
pageSize: 10,
},
)
.then(res => {
console.log(res);
})
.catch(console.error);
}
getAllOrderHandle() {}
goPayPage(data) { goPayPage(data) {
this.$preload(data); this.$preload(data);
Taro.navigateTo({ Taro.navigateTo({
......
...@@ -7,6 +7,7 @@ import pwdShowIcon from '../../images/login/setting_see_icon@2x.png'; ...@@ -7,6 +7,7 @@ import pwdShowIcon from '../../images/login/setting_see_icon@2x.png';
import ToastBox from '../../components/ToastBox/ToastBox'; import ToastBox from '../../components/ToastBox/ToastBox';
import './ResetPwd.scss'; import './ResetPwd.scss';
import { changePwdByCellphone } from '../../api/customer';
type PageOwnProps = {}; type PageOwnProps = {};
type PageState = { type PageState = {
...@@ -30,7 +31,7 @@ class ResetPwd extends Component { ...@@ -30,7 +31,7 @@ class ResetPwd extends Component {
constructor(props: PageOwnProps) { constructor(props: PageOwnProps) {
super(props); super(props);
this.state = { this.state = {
cellphone: '', cellphone: '18108096099',
vcode: '', vcode: '',
pwd: '', pwd: '',
checkPwd: '', checkPwd: '',
...@@ -90,13 +91,23 @@ class ResetPwd extends Component { ...@@ -90,13 +91,23 @@ class ResetPwd extends Component {
return true; return true;
} }
resetPwd() { resetPwd() {
// this.refs.ToastBox.showToast('修改成功');
if (this.validatePwdForm()) { if (this.validatePwdForm()) {
console.log('回到登陆'); const { cellphone, pwd, vcode } = this.state;
changePwdByCellphone({
Taro.redirectTo({ loginAccount: cellphone,
url: '/pages/Login/Login', password: pwd,
}); verification: vcode,
})
.then(() => {
this.refs.ToastBox.showToast('修改成功');
console.log('回到登陆');
setTimeout(() => {
Taro.redirectTo({
url: '/pages/Login/Login',
});
}, 2000);
})
.catch(console.error);
} }
} }
render() { render() {
...@@ -129,6 +140,12 @@ class ResetPwd extends Component { ...@@ -129,6 +140,12 @@ class ResetPwd extends Component {
placeholder='请输入验证码' placeholder='请输入验证码'
maxLength={6} maxLength={6}
value={vcode} value={vcode}
onInput={({ detail: { value } }) => {
this.setState({
vcode: value,
});
return value;
}}
/> />
<Vcode <Vcode
vcode-classname='registerBox-getVcode' vcode-classname='registerBox-getVcode'
......
...@@ -4,24 +4,34 @@ import { connect } from '@tarojs/redux'; ...@@ -4,24 +4,34 @@ import { connect } from '@tarojs/redux';
import { View, Text, Input, Image, ScrollView } from '@tarojs/components'; import { View, Text, Input, Image, ScrollView } from '@tarojs/components';
import SearchIcon from '../../images/login/icon_search@2x.png'; import SearchIcon from '../../images/login/icon_search@2x.png';
import { Campus, CampusList } from '../../types/Campus/Campus';
import { fetchAllCampus } from '../../api/campus'; import { fetchAllArea } from '../../api/area';
import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo'; import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo';
import User from 'src/types/User/User';
import './SelectCampus.scss'; import './SelectCampus.scss';
type Area = {
id: number;
areaName: string;
initial?: string;
};
type AreaList = Array<{
firstPin: string;
children: Array<Area>;
}>;
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: UserState;
}; };
type PageDispatchProps = { type PageDispatchProps = {
updateUserInfo: (e: User) => void; updateUserInfo: (e: UserState) => void;
}; };
type PageState = { type PageState = {
campusList: CampusList; pinList: Array<string>;
filterList: CampusList; campusList: AreaList;
filterList: AreaList;
filterName: string; filterName: string;
showToast: boolean; showToast: boolean;
localText: string; localText: string;
...@@ -39,7 +49,7 @@ interface SelectCampus { ...@@ -39,7 +49,7 @@ interface SelectCampus {
userinfo, userinfo,
}), }),
dispatch => ({ dispatch => ({
updateUserInfo(entity: User) { updateUserInfo(entity: UserState) {
dispatch(updateUserInfo(entity)); dispatch(updateUserInfo(entity));
}, },
}), }),
...@@ -53,6 +63,7 @@ class SelectCampus extends Component { ...@@ -53,6 +63,7 @@ class SelectCampus extends Component {
super(props); super(props);
this.state = { this.state = {
filterName: '', filterName: '',
pinList: [],
campusList: [], campusList: [],
filterList: [], filterList: [],
showToast: false, showToast: false,
...@@ -66,22 +77,22 @@ class SelectCampus extends Component { ...@@ -66,22 +77,22 @@ class SelectCampus extends Component {
} }
getList() { getList() {
fetchAllCampus() fetchAllArea()
.then(res => { .then(res => {
console.log(res); console.log(res);
let campusIndexArr: Array<string> = []; let campusIndexArr: Array<string> = [];
let campusList: CampusList = []; let campusList: AreaList = [];
res.data.map((campus: Campus) => { res.data.map((area: Area) => {
let firstPin = campus.firstPin; let firstPin = area.initial;
if (firstPin) { if (firstPin) {
let index = campusIndexArr.indexOf(firstPin); let index = campusIndexArr.indexOf(firstPin);
if (index > -1) { if (index > -1) {
campusList[index].children.push(campus); campusList[index].children.push(area);
} else { } else {
campusIndexArr.push(firstPin); campusIndexArr.push(firstPin);
campusList.push({ campusList.push({
firstPin: firstPin, firstPin: firstPin,
children: [campus], children: [area],
}); });
} }
} }
...@@ -89,6 +100,7 @@ class SelectCampus extends Component { ...@@ -89,6 +100,7 @@ class SelectCampus extends Component {
this.setState({ this.setState({
campusList: campusList, campusList: campusList,
filterList: campusList, filterList: campusList,
pinList: campusIndexArr,
}); });
}) })
.catch(err => { .catch(err => {
...@@ -99,21 +111,18 @@ class SelectCampus extends Component { ...@@ -99,21 +111,18 @@ class SelectCampus extends Component {
searchList() { searchList() {
let { filterName, campusList } = this.state; let { filterName, campusList } = this.state;
if (filterName) { if (filterName) {
const filterList = campusList.reduce( const filterList = campusList.reduce((totalArr: AreaList, campusItem) => {
(totalArr: CampusList, campusItem) => { let arr = campusItem.children.filter(
let arr = campusItem.children.filter( i => i.areaName.indexOf(filterName) > -1,
i => i.name.indexOf(filterName) > -1, );
); if (arr.length > 0) {
if (arr.length > 0) { totalArr.push({
totalArr.push({ firstPin: campusItem.firstPin,
firstPin: campusItem.firstPin, children: arr,
children: arr, });
}); }
} return totalArr;
return totalArr; }, []);
},
[],
);
this.setState({ this.setState({
filterList: filterList, filterList: filterList,
}); });
...@@ -144,21 +153,18 @@ class SelectCampus extends Component { ...@@ -144,21 +153,18 @@ class SelectCampus extends Component {
} }
bindCampus({ target: { dataset } }) { bindCampus({ target: { dataset } }) {
const { const { id, areaName }: Area = dataset.campus;
campus: { id, name, schoolId },
} = dataset;
this.props.updateUserInfo({ this.props.updateUserInfo({
campusId: id, areaId: id,
campusName: name, areaName: areaName,
schoolId: schoolId,
}); });
Taro.navigateBack(); Taro.navigateBack();
} }
render() { render() {
const { const {
campusList, pinList,
filterList, filterList,
filterName, filterName,
showToast, showToast,
...@@ -184,12 +190,12 @@ class SelectCampus extends Component { ...@@ -184,12 +190,12 @@ class SelectCampus extends Component {
</View> </View>
</View> </View>
<View className='infoBar'> <View className='infoBar'>
{campusList.map(item => ( {pinList.map(item => (
<View <View
key={item.firstPin} key={item}
className='infoItem' className='infoItem'
onClick={() => this.showToastHandle(item.firstPin)}> onClick={() => this.showToastHandle(item)}>
{item.firstPin} {item}
</View> </View>
))} ))}
</View> </View>
...@@ -212,7 +218,7 @@ class SelectCampus extends Component { ...@@ -212,7 +218,7 @@ class SelectCampus extends Component {
className='locationItem' className='locationItem'
data-campus={campus} data-campus={campus}
onClick={this.bindCampus}> onClick={this.bindCampus}>
{campus.name} {campus.areaName}
</View> </View>
))} ))}
</View> </View>
......
import User from '../../types/User/User';
import Action from '../../types/Store/Actions'; import Action from '../../types/Store/Actions';
export interface UserState extends User { export class UserState {
login?: boolean; login?: boolean;
areaId?: number;
areaName?: string;
birthDay?: string;
createAt?: string;
createLoginDate?: string;
customerHead?: string;
customerId?: number;
customerName?: string;
customerPhone?: string;
customerSex?: string;
customerType?: string;
email?: string;
entranceDate?: string;
hardwareAccount?: string;
hardwarePwd?: string;
hardwareState?: string;
hardwarelastDate?: string;
idBar?: string;
idCard?: string;
isFirstRecharge?: number;
lastLoginDate?: string;
loginAccount?: string;
loginPwd?: string;
loginPwdSalt?: string;
loginState?: string;
state?: string;
studentNo?: string;
token?: string; token?: string;
updateAt?: string;
updateLoginDate?: string;
version?: string;
} }
const INITIAL_STATE = { const INITIAL_STATE = {
login: false, login: false,
areaId: undefined,
areaName: '',
birthDay: '',
createAt: '',
createLoginDate: '',
customerHead: '',
customerId: undefined,
customerName: '',
customerPhone: '',
customerSex: '',
customerType: '',
email: '',
entranceDate: '',
hardwareAccount: '',
hardwarePwd: '',
hardwareState: '',
hardwarelastDate: '',
idBar: '',
idCard: '',
isFirstRecharge: undefined,
lastLoginDate: '',
loginAccount: '',
loginPwd: '',
loginPwdSalt: '',
loginState: '',
state: '',
studentNo: '',
token: '', token: '',
id: '', updateAt: '',
campusId: null, updateLoginDate: '',
campusName: '', version: '',
schoolId: null,
name: '',
headPic: '',
}; };
export const updateUserInfo = (entity: User): Action => ({ export const updateUserInfo = (entity: UserState): Action => ({
type: 'UPDATE_USERINFO', type: 'UPDATE_USERINFO',
payload: entity, payload: entity,
}); });
......
type User = {
id?: string;
campusId?: number | null;
campusName?: string;
schoolId?: number | null;
name?: string;
headPic?: string;
};
export default User;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment