Commit 382fc3c3 authored by mqf_0707's avatar mqf_0707

新增授权及会员优惠券等常用API

parent 9c028b13
......@@ -6,28 +6,39 @@ import { AudioModel } from '../helpers';
* @param {function} successCb 成功回调
*/
export declare const commonToast: (content: string, duration?: number, successCb?: () => any) => void;
/**
* 通用toast
* @param {string} content toast内容
* @param {number} duration 显示时长
* @param {function} successCb 成功回调
*/
export declare const showToast: (params: {
content: string;
duration?: number;
success?: () => any;
}, Taro?: any) => void;
/**
* 简易alert
* @param {string} content toast内容
*/
export declare const simpleAlert: (content: string) => void;
export declare const simpleAlert: (content: string, Taro?: any) => void;
/**
* 通用确认弹窗
* @param {string} title 标题
* @param {string} content 内容
* @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, Taro?: any) => Promise<void>;
/**
* 获取系统信息
*/
export declare const getSystemInfo: () => Promise<unknown>;
export declare const getSystemInfo: (Taro?: any) => Promise<unknown>;
/**
* 执行关注店铺
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
export declare const favorShop: (sellerId: number) => Promise<boolean | {
export declare const favorShop: (sellerId?: number, Taro?: any) => Promise<boolean | {
error?: number;
}>;
/**
......@@ -35,34 +46,34 @@ export declare const favorShop: (sellerId: number) => Promise<boolean | {
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
export declare const checkShopFavoredStatus: (sellerId: number) => Promise<boolean | {
export declare const checkShopFavoredStatus: (sellerId?: number, Taro?: any) => Promise<boolean | {
isFavor?: boolean;
}>;
/**
* 跳转到外部链接
* @param {string} url 跳转链接
*/
export declare const navigateToOutside: (url: any) => boolean;
export declare const navigateToOutside: (url: string, Taro?: any) => boolean;
/**
* 跳转到内部链接(新开窗口)
* @param {string} url 跳转链接
*/
export declare const navigateTo: (url: any) => boolean;
export declare const navigateTo: (url: string, Taro?: any) => boolean;
/**
* 返回页面
* @param {number} delta
*/
export declare const navigateBack: (delta?: number) => void;
export declare const navigateBack: (delta?: number, Taro?: any) => void;
/**
* 跳转到内部链接(不新开窗口)
* @param {string} url
*/
export declare const redirectTo: (url: string) => boolean;
export declare const redirectTo: (url: string, Taro?: any) => boolean;
/**
* 获取服务器时间
* @returns {number} 服务器时间戳
*/
export declare const getServerTime: () => Promise<string | {
export declare const getServerTime: (Taro?: any) => Promise<string | {
time?: string;
}>;
/**
......@@ -70,7 +81,7 @@ export declare const getServerTime: () => Promise<string | {
* @param {number} 商品id
* @returns {object} 收藏结果
*/
export declare const collectGoods: (id: number) => Promise<false | {
export declare const collectGoods: (id: number, Taro?: any) => Promise<false | {
error?: number;
}>;
/**
......@@ -78,14 +89,14 @@ export declare const collectGoods: (id: number) => Promise<false | {
* @param {number} 商品id
* @returns {boolean} 商品收场状态
*/
export declare const checkGoodsCollectedStatus: (id: number) => Promise<boolean | {
export declare const checkGoodsCollectedStatus: (id: number, Taro?: any) => Promise<boolean | {
isCollect?: boolean;
}>;
/**
* 跳转到淘宝商品页
* @param {string} itemId 商品ID
*/
export declare const openDetail: (itemId: string) => Promise<unknown>;
export declare const openDetail: (itemId: string, Taro?: any) => Promise<unknown>;
/**
* 创建音频实例
* @param {object} opts 配置对象 例 { src: '音频链接', autoplay: false }
......@@ -93,41 +104,41 @@ export declare const openDetail: (itemId: string) => Promise<unknown>;
export declare const createAudio: (opts: {
src: string;
autoplay?: boolean;
}) => AudioModel;
}, Taro?: any) => AudioModel;
/**
* 获取图片信息
* @param {string} src 图片地址
*/
export declare const getImageInfo: (src: string) => Promise<unknown>;
export declare const getImageInfo: (src: string, Taro?: any) => Promise<unknown>;
/**
* 剪切板
* @param {text: string}
*/
export declare const setClipboard: (text: string) => Promise<unknown>;
export declare const setClipboard: (text: string, Taro?: any) => Promise<unknown>;
/**
* 调起分享面板
*/
export declare const showSharePanel: () => Promise<void>;
export declare const showSharePanel: (Taro?: any) => Promise<void>;
/**
* 隐藏分享面板
*/
export declare const hideShareMenu: () => Promise<void>;
export declare const hideShareMenu: (Taro?: any) => Promise<void>;
/**
* 获取缓存数据
* @param key
*/
export declare const getStorage: (key: string) => Promise<string>;
export declare const getStorage: (key: string, Taro?: any) => Promise<string>;
/**
* 设置缓存数据
* @param key
* @param value
*/
export declare const setStorage: (key: string, value: any) => Promise<unknown>;
export declare const setStorage: (key: string, value: any, Taro?: any) => Promise<unknown>;
/**
* 清除缓存数据
* @param key
*/
export declare const removeStorage: (key: string) => Promise<unknown>;
export declare const removeStorage: (key: string, Taro?: any) => Promise<unknown>;
/**
* 自定义分析数据的上报接口
* @param eventType
......@@ -139,20 +150,31 @@ export declare const taobaoReportClick: (eventType: string, logkey: string) => v
* @param sellerNick
* @param itemId
*/
export declare const openMessage: (sellerNick: string, itemId: string) => Promise<unknown>;
export declare const openMessage: (param: {
sellerNick: string;
itemId: string;
}, Taro?: any) => Promise<unknown>;
/**
* 显示指定商品 SKU 选择器
* @param itemId
*/
export declare const showSkuModal: (itemId: string) => Promise<unknown>;
export declare const showSkuModal: (itemId: string, Taro?: any) => Promise<unknown>;
/**
* 隐藏正在展示的商品 SKU 选择器
*/
export declare const hideSkuModal: () => Promise<unknown>;
export declare const hideSkuModal: (Taro?: any) => Promise<unknown>;
/**
* 跳转订单页
* @param itemId
* @param skuId
* @param quantity
*/
export declare const confirmCustomOrder: (itemId: number, skuId?: number, quantity?: number) => Promise<unknown>;
export declare const confirmCustomOrder: (param: {
itemId: number;
skuId?: number;
quantity?: number;
}, Taro?: any) => Promise<unknown>;
export declare const getSetting: (Taro?: any) => Promise<unknown>;
export declare const openSetting: (Taro?: any) => Promise<unknown>;
export declare const getAuthUserInfo: (Taro?: any) => Promise<unknown>;
export declare const authorize: (scopeInfo: any, Taro?: any) => Promise<unknown>;
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
......@@ -36,7 +47,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.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;
exports.authorize = exports.getAuthUserInfo = exports.openSetting = exports.getSetting = 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.showToast = exports.commonToast = void 0;
var helpers_1 = require("../helpers");
/**
* 通用toast
......@@ -52,14 +63,30 @@ var commonToast = function (content, duration, successCb) {
});
};
exports.commonToast = commonToast;
/**
* 通用toast
* @param {string} content toast内容
* @param {number} duration 显示时长
* @param {function} successCb 成功回调
*/
var showToast = function (params, Taro) {
var _a;
var content = params.content, duration = params.duration, success = params.success;
helpers_1.promisifyApiSimple('showToast', (_a = {},
_a[Taro ? 'title' : 'content'] = content || '换个姿势再试一次~',
_a.duration = duration || 3000,
_a.success = success,
_a), null, Taro);
};
exports.showToast = showToast;
/**
* 简易alert
* @param {string} content toast内容
*/
var simpleAlert = function (content) {
var simpleAlert = function (content, Taro) {
helpers_1.promisifyApiSimple('alert', {
content: content
});
}, null, Taro);
};
exports.simpleAlert = simpleAlert;
/**
......@@ -68,7 +95,7 @@ exports.simpleAlert = simpleAlert;
* @param {string} content 内容
* @param {function} successCb 成功回调
*/
var commonConfirm = function (title, content, successCb) {
var commonConfirm = function (title, content, successCb, Taro) {
if (title === void 0) { title = '提示'; }
return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
......@@ -83,7 +110,7 @@ var commonConfirm = function (title, content, successCb) {
successCb && successCb();
}
}
});
}, null, Taro);
return [2 /*return*/];
});
});
......@@ -92,10 +119,10 @@ exports.commonConfirm = commonConfirm;
/**
* 获取系统信息
*/
var getSystemInfo = function () { return __awaiter(void 0, void 0, void 0, function () {
var getSystemInfo = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getSystemInfo', {})];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getSystemInfo', {}, Taro)];
case 1: return [2 /*return*/, _a.sent()];
}
});
......@@ -106,7 +133,7 @@ exports.getSystemInfo = getSystemInfo;
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
var favorShop = function (sellerId) { return __awaiter(void 0, void 0, void 0, function () {
var favorShop = function (sellerId, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -114,7 +141,7 @@ var favorShop = function (sellerId) { return __awaiter(void 0, void 0, void 0, f
if (!sellerId) {
return [2 /*return*/, false];
}
return [4 /*yield*/, helpers_1.promisifyApiToTb('favorShop', { id: +sellerId })];
return [4 /*yield*/, helpers_1.promisifyApiToTb('favorShop', { id: +sellerId }, Taro)];
case 1:
result = _a.sent();
if ((result === null || result === void 0 ? void 0 : result.error) === 11)
......@@ -131,7 +158,7 @@ exports.favorShop = favorShop;
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
var checkShopFavoredStatus = function (sellerId) { return __awaiter(void 0, void 0, void 0, function () {
var checkShopFavoredStatus = function (sellerId, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -139,7 +166,7 @@ var checkShopFavoredStatus = function (sellerId) { return __awaiter(void 0, void
if (!sellerId) {
return [2 /*return*/, false];
}
return [4 /*yield*/, helpers_1.promisifyApiToTb('checkShopFavoredStatus', { id: +sellerId })];
return [4 /*yield*/, helpers_1.promisifyApiToTb('checkShopFavoredStatus', { id: +sellerId }, Taro)];
case 1:
result = _a.sent();
if ((result === null || result === void 0 ? void 0 : result.isFavor) !== undefined)
......@@ -155,63 +182,63 @@ exports.checkShopFavoredStatus = checkShopFavoredStatus;
* 跳转到外部链接
* @param {string} url 跳转链接
*/
var navigateToOutside = function (url) {
var navigateToOutside = function (url, Taro) {
if (!url) {
console.error('navigateToOutside: 请传入url');
return false;
}
helpers_1.promisifyApiSimple('call', {
url: url
}, 'navigateToOutside');
}, 'navigateToOutside', Taro);
};
exports.navigateToOutside = navigateToOutside;
/**
* 跳转到内部链接(新开窗口)
* @param {string} url 跳转链接
*/
var navigateTo = function (url) {
var navigateTo = function (url, Taro) {
if (!url) {
console.error('navigateTo: 请传入url');
return false;
}
helpers_1.promisifyApiSimple('navigateTo', {
url: url
});
}, null, Taro);
};
exports.navigateTo = navigateTo;
/**
* 返回页面
* @param {number} delta
*/
var navigateBack = function (delta) {
var navigateBack = function (delta, Taro) {
helpers_1.promisifyApiSimple('navigateBack', {
delta: delta
});
}, null, Taro);
};
exports.navigateBack = navigateBack;
/**
* 跳转到内部链接(不新开窗口)
* @param {string} url
*/
var redirectTo = function (url) {
var redirectTo = function (url, Taro) {
if (!url) {
console.error('redirectTo: 请传入url');
return false;
}
helpers_1.promisifyApiSimple('redirectTo', {
url: url
});
}, null, Taro);
};
exports.redirectTo = redirectTo;
/**
* 获取服务器时间
* @returns {number} 服务器时间戳
*/
var getServerTime = function () { return __awaiter(void 0, void 0, void 0, function () {
var getServerTime = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getServerTime', {})];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getServerTime', {}, Taro)];
case 1:
result = _a.sent();
if (result === null || result === void 0 ? void 0 : result.time)
......@@ -226,7 +253,7 @@ exports.getServerTime = getServerTime;
* @param {number} 商品id
* @returns {object} 收藏结果
*/
var collectGoods = function (id) { return __awaiter(void 0, void 0, void 0, function () {
var collectGoods = function (id, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -235,7 +262,7 @@ var collectGoods = function (id) { return __awaiter(void 0, void 0, void 0, func
console.error('collectGoods: 请传入商品id');
return [2 /*return*/, false];
}
return [4 /*yield*/, helpers_1.promisifyApiToTb('collectGoods', { id: +id })];
return [4 /*yield*/, helpers_1.promisifyApiToTb('collectGoods', { id: +id }, Taro)];
case 1:
result = _a.sent();
if ((result === null || result === void 0 ? void 0 : result.error) === 11)
......@@ -250,7 +277,7 @@ exports.collectGoods = collectGoods;
* @param {number} 商品id
* @returns {boolean} 商品收场状态
*/
var checkGoodsCollectedStatus = function (id) { return __awaiter(void 0, void 0, void 0, function () {
var checkGoodsCollectedStatus = function (id, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
......@@ -259,7 +286,7 @@ var checkGoodsCollectedStatus = function (id) { return __awaiter(void 0, void 0,
console.error('checkGoodsCollectedStatus: 请传入商品id');
return [2 /*return*/, false];
}
return [4 /*yield*/, helpers_1.promisifyApiToTb('checkGoodsCollectedStatus', { id: +id })];
return [4 /*yield*/, helpers_1.promisifyApiToTb('checkGoodsCollectedStatus', { id: +id }, Taro)];
case 1:
result = _a.sent();
if (result === null || result === void 0 ? void 0 : result.isCollect)
......@@ -273,7 +300,7 @@ exports.checkGoodsCollectedStatus = checkGoodsCollectedStatus;
* 跳转到淘宝商品页
* @param {string} itemId 商品ID
*/
var openDetail = function (itemId) { return __awaiter(void 0, void 0, void 0, function () {
var openDetail = function (itemId, Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
......@@ -281,7 +308,7 @@ var openDetail = function (itemId) { return __awaiter(void 0, void 0, void 0, fu
console.error('openDetail: 请传入商品id');
return [2 /*return*/, false];
}
return [4 /*yield*/, helpers_1.promisifyApiToTb('openDetail', { itemId: String(itemId) })];
return [4 /*yield*/, helpers_1.promisifyApiToTb('openDetail', { itemId: String(itemId) }, Taro)];
case 1: return [2 /*return*/, _a.sent()];
}
});
......@@ -291,8 +318,8 @@ exports.openDetail = openDetail;
* 创建音频实例
* @param {object} opts 配置对象 例 { src: '音频链接', autoplay: false }
*/
var createAudio = function (opts) {
var audioInstance = new helpers_1.AudioModel(opts);
var createAudio = function (opts, Taro) {
var audioInstance = new helpers_1.AudioModel(__assign({ Taro: Taro }, opts));
return audioInstance;
};
exports.createAudio = createAudio;
......@@ -300,10 +327,10 @@ exports.createAudio = createAudio;
* 获取图片信息
* @param {string} src 图片地址
*/
var getImageInfo = function (src) { return __awaiter(void 0, void 0, void 0, function () {
var getImageInfo = function (src, Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getImageInfo', { src: src })];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getImageInfo', { src: src }, Taro)];
case 1: return [2 /*return*/, _a.sent()];
}
});
......@@ -313,10 +340,10 @@ exports.getImageInfo = getImageInfo;
* 剪切板
* @param {text: string}
*/
var setClipboard = function (text) { return __awaiter(void 0, void 0, void 0, function () {
var setClipboard = function (text, Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('setClipboard', { text: text })];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('setClipboard', { text: text }, Taro)];
case 1: return [2 /*return*/, _a.sent()];
}
});
......@@ -325,9 +352,9 @@ exports.setClipboard = setClipboard;
/**
* 调起分享面板
*/
var showSharePanel = function () { return __awaiter(void 0, void 0, void 0, function () {
var showSharePanel = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
helpers_1.promisifyApiSimple('showSharePanel', {});
helpers_1.promisifyApiSimple('showSharePanel', {}, null, Taro);
return [2 /*return*/];
});
}); };
......@@ -335,9 +362,9 @@ exports.showSharePanel = showSharePanel;
/**
* 隐藏分享面板
*/
var hideShareMenu = function () { return __awaiter(void 0, void 0, void 0, function () {
var hideShareMenu = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
helpers_1.promisifyApiSimple('hideShareMenu', {});
helpers_1.promisifyApiSimple('hideShareMenu', {}, null, Taro);
return [2 /*return*/];
});
}); };
......@@ -346,11 +373,11 @@ exports.hideShareMenu = hideShareMenu;
* 获取缓存数据
* @param key
*/
var getStorage = function (key) { return __awaiter(void 0, void 0, void 0, function () {
var getStorage = function (key, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getStorage', { key: key })];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('getStorage', { key: key }, Taro)];
case 1:
result = _a.sent();
if (result === null || result === void 0 ? void 0 : result.data)
......@@ -365,10 +392,10 @@ exports.getStorage = getStorage;
* @param key
* @param value
*/
var setStorage = function (key, value) { return __awaiter(void 0, void 0, void 0, function () {
var setStorage = function (key, value, Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('setStorage', { key: key, data: value })];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('setStorage', { key: key, data: value }, Taro)];
case 1: return [2 /*return*/, _a.sent()];
}
});
......@@ -378,10 +405,10 @@ exports.setStorage = setStorage;
* 清除缓存数据
* @param key
*/
var removeStorage = function (key) { return __awaiter(void 0, void 0, void 0, function () {
var removeStorage = function (key, Taro) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApi('removeStorage', { key: key })];
case 0: return [4 /*yield*/, helpers_1.promisifyApi('removeStorage', { key: key }, Taro)];
case 1: return [2 /*return*/, _a.sent()];
}
});
......@@ -405,11 +432,13 @@ exports.taobaoReportClick = taobaoReportClick;
* @param sellerNick
* @param itemId
*/
var openMessage = function (sellerNick, itemId) { return __awaiter(void 0, void 0, void 0, function () {
var result;
var openMessage = function (param, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var sellerNick, itemId, result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApiToTb('openMessage', { sellerNick: sellerNick, forceH5: false, params: { itemId: itemId } })];
case 0:
sellerNick = param.sellerNick, itemId = param.itemId;
return [4 /*yield*/, helpers_1.promisifyApiToTb('openMessage', { sellerNick: sellerNick, forceH5: false, params: { itemId: itemId } }, Taro)];
case 1:
result = _a.sent();
return [2 /*return*/, result];
......@@ -421,11 +450,11 @@ exports.openMessage = openMessage;
* 显示指定商品 SKU 选择器
* @param itemId
*/
var showSkuModal = function (itemId) { return __awaiter(void 0, void 0, void 0, function () {
var showSkuModal = function (itemId, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApiToTb('showSku', { itemId: itemId })];
case 0: return [4 /*yield*/, helpers_1.promisifyApiToTb('showSku', { itemId: itemId }, Taro)];
case 1:
result = _a.sent();
return [2 /*return*/, result];
......@@ -436,11 +465,11 @@ exports.showSkuModal = showSkuModal;
/**
* 隐藏正在展示的商品 SKU 选择器
*/
var hideSkuModal = function () { return __awaiter(void 0, void 0, void 0, function () {
var hideSkuModal = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
var result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApiToTb('hideSku', {})];
case 0: return [4 /*yield*/, helpers_1.promisifyApiToTb('hideSku', {}, Taro)];
case 1:
result = _a.sent();
return [2 /*return*/, result];
......@@ -454,18 +483,20 @@ exports.hideSkuModal = hideSkuModal;
* @param skuId
* @param quantity
*/
var confirmCustomOrder = function (itemId, skuId, quantity) { return __awaiter(void 0, void 0, void 0, function () {
var result;
var confirmCustomOrder = function (param, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var itemId, skuId, quantity, result;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, helpers_1.promisifyApiToTb('confirmCustomOrder', {
case 0:
itemId = param.itemId, skuId = param.skuId, quantity = param.quantity;
return [4 /*yield*/, helpers_1.promisifyApiToTb('confirmCustomOrder', {
data: {
itemId: itemId,
skuId: skuId || -1,
quantity: quantity || 1,
customization: {}
}
})];
}, Taro)];
case 1:
result = _a.sent();
return [2 /*return*/, result];
......@@ -473,4 +504,80 @@ var confirmCustomOrder = function (itemId, skuId, quantity) { return __awaiter(v
});
}); };
exports.confirmCustomOrder = confirmCustomOrder;
// 获取授权信息
var getSetting = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
var _Taro;
return __generator(this, function (_a) {
_Taro = Taro || my;
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
_Taro.getSetting({
success: function (res) {
resolve(res);
},
});
return [2 /*return*/];
});
}); })];
});
}); };
exports.getSetting = getSetting;
// 打开授权设置
var openSetting = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
var _Taro;
return __generator(this, function (_a) {
_Taro = Taro || my;
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
_Taro.openSetting({
success: function (res) {
resolve(res);
},
});
return [2 /*return*/];
});
}); })];
});
}); };
exports.openSetting = openSetting;
// 获取用户信息
var getAuthUserInfo = function (Taro) { return __awaiter(void 0, void 0, void 0, function () {
var _Taro;
return __generator(this, function (_a) {
_Taro = Taro || my;
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
_Taro.getAuthUserInfo({
success: function (res) {
resolve(res);
},
});
return [2 /*return*/];
});
}); })];
});
}); };
exports.getAuthUserInfo = getAuthUserInfo;
// 发起用户授权{ groupChat: 群聊, userInfo: 用户基本信息, addressList: 地址列表, clipboard: 粘贴 }
var authorize = function (scopeInfo, Taro) { return __awaiter(void 0, void 0, void 0, function () {
var _Taro;
return __generator(this, function (_a) {
_Taro = Taro || my;
return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(void 0, void 0, void 0, function () {
return __generator(this, function (_a) {
_Taro.authorize({
scopes: scopeInfo || 'scope.userInfo',
success: function (res) {
resolve(res);
},
fail: function (err) {
reject(err);
}
});
return [2 /*return*/];
});
}); })];
});
}); };
exports.authorize = authorize;
//# sourceMappingURL=tb.js.map
\ No newline at end of file
{"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;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,OAAO,CAAC,UAAO,OAAO,EAAC,MAAM;;oBACpC,KAAK,CAAC,SAAS,CAAC;wBACZ,MAAM,EAAE,SAAS,IAAI,gBAAgB;wBACrC,OAAO,EAAE,UAAC,GAAG;4BACT,OAAO,CAAC,GAAG,CAAC,CAAA;wBAChB,CAAC;wBACD,IAAI,EAAE,UAAC,GAAG;4BACN,MAAM,CAAC,GAAG,CAAC,CAAA;wBACf,CAAC;qBACJ,CAAC,CAAC;;;iBACN,CAAC,EAAA;;KACL,CAAA;AAdY,QAAA,SAAS,aAcrB"}
\ No newline at end of file
......@@ -64,13 +64,12 @@ var getUserAddress = function (opts) {
joinTag: '' // 分割收货地址符号(淘宝商家有特定发货需求)
};
_opts = Object.assign({}, defaults, opts);
return [2 /*return*/, new Promise(function (resolve, reject) {
// @ts-ignore
return [2 /*return*/, new Promise(function (resolve, reject) {
my.authorize({
scopes: 'scope.addressList',
success: function () {
var addAddress = _opts.addAddress, searchAddress = _opts.searchAddress, locateAddress = _opts.locateAddress, joinTag = _opts.joinTag;
// @ts-ignore
if (!my.tb.chooseAddress) {
reject({
noSupport: true,
......@@ -78,7 +77,6 @@ var getUserAddress = function (opts) {
});
return false;
}
// @ts-ignore
my.tb.chooseAddress({
addAddress: addAddress,
searchAddress: searchAddress,
......@@ -125,8 +123,8 @@ var chooseImage = function (opts) {
};
_opts = Object.assign({}, defaults, opts);
count = _opts.count, sourceType = _opts.sourceType, compressLevel = _opts.compressLevel;
return [2 /*return*/, new Promise(function (resolve, reject) {
// @ts-ignore
return [2 /*return*/, new Promise(function (resolve, reject) {
if (!my.chooseImage) {
reject({
noSupport: true,
......@@ -134,12 +132,10 @@ var chooseImage = function (opts) {
});
return false;
}
// @ts-ignore
my.chooseImage({
count: count,
sourceType: sourceType,
success: function (res) {
// @ts-ignore
my.compressImage({
apFilePaths: res.apFilePaths,
level: compressLevel,
......
{"version":3,"file":"tbFn.js","sourceRoot":"","sources":["../../src/core/tbFn.ts"],"names":[],"mappings":";;;;;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,MAAc;IAClD,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QAClC,aAAa;QACb,EAAE,CAAC,EAAE,CAAC,oBAAoB,CAAC;YAC1B,OAAO,EAAC,MAAM;YACd,SAAS,EAAC;gBACT,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;gBACtB,WAAW,EAAC,cAAc;gBAC1B,cAAc,EAAC,WAAW;aAC1B;YACD,OAAO,EAAE,UAAC,GAAG;gBACZ,OAAO,CAAC,IAAI,CAAC,CAAA;YACd,CAAC;YACD,IAAI,EAAE,UAAC,GAAG;gBACT,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;YAClB,CAAC;SACD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAA;AACH,CAAC,CAAA;AAlBY,QAAA,oBAAoB,wBAkBhC"}
\ No newline at end of file
......@@ -4,25 +4,26 @@
* @param params
* @param name
*/
export declare const promisifyApiSimple: (methodName: string, params: IParamJSAPI, name?: string) => void;
export declare const promisifyApiSimple: (methodName?: string, params?: IParamJSAPI, name?: string, Taro?: any) => void;
/**
* 通用API封装
* @param methodName
* @param params
*/
export declare const promisifyApi: (methodName: string, params?: {}) => Promise<unknown>;
export declare const promisifyApi: (methodName?: string, params?: {}, Taro?: any) => Promise<unknown>;
/**
* 通用API封装
* @param methodName
* @param params
*/
export declare const promisifyApiToTb: (methodName: string, params?: {}) => Promise<unknown>;
export declare const promisifyApiToTb: (methodName?: string, params?: {}, Taro?: any) => Promise<unknown>;
/**
* 创建音频类
*/
export declare class AudioModel {
constructor(opts: {
src: string;
Taro?: any;
});
}
/**
......
......@@ -55,14 +55,14 @@ var tb_1 = require("../core/tb");
* @param params
* @param name
*/
var promisifyApiSimple = function (methodName, params, name) {
if (name) {
var promisifyApiSimple = function (methodName, params, name, Taro) {
// @ts-ignore
my[methodName](name, params);
var _Taro = Taro || my;
if (name) {
_Taro[methodName](name, params);
return;
}
// @ts-ignore
my[methodName](params);
_Taro[methodName](params);
};
exports.promisifyApiSimple = promisifyApiSimple;
/**
......@@ -70,11 +70,12 @@ exports.promisifyApiSimple = promisifyApiSimple;
* @param methodName
* @param params
*/
var promisifyApi = function (methodName, params) {
var promisifyApi = function (methodName, params, Taro) {
if (params === void 0) { params = {}; }
return new Promise(function (resolve, reject) {
// @ts-ignore
my[methodName](__assign(__assign({}, params), { success: function (res) {
var _Taro = Taro || my;
return new Promise(function (resolve, reject) {
_Taro[methodName](__assign(__assign({}, params), { success: function (res) {
resolve(res);
}, fail: function (err) {
reject(err);
......@@ -87,11 +88,13 @@ exports.promisifyApi = promisifyApi;
* @param methodName
* @param params
*/
var promisifyApiToTb = function (methodName, params) {
var promisifyApiToTb = function (methodName, params, Taro) {
if (params === void 0) { params = {}; }
// @ts-ignore
var _Taro = Taro || my;
return new Promise(function (resolve, reject) {
// @ts-ignore
my.tb[methodName](__assign(__assign({}, params), { success: function (res) {
_Taro.tb[methodName](__assign(__assign({}, params), { success: function (res) {
resolve(res);
}, fail: function (err) {
reject(err);
......@@ -104,14 +107,15 @@ exports.promisifyApiToTb = promisifyApiToTb;
*/
var AudioModel = /** @class */ (function () {
function AudioModel(opts) {
var src = opts.src;
var Taro = opts.Taro, src = opts.src;
if (!src) {
console.error('请输入音频链接');
return false;
}
try {
// @ts-ignore
var innerAudioContext_1 = my.createInnerAudioContext();
var _Taro = Taro || my;
var innerAudioContext_1 = _Taro.createInnerAudioContext();
Object.keys(opts).forEach(function (item) {
innerAudioContext_1[item] = opts[item];
});
......
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAwC;AACxC;;;;;GAKG;AACI,IAAM,kBAAkB,GAAG,UAAC,UAAkB,EAAE,MAAmB,EAAE,IAAa;IACrF,IAAG,IAAI,EAAE;QACL,aAAa;QACb,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,EAAC,MAAM,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promise<unknown>;
navigateToTaobaoPage: (shopId: string) => Promise<unknown>;
commonToast: (content: string, duration?: number, successCb?: () => any) => void;
simpleAlert: (content: string) => void;
commonConfirm: (title: string, content: string, successCb?: () => any) => Promise<void>;
getSystemInfo: () => Promise<unknown>;
favorShop: (sellerId: number) => Promise<boolean | {
showToast: (params: {
content: string;
duration?: number;
success?: () => any;
}, Taro?: any) => void;
simpleAlert: (content: string, Taro?: any) => void;
commonConfirm: (title?: string, content?: string, successCb?: () => any, Taro?: any) => Promise<void>;
getSystemInfo: (Taro?: any) => Promise<unknown>;
favorShop: (sellerId?: number, Taro?: any) => Promise<boolean | {
error?: number;
}>;
checkShopFavoredStatus: (sellerId: number) => Promise<boolean | {
checkShopFavoredStatus: (sellerId?: number, Taro?: any) => Promise<boolean | {
isFavor?: boolean;
}>;
navigateToOutside: (url: any) => boolean;
navigateTo: (url: any) => boolean;
navigateBack: (delta?: number) => void;
redirectTo: (url: string) => boolean;
getServerTime: () => Promise<string | {
navigateToOutside: (url: string, Taro?: any) => boolean;
navigateTo: (url: string, Taro?: any) => boolean;
navigateBack: (delta?: number, Taro?: any) => void;
redirectTo: (url: string, Taro?: any) => boolean;
getServerTime: (Taro?: any) => Promise<string | {
time?: string;
}>;
collectGoods: (id: number) => Promise<false | {
collectGoods: (id: number, Taro?: any) => Promise<false | {
error?: number;
}>;
checkGoodsCollectedStatus: (id: number) => Promise<boolean | {
checkGoodsCollectedStatus: (id: number, Taro?: any) => Promise<boolean | {
isCollect?: boolean;
}>;
openDetail: (itemId: string) => Promise<unknown>;
openDetail: (itemId: string, Taro?: any) => Promise<unknown>;
createAudio: (opts: {
src: string;
autoplay?: boolean;
}) => import("./helpers").AudioModel;
getImageInfo: (src: string) => Promise<unknown>;
setClipboard: (text: string) => Promise<unknown>;
showSharePanel: () => Promise<void>;
hideShareMenu: () => Promise<void>;
getStorage: (key: string) => Promise<string>;
setStorage: (key: string, value: any) => Promise<unknown>;
removeStorage: (key: string) => Promise<unknown>;
}, Taro?: any) => import("./helpers").AudioModel;
getImageInfo: (src: string, Taro?: any) => Promise<unknown>;
setClipboard: (text: string, Taro?: any) => Promise<unknown>;
showSharePanel: (Taro?: any) => Promise<void>;
hideShareMenu: (Taro?: any) => Promise<void>;
getStorage: (key: string, Taro?: any) => Promise<string>;
setStorage: (key: string, value: any, Taro?: any) => Promise<unknown>;
removeStorage: (key: string, Taro?: any) => Promise<unknown>;
taobaoReportClick: (eventType: string, logkey: string) => void;
openMessage: (sellerNick: string, itemId: string) => Promise<unknown>;
showSkuModal: (itemId: string) => Promise<unknown>;
hideSkuModal: () => Promise<unknown>;
confirmCustomOrder: (itemId: number, skuId?: number, quantity?: number) => Promise<unknown>;
openMessage: (param: {
sellerNick: string;
itemId: string;
}, Taro?: any) => Promise<unknown>;
showSkuModal: (itemId: string, Taro?: any) => Promise<unknown>;
hideSkuModal: (Taro?: any) => Promise<unknown>;
confirmCustomOrder: (param: {
itemId: number;
skuId?: number;
quantity?: number;
}, Taro?: any) => Promise<unknown>;
getSetting: (Taro?: any) => Promise<unknown>;
openSetting: (Taro?: any) => Promise<unknown>;
authorize: (scopeInfo: any, Taro?: any) => Promise<unknown>;
};
utils: typeof utils;
request: (header: IRequest) => false | ((handle: any, method: string, params: any, ext?: {
......
{"version":3,"file":"capiFn.js","sourceRoot":"","sources":["../../src/request/capiFn.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAyC;AACzC,qCAA8C;AAC9C,kCAAyC;AAEzC,OAAO;AACP,IAAM,kBAAkB,GAAG;;;;oBACA,qBAAM,qBAAc,EAAE,CAAC,KAAK,CAAC,UAAA,GAAG;oBACrD,gBAAW,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;gBAClC,CAAC,CAAC,EAAA;;gBAFI,WAAW,GAAQ,SAEvB;gBACF,IAAG,CAAC,WAAW;oBAAE,sBAAO,KAAK,EAAA;gBACvB,K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2B,IAAI,OAA/B,EAAE,UAAU,GAAe,IAAI,WAAnB,EAAE,QAAQ,GAAK,IAAI,SAAT,CAAS;QACrC,QAAQ,GAAoB,MAAM,SAA1B,EAAE,KAAK,GAAa,MAAM,MAAnB,EAAK,GAAG,UAAK,MAAM,EAApC,qBAA2B,CAAF,CAAW;QAC1C,IAAG,CAAC,KAAK;YAAE,sBAAO,KAAK,EAAA;QACvB,sBAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAC,MAAM;;;;gCAChB,qBAAM,qBAAa,CAAC,EAAC,QAAQ,UAAA,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,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
......@@ -260,11 +260,11 @@ var validateActivityStatus = function (checkParam) { return __awaiter(void 0, vo
return [2 /*return*/, false];
return [2 /*return*/, new Promise(function (resolve, reject) {
if (nowTime < startTime) {
tb_1.commonToast('活动未开始');
tb_1.showToast({ content: '活动未开始' });
resolve(false);
}
else if (nowTime > endTime && !noCheck) {
tb_1.commonToast('活动已结束');
tb_1.showToast({ content: '活动已结束' });
resolve(false);
}
else {
......
{"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,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACvB,MAAM,GAAG,MAAM,CAAC,OAAO,CACrB,MAAM,CAAC,EAAE,EACT,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CACvD,CAAC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AQ,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
{
"name": "tbcc-sdk-ts",
"version": "1.0.7",
"version": "1.0.14",
"description": "",
"main": "lib/index.js",
"scripts": {
......
......@@ -17,14 +17,28 @@ export const commonToast = (content: string, duration?: number, successCb?: () =
success: successCb
})
};
/**
* 通用toast
* @param {string} content toast内容
* @param {number} duration 显示时长
* @param {function} successCb 成功回调
*/
export const showToast = (params: { content: string, duration?: number, success?: () => any }, Taro?: any) => {
const { content, duration, success } = params
promisifyApiSimple('showToast',{
[Taro?'title':'content']: content || '换个姿势再试一次~',
duration: duration || 3000,
success: success
},null,Taro)
};
/**
* 简易alert
* @param {string} content toast内容
*/
export const simpleAlert = (content: string) => {
export const simpleAlert = (content: string, Taro?: any) => {
promisifyApiSimple('alert',{
content
})
},null,Taro)
};
/**
* 通用确认弹窗
......@@ -32,7 +46,7 @@ export const simpleAlert = (content: string) => {
* @param {string} content 内容
* @param {function} successCb 成功回调
*/
export const commonConfirm = async (title = '提示', content: string, successCb?: () => any) => {
export const commonConfirm = async (title = '提示', content?: string, successCb?: () => any, Taro?: any) => {
promisifyApiSimple('confirm',{
title,
content,
......@@ -44,24 +58,24 @@ export const commonConfirm = async (title = '提示', content: string, successCb
successCb && successCb();
}
}
})
},null,Taro)
};
/**
* 获取系统信息
*/
export const getSystemInfo = async () => {
return await promisifyApi('getSystemInfo', {})
export const getSystemInfo = async (Taro?: any) => {
return await promisifyApi('getSystemInfo', {}, Taro)
};
/**
* 执行关注店铺
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
export const favorShop = async (sellerId: number) => {
export const favorShop = async (sellerId?: number, Taro?: any) => {
if (!sellerId) {
return false;
}
let result: { error?: number } = await promisifyApiToTb('favorShop',{ id: +sellerId })
let result: { error?: number } = await promisifyApiToTb('favorShop',{ id: +sellerId },Taro)
if(result?.error === 11) return false
if(result?.error === 12) return true
return result
......@@ -71,11 +85,11 @@ export const favorShop = async (sellerId: number) => {
* @param {number} sellerId 店铺归属的卖家Id
* @returns {boolean} 关注状态
*/
export const checkShopFavoredStatus = async (sellerId: number) => {
export const checkShopFavoredStatus = async (sellerId?: number, Taro?: any) => {
if (!sellerId) {
return false;
}
let result: { isFavor?: boolean } = await promisifyApiToTb('checkShopFavoredStatus',{ id: +sellerId })
let result: { isFavor?: boolean } = await promisifyApiToTb('checkShopFavoredStatus',{ id: +sellerId },Taro)
if(result?.isFavor !== undefined) return result.isFavor
if(result === 'checkShopFavoredStatus 仅支持真机调用,请在手机淘宝中运行')return true
return result
......@@ -84,56 +98,56 @@ export const checkShopFavoredStatus = async (sellerId: number) => {
* 跳转到外部链接
* @param {string} url 跳转链接
*/
export const navigateToOutside = url => {
export const navigateToOutside = (url: string, Taro?: any) => {
if (!url) {
console.error('navigateToOutside: 请传入url');
return false;
}
promisifyApiSimple('call',{
url
}, 'navigateToOutside')
}, 'navigateToOutside',Taro)
};
/**
* 跳转到内部链接(新开窗口)
* @param {string} url 跳转链接
*/
export const navigateTo = url => {
export const navigateTo = (url: string, Taro?: any) => {
if (!url) {
console.error('navigateTo: 请传入url');
return false;
}
promisifyApiSimple('navigateTo',{
url
})
}, null, Taro)
};
/**
* 返回页面
* @param {number} delta
*/
export const navigateBack = (delta?: number) => {
export const navigateBack = (delta?: number, Taro?: any) => {
promisifyApiSimple('navigateBack',{
delta
})
},null,Taro)
};
/**
* 跳转到内部链接(不新开窗口)
* @param {string} url
*/
export const redirectTo = (url: string) => {
export const redirectTo = (url: string, Taro?: any) => {
if (!url) {
console.error('redirectTo: 请传入url');
return false;
}
promisifyApiSimple('redirectTo',{
url
})
},null,Taro)
};
/**
* 获取服务器时间
* @returns {number} 服务器时间戳
*/
export const getServerTime = async () => {
const result: { time?: string } = await promisifyApi('getServerTime', {})
export const getServerTime = async (Taro?: any) => {
const result: { time?: string } = await promisifyApi('getServerTime', {},Taro)
if(result?.time) return result.time
return result
};
......@@ -142,12 +156,12 @@ export const getServerTime = async () => {
* @param {number} 商品id
* @returns {object} 收藏结果
*/
export const collectGoods = async (id: number) => {
export const collectGoods = async (id: number,Taro?: any) => {
if (!id) {
console.error('collectGoods: 请传入商品id');
return false;
}
let result: { error?: number } = await promisifyApiToTb('collectGoods',{ id: +id })
let result: { error?: number } = await promisifyApiToTb('collectGoods',{ id: +id },Taro)
if(result?.error === 11) return false
return result
};
......@@ -156,12 +170,12 @@ export const collectGoods = async (id: number) => {
* @param {number} 商品id
* @returns {boolean} 商品收场状态
*/
export const checkGoodsCollectedStatus = async (id: number) => {
export const checkGoodsCollectedStatus = async (id: number, Taro?: any) => {
if (!id) {
console.error('checkGoodsCollectedStatus: 请传入商品id');
return false;
}
let result: { isCollect?: boolean } = await promisifyApiToTb('checkGoodsCollectedStatus',{ id: +id })
let result: { isCollect?: boolean } = await promisifyApiToTb('checkGoodsCollectedStatus',{ id: +id },Taro)
if(result?.isCollect) return result.isCollect
return result
};
......@@ -169,53 +183,53 @@ export const checkGoodsCollectedStatus = async (id: number) => {
* 跳转到淘宝商品页
* @param {string} itemId 商品ID
*/
export const openDetail = async (itemId: string) => {
export const openDetail = async (itemId: string, Taro?: any) => {
if (!itemId) {
console.error('openDetail: 请传入商品id');
return false;
}
return await promisifyApiToTb('openDetail',{ itemId: String(itemId) })
return await promisifyApiToTb('openDetail',{ itemId: String(itemId) },Taro)
};
/**
* 创建音频实例
* @param {object} opts 配置对象 例 { src: '音频链接', autoplay: false }
*/
export const createAudio = (opts: { src: string, autoplay?: boolean}) => {
const audioInstance = new AudioModel(opts);
export const createAudio = (opts: { src: string, autoplay?: boolean},Taro?: any) => {
const audioInstance = new AudioModel({ Taro, ...opts });
return audioInstance;
};
/**
* 获取图片信息
* @param {string} src 图片地址
*/
export const getImageInfo = async (src: string) => {
return await promisifyApi('getImageInfo', { src })
export const getImageInfo = async (src: string, Taro?: any) => {
return await promisifyApi('getImageInfo', { src }, Taro)
};
/**
* 剪切板
* @param {text: string}
*/
export const setClipboard = async (text: string) => {
return await promisifyApi('setClipboard', { text })
export const setClipboard = async (text: string, Taro?: any) => {
return await promisifyApi('setClipboard', { text }, Taro)
};
/**
* 调起分享面板
*/
export const showSharePanel = async () => {
promisifyApiSimple('showSharePanel',{})
export const showSharePanel = async (Taro?: any) => {
promisifyApiSimple('showSharePanel',{}, null,Taro)
}
/**
* 隐藏分享面板
*/
export const hideShareMenu = async () => {
promisifyApiSimple('hideShareMenu',{})
export const hideShareMenu = async (Taro?: any) => {
promisifyApiSimple('hideShareMenu',{},null,Taro)
}
/**
* 获取缓存数据
* @param key
*/
export const getStorage = async (key: string) => {
const result: { data?: string} = await promisifyApi('getStorage', { key })
export const getStorage = async (key: string, Taro?: any) => {
const result: { data?: string} = await promisifyApi('getStorage', { key }, Taro)
if(result?.data) return result.data
return undefined
}
......@@ -224,15 +238,15 @@ export const getStorage = async (key: string) => {
* @param key
* @param value
*/
export const setStorage = async (key: string, value: any) => {
return await promisifyApi('setStorage', { key, data: value })
export const setStorage = async (key: string, value: any, Taro?: any) => {
return await promisifyApi('setStorage', { key, data: value }, Taro)
}
/**
* 清除缓存数据
* @param key
*/
export const removeStorage = async (key: string) => {
return await promisifyApi('removeStorage', { key })
export const removeStorage = async (key: string, Taro?: any) => {
return await promisifyApi('removeStorage', { key }, Taro)
}
/**
* 自定义分析数据的上报接口
......@@ -251,23 +265,24 @@ export const taobaoReportClick = (eventType: string,logkey: string) => {
* @param sellerNick
* @param itemId
*/
export const openMessage = async (sellerNick: string, itemId: string) => {
let result = await promisifyApiToTb('openMessage',{ sellerNick, forceH5: false, params: { itemId } })
export const openMessage = async (param:{ sellerNick: string, itemId: string }, Taro?: any) => {
const { sellerNick, itemId } = param
let result = await promisifyApiToTb('openMessage',{ sellerNick, forceH5: false, params: { itemId } }, Taro)
return result
}
/**
* 显示指定商品 SKU 选择器
* @param itemId
*/
export const showSkuModal = async (itemId: string) => {
let result = await promisifyApiToTb('showSku',{ itemId })
export const showSkuModal = async (itemId: string, Taro?: any) => {
let result = await promisifyApiToTb('showSku',{ itemId }, Taro)
return result
}
/**
* 隐藏正在展示的商品 SKU 选择器
*/
export const hideSkuModal = async () => {
let result = await promisifyApiToTb('hideSku',{})
export const hideSkuModal = async (Taro?: any) => {
let result = await promisifyApiToTb('hideSku',{}, Taro)
return result
}
/**
......@@ -276,7 +291,8 @@ export const hideSkuModal = async () => {
* @param skuId
* @param quantity
*/
export const confirmCustomOrder = async (itemId: number, skuId?: number, quantity?: number) => {
export const confirmCustomOrder = async (param: { itemId: number, skuId?: number, quantity?: number }, Taro?: any) => {
const { itemId, skuId, quantity } = param
let result = await promisifyApiToTb('confirmCustomOrder',{
data: {
itemId,
......@@ -284,6 +300,58 @@ export const confirmCustomOrder = async (itemId: number, skuId?: number, quantit
quantity: quantity || 1,
customization: {}
}
})
}, Taro)
return result
}
// 获取授权信息
export const getSetting = async (Taro?: any) => {
// @ts-ignore
const _Taro = Taro || my
return new Promise(async (resolve,reject) => {
_Taro.getSetting({
success: (res) => {
resolve(res)
},
});
})
}
// 打开授权设置
export const openSetting = async (Taro?: any) => {
// @ts-ignore
const _Taro = Taro || my
return new Promise(async (resolve,reject) => {
_Taro.openSetting({
success: (res) => {
resolve(res)
},
});
})
}
// 获取用户信息
export const getAuthUserInfo = async (Taro?: any) => {
// @ts-ignore
const _Taro = Taro || my
return new Promise(async (resolve,reject) => {
_Taro.getAuthUserInfo({
success: (res) => {
resolve(res)
},
});
})
}
// 发起用户授权{ groupChat: 群聊, userInfo: 用户基本信息, addressList: 地址列表, clipboard: 粘贴 }
export const authorize = async (scopeInfo, Taro?: any) => {
// @ts-ignore
const _Taro = Taro || my
return new Promise(async (resolve,reject) => {
_Taro.authorize({
scopes: scopeInfo || 'scope.userInfo',
success: (res) => {
resolve(res)
},
fail: (err) => {
reject(err)
}
});
})
}
\ No newline at end of file
......@@ -14,13 +14,12 @@ export const getUserAddress = async (opts = {}) => {
joinTag: '' // 分割收货地址符号(淘宝商家有特定发货需求)
};
let _opts = Object.assign({}, defaults, opts);
return new Promise((resolve, reject) => {
// @ts-ignore
return new Promise((resolve, reject) => {
my.authorize({
scopes: 'scope.addressList',
success: () => {
const { addAddress, searchAddress, locateAddress, joinTag } = _opts;
// @ts-ignore
if (!my.tb.chooseAddress) {
reject({
noSupport: true,
......@@ -28,7 +27,6 @@ export const getUserAddress = async (opts = {}) => {
});
return false;
}
// @ts-ignore
my.tb.chooseAddress(
{
addAddress,
......@@ -74,8 +72,8 @@ export const chooseImage = async (opts = {}) => {
};
let _opts = Object.assign({}, defaults, opts);
const { count, sourceType, compressLevel } = _opts;
return new Promise((resolve, reject) => {
// @ts-ignore
return new Promise((resolve, reject) => {
if (!my.chooseImage) {
reject({
noSupport: true,
......@@ -83,12 +81,10 @@ export const chooseImage = async (opts = {}) => {
});
return false;
}
// @ts-ignore
my.chooseImage({
count,
sourceType,
success: res => {
// @ts-ignore
my.compressImage({
apFilePaths: res.apFilePaths,
level: compressLevel,
......
......@@ -5,24 +5,25 @@ import { commonToast } from '../core/tb'
* @param params
* @param name
*/
export const promisifyApiSimple = (methodName: string, params: IParamJSAPI, name?: string) => {
if(name) {
export const promisifyApiSimple = (methodName?: string, params?: IParamJSAPI, name?: string, Taro?: any) => {
// @ts-ignore
my[methodName](name,params);
const _Taro = Taro || my
if(name) {
_Taro[methodName](name,params);
return;
}
// @ts-ignore
my[methodName](params);
_Taro[methodName](params);
}
/**
* 通用API封装
* @param methodName
* @param params
*/
export const promisifyApi = (methodName: string, params = {}) => {
return new Promise((resolve, reject) => {
export const promisifyApi = (methodName?: string, params = {}, Taro?: any) => {
// @ts-ignore
my[methodName]({
const _Taro = Taro || my
return new Promise((resolve, reject) => {
_Taro[methodName]({
...params,
success: res => {
resolve(res)
......@@ -38,10 +39,12 @@ export const promisifyApi = (methodName: string, params = {}) => {
* @param methodName
* @param params
*/
export const promisifyApiToTb = (methodName: string, params = {}) => {
export const promisifyApiToTb = (methodName?: string, params = {}, Taro?: any) => {
// @ts-ignore
const _Taro = Taro || my
return new Promise((resolve, reject) => {
// @ts-ignore
my.tb[methodName]({
_Taro.tb[methodName]({
...params,
success: res => {
resolve(res)
......@@ -56,15 +59,16 @@ export const promisifyApiToTb = (methodName: string, params = {}) => {
* 创建音频类
*/
export class AudioModel {
constructor(opts: { src: string }) {
const { src } = opts;
constructor(opts: { src: string, Taro?: any }) {
const { Taro, src } = opts;
if (!src) {
console.error('请输入音频链接');
return false;
}
try {
// @ts-ignore
const innerAudioContext = my.createInnerAudioContext();
const _Taro = Taro || my
const innerAudioContext = _Taro.createInnerAudioContext();
Object.keys(opts).forEach(item => {
innerAudioContext[item] = opts[item];
});
......
......@@ -66,7 +66,7 @@ export const receiveObjectPrize = async (api: any, data: IReceivePrize) => {
commonToast(successMsg)
resolve(true)
}else {
commonToast(errorMsg || message)
commonToast(errorMsg || message )
resolve(false)
}
})
......
import { commonToast, getServerTime } from '../core/tb';
import { showToast, getServerTime } from '../core/tb';
/**
* 时间格式化
* @param date 接收可以被new Date()方法转换的内容
......@@ -182,11 +182,11 @@ export const validateActivityStatus = async (checkParam: { startTime: number, en
if(!startTime || !endTime) return false
return new Promise((resolve,reject) => {
if(nowTime < startTime ) {
commonToast('活动未开始')
showToast({ content: '活动未开始' })
resolve(false)
}
else if(nowTime > endTime && !noCheck) {
commonToast('活动已结束')
showToast({ content: '活动已结束' })
resolve(false)
}
else {
......
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