提交 fb11255c 编写于 作者: Y yangzk

优化卡片api文档示例代码 挑单3.2release

Signed-off-by: Nyangzk <yangzhongkai@huawei.com>
Change-Id: I6feb1edb3c63baa8e440ae82008836fe5ffe5216
上级 79b163e2
......@@ -46,12 +46,12 @@ setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback&l
```ts
var formId = '12400633174999288';
try {
formProvider.setFormNextRefreshTime(formId, 5, (error, data) => {
formProvider.setFormNextRefreshTime(formId, 5, (error) => {
if (error) {
console.log('formProvider setFormNextRefreshTime, error:' + JSON.stringify(error));
} else {
console.log(`formProvider setFormNextRefreshTime success`);
return;
}
console.log(`formProvider setFormNextRefreshTime success`);
});
} catch (error) {
console.log('error' + JSON.stringify(error))
......@@ -144,12 +144,12 @@ import formBindingData from '@ohos.application.formBindingData';
var formId = '12400633174999288';
try {
let obj = formBindingData.createFormBindingData({temperature:'22c', time:'22:00'});
formProvider.updateForm(formId, obj, (error, data) => {
formProvider.updateForm(formId, obj, (error) => {
if (error) {
console.log('formProvider updateForm, error:' + JSON.stringify(error));
} else {
console.log(`formProvider updateForm success`);
return;
}
console.log(`formProvider updateForm success`);
});
} catch (error) {
console.log(`catch err->${JSON.stringify(error)}`);
......@@ -238,9 +238,9 @@ try {
formProvider.getFormsInfo((error, data) => {
if (error) {
console.log('formProvider getFormsInfo, error:' + JSON.stringify(error));
} else {
console.log('formProvider getFormsInfo, data:' + JSON.stringify(data));
return;
}
console.log('formProvider getFormsInfo, data:' + JSON.stringify(data));
});
} catch (error) {
console.log(`catch err->${JSON.stringify(error)}`);
......@@ -284,9 +284,9 @@ try {
formProvider.getFormsInfo(filter, (error, data) => {
if (error) {
console.log('formProvider getFormsInfo, error:' + JSON.stringify(error));
} else {
console.log('formProvider getFormsInfo, data:' + JSON.stringify(data));
return;
}
console.log('formProvider getFormsInfo, data:' + JSON.stringify(data));
});
} catch(error) {
console.log(`catch err->${JSON.stringify(error)}`);
......@@ -389,9 +389,9 @@ try {
formProvider.requestPublishForm(want, obj, (error, data) => {
if (error) {
console.log('formProvider requestPublishForm, error: ' + JSON.stringify(error));
} else {
console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data));
return;
}
console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data));
});
} catch (error) {
console.log(`catch err->${JSON.stringify(error)}`);
......@@ -441,9 +441,9 @@ try {
formProvider.requestPublishForm(want, (error, data) => {
if (error) {
console.log('formProvider requestPublishForm, error: ' + JSON.stringify(error));
} else {
console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data));
return;
}
console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data));
});
} catch (error) {
console.log(`catch err->${JSON.stringify(error)}`);
......
......@@ -72,7 +72,7 @@ let want = {
uri: 'key={true,true,false}',
parameters: {}
};
this.context.startAbility(want, (error, data) => {
this.context.startAbility(want, (error) => {
if (error) {
console.log('FormExtensionContext startAbility, error:' + JSON.stringify(error));
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册