Files
plugin-library/Assets/12.WeixinMinigame/Runtime/playable-default/unity-sdk/response.js
stary 0d6faa56f4
All checks were successful
Plugin Library CI / publish (00.BuildOriginality) (push) Successful in 13s
Plugin Library CI / publish (00.StaryEvo) (push) Successful in 17s
Plugin Library CI / publish (00.StaryEvoTools) (push) Successful in 35s
Plugin Library CI / publish (01.HybridCLR) (push) Successful in 15s
Plugin Library CI / publish (02.InformationSave) (push) Successful in 3s
Plugin Library CI / publish (03.YooAsset) (push) Successful in 33s
Plugin Library CI / publish (04.AudioCore) (push) Successful in 3s
Plugin Library CI / publish (05.TableTextConversion) (push) Successful in 5s
Plugin Library CI / publish (06.UIFarme) (push) Successful in 15s
Plugin Library CI / publish (07.RKTools) (push) Successful in 2s
Plugin Library CI / publish (08.UniTask) (push) Successful in 3s
Plugin Library CI / publish (09.CodeChecker) (push) Successful in 16s
Plugin Library CI / publish (10.StoryEditor) (push) Successful in 3s
Plugin Library CI / publish (10.XNode) (push) Successful in 3s
Plugin Library CI / publish (11.PointCloudTools) (push) Successful in 2s
Plugin Library CI / publish (12.WeixinMinigame) (push) Successful in 2m32s
微信小程序编译
2026-04-19 00:16:03 +08:00

75 lines
1.8 KiB
JavaScript

/* eslint-disable @typescript-eslint/no-this-alias */
import moduleHelper from './module-helper';
export default {
handleText(s, f, c) {
const self = this;
return {
success(res) {
self.textFormat(s, res);
},
fail(res) {
self.textFormat(f, res);
},
complete(res) {
self.textFormat(c, res);
},
};
},
handleTextLongBack(s, f, c) {
const self = this;
return {
success(res) {
self.textFormatLongBack(s, res);
},
fail(res) {
self.textFormatLongBack(f, res);
},
complete(res) {
self.textFormatLongBack(c, res);
},
};
},
textFormat(id, res) {
if (!id) {
return false;
}
moduleHelper.send('TextResponseCallback', JSON.stringify({
callbackId: id,
errMsg: res.errMsg,
errCode: res.errCode,
}));
},
textFormatLongBack(id, res) {
if (!id) {
return false;
}
moduleHelper.send('TextResponseLongCallback', JSON.stringify({
callbackId: id,
errMsg: res.errMsg,
errCode: res.errCode,
}));
},
handle(formatFunc, s, f, c) {
return {
success(res) {
if (!s) {
return false;
}
formatFunc(s, res);
},
fail(res) {
if (!f) {
return false;
}
formatFunc(f, res);
},
complete(res) {
if (!c) {
return false;
}
formatFunc(c, res);
},
};
},
};