From 6355b0922442ebc9b260d5a040bed4b07aed9e6d Mon Sep 17 00:00:00 2001
From: jyt <1592211625@qq.com>
Date: Fri, 13 May 2022 11:00:32 +0800
Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E8=AE=B0=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Customerportrait/Receivedetailabout.vue | 95 ++++++++++++-------
pages/mine/registerForm.vue | 4 +-
2 files changed, 63 insertions(+), 36 deletions(-)
diff --git a/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue b/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue
index 848e53f..35fa36d 100644
--- a/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue
+++ b/pages/center/Piabodata/Customerportrait/Receivedetailabout.vue
@@ -405,7 +405,7 @@
常错词:
-
+
@@ -506,7 +506,8 @@
textItself: '',
argtextindex1: 0,
argtextindex2: 0,
- isSw: false,
+ isSw: false,
+ isNum: false,
info: null, // 详细信息
};
},
@@ -755,43 +756,62 @@
},
//确认加入常错词
Confirmtheexit() {
- if (this.thewrongword) {
- if (this.reswrongword) {
- let parames = {
- customerId: this.customerId,
- cupid: this.luyinList[this.csdFileindex].id,
- wrongWord: this.thewrongword, //错误词
- correctWord: this.reswrongword, //正确词
- translateHtmlContent: this.messagelisy,
-
- }
- this.isshow2 = false;
- let sas = this.textItself.replace(this.thewrongword, this.reswrongword)
- this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest = sas;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.$u.post("/corpus/addCorrectWord", parames).then(data => {
- this.thewrongword = "";
- this.reswrongword = "";
+ if(this.reswrongword.length>8 || this.thewrongword.length>8){
+ this.$refs.uToast.show({
+ title: '正确词错误词不能超过8个字',
+ type: 'warning',
+ })
+ }else{
+ let reg = /^[0-9]+$/
+ if (reg.test(this.thewrongword)) {
+ this.$refs.uToast.show({
+ title: '错误词不能为纯数字',
+ type: 'warning',
})
- } else {
- uni.showToast({
- title: '正确值不能为空',
- duration: 2000
- });
- return
+ }else{
+ if (this.thewrongword) {
+ if (this.reswrongword) {
+ let parames = {
+ customerId: this.customerId,
+ cupid: this.luyinList[this.csdFileindex].id,
+ wrongWord: this.thewrongword, //错误词
+ correctWord: this.reswrongword, //正确词
+ translateHtmlContent: this.messagelisy,
+
+ }
+ this.isshow2 = false;
+
+
+ let sas = this.textItself.replace(this.thewrongword, this.reswrongword)
+ this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest = sas
+
+ this.dialogList.forEach(res => {
+ res.message.forEach(asd => {
+ asd.isshow = false;
+ })
+ })
+ this.$u.post("/corpus/addCorrectWord", parames).then(data => {
+ this.thewrongword = "";
+ this.reswrongword = "";
+ })
+ } else {
+ uni.showToast({
+ title: '正确值不能为空',
+ duration: 2000
+ });
+ return
+ }
+ } else {
+ uni.showToast({
+ title: '错误词不能为空',
+ duration: 2000
+ });
+ return
+ }
}
- } else {
- uni.showToast({
- title: '错误词不能为空',
- duration: 2000
- });
- return
}
},
+
//取消加入常错词
Cancelout() {
this.isshow2 = false;
@@ -803,8 +823,13 @@
},
//加入长错词
Oftenthewrongword() {
+ this.isNum = false;
this.reswrongword = "";
this.isshow2 = true;
+ let reg = /^[0-9]+$/
+ if (reg.test(this.thewrongword)) {
+ this.isNum = true
+ }
},
//长按对话
changanxiaoguo(item, index, i) {
diff --git a/pages/mine/registerForm.vue b/pages/mine/registerForm.vue
index 21a56af..31cd279 100644
--- a/pages/mine/registerForm.vue
+++ b/pages/mine/registerForm.vue
@@ -95,7 +95,9 @@
-
+
+
+