group.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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 { joinSec,add_company } from '@/api/index.js';
  84. import { upload } 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. unit_name: '',//单位名称
  110. unit_peo: '',//法人代表
  111. unit_type: '',//单位性质
  112. unit_num: '',//单位人数
  113. unit_concat: '',//单位联系人
  114. usually_area: '',//常驻地区
  115. postal_code: '',//邮政编码
  116. concat_phone: '',//联系电话
  117. email: '',//电子邮箱
  118. concat_address: ''//联系地址
  119. };
  120. },
  121. computed: {
  122. startDate() {
  123. return this.getDate('start');
  124. },
  125. endDate() {
  126. return this.getDate('end');
  127. }
  128. },
  129. methods: {
  130. async join() {
  131. let obj = this;
  132. if(obj.unit_name == '') {
  133. obj.$api.msg('请填写单位名称');
  134. return;
  135. }
  136. if(obj.unit_type == '') {
  137. obj.$api.msg('请填写单位性质');
  138. return;
  139. }
  140. if(obj.unit_peo == '') {
  141. obj.$api.msg('请填写法人代表');
  142. return;
  143. }
  144. if(obj.unit_num == '') {
  145. obj.$api.msg('请填写单位人数');
  146. return;
  147. }
  148. if(obj.unit_concat == '') {
  149. obj.$api.msg('请填写联系人');
  150. return;
  151. }
  152. if(obj.usually_area == '') {
  153. obj.$api.msg('请填写常驻地址');
  154. return;
  155. }
  156. if(obj.postal_code == '') {
  157. obj.$api.msg('请填写邮政编码');
  158. return;
  159. }
  160. if(obj.concat_phone == '') {
  161. obj.$api.msg('请填写联系电话');
  162. return;
  163. }
  164. if(!/^((\+?86)|(\(\+86\)))?1\d{10}$/.test(obj.concat_phone)) {
  165. obj.$api.msg('请填写正确的联系电话');
  166. return;
  167. }
  168. if(obj.email == '') {
  169. obj.$api.msg('请填写电子邮箱');
  170. return;
  171. }
  172. if (!/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(obj.email)) {
  173. obj.$api.msg('请填写正确的邮箱');
  174. return;
  175. }
  176. if(obj.concat_address == '') {
  177. obj.$api.msg('请填写联系地址');
  178. return;
  179. }
  180. obj.loding = true;
  181. add_company({
  182. company: obj.unit_name,//单位名称
  183. company_nature: obj.unit_type,//性质
  184. company_person: obj.unit_peo,//负责人
  185. company_member: obj.unit_num*1,//公司人数
  186. address: obj.concat_address,//联系地址
  187. zip: obj.postal_code,//邮编
  188. company_tel: obj.concat_phone,//联系电话
  189. email: obj.email,//邮箱
  190. permanent_address: obj.usually_area,//常驻地址
  191. person: obj.unit_concat,//联系人
  192. })
  193. .then(e => {
  194. // obj.name = '';
  195. // obj.sex = '';
  196. // obj.education = '';
  197. // obj.birth = '';
  198. // (obj.mz = ''), (obj.phone = '');
  199. // obj.address = '';
  200. // obj.work = '';
  201. // obj.specialty = '';
  202. // (obj.cardimg = ''), (obj.card = '');
  203. if(e.status == 400) {
  204. obj.$api.msg(e.msg);
  205. return;
  206. }
  207. obj.unit_name = ''
  208. obj.unit_type= ''
  209. obj.unit_num= ''
  210. obj.concat_address= ''
  211. obj.postal_code= ''
  212. obj.concat_phone= ''
  213. obj.email= ''
  214. obj.usually_area= ''
  215. uni.navigateTo({
  216. url: '../joinSuc/joinNow'
  217. });
  218. })
  219. .catch(function(e) {
  220. console.log('出错了');
  221. console.log(e);
  222. });
  223. },
  224. imgsub() {
  225. console.log('imgsub');
  226. upload({
  227. filename: ''
  228. }).then(data => {
  229. this.cardimg = data[0].url;
  230. });
  231. },
  232. // 选择性别
  233. bindPickerSex: function(e) {
  234. console.log(this.array[e.target.value]);
  235. this.sex = this.array[e.target.value];
  236. this.index = e.target.value + 1;
  237. },
  238. // 选择教育程度
  239. bindPickerEdu: function(e) {
  240. this.education = this.chooseEdu[e.target.value];
  241. this.index = e.target.value + 1;
  242. },
  243. // 选择日期
  244. bindDateChange: function(e) {
  245. this.birth = e.target.value;
  246. },
  247. // 是否参加志愿活动
  248. bindPickerVol: function(e) {
  249. this.is_vol = this.chooseVol[e.target.value];
  250. this.index = e.target.value + 1;
  251. },
  252. // 有无服务经验
  253. bindPickerExp: function(e) {
  254. this.is_experience = this.chooseExp[e.target.value];
  255. this.index = e.target.value + 1;
  256. },
  257. getDate(type) {
  258. const date = new Date();
  259. let year = date.getFullYear();
  260. let month = date.getMonth() + 1;
  261. let day = date.getDate();
  262. if (type === 'start') {
  263. year = year - 60;
  264. } else if (type === 'end') {
  265. year = year + 2;
  266. }
  267. month = month > 9 ? month : '0' + month;
  268. day = day > 9 ? day : '0' + day;
  269. return `${year}-${month}-${day}`;
  270. },
  271. // 选择可提供时间
  272. // this.quantum = item.detail.value.join(',');
  273. checktime1(e) {
  274. // var items = this.timeList,
  275. // let quantum = [];
  276. this.quantum = e.detail.value.join(',');
  277. console.log(this.quantum);
  278. },
  279. checktime2(e) {
  280. // var items = this.timeList,
  281. let values = e.detail.value;
  282. // let quantum = [];
  283. console.log(values);
  284. },
  285. checktime3(e) {
  286. // var items = this.timeList,
  287. let values = e.detail.value;
  288. // let quantum = [];
  289. console.log(values);
  290. },
  291. //选择有兴趣参与的工作
  292. checkjob(item) {
  293. this.taste = item.detail.value.join(',');
  294. },
  295. // 选择专长checkspeciality
  296. checkspeciality(item) {
  297. this.speciali = item.detail.value.join(',');
  298. }
  299. }
  300. };
  301. </script>
  302. <style lang="scss">
  303. page {
  304. background-color: #fdcbc2;
  305. height: 100%;
  306. }
  307. .content {
  308. max-height: 100%;
  309. padding-top: 44rpx;
  310. background-color: #fdcbc2;
  311. .buttom-ts {
  312. height: 120rpx;
  313. }
  314. .buttom {
  315. // margin: 60rpx auto 0;
  316. position: absolute;
  317. bottom: 0;
  318. width: 750rpx;
  319. height: 100rpx;
  320. background: #FA7E67;
  321. font-size: 34rpx;
  322. font-family: PingFang SC;
  323. font-weight: 500;
  324. color: #FFFFFF;
  325. line-height: 100rpx;
  326. text-align: center;
  327. &.action {
  328. background: #999999;
  329. }
  330. }
  331. .box {
  332. // margin-top: 44rpx;
  333. width: 690rpx;
  334. margin: 20rpx auto 0;
  335. background-color: #ffffff;
  336. border-radius: 20rpx;
  337. // padding: 28rpx 20rpx 32rpx 20rpx;
  338. position: relative;
  339. .red-box {
  340. width: 405rpx;
  341. line-height: 66rpx;
  342. text-align: center;
  343. background: linear-gradient(0deg, #c90f1b, #f14d33);
  344. // background-color: #c62316;
  345. border-radius: 10rpx;
  346. font-size: 30rpx;
  347. font-weight: 500;
  348. color: #ffffff;
  349. // position: relative;
  350. position: absolute;
  351. top: -36rpx;
  352. left: 50%;
  353. transform: translateX(-50%);
  354. z-index: 1;
  355. }
  356. .box-check {
  357. font-size: 28rpx;
  358. font-weight: 500;
  359. color: #666666;
  360. line-height: 100rpx;
  361. }
  362. .imp {
  363. color: red;
  364. margin-left: 5rpx;
  365. }
  366. .box-1 {
  367. height: 98rpx;
  368. padding: 0 20rpx;
  369. display: flex;
  370. justify-content: space-between;
  371. border-bottom: 1px solid #f0f0f0;
  372. line-height: 98rpx;
  373. align-items: center;
  374. font-size: 28rpx;
  375. font-family: PingFang SC;
  376. font-weight: 500;
  377. color: #333333;
  378. // .box-left {
  379. // width: 120rpx;
  380. // }
  381. // .list-input {
  382. // width: 440rpx;
  383. // }
  384. // .box-right {
  385. // width: 440rpx
  386. // }
  387. .list-input {
  388. width: 440rpx;
  389. // height: 26rpx;
  390. font-size: 28rpx;
  391. font-family: PingFang SC;
  392. font-weight: 500;
  393. color: #000;
  394. }
  395. .placeholder {
  396. color: #999999;
  397. }
  398. .box-right {
  399. width: 440rpx;
  400. }
  401. }
  402. }
  403. }
  404. .upload-box {
  405. // height: 247rpx;
  406. background: #ffffff;
  407. border-radius: 27rpx;
  408. display: flex;
  409. flex-direction: column;
  410. padding: 30rpx 40rpx 30rpx 0;
  411. margin: 15rpx auto 30rpx;
  412. width: 690rpx;
  413. background: #ffffff;
  414. border-radius: 10rpx;
  415. .upload-left {
  416. padding-left: 20rpx;
  417. font-weight: 400;
  418. color: #000;
  419. }
  420. .upload-right {
  421. flex: 1;
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. .upload-img {
  426. width: 160rpx;
  427. height: 160rpx;
  428. margin-top: 24rpx;
  429. }
  430. }
  431. }
  432. .top-box {
  433. height: 58rpx;
  434. font-size: 38rpx;
  435. line-height: 58rpx;
  436. font-family: PingFang SC;
  437. font-weight: bold;
  438. color: #FA7E67;
  439. text-align: center;
  440. position: relative;
  441. &::before {
  442. content: '';
  443. width: 215rpx;
  444. height: 17rpx;
  445. background: #fff;
  446. opacity: 0.26;
  447. position: absolute;
  448. left: 0;
  449. right: 0;
  450. bottom: 0;
  451. margin: 0 auto;
  452. }
  453. }
  454. </style>