diff --git a/manifest.json b/manifest.json index 16f44b9..1db4f91 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "数智工牌", + "name" : "智控管家", "appid" : "__UNI__7A1611D", "description" : "去房智控管家", "versionName" : "1.1.0", diff --git a/pages/center/consumer/edit.vue b/pages/center/consumer/edit.vue index c35d372..ae14b53 100644 --- a/pages/center/consumer/edit.vue +++ b/pages/center/consumer/edit.vue @@ -346,22 +346,23 @@ } let isPass = false // 默认通过 let indexs = 0; // - let checkArr = {} - this.allList.map(item => { - checkArr = this.allList.find(item => item.mustSelected == 0) - isPass = checkArr.children.findIndex(item => item.selected == 0) == -1 - if (isPass) return; - item.children.map(item1 => { - if (item1.selected == 0) { - console.log(item, item1) - str.push(item1.keywordsId) + try { + this.allList.forEach(item => { + if (item.mustSelected == 0) { + if (item.children.findIndex(item => item.selected == 0) == -1) { + throw new Error(item.name) + } } + item.children.map(item1 => { + if (item1.selected == 0) { + str.push(item1.keywordsId) + } + }) }) - }) - - if (isPass) { + } catch (e) { + console.log(e) uni.showToast({ - title: `${checkArr.name}为必选项~`, + title: `${e.message}为必选项~`, icon: 'none', duration: 2000 }) diff --git a/pages/mine/calibration.vue b/pages/mine/calibration.vue index 3a97ebd..ac77ba8 100644 --- a/pages/mine/calibration.vue +++ b/pages/mine/calibration.vue @@ -5,7 +5,8 @@ - + {{item.name}} @@ -36,35 +37,35 @@ export default { data() { return { - allList:[], - customerId:'' + allList: [], + customerId: '' } }, onLoad(e) { - this.customerId=e.id; + this.customerId = e.id; this.getListByType() }, methods: { - Edittag(item,item1,index,i){ - if(this.allList[index].children[i].selected==0){ - this.allList[index].children[i].selected=1; - }else{ - this.allList[index].children[i].selected=0; + Edittag(item, item1, index, i) { + if (this.allList[index].children[i].selected == 0) { + this.allList[index].children[i].selected = 1; + } else { + this.allList[index].children[i].selected = 0; } - this.$forceUpdate() + this.$forceUpdate() }, // 字典表接口 getListByType() { this.$u.get("/matchKeywords/findManualCalibration", { customerId: this.customerId, - type:2 + type: 2 }) .then(res => { res.forEach(item1 => { item1.children.map(item => { if (item.isInterval == 0) { item.label = item.name + item.unit + '-' + item.endName + item - .unit; + .unit; } else { item.label = item.name } @@ -77,51 +78,52 @@ // 提交 submit() { let param = { - keywordIds:'', + keywordIds: '', id: this.customerId, projectId: uni.getStorageSync('buildingID').id, } let str = [] - let isPass = false // 默认通过 let indexs = 0; // - let checkArr = {} - this.allList.map(item => { - checkArr = this.allList.find(item => item.mustSelected == 0) - isPass = checkArr.children.findIndex(item => item.selected == 0) == -1 - if (isPass) return; - item.children.map(item1 => { - if (item1.selected == 0) { - str.push(item1.keywordsId) + try { + this.allList.forEach(item => { + if (item.mustSelected == 0) { + if (item.children.findIndex(item => item.selected == 0) == -1) { + throw new Error(item.name) + } } + item.children.map(item1 => { + if (item1.selected == 0) { + str.push(item1.keywordsId) + } + }) }) - }) - - if (isPass) { + } catch (e) { + console.log(e) uni.showToast({ - title: `${checkArr.name}为必选项~`, + title: `${e.message}为必选项~`, icon: 'none', duration: 2000 }) return } - + str = str.join(',') - param.keywordIds = str + param.keywordIds = str this.$u.post("matchKeywords/updateManualCalibration", param).then(res => { uni.showToast({ title: '操作成功', icon: 'none', success: () => { - let sdd={ + let sdd = { keywordIds: this.customerId, id: this.customerId, - bg:0, - speaker:0 + bg: 0, + speaker: 0 } - let pages = getCurrentPages() //获取当前页面栈的信息 - let prevPage = pages[pages.length - 2] //获取上一个页面 - prevPage.setData({ //把需要回传的值保存到上一个页面 - info: sdd + let pages = getCurrentPages() //获取当前页面栈的信息 + let prevPage = pages[pages.length - 2] //获取上一个页面 + prevPage.setData({ //把需要回传的值保存到上一个页面 + info: sdd }); uni.navigateBack() } @@ -167,7 +169,7 @@ color: #333333; border-bottom: 1px solid #E0E0E0; line-height: 102rpx; - + &.mustSe::before { content: '*'; color: red;