// 云对象
module.exports = {
helloWd(text){
console.log('text', text);
return {
errCode: 1,
data: "hello, uni-app~"
}
}
}
// 页面点击事件函数调用
methods: {
async callTest(){
try{
const demoTest = uniCloud.importObject("testIndex");
let res = await demoTest.helloWd("hello");
uni.showModal({
content: JSON.stringify(res),
showCancel: false
})
}catch(e){
//TODO handle the exception
console.error("Error:", e);
}
}
}