|
@@ -1,10 +1,10 @@
|
|
|
// 用户相关请求模块
|
|
// 用户相关请求模块
|
|
|
import APP from '@/services';
|
|
import APP from '@/services';
|
|
|
-import { Callback } from '@/utils/websocket/index';
|
|
|
|
|
import { getUserId } from '@/services/bus/account';
|
|
import { getUserId } from '@/services/bus/account';
|
|
|
-import { receiverInfo, queryProvinceAndCityParam, userReceiveInfoReq, userReceiveIsDefaultReq, delUserReceiveInfoReq } from './interface/index';
|
|
|
|
|
import { buildProtoReq50, parseProtoRsp50 } from '@/services/socket/protobuf/buildReq';
|
|
import { buildProtoReq50, parseProtoRsp50 } from '@/services/socket/protobuf/buildReq';
|
|
|
import { getUUID } from '@/utils/tool/common';
|
|
import { getUUID } from '@/utils/tool/common';
|
|
|
|
|
+import { Callback } from '@/utils/websocket/index';
|
|
|
|
|
+import { delUserReceiveInfoReq, queryProvinceAndCityParam, receiverInfo, userReceiveInfoReq, userReceiveIsDefaultReq } from './interface/index';
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 查询用户收货信息表
|
|
* 查询用户收货信息表
|
|
@@ -19,7 +19,7 @@ export const queryAddressInfoList = (): Promise<receiverInfo[]> => {
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
|
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'SearchReceiverRsp');
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'SearchReceiverRsp');
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
@@ -29,7 +29,7 @@ export const queryAddressInfoList = (): Promise<receiverInfo[]> => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
|
|
|
|
+ } as Callback);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -45,7 +45,7 @@ export const queryProvinceAndCity = (param: queryProvinceAndCityParam): Promise<
|
|
|
params: param,
|
|
params: param,
|
|
|
};
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
|
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res);
|
|
const { isSuccess, result } = parseProtoRsp50(res);
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
@@ -55,7 +55,7 @@ export const queryProvinceAndCity = (param: queryProvinceAndCityParam): Promise<
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
|
|
|
|
+ } as Callback);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -75,7 +75,7 @@ export const addOrModifyUserReceiveInfo = (param: userReceiveInfoReq): Promise<a
|
|
|
reqParams: Object.assign(req, param),
|
|
reqParams: Object.assign(req, param),
|
|
|
};
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
|
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'UserReceiveInfoRsp');
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'UserReceiveInfoRsp');
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
@@ -85,7 +85,7 @@ export const addOrModifyUserReceiveInfo = (param: userReceiveInfoReq): Promise<a
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
|
|
|
|
+ } as Callback);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -103,7 +103,7 @@ export const setDefaultAddress = (param: userReceiveIsDefaultReq): Promise<any>
|
|
|
reqParams: Object.assign(req, param),
|
|
reqParams: Object.assign(req, param),
|
|
|
};
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
|
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'UserReceiveIsDefaultRsp');
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'UserReceiveIsDefaultRsp');
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
@@ -113,7 +113,7 @@ export const setDefaultAddress = (param: userReceiveIsDefaultReq): Promise<any>
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
|
|
|
|
+ } as Callback);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -133,7 +133,7 @@ export const changeAddress = (param: userReceiveInfoReq): Promise<any> => {
|
|
|
reqParams: Object.assign(req, param),
|
|
reqParams: Object.assign(req, param),
|
|
|
};
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
|
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'UserReceiveInfoRsp');
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'UserReceiveInfoRsp');
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
@@ -143,7 +143,7 @@ export const changeAddress = (param: userReceiveInfoReq): Promise<any> => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
|
|
|
|
+ } as Callback);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -158,7 +158,7 @@ export const delAddress = (param: delUserReceiveInfoReq): Promise<any> => {
|
|
|
reqParams: param,
|
|
reqParams: param,
|
|
|
};
|
|
};
|
|
|
const package50 = buildProtoReq50(params);
|
|
const package50 = buildProtoReq50(params);
|
|
|
- APP.sendTradingServer(package50, undefined, <Callback>{
|
|
|
|
|
|
|
+ APP.sendTradingServer(package50, undefined, {
|
|
|
onSuccess: (res) => {
|
|
onSuccess: (res) => {
|
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'DelUserReceiveInfoRsp');
|
|
const { isSuccess, result } = parseProtoRsp50(res, 'DelUserReceiveInfoRsp');
|
|
|
if (isSuccess) {
|
|
if (isSuccess) {
|
|
@@ -168,6 +168,6 @@ export const delAddress = (param: delUserReceiveInfoReq): Promise<any> => {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onFail: (err) => reject(err.message),
|
|
onFail: (err) => reject(err.message),
|
|
|
- });
|
|
|
|
|
|
|
+ } as Callback);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|