1234567891011121314151617181920212223242526272829303132333435363738394041 |
- const plugin = requirePlugin('hello-plugin')
- Page({
- data: {
- items: [],
- currentItem: 0
- },
- onLoad() {
- const world = plugin.answer
- },
- onShow() {
- plugin.getOcrResult({
- success: (res) => {
- console.log(res)
- wx.showLoading({
- title: '0980890890',
- })
- },
- failed: (error) => {
- console.log(error)
- }
- })
- },
- goPluginPage(){
- wx.navigateTo({
- url: 'plugin://hello-plugin/bank-card?token=123',
- events: {
- someEvent: (data) => {
- console.log(data)
- }
- }
- })
- },
- addItem() {
- this.data.items.push(this.data.currentItem++)
- this.setData({
- items: this.data.items,
- currentItem: this.data.currentItem
- })
- }
- })
|