applyMemberVindicate.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <view class="common_page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header :title="title" bgColor="#FFFFFF"></cus-header>
  4. <div class="form">
  5. <div class="title">报名人员信息</div>
  6. <div class="pre adfac" style="margin-top: 40rpx;">
  7. <div class="pre-title"><span>*</span>人员类型</div>
  8. <div class="pre-content adfac">
  9. <div class="pre-content-box adfac" @tap="changeMember(1,'personnelType')">
  10. <image v-if="memberInfo.personnelType==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
  11. <image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
  12. <text>成人</text>
  13. </div>
  14. <div class="pre-content-box adfac" @tap="changeMember(2,'personnelType')">
  15. <image v-if="memberInfo.personnelType==2" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
  16. <image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
  17. <text>学生</text>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="pre adfac">
  22. <div class="pre-title"><span>*</span>姓名</div>
  23. <div class="pre-content">
  24. <up-input v-model="memberInfo.name" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入姓名"></up-input>
  25. </div>
  26. </div>
  27. <div class="pre adfac">
  28. <div class="pre-title"><span>*</span>身份证</div>
  29. <div class="pre-content">
  30. <up-input v-model="memberInfo.idCard" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入身份证"></up-input>
  31. </div>
  32. </div>
  33. <div class="pre adfac">
  34. <div class="pre-title"><span style="color: #FFFFFF;">*</span>义工号</div>
  35. <div class="pre-content">
  36. <up-input v-model="memberInfo.volunteerNo" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入义工号"></up-input>
  37. </div>
  38. </div>
  39. <div class="pre adfac">
  40. <div class="pre-title"><span>*</span>性别</div>
  41. <div class="pre-content adfac">
  42. <div class="pre-content-box adfac" @tap="changeMember(0,'gender')">
  43. <image v-if="memberInfo.gender==0" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
  44. <image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
  45. <text>男</text>
  46. </div>
  47. <div class="pre-content-box adfac" @tap="changeMember(1,'gender')">
  48. <image v-if="memberInfo.gender==1" src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/9efae012-a9fd-4a0d-9e14-7ec90001e712.png"></image>
  49. <image v-else src="https://transcend.ringzle.com/xiaozhi-app/profile/2025/10/09/5ae64305-d1e0-4ffe-8dc0-f9d3704ac370.png"></image>
  50. <text>女</text>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="pre adfac" v-if="memberInfo.personnelType==2">
  55. <div class="pre-title"><span>*</span>就读学校</div>
  56. <div class="pre-content">
  57. <up-input v-model="memberInfo.currentSchool" border="none" style="font-size: 30rpx;color: #252525;" placeholder="请输入就读学校"></up-input>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="btn" @tap="handleSave">保存</div>
  62. </view>
  63. </template>
  64. <script setup name="">
  65. import CusHeader from '@/components/CusHeader/index.vue'
  66. import { onLoad } from '@dcloudio/uni-app';
  67. import { ref, getCurrentInstance } from 'vue'
  68. const { proxy } = getCurrentInstance()
  69. const title = ref('添加报名人员')
  70. const memberInfo = ref({
  71. userId:'',
  72. personnelType:1,
  73. name:'',
  74. idCard:'',
  75. volunteerNo:'',
  76. gender:0,
  77. currentSchool:''
  78. })
  79. const changeMember = (value,key) => {
  80. memberInfo.value[key] = value;
  81. }
  82. const handleSave = () => {
  83. if(!memberInfo.value.name) return proxy.$showToast('请输入姓名')
  84. if(!proxy.$reg.idCard(memberInfo.value.idCard)) return proxy.$showToast('请输入正确的身份证号')
  85. if(!memberInfo.value.currentSchool&&memberInfo.value.personnelType==2) return proxy.$showToast('请输入就读学校')
  86. memberInfo.value.gender = memberInfo.value.gender??1;
  87. if(!memberInfo.value.userId) memberInfo.value.userId = JSON.parse(uni.getStorageSync('userInfo')).id;
  88. proxy.$api[memberInfo.value.id?'put':'post']('/core/family/member',memberInfo.value).then(({data:res})=>{
  89. if(res.code!==0) return proxy.$showToast(res.msg)
  90. proxy.$showToast(memberInfo.value.id?'编辑成功':'添加成功')
  91. setTimeout(()=>{
  92. uni.redirectTo({
  93. url:'/pagesHome/applyMember'
  94. })
  95. },1500)
  96. })
  97. }
  98. const getMemberInfo = (id) => {
  99. proxy.$api.get(`/core/family/member/${id}`).then(({data:res})=>{
  100. if(res.code!==0) return proxy.$showToast(res.msg)
  101. memberInfo.value = {...memberInfo.value,...res.data}
  102. })
  103. }
  104. onLoad((options)=>{
  105. const id = options?.id;
  106. if(id){
  107. title.value = '编辑报名人员';
  108. getMemberInfo(id)
  109. }
  110. })
  111. </script>
  112. <style scoped lang="scss">
  113. .common_page{
  114. padding-bottom: 184rpx;
  115. .form{
  116. background: #FFFFFF;
  117. border-radius: 24rpx;
  118. margin-top: 20rpx;
  119. padding: 36rpx 24rpx 0;
  120. .title{
  121. font-family: PingFang-SC, PingFang-SC;
  122. font-weight: bold;
  123. font-size: 36rpx;
  124. color: #151B29;
  125. line-height: 48rpx;
  126. }
  127. .pre{
  128. padding: 25rpx 0;
  129. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #F2F2F2;
  130. &-title{
  131. width: 209rpx;
  132. font-family: PingFangSC, PingFang SC;
  133. font-weight: 400;
  134. font-size: 28rpx;
  135. color: #676775;
  136. line-height: 40rpx;
  137. label{
  138. font-family: PingFangSC, PingFang SC;
  139. font-weight: 400;
  140. font-size: 30rpx;
  141. color: #F4657A;
  142. line-height: 42rpx;
  143. margin-right: 4rpx;
  144. }
  145. }
  146. &-content{
  147. width: calc(100% - 209rpx);
  148. &-box{
  149. width: 184rpx;
  150. image{
  151. width: 28rpx;
  152. height: 28rpx;
  153. }
  154. text{
  155. font-family: PingFangSC, PingFang SC;
  156. font-weight: 400;
  157. font-size: 30rpx;
  158. color: #252525;
  159. line-height: 42rpx;
  160. margin-left: 16rpx;
  161. }
  162. }
  163. }
  164. }
  165. }
  166. .btn{
  167. width: calc(100% - 80rpx);
  168. height: 90rpx;
  169. background: #B7F358;
  170. border-radius: 45rpx;
  171. font-family: PingFang-SC, PingFang-SC;
  172. font-weight: bold;
  173. font-size: 32rpx;
  174. color: #151B29;
  175. line-height: 90rpx;
  176. text-align: center;
  177. letter-spacing: 2rpx;
  178. position: fixed;
  179. left: 40rpx;
  180. bottom: 64rpx;
  181. }
  182. }
  183. </style>