44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
// index.ts
|
|
import callCloud from '../../base/callCloud';
|
|
|
|
// 获取应用实例
|
|
Component({
|
|
data: {},
|
|
methods: {
|
|
test() {
|
|
console.log('1test');
|
|
this.getOpenId();
|
|
},
|
|
async getOpenId() {
|
|
const res = await callCloud('getOpenId');
|
|
console.log('res-----:', res);
|
|
|
|
// const areaIds = await callCloud('createArea');
|
|
// console.log('areaIds-----:', areaIds);
|
|
|
|
// const stationIds = await callCloud('createStation');
|
|
const reslut = await callCloud('createPDF');
|
|
console.log('reslut-----:', reslut);
|
|
// wx.cloud
|
|
// .callFunction({
|
|
// name: 'user',
|
|
// data: {
|
|
// type: 'getOpenId',
|
|
// },
|
|
// })
|
|
// .then((resp: Record<string, any>) => {
|
|
// console.log('resp-----:', resp);
|
|
// this.setData({
|
|
// haveGetOpenId: true,
|
|
// openId: resp.result.openid,
|
|
// });
|
|
// wx.hideLoading();
|
|
// })
|
|
// .catch((error: any) => {
|
|
// console.log('error:', error);
|
|
// wx.hideLoading();
|
|
// });
|
|
},
|
|
},
|
|
});
|