武田小程序
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.

85 lines
1.5 KiB

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