0983d505 by 杨炀

no message

1 parent 4c11fc3e
......@@ -32,6 +32,16 @@ function carUrl(data, type) {
params: data
})
}
// 添加会员信息
function addPersonToMyDept(data) {
return request({
url: '/person/info/addPersonToMyDept',
method: 'post',
params: data
})
}
// 图片上传
function uploadImg(e){
const tempFilePaths = e.tempFilePaths;
......@@ -50,7 +60,12 @@ function uploadImg(e){
uni.hideLoading();
});
}
function getInfo(perId) {
return request({
url: '/person/info/' + perId,
method: 'get'
})
}
function getOwnMemberInfo() {
......@@ -264,7 +279,7 @@ function miniappData(params) {
export {
getMessage,reader,regionsList,carUrl,uploadImg,
getMessage,reader,regionsList,carUrl,uploadImg,addPersonToMyDept,getInfo,
getOwnMemberInfo,
getSiteList,
......
......@@ -3,8 +3,8 @@
// staging
const baseUrl_api = "http://192.168.1.11:8787";
const baseUrl_api = "http://192.168.1.96:8787";
export default {
baseUrl_api
}
\ No newline at end of file
};
\ No newline at end of file
......
......@@ -17,9 +17,8 @@
</uni-forms-item>
<uni-forms-item label="证件照" required name="picUrl" v-show="current === 1">
<view class="upCard">
<uni-file-picker :class="baseFormData.card?'':'op0'"
v-model="baseFormData.cardObj" @delete="delimgFont" return-type="object"
limit="1" @select="upIdCardImgFront"
<uni-file-picker :class="baseFormData.card?'':'op0'" v-model="baseFormData.cardObj"
@delete="delimgFont" return-type="object" limit="1" @select="upIdCardImgFront"
:image-styles="imageStylesZJ"></uni-file-picker>
<image v-if="!baseFormData.card" class="sfz" src="@/static/login/sfz.png">
</image>
......@@ -54,9 +53,8 @@
placeholder="请输入详细地址" /></uni-forms-item>
<uni-forms-item label="头像" required name="photo">
<uni-file-picker v-model="baseFormData.photoObj" @delete="delPhoto"
return-type="object" limit="1" @select="upPhoto"
:image-styles="imageStylesTx"></uni-file-picker>
<uni-file-picker v-model="baseFormData.photoObj" @delete="delPhoto" return-type="object"
limit="1" @select="upPhoto" :image-styles="imageStylesTx"></uni-file-picker>
</uni-forms-item>
......@@ -110,17 +108,18 @@
<script setup>
import {
onMounted,
onMounted,
ref
} from 'vue'
import * as api from '@/common/api.js'
} from 'vue'
import * as api from '@/common/api.js'
const current = ref(0)
const popup = ref(null)
const agree = ref(false)
const agree = ref(false)
const perId = ref()
const regionsList = ref([])
const baseFormData = ref({
sex: '0',
idcType:'0'
sex: '0',
idcType: '0'
})
const baseFormData2 = ref({})
const items = ref(['手动录入', '自动录入'])
......@@ -150,8 +149,8 @@
}])
const placeholderStyle = ref('text-align: right;font-size:30rpx')
const inputstyle = ref({
borderColor: '#fff',
fontSize:'30rpx'
borderColor: '#fff',
fontSize: '30rpx'
})
const imageStylesTx = ref({
width: '210rpx',
......@@ -168,51 +167,54 @@
width: '500rpx',
height: '316rpx'
});
onMounted(()=>{
getRegionsList()
})
function getRegionsList() {
api.regionsList().then(res=>{
regionsList.value = res.data
})
}
onMounted(() => {
getRegionsList()
})
function getRegionsList() {
api.regionsList().then(res => {
regionsList.value = res.data
})
}
function onClickItem(e) {
if (current.value != e.currentIndex) {
current.value = e.currentIndex
}
}
function changeAgree(item) {
if(agree.value){
agree.value = false
} else {
agree.value = true
}
function changeAgree(item) {
if (agree.value) {
agree.value = false
} else {
agree.value = true
}
// item = !item
}
//身份证识别
function upIdCardImgFront(e) {
baseFormData.value.card = e.tempFiles;
console.log(e.tempFiles[0].file)
const formData = new FormData()
formData.append('pic', e.tempFiles[0].file)
api.carUrl(formData, baseFormData.value.idcType).then(res=>{
baseFormData.value.idcUrl = res.data.url
baseFormData.value.sex = res.data.sex
baseFormData.value.birth = res.data.birth
baseFormData.value.idcCode = res.data.code
baseFormDatabaseFormData.value.cityId = res.data.cityId
baseFormData.value.address = res.data.address
baseFormData.value.photo = res.data.photo
baseFormData.value.name = res.data.name
baseFormData.value.picUUid = res.data.picUUid
function upIdCardImgFront(e) {
baseFormData.value.card = e.tempFiles;
console.log(e.tempFiles[0].file)
const formData = new FormData()
formData.append('pic', e.tempFiles[0].file)
api.carUrl(formData, baseFormData.value.idcType).then(res => {
baseFormData.value.idcUrl = res.data.url
baseFormData.value.sex = res.data.sex
baseFormData.value.birth = res.data.birth
baseFormData.value.idcCode = res.data.code
baseFormDatabaseFormData.value.cityId = res.data.cityId
baseFormData.value.address = res.data.address
baseFormData.value.photo = res.data.photo
baseFormData.value.name = res.data.name
baseFormData.value.picUUid = res.data.picUUid
})
// api.uploadImg(e).then(data => {
// baseFormData.value.card = data.data;
// });
}
}
function upPhoto(e) {
// api.uploadImg(e).then(data => {
// baseFormData.value.photo = data.data;
......@@ -222,7 +224,7 @@ function getRegionsList() {
function delimgFont(n) {
baseFormData.value.card = '';
}
function delPhoto(n) {
baseFormData.value.photo = '';
}
......@@ -271,33 +273,87 @@ function getRegionsList() {
popup.value.open()
}
function closepopup() {
function closepopup() {
agree.value = true
popup.value.close()
}
function goSubmit() {
if(!agree.value){
uni.showToast({
icon:'none',
title: '请阅知入会须知',
duration: 2000
});
if (!agree.value) {
uni.showToast({
icon: 'none',
title: '请阅知入会须知',
duration: 2000
});
return
}
// 验证必填项
//信息确认弹出
uni.showModal({
content: '确认信息正确',
success: function(res) {
if (res.confirm) {
api.addPersonToMyDept().then(res => {
if (res.data == 0) {
let msg = '该成员,实名认证未通过,注册失败!'
resultDialog.value = true
return
}
if (res.data * 1 < 0) {
// 会员调入弹出
perId.value = res.data.slice(1)
getUserInfo()
return
}
let msg = '操作成功,您可以去列表中查看'
form.value = { perType: 1, idcType: '0' }
}).catch(() => {
let msg = '您已注册该会员,请不要重复注册!'
})
}
}
});
}
function getUserInfo() {
api.getInfo(perId.value).then(res=>{
forms.value = res.data
if (forms.areaAssName)forms.ancestorNameList = forms.value.ancestorNameList.join(',').replaceAll(',', '/')
})
}
</script>
<style lang="scss" scoped>
:deep(.segmented-control){height:100rpx;}
:deep(.segmented-control__text){line-height: 2;font-size: 30rpx;}
.tt{text-align: center;font-size: 30rpx;padding: 40rpx 0 0;}
<style lang="scss" scoped>
:deep(.segmented-control) {
height: 100rpx;
}
:deep(.segmented-control__text) {
line-height: 2;
font-size: 30rpx;
}
.tt {
text-align: center;
font-size: 30rpx;
padding: 40rpx 0 0;
}
.popBody {
font-size: 28rpx;
line-height: 1.5;
font-family: 华文仿宋;
height: 80vh;
overflow: auto;padding: 30rpx;
.btn-red{margin: 50rpx 0 30rpx;}
overflow: auto;
padding: 30rpx;
.btn-red {
margin: 50rpx 0 30rpx;
}
}
.agreeline {
......@@ -335,9 +391,14 @@ function getRegionsList() {
.op0 {
opacity: 0;
}
:deep(.item-text-overflow){text-align: left;}
:deep(.selected-list){justify-content: end;}
}
:deep(.item-text-overflow) {
text-align: left;
}
:deep(.selected-list) {
justify-content: end;
}
</style>
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!