appliSystem3.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <template>
  2. <view class="content">
  3. <view class="box">
  4. <view class="info">
  5. 我单位自愿加入中国红十字会,遵守《中华人民共和国红十字会会法》,
  6. 承认《中国红十字会章程》,按时交纳会费,积极参加红十字会活动,维护红十字会合法权益,
  7. 发扬“人道、博爱、奉献”的红十字精神,为发展红十字事业做贡献。
  8. </view>
  9. <view class="red-box">
  10. 报名参与
  11. </view>
  12. <view class="box-1">
  13. <view class="box-left">
  14. 单位名称<text class="imp"></text>:
  15. </view>
  16. <input type="text" value="" class="list-input" v-model="name" />
  17. </view>
  18. <view class="box-1">
  19. <view class="box-left">
  20. 单位性质<text class="imp"></text>:
  21. </view>
  22. <input type="text" value="" class="list-input" v-model="name" />
  23. </view>
  24. <view class="box-1">
  25. <view class="box-left">
  26. 法人代表<text class="imp"></text>:
  27. </view>
  28. <input type="text" value="" class="list-input" v-model="name" />
  29. </view>
  30. <view class="box-1">
  31. <view class="box-left">
  32. 单位人数<text class="imp"></text>:
  33. </view>
  34. <input type="text" value="" class="list-input" v-model="name" />
  35. </view>
  36. <view class="box-1">
  37. <view class="box-left">
  38. 联系人<text class="imp"></text>:
  39. </view>
  40. <input type="text" value="" class="list-input" v-model="name" />
  41. </view>
  42. <view class="box-1">
  43. <view class="box-left">
  44. 常驻地区<text class="imp"></text>:
  45. </view>
  46. <input type="text" value="" class="list-input" v-model="name" />
  47. </view>
  48. <view class="box-1">
  49. <view class="box-left">
  50. 邮政编码<text class="imp"></text>:
  51. </view>
  52. <input type="text" value="" class="list-input" v-model="name" />
  53. </view>
  54. <view class="box-1">
  55. <view class="box-left">
  56. 联系电话<text class="imp"></text>:
  57. </view>
  58. <input type="text" value="" class="list-input" v-model="name" />
  59. </view>
  60. <view class="box-1">
  61. <view class="box-left">
  62. 电子邮箱<text class="imp"></text>:
  63. </view>
  64. <input type="text" value="" class="list-input" v-model="name" />
  65. </view>
  66. <view class="box-1">
  67. <view class="box-left">
  68. 联系地址<text class="imp"></text>:
  69. </view>
  70. <input type="text" value="" class="list-input" v-model="name" />
  71. </view>
  72. </view>
  73. <view class="buttom" :class="{ action: loding }" @click="!loding?join():''">
  74. 提交申请
  75. </view>
  76. </view>
  77. </template>
  78. <script>
  79. import {
  80. joinSec
  81. } from '@/api/index.js';
  82. import {
  83. upload
  84. } from '@/api/ask.js';
  85. export default {
  86. data() {
  87. const currentDate = this.getDate({
  88. format: true
  89. })
  90. return {
  91. loding: false, //是否提交中
  92. array: ['男', '女'],
  93. chooseEdu: ['博士后', '博士', '硕士', '本科', '专科', '其他'],
  94. chooseVol: ['是', '否'],
  95. chooseExp: ['是', '否'],
  96. index: 0,
  97. mz: '',
  98. cardimg: '', //证件照
  99. card: '',
  100. checklist: [],
  101. name: '',
  102. sex: '',
  103. birth: '',
  104. phone: '',
  105. address: '',
  106. work: '',
  107. specialty: '',
  108. education: '',
  109. }
  110. },
  111. computed: {
  112. startDate() {
  113. return this.getDate('start');
  114. },
  115. endDate() {
  116. return this.getDate('end');
  117. }
  118. },
  119. methods: {
  120. async join() {
  121. let obj = this;
  122. if (obj.name == '') {
  123. obj.$api.msg('请输入您的姓名');
  124. return;
  125. }
  126. if (obj.birth == '') {
  127. obj.$api.msg('请选择出生年月');
  128. return
  129. }
  130. if (obj.sex == '') {
  131. obj.$api.msg('请输入您的性别');
  132. return;
  133. }
  134. if (obj.education == '') {
  135. obj.$api.msg('请选择您的文化程度');
  136. return;
  137. }
  138. if (obj.mz == '') {
  139. obj.$api.msg('请填写您所属的民族');
  140. return;
  141. }
  142. if (obj.specialty == '') {
  143. obj.$api.msg('请填写您的职位');
  144. return;
  145. }
  146. if (obj.address == '') {
  147. obj.$api.msg('请填写您的地址');
  148. return;
  149. }
  150. let reg1 =
  151. /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
  152. if (!reg1.test(obj.card)) {
  153. obj.$api.msg('请填写正确的身份证信息');
  154. return;
  155. }
  156. const reg = /^(\+?0?86-?)?1[\d]\d{9}$/;
  157. if (!reg.test(obj.phone)) {
  158. obj.$api.msg('请填写正确的手机号码');
  159. return;
  160. }
  161. // /^(^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$)|(^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])((\d{4})|\d{3}[Xx])$)$/
  162. if (obj.work == '') {
  163. obj.$api.msg('请填写您的工作单位');
  164. return;
  165. }
  166. if (obj.cardimg == '') {
  167. obj.$api.msg('请上传您的证件');
  168. return
  169. }
  170. if (obj.specialty == '') {
  171. obj.$api.msg('请填写您的职位');
  172. return;
  173. }
  174. // if (obj.education == '') {
  175. // obj.$api.msg('请填写您的教育程度');
  176. // return;
  177. // }
  178. // if (obj.is_vol == '') {
  179. // obj.$api.msg('请填写您的是否受过志愿服务');
  180. // return;
  181. // }
  182. // if (obj.is_experience == '') {
  183. // obj.$api.msg('请填写您的有无服务经验');
  184. // return;
  185. // }
  186. obj.loding = true;
  187. joinSec({
  188. name: obj.name,
  189. sex: obj.sex,
  190. education: obj.education,
  191. birth: obj.birth,
  192. mz: obj.mz,
  193. phone: obj.phone,
  194. address: obj.address,
  195. work: obj.work,
  196. specialty: obj.specialty,
  197. img: obj.cardimg,
  198. card: obj.card,
  199. }).then(e => {
  200. obj.name = '';
  201. obj.sex = '';
  202. obj.education = '';
  203. obj.birth = '';
  204. obj.mz = '',
  205. obj.phone = '';
  206. obj.address = '';
  207. obj.work = '';
  208. obj.specialty = '';
  209. obj.cardimg = '',
  210. obj.card = ''
  211. uni.navigateTo({
  212. url: '../joinSuc/joinNow'
  213. });
  214. }).catch(function(e) {
  215. console.log('出错了')
  216. console.log(e);
  217. });
  218. },
  219. imgsub() {
  220. console.log('imgsub')
  221. upload({
  222. filename: ''
  223. }).then(data => {
  224. this.cardimg = data[0].url;
  225. })
  226. },
  227. // 选择性别
  228. bindPickerSex: function(e) {
  229. console.log(this.array[e.target.value])
  230. this.sex = this.array[e.target.value];
  231. this.index = e.target.value + 1;
  232. },
  233. // 选择教育程度
  234. bindPickerEdu: function(e) {
  235. this.education = this.chooseEdu[e.target.value];
  236. this.index = e.target.value + 1;
  237. },
  238. // 选择日期
  239. bindDateChange: function(e) {
  240. this.birth = e.target.value
  241. },
  242. // 是否参加志愿活动
  243. bindPickerVol: function(e) {
  244. this.is_vol = this.chooseVol[e.target.value];
  245. this.index = e.target.value + 1;
  246. },
  247. // 有无服务经验
  248. bindPickerExp: function(e) {
  249. this.is_experience = this.chooseExp[e.target.value];
  250. this.index = e.target.value + 1;
  251. },
  252. getDate(type) {
  253. const date = new Date();
  254. let year = date.getFullYear();
  255. let month = date.getMonth() + 1;
  256. let day = date.getDate();
  257. if (type === 'start') {
  258. year = year - 60;
  259. } else if (type === 'end') {
  260. year = year + 2;
  261. }
  262. month = month > 9 ? month : '0' + month;;
  263. day = day > 9 ? day : '0' + day;
  264. return `${year}-${month}-${day}`;
  265. },
  266. // 选择可提供时间
  267. // this.quantum = item.detail.value.join(',');
  268. checktime1(e) {
  269. // var items = this.timeList,
  270. // let quantum = [];
  271. this.quantum = e.detail.value.join(',');
  272. console.log(this.quantum);
  273. },
  274. checktime2(e) {
  275. // var items = this.timeList,
  276. let values = e.detail.value;
  277. // let quantum = [];
  278. console.log(values);
  279. },
  280. checktime3(e) {
  281. // var items = this.timeList,
  282. let values = e.detail.value;
  283. // let quantum = [];
  284. console.log(values);
  285. },
  286. //选择有兴趣参与的工作
  287. checkjob(item) {
  288. this.taste = item.detail.value.join(',');
  289. },
  290. // 选择专长checkspeciality
  291. checkspeciality(item) {
  292. this.speciali = item.detail.value.join(',');
  293. },
  294. }
  295. }
  296. </script>
  297. <style lang="scss">
  298. page {
  299. background-color: #f3afad;
  300. }
  301. .content {
  302. padding-top: 44rpx;
  303. background-color: #f3afad;
  304. padding-bottom: 108rpx;
  305. .buttom {
  306. width: 660rpx;
  307. height: 100rpx;
  308. // background: linear-gradient(0deg, #C90F1B, #F14D33);
  309. background: $motif-color;
  310. border-radius: 50rpx;
  311. margin: 50rpx auto;
  312. font-size: 36rpx;
  313. font-weight: 400;
  314. color: #FFFFFF;
  315. line-height: 100rpx;
  316. text-align: center;
  317. &.action {
  318. background: #999999;
  319. }
  320. }
  321. .box {
  322. // margin-top: 44rpx;
  323. width: 690rpx;
  324. margin: 20rpx auto 0;
  325. background-color: #FFFFFF;
  326. border-radius: 10rpx;
  327. padding: 28rpx 20rpx 32rpx 20rpx;
  328. position: relative;
  329. .info{
  330. text-indent: 54rpx;
  331. margin:42rpx 0 24rpx;
  332. padding: 0 12rpx 20rpx;
  333. // border: 3rpx solid #009100;
  334. width: 100%;
  335. display: flex;
  336. flex-direction: column;
  337. border-radius: 25rpx;
  338. color: #E63931;
  339. }
  340. .red-box {
  341. width: 405rpx;
  342. line-height: 66rpx;
  343. text-align: center;
  344. // background: linear-gradient(0deg, #C90F1B, #F14D33);
  345. background: $motif-color;
  346. border-radius: 10rpx;
  347. font-size: 30rpx;
  348. font-weight: 500;
  349. color: #FFFFFF;
  350. // position: relative;
  351. position: absolute;
  352. top: -36rpx;
  353. left: 50%;
  354. transform: translateX(-50%);
  355. z-index: 1;
  356. }
  357. .box-check {
  358. font-size: 28rpx;
  359. font-weight: 500;
  360. color: #666666;
  361. line-height: 100rpx;
  362. }
  363. .imp {
  364. color: red;
  365. margin-left: 5rpx;
  366. }
  367. .box-1 {
  368. display: flex;
  369. flex-direction: column;
  370. align-items: center;
  371. width: 100%;
  372. margin-top: 32rpx;
  373. // height: 133rpx;
  374. .box-left {
  375. padding-left: 2rpx;
  376. width: 100%;
  377. text-align: left;
  378. color: #E63931;
  379. }
  380. input{
  381. height: 66rpx;
  382. line-height: 66rpx;
  383. margin-top: 32rpx;
  384. // height: 88rpx;
  385. }
  386. .list-input {
  387. padding-left: 24rpx;
  388. // margin: 12rpx 0 ;
  389. // line-height: 66rpx;
  390. display: flex;
  391. align-items: center;
  392. width: 100%;
  393. font-size: 36rpx;
  394. flex: 1;
  395. color: #FF9797;
  396. border: 1rpx solid #f3afad;
  397. border-radius: 22rpx;
  398. text-align: left;
  399. padding-right: 24rpx;
  400. .input-placeholder {
  401. height: 70rpx;
  402. color: #FF9797;
  403. }
  404. }
  405. .box-right {
  406. display: flex;
  407. align-items: center;
  408. padding-left: 24rpx;
  409. height: 66rpx;
  410. line-height: 66rpx;
  411. border: 1rpx solid #f3afad;
  412. border-radius: 22rpx;
  413. margin: 32rpx 36rpx 0 36rpx;
  414. width: 96%;
  415. font-size: 36rpx;
  416. color: #FF9797;
  417. text-align: left;
  418. // line-height: 1;
  419. }
  420. }
  421. .upload-box {
  422. width: 100%;
  423. height: 247rpx;
  424. background: #FFFFFF;
  425. // border: 1px solid #E63931;
  426. border-radius: 27rpx;
  427. display: flex;
  428. flex-direction: column;
  429. padding: 30rpx 40rpx 30rpx 0;
  430. margin: 0 auto 30rpx;
  431. .upload-left {
  432. font-weight: 400;
  433. color: #E63931;
  434. }
  435. .upload-right {
  436. flex: 1;
  437. display: flex;
  438. align-items: center;
  439. justify-content: center;
  440. .upload-img {
  441. width: 103rpx;
  442. height: 103rpx;
  443. margin-top: 24rpx;
  444. }
  445. }
  446. }
  447. }
  448. }
  449. </style>