t-comm
Version:
专业、稳定、纯粹的工具库
39 lines (35 loc) • 945 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function getCurrentPage() {
var pages = getCurrentPages();
return pages[pages.length - 1];
}
function initShareMp(shareInfo) {
var page = getCurrentPage();
if (!page) return;
page.onShareAppMessage = function () {
return {
title: "".concat(shareInfo.title) || '',
path: shareInfo.mpPath || shareInfo.path || '',
imageUrl: shareInfo.mpImageUrl || shareInfo.imageUrl || shareInfo.icon || ''
};
};
}
function openShareUIMp(text, duration) {
if (text === void 0) {
text = '点击右上角"..."分享';
}
if (duration === void 0) {
duration = 3000;
}
uni.showToast({
title: text,
icon: 'none',
duration: duration,
success: function success() {},
fail: function fail() {}
});
}
exports.getCurrentPage = getCurrentPage;
exports.initShareMp = initShareMp;
exports.openShareUIMp = openShareUIMp;