group.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <template>
  2. <view class="content">
  3. <view class="top-box">
  4. 团队报名
  5. </view>
  6. <view class="box">
  7. <view class="box-1">
  8. <view class="box-left">
  9. 单位名称
  10. <text class="imp"></text>
  11. </view>
  12. <input type="text" value="" class="list-input" v-model="unit_name" placeholder="请输入单位名称" placeholder-class="placeholder" />
  13. </view>
  14. <view class="box-1">
  15. <view class="box-left">
  16. 单位性质
  17. <text class="imp"></text>
  18. </view>
  19. <input type="text" value="" class="list-input" v-model="unit_type" placeholder="请输入单位性质" placeholder-class="placeholder" />
  20. </view>
  21. <view class="box-1">
  22. <view class="box-left">
  23. 法人代表
  24. <text class="imp"></text>
  25. </view>
  26. <input type="text" value="" class="list-input" v-model="unit_peo" placeholder="请输入法人代表" placeholder-class="placeholder" />
  27. </view>
  28. <view class="box-1">
  29. <view class="box-left">
  30. 单位人数
  31. <text class="imp"></text>
  32. </view>
  33. <input type="number" value="" class="list-input" v-model="unit_num" placeholder="请输入单位人数" placeholder-class="placeholder" />
  34. </view>
  35. <view class="box-1">
  36. <view class="box-left">
  37. 联系人
  38. <text class="imp"></text>
  39. </view>
  40. <input type="text" value="" class="list-input" v-model="unit_concat" placeholder="请输入联系人" placeholder-class="placeholder" />
  41. </view>
  42. <view class="box-1">
  43. <view class="box-left">
  44. 常驻地区
  45. <text class="imp"></text>
  46. </view>
  47. <input type="text" value="" class="list-input" v-model="usually_area" placeholder="请输入常驻地区" placeholder-class="placeholder" />
  48. </view>
  49. <view class="box-1">
  50. <view class="box-left">
  51. 邮政编码
  52. <text class="imp"></text>
  53. </view>
  54. <input type="number" value="" class="list-input" v-model="postal_code" placeholder="请输入邮政编码" placeholder-class="placeholder" />
  55. </view>
  56. <view class="box-1">
  57. <view class="box-left">
  58. 联系电话
  59. <text class="imp"></text>
  60. </view>
  61. <input type="number" value="" class="list-input" v-model="concat_phone" placeholder="请输入联系电话" placeholder-class="placeholder" />
  62. </view>
  63. <view class="box-1">
  64. <view class="box-left">
  65. 电子邮箱
  66. <text class="imp"></text>
  67. </view>
  68. <input type="text" value="" class="list-input" v-model="email" placeholder="请输入电子邮箱" placeholder-class="placeholder" />
  69. </view>
  70. <view class="box-1">
  71. <view class="box-left">
  72. 联系地址
  73. <text class="imp"></text>
  74. </view>
  75. <input type="text" value="" class="list-input" v-model="concat_address" placeholder="请输入联系地址" placeholder-class="placeholder" />
  76. </view>
  77. </view>
  78. <!-- <view class="buttom-ts" ></view> -->
  79. <view class="buttom" :class="{ action: loding }" @click="!loding ? join() : ''">提交申请</view>
  80. </view>
  81. </template>
  82. <script>
  83. import {
  84. mapState,
  85. mapMutations
  86. } from 'vuex';
  87. import {
  88. saveUrl,
  89. interceptor
  90. } from '@/utils/loginUtils.js';
  91. import { joinSec,add_company } from '@/api/index.js';
  92. import { upload } from '@/api/ask.js';
  93. export default {
  94. data() {
  95. const currentDate = this.getDate({
  96. format: true
  97. });
  98. return {
  99. loding: false, //是否提交中
  100. // array: ['男', '女'],
  101. // chooseEdu: ['博士后', '博士', '硕士', '本科', '专科', '其他'],
  102. // chooseVol: ['是', '否'],
  103. // chooseExp: ['是', '否'],
  104. // index: 0,
  105. // mz: '',
  106. // cardimg: '', //证件照
  107. // card: '',
  108. // checklist: [],
  109. // name: '',
  110. // sex: '',
  111. // birth: '',
  112. // phone: '',
  113. // address: '',
  114. // work: '',
  115. // specialty: '',
  116. // education: '',
  117. unit_name: '',//单位名称
  118. unit_peo: '',//法人代表
  119. unit_type: '',//单位性质
  120. unit_num: '',//单位人数
  121. unit_concat: '',//单位联系人
  122. usually_area: '',//常驻地区
  123. postal_code: '',//邮政编码
  124. concat_phone: '',//联系电话
  125. email: '',//电子邮箱
  126. concat_address: ''//联系地址
  127. };
  128. },
  129. onShow() {
  130. if (this.hasLogin) {
  131. // this.loadBaseData();
  132. } else {
  133. saveUrl();
  134. uni.showModal({
  135. title: '登录',
  136. content: '您未登录,是否马上登陆?',
  137. success: e => {
  138. if (e.confirm) {
  139. interceptor();
  140. }
  141. },
  142. fail: e => {
  143. console.log(e);
  144. }
  145. });
  146. }
  147. },
  148. computed: {
  149. ...mapState('user', ['hasLogin', 'userInfo'])
  150. // startDate() {
  151. // return this.getDate('start');
  152. // },
  153. // endDate() {
  154. // return this.getDate('end');
  155. // }
  156. },
  157. methods: {
  158. async join() {
  159. let obj = this;
  160. if(obj.unit_name == '') {
  161. obj.$api.msg('请填写单位名称');
  162. return;
  163. }
  164. if(obj.unit_type == '') {
  165. obj.$api.msg('请填写单位性质');
  166. return;
  167. }
  168. if(obj.unit_peo == '') {
  169. obj.$api.msg('请填写法人代表');
  170. return;
  171. }
  172. if(obj.unit_num == '') {
  173. obj.$api.msg('请填写单位人数');
  174. return;
  175. }
  176. if(obj.unit_concat == '') {
  177. obj.$api.msg('请填写联系人');
  178. return;
  179. }
  180. if(obj.usually_area == '') {
  181. obj.$api.msg('请填写常驻地址');
  182. return;
  183. }
  184. if(obj.postal_code == '') {
  185. obj.$api.msg('请填写邮政编码');
  186. return;
  187. }
  188. if(obj.concat_phone == '') {
  189. obj.$api.msg('请填写联系电话');
  190. return;
  191. }
  192. if(!/^((\+?86)|(\(\+86\)))?1\d{10}$/.test(obj.concat_phone)) {
  193. obj.$api.msg('请填写正确的联系电话');
  194. return;
  195. }
  196. if(obj.email == '') {
  197. obj.$api.msg('请填写电子邮箱');
  198. return;
  199. }
  200. if (!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(obj.email)) {
  201. obj.$api.msg('请填写正确的邮箱');
  202. return;
  203. }
  204. if(obj.concat_address == '') {
  205. obj.$api.msg('请填写联系地址');
  206. return;
  207. }
  208. obj.loding = true;
  209. add_company({
  210. company: obj.unit_name,//单位名称
  211. company_nature: obj.unit_type,//性质
  212. company_person: obj.unit_peo,//负责人
  213. company_member: obj.unit_num*1,//公司人数
  214. address: obj.concat_address,//联系地址
  215. zip: obj.postal_code,//邮编
  216. company_tel: obj.concat_phone,//联系电话
  217. email: obj.email,//邮箱
  218. permanent_address: obj.usually_area,//常驻地址
  219. person: obj.unit_concat,//联系人
  220. })
  221. .then(e => {
  222. // obj.name = '';
  223. // obj.sex = '';
  224. // obj.education = '';
  225. // obj.birth = '';
  226. // (obj.mz = ''), (obj.phone = '');
  227. // obj.address = '';
  228. // obj.work = '';
  229. // obj.specialty = '';
  230. // (obj.cardimg = ''), (obj.card = '');
  231. if(e.status == 400) {
  232. obj.$api.msg(e.msg);
  233. return;
  234. }
  235. obj.unit_name = ''
  236. obj.unit_type= ''
  237. obj.unit_num= ''
  238. obj.concat_address= ''
  239. obj.postal_code= ''
  240. obj.concat_phone= ''
  241. obj.email= ''
  242. obj.usually_area= ''
  243. uni.navigateTo({
  244. url: '../joinSuc/joinNow'
  245. });
  246. })
  247. .catch(function(e) {
  248. console.log('出错了');
  249. console.log(e);
  250. });
  251. },
  252. imgsub() {
  253. console.log('imgsub');
  254. upload({
  255. filename: ''
  256. }).then(data => {
  257. this.cardimg = data[0].url;
  258. });
  259. },
  260. // 选择性别
  261. bindPickerSex: function(e) {
  262. console.log(this.array[e.target.value]);
  263. this.sex = this.array[e.target.value];
  264. this.index = e.target.value + 1;
  265. },
  266. // 选择教育程度
  267. bindPickerEdu: function(e) {
  268. this.education = this.chooseEdu[e.target.value];
  269. this.index = e.target.value + 1;
  270. },
  271. // 选择日期
  272. bindDateChange: function(e) {
  273. this.birth = e.target.value;
  274. },
  275. // 是否参加志愿活动
  276. bindPickerVol: function(e) {
  277. this.is_vol = this.chooseVol[e.target.value];
  278. this.index = e.target.value + 1;
  279. },
  280. // 有无服务经验
  281. bindPickerExp: function(e) {
  282. this.is_experience = this.chooseExp[e.target.value];
  283. this.index = e.target.value + 1;
  284. },
  285. getDate(type) {
  286. const date = new Date();
  287. let year = date.getFullYear();
  288. let month = date.getMonth() + 1;
  289. let day = date.getDate();
  290. if (type === 'start') {
  291. year = year - 60;
  292. } else if (type === 'end') {
  293. year = year + 2;
  294. }
  295. month = month > 9 ? month : '0' + month;
  296. day = day > 9 ? day : '0' + day;
  297. return `${year}-${month}-${day}`;
  298. },
  299. // 选择可提供时间
  300. // this.quantum = item.detail.value.join(',');
  301. checktime1(e) {
  302. // var items = this.timeList,
  303. // let quantum = [];
  304. this.quantum = e.detail.value.join(',');
  305. console.log(this.quantum);
  306. },
  307. checktime2(e) {
  308. // var items = this.timeList,
  309. let values = e.detail.value;
  310. // let quantum = [];
  311. console.log(values);
  312. },
  313. checktime3(e) {
  314. // var items = this.timeList,
  315. let values = e.detail.value;
  316. // let quantum = [];
  317. console.log(values);
  318. },
  319. //选择有兴趣参与的工作
  320. checkjob(item) {
  321. this.taste = item.detail.value.join(',');
  322. },
  323. // 选择专长checkspeciality
  324. checkspeciality(item) {
  325. this.speciali = item.detail.value.join(',');
  326. }
  327. }
  328. };
  329. </script>
  330. <style lang="scss">
  331. page {
  332. background-color: #fdcbc2;
  333. height: 100%;
  334. }
  335. .content {
  336. max-height: 100%;
  337. padding-top: 44rpx;
  338. background-color: #fdcbc2;
  339. .buttom-ts {
  340. height: 120rpx;
  341. }
  342. .buttom {
  343. margin: 60rpx auto 0;
  344. // position: absolute;
  345. // bottom: 0;
  346. width: 600rpx;
  347. height: 100rpx;
  348. border-radius: 50rpx;
  349. background: #FA7E67;
  350. font-size: 34rpx;
  351. font-family: PingFang SC;
  352. font-weight: 500;
  353. color: #FFFFFF;
  354. line-height: 100rpx;
  355. text-align: center;
  356. &.action {
  357. background: #999999;
  358. }
  359. }
  360. .box {
  361. // margin-top: 44rpx;
  362. width: 690rpx;
  363. margin: 20rpx auto 0;
  364. background-color: #ffffff;
  365. border-radius: 20rpx;
  366. // padding: 28rpx 20rpx 32rpx 20rpx;
  367. position: relative;
  368. .red-box {
  369. width: 405rpx;
  370. line-height: 66rpx;
  371. text-align: center;
  372. background: linear-gradient(0deg, #c90f1b, #f14d33);
  373. // background-color: #c62316;
  374. border-radius: 10rpx;
  375. font-size: 30rpx;
  376. font-weight: 500;
  377. color: #ffffff;
  378. // position: relative;
  379. position: absolute;
  380. top: -36rpx;
  381. left: 50%;
  382. transform: translateX(-50%);
  383. z-index: 1;
  384. }
  385. .box-check {
  386. font-size: 28rpx;
  387. font-weight: 500;
  388. color: #666666;
  389. line-height: 100rpx;
  390. }
  391. .imp {
  392. color: red;
  393. margin-left: 5rpx;
  394. }
  395. .box-1 {
  396. height: 98rpx;
  397. padding: 0 20rpx;
  398. display: flex;
  399. justify-content: space-between;
  400. border-bottom: 1px solid #f0f0f0;
  401. line-height: 98rpx;
  402. align-items: center;
  403. font-size: 28rpx;
  404. font-family: PingFang SC;
  405. font-weight: 500;
  406. color: #333333;
  407. // .box-left {
  408. // width: 120rpx;
  409. // }
  410. // .list-input {
  411. // width: 440rpx;
  412. // }
  413. // .box-right {
  414. // width: 440rpx
  415. // }
  416. .list-input {
  417. width: 440rpx;
  418. // height: 26rpx;
  419. font-size: 28rpx;
  420. font-family: PingFang SC;
  421. font-weight: 500;
  422. color: #000;
  423. }
  424. .placeholder {
  425. color: #999999;
  426. }
  427. .box-right {
  428. width: 440rpx;
  429. }
  430. }
  431. }
  432. }
  433. .upload-box {
  434. // height: 247rpx;
  435. background: #ffffff;
  436. border-radius: 27rpx;
  437. display: flex;
  438. flex-direction: column;
  439. padding: 30rpx 40rpx 30rpx 0;
  440. margin: 15rpx auto 30rpx;
  441. width: 690rpx;
  442. background: #ffffff;
  443. border-radius: 10rpx;
  444. .upload-left {
  445. padding-left: 20rpx;
  446. font-weight: 400;
  447. color: #000;
  448. }
  449. .upload-right {
  450. flex: 1;
  451. display: flex;
  452. align-items: center;
  453. justify-content: center;
  454. .upload-img {
  455. width: 160rpx;
  456. height: 160rpx;
  457. margin-top: 24rpx;
  458. }
  459. }
  460. }
  461. .top-box {
  462. height: 58rpx;
  463. font-size: 38rpx;
  464. line-height: 58rpx;
  465. font-family: PingFang SC;
  466. font-weight: bold;
  467. color: #FA7E67;
  468. text-align: center;
  469. position: relative;
  470. &::before {
  471. content: '';
  472. width: 215rpx;
  473. height: 17rpx;
  474. background: #fff;
  475. opacity: 0.26;
  476. position: absolute;
  477. left: 0;
  478. right: 0;
  479. bottom: 0;
  480. margin: 0 auto;
  481. }
  482. }
  483. </style>