Spaces:
Sleeping
Sleeping
silencewing
commited on
Commit
·
4e06f9b
1
Parent(s):
5ad5311
Upload 3 files
Browse files- youyou/js/jquery.js +0 -0
- youyou/js/main.js +29 -0
youyou/js/jquery.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
youyou/js/main.js
CHANGED
@@ -82,4 +82,33 @@ function ttsPlay(params) {
|
|
82 |
reject(error);
|
83 |
})
|
84 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
85 |
}
|
|
|
82 |
reject(error);
|
83 |
})
|
84 |
})
|
85 |
+
}
|
86 |
+
|
87 |
+
|
88 |
+
function readTxt(data) {
|
89 |
+
var lines = data.split("\n"); //按行读取
|
90 |
+
|
91 |
+
var list = []
|
92 |
+
$.each(lines,function(i, v) {
|
93 |
+
// console.log(v);
|
94 |
+
if( v.trim()!= '')
|
95 |
+
list.push(v)
|
96 |
+
});
|
97 |
+
return list;
|
98 |
+
|
99 |
+
}
|
100 |
+
|
101 |
+
function readLocalTxt(fileName) {
|
102 |
+
var reader = new FileReader();
|
103 |
+
var file = new File(fileName=fileName); //files为上传组件获取的地址
|
104 |
+
reader.readAsText(file, 'utf-8');
|
105 |
+
reader.onload = function(){
|
106 |
+
reader.result.split('\n').forEach(function(v, i){
|
107 |
+
console.log(v);
|
108 |
+
});
|
109 |
+
};
|
110 |
+
reader.onerror = function(){
|
111 |
+
console.log('读取失败');
|
112 |
+
console.log(reader.error);
|
113 |
+
};
|
114 |
}
|