@ant-basement/miniprogram-sdk
v2.2.24
Published
Ant Basement JavaScript SDK for Alipay MiniProgram
Downloads
305
Readme
miniprogram-sdk
Basement SDK for Alipay Mini Program IDE
Getting Started
npm install --save @ant-basement/miniprogram-sdk
Documentation
API reference please see documentation
Usage
// app.js
App({
onLaunch(options) {
basement.user.getInfo().then(res => {
console.log('user info', res);
});
basement.db.collection('task').find().then(res => {
console.log('task list', res.result);
});
basement.function.invoke('sayHello', { name: 'angela' }).then(res => {
console.log(res.result + ' says angela');
});
basement.appService.invoke('myApp', { method: 'GET' }).then(res => {
console.log(res.result + 'userId say hello to angela');
});
my.chooseImage({
chooseImage: 1,
success: res => {
const path = res.apFilePaths[0];
const options = {
env: 'public',
filePath: path,
};
basement.file.uploadFile(options).then(res => {
console.log('file info', res);
});
},
});
}
});