From 81bae1f65cb304a35d35e4a71f458c71eeb3fc69 Mon Sep 17 00:00:00 2001 From: douzhuo <17611323298@163.com> Date: Tue, 28 Feb 2023 19:24:54 +0800 Subject: [PATCH] tijiao --- env/cl.js | 2 +- env/sh.js | 2 +- pages/center/consumer/edit.vue | 59 +++++++++++++++++++++++----------- pages/mine/calibration.vue | 40 ++++++++++++++++++----- pages/mine/details2.vue | 4 +-- 5 files changed, 77 insertions(+), 30 deletions(-) diff --git a/env/cl.js b/env/cl.js index d4c5e15..31228e3 100644 --- a/env/cl.js +++ b/env/cl.js @@ -1,5 +1,5 @@ const ENV_PATH = { - baseUrl: 'http://192.168.31.160:9999', // 长龙 + baseUrl: 'http://192.168.31.161:9999', // 长龙 } module.exports = ENV_PATH \ No newline at end of file diff --git a/env/sh.js b/env/sh.js index 2f774fb..a3e9aee 100644 --- a/env/sh.js +++ b/env/sh.js @@ -1,5 +1,5 @@ const ENV_PATH = { - baseUrl: 'http://192.168.31.85:9999', // 胜浩 + baseUrl: 'http://192.168.31.86:9999', // 胜浩 } module.exports = ENV_PATH \ No newline at end of file diff --git a/pages/center/consumer/edit.vue b/pages/center/consumer/edit.vue index 8aa9ce7..936534b 100644 --- a/pages/center/consumer/edit.vue +++ b/pages/center/consumer/edit.vue @@ -97,7 +97,7 @@ - + {{item.name}} @@ -179,15 +179,14 @@ userInfo: {}, // 用户信息 } }, - computed: { - }, - + computed: {}, + onLoad(e) { const { dataCode } = uni.getStorageSync("weapp_session_userInfo_data"); this.userInfo = uni.getStorageSync('weapp_session_userInfo_data'); - + this.dataCode = dataCode console.log(this.userInfo.showPhoneStatus) // 先调用借口查询数据 @@ -200,7 +199,7 @@ // 获取置业需求 this.getListByType() }, - + Edittag(item, item1, index, i) { if (this.allList[index].children[i].selected == 0) { this.allList[index].children[i].selected = 1; @@ -237,7 +236,7 @@ if (this.userInfo.showPhoneStatus == 1) { this.showPhone = this.form.phone this.form.phone = this.form.phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2') - } + } // 给客户等级赋值 let idx = this.levellist.findIndex(item => item.value == res.level) if (idx != -1) { @@ -248,7 +247,7 @@ } }) }, - + // 字典表接口 getListByType() { this.$u.get("/matchKeywords/findPersonalMatchData", { @@ -260,11 +259,11 @@ item1.children.map(item => { if (item.isInterval == 0) { item.label = item.name + item.unit + '-' + item.endName + item - .unit; + .unit; } else { item.label = item.name } - item.value = item.id; + item.value = item.id; }) }) // console.log(res) @@ -290,7 +289,7 @@ // }) // return // } - + // if(!(/^1[3456789]\d{9}$/.test(this.form.phone))){ // uni.showToast({ // title: "请检查手机号码格式", @@ -313,14 +312,28 @@ // }) // return; // } - - this.allList.map(item => { - 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) + } + }) }) - }) + } catch (e) { + console.log(e) + uni.showToast({ + title: `${e.message}为必选项~`, + icon: 'none', + duration: 2000 + }) + return + } str = str.join(',') param = this.form // 如果是禁用状态就传入明文手机号,如果没禁用则不用更改 @@ -378,6 +391,7 @@ padding: 0 30rpx; .conmsg-msg-lab { + position: relative; width: 100%; height: 102rpx; display: flex; @@ -388,6 +402,15 @@ display: flex; align-items: center; + &.mustSe::before { + content: '*'; + color: red; + position: absolute; + left: -10rpx; + right: -10rpx; + z-index: 10; + } + .conmsg-msg-lab-1 { flex-shrink: 0; display: flex; @@ -402,7 +425,7 @@ margin-left: 44rpx; flex-grow: 1; display: flex; - + input { flex-grow: 1; } diff --git a/pages/mine/calibration.vue b/pages/mine/calibration.vue index 809b694..68be8da 100644 --- a/pages/mine/calibration.vue +++ b/pages/mine/calibration.vue @@ -5,7 +5,7 @@ - + {{item.name}} @@ -82,14 +82,28 @@ projectId: uni.getStorageSync("buildingID").id } let str = [] - this.allList.map(item => { - 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) + } + }) }) - }) - + } catch (e) { + console.log(e) + uni.showToast({ + title: `${e.message}为必选项~`, + icon: 'none', + duration: 2000 + }) + return + } str = str.join(',') param.keywordIds = str this.$u.post("matchKeywords/updateManualCalibration", param).then(res => { @@ -144,6 +158,7 @@ padding: 0 30rpx; .conmsg-msg-lab { + position: relative; height: 102rpx; display: flex; font-size: 30rpx; @@ -151,7 +166,16 @@ color: #333333; border-bottom: 1px solid #E0E0E0; line-height: 102rpx; - + + &.mustSe::before { + content: '*'; + color: red; + position: absolute; + left: -10rpx; + right: -10rpx; + z-index: 10; + } + .conmsg-msg-lab-1 { display: flex; min-width: 136rpx; diff --git a/pages/mine/details2.vue b/pages/mine/details2.vue index bd640dd..5ccb948 100644 --- a/pages/mine/details2.vue +++ b/pages/mine/details2.vue @@ -145,7 +145,7 @@ - +