group.vue 12 KB

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