Procházet zdrojové kódy

人工翻译 bug修复

master
jiahao před 5 roky
rodič
revize
7bda60a564
3 změnil soubory, kde provedl 28 přidání a 18 odebrání
  1. +10
    -10
      i18n/en-US.json
  2. +3
    -2
      lib/chat/ChatPage.dart
  3. +15
    -6
      lib/chat/ChatPageItem.dart

+ 10
- 10
i18n/en-US.json Zobrazit soubor

@@ -1187,18 +1187,18 @@
"translation_butler_order_close_tips2": "是否提前结束翻译管家服务?",
"translation_butler_order_failed": "发布订单失败",
"translation_butler_order_failed2": "订单生成失败 网络异常",
"translation_butler_introduction": "还在烦恼对方听不懂你说什么吗?选择你需要翻译的语言,描述你遇到的问题。贴身翻译管家将随时为你服务",
"travel_introduction": "是否在离目的地越行越远?选择你的起点和终点,出行管家为你精准测距",
"splash_tips_content4": "出行聊天畅通无阻",
"splash_tips_content5": "无忧你的旅行",
"shock_notice": "震动通知",
"translation_butler_introduction": "Still annoying that the other party cannot understand what you are saying? Choose the language you need to translate and describe the problem you are experiencing. The personal translation butler will be at your service",
"travel_introduction": "Is it going further and further away from the destination? Choose your starting point and end point, the travel butler will accurately measure the distance for you",
"splash_tips_content4": "Unblocked travel chat",
"splash_tips_content5": "No Worry about your trip",
"shock_notice": "Vibration notification",
"max_upload_size": "最多上传/s1张",
"travel_tips2": "您的贴身出行管家,解决语言不通打车走错路的问题",
"new_friends_tips": "现在我们可以开始聊天了。",
"msg_tips": "填写自我简介获得更多关注,在此处填写",
"new_friends_tips": "Now we can start chatting.",
"msg_tips": "Fill in your profile to get more attention, fill in here",
"new_msg": "/s1条新消息",
"upload1": "上传",
"his_profile": "他的资料",
"her_profile": "她的资料",
"not_register": "手机号未注册"
"his_profile": "His profile",
"her_profile": "Her profile",
"not_register": "Phone number is not registered"
}

+ 3
- 2
lib/chat/ChatPage.dart Zobrazit soubor

@@ -41,6 +41,7 @@ import 'package:oktoast/oktoast.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:scroll_to_index/scroll_to_index.dart';
//import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
import '../r.dart';
import 'ChatPageItem.dart';
@@ -566,11 +567,11 @@ class _ChatPageState extends State<ChatPage> {
goBackCheck() {
if (isTranslateButler && !isTranslateButlerFinish) {
if (UserData().isTranslateUser) {
showToast('翻译服务未结束不能主动结束');
showToast(I18n.of(context).translation_butler_order_close_tips);
} else {
CustomUI.buildTowConfirm(
context,
'是否提前结束翻译管家服务?',
I18n.of(context).translation_butler_order_close_tips2,
I18n.of(context).confirm,
() {
setState(() {


+ 15
- 6
lib/chat/ChatPageItem.dart Zobrazit soubor

@@ -1015,7 +1015,7 @@ class _ChatPageItemState extends State<ChatPageItem>
bool isTranslating = false;
_transProcessWidget(int transTag) {
double width = 160;
print('transTag: $transTag');
Widget userTranslateWidget;
Widget machineTranslateWidget;
@@ -1061,11 +1061,16 @@ class _ChatPageItemState extends State<ChatPageItem>
showToast('翻译券和H币不足');
return;
}
setState(() { // 把这条放提前放这的原因是 有记录的翻译的话 推送会比post请求先到达
widget.msg.transTag = 2;
});
var res = await HttpUtil().getPersonalTranslate(widget.msg);
if (res) {
print('请求人工翻译成功,进行扣费');
setState(() {
widget.msg.transTag = 2;
SqlUtil().updateUserTranslateState(widget.msg.sessionId,
widget.msg.time, widget.msg.transTag);
//优先扣券
@@ -1091,9 +1096,13 @@ class _ChatPageItemState extends State<ChatPageItem>
curTextType %= textList.length;
});
});
} else if (transTag == 5 || transTag == 6) {
} else if (transTag == 5 ) {
//人工翻译失败
userTranslateWidget = _translateItemWidget(0xe670, '人工翻译失败', null);
String str ='';
if(transTag == 5){
str= '翻译失败';
}
userTranslateWidget = _translateItemWidget(0xe670, str, null);
machineTranslateWidget =
_translateItemWidget(0xe671, I18n.of(context).robot_retranslate, () {
setState(() {
@@ -1101,8 +1110,8 @@ class _ChatPageItemState extends State<ChatPageItem>
curTextType %= textList.length;
});
});
} else if (transTag == 4 || transTag == 10) {
//4人工翻译完成,未评论 10人工翻译完成已评论
} else if (transTag == 4 || transTag == 10 || transTag == 6) {
//4人工翻译完成,未评论 10人工翻译完成已评论 6翻译点跳过相当于翻译完成
userTranslateWidget = InkWell(
onTap: () {
setState(() {


Načítá se…
Zrušit
Uložit