Browse Source

景点

master
jiazhipeng 11 months ago
parent
commit
91d960a656
  1. 28
      manifest.json
  2. 2
      static/js/request.js
  3. 8
      store/modules/user.js
  4. 343
      subPackages/user/infoFilling.vue
  5. 19
      subPackages/user/register.vue

28
manifest.json

@ -76,20 +76,20 @@
}, },
"vueVersion" : "2", "vueVersion" : "2",
"h5" : { "h5" : {
// "devServer" : { "devServer" : {
// "port" : 5173, // "port" : 5173, //
// "disableHostCheck" : true, "disableHostCheck" : true,
// "proxy" : { "proxy" : {
// "/api" : { "/api" : {
// "target" : "http://47.103.142.123:1010/", // "target" : "http://47.103.142.123:1010/", //
// "changeOrigin" : true, // "changeOrigin" : true, //
// "secure" : true, // https "secure" : true, // https
// "pathRewrite" : { "pathRewrite" : {
// "^/api" : "" //devApi '' "^/api" : "" //devApi ''
// } }
// } }
// } }
// }, },
"router" : { "router" : {
"mode" : "history" "mode" : "history"
}, },

2
static/js/request.js

@ -4,7 +4,7 @@ import store from '@/store'
let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'http://47.103.142.123:1010' : 'http://47.103.142.123:1010' let NEWAPIURL = process.env.NODE_ENV == 'development' ? 'http://47.103.142.123:1010' : 'http://47.103.142.123:1010'
Vue.prototype.NEWAPIURL = NEWAPIURL Vue.prototype.NEWAPIURL = NEWAPIURL
// #ifdef H5 // #ifdef H5
// NEWAPIURL = '/api' NEWAPIURL = '/api'
// #endif // #endif
Vue.prototype.Post = (params, apiurl) => { Vue.prototype.Post = (params, apiurl) => {

8
store/modules/user.js

@ -69,11 +69,11 @@ export default {
state.meetRoomReserve = data state.meetRoomReserve = data
}, },
changeLingoIds(state, date) { changeLingoIds(state, data) {
state.groupIds = data state.lingoIds = data
}, },
changeScenicIds(state, date) { changeScenicIds(state, data) {
state.groupIds = data state.scenicIds = data
}, },
} }
} }

343
subPackages/user/infoFilling.vue

