You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
1.6 KiB
89 lines
1.6 KiB
const app = getApp<IAppOption>(); |
|
|
|
Component({ |
|
// 组件选项 |
|
options: { |
|
multipleSlots: true, |
|
}, |
|
behaviors: [], |
|
properties: { |
|
url: { |
|
type: String, |
|
value: "", |
|
}, |
|
map1: { |
|
type: String, |
|
value: "", |
|
}, |
|
map2: { |
|
type: String, |
|
value: "", |
|
}, |
|
}, |
|
// 组件数据 |
|
data: { |
|
isPageHidden: false, // 页面是否处于隐藏状态 |
|
show: false, |
|
text: "", |
|
}, |
|
// 数据监听器 |
|
observers: {}, |
|
// 组件方法 |
|
methods: { |
|
init() {}, |
|
handleAudioText() { |
|
console.log(this.data.map1) |
|
if (this.data.map1) { |
|
app.mpBehavior({ PageName: this.data.map1 }); |
|
} |
|
wx.ajax({ |
|
method: "GET", |
|
url: "?r=takeda/common/audio-url-to-text", |
|
loading: true, |
|
data: { |
|
AudioUrl: this.data.url, |
|
}, |
|
}).then((res) => { |
|
this.setData({ |
|
show: true, |
|
text: res.text, |
|
}); |
|
}); |
|
}, |
|
onClose() { |
|
this.setData({ |
|
show: false, |
|
}); |
|
}, |
|
onCopy() { |
|
if (this.data.map2) { |
|
app.mpBehavior({ PageName: this.data.map2 }); |
|
} |
|
this.setData({ |
|
show: false, |
|
}); |
|
wx.setClipboardData({ |
|
data: this.data.text, |
|
success() { |
|
wx.showToast({ |
|
title: "复制成功", |
|
icon: "success", |
|
}); |
|
}, |
|
}); |
|
}, |
|
}, |
|
// 组件生命周期 |
|
lifetimes: { |
|
created() {}, |
|
attached() { |
|
this.init(); |
|
}, |
|
ready() {}, |
|
moved() {}, |
|
detached() {}, |
|
}, |
|
definitionFilter() {}, |
|
}); |
|
|
|
export {}
|
|
|