From 9d512fae1b043f9d6751c8fcce6701799a6ca07b Mon Sep 17 00:00:00 2001 From: jyt <1592211625@qq.com> Date: Wed, 11 May 2022 14:29:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BF=E5=AE=A2=E7=99=BB=E8=AE=B0=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/details2.vue | 106 +++++++++++++++++++----------------- pages/mine/registerCode.vue | 6 +- pages/mine/registerForm.vue | 41 ++++++++++---- 3 files changed, 89 insertions(+), 64 deletions(-) diff --git a/pages/mine/details2.vue b/pages/mine/details2.vue index a4eb7b0..9ad0797 100644 --- a/pages/mine/details2.vue +++ b/pages/mine/details2.vue @@ -1551,54 +1551,61 @@ }); }, //确认加入常错词 - Confirmtheexit() { - let reg = /^[0-9]+$/ - if (reg.test(this.thewrongword)) { - this.$refs.uToast.show({ - title: '错误词不能为纯数字', - type: 'warning', - }) - } 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 - } - } + Confirmtheexit() { + 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 { + 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 + } + } + } }, //取消加入常错词 Cancelout() { @@ -1610,7 +1617,8 @@ }) }, //加入长错词 - Oftenthewrongword() { + Oftenthewrongword() { + this.isNum = false; this.reswrongword = ""; this.isshow2 = true; let reg = /^[0-9]+$/ diff --git a/pages/mine/registerCode.vue b/pages/mine/registerCode.vue index 971e36f..5f9eb36 100644 --- a/pages/mine/registerCode.vue +++ b/pages/mine/registerCode.vue @@ -16,19 +16,17 @@ return { qrCodeUrl: "", projectId:"", - projectName:"", appid:"", }; }, onShow() { this.projectId = uni.getStorageSync('buildingID').id; - this.projectName = uni.getStorageSync('buildingID').name; this.appid = uni.getAccountInfoSync().miniProgram.appId; this.qrCodeUrl = domain.baseUrl; }, - methods: { + methods: { down() { - let url = this.qrCodeUrl+'/customer/getQrCode?appid='+this.appid+'&page=pages/mine/registerForm&scene='+this.projectId+'&projectName='+this.projectName + let url = this.qrCodeUrl+'/customer/getQrCode?appid='+this.appid+'&page=pages/mine/registerForm&scene='+this.projectId console.log(url) uni.getImageInfo({ src:url, diff --git a/pages/mine/registerForm.vue b/pages/mine/registerForm.vue index 45597a8..6ff0616 100644 --- a/pages/mine/registerForm.vue +++ b/pages/mine/registerForm.vue @@ -88,9 +88,12 @@ 《{{tit}}》 - - - + + + + + + @@ -131,7 +134,7 @@ projectId: '', projectName: 'xxx', version:"", - checked: false, + checked: true, }, pname:"", daitiReceptionobj: {}, @@ -144,10 +147,9 @@ }; }, onLoad(options) { - const sceneStr = decodeURIComponent(options.scene); console.log(options) - this.parames.projectId = sceneStr - this.pname = options.projectName + const sceneStr = decodeURIComponent(options.scene); + this.parames.projectId = sceneStr this.initFetch() }, watch: { @@ -179,16 +181,18 @@ url: config.service.privacyAgr, method: "GET", data:{ - id:appid + id:appid, + projectId:this.parames.projectId }, header: { 'content-type': 'application/json', 'Access-Token': uni.getStorageSync('weapp_session_login_data').token }, success: (res) => { - this.content = res.data.data.content + this.content = res.data.data.content this.tit = res.data.data.title - this.parames.version = res.data.data.version + this.parames.version = res.data.data.version + this.pname = res.data.data.projectName } }) }, @@ -197,6 +201,7 @@ }, readOk(){ this.parames.checked = true; + this.modelShow = false; }, save() { if(this.parames.checked == false){ @@ -291,7 +296,21 @@ } }; -