diff --git a/subPackages/user/infoFilling.vue b/subPackages/user/infoFilling.vue index 6f30fe7..9bb7489 100644 --- a/subPackages/user/infoFilling.vue +++ b/subPackages/user/infoFilling.vue @@ -87,7 +87,7 @@ {{item.nameStr}} 请选择 - + 级别 {{item.rankStr}} 请选择 @@ -204,7 +204,7 @@ speakText: [], honor: [], - honorNameList: [{id: 1, name: "称号1"},{id: 2, name: "称号2"}], + honorNameList: [{id: 1, name: "导游资源库"},{id: 2, name: "文明导游"},{id: 3, name: "金牌导游"},{id: 4, name: "品牌导游"}], honorRankList: [{id: 1, name: "全国级"}, {id: 2, name: "省级"}, {id:3,name:"市级"}], selectionItem: null, // 景点选中更改的值 @@ -215,16 +215,9 @@ deleteMode: false, // 视频删除 - province: [ - {id: 1, name: '北京', children: [{id:2, name: '北京'}, {id:3, name: "h萨拉开放"}]}, - {id: 4, name: '北京2', children: [{id:5, name: '北京2'}, {id:6, name: "h萨拉开放2"}]}, - ], + province: [], mulProvince : [ - [ - {id: 1, name: '北京',children: [{id:2, name: '北京'}, {id:3, name: "h萨拉开放"}]}, - {id: 4, name: '北京2',children: [{id:5, name: '北京2'}, {id:6, name: "h萨拉开放2"}]}, - ], - [{id:2, name: '北京'}, {id:3, name: "h萨拉开放"}] + [],[] ] } }, @@ -359,7 +352,29 @@ ] } this.honor = honor + this.initAddress() + + }, + + initAddress () { + this.Post({id: 1},'/api/common/getAreaList').then(res => { + this.province = res.data || [] + this.mulProvince[0] = res.data || [] + let data = this.province[0] + if (data) { + this.initChildProvince(data.id) + } + }) + }, + + initChildProvince (parent_id) { + this.Post({id: parent_id},'/api/common/getAreaList').then(res => { + this.mulProvince[1] = res.data || [] + this.$forceUpdate() + }) }, + + addHonor() { this.honor.push({nameStr: '', name: null, rank: null,rankId: null, rankStr: '',fileList: []}) }, @@ -388,23 +403,26 @@ // 市级 if (Array.isArray(value)) { this.selectionItem.rank = 3 - this.selectionItem.rankId = value[1] + this.selectionItem.rankId = this.mulProvince[1][value[1]].id let address = this.mulProvince[0][value[0]].name+this.mulProvince[1][value[1]].name this.selectionItem.rankStr = `市级(${address})` } else { this.selectionItem.rank = 2 - this.selectionItem.rankId = value + this.selectionItem.rankId =this.mulProvince[0][value].id let address = this.province[value].name this.selectionItem.rankStr = `省级(${address})` } + console.log(this.selectionItem) }, + // console.log('第一列滑动'); pickerColumnchange (e) { if(e.detail.column === 0){ let index = e.detail.value - // console.log('第一列滑动'); - // this.newProvinceDataList[1] = []; - this.mulProvince[1] = this.mulProvince[0][index].children || [] + let data = this.mulProvince[0][index] + if (data) { + this.initChildProvince(data.id) + } } }, @@ -632,8 +650,16 @@ if (this.valueType == 'honor') { // 过滤都没填的数据 let data = this.honor.filter(v=> !(!v.name&&!v.rank&&v.fileList.length<=0)) + data.forEach(v=>{ + if (v.name == 1) { + v.rank = null + v.rankId = null + v.rankStr = '' + } + }) + if (data.length>0) { - if (data.every(v=>(v.name&&v.rank&&v.fileList.length>0))) { + if (data.every(v=>(v.name&&(v.name==1 || v.name!=1&&v.rank)&&v.fileList.length>0))) { this.inputValue = JSON.parse(JSON.stringify(data)) this.inputValueStr = data[0].nameStr } else { @@ -685,7 +711,7 @@ min-height: 100vh; overflow-x: hidden; background: white; - padding-bottom: 50rpx; + padding-bottom: 200rpx; } .bg.honorBG{ background: #F1F1F1; diff --git a/subPackages/user/register.vue b/subPackages/user/register.vue index ebe1309..0e67011 100644 --- a/subPackages/user/register.vue +++ b/subPackages/user/register.vue @@ -176,11 +176,16 @@ let lingo_idsFileList = [] let video_list = [] + let honor = [] try { lingo_idsFileList = (resData.lingo_image_list || '').split(',').filter(v=>v) video_list = (resData.video_list || '').split(',').filter(v=>v) + honor = JSON.parse(resData.honor) + } catch(e){} + console.log(honor ,'honor') + this.info = { id: resData.id,avatar: resData.avatar, nickname: resData.nickname, mobile: resData.mobile, @@ -395,10 +400,12 @@ console.log(this.info) let param = { + method: "POST", ...this.info,guide_id: this.info.id, lingo_image_list: this.info.lingo_idsFileList.join(','), video_list: this.info.video_list.join(','), - sparkle_text: JSON.stringify(this.info.sparkle_text) + sparkle_text: JSON.stringify(this.info.sparkle_text), + honor: this.info.honor&&this.info.honor.length>0?JSON.stringify(this.info.honor):'', } let api = "/api/guide/applyGuide" if (this.status == 2) api = "/api/guide/updateGuideDetails"