|
@@ -427,7 +427,35 @@ function messageLoadOld(item, img, time){
|
|
}
|
|
}
|
|
//翻译
|
|
//翻译
|
|
function translation(){
|
|
function translation(){
|
|
-
|
|
|
|
|
|
+ let value = clickEven.find("p").eq(0).text();
|
|
|
|
+ clickEven.find("p").eq(1).html(translationResults(value)).show();
|
|
|
|
+}
|
|
|
|
+//翻译结果
|
|
|
|
+function translationResults(translationVal){
|
|
|
|
+ let results = null;
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: 'https://www.tuyatrip.com/api/translationInterface/translation',
|
|
|
|
+ async: false,
|
|
|
|
+ type: "get",
|
|
|
|
+ data: {
|
|
|
|
+ "translationVal": translationVal,
|
|
|
|
+ "from": "auto",
|
|
|
|
+ "to": type
|
|
|
|
+ },
|
|
|
|
+ headers: {"token": localStorage.getItem("token")},
|
|
|
|
+ dataType: "json",
|
|
|
|
+ success: (data) => {
|
|
|
|
+ if(data.hasOwnProperty("error_code")){
|
|
|
|
+ results = "翻译失败"
|
|
|
|
+ } else {
|
|
|
|
+ results = data.result.trans_result[0].dst;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ error: () => {
|
|
|
|
+ results = "翻译失败"
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return results;
|
|
}
|
|
}
|
|
//复制
|
|
//复制
|
|
function copyVal(){
|
|
function copyVal(){
|