景徳镇旅游微信小程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

199 lines
4.2 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <!-- 加入志愿者 -->
  3. <view class="volunteer">
  4. <navbar title="加入志愿者" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="volunteer-form">
  6. <view class="volunteer-form-title">
  7. <view>志愿者信息</view>
  8. </view>
  9. <view class="volunteer-form-sheet">
  10. <view class="volunteer-form-sheet-cell">
  11. <view>
  12. 姓名
  13. </view>
  14. <input v-model="form.volunteerName" placeholder="请输入您的姓名" />
  15. </view>
  16. <view>
  17. <uv-picker ref="picker" :columns="columns" @confirm="confirm"></uv-picker>
  18. <view class="volunteer-form-sheet-cell">
  19. <view @click="openPicker">
  20. 证件类型
  21. </view>
  22. <uv-cell :border="false"
  23. :title="form.cerType || '选择证件类型'"
  24. :isLink="true" arrow-direction="right"
  25. @click="openPicker" />
  26. </view>
  27. </view>
  28. <view class="volunteer-form-sheet-cell">
  29. <view>
  30. 证件号码
  31. </view>
  32. <input placeholder="请输入证件号码" v-model="form.cerNo" />
  33. </view>
  34. <view class="volunteer-form-sheet-cell">
  35. <view>
  36. 手机号码
  37. </view>
  38. <!-- <uv-input
  39. v-model="form.volunteerPhone"
  40. placeholder="请输入手机号码"
  41. fontSize="24rpx"
  42. border="none"
  43. :custom-style="{backgroundColor: '#fff',
  44. padding : '0 20rpx'}"> -->
  45. <!-- <template #suffix>
  46. <view>
  47. <text class="yzm">获取验证码</text>
  48. </view>
  49. </template> -->
  50. <!-- </uv-input> -->
  51. <input placeholder="请输入手机号码" v-model="form.volunteerPhone" />
  52. </view>
  53. <!-- <view class="volunteer-form-sheet-cell">
  54. <view>
  55. 验证码
  56. </view>
  57. <input placeholder="请输入验证码" />
  58. </view> -->
  59. </view>
  60. <view class="submit" @click="submit">
  61. <view>
  62. 提交
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. data() {
  71. return {
  72. columns: [
  73. ['居民身份证']
  74. ],
  75. form : {
  76. cerNo : '',//证件号码
  77. cerType : '',//证件类型
  78. volunteerName : '',//志愿者姓名
  79. volunteerPhone : '',//手机号码
  80. },
  81. }
  82. },
  83. methods: {
  84. openPicker() {
  85. this.$refs.picker.open();
  86. },
  87. confirm(e) {
  88. this.form.cerType = e.value[0]
  89. },
  90. submit(){
  91. if(this.$utils.verificationAll(this.form, {
  92. volunteerName : '请输入志愿者姓名',//志愿者姓名
  93. cerType : '请选择证件类型',//证件类型
  94. cerNo : '请输入证件号码',//证件号码
  95. volunteerPhone : '请输入手机号码',//手机号码
  96. })){
  97. return
  98. }
  99. if(this.$utils.verificationPhone(this.form.volunteerPhone)){
  100. uni.showToast({
  101. title: '请输入正确的手机号码',
  102. icon : 'none'
  103. })
  104. }
  105. this.$api('addVolunteer', this.form, res => {
  106. if(res.code == 200){
  107. setTimeout(uni.navigateBack, 800, -1)
  108. uni.showToast({
  109. title: res.message,
  110. icon : 'none'
  111. })
  112. }
  113. })
  114. },
  115. }
  116. }
  117. </script>
  118. <style scoped lang="scss">
  119. .volunteer {
  120. .volunteer-form {
  121. width: 94%;
  122. margin-top: 40rpx;
  123. margin-left: 3%;
  124. .volunteer-form-title {
  125. color: #333;
  126. font-size: 36rpx;
  127. font-weight: 600;
  128. padding: 0rpx 0rpx 0rpx 8rpx;
  129. border-left: 8rpx solid #F6732D;
  130. }
  131. .volunteer-form-sheet {
  132. display: flex;
  133. height: 500rpx;
  134. flex-direction: column;
  135. justify-content: space-around;
  136. .volunteer-form-sheet-cell {
  137. display: flex;
  138. font-size: 28rpx;
  139. align-items: center;
  140. .yzm {
  141. display: inline-block;
  142. font-size: 22rpx;
  143. padding: 6rpx;
  144. border-radius: 20rpx;
  145. background-color: #ff0829;
  146. color: #fff;
  147. }
  148. /deep/ .uv-cell__title-text {
  149. font-size: 24rpx;
  150. }
  151. /deep/ .uv-cell__body {
  152. padding: 0;
  153. }
  154. /deep/ .uv-cell {
  155. flex: 1;
  156. }
  157. view {
  158. width: 140rpx;
  159. padding: 20rpx 0;
  160. }
  161. input {
  162. flex: 1;
  163. height: 100%;
  164. color: #000;
  165. background-color: #fff;
  166. font-size: 24rpx;
  167. padding: 0 20rpx;
  168. }
  169. }
  170. }
  171. .submit{
  172. position: fixed;
  173. bottom: 5%;
  174. background-color: #b12026;
  175. color: #fff;
  176. width: 94%;
  177. padding: 20rpx 0;
  178. text-align: center;
  179. border-radius: 40rpx;
  180. }
  181. }
  182. }
  183. </style>