@ -2,8 +2,34 @@
<view class="bg"> <view class="bg">
<view class="user-other-info"> <view class="user-other-info">
<!-- // -->
<view class="nickname-box"> <view class="scenic-container" v-if="valueType=='scenic_ids'">
<view class="userinfo-item" v-for="(item,i) in scenicIds" :key="i" @click="changeSelection(item)">
<span>{{item.name}}</span>
<view v-if="item.value.length>0" class="text-overflow" >{{item.valueStr}}</view>
<view v-else class="empty-value" >请选择</view>
</view>
</view>
<view class="lingo-container" v-else-if="valueType=='lingo_ids'">
<view class="userinfo-item">
<span>语言能力</span>
<view v-if="inputValueStr" class="text-overflow" >{{inputValueStr}}</view>
<view v-else class="empty-value" >请选择</view>
</view>
<view class="language-doc-container">
<span>证明材料</span>
<view class="img-container">
<image :src="file.img" class="doc-image" v-for="(file,i) in fileList" :key="i"></image>
<view class="doc-image" @click="uploadImg">
<!-- <image class="upload-image" src=""></image> -->
111
</view>
</view>
</view>
</view>
<view class="nickname-box" v-else>
<input v-model="inputValue" type="text" placeholder="请输入内容" /> <input v-model="inputValue" type="text" placeholder="请输入内容" />
</view> </view>
@ -11,6 +37,30 @@
<view class="btn-tao" @click="submit">保存</view> <view class="btn-tao" @click="submit">保存</view>
</view> </view>
<!-- 弹框 -->
<uni-popup ref="popup" type="bottom">
<view class="popup-box">
<view class="btn-top flex flex-between w-full">
<view @click="$refs.popup.close()">取消</view>
<view @click="selectAll">全选</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>
</view> </view>
</template> </template>
@ -22,11 +72,7 @@
return { return {
valueType: '', valueType: '',
inputValue: '', inputValue: '',
inputValueStr: '',
lingo_ids: null, lingo_idsStr:'',
scenic_ids: null, scenic_idsStr:'',
keyNames: [ keyNames: [
{key: 'nickname', value:'姓名'},{key: 'mobile', value:'手机号'}, {key: 'nickname', value:'姓名'},{key: 'mobile', value:'手机号'},
{key: 'certificate_number', value: '导游证号码'}, {key: 'certificate_number', value: '导游证号码'},
@ -34,14 +80,16 @@
{key: 'bio',value: '个性签名'}, {key: 'bio',value: '个性签名'},
{key: 'scenic_ids',value: '擅长景区'}, {key: 'scenic_ids',value: '擅长景区'},
{key: 'lingo_ids',value: '语言能力'}, {key: 'lingo_ids',value: '语言能力'},
] ],
lingoIds: [],
scenicIds: [],
selectionItem: null, //
selection: {arr: [], value: [], valueStr: ''}, //
fileList: []
} }
}, },
computed: {
...mapState(['lingoIds','scenicIds'])
},
onLoad(options) { onLoad(options) {
this.initData(options) this.initData(options)
}, },
@ -52,12 +100,19 @@
uni.setNavigationBarTitle({title: ''}); uni.setNavigationBarTitle({title: ''});
this.valueType = '' this.valueType = ''
this.inputValue = '' this.inputValue = ''
this.inputValueStr = ''
if (options.valueType) { if (options.valueType) {
this.valueType = options.valueType this.valueType = options.valueType
let titleData = this.keyNames.find(v=>v.key == this.valueType) let titleData = this.keyNames.find(v=>v.key == this.valueType)
if (titleData) { if (titleData) {
uni.setNavigationBarTitle({title: titleData.value}); uni.setNavigationBarTitle({title: titleData.value});
} }
if (this.valueType == 'lingo_ids') {
this.initLingoList()
}
if (this.valueType == 'scenic_ids') {
this.initScenicList()
}
} else { } else {
this.goBack() this.goBack()
@ -66,80 +121,112 @@
if (options.inputValue && options.inputValue!='null' && options.inputValue!='undefined') { if (options.inputValue && options.inputValue!='null' && options.inputValue!='undefined') {
this.inputValue = options.inputValue this.inputValue = options.inputValue
} }
console.log(this.lingoIds, this.scenicIds) },
async initLingoList() {
//
let res = await this.Post({},'/api/guide/getGuideLingoList').then(res =>{
this.lingoIds = res.data
})
this.lingoIds = (this.$store.state.user.lingoIds || []).map(v=>{
return {...v, value: [], valueStr: ""}
})
},
async initScenicList() {
//
let res = await this.Post({},'/api/guide/getGuideScenicList')
let valueArr = []
try {
valueArr = (this.inputValue || '').split(',').map(v=>{return Number(v)})
} catch(e) {}
console.log(valueArr)
this.scenicIds = (res.data || []).map(v=>{
let valueHave = v.arr.filter(x=>valueArr.includes(x.id))
return {...v, value: valueHave.map(x=>x.id), valueStr: valueHave.map(x=>x.name).join(',')}
})
},
changeSelection (item) {
this.selectionItem = item
this.selection = {arr: item.arr, value: JSON.parse(JSON.stringify(item.value)), valueStr: ''}
this.$refs.popup.open()
},
//
changeItemSelect (item) {
let index = this.selection.value.findIndex(x=>x==item.id)
if (index>=0) {
this.selection.value.splice(index,1)
} else {
this.selection.value.push(item.id)
}
},
selectAll() {
this.selection.value = this.selection.arr.map(x=>x.id)
},
popSubmit () {
let tempSelect = JSON.parse(JSON.stringify(this.selection))
let valueHave = tempSelect.arr.filter(x=>tempSelect.value.includes(x.id))
this.selectionItem.value = tempSelect.value
this.selectionItem.valueStr = valueHave.map(x=>x.name).join(',')
this.$refs.popup.close()
}, },
uploadImg() { uploadImg() {
uni.chooseImage({ uni.chooseImage({
success: (chooseImageRes) => { success: (res) => {
const tempFilePaths = chooseImageRes.tempFilePaths; 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)
// // #ifdef MP-WEIXIN },
// uni.getFileSystemManager().readFile({ fail:()=> {
// filePath: tempFilePaths[0], uni.showToast({
// encoding: 'base64', title:'上传失败',
// success: res => { icon:'none'
// this.Post({
// method: 'POST',
// base64: 'data:image/png;base64,' + res.data
// }, '/api/common/base64').then(res => {
// if (res.data) {
// this.Post({
// avatar: res.data
// }, '/api/user/profile').then(res => {
// uni.showModal({
// title: '',
// content: res.msg,
// showCancel: false,
// success: res => {
// if (res.confirm) {
// this.getList()
// }
// }
// })
// })
// }
// })
// }
// })
// // #endif
pathToBase64(tempFilePaths[0]).then(base64 => {
this.Post({
method: 'POST',
base64: base64
}, '/api/common/base64').then(res => {
if (res.data) {
this.Post({
avatar: res.data
}, '/api/user/profile').then(res => {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false,
success: res => {
if (res.confirm) {
this.getList()
}
}
})
})
}
})
}) })
} }
}); });
}, },
//
handleSubmitData() {
let data = []
if (this.valueType == 'lingo_ids') {
data = this.lingoIds
}
if (this.valueType == 'scenic_ids') {
data = this.scenicIds
}
let value = []
data.forEach(v=>{
if(Array.isArray(v.value) && v.value.length>0) {
value.push(v)
}
})
this.inputValue = value.map(v=>v.value.join(',')).join(',')
this.inputValueStr = value.map(v=>v.valueStr).join(',')
console.log(this.inputValue,this.inputValueStr)
},
submit() { submit() {
this.handleSubmitData()
uni.$emit("updateInfo", { uni.$emit("updateInfo", {
msgType: 'registerInfo', msgType: 'registerInfo',
data: { data: {
valueType: this.valueType, valueType: this.valueType,
inputValue: this.inputValue inputValue: this.inputValue,
inputValueStr: this.inputValueStr
} }
}) })
this.goBack() this.goBack()
@ -186,25 +273,26 @@
.user-other-info { .user-other-info {
padding: 30rpx; padding:30rpx;
} }
.userinfo-item { .userinfo-item {
display: flex; display: flex;
justify-content: space-between;
align-items: center; align-items: center;
font-size: 28rpx; font-size: 28rpx;
border-bottom: 1rpx solid #D8D8D8;
padding: 40rpx 30rpx 40rpx 0;
height: 48rpx;
color: #333; color: #333;
position: relative; position: relative;
span{
flex-shrink: 0;
width: 120rpx;
}
&>view{
flex: 1;
padding: 40rpx 10rpx 40rpx 0;
margin-left: 30rpx;
border-bottom: 1px solid #D8D8D8;
}
} }
.btn-tao { .btn-tao {
width: 333rpx; width: 333rpx;
height: 80rpx; height: 80rpx;
@ -216,4 +304,97 @@
color: #FFFFFF; color: #FFFFFF;
margin: 68rpx auto 0; margin: 68rpx auto 0;
} }
.popup-box {
border-radius: 0rpx;
background: #fff;
overflow: hidden;
.btn-top{
padding: 26rpx 26rpx 0 26rpx;
color: #999999;
font-size: 31rpx;
box-sizing: border-box;
}
.popup-content{
max-height: 900rpx;
width: 100%;
overflow-x: hidden;
overflow-y: auto;
}
.popup-item {
width: 697rpx;
height: 99rpx;
font-weight: 500;
font-size: 31rpx;
color: #12293C;
margin: auto;
border-bottom: 1rpx solid #D8D8D8;
position: relative;
}
.popup-item.active{
color: #96684F;
}
.popup-item:last-of-type {
border: none;
}
.active-img{
position: absolute;
right: 10rpx;
}
.popup-btns {
width: 100%;
height: 153rpx;
background: #FFFFFF;
color: #12293C;
border-top: 13rpx solid #F2F2F2;
box-shadow: 0rpx 0rpx 13rpx 0rpx rgba(82,82,82,0.25);
padding: 40rpx 26rpx;
box-sizing: border-box;
view{
box-sizing: border-box;
width: 100%;
height: 73.33rpx;
line-height: 73.33rpx;
background: #DC2525;
border-radius: 11rpx;
font-weight: bold;
font-size: 32rpx;
color: #FFFFFF;
text-align: center;
}
}
}
.language-doc-container{
display: flex;
align-items: flex-start;
padding-top: 40rpx;
span{
flex-shrink: 0;
width: 120rpx;
}
.img-container{
flex:1;
flex-shrink: 0;
display: flex;
flex-wrap: wrap;
padding-left: 20rpx;
.doc-image{
width: 141rpx;
height: 151rpx;
border-radius: 13rpx;
margin: 0 20rpx 20rpx 0;
background: #F1F1F1;
}
.upload-image{
width: 43rpx;
height: 41rpx;
}
}
}
</style> </style>

19
subPackages/user/register.vue

@ -95,8 +95,7 @@
}, },
groupIds: [], // groupIds: [], //
lingoIds: [],//
scenicIds: [], //
} }
}, },
mounted() { mounted() {
@ -122,22 +121,14 @@
this.Post({}, '/api/guide/getGuideGroupList').then(res => { this.Post({}, '/api/guide/getGuideGroupList').then(res => {
this.groupIds = res.data this.groupIds = res.data
}) })
//
this.Post({},'/api/guide/getGuideLingoList').then(res =>{
this.lingoIds = res.data
this.$store.commit('changeLingoIds', res.data)
})
//
this.Post({},'/api/guide/getGuideScenicList').then(res =>{
this.scenicIds = res
this.$store.commit('changeScenicIds', res.data)
})
}, },
// //
uploadAvator () { uploadAvator () {
let _this = this let _this = this
uni.chooseImage({ uni.chooseImage({
count: 1,
success: (chooseImageRes) => { success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths; const tempFilePaths = chooseImageRes.tempFilePaths;
pathToBase64(tempFilePaths[0]).then(base64 => { pathToBase64(tempFilePaths[0]).then(base64 => {
@ -166,8 +157,8 @@
}, },
selectRank () { selectRank () {
let _this = this let _this = this
let itemList = this.lingoIds.map(v=>v.name) let itemList = this.groupIds.map(v=>v.name)
let valueList = this.lingoIds.map(v=>v.id) let valueList = this.groupIds.map(v=>v.id)
uni.showActionSheet({ uni.showActionSheet({
itemList: itemList, itemList: itemList,
success: function (res) { success: function (res) {

Loading…
Cancel
Save