diff --git a/common/globalFunction.js b/common/globalFunction.js index 3874daa..663b6e9 100644 --- a/common/globalFunction.js +++ b/common/globalFunction.js @@ -439,6 +439,17 @@ function formatFileSize(bytes) { else if (bytes < 1024 * 1024 * 1024) return (bytes / (1024 * 1024)).toFixed(2) + ' MB' else return (bytes / (1024 * 1024 * 1024)).toFixed(2) + ' GB' } + + +function sendingMiniProgramMessage(data = { + text: 'hello' +}, action = 'defalut') { + jWeixin.miniProgram.postMessage({ + data, + action + }); +} + export const $api = { msg, prePage, @@ -449,9 +460,12 @@ export const $api = { chatRequest, insertSortData, uploadFile, - formatFileSize + formatFileSize, + sendingMiniProgramMessage } + + export default { $api, navTo, diff --git a/index.html b/index.html index baba876..c90f19b 100644 --- a/index.html +++ b/index.html @@ -3,11 +3,18 @@