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 @@ diff --git a/manifest.json b/manifest.json index 25a9177..e1b22f3 100644 --- a/manifest.json +++ b/manifest.json @@ -97,9 +97,6 @@ "serviceHost": "" } } - }, - "unipush": { - "enable": true } } } \ No newline at end of file diff --git a/pages/careerfair/careerfair.vue b/pages/careerfair/careerfair.vue index e59fc9c..5910f75 100644 --- a/pages/careerfair/careerfair.vue +++ b/pages/careerfair/careerfair.vue @@ -48,15 +48,10 @@ const state = reactive({ onLoad(() => { state.dateList = getNextMonthDates(); }); -document.addEventListener('UniAppJSBridgeReady', function () { - console.log(123); -}); + function textXcx() { - jWeixin.miniProgram.postMessage({ - data: { - pathUrl: '你好,小程序', //传递的参数 - }, - }); + $api.msg('测试给小程序发送消息'); + $api.sendingMiniProgramMessage(); } // 获取往后三十天日期