no message
Showing
3 changed files
with
145 additions
and
69 deletions
| ... | @@ -32,6 +32,16 @@ function carUrl(data, type) { | ... | @@ -32,6 +32,16 @@ function carUrl(data, type) { |
| 32 | params: data | 32 | params: data |
| 33 | }) | 33 | }) |
| 34 | } | 34 | } |
| 35 | |||
| 36 | // 添加会员信息 | ||
| 37 | function addPersonToMyDept(data) { | ||
| 38 | return request({ | ||
| 39 | url: '/person/info/addPersonToMyDept', | ||
| 40 | method: 'post', | ||
| 41 | params: data | ||
| 42 | }) | ||
| 43 | } | ||
| 44 | |||
| 35 | // 图片上传 | 45 | // 图片上传 |
| 36 | function uploadImg(e){ | 46 | function uploadImg(e){ |
| 37 | const tempFilePaths = e.tempFilePaths; | 47 | const tempFilePaths = e.tempFilePaths; |
| ... | @@ -50,7 +60,12 @@ function uploadImg(e){ | ... | @@ -50,7 +60,12 @@ function uploadImg(e){ |
| 50 | uni.hideLoading(); | 60 | uni.hideLoading(); |
| 51 | }); | 61 | }); |
| 52 | } | 62 | } |
| 53 | 63 | function getInfo(perId) { | |
| 64 | return request({ | ||
| 65 | url: '/person/info/' + perId, | ||
| 66 | method: 'get' | ||
| 67 | }) | ||
| 68 | } | ||
| 54 | 69 | ||
| 55 | 70 | ||
| 56 | function getOwnMemberInfo() { | 71 | function getOwnMemberInfo() { |
| ... | @@ -264,7 +279,7 @@ function miniappData(params) { | ... | @@ -264,7 +279,7 @@ function miniappData(params) { |
| 264 | 279 | ||
| 265 | 280 | ||
| 266 | export { | 281 | export { |
| 267 | getMessage,reader,regionsList,carUrl,uploadImg, | 282 | getMessage,reader,regionsList,carUrl,uploadImg,addPersonToMyDept,getInfo, |
| 268 | 283 | ||
| 269 | getOwnMemberInfo, | 284 | getOwnMemberInfo, |
| 270 | getSiteList, | 285 | getSiteList, | ... | ... |
| ... | @@ -3,8 +3,8 @@ | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | ||
| 4 | 4 | ||
| 5 | // staging | 5 | // staging |
| 6 | const baseUrl_api = "http://192.168.1.11:8787"; | 6 | const baseUrl_api = "http://192.168.1.96:8787"; |
| 7 | 7 | ||
| 8 | export default { | 8 | export default { |
| 9 | baseUrl_api | 9 | baseUrl_api |
| 10 | } | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 10 | }; | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -17,9 +17,8 @@ | ... | @@ -17,9 +17,8 @@ |
| 17 | </uni-forms-item> | 17 | </uni-forms-item> |
| 18 | <uni-forms-item label="证件照" required name="picUrl" v-show="current === 1"> | 18 | <uni-forms-item label="证件照" required name="picUrl" v-show="current === 1"> |
| 19 | <view class="upCard"> | 19 | <view class="upCard"> |
| 20 | <uni-file-picker :class="baseFormData.card?'':'op0'" | 20 | <uni-file-picker :class="baseFormData.card?'':'op0'" v-model="baseFormData.cardObj" |
| 21 | v-model="baseFormData.cardObj" @delete="delimgFont" return-type="object" | 21 | @delete="delimgFont" return-type="object" limit="1" @select="upIdCardImgFront" |
| 22 | limit="1" @select="upIdCardImgFront" | ||
| 23 | :image-styles="imageStylesZJ"></uni-file-picker> | 22 | :image-styles="imageStylesZJ"></uni-file-picker> |
| 24 | <image v-if="!baseFormData.card" class="sfz" src="@/static/login/sfz.png"> | 23 | <image v-if="!baseFormData.card" class="sfz" src="@/static/login/sfz.png"> |
| 25 | </image> | 24 | </image> |
| ... | @@ -54,9 +53,8 @@ | ... | @@ -54,9 +53,8 @@ |
| 54 | placeholder="请输入详细地址" /></uni-forms-item> | 53 | placeholder="请输入详细地址" /></uni-forms-item> |
| 55 | 54 | ||
| 56 | <uni-forms-item label="头像" required name="photo"> | 55 | <uni-forms-item label="头像" required name="photo"> |
| 57 | <uni-file-picker v-model="baseFormData.photoObj" @delete="delPhoto" | 56 | <uni-file-picker v-model="baseFormData.photoObj" @delete="delPhoto" return-type="object" |
| 58 | return-type="object" limit="1" @select="upPhoto" | 57 | limit="1" @select="upPhoto" :image-styles="imageStylesTx"></uni-file-picker> |
| 59 | :image-styles="imageStylesTx"></uni-file-picker> | ||
| 60 | </uni-forms-item> | 58 | </uni-forms-item> |
| 61 | 59 | ||
| 62 | 60 | ||
| ... | @@ -110,17 +108,18 @@ | ... | @@ -110,17 +108,18 @@ |
| 110 | 108 | ||
| 111 | <script setup> | 109 | <script setup> |
| 112 | import { | 110 | import { |
| 113 | onMounted, | 111 | onMounted, |
| 114 | ref | 112 | ref |
| 115 | } from 'vue' | 113 | } from 'vue' |
| 116 | import * as api from '@/common/api.js' | 114 | import * as api from '@/common/api.js' |
| 117 | const current = ref(0) | 115 | const current = ref(0) |
| 118 | const popup = ref(null) | 116 | const popup = ref(null) |
| 119 | const agree = ref(false) | 117 | const agree = ref(false) |
| 118 | const perId = ref() | ||
| 120 | const regionsList = ref([]) | 119 | const regionsList = ref([]) |
| 121 | const baseFormData = ref({ | 120 | const baseFormData = ref({ |
| 122 | sex: '0', | 121 | sex: '0', |
| 123 | idcType:'0' | 122 | idcType: '0' |
| 124 | }) | 123 | }) |
| 125 | const baseFormData2 = ref({}) | 124 | const baseFormData2 = ref({}) |
| 126 | const items = ref(['手动录入', '自动录入']) | 125 | const items = ref(['手动录入', '自动录入']) |
| ... | @@ -150,8 +149,8 @@ | ... | @@ -150,8 +149,8 @@ |
| 150 | }]) | 149 | }]) |
| 151 | const placeholderStyle = ref('text-align: right;font-size:30rpx') | 150 | const placeholderStyle = ref('text-align: right;font-size:30rpx') |
| 152 | const inputstyle = ref({ | 151 | const inputstyle = ref({ |
| 153 | borderColor: '#fff', | 152 | borderColor: '#fff', |
| 154 | fontSize:'30rpx' | 153 | fontSize: '30rpx' |
| 155 | }) | 154 | }) |
| 156 | const imageStylesTx = ref({ | 155 | const imageStylesTx = ref({ |
| 157 | width: '210rpx', | 156 | width: '210rpx', |
| ... | @@ -168,51 +167,54 @@ | ... | @@ -168,51 +167,54 @@ |
| 168 | width: '500rpx', | 167 | width: '500rpx', |
| 169 | height: '316rpx' | 168 | height: '316rpx' |
| 170 | }); | 169 | }); |
| 171 | 170 | ||
| 172 | onMounted(()=>{ | 171 | onMounted(() => { |
| 173 | getRegionsList() | 172 | getRegionsList() |
| 174 | }) | 173 | }) |
| 175 | function getRegionsList() { | 174 | |
| 176 | api.regionsList().then(res=>{ | 175 | function getRegionsList() { |
| 177 | regionsList.value = res.data | 176 | api.regionsList().then(res => { |
| 178 | }) | 177 | regionsList.value = res.data |
| 179 | } | 178 | }) |
| 179 | } | ||
| 180 | |||
| 180 | function onClickItem(e) { | 181 | function onClickItem(e) { |
| 181 | if (current.value != e.currentIndex) { | 182 | if (current.value != e.currentIndex) { |
| 182 | current.value = e.currentIndex | 183 | current.value = e.currentIndex |
| 183 | } | 184 | } |
| 184 | } | 185 | } |
| 185 | 186 | ||
| 186 | function changeAgree(item) { | 187 | function changeAgree(item) { |
| 187 | if(agree.value){ | 188 | if (agree.value) { |
| 188 | agree.value = false | 189 | agree.value = false |
| 189 | } else { | 190 | } else { |
| 190 | agree.value = true | 191 | agree.value = true |
| 191 | } | 192 | } |
| 192 | // item = !item | 193 | // item = !item |
| 193 | } | 194 | } |
| 194 | 195 | ||
| 195 | //身份证识别 | 196 | //身份证识别 |
| 196 | function upIdCardImgFront(e) { | 197 | function upIdCardImgFront(e) { |
| 197 | baseFormData.value.card = e.tempFiles; | 198 | baseFormData.value.card = e.tempFiles; |
| 198 | console.log(e.tempFiles[0].file) | 199 | console.log(e.tempFiles[0].file) |
| 199 | const formData = new FormData() | 200 | const formData = new FormData() |
| 200 | formData.append('pic', e.tempFiles[0].file) | 201 | formData.append('pic', e.tempFiles[0].file) |
| 201 | api.carUrl(formData, baseFormData.value.idcType).then(res=>{ | 202 | api.carUrl(formData, baseFormData.value.idcType).then(res => { |
| 202 | baseFormData.value.idcUrl = res.data.url | 203 | baseFormData.value.idcUrl = res.data.url |
| 203 | baseFormData.value.sex = res.data.sex | 204 | baseFormData.value.sex = res.data.sex |
| 204 | baseFormData.value.birth = res.data.birth | 205 | baseFormData.value.birth = res.data.birth |
| 205 | baseFormData.value.idcCode = res.data.code | 206 | baseFormData.value.idcCode = res.data.code |
| 206 | baseFormDatabaseFormData.value.cityId = res.data.cityId | 207 | baseFormDatabaseFormData.value.cityId = res.data.cityId |
| 207 | baseFormData.value.address = res.data.address | 208 | baseFormData.value.address = res.data.address |
| 208 | baseFormData.value.photo = res.data.photo | 209 | baseFormData.value.photo = res.data.photo |
| 209 | baseFormData.value.name = res.data.name | 210 | baseFormData.value.name = res.data.name |
| 210 | baseFormData.value.picUUid = res.data.picUUid | 211 | baseFormData.value.picUUid = res.data.picUUid |
| 211 | }) | 212 | }) |
| 212 | // api.uploadImg(e).then(data => { | 213 | // api.uploadImg(e).then(data => { |
| 213 | // baseFormData.value.card = data.data; | 214 | // baseFormData.value.card = data.data; |
| 214 | // }); | 215 | // }); |
| 215 | } | 216 | } |
| 217 | |||
| 216 | function upPhoto(e) { | 218 | function upPhoto(e) { |
| 217 | // api.uploadImg(e).then(data => { | 219 | // api.uploadImg(e).then(data => { |
| 218 | // baseFormData.value.photo = data.data; | 220 | // baseFormData.value.photo = data.data; |
| ... | @@ -222,7 +224,7 @@ function getRegionsList() { | ... | @@ -222,7 +224,7 @@ function getRegionsList() { |
| 222 | function delimgFont(n) { | 224 | function delimgFont(n) { |
| 223 | baseFormData.value.card = ''; | 225 | baseFormData.value.card = ''; |
| 224 | } | 226 | } |
| 225 | 227 | ||
| 226 | function delPhoto(n) { | 228 | function delPhoto(n) { |
| 227 | baseFormData.value.photo = ''; | 229 | baseFormData.value.photo = ''; |
| 228 | } | 230 | } |
| ... | @@ -271,33 +273,87 @@ function getRegionsList() { | ... | @@ -271,33 +273,87 @@ function getRegionsList() { |
| 271 | popup.value.open() | 273 | popup.value.open() |
| 272 | } | 274 | } |
| 273 | 275 | ||
| 274 | function closepopup() { | 276 | function closepopup() { |
| 275 | agree.value = true | 277 | agree.value = true |
| 276 | popup.value.close() | 278 | popup.value.close() |
| 277 | } | 279 | } |
| 278 | 280 | ||
| 279 | function goSubmit() { | 281 | function goSubmit() { |
| 280 | if(!agree.value){ | 282 | if (!agree.value) { |
| 281 | uni.showToast({ | 283 | uni.showToast({ |
| 282 | icon:'none', | 284 | icon: 'none', |
| 283 | title: '请阅知入会须知', | 285 | title: '请阅知入会须知', |
| 284 | duration: 2000 | 286 | duration: 2000 |
| 285 | }); | 287 | }); |
| 288 | return | ||
| 286 | } | 289 | } |
| 290 | // 验证必填项 | ||
| 291 | //信息确认弹出 | ||
| 292 | uni.showModal({ | ||
| 293 | content: '确认信息正确', | ||
| 294 | success: function(res) { | ||
| 295 | if (res.confirm) { | ||
| 296 | api.addPersonToMyDept().then(res => { | ||
| 297 | if (res.data == 0) { | ||
| 298 | let msg = '该成员,实名认证未通过,注册失败!' | ||
| 299 | resultDialog.value = true | ||
| 300 | return | ||
| 301 | } | ||
| 302 | if (res.data * 1 < 0) { | ||
| 303 | // 会员调入弹出 | ||
| 304 | perId.value = res.data.slice(1) | ||
| 305 | getUserInfo() | ||
| 306 | return | ||
| 307 | } | ||
| 308 | |||
| 309 | let msg = '操作成功,您可以去列表中查看' | ||
| 310 | form.value = { perType: 1, idcType: '0' } | ||
| 311 | |||
| 312 | }).catch(() => { | ||
| 313 | let msg = '您已注册该会员,请不要重复注册!' | ||
| 314 | |||
| 315 | }) | ||
| 316 | } | ||
| 317 | } | ||
| 318 | }); | ||
| 319 | |||
| 320 | } | ||
| 321 | |||
| 322 | function getUserInfo() { | ||
| 323 | api.getInfo(perId.value).then(res=>{ | ||
| 324 | forms.value = res.data | ||
| 325 | if (forms.areaAssName)forms.ancestorNameList = forms.value.ancestorNameList.join(',').replaceAll(',', '/') | ||
| 326 | }) | ||
| 287 | } | 327 | } |
| 288 | </script> | 328 | </script> |
| 289 | 329 | ||
| 290 | <style lang="scss" scoped> | 330 | <style lang="scss" scoped> |
| 291 | :deep(.segmented-control){height:100rpx;} | 331 | :deep(.segmented-control) { |
| 292 | :deep(.segmented-control__text){line-height: 2;font-size: 30rpx;} | 332 | height: 100rpx; |
| 293 | .tt{text-align: center;font-size: 30rpx;padding: 40rpx 0 0;} | 333 | } |
| 334 | |||
| 335 | :deep(.segmented-control__text) { | ||
| 336 | line-height: 2; | ||
| 337 | font-size: 30rpx; | ||
| 338 | } | ||
| 339 | |||
| 340 | .tt { | ||
| 341 | text-align: center; | ||
| 342 | font-size: 30rpx; | ||
| 343 | padding: 40rpx 0 0; | ||
| 344 | } | ||
| 345 | |||
| 294 | .popBody { | 346 | .popBody { |
| 295 | font-size: 28rpx; | 347 | font-size: 28rpx; |
| 296 | line-height: 1.5; | 348 | line-height: 1.5; |
| 297 | font-family: 华文仿宋; | 349 | font-family: 华文仿宋; |
| 298 | height: 80vh; | 350 | height: 80vh; |
| 299 | overflow: auto;padding: 30rpx; | 351 | overflow: auto; |
| 300 | .btn-red{margin: 50rpx 0 30rpx;} | 352 | padding: 30rpx; |
| 353 | |||
| 354 | .btn-red { | ||
| 355 | margin: 50rpx 0 30rpx; | ||
| 356 | } | ||
| 301 | } | 357 | } |
| 302 | 358 | ||
| 303 | .agreeline { | 359 | .agreeline { |
| ... | @@ -335,9 +391,14 @@ function getRegionsList() { | ... | @@ -335,9 +391,14 @@ function getRegionsList() { |
| 335 | 391 | ||
| 336 | .op0 { | 392 | .op0 { |
| 337 | opacity: 0; | 393 | opacity: 0; |
| 338 | } | 394 | } |
| 339 | 395 | ||
| 340 | 396 | ||
| 341 | :deep(.item-text-overflow){text-align: left;} | 397 | :deep(.item-text-overflow) { |
| 342 | :deep(.selected-list){justify-content: end;} | 398 | text-align: left; |
| 399 | } | ||
| 400 | |||
| 401 | :deep(.selected-list) { | ||
| 402 | justify-content: end; | ||
| 403 | } | ||
| 343 | </style> | 404 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment