- 新增 components.d.json 文件,包含所有组件的属性配置 - 添加 card-item-plugin 组件及其相关文件(json、ts、wxml、wxss) - 在 app.json 中添加新的生产流程管理页面路径 - 添加多个SVG图标文件用于菜单项 - 重构 popup-plugin 组件样式和关闭逻辑 - 更新 tab-bar-plugin 的激活状态逻辑 - 优化 search-popup 使用全局样式类 - 在首页添加菜单配置和页面跳转功能 - 调整组件样式细节和间距
31 lines
797 B
TypeScript
31 lines
797 B
TypeScript
import { post, urlAddBaseUrl } from "./https";
|
|
|
|
const playVoice = (src: string, text: string) => {
|
|
const innerAudioContext = wx.createInnerAudioContext({
|
|
useWebAudioImplement: true,
|
|
});
|
|
innerAudioContext.src = src;
|
|
innerAudioContext.play();
|
|
innerAudioContext.onError(() => {
|
|
innerAudioContext.destroy();
|
|
console.log("Audio Error");
|
|
// wx.removeStorageSync(text);
|
|
});
|
|
innerAudioContext.onEnded(() => {
|
|
innerAudioContext.destroy();
|
|
console.log("Audio End");
|
|
});
|
|
};
|
|
|
|
export const voiceRequest = (text: string, cacheVoice?: boolean) => {
|
|
post(
|
|
"/Tools/voice",
|
|
{ txt: text, per: 3, spd: 5, pit: 5, vol: 9 },
|
|
{ showLoading: false }
|
|
).then((res: any) => {
|
|
if (res.err_code == 0) {
|
|
playVoice(urlAddBaseUrl(res.data), text);
|
|
}
|
|
});
|
|
};
|