Commit 9c028b13 authored by mqf_0707's avatar mqf_0707

更新默认接口

parent dc8ff82e
...@@ -27,7 +27,7 @@ export declare const getSystemInfo: () => Promise<unknown>; ...@@ -27,7 +27,7 @@ export declare const getSystemInfo: () => Promise<unknown>;
* @param {number} sellerId 店铺归属的卖家Id * @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态 * @returns {boolean} 关注状态
*/ */
export declare const favorShop: (sellerId: number) => Promise<false | { export declare const favorShop: (sellerId: number) => Promise<boolean | {
error?: number; error?: number;
}>; }>;
/** /**
......
...@@ -119,6 +119,8 @@ var favorShop = function (sellerId) { return __awaiter(void 0, void 0, void 0, f ...@@ -119,6 +119,8 @@ var favorShop = function (sellerId) { return __awaiter(void 0, void 0, void 0, f
result = _a.sent(); result = _a.sent();
if ((result === null || result === void 0 ? void 0 : result.error) === 11) if ((result === null || result === void 0 ? void 0 : result.error) === 11)
return [2 /*return*/, false]; return [2 /*return*/, false];
if ((result === null || result === void 0 ? void 0 : result.error) === 12)
return [2 /*return*/, true];
return [2 /*return*/, result]; return [2 /*return*/, result];
} }
}); });
......
{"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,eA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MAAM,EAAE,EAAE,MAAM,QAAA,EAAE,EAAE,CAAC,EAAA;;gBAAjG,MAAM,GAAG,SAAwF;gBACrG,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAHY,QAAA,WAAW,eAGvB;AACD;;;GAGG;AACI,IAAM,YAAY,GAAG,UAAO,MAAc;;;;oBAChC,qBAAM,0BAAgB,CAAC,SAAS,EAAC,EAAE,MAAM,QAAA,EAAE,CAAC,EAAA;;gBAArD,MAAM,GAAG,SAA4C;gBACzD,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAHY,QAAA,YAAY,gBAGxB;AACD;;GAEG;AACI,IAAM,YAAY,GAAG;;;;oBACX,qBAAM,0BAAgB,CAAC,SAAS,EAAC,EAAE,CAAC,EAAA;;gBAA7C,MAAM,GAAG,SAAoC;gBACjD,sBAAO,MAAM,EAAA;;;KAChB,CAAA;AAHY,QAAA,YAAY,gBAGxB;AACD;;;;;GAKG;AACI,IAAM,kBAAkB,GAAG,UAAO,MAAc,EAAE,KAAc,EAAE,QAAiB;;;;oBACzE,qBAAM,0BAAgB,CAAC,oBAAoB,EAAC;oBACrD,IAAI,EAAE;wBACF,MAAM,QAAA;wBACN,KAAK,EAAE,KAAK,IAAI,CAAC,CAAC;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 \ No newline at end of file
import * as utils from './utils'; import * as utils from './utils';
import * as constants from './constants'; import * as constants from './constants';
import * as capiFn from './request/capiFn';
declare const _default: { declare const _default: {
capi: { capi: {
getMyPrizeList: { getMyAwardsList: {
method: string; method: string;
handle: string; handle: string;
isShowLoading: boolean; isShowLoading: boolean;
...@@ -15,29 +16,24 @@ declare const _default: { ...@@ -15,29 +16,24 @@ declare const _default: {
method: string; method: string;
handle: string; handle: string;
}; };
getItemListByItemIds: { completeTask: {
method: string; method: string;
handle: string; handle: string;
}; };
getCollectGoodsList: { receiveTask: {
method: string; method: string;
handle: string; handle: string;
}; };
doCompleteTask: { getTaskList: {
method: string; method: string;
handle: string; handle: string;
}; };
getVipInfo: { getCollectGoods: {
method: string; method: string;
handle: string; handle: string;
}; };
}; };
capiFn: (apiList: any, request: any) => { capiFn: typeof capiFn;
receiveObjectPrize(params: any): Promise<false | void>;
getVipInfo(params: any): Promise<any>;
receiveEnamePrize(params: any): Promise<boolean>;
addStat(activityId: string, type: string | number): Promise<boolean>;
};
tb: { tb: {
getUserAddress: (opts?: {}) => Promise<unknown>; getUserAddress: (opts?: {}) => Promise<unknown>;
chooseImage: (opts?: {}) => Promise<unknown>; chooseImage: (opts?: {}) => Promise<unknown>;
...@@ -56,7 +52,7 @@ declare const _default: { ...@@ -56,7 +52,7 @@ declare const _default: {
simpleAlert: (content: string) => void; simpleAlert: (content: string) => void;
commonConfirm: (title: string, content: string, successCb?: () => any) => Promise<void>; commonConfirm: (title: string, content: string, successCb?: () => any) => Promise<void>;
getSystemInfo: () => Promise<unknown>; getSystemInfo: () => Promise<unknown>;
favorShop: (sellerId: number) => Promise<false | { favorShop: (sellerId: number) => Promise<boolean | {
error?: number; error?: number;
}>; }>;
checkShopFavoredStatus: (sellerId: number) => Promise<boolean | { checkShopFavoredStatus: (sellerId: number) => Promise<boolean | {
......
...@@ -16,11 +16,11 @@ var tbFn = require("./core/tbFn"); ...@@ -16,11 +16,11 @@ var tbFn = require("./core/tbFn");
var utils = require("./utils"); var utils = require("./utils");
var constants = require("./constants"); var constants = require("./constants");
var capi_1 = require("./request/capi"); var capi_1 = require("./request/capi");
var capiFn_1 = require("./request/capiFn"); var capiFn = require("./request/capiFn");
var request_1 = require("./request"); var request_1 = require("./request");
exports.default = { exports.default = {
capi: capi_1.default, capi: capi_1.default,
capiFn: capiFn_1.default, capiFn: capiFn,
tb: __assign(__assign({}, tb), tbFn), tb: __assign(__assign({}, tb), tbFn),
utils: utils, utils: utils,
request: request_1.default, request: request_1.default,
......
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8BAAgC;AAChC,kCAAoC;AACpC,+BAAiC;AACjC,uCAAyC;AACzC,uCAAkC;AAClC,2CAAsC;AACtC,qCAAgC;AAEhC,kBAAe;IACb,IAAI,gBAAA;IACJ,MAAM,kBAAA;IACN,EAAE,wBACE,EAAE,GAAK,IAAI,CACd;IACD,KAAK,OAAA;IACL,OAAO,mBAAA;IACP,SAAS,WAAA;CACV,CAAA"} {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,8BAAgC;AAChC,kCAAoC;AACpC,+BAAiC;AACjC,uCAAyC;AACzC,uCAAkC;AAClC,yCAA2C;AAC3C,qCAAgC;AAEhC,kBAAe;IACb,IAAI,gBAAA;IACJ,MAAM,QAAA;IACN,EAAE,wBACE,EAAE,GAAK,IAAI,CACd;IACD,KAAK,OAAA;IACL,OAAO,mBAAA;IACP,SAAS,WAAA;CACV,CAAA"}
\ No newline at end of file \ No newline at end of file
declare const capi: { declare const capi: {
getMyPrizeList: { getMyAwardsList: {
method: string; method: string;
handle: string; handle: string;
isShowLoading: boolean; isShowLoading: boolean;
...@@ -12,19 +12,19 @@ declare const capi: { ...@@ -12,19 +12,19 @@ declare const capi: {
method: string; method: string;
handle: string; handle: string;
}; };
getItemListByItemIds: { completeTask: {
method: string; method: string;
handle: string; handle: string;
}; };
getCollectGoodsList: { receiveTask: {
method: string; method: string;
handle: string; handle: string;
}; };
doCompleteTask: { getTaskList: {
method: string; method: string;
handle: string; handle: string;
}; };
getVipInfo: { getCollectGoods: {
method: string; method: string;
handle: string; handle: string;
}; };
......
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var capi = { var capi = {
getMyPrizeList: { getMyAwardsList: {
method: 'GET', method: 'GET',
handle: 'getMyPrizeList', handle: 'getMyAwardsList',
isShowLoading: false isShowLoading: true
}, },
receiveObjectPrize: { method: 'GET', handle: 'receiveObjectPrize' }, receiveObjectPrize: { method: 'GET', handle: 'receiveObjectPrize' },
receiveEnamePrize: { method: 'GET', handle: 'receiveEnamePrize' }, receiveEnamePrize: { method: 'GET', handle: 'receiveEnamePrize' },
getItemListByItemIds: { method: 'GET', handle: 'getItemListByItemIds' }, completeTask: { method: 'GET', handle: 'completeTask' },
getCollectGoodsList: { method: 'GET', handle: 'getCollectGoodsList' }, receiveTask: { method: 'GET', handle: 'receiveTask' },
doCompleteTask: { method: 'GET', handle: 'doCompleteTask' }, getTaskList: { method: 'GET', handle: 'getTaskList' },
getVipInfo: { method: 'GET', handle: 'getVipInfo' } getCollectGoods: { method: 'GET', handle: 'getCollectGoods' },
}; };
exports.default = capi; exports.default = capi;
//# sourceMappingURL=capi.js.map //# sourceMappingURL=capi.js.map
\ No newline at end of file
{"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/request/capi.ts"],"names":[],"mappings":";;AAAA,IAAM,IAAI,GAAG;IACT,cAAc,EAAE;QACd,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,gBAAgB;QACxB,aAAa,EAAE,KAAK;KACrB;IACD,kBAAkB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE;IACnE,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE;IACjE,oBAAoB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,sBAAsB,EAAE;IACvE,mBAAmB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,qBAAqB,EAAE;IACrE,cAAc,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAC3D,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE;CACpD,CAAC;AAEF,kBAAe,IAAI,CAAC"} {"version":3,"file":"capi.js","sourceRoot":"","sources":["../../src/request/capi.ts"],"names":[],"mappings":";;AAAA,IAAM,IAAI,GAAG;IACX,eAAe,EAAE;QACf,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,iBAAiB;QACzB,aAAa,EAAE,IAAI;KACpB;IACD,kBAAkB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,oBAAoB,EAAE;IACnE,iBAAiB,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE;IACjE,YAAY,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE;IACvD,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;IACrD,WAAW,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE;IACrD,eAAe,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE;CAC9D,CAAC;AAEF,kBAAe,IAAI,CAAC"}
\ No newline at end of file \ No newline at end of file
declare const capiFn: (apiList: any, request: any) => { /**
receiveObjectPrize(params: any): Promise<false | void>; * 领取实物奖品
getVipInfo(params: any): Promise<any>; * @param api
receiveEnamePrize(params: any): Promise<boolean>; * @param data
addStat(activityId: string, type: number | string): Promise<boolean>; */
}; export declare const receiveObjectPrize: (api: any, data: IReceivePrize) => Promise<unknown>;
export default capiFn; /**
* 领取权益
* @param api
* @param data
*/
export declare const receiveEnamePrize: (api: any, data: IReceivePrize) => Promise<unknown>;
/**
* 会员优惠券领取
* @param api
* @param data
*/
export declare const receiveMemberEname: (api: any, data: IReceivePrize) => Promise<unknown>;
...@@ -46,124 +46,199 @@ var __generator = (this && this.__generator) || function (thisArg, body) { ...@@ -46,124 +46,199 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
} }
}; };
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.receiveMemberEname = exports.receiveEnamePrize = exports.receiveObjectPrize = void 0;
var tb_1 = require("../core/tb"); var tb_1 = require("../core/tb");
var tbFn_1 = require("../core/tbFn"); var tbFn_1 = require("../core/tbFn");
var utils_1 = require("../utils"); var utils_1 = require("../utils");
// 通用API封装方法 // 领取实物
var capiFn = function (apiList, request) { var getUerAddressParam = function () { return __awaiter(void 0, void 0, void 0, function () {
return { var userAddress, _a, name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName, params;
receiveObjectPrize: function (params) { return __generator(this, function (_b) {
return __awaiter(this, void 0, void 0, function () { switch (_b.label) {
var _a, handle, method, ext, userAddress, _b, name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName, confirmResult, _c; case 0: return [4 /*yield*/, tbFn_1.getUserAddress().catch(function (err) {
return __generator(this, function (_d) { tb_1.commonToast(err.errorMessage);
switch (_d.label) { })];
case 0: case 1:
_a = utils_1.getRequestParams(apiList['receiveObjectPrize']), handle = _a.handle, method = _a.method, ext = _a.ext; userAddress = _b.sent();
return [4 /*yield*/, tbFn_1.getUserAddress().catch(function (err) { if (!userAddress)
tb_1.commonToast(err.errorMessage); return [2 /*return*/, false];
})]; _a = userAddress || {}, name = _a.name, telNumber = _a.telNumber, provinceName = _a.provinceName, cityName = _a.cityName, cityCode = _a.cityCode, countyName = _a.countyName, detailInfo = _a.detailInfo, streetName = _a.streetName;
case 1: params = {
userAddress = _d.sent(); name: name,
_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; phone: telNumber,
params = __assign({ name: name, phone: telNumber, addressDetail: detailInfo, cityCode: cityCode, city: cityName, province: provinceName, area: countyName, streetName: streetName }, params); addressDetail: detailInfo,
if (!userAddress) return [3 /*break*/, 3]; cityCode: cityCode,
return [4 /*yield*/, tb_1.commonConfirm('提示', '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address, function () { city: cityName,
return __awaiter(this, void 0, void 0, function () { province: provinceName,
var result; area: countyName,
return __generator(this, function (_a) { streetName: streetName,
switch (_a.label) { };
case 0: return [4 /*yield*/, request(handle, method, params, ext).catch(function (res) { return [2 /*return*/, {
tb_1.commonToast(res && res.message); params: params,
})]; duibaAddress: userAddress.duibaAddress.address
case 1: }];
result = _a.sent(); }
if (result && result.success) { });
return [2 /*return*/, true]; }); };
} var confirmAddress = function (address) { return __awaiter(void 0, void 0, void 0, function () {
return [2 /*return*/, false]; return __generator(this, function (_a) {
} return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
}); return __generator(this, function (_a) {
}); // @ts-ignore
})]; my.confirm({
case 2: title: '提示',
_c = (_d.sent()); content: '确认使用该收货地址:' + address,
return [3 /*break*/, 4]; success: function (res) {
case 3: if (res.confirm) {
_c = false; resolve(true);
_d.label = 4; }
case 4: else {
confirmResult = _c; resolve(false);
return [2 /*return*/, confirmResult]; }
} },
});
return [2 /*return*/];
}); });
}); }); })];
}, });
getVipInfo: function (params) { }); };
return __awaiter(this, void 0, void 0, function () { /**
var _a, handle, method, ext, result, isVip; * 领取实物奖品
* @param api
* @param data
*/
var receiveObjectPrize = function (api, data) { return __awaiter(void 0, void 0, void 0, function () {
var params, successMsg, errorMsg;
return __generator(this, function (_a) {
params = data.params, successMsg = data.successMsg, errorMsg = data.errorMsg;
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
var userInfo, _params, duibaAddress, name, phone, address, canPass, _a, success, data, message;
return __generator(this, function (_b) { return __generator(this, function (_b) {
switch (_b.label) { switch (_b.label) {
case 0: case 0: return [4 /*yield*/, getUerAddressParam()];
_a = utils_1.getRequestParams(apiList['getVipInfo']), handle = _a.handle, method = _a.method, ext = _a.ext;
return [4 /*yield*/, request(handle, method, params, ext).catch(function (res) {
tb_1.commonToast(res && res.message);
})];
case 1: case 1:
result = _b.sent(); userInfo = _b.sent();
if (result && result.success) { if (!userInfo) {
isVip = result.data.isVip; resolve(false);
return [2 /*return*/, isVip]; return [2 /*return*/];
}
_params = userInfo.params, duibaAddress = userInfo.duibaAddress;
name = _params.name, phone = _params.phone;
address = name + phone + duibaAddress;
return [4 /*yield*/, confirmAddress(address)];
case 2:
canPass = _b.sent();
if (!canPass) {
resolve(false);
return [2 /*return*/];
} }
return [2 /*return*/, false]; return [4 /*yield*/, api(__assign(__assign({}, params), _params))];
case 3:
_a = _b.sent(), success = _a.success, data = _a.data, message = _a.message;
if (success) {
tb_1.commonToast(successMsg);
resolve(true);
}
else {
tb_1.commonToast(errorMsg || message);
resolve(false);
}
return [2 /*return*/];
} }
}); });
}); }); })];
}, });
receiveEnamePrize: function (params) { }); };
return __awaiter(this, void 0, void 0, function () { exports.receiveObjectPrize = receiveObjectPrize;
var _a, handle, method, ext, result; /**
* 领取权益
* @param api
* @param data
*/
var receiveEnamePrize = function (api, data) { return __awaiter(void 0, void 0, void 0, function () {
var params, successMsg, errorMsg;
return __generator(this, function (_a) {
params = data.params, successMsg = data.successMsg, errorMsg = data.errorMsg;
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
var _a, success, data, message;
return __generator(this, function (_b) { return __generator(this, function (_b) {
switch (_b.label) { switch (_b.label) {
case 0: case 0: return [4 /*yield*/, api(params).catch(function (res) {
_a = utils_1.getRequestParams(apiList['receiveEnamePrize']), handle = _a.handle, method = _a.method, ext = _a.ext; tb_1.commonToast(successMsg || res.message);
return [4 /*yield*/, request(handle, method, params, ext).catch(function (res) { resolve(false);
tb_1.commonToast(res && res.message); })];
})];
case 1: case 1:
result = _b.sent(); _a = _b.sent(), success = _a.success, data = _a.data, message = _a.message;
if (result && result.success) { if (success) {
return [2 /*return*/, true]; tb_1.commonToast(successMsg);
resolve(true);
}
else {
tb_1.commonToast(errorMsg || message);
resolve(false);
} }
return [2 /*return*/, false]; return [2 /*return*/];
} }
}); });
}); }); })];
}, });
addStat: function (activityId, type) { }); };
return __awaiter(this, void 0, void 0, function () { exports.receiveEnamePrize = receiveEnamePrize;
var _a, handle, method, ext, result; /**
* 会员优惠券领取
* @param api
* @param data
*/
var receiveMemberEname = function (api, data) { return __awaiter(void 0, void 0, void 0, function () {
var params, successMsg, errorMsg, sellerId, ename, ext;
return __generator(this, function (_a) {
params = data.params, successMsg = data.successMsg, errorMsg = data.errorMsg;
sellerId = params.sellerId, ename = params.ename, ext = __rest(params, ["sellerId", "ename"]);
if (!ename)
return [2 /*return*/, false];
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
var result, _a, success, data_1, message;
return __generator(this, function (_b) { return __generator(this, function (_b) {
switch (_b.label) { switch (_b.label) {
case 0: case 0: return [4 /*yield*/, utils_1.applyActivity({ sellerId: sellerId, activityId: ename })];
_a = utils_1.getRequestParams(apiList['addStat']), handle = _a.handle, method = _a.method, ext = _a.ext;
return [4 /*yield*/, request(handle, method, {
activityId: activityId,
type: type
}, ext).catch(function (res) {
tb_1.commonToast(res && res.message);
})];
case 1: case 1:
result = _b.sent(); result = _b.sent();
if (result && result.success) { if (!result)
return [2 /*return*/, true]; resolve(false);
if (!result.businessSuccess) return [3 /*break*/, 3];
return [4 /*yield*/, api(__assign({}, ext))];
case 2:
_a = _b.sent(), success = _a.success, data_1 = _a.data, message = _a.message;
if (success) {
tb_1.commonToast(successMsg || '奖品发放成功,请前往我的奖品处进行使用');
resolve(true);
}
else {
tb_1.commonToast(errorMsg || message);
resolve(false);
} }
return [2 /*return*/, false]; return [3 /*break*/, 4];
case 3:
tb_1.commonToast(result.errorMsg);
resolve(false);
_b.label = 4;
case 4: return [2 /*return*/];
} }
}); });
}); }); })];
}, });
}; }); };
}; exports.receiveMemberEname = receiveMemberEname;
exports.default = capiFn;
//# sourceMappingURL=capiFn.js.map //# sourceMappingURL=capiFn.js.map
\ No newline at end of file
{"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;4BAEI,KAA4F,WAAW,IAAI,EAAE,EAA3G,IAAI,UAAA,EAAE,SAAS,eAAA,EAAE,YAAY,kBAAA,EAAE,QAAQ,cAAA,EAAE,QAAQ,cAAA,EAAE,UAAU,gBAAA,EAAE,UAAU,gBAAA,EAAE,UAAU,gBAAA,CAAuB;4BACpH,MAAM,cACJ,IAAI,MAAA,EACJ,KAAK,EAAE,SAAS,EAChB,aAAa,EAAE,UAA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,EAAA;;4BAAjE,MAAM,GAAQ,SAAmD;4BACvE,IAAG,CAAC,MAAM;gCAAE,OAAO,CAAC,KAAK,CAAC,CAAA;iCACvB,MAAM,CAAC,eAAe,EAAtB,wBAAsB;4BACc,qBAAM,GAAG,cAAM,GAAG,EAAG,EAAA;;4BAAlD,KAA6B,SAAqB,EAAhD,OAAO,aAAA,EAAE,gBAAI,EAAE,OAAO,aAAA;4BAC9B,IAAG,OAAO,EAAE;gCACR,gBAAW,CAAC,UAAU,IAAI,qBAAqB,CAAC,CAAA;gCAChD,OAAO,CAAC,IAAI,CAAC,CAAA;6BAChB;iCAAK;gCACF,gBAAW,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAA;gCAChC,OAAO,CAAC,KAAK,CAAC,CAAA;6BACjB;;;4BAED,gBAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;4BAC5B,OAAO,CAAC,KAAK,CAAC,CAAA;;;;;iBAErB,CAAC,EAAA;;KACH,CAAA;AArBY,QAAA,kBAAkB,sBAqB9B"}
\ No newline at end of file \ No newline at end of file
...@@ -70,4 +70,18 @@ export declare const validateActivityStatus: (checkParam: { ...@@ -70,4 +70,18 @@ export declare const validateActivityStatus: (checkParam: {
endTime: number; endTime: number;
noCheck: boolean; noCheck: boolean;
}) => Promise<unknown>; }) => Promise<unknown>;
/**
* 查询商家权益活动
* @param sellerId
*/
export declare const getActivity: (sellerId: number) => any[] | Promise<unknown>;
/**
* 领取会员优惠券
* @param params
*/
export declare const applyActivity: (params: {
sellerId: number;
activityId: string;
}) => false | Promise<unknown>;
export declare const getGrade: (sellerId: number) => any[] | Promise<unknown>;
export {}; export {};
...@@ -58,7 +58,7 @@ var __rest = (this && this.__rest) || function (s, e) { ...@@ -58,7 +58,7 @@ var __rest = (this && this.__rest) || function (s, e) {
return t; return t;
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.validateActivityStatus = exports.formatTimeStamp = exports.checkIsMember = exports.getImgShareUrl = exports.throttleHandle = exports.generateAPI = exports.getRequestParams = exports.versionCompare = exports.dateFormatter = void 0; exports.getGrade = exports.applyActivity = exports.getActivity = exports.validateActivityStatus = exports.formatTimeStamp = exports.checkIsMember = exports.getImgShareUrl = exports.throttleHandle = exports.generateAPI = exports.getRequestParams = exports.versionCompare = exports.dateFormatter = void 0;
var tb_1 = require("../core/tb"); var tb_1 = require("../core/tb");
/** /**
* 时间格式化 * 时间格式化
...@@ -275,4 +275,87 @@ var validateActivityStatus = function (checkParam) { return __awaiter(void 0, vo ...@@ -275,4 +275,87 @@ var validateActivityStatus = function (checkParam) { return __awaiter(void 0, vo
}); });
}); }; }); };
exports.validateActivityStatus = validateActivityStatus; exports.validateActivityStatus = validateActivityStatus;
/**
* 查询商家权益活动
* @param sellerId
*/
var getActivity = function (sellerId) {
// @ts-ignore
var memberBenefitPlugin = requirePlugin("memberBenefit");
if (!memberBenefitPlugin)
return [];
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
memberBenefitPlugin.getActivity({
data: {
sellerId: sellerId,
},
success: function (result) {
resolve(result);
},
fail: function (error) {
console.log('获取失败' + JSON.stringify(error));
resolve(error);
}
});
return [2 /*return*/];
});
}); });
};
exports.getActivity = getActivity;
/**
* 领取会员优惠券
* @param params
*/
var applyActivity = function (params) {
var sellerId = params.sellerId, activityId = params.activityId;
// @ts-ignore
var memberBenefitPlugin = requirePlugin("memberBenefit");
if (!memberBenefitPlugin)
return false;
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
memberBenefitPlugin.applyActivity({
data: {
sellerId: sellerId,
activityId: activityId,
},
success: function (result) {
resolve(result);
},
fail: function (error) {
console.warn('领取商家权益失败' + JSON.stringify(error.data));
resolve(error.data);
}
});
return [2 /*return*/];
});
}); });
};
exports.applyActivity = applyActivity;
// 查询商家会员等级
var getGrade = function (sellerId) {
// @ts-ignore
var memberBenefitPlugin = requirePlugin("memberBenefit");
if (!memberBenefitPlugin)
return [];
return new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
memberBenefitPlugin.getGrade({
data: {
sellerId: sellerId
},
success: function (result) {
resolve(result);
},
fail: function (error) {
console.log('查询商家会员等级失败' + JSON.stringify(error));
resolve(error);
}
});
return [2 /*return*/];
});
}); });
};
exports.getGrade = getGrade;
//# sourceMappingURL=index.js.map //# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAwD;AACxD;;;;;GAKG;AACI,IAAM,aAAa,GAAG,UAAC,OAAe,EAAE,MAAqB;IAArB,uBAAA,EAAA,qBAAqB;IAChE,IAAI,CAAC,OAAO;QAAE,OAAO,GAAG,CAAC;IAEzB,IAAM,IAAI,GAAG,IAAI,IAAI,CACnB,OAAO,OAAO,KAAK,QAAQ,IAAI,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CACtF,CAAC;IACF,IAAI,CAAC,GAAG;QACN,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC;QACzB,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;QACpB,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE;QACrB,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;QACvB,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE;QACvB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE;KAC1B,CAAC;IACF,IA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,OAAO,CAAC,MAAM,CAAC,CAAA;gBACnB,CAAC;gBACD,IAAI,EAAE,UAAC,KAAK;oBACR,OAAO,CAAC,IAAI,CAAC,UAAU,GAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAA;oBACnD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;gBACvB,CAAC;aACF,CAAC,CAAC;;;SACR,CAAC,CAAA;AACJ,CAAC,CAAA;AApBY,QAAA,aAAa,iBAoBzB;AACD,WAAW;AACJ,IAAM,QAAQ,GAAG,UAAC,QAAgB;IACvC,aAAa;IACb,IAAM,mBAAmB,GAAG,aAAa,CAAC,eAAe,CAAC,CAAA;IAC1D,IAAG,CAAC,mBAAmB;QAAE,OAAO,EAAE,CAAA;IAClC,OAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAC,MAAM;;YACpC,mBAAmB,CAAC,QAAQ,CAAC;gBACzB,IAAI,EAAE;oBACJ,QAAQ,UAAA;iBACT;gBACD,OAAO,EAAE,UAAC,MAAM;oBACZ,OAAO,CAAC,MAAM,CAAC,CAAA;gBACnB,CAAC;gBACD,IAAI,EAAE,UAAC,KAAK;oBACR,OAAO,CAAC,GAAG,CAAC,YAAY,GAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;oBAC/C,OAAO,CAAC,KAAK,CAAC,CAAA;gBAClB,CAAC;aACF,CAAC,CAAC;;;SACR,CAAC,CAAA;AACJ,CAAC,CAAA;AAlBY,QAAA,QAAQ,YAkBpB"}
\ No newline at end of file \ No newline at end of file
{ {
"name": "tbcc-sdk-ts", "name": "tbcc-sdk-ts",
"version": "1.0.6", "version": "1.0.7",
"description": "", "description": "",
"main": "lib/index.js", "main": "lib/index.js",
"scripts": { "scripts": {
......
...@@ -63,6 +63,7 @@ export const favorShop = async (sellerId: number) => { ...@@ -63,6 +63,7 @@ export const favorShop = async (sellerId: number) => {
} }
let result: { error?: number } = await promisifyApiToTb('favorShop',{ id: +sellerId }) let result: { error?: number } = await promisifyApiToTb('favorShop',{ id: +sellerId })
if(result?.error === 11) return false if(result?.error === 11) return false
if(result?.error === 12) return true
return result return result
}; };
/** /**
......
...@@ -3,7 +3,7 @@ import * as tbFn from './core/tbFn'; ...@@ -3,7 +3,7 @@ import * as tbFn from './core/tbFn';
import * as utils from './utils'; import * as utils from './utils';
import * as constants from './constants'; import * as constants from './constants';
import capi from './request/capi'; import capi from './request/capi';
import capiFn from './request/capiFn'; import * as capiFn from './request/capiFn';
import request from './request'; import request from './request';
export default { export default {
......
const capi = { const capi = {
getMyPrizeList: { getMyAwardsList: {
method: 'GET', method: 'GET',
handle: 'getMyPrizeList', handle: 'getMyAwardsList',
isShowLoading: false isShowLoading: true
}, },
receiveObjectPrize: { method: 'GET', handle: 'receiveObjectPrize' }, receiveObjectPrize: { method: 'GET', handle: 'receiveObjectPrize' },
receiveEnamePrize: { method: 'GET', handle: 'receiveEnamePrize' }, receiveEnamePrize: { method: 'GET', handle: 'receiveEnamePrize' },
getItemListByItemIds: { method: 'GET', handle: 'getItemListByItemIds' }, completeTask: { method: 'GET', handle: 'completeTask' },
getCollectGoodsList: { method: 'GET', handle: 'getCollectGoodsList' }, receiveTask: { method: 'GET', handle: 'receiveTask' },
doCompleteTask: { method: 'GET', handle: 'doCompleteTask' }, getTaskList: { method: 'GET', handle: 'getTaskList' },
getVipInfo: { method: 'GET', handle: 'getVipInfo' } getCollectGoods: { method: 'GET', handle: 'getCollectGoods' },
}; };
export default capi; export default capi;
\ No newline at end of file \ No newline at end of file
import { commonToast, commonConfirm } from '../core/tb'; import { commonToast } from '../core/tb';
import { getUserAddress } from '../core/tbFn'; import { getUserAddress } from '../core/tbFn';
import { getRequestParams } from '../utils'; import { applyActivity } from '../utils';
// 通用API封装方法 // 领取实物
const capiFn = (apiList, request) => { const getUerAddressParam = async () => {
const userAddress: any = await getUserAddress().catch(err => {
commonToast(err.errorMessage);
});
if(!userAddress) return false
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {};
const params = {
name,
phone: telNumber,
addressDetail: detailInfo,
cityCode,
city: cityName,
province: provinceName,
area: countyName,
streetName,
}
return { return {
async receiveObjectPrize(params) { params,
const { handle, method, ext } = getRequestParams(apiList['receiveObjectPrize']); duibaAddress: userAddress.duibaAddress.address
const userAddress: IAddress = await getUserAddress().catch(err => { }
commonToast(err.errorMessage); }
const confirmAddress = async (address) => {
return new Promise(async (resolve,reject) => {
// @ts-ignore
my.confirm({
title: '提示',
content: '确认使用该收货地址:' + address,
success: (res) => {
if(res.confirm) {
resolve(true)
}else {
resolve(false)
}
},
}); });
// if(!userAddress) return false })
const { name, telNumber, provinceName, cityName, cityCode, countyName, detailInfo, streetName } = userAddress || {}; }
params = { /**
name, * 领取实物奖品
phone: telNumber, * @param api
addressDetail: detailInfo, * @param data
cityCode, */
city: cityName, export const receiveObjectPrize = async (api: any, data: IReceivePrize) => {
province: provinceName, const { params, successMsg, errorMsg } = data
area: countyName, return new Promise(async (resolve,reject) => {
streetName, const userInfo = await getUerAddressParam()
...params if(!userInfo) {
resolve(false)
return;
} }
const confirmResult = userAddress ? (await commonConfirm('提示', '确认使用该收货地址:' + name + telNumber + userAddress.duibaAddress.address, async function() { const { params: _params, duibaAddress } = userInfo
const result = await request(handle, method, params, ext).catch(res => { const { name, phone } = _params
commonToast(res && res.message); const address = name + phone + duibaAddress
}); const canPass = await confirmAddress(address)
if (result && result.success) { if(!canPass) {
return true; resolve(false)
} return;
return false
})) : false
return confirmResult
},
async getVipInfo(params) {
const { handle, method, ext } = getRequestParams(apiList['getVipInfo']);
const result = await request(handle, method, params, ext).catch(res => {
commonToast(res && res.message);
});
if (result && result.success) {
const { isVip } = result.data
return isVip;
} }
return false; const { success, data, message } = await api({ ...params, ..._params })
}, if (success) {
commonToast(successMsg)
async receiveEnamePrize(params) { resolve(true)
const { handle, method, ext } = getRequestParams(apiList['receiveEnamePrize']); }else {
const result = await request(handle, method, params, ext).catch(res => { commonToast(errorMsg || message)
commonToast(res && res.message); resolve(false)
});
if (result && result.success) {
return true;
} }
return false; })
}, }
/**
async addStat(activityId: string, type: number | string) { * 领取权益
const { handle, method, ext } = getRequestParams(apiList['addStat']); * @param api
const result = await request(handle, method, { * @param data
activityId, */
type export const receiveEnamePrize = async (api: any, data: IReceivePrize) => {
}, ext).catch(res => { const { params, successMsg, errorMsg } = data
commonToast(res && res.message); return new Promise(async (resolve,reject) => {
const { success, data, message } = await api(params).catch(res => {
commonToast(successMsg || res.message)
resolve(false)
}); });
if (result && result.success) { if (success) {
return true; commonToast(successMsg)
resolve(true)
}else {
commonToast(errorMsg || message)
resolve(false)
} }
return false; })
}, }
} /**
}; * 会员优惠券领取
* @param api
export default capiFn; * @param data
*/
export const receiveMemberEname = async(api: any, data: IReceivePrize) => {
const { params, successMsg, errorMsg } = data
const { sellerId, ename, ...ext } = params
if(!ename) return false
return new Promise(async (resolve,reject) => {
const result: any = await applyActivity({sellerId, activityId: ename })
if(!result) resolve(false)
if(result.businessSuccess) {
const { success, data, message } = await api({ ...ext })
if(success) {
commonToast(successMsg || '奖品发放成功,请前往我的奖品处进行使用')
resolve(true)
}else {
commonToast(errorMsg || message)
resolve(false)
}
}else{
commonToast(result.errorMsg)
resolve(false)
}
})
}
\ No newline at end of file
...@@ -77,4 +77,14 @@ interface ISkuInfo { ...@@ -77,4 +77,14 @@ interface ISkuInfo {
quantity: string quantity: string
} }
declare var my: any declare var my: any
\ No newline at end of file
interface IReceivePrize {
params: {
sellerId: number
ename: string
[key: string]: string | number
}
successMsg: string
errorMsg: string
}
\ No newline at end of file
...@@ -193,4 +193,72 @@ export const validateActivityStatus = async (checkParam: { startTime: number, en ...@@ -193,4 +193,72 @@ export const validateActivityStatus = async (checkParam: { startTime: number, en
resolve(true) resolve(true)
} }
}) })
}
/**
* 查询商家权益活动
* @param sellerId
*/
export const getActivity = (sellerId: number) => {
// @ts-ignore
const memberBenefitPlugin = requirePlugin("memberBenefit")
if(!memberBenefitPlugin) return []
return new Promise(async (resolve,reject) => {
memberBenefitPlugin.getActivity({
data: {
sellerId,
},
success: (result) => {
resolve(result)
},
fail: (error) => {
console.log('获取失败'+JSON.stringify(error))
resolve(error)
}
});
})
}
/**
* 领取会员优惠券
* @param params
*/
export const applyActivity = (params: { sellerId: number, activityId: string }) => {
const { sellerId, activityId } = params
// @ts-ignore
const memberBenefitPlugin = requirePlugin("memberBenefit")
if(!memberBenefitPlugin) return false
return new Promise(async (resolve,reject) => {
memberBenefitPlugin.applyActivity({
data: {
sellerId,
activityId,
},
success: (result) => {
resolve(result)
},
fail: (error) => {
console.warn('领取商家权益失败'+JSON.stringify(error.data))
resolve(error.data)
}
});
})
}
// 查询商家会员等级
export const getGrade = (sellerId: number) => {
// @ts-ignore
const memberBenefitPlugin = requirePlugin("memberBenefit")
if(!memberBenefitPlugin) return []
return new Promise(async (resolve,reject) => {
memberBenefitPlugin.getGrade({
data: {
sellerId
},
success: (result) => {
resolve(result)
},
fail: (error) => {
console.log('查询商家会员等级失败'+JSON.stringify(error))
resolve(error)
}
});
})
} }
\ No newline at end of file
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