test.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view>
  3. <view class="form">
  4. <view class="card">
  5. <u-form :model="model" labelWidth="200" ref="uForm" >
  6. <u-form-item label="所在地址" >
  7. <u-input type="text" v-model="model.address" placeholder="请填写所在地址" ></u-input>
  8. </u-form-item>
  9. <u-form-item :required="true" label="身份证号" >
  10. <u-input type="idcard" v-model="model.idCard" placeholder="请填写身份证号" ></u-input>
  11. </u-form-item>
  12. <u-form-item :required="true" label="所属党支部" >
  13. <u-input type="select" :select-open="branchShow" v-model="branchLabel" placeholder="请选择所属党支部" @click="branchShow=true"></u-input>
  14. </u-form-item>
  15. <u-form-item :required="true" label="入党时间" >
  16. <u-input type="select" :select-open="enterTimeShow" v-model="model.enterTime" placeholder="请选择入党时间" @click="enterTimeShow=true"></u-input>
  17. </u-form-item>
  18. <u-form-item class="" :required="true" label="请上传党员证件图像" label-position="top">
  19. <view class="upload-img">
  20. <view class="">
  21. <upload-img
  22. width="480"
  23. height="320"
  24. :currentImage="model.memberPic"
  25. bgsrc="http://139.9.103.171:1888/miniofile/xlyq/upload.png"
  26. >
  27. </upload-img>
  28. <view class="text-center padding-top-20 base-color" >
  29. <text class="cuIcon-camera padding-right-sm" style="font-size: 30rpx;"></text>
  30. <text v-if="$isEmpty(model.memberPic)">点击上传党员证件图像</text>
  31. <text style="margin-top: 40rpx;display: inline-block;" v-else>点击重新上传</text>
  32. </view>
  33. </view>
  34. </view>
  35. </u-form-item>
  36. </u-form>
  37. </view>
  38. </view>
  39. <view >
  40. <view class="bg-white" style="height: 80rpx;"></view>
  41. <view class="" @click="submit" style="width: 90%;margin: 0 auto ;margin-bottom: 10%;">
  42. <view class="cu-btn round base-bg-color" style="padding: 40rpx;width: 100%;" >
  43. <text class="cuIcon-add"></text>
  44. <text >确认提交</text>
  45. </view>
  46. </view>
  47. </view>
  48. <u-select @confirm="branchConfirm" v-model="branchShow" :list="branchList"></u-select>
  49. <u-picker v-model="enterTimeShow" mode="time" :params="params" @confirm="enterTimeConfirm"></u-picker>
  50. </view>
  51. </template>
  52. <script>
  53. import uploadImg from '@/components/uploadimg/uploadImg.vue'
  54. export default {
  55. components:{
  56. uploadImg
  57. },
  58. data() {
  59. return {
  60. model:{},
  61. //党支部
  62. branchShow:false,
  63. branchLabel:'',
  64. branchList:[],
  65. //入党时间
  66. enterTimeShow:false,
  67. params: {
  68. year: true,
  69. month: true,
  70. day: true,
  71. hour: false,
  72. minute: false,
  73. second: false
  74. },
  75. }
  76. },
  77. methods: {
  78. //党支部
  79. branchConfirm(){
  80. this.model.branchId=e[0].value
  81. this.branchLabel=e[0].label
  82. },
  83. //入党时间
  84. enterTimeConfirm(e){
  85. this.model.enterTime=e.year+''+e.month+''+e.day
  86. },
  87. //党员证件照
  88. chooseImage(type) {
  89. this.$mpi.chooseImage().then(res=>{
  90. this.$api.uploadFile.submit(res[0]).then(res=>{
  91. this.model.memberPic=res.data.link
  92. })
  93. })
  94. },
  95. //提交
  96. submit(){
  97. if (this.$isEmpty(this.model.idCard)) {
  98. this.$u.toast('请填写身份证号')
  99. return
  100. }
  101. }
  102. }
  103. }
  104. </script>
  105. <style lang="scss">
  106. page{
  107. background-color: #FFFFFF;
  108. }
  109. .form{
  110. padding: 40rpx 30rpx;
  111. .tag{
  112. width: 35rpx;
  113. height: 35rpx;
  114. display: block;
  115. padding-top: 6rpx;
  116. padding-right: 10rpx;
  117. }
  118. .card{
  119. margin-top: 20rpx;
  120. padding: 0 30rpx;
  121. box-sizing: border-box;
  122. border-radius: 12rpx;
  123. box-shadow: 0 -10rpx rgba(248, 248, 248,.9) ,0 10rpx rgba(248, 248, 248,.9) , -10rpx 0rpx rgba(248, 248, 248,.9) ,10rpx 0rpx rgba(248, 248, 248,.9);
  124. .item{
  125. padding:30rpx 0;
  126. display: flex;
  127. justify-content: space-between;
  128. }
  129. .upload-img{
  130. padding:50rpx 0 30rpx;
  131. display: flex;
  132. justify-content: center;
  133. align-items: center;
  134. }
  135. }
  136. }
  137. </style>