Commit a20574ac authored by mqf_0707's avatar mqf_0707

优化tbcc-sdk实物奖品领取未及时更新问题

parent b55a883f
No preview for this file type
...@@ -6,8 +6,8 @@ cloud.init({ ...@@ -6,8 +6,8 @@ cloud.init({
}); });
App({ App({
requestType: 'cloud', // cloud : 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口 requestType: 'yapi', // cloud : 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName: 'hlnBox', // 主云函数项目名 CommonToC cloudName: 'CommonToC', // 主云函数项目名 CommonToC
tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=xxx&proxyIp=xxx', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址 tornadoAPI: 'https://tornado.duibadev.com.cn/tbServer/api?db=xxx&proxyIp=xxx', // 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
cloud, cloud,
tbccTs, tbccTs,
......
...@@ -185,8 +185,8 @@ Page({ ...@@ -185,8 +185,8 @@ Page({
this.setData({ memberShopVisible: false }) this.setData({ memberShopVisible: false })
this.doHelp() this.doHelp()
}, },
// 获取分享图地址 // 获取分享图地址 上传好分享图到云存储后取消注释
async getImgShareUrl() { async getImgShareUrl() {
this.shareImgUrl = await getImgShareUrl(SHARE_IMG_FILE_ID) // this.shareImgUrl = await getImgShareUrl(SHARE_IMG_FILE_ID)
}, },
}); });
...@@ -17,7 +17,7 @@ export declare const simpleAlert: (content: string) => void; ...@@ -17,7 +17,7 @@ export declare const simpleAlert: (content: string) => void;
* @param {string} content 内容 * @param {string} content 内容
* @param {function} successCb 成功回调 * @param {function} successCb 成功回调
*/ */
export declare const commonConfirm: (title: string, content: string, successCb?: () => any) => Promise<void>; export declare const commonConfirm: (title: string, content: string, successCb?: any) => Promise<unknown>;
/** /**
* 获取系统信息 * 获取系统信息
*/ */
......
...@@ -70,20 +70,11 @@ exports.commonConfirm = function (title, content, successCb) { ...@@ -70,20 +70,11 @@ exports.commonConfirm = function (title, content, successCb) {
if (title === void 0) { title = '提示'; } if (title === void 0) { title = '提示'; }
return __awaiter(void 0, void 0, void 0, function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) { return __generator(this, function (_a) {
helpers_1.promisifyApiSimple('confirm', { switch (_a.label) {
title: title, case 0: return [4 /*yield*/, helpers_1.confirmPromisifyApi(title, content, successCb)];
content: content, case 1: return [2 /*return*/, _a.sent()];
confirmButtonText: '确定',
cancelButtonText: '取消',
success: function (result) {
var confirm = result.confirm;
if (confirm) {
successCb && successCb();
}
} }
}); });
return [2 /*return*/];
});
}); });
}; };
/** /**
......
...@@ -11,6 +11,12 @@ export declare const promisifyApiSimple: (methodName: string, params: IParamJSAP ...@@ -11,6 +11,12 @@ export declare const promisifyApiSimple: (methodName: string, params: IParamJSAP
* @param params * @param params
*/ */
export declare const promisifyApi: (methodName: string, params?: {}) => Promise<unknown>; export declare const promisifyApi: (methodName: string, params?: {}) => Promise<unknown>;
/**
* 通用API封装
* @param methodName
* @param params
*/
export declare const confirmPromisifyApi: (title: string, content: string, successCb?: any) => Promise<unknown>;
/** /**
* 通用API封装 * 通用API封装
* @param methodName * @param methodName
...@@ -50,7 +56,7 @@ export declare const isLoading: (methodName: string) => void; ...@@ -50,7 +56,7 @@ export declare const isLoading: (methodName: string) => void;
* @param params * @param params
* @param loading * @param loading
*/ */
export declare const myRequest: (params: any, loading: boolean) => Promise<unknown>; export declare const myRequest: (params: any, handle: string, loading: boolean) => Promise<unknown>;
/** /**
* 云函数接口请求 * 云函数接口请求
* @param _cloudName * @param _cloudName
......
...@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) { ...@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
} }
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.cloudRequest = exports.myRequest = exports.isLoading = exports.strategyEname = exports.getTmallMemberStatus = exports.AudioModel = exports.promisifyApiToTb = exports.promisifyApi = exports.promisifyApiSimple = void 0; exports.cloudRequest = exports.myRequest = exports.isLoading = exports.strategyEname = exports.getTmallMemberStatus = exports.AudioModel = exports.promisifyApiToTb = exports.confirmPromisifyApi = exports.promisifyApi = exports.promisifyApiSimple = void 0;
/** /**
* 简易API封装 * 简易API封装
* @param methodName * @param methodName
...@@ -79,6 +79,42 @@ exports.promisifyApi = function (methodName, params) { ...@@ -79,6 +79,42 @@ exports.promisifyApi = function (methodName, params) {
} })); } }));
}); });
}; };
/**
* 通用API封装
* @param methodName
* @param params
*/
exports.confirmPromisifyApi = function (title, content, successCb) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) {
// @ts-ignore
my.confirm({
title: title,
content: content,
confirmButtonText: '确定',
cancelButtonText: '取消',
success: function (result) { return __awaiter(void 0, void 0, void 0, function () {
var confirm, cbResult;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
confirm = result.confirm;
if (!(confirm && successCb)) return [3 /*break*/, 2];
return [4 /*yield*/, successCb()];
case 1:
cbResult = _a.sent();
resolve(cbResult);
_a.label = 2;
case 2:
resolve(false);
return [2 /*return*/];
}
});
}); },
});
})];
});
}); };
/** /**
* 通用API封装 * 通用API封装
* @param methodName * @param methodName
...@@ -180,13 +216,13 @@ exports.isLoading = function (methodName) { ...@@ -180,13 +216,13 @@ exports.isLoading = function (methodName) {
* @param params * @param params
* @param loading * @param loading
*/ */
exports.myRequest = function (params, loading) { return __awaiter(void 0, void 0, void 0, function () { exports.myRequest = function (params, handle, loading) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) { return __generator(this, function (_a) {
return [2 /*return*/, new Promise(function (resolve, reject) { return [2 /*return*/, new Promise(function (resolve, reject) {
// @ts-ignore // @ts-ignore
my.request(params).then(function (_a) { my.request(params).then(function (_a) {
var res = _a.data; var res = _a.data;
console.log("\u8C03\u7528mock\u63A5\u53E3\u8FD4\u56DE\u7ED3\u679C", res); console.log("\u8C03\u7528" + handle + "\u63A5\u53E3\u8FD4\u56DE\u7ED3\u679C", res);
loading && exports.isLoading('hideLoading'); loading && exports.isLoading('hideLoading');
if (res && res.success) { if (res && res.success) {
resolve(res); resolve(res);
......
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACU,QAAA,kBAAkB,GAAG,UAAC,UAAkB,EAAE,MAAmB,EAAE,IAAa;IACrF,IAAG,IAAI,EAAE;QACL,aAAa;QACb,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,EAAC,MAAM,CAAC,CAAC;QAC5B,OAAO;KACV;IACD,aAAa;IACb,EAAE,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC,CAAA;AACD;;;;GAIG;AACU,QAAA,YAAY,GAAI,UAAC,UAAkB,EAAE,MAAW;IAAX,uBAAA,EAAA,WAAW;IAC5D,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAC5B,aAAa;QACnB,EAAE,CAAC,UAAU,CAAC,uBACV,MAAM,KACT,OAAO,EAAE,UAAA,GAAG;gBACX,OAAO,CAAC,GAAG,CAAC,CAAA;YACb,CAAC,EACD,IAAI,EAAE,UAAA,GAAG;gBACR,MAAM,CAAC,GAAG,CAAC,CAAA;YACZ,CAAC,IACA,CAAA;IACH,CAAC,CAAC,CAAA;AACH,CAAC,CAAA;AACD;;;;GAIG;AACU,QAAA,gBAAgB,GAAI,UAAC,UAAkB,EAAE,MAAW;IAAX,uBAAA,EAAA,WAAW;IAChE,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAChC,aAAa;QACf,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,uBACb,MAAM,KACT,OAAO,EAAE,UAAA,GAAG;gBACX,OAAO,CAAC,GAAG,CAAC,CAAA;YACb,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AAE,CAAC;gBACX,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,EAAA;;KACH,CAAA;AACD;;;;;;GAMG;AACU,QAAA,YAAY,GAAG,UAAO,KAAU,EAAE,UAAiB,EAAE,MAAc,EAAE,MAAW,EAAE,OAAgB;;QAC7G,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;gBACjC,aAAa;gBACb,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,UAAA,GAAG;oBACxD,OAAO,CAAC,GAAG,CAAC,iBAAK,MAAM,yCAAQ,EAAE,GAAG,CAAC,CAAA;oBACrC,OAAO,IAAI,iBAAS,CAAC,aAAa,CAAC,CAAA;oBACnC,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,EAAE;wBACtB,OAAO,CAAC,GAAG,CAAC,CAAC;qBACd;yBAAM;wBACL,MAAM,CAAC,GAAG,CAAC,CAAC;qBACb;oBACD,OAAO,GAAG,CAAC;gBACb,CAAC,CAAC,CAAC,KAAK,CAAC;oBACP,OAAO,IAAI,iBAAS,CAAC,aAAa,CAAC,CAAA;oBACnC,MAAM,EAAE,CAAC;gBACX,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,EAAC;;KACJ,CAAA"}
\ No newline at end of file \ No newline at end of file
...@@ -10,7 +10,7 @@ export declare const md5: (data: any) => any; ...@@ -10,7 +10,7 @@ export declare const md5: (data: any) => any;
* @param loading * @param loading
* @param tornadoAPI * @param tornadoAPI
*/ */
export declare const tornadoAPICb: (params: any, res: any, loading: boolean, tornadoAPI: string) => Promise<unknown>; export declare const tornadoAPICb: (params: any, handle: string, res: any, loading: boolean, tornadoAPI: string) => Promise<unknown>;
/** /**
* 请求风池台接口数据 * 请求风池台接口数据
* @param tornadoAPI * @param tornadoAPI
......
...@@ -58,7 +58,7 @@ exports.md5 = function (data) { ...@@ -58,7 +58,7 @@ exports.md5 = function (data) {
* @param loading * @param loading
* @param tornadoAPI * @param tornadoAPI
*/ */
exports.tornadoAPICb = function (params, res, loading, tornadoAPI) { return __awaiter(void 0, void 0, void 0, function () { exports.tornadoAPICb = function (params, handle, res, loading, tornadoAPI) { return __awaiter(void 0, void 0, void 0, function () {
var nickName, params_; var nickName, params_;
return __generator(this, function (_a) { return __generator(this, function (_a) {
switch (_a.label) { switch (_a.label) {
...@@ -71,7 +71,7 @@ exports.tornadoAPICb = function (params, res, loading, tornadoAPI) { return __aw ...@@ -71,7 +71,7 @@ exports.tornadoAPICb = function (params, res, loading, tornadoAPI) { return __aw
data: params, data: params,
dataType: 'json' dataType: 'json'
}; };
return [4 /*yield*/, index_1.myRequest(params_, loading)]; return [4 /*yield*/, index_1.myRequest(params_, handle, loading)];
case 1: return [2 /*return*/, _a.sent()]; case 1: return [2 /*return*/, _a.sent()];
} }
}); });
...@@ -109,7 +109,7 @@ exports.tornadoAPIFn = function (tornadoAPI, nickName, handle, loading, params) ...@@ -109,7 +109,7 @@ exports.tornadoAPIFn = function (tornadoAPI, nickName, handle, loading, params)
return [2 /*return*/, tbFn_1.getAuthUserInfo().catch(function (err) { return [2 /*return*/, tbFn_1.getAuthUserInfo().catch(function (err) {
console.log('未授权成功', err); console.log('未授权成功', err);
}).then(function (res) { }).then(function (res) {
return exports.tornadoAPICb(params_, res, loading, tornadoAPI); return exports.tornadoAPICb(params_, handle, res, loading, tornadoAPI);
})]; })];
} }
return [2 /*return*/]; return [2 /*return*/];
...@@ -139,7 +139,7 @@ exports.requestMock = function (reqConfig, initConfig, params) { return __awaite ...@@ -139,7 +139,7 @@ exports.requestMock = function (reqConfig, initConfig, params) { return __awaite
data: params, data: params,
dataType: 'json' dataType: 'json'
}; };
return [4 /*yield*/, index_1.myRequest(params_, isShowLoading)]; return [4 /*yield*/, index_1.myRequest(params_, handle, isShowLoading)];
case 3: return [2 /*return*/, _a.sent()]; case 3: return [2 /*return*/, _a.sent()];
} }
}); });
......
{"version":3,"file":"requestFn.js","sour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BAClE,CAAC,CAAC,EAAA;SACL;;;KACJ,CAAA;AACD;;;;;GAKG;AACU,QAAA,WAAW,GAAG,UAAO,SAAqB,EAAE,UAAuB,EAAE,MAAW;;;;;gBACjF,SAAS,GAAoC,SAAS,UAA7C,EAAE,MAAM,GAA4B,SAAS,OAArC,EAAE,MAAM,GAAoB,SAAS,OAA7B,EAAE,aAAa,GAAK,SAAS,cAAd,CAAc;gBACtD,WAAW,GAAmD,UAAU,YAA7D,EAAE,UAAU,GAAuC,UAAU,WAAjD,EAAE,QAAQ,GAA6B,UAAU,SAAvC,EAAE,aAAa,GAAc,UAAU,cAAxB,EAAE,OAAO,GAAK,UAAU,QAAf,CAAe;qBAE5E,CAAA,WAAW,KAAK,YAAY,CAAA,EAA5B,wBAA4B;gBACrB,qBAAM,oBAAY,CAAC,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,CAAC,EAAA;oBAA9E,sBAAO,SAAuE,EAAA;;gBAE5E,aAAa,GAAG,OAAO,IAAI,aAAa,CAAC,WAAW,CAAC,CAAC;gBACtD,OAAO,GAAG;oBACZ,GAAG,EAAE,aAAa,GAAG,SAAS,GAAG,GAAG,GAAG,MAAM;oBAC7C,MAAM,EAAE,KAAK;oBACb,IAAI,EAAE,MAAM;oBACZ,QAAQ,EAAE,MAAM;iBACnB,CAAA;gBACM,qBAAM,iBAAS,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,EAAA;oBAAtD,sBAAO,SAA+C,EAAA;;;KACzD,CAAA"}
\ No newline at end of file \ No newline at end of file
...@@ -57,7 +57,7 @@ declare const _default: { ...@@ -57,7 +57,7 @@ declare const _default: {
}; };
}; };
capiFn: (apiList: any, request: any) => { capiFn: (apiList: any, request: any) => {
receiveObjectPrize(params: any): Promise<boolean>; receiveObjectPrize(params: any): Promise<unknown>;
getVipInfo(params: any): Promise<any>; getVipInfo(params: any): Promise<any>;
receiveEnamePrize(params: any): Promise<boolean>; receiveEnamePrize(params: any): Promise<boolean>;
addStat(activityId: string, type: string | number): Promise<boolean>; addStat(activityId: string, type: string | number): Promise<boolean>;
......
declare const capiFn: (apiList: any, request: any) => { declare const capiFn: (apiList: any, request: any) => {
receiveObjectPrize(params: any): Promise<boolean>; receiveObjectPrize(params: any): Promise<unknown>;
getVipInfo(params: any): Promise<any>; getVipInfo(params: any): Promise<any>;
receiveEnamePrize(params: any): Promise<boolean>; receiveEnamePrize(params: any): Promise<boolean>;
addStat(activityId: string, type: number | string): Promise<boolean>; addStat(activityId: string, type: number | string): Promise<boolean>;
......
...@@ -55,7 +55,7 @@ var capiFn = function (apiList, request) { ...@@ -55,7 +55,7 @@ var capiFn = function (apiList, request) {
return { return {
receiveObjectPrize: function (params) { receiveObjectPrize: function (params) {
return __awaiter(this, void 0, void 0, function () { return __awaiter(this, void 0, void 0, function () {
var _a, handle, method, ext, userAddress, _b, name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName; var _a, handle, method, ext, userAddress, _b, name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName, confirmResult;
return __generator(this, function (_c) { return __generator(this, function (_c) {
switch (_c.label) { switch (_c.label) {
case 0: case 0:
...@@ -65,8 +65,6 @@ var capiFn = function (apiList, request) { ...@@ -65,8 +65,6 @@ var capiFn = function (apiList, request) {
})]; })];
case 1: case 1:
userAddress = _c.sent(); userAddress = _c.sent();
if (!userAddress)
return [2 /*return*/, false];
_b = userAddress || {}, name = _b.name, telNumber = _b.telNumber, provinceName = _b.provinceName, cityName = _b.cityName, cityCode = _b.cityCode, countyName = _b.countyName, detailInfo = _b.detailInfo, streetName = _b.streetName; _b = userAddress || {}, name = _b.name, telNumber = _b.telNumber, provinceName = _b.provinceName, cityName = _b.cityName, cityCode = _b.cityCode, countyName = _b.countyName, detailInfo = _b.detailInfo, streetName = _b.streetName;
params = __assign({ name: name, phone: telNumber, addressDetail: detailInfo, cityCode: cityCode, city: cityName, province: provinceName, area: countyName, streetName: streetName }, params); params = __assign({ name: name, phone: telNumber, addressDetail: detailInfo, cityCode: cityCode, city: cityName, province: provinceName, area: countyName, streetName: streetName }, params);
return [4 /*yield*/, tb_1.commonConfirm('提示', '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address, function () { return [4 /*yield*/, tb_1.commonConfirm('提示', '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address, function () {
...@@ -82,14 +80,14 @@ var capiFn = function (apiList, request) { ...@@ -82,14 +80,14 @@ var capiFn = function (apiList, request) {
if (result && result.success) { if (result && result.success) {
return [2 /*return*/, true]; return [2 /*return*/, true];
} }
return [2 /*return*/]; return [2 /*return*/, false];
} }
}); });
}); });
})]; })];
case 2: case 2:
_c.sent(); confirmResult = _c.sent();
return [2 /*return*/, false]; return [2 /*return*/, confirmResult];
} }
}); });
}); });
......
{"version":3,"file":"capiFn.js","sourceRoot":"","sources":["../../src/request/capiFn.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAwD;AACxD,qCAA8C;AAC9C,kCAA4C;AAE5C,YAAY;AACZ,IAAM,MAAM,GAAG,UAAC,OAAO,EAAE,OAAO;IAC9B,OAAO;QACC,kBAAkB,EAAxB,UAAyB,MAAM;;;;;;4BACvB,KAA0B,wBAAgB,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC,EAAvE,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,GAAG,SAAA,CAAqD;4BAClD,qBAAM,qBAAc,EAAE,CAAC,KAAK,CAAC,UAAA,GAAG;oCAC5D,gBAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gCAChC,CAAC,CAAC,EAAA;;4BAFI,WAAW,GAAa,SAE5B;4BACF,IAAG,CAAC,WAAW;gCAAE,sBAAO,KAAK,EAAA;4BACvB,KAA4F,WAAW,IAAI,EAAE,EAA3G,IAAI,UAAA,EAAE,SAAS,eAAA,EAAE,YAAY,kBAAA,EAAE,QAAQ,cAAA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EAAC;;;;SACd;QAEK,OAAO,EAAb,UAAc,UAAkB,EAAE,IAAqB;;;;;;4BAC/C,KAA0B,wBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,EAA5D,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,GAAG,SAAA,CAA0C;4BACtD,qBAAM,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE;oCAC3C,UAAU,YAAA;oCACV,IAAI,MAAA;iCACL,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,UAAA,GAAG;oCACf,gBAAW,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;gCAClC,CAAC,CAAC,EAAA;;4BALI,MAAM,GAAG,SAKb;4BACF,IAAI,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE;gCAC5B,sBAAO,IAAI,EAAC;6BACb;4BACD,sBAAO,KAAK,EAAC;;;;SACd;KACF,CAAA;AACH,CAAC,CAAC;AAEF,kBAAe,MAAM,CAAC"}
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,8 @@ import { ...@@ -2,7 +2,8 @@ import {
promisifyApiSimple, promisifyApiSimple,
promisifyApi, promisifyApi,
promisifyApiToTb, promisifyApiToTb,
AudioModel AudioModel,
confirmPromisifyApi
} from '../helpers' } from '../helpers'
/** /**
* 通用toast * 通用toast
...@@ -32,19 +33,8 @@ export const simpleAlert = (content: string) => { ...@@ -32,19 +33,8 @@ export const simpleAlert = (content: string) => {
* @param {string} content 内容 * @param {string} content 内容
* @param {function} successCb 成功回调 * @param {function} successCb 成功回调
*/ */
export const commonConfirm = async (title = '提示', content: string, successCb?: () => any) => { export const commonConfirm = async (title = '提示', content: string, successCb?: any) => {
promisifyApiSimple('confirm',{ return await confirmPromisifyApi(title, content, successCb)
title,
content,
confirmButtonText: '确定',
cancelButtonText: '取消',
success: result => {
const { confirm } = result;
if (confirm) {
successCb && successCb();
}
}
})
}; };
/** /**
* 获取系统信息 * 获取系统信息
......
...@@ -32,6 +32,31 @@ export const promisifyApi = (methodName: string, params = {}) => { ...@@ -32,6 +32,31 @@ export const promisifyApi = (methodName: string, params = {}) => {
}) })
}) })
} }
/**
* 通用API封装
* @param methodName
* @param params
*/
export const confirmPromisifyApi = async (title: string, content: string, successCb?: any) => {
return new Promise((resolve, reject) => {
// @ts-ignore
my.confirm({
title,
content,
confirmButtonText: '确定',
cancelButtonText: '取消',
success: async (result) => {
const { confirm } = result;
if (confirm && successCb) {
const cbResult = await successCb();
resolve(cbResult)
}
resolve(false)
},
});
})
}
/** /**
* 通用API封装 * 通用API封装
* @param methodName * @param methodName
...@@ -121,11 +146,11 @@ export const isLoading = (methodName: string) => { ...@@ -121,11 +146,11 @@ export const isLoading = (methodName: string) => {
* @param params * @param params
* @param loading * @param loading
*/ */
export const myRequest = async (params: any, loading: boolean) => { export const myRequest = async (params: any, handle: string, loading: boolean) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// @ts-ignore // @ts-ignore
my.request(params).then(({ data: res }) => { my.request(params).then(({ data: res }) => {
console.log(`调用mock接口返回结果`, res) console.log(`调用${handle}接口返回结果`, res)
loading && isLoading('hideLoading') loading && isLoading('hideLoading')
if (res && res.success) { if (res && res.success) {
resolve(res); resolve(res);
......
...@@ -19,7 +19,7 @@ export const md5 = (data: any) => { ...@@ -19,7 +19,7 @@ export const md5 = (data: any) => {
* @param loading * @param loading
* @param tornadoAPI * @param tornadoAPI
*/ */
export const tornadoAPICb = async (params: any, res: any, loading: boolean, tornadoAPI: string) => { export const tornadoAPICb = async (params: any, handle: string, res: any, loading: boolean, tornadoAPI: string) => {
const { nickName } = res const { nickName } = res
params.openId = md5(nickName) params.openId = md5(nickName)
const params_ = { const params_ = {
...@@ -28,7 +28,7 @@ export const tornadoAPICb = async (params: any, res: any, loading: boolean, torn ...@@ -28,7 +28,7 @@ export const tornadoAPICb = async (params: any, res: any, loading: boolean, torn
data: params, data: params,
dataType: 'json' dataType: 'json'
} }
return await myRequest(params_, loading) return await myRequest(params_, handle, loading)
} }
/** /**
* 请求风池台接口数据 * 请求风池台接口数据
...@@ -62,7 +62,7 @@ export const tornadoAPIFn = async (tornadoAPI: string, nickName: string, handle: ...@@ -62,7 +62,7 @@ export const tornadoAPIFn = async (tornadoAPI: string, nickName: string, handle:
return getAuthUserInfo().catch(err => { return getAuthUserInfo().catch(err => {
console.log('未授权成功', err); console.log('未授权成功', err);
}).then(res=> { }).then(res=> {
return tornadoAPICb(params_, res, loading, tornadoAPI) return tornadoAPICb(params_, handle, res, loading, tornadoAPI)
}) })
} }
} }
...@@ -86,5 +86,5 @@ export const requestMock = async (reqConfig: IReqConfig, initConfig: IInitConfig ...@@ -86,5 +86,5 @@ export const requestMock = async (reqConfig: IReqConfig, initConfig: IInitConfig
data: params, data: params,
dataType: 'json' dataType: 'json'
} }
return await myRequest(params_, isShowLoading) return await myRequest(params_, handle, isShowLoading)
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ const capiFn = (apiList, request) => { ...@@ -10,7 +10,7 @@ const capiFn = (apiList, request) => {
const userAddress: IAddress = await getUserAddress().catch(err => { const userAddress: IAddress = await getUserAddress().catch(err => {
commonToast(err.errorMessage); commonToast(err.errorMessage);
}); });
if(!userAddress) return false // if(!userAddress) return false
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {}; const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
params = { params = {
name, name,
...@@ -23,15 +23,16 @@ const capiFn = (apiList, request) => { ...@@ -23,15 +23,16 @@ const capiFn = (apiList, request) => {
streetName, streetName,
...params ...params
} }
await commonConfirm('提示', '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address, async function() { const confirmResult = await commonConfirm('提示', '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address, async function() {
const result = await request(handle, method, params, ext).catch(res => { const result = await request(handle, method, params, ext).catch(res => {
commonToast(res && res.message); commonToast(res && res.message);
}); });
if (result && result.success) { if (result && result.success) {
return true; return true;
} }
})
return false return false
})
return confirmResult
}, },
async getVipInfo(params) { async getVipInfo(params) {
......
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