group.vue 11 KB

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