Browse Source

荣誉称号

master
jiazhipeng 11 months ago
parent
commit
f392adef2c
  1. 6
      subPackages/onlineService/detail.vue
  2. 272
      subPackages/user/infoFilling.vue
  3. 14
      subPackages/user/register.vue

6
subPackages/onlineService/detail.vue

@ -52,6 +52,7 @@ export default {
this.goBack()
} else {
this.getDetail()
this.getRecommend()
}
},
@ -61,6 +62,11 @@ export default {
this.detail = res.data
})
},
getRecommend(){
this.Post({id: this.id, limit: 5}, '/api/Answer/getCorrelation').then(res=>{
this.questionList = res.data
})
},
viewDetail(item) {
uni.navigateTo({
url: `/subPackages/onlineService/detail?id=${item.id}`

272
subPackages/user/infoFilling.vue

@ -1,5 +1,5 @@
<template>
<view class="bg">
<view :class="['bg', valueType == 'honor'?'honorBG':'']">
<view class="user-other-info">
<!-- // -->
@ -43,9 +43,7 @@
<uni-icons v-if="i!=0" class="del-icon" type="trash" size="20" @click.native="delText(i)"></uni-icons>
</view>
</view>
<view class="add-btn" @click="addText">+ 添加更多</view>
</view>
<!-- 视频 -->
@ -76,26 +74,53 @@
</view>
</view>
</view>
</view>
</view>
<!-- 荣誉称号 -->
<view class="scenic-container" v-else-if="valueType=='honor'">
<view class="honor-item" v-for="(item,i) in honor" :key="i">
<uni-icons v-if="honor.length>1" class="del-icon" type="trash" size="20" @click.native="removeArr(i,honor)"></uni-icons>
<view class="userinfo-item" @click="changeHonorSelection(item, 'name')">
<span>{{`荣誉称号${i+1}`}}</span>
<view v-if="item.nameStr" class="text-overflow icon-select" >{{item.nameStr}}</view>
<view v-else class="empty-value icon-select" >请选择</view>
</view>
<view class="userinfo-item" @click="openRankOption(item)">
<span>级别</span>
<view v-if="item.rankStr" class="text-overflow icon-select" >{{item.rankStr}}</view>
<view v-else class="empty-value icon-select" >请选择</view>
</view>
<view class="language-doc-container">
<span>证明材料</span>
<view class="img-container">
<view v-for="(file,index) in item.fileList" class="doc-image" :key="`honor${i}_${index}`">
<image :src="file" class="doc-image" ></image>
<view class="doc-del" @click.native="removeArr(index,item.fileList)">x</view>
</view>
<view class="doc-image flex flex-center" @click="uploadImage(item.fileList)">
<image class="upload-image" :src="showImg('/uploads/20241202/33e04a3b13241a6705616f6d6db315ce.png')"></image>
</view>
</view>
</view>
</view>
<view class="add-btn" style="background: white;" @click="addHonor">+ 添加更多</view>
</view>
<view class="nickname-box" v-else>
<input v-model="inputValue" type="text" placeholder="请输入内容" />
</view>
<!-- 底部保存 -->
<view class="btn-tao" @click="submit" v-if="!['scenic_ids','sparkle_text','video_list'].includes(valueType)">保存</view>
<view class="btn-tao" @click="submit" v-if="!['scenic_ids','sparkle_text','video_list','honor'].includes(valueType)">保存</view>
<view class="bottom-btn" v-if="['scenic_ids','sparkle_text'].includes(valueType)">
<view class="btn" @click="goBack()" >取消</view>
<view class="btn" @click="submit()" >保存</view>
</view>
<view class="bottom-btn-fixed" v-if="['video_list'].includes(valueType)">
<view class="bottom-btn-fixed" v-if="['video_list','honor'].includes(valueType)">
<template v-if="!deleteMode">
<view class="btn" @click="goBack()" >取消</view>
<view class="btn" @click="submit()" >保存</view>
@ -113,24 +138,42 @@
<view class="popup-box">
<view class="btn-top flex flex-between w-full">
<view @click="$refs.popup.close()">取消</view>
<view @click="selectAll">全选</view>
<view @click="selectAll" v-if="!selection.single">全选</view>
</view>
<view class="popup-content">
<view :class="['popup-item','flex-center',selection.value.includes(item.id)?'active':'']"
v-for="(item,index) in selection.arr" :key="index" @click="changeItemSelect(item)">
{{item.name}}
<uni-icons v-show="selection.value.includes(item.id)" class="active-img" type="checkmarkempty" size="23" color="#96684F"></uni-icons>
</view>
</view>
<view class="popup-btns flex-center" @click="popSubmit">
<view>确定</view>
</view>
</view>
</uni-popup>
<uni-popup ref="popupRank" type="bottom">
<view class="popup-box">
<view class="btn-top flex flex-between w-full">
<view @click="$refs.popupRank.close()">取消</view>
</view>
<view class="popup-content">
<view :class="['popup-item','flex-center',selectionItem&&selectionItem.rank==item.id?'active':'']"
v-for="(item,index) in honorRankList" :key="index" @click="changeRank(item)">
{{item.name}}
<uni-icons v-if="index!=0" class="active-img" type="right" size="20" color="#96684F"></uni-icons>
<view class="popup-btns flex-center" @click="popSubmit">
<picker v-if="item.id==2" class="cover-picker" :range="province" range-key="name" @change="changeArea"></picker>
<picker v-if="item.id==3" class="cover-picker" :range="mulProvince" range-key="name" @change="changeArea" @columnchange="pickerColumnchange" mode="multiSelector"></picker>
</view>
</view>
<view class="popup-btns flex-center" @click="$refs.popupRank.close()">
<view>确定</view>
</view>
</view>
</uni-popup>
</view>
</template>
@ -151,19 +194,36 @@
{key: 'scenic_ids',value: '擅长景区'},
{key: 'lingo_ids',value: '语言能力'},
{key: 'sparkle_text', value: '核心亮点'},
{key:'video_list', value: '讲解视频'}
{key:'video_list', value: '讲解视频'},
{key:'honor', value: '荣誉称号'}
],
lingoIds: [],
scenicIds: [],
speakText: [],
honor: [],
honorNameList: [{id: 1, name: "称号1"},{id: 2, name: "称号2"}],
honorRankList: [{id: 1, name: "全国级"}, {id: 2, name: "省级"}, {id:3,name:"市级"}],
selectionItem: null, //
selection: {arr: [], value: [], valueStr: ''}, //
selection: {arr: [], value: [], valueStr: '', single: false}, //
fileList: [],
deleteIndex: [],
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"}]},
],
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萨拉开放"}]
]
}
},
onLoad(options) {
@ -201,6 +261,9 @@
if (this.valueType == 'video_list') {
this.initVideo()
}
if (this.valueType == 'honor') {
this.initHonor()
}
} else {
this.goBack()
@ -253,6 +316,12 @@
})
this.speakText = arr
},
addText () {
this.speakText.push({text:''})
},
delText (index) {
this.speakText.splice(index,1)
},
//
initVideo () {
try {
@ -263,18 +332,85 @@
this.fileList = []
}
},
//
initHonor () {
let honor = []
try {
honor = uni.getStorageSync('userHonor')
honor = JSON.parse(honor)
if (!Array.isArray(honor)) {
honor = []
}
} catch(e) {
honor = []
}
addText () {
this.speakText.push({text:''})
if (honor.length<=0) {
honor = [
{nameStr: '', name: null, rank: null, rankId: null, rankStr: '',fileList: []}
]
}
this.honor = honor
},
delText (index) {
this.speakText.splice(index,1)
addHonor() {
this.honor.push({nameStr: '', name: null, rank: null,rankId: null, rankStr: '',fileList: []})
},
// honor
changeHonorSelection (item, keyName) {
this.selectionItem = item
this.selection = {arr: this.honorNameList, value: item.name?[item.name]:[], valueStr: '', single: true}
this.$refs.popup.open()
},
openRankOption (item) {
this.selectionItem = item
this.$refs.popupRank.open()
},
changeRank (item) {
//
if (item.id == 1) {
this.selectionItem.rank = 1
this.selectionItem.rankId = null
this.selectionItem.rankStr = "全国级"
}
},
changeArea (e) {
console.log(e)
let value = e.detail.value
//
if (Array.isArray(value)) {
this.selectionItem.rank = 3
this.selectionItem.rankId = value[1]
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
let address = this.province[value].name
this.selectionItem.rankStr = `省级(${address}`
}
},
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 || []
}
},
//
changeSelection (item) {
this.selectionItem = item
this.selection = {arr: item.arr, value: JSON.parse(JSON.stringify(item.value)), valueStr: ''}
let single = item.single||false
let value = []
if (single && item.value) {
value = [Number(item.value)]
} else {
value = JSON.parse(JSON.stringify(item.value))
}
this.selection = {arr: item.arr, value: value, valueStr: '', single: single}
this.$refs.popup.open()
},
//
@ -282,9 +418,14 @@
let index = this.selection.value.findIndex(x=>x==item.id)
if (index>=0) {
this.selection.value.splice(index,1)
} else {
let single = this.selection.single
if (single) {
this.selection.value = [item.id]
} else {
this.selection.value.push(item.id)
}
}
},
selectAll() {
this.selection.value = this.selection.arr.map(x=>x.id)
@ -296,11 +437,21 @@
if (['scenic_ids','lingo_ids'].includes(this.valueType)) {
this.selectionItem.value = tempSelect.value
this.selectionItem.valueStr = valueHave.map(x=>x.name).join(',')
} else if (['honor'].includes(this.valueType)) {
//
if (tempSelect.value.length>0) {
this.selectionItem.name = tempSelect.value[0]
this.selectionItem.nameStr = valueHave.map(x=>x.name).join(',')
} else {
this.selectionItem.name = null
this.selectionItem.nameStr = ""
}
console.log(this.selectionItem, this.honor)
}
this.$refs.popup.close()
},
uploadImage() {
uploadImage(arr) {
let _this = this
let url = this.NEWAPIURL
// #ifdef H5
@ -310,11 +461,6 @@
uni.chooseImage({
count:1,
success: (res) => {
// for(let i =0 ;i<res.tempFilePaths.length;i++) {
// let param = {img:res.tempFilePaths[i], tempFile:res.tempFiles[i] }
// this.fileList.push(param)
// }
// console.log(this.fileList)
const tempFilePaths = res.tempFilePaths;
const uploadTask = uni.uploadFile({
url: url,
@ -325,8 +471,12 @@
try {
let res = JSON.parse(uploadFileRes.data)
if (res.code == 1) {
if (Array.isArray(arr)) {
arr.push(res.data.fullurl)
} else {
_this.fileList.push(res.data.fullurl)
}
}
} catch(e) {}
@ -397,8 +547,9 @@
});
},
removeFile(index) {
this.fileList.splice(index,1)
//
removeArr(index, arr) {
arr.splice(index,1)
},
playVideo (file) {
@ -450,6 +601,7 @@
console.log(this.inputValue,this.inputValueStr)
}
//
if (this.valueType == 'sparkle_text') {
if (!this.speakText[0].text) {
uni.showToast({
@ -461,11 +613,34 @@
this.inputValue = this.speakText.filter(v=>v.text)
this.inputValueStr = this.inputValue.map(v=>v.text).join(',')
}
//
if (this.valueType == 'video_list') {
this.inputValue = JSON.parse(JSON.stringify(this.fileList))
this.inputValueStr = ''
}
//
if (this.valueType == 'honor') {
//
let data = this.honor.filter(v=> !(!v.name&&!v.rank&&v.fileList.length<=0))
if (data.length>0) {
if (data.every(v=>(v.name&&v.rank&&v.fileList.length>0))) {
this.inputValue = JSON.parse(JSON.stringify(data))
this.inputValueStr = data[0].nameStr
} else {
uni.showToast({
title: '请补充信息',
icon:'none'
})
return true
}
} else {
this.inputValue = []
this.inputValueStr = ""
}
}
},
submit() {
@ -498,6 +673,9 @@
background: white;
padding-bottom: 50rpx;
}
.bg.honorBG{
background: #F1F1F1;
}
.empty-value{
font-weight: 500;
@ -536,7 +714,7 @@
position: relative;
span{
flex-shrink: 0;
width: 120rpx;
width: 140rpx;
}
&>view{
flex: 1;
@ -583,6 +761,14 @@
margin: auto;
border-bottom: 1rpx solid #D8D8D8;
position: relative;
.cover-picker{
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
}
}
.popup-item.active{
color: #96684F;
@ -640,7 +826,7 @@
padding-top: 40rpx;
span{
flex-shrink: 0;
width: 120rpx;
width: 140rpx;
}
.img-container{
flex:1;
@ -815,4 +1001,30 @@
}
}
.honor-item{
background: white;
border-radius: 13rpx;
padding: 0 12rpx;
position: relative;
margin-bottom: 28rpx;
.del-icon{
position: absolute;
bottom: 5rpx;
right: 5rpx;
}
}
.icon-select{
display: flex;
align-items: center;
justify-content: space-between;
}
.icon-select::after{
content: "";
width: 20rpx;
height: 20rpx;
margin-left: 6rpx;
background-image: url('https://static.ticket.sz-trip.com/tongli/images/user/rightIcon-gray.png');
background-size: 100% 100%;
}
</style>

14
subPackages/user/register.vue

@ -38,6 +38,11 @@
<view class="text-overflow" v-if="info.certificate_number">{{info.certificate_number}}</view>
<view v-else class="empty-value">请填写</view>
</view>
<view class="userinfo-item" @click="changeValue('honor')">
<span>荣誉称号</span>
<view class="text-overflow" v-if="info.honorStr">{{info.honorStr}}</view>
<view v-else class="empty-value">请选择</view>
</view>
<view class="userinfo-item" @click="changeValue('duration')">
<span>工作年限</span>
<view class="text-overflow" v-if="info.duration">{{info.duration}}</view>
@ -111,6 +116,7 @@
bio:'', video_list: [],
sparkle_text: [],
sparkle_textStr: '',
honor: [], honorStr: ''
},
groupIds: [], //
@ -159,6 +165,7 @@
bio:'', video_list: [],
sparkle_text: [],
sparkle_textStr: '',
honor: [], honorStr: ''
}
return
}
@ -193,6 +200,8 @@
sparkle_textStr:(resData.sparkle_text || []).map(v=>v.text).join(','),
video_list: video_list,
honor: [], honorStr: ''
}
})
},
@ -289,7 +298,7 @@
//
changeValue(valueType) {
if (!this.canEdit) return
// if (!this.canEdit) return
let inputValue = this.info[valueType]
if (valueType == "lingo_ids") {
uni.setStorageSync("userfileList",JSON.stringify(this.info.lingo_idsFileList))
@ -300,6 +309,9 @@
if (valueType == 'sparkle_text') {
inputValue = this.info.sparkle_textStr
}
if (valueType == 'honor') {
uni.setStorageSync("userHonor",JSON.stringify(this.info.honor))
}
uni.navigateTo({
url: `/subPackages/user/infoFilling?valueType=${valueType}&inputValue=${inputValue}`

Loading…
Cancel
Save