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.
73 lines
1.2 KiB
73 lines
1.2 KiB
7 months ago
|
Component({
|
||
|
// 组件选项
|
||
|
options: {
|
||
|
multipleSlots: true,
|
||
|
},
|
||
|
behaviors: [],
|
||
|
properties: {
|
||
|
url: {
|
||
|
type: String,
|
||
|
value: "",
|
||
|
},
|
||
|
},
|
||
|
// 组件数据
|
||
|
data: {
|
||
|
isPageHidden: false, // 页面是否处于隐藏状态
|
||
|
show: false,
|
||
|
text: "",
|
||
|
},
|
||
|
// 数据监听器
|
||
|
observers: {},
|
||
|
// 组件方法
|
||
|
methods: {
|
||
|
init() {},
|
||
|
handleAudioText() {
|
||
|
this.setData({
|
||
|
show: true,
|
||
|
});
|
||
|
wx.ajax({
|
||
|
method: "GET",
|
||
|
url: "?r=takeda/common/audio-url-to-text",
|
||
|
data: {
|
||
|
AudioUrl: this.data.url,
|
||
|
},
|
||
|
}).then((res) => {
|
||
|
this.setData({
|
||
|
show: true,
|
||
|
text: res.text,
|
||
|
});
|
||
|
});
|
||
|
},
|
||
|
onClose() {
|
||
|
this.setData({
|
||
|
show: false,
|
||
|
});
|
||
|
},
|
||
|
onCopy() {
|
||
|
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() {},
|
||
|
});
|