group.vue 12 KB

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