小程序调用地址解析代码问题?

发布于 8 年前作者 guiying3112469 次浏览最后编辑 8 年前来自 ask

const bs = await wx.serviceMarket.invokeService({

      service: 'wx30a496aefcb66233',

      api: 'geoc',

      address: '山西省阳泉市矿区四矿小区'

    })

    console.log('invokeService success', bs)

VM492:1 file: default/default.js

 unknown: await is a reserved word (95:15)

   93 |     

  94 | 

> 95 |     const bs = await wx.serviceMarket.invokeService({

     |               ^

  96 |       service: ‘wx30a496aefcb66c88’,

  97 |       api: ‘geoc’,

  98 |       address: ‘山西省阳泉市矿区四矿小区’

console.error @ VM492:1

(anonymous) @ VM522:2

VM498 WAService.js:2 Page “default/default” has not been registered yet.

1 回复
owu
owu1 楼6 年前

async await是成对出现的