Commit b6420d43 authored by mqf_0707's avatar mqf_0707

capiFn新增自定义错误信息提示

parent 23b1c8c7
......@@ -108,13 +108,15 @@ export declare const setClipboard: (text: string) => Promise<unknown>;
* 调起分享面板
*/
export declare const showSharePanel: () => Promise<void>;
/**
* 隐藏分享面板
*/
export declare const hideShareMenu: () => Promise<void>;
/**
* 获取缓存数据
* @param key
*/
export declare const getStorage: (key: string) => Promise<string | {
data?: string;
}>;
export declare const getStorage: (key: string) => Promise<string>;
/**
* 设置缓存数据
* @param key
......
......@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.confirmCustomOrder = exports.hideSkuModal = exports.showSkuModal = exports.openMessage = exports.taobaoReportClick = exports.removeStorage = exports.setStorage = exports.getStorage = exports.showSharePanel = exports.setClipboard = exports.getImageInfo = exports.createAudio = exports.openDetail = exports.checkGoodsCollectedStatus = exports.collectGoods = exports.getServerTime = exports.redirectTo = exports.navigateBack = exports.navigateTo = exports.navigateToOutside = exports.checkShopFavoredStatus = exports.favorShop = exports.getSystemInfo = exports.commonConfirm = exports.simpleAlert = exports.commonToast = void 0;
exports.confirmCustomOrder = exports.hideSkuModal = exports.showSkuModal = exports.openMessage = exports.taobaoReportClick = exports.removeStorage = exports.setStorage = exports.getStorage = exports.hideShareMenu = exports.showSharePanel = exports.setClipboard = exports.getImageInfo = exports.createAudio = exports.openDetail = exports.checkGoodsCollectedStatus = exports.collectGoods = exports.getServerTime = exports.redirectTo = exports.navigateBack = exports.navigateTo = exports.navigateToOutside = exports.checkShopFavoredStatus = exports.favorShop = exports.getSystemInfo = exports.commonConfirm = exports.simpleAlert = exports.commonToast = void 0;
var helpers_1 = require("../helpers");
/**
* 通用toast
......@@ -328,6 +328,16 @@ var showSharePanel = function () { return __awaiter(void 0, void 0, void 0, func
});
}); };
exports.showSharePanel = showSharePanel;
/**
* 隐藏分享面板
*/
var hideShareMenu = function () { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
helpers_1.promisifyApiSimple('hideShareMenu', {});
return [2 /*return*/];
});
}); };
exports.hideShareMenu = hideShareMenu;
/**
* 获取缓存数据
* @param key
......@@ -341,7 +351,7 @@ var getStorage = function (key) { return __awaiter(void 0, void 0, void 0, funct
result = _a.sent();
if (result === null || result === void 0 ? void 0 : result.data)
return [2 /*return*/, result.data];
return [2 /*return*/, result];
return [2 /*return*/, undefined];
}
});
}); };
......
{"version":3,"file":"tb.js","sourceRoot":"","sources":["../../src/core/tb.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sCAKmB;AACnB;;;;;GAKG;AACI,IAAM,WAAW,GAAG,UAAC,OAAe,EAAE,QAAiB,EAAE,SAAqB;IACjF,4BAAkB,CAAC,WAAW,EAAC;QAC3B,OAAO,EAAE,OAAO,IAAI,WAAW;QAC/B,QAAQ,EAAE,QAAQ,IAAI,IAAI;QAC1B,OAAO,EAAE,SAAS;KACrB,CAAC,CAAA;AACN,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB;AACF;;;GAGG;AACI,IAAM,WAAW,GAAG,UAAC,OAAe;IACvC,4BAAkB,CAAC,OAAO,EAAC;QACvB,OAAO,SAAA;KACV,CAAC,CAAA;AACN,CAAC,CAAC;AAJW,QAAA,WAAW,eAItB;AACF;;;;;GAKG;AACI,IAAM,aAAa,GAAG,UAAO,KAAY,EAAE,OAAe,EAAE,SAAqB;IAApD,sBAAA,EAAA,YAAY;;;YAC5C,4BAAkB,CAAC,SAAS,EAAC;gBACzB,KAAK,OAAA;gBACL,OAAO,SAAA;gBACP,iBAAiB,EAAE,IAAI;gBACvB,gBAAgB,EAAE,IAAI;gBACtB,OAAO,EAAE,UAAA,MAAM;oBACH,IAAA,OAAO,GAAK,MAAM,QAAX,CAAY;oBAC3B,IAAI,OAAO,EAAE;wBACX,SAAS,IAAI,SAAS,EAAE,CAAC;qBAC1B;gBACL,CAAC;aACJ,CAAC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C;wBAClB,QAAQ,EAAE,QAAQ,IAAI,CAAC;wBACvB,aAAa,EAAE,EAAE;qBACpB;iBACJ,CAAC,EAAA;;gBAPE,MAAM,GAAG,SAOX;gBACF,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAVY,QAAA,kBAAkB,sBAU9B"}
\ No newline at end of file
......@@ -33,10 +33,10 @@ declare const _default: {
};
};
capiFn: (apiList: any, request: any) => {
receiveObjectPrize(params: any): Promise<boolean>;
receiveObjectPrize(params: any, failMessage: any, successMessage: any): Promise<boolean>;
getVipInfo(params: any): Promise<any>;
receiveEnamePrize(params: any): Promise<boolean>;
addStat(type: string | number): Promise<boolean>;
receiveEnamePrize(params: any, failMessage: any, successMessage: any): Promise<boolean>;
addStat(type: string | number, param?: {}): Promise<boolean>;
};
tb: {
getUserAddress: (opts?: {}) => Promise<unknown>;
......@@ -83,9 +83,8 @@ declare const _default: {
getImageInfo: (src: string) => Promise<unknown>;
setClipboard: (text: string) => Promise<unknown>;
showSharePanel: () => Promise<void>;
getStorage: (key: string) => Promise<string | {
data?: string;
}>;
hideShareMenu: () => Promise<void>;
getStorage: (key: string) => Promise<string>;
setStorage: (key: string, value: any) => Promise<unknown>;
removeStorage: (key: string) => Promise<unknown>;
taobaoReportClick: (eventType: string, logkey: string) => void;
......
declare const capiFn: (apiList: any, request: any) => {
receiveObjectPrize(params: any): Promise<boolean>;
receiveObjectPrize(params: any, failMessage: any, successMessage: any): Promise<boolean>;
getVipInfo(params: any): Promise<any>;
receiveEnamePrize(params: any): Promise<boolean>;
addStat(type: number | string): Promise<boolean>;
receiveEnamePrize(params: any, failMessage: any, successMessage: any): Promise<boolean>;
addStat(type: number | string, param?: {}): Promise<boolean>;
};
export default capiFn;
......@@ -53,7 +53,7 @@ var utils_1 = require("../utils");
// 通用API封装方法
var capiFn = function (apiList, request) {
return {
receiveObjectPrize: function (params) {
receiveObjectPrize: function (params, failMessage, successMessage) {
return __awaiter(this, void 0, void 0, function () {
var _a, handle, method, ext, userAddress, _b, name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName;
return __generator(this, function (_c) {
......@@ -79,7 +79,12 @@ var capiFn = function (apiList, request) {
})];
case 1:
result = _a.sent();
if (result && !result.success) {
tb_1.commonToast(failMessage || '领取失败,前去“我的奖品”查看原因');
return [2 /*return*/, true];
}
if (result && result.success) {
successMessage && tb_1.commonToast(successMessage);
return [2 /*return*/, true];
}
return [2 /*return*/];
......@@ -115,7 +120,7 @@ var capiFn = function (apiList, request) {
});
});
},
receiveEnamePrize: function (params) {
receiveEnamePrize: function (params, failMessage, successMessage) {
return __awaiter(this, void 0, void 0, function () {
var _a, handle, method, ext, result;
return __generator(this, function (_b) {
......@@ -127,7 +132,12 @@ var capiFn = function (apiList, request) {
})];
case 1:
result = _b.sent();
if (result && !result.success) {
tb_1.commonToast(failMessage || '领取失败,前去“我的奖品”查看原因');
return [2 /*return*/, true];
}
if (result && result.success) {
successMessage && tb_1.commonToast(successMessage);
return [2 /*return*/, true];
}
return [2 /*return*/, false];
......@@ -135,16 +145,15 @@ var capiFn = function (apiList, request) {
});
});
},
addStat: function (type) {
addStat: function (type, param) {
if (param === void 0) { param = {}; }
return __awaiter(this, void 0, void 0, function () {
var _a, handle, method, ext, result;
return __generator(this, function (_b) {
switch (_b.label) {
case 0:
_a = utils_1.getRequestParams(apiList['addStat']), handle = _a.handle, method = _a.method, ext = _a.ext;
return [4 /*yield*/, request(handle, method, {
type: type
}, ext).catch(function (res) {
return [4 /*yield*/, request(handle, method, __assign({ type: type }, param), ext).catch(function (res) {
tb_1.commonToast(res && res.message);
})];
case 1:
......
{"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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,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
......@@ -202,6 +202,12 @@ export const setClipboard = async (text: string) => {
export const showSharePanel = async () => {
promisifyApiSimple('showSharePanel',{})
}
/**
* 隐藏分享面板
*/
export const hideShareMenu = async () => {
promisifyApiSimple('hideShareMenu',{})
}
/**
* 获取缓存数据
* @param key
......@@ -209,7 +215,7 @@ export const showSharePanel = async () => {
export const getStorage = async (key: string) => {
const result: { data?: string} = await promisifyApi('getStorage', { key })
if(result?.data) return result.data
return result
return undefined
}
/**
* 设置缓存数据
......
......@@ -5,7 +5,7 @@ import { getRequestParams } from '../utils';
// 通用API封装方法
const capiFn = (apiList, request) => {
return {
async receiveObjectPrize(params) {
async receiveObjectPrize(params,failMessage,successMessage) {
const { handle, method, ext } = getRequestParams(apiList['receiveObjectPrize']);
const userAddress: IAddress = await getUserAddress().catch(err => {
commonToast(err.errorMessage);
......@@ -27,7 +27,12 @@ const capiFn = (apiList, request) => {
const result = await request(handle, method, params, ext).catch(res => {
commonToast(res && res.message);
});
if (result && !result.success) {
commonToast(failMessage || '领取失败,前去“我的奖品”查看原因');
return true;
}
if (result && result.success) {
successMessage && commonToast(successMessage)
return true;
}
})
......@@ -46,21 +51,27 @@ const capiFn = (apiList, request) => {
return false;
},
async receiveEnamePrize(params) {
async receiveEnamePrize(params,failMessage,successMessage) {
const { handle, method, ext } = getRequestParams(apiList['receiveEnamePrize']);
const result = await request(handle, method, params, ext).catch(res => {
commonToast(res && res.message);
});
if (result && !result.success) {
commonToast(failMessage || '领取失败,前去“我的奖品”查看原因');
return true;
}
if (result && result.success) {
successMessage && commonToast(successMessage)
return true;
}
return false;
},
async addStat(type: number | string) {
async addStat(type: number | string, param = {}) {
const { handle, method, ext } = getRequestParams(apiList['addStat']);
const result = await request(handle, method, {
type
type,
...param
}, ext).catch(res => {
commonToast(res && res.message);
});
......
......@@ -173,11 +173,6 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
dependencies:
color-convert "^2.0.1"
arg@^4.1.0:
version "4.1.3"
resolved "http://npm.dui88.com:80/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk=
argparse@^1.0.7:
version "1.0.10"
resolved "http://npm.dui88.com:80/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
......@@ -203,11 +198,6 @@ brace-expansion@^1.1.7:
balanced-match "^1.0.0"
concat-map "0.0.1"
buffer-from@^1.0.0:
version "1.1.1"
resolved "http://npm.dui88.com:80/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=
callsites@^3.0.0:
version "3.1.0"
resolved "http://npm.dui88.com:80/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
......@@ -259,11 +249,6 @@ concat-map@0.0.1:
resolved "http://npm.dui88.com:80/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
create-require@^1.1.0:
version "1.1.1"
resolved "http://npm.dui88.com:80/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
integrity sha1-wdfo8eX2z8n/ZfnNNS03NIdWwzM=
cross-spawn@^7.0.2:
version "7.0.3"
resolved "http://npm.dui88.com:80/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
......@@ -285,11 +270,6 @@ deep-is@^0.1.3:
resolved "http://npm.dui88.com:80/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34"
integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=
diff@^4.0.1:
version "4.0.2"
resolved "http://npm.dui88.com:80/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=
doctrine@^3.0.0:
version "3.0.0"
resolved "http://npm.dui88.com:80/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
......@@ -631,11 +611,6 @@ lru-cache@^6.0.0:
dependencies:
yallist "^4.0.0"
make-error@^1.1.1:
version "1.3.6"
resolved "http://npm.dui88.com:80/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha1-LrLjfqm2fEiR9oShOUeZr0hM96I=
minimatch@^3.0.4:
version "3.0.4"
resolved "http://npm.dui88.com:80/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
......@@ -766,19 +741,6 @@ slice-ansi@^4.0.0:
astral-regex "^2.0.0"
is-fullwidth-code-point "^3.0.0"
source-map-support@^0.5.17:
version "0.5.19"
resolved "http://npm.dui88.com:80/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha1-qYti+G3K9PZzmWSMCFKRq56P7WE=
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0:
version "0.6.1"
resolved "http://npm.dui88.com:80/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha1-dHIq8y6WFOnCh6jQu95IteLxomM=
sprintf-js@~1.0.2:
version "1.0.3"
resolved "http://npm.dui88.com:80/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
......@@ -834,18 +796,6 @@ text-table@^0.2.0:
resolved "http://npm.dui88.com:80/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=
ts-node@^9.0.0:
version "9.1.1"
resolved "http://npm.dui88.com:80/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d"
integrity sha1-UamkUKPpWUAb2l8ASnLVS5NtN20=
dependencies:
arg "^4.1.0"
create-require "^1.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.17"
yn "3.1.1"
tslib@^1.8.1:
version "1.14.1"
resolved "http://npm.dui88.com:80/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
......@@ -870,11 +820,6 @@ type-fest@^0.8.1:
resolved "http://npm.dui88.com:80/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=
typescript@^3.9.7:
version "3.9.7"
resolved "http://npm.dui88.com:80/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
integrity sha1-mNYApevcOPQMsndSLxLcgA6eJfo=
uri-js@^4.2.2:
version "4.4.1"
resolved "http://npm.dui88.com:80/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
......@@ -908,8 +853,3 @@ yallist@^4.0.0:
version "4.0.0"
resolved "http://npm.dui88.com:80/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
integrity sha1-m7knkNnA7/7GO+c1GeEaNQGaOnI=
yn@3.1.1:
version "3.1.1"
resolved "http://npm.dui88.com:80/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=
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