base.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. <template>
  2. <view class="" >
  3. <view v-if="status!=3&&status!=1">
  4. <image src="../../static/bg.png" mode="" class="bg"></image>
  5. <view class="top">
  6. 基础资料
  7. <image src="../../static/index/goback.png" mode="" @click="goback"></image>
  8. </view>
  9. <view class="form" >
  10. <view class="">
  11. <view class="item u-flex u-row-between">
  12. <text style="white-space: nowrap;">单位名称</text>
  13. <input type="text" v-model="unit" placeholder="请输入您的单位名称">
  14. </view>
  15. <view class="item u-flex u-row-between">
  16. <text style="white-space: nowrap;">姓名</text>
  17. <input type="text" v-model="name" placeholder="请输入姓名">
  18. </view>
  19. <view class="item u-flex u-row-between">
  20. <text style="white-space: nowrap;">身份证号</text>
  21. <input type="text" v-model="idcard" placeholder="请输入您的身份证号">
  22. </view>
  23. <view class="item u-flex u-row-between">
  24. <text style="white-space: nowrap;">年龄</text>
  25. <input type="number" v-model="age" placeholder="请输入您的年龄">
  26. </view>
  27. <view class="item u-flex u-row-between" @click="show=true">
  28. <text style="white-space: nowrap;">学历</text>
  29. <view class="u-flex" style="text-align: right;justify-content: flex-end;flex: 1;">
  30. <text >{{current!=null?current:'请选择您的学历'}}</text>
  31. <u-icon name="arrow-right" ></u-icon>
  32. </view>
  33. </view>
  34. <view class="item u-flex u-row-between">
  35. <text style="white-space: nowrap;">手机号</text>
  36. <input type="number" v-model="phone" placeholder="请输入手机号">
  37. </view>
  38. <view class="item u-flex u-row-between">
  39. <text style="white-space: nowrap;">验证码</text>
  40. <view class="u-flex" >
  41. <input v-model="code" type="text" placeholder=" ">
  42. <text style="color: #2A63F3;background: linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%);-webkit-background-clip: text;-webkit-text-fill-color: transparent;" @click="getCode">{{count}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="" style="margin: 106rpx 30rpx 0;">
  48. <u-button text="确定" @click="gorenzheng" shape="circle" color="linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%)"
  49. ></u-button>
  50. </view>
  51. <u-picker :show="show" :columns="columns" keyName="name" @confirm='change' @cancel='cancel' :closeOnClickOverlay='true'>
  52. </u-picker>
  53. </view>
  54. <view class="error u-flex-col u-col-center" v-if="status==3">
  55. <image src="../../static/auth/error@2x.png" mode=""></image>
  56. <text style="font-size: 40rpx;font-weight: 600;margin: 48rpx 0 16rpx;">认证失败</text>
  57. <text>您的账号注册审核没有通过</text>
  58. <!-- <view class="reason">
  59. {{reason}}
  60. </view> -->
  61. <view class="u-flex u-row-around btnlist">
  62. <view class="btn1" @click="reset">
  63. 重新注册
  64. </view>
  65. <!-- <view class="btn" style="color: #fff;" @click="reset">
  66. 暂不注册
  67. </view> -->
  68. </view>
  69. </view>
  70. <view class="error u-flex-col u-col-center" v-if="status==1">
  71. <image src="../../static/auth/shenhe@2x.png" mode=""></image>
  72. <text style="font-size: 40rpx;font-weight: 600;margin: 48rpx 0 16rpx;">管理员审核中</text>
  73. <text>请耐心等待审核结果哦~</text>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. export default {
  79. onPullDownRefresh() {
  80. setTimeout(function () {
  81. uni.stopPullDownRefresh();
  82. }, 1000);
  83. },
  84. onLoad() {
  85. },
  86. onShow() {
  87. this.getInfo()
  88. },
  89. data() {
  90. return {
  91. status:0,
  92. s:60,
  93. count:'获取验证码',
  94. code:'',
  95. age:'',
  96. unit:'',
  97. idcard:'',
  98. working:{},
  99. fileList1: [],
  100. show: false,
  101. columns: [
  102. ['高中','大专','本科','硕士','博士']
  103. ],
  104. current: null,
  105. name:'',
  106. phone:'',
  107. unit:'',
  108. workImg:'',
  109. type:'',
  110. reason:'',
  111. uuid:''
  112. }
  113. },
  114. methods: {
  115. goback(){
  116. uni.switchTab({
  117. url:'./index'
  118. })
  119. },
  120. reset(){
  121. this.status=0
  122. },
  123. getInfo() {
  124. uni.$u.http.post('/api/user/userinfo').then(res => {
  125. if (res.code == 1) {
  126. this.status=res.data.is_info
  127. }
  128. })
  129. },
  130. getCode(){
  131. if (this.s == 60) {
  132. if (!this.phone) {
  133. uni.showToast({
  134. title: "请输入手机号",
  135. duration: 2000,
  136. icon: "none",
  137. });
  138. return false;
  139. }
  140. uni.$u.http.post('/api/Sms/alsend',{phone:this.phone}).then((res) => {
  141. uni.hideLoading()
  142. uni.showToast({
  143. title: res.msg,
  144. duration: 2000,
  145. icon: "none",
  146. });
  147. if (res.code == 1) {
  148. this.time = setInterval(() => {
  149. this.s--
  150. this.count = `${this.s}s`
  151. if (this.s <= 0) {
  152. this.s = 60
  153. this.count = '重新发送'
  154. clearInterval(this.time)
  155. }
  156. }, 1000)
  157. }
  158. });
  159. }
  160. },
  161. gorenzheng(){
  162. if(!this.unit){
  163. this.$u.toast('请输入单位名称')
  164. return
  165. }
  166. if(!this.name){
  167. this.$u.toast('请输入姓名')
  168. return
  169. }
  170. if(!this.idcard){
  171. this.$u.toast('请输入身份证号')
  172. return
  173. }
  174. if(!this.age){
  175. this.$u.toast('请输入年龄')
  176. return
  177. }
  178. if(this.current==null){
  179. this.$u.toast('请选择学历')
  180. return
  181. }
  182. if(!this.phone){
  183. this.$u.toast('请输入手机号')
  184. return
  185. }
  186. if(!this.code){
  187. this.$u.toast('请输入验证码')
  188. return
  189. }
  190. // if(!this.uuid){
  191. // this.$u.toast('请输入会员号')
  192. // return
  193. // }
  194. // if(!this.workImg){
  195. // this.$u.toast('上传单位证明')
  196. // return
  197. // }
  198. // if(this.fileList1.length==0){
  199. // this.$u.toast('上传个人照片')
  200. // return
  201. // }
  202. let data={
  203. working:this.unit,
  204. username:this.name,
  205. ID_car:this.idcard,
  206. age:this.age,
  207. education:this.current,
  208. phone:this.phone,
  209. code:this.code,
  210. }
  211. uni.$u.http.post('/api/index/member_basic',data).then(res => {
  212. if(res.code==1){
  213. this.$u.toast(res.msg)
  214. this.getInfo()
  215. }
  216. })
  217. },
  218. uploadImg(){
  219. var that=this
  220. uni.chooseImage({
  221. success: (chooseImageRes) => {
  222. const tempFilePaths = chooseImageRes.tempFilePaths;
  223. uni.uploadFile({
  224. url: this.$url+'/api/Publics/uploadLocality', //仅为示例,非真实的接口地址
  225. filePath: tempFilePaths[0],
  226. name: 'file',
  227. success: (uploadFileRes) => {
  228. that.workImg=JSON.parse(uploadFileRes.data).data.url
  229. }
  230. });
  231. }
  232. });
  233. },
  234. change(e) {
  235. this.current = e.value[0]
  236. // console.log(this.columns[0][this.current])
  237. this.show = false
  238. },
  239. cancel() {
  240. this.show = false
  241. },
  242. // 删除图片
  243. deletePic(event) {
  244. this[`fileList${event.name}`].splice(event.index, 1)
  245. },
  246. // 新增图片
  247. async afterRead(event) {
  248. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  249. let lists = [].concat(event.file)
  250. let fileListLen = this[`fileList${event.name}`].length
  251. lists.map((item) => {
  252. this[`fileList${event.name}`].push({
  253. ...item,
  254. status: 'uploading',
  255. message: '上传中'
  256. })
  257. })
  258. for (let i = 0; i < lists.length; i++) {
  259. const result = await this.uploadFilePromise(lists[i].url)
  260. let item = this[`fileList${event.name}`][fileListLen]
  261. this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  262. status: 'success',
  263. message: '',
  264. url: result
  265. }))
  266. fileListLen++
  267. }
  268. },
  269. uploadFilePromise(url) {
  270. return new Promise((resolve, reject) => {
  271. let a = uni.uploadFile({
  272. url: this.$url+'/api/Publics/uploadLocality', // 仅为示例,非真实的接口地址
  273. filePath: url,
  274. name: 'file',
  275. formData: {
  276. user: 'test'
  277. },
  278. success: (res) => {
  279. setTimeout(() => {
  280. resolve(JSON.parse(res.data).data.url)
  281. }, 1000)
  282. }
  283. });
  284. })
  285. },
  286. }
  287. }
  288. </script>
  289. <style lang="scss">
  290. .btnlist{
  291. width: 100%;
  292. }
  293. .btn1{
  294. font-weight: 500;
  295. color: #FFFFFF;
  296. line-height: 50px;
  297. background: linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%);
  298. -webkit-background-clip: text;
  299. -webkit-text-fill-color: transparent;
  300. width: 270rpx;
  301. height: 88rpx;
  302. line-height: 88rpx;
  303. text-align: center;
  304. font-size: 36rpx;
  305. border-radius: 48rpx;
  306. border: 4rpx solid #E6CDE6;
  307. // border-image: linear-gradient(270deg, rgba(171, 145, 252, 1), rgba(251, 173, 177, 1)) 2 2;
  308. }
  309. .btn{
  310. width: 270rpx;
  311. height: 88rpx;
  312. line-height: 88rpx;
  313. text-align: center;
  314. background: linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%);
  315. border-radius: 48rpx;
  316. font-size: 36rpx;
  317. }
  318. .error{
  319. padding-top: 96rpx;
  320. padding-bottom: 94rpx;
  321. margin: 56rpx auto 0;
  322. width: 690rpx;
  323. // height: 888rpx;
  324. background: #FFFFFF;
  325. border-radius: 40rpx;
  326. font-size: 24rpx;
  327. color: #222222;
  328. image{
  329. width: 140rpx;
  330. height: 140rpx;
  331. }
  332. .reason{
  333. padding: 24rpx 20rpx;
  334. margin: 52rpx auto 64rpx;
  335. width: 610rpx;
  336. height: 200rpx;
  337. background: #F4F4F4;
  338. border-radius: 20rpx;
  339. }
  340. }
  341. .success{
  342. box-sizing: border-box;
  343. padding: 0 40rpx;
  344. height: auto;
  345. }
  346. .info{
  347. padding: 40rpx 40rpx 0;
  348. width: 100%;
  349. margin-top: 80rpx;
  350. border-top: 2rpx solid #F3F3F3;
  351. .infoitem{
  352. line-height: 100rpx;
  353. width: 100%;
  354. font-size: 30rpx;
  355. color: #222222;
  356. }
  357. }
  358. .btnlist{
  359. margin-top: 30rpx;
  360. width: 100%;
  361. }
  362. .btn1{
  363. font-weight: 500;
  364. color: #FFFFFF;
  365. line-height: 50px;
  366. background: linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%);
  367. -webkit-background-clip: text;
  368. -webkit-text-fill-color: transparent;
  369. width: 270rpx;
  370. height: 88rpx;
  371. line-height: 88rpx;
  372. text-align: center;
  373. font-size: 36rpx;
  374. border-radius: 48rpx;
  375. border: 4rpx solid #E6CDE6;
  376. // border-image: linear-gradient(270deg, rgba(171, 145, 252, 1), rgba(251, 173, 177, 1)) 2 2;
  377. }
  378. .btn{
  379. width: 270rpx;
  380. height: 88rpx;
  381. line-height: 88rpx;
  382. text-align: center;
  383. background: linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%);
  384. border-radius: 48rpx;
  385. font-size: 36rpx;
  386. }
  387. .error{
  388. padding-top: 96rpx;
  389. padding-bottom: 94rpx;
  390. margin: 56rpx auto 0;
  391. width: 690rpx;
  392. // height: 888rpx;
  393. background: #FFFFFF;
  394. border-radius: 40rpx;
  395. font-size: 24rpx;
  396. color: #222222;
  397. image{
  398. width: 140rpx;
  399. height: 140rpx;
  400. }
  401. .reason{
  402. padding: 24rpx 20rpx;
  403. margin: 52rpx auto 64rpx;
  404. width: 610rpx;
  405. height: 200rpx;
  406. background: #F4F4F4;
  407. border-radius: 20rpx;
  408. }
  409. }
  410. .lookvip {
  411. font-weight: 500;
  412. margin-top: 24rpx;
  413. font-size: 24rpx;
  414. color: #555555;
  415. text-align: center;
  416. text {
  417. margin: 0 8rpx;
  418. }
  419. }
  420. .uploadContent {
  421. position: relative;
  422. margin-top: 32rpx;
  423. width: 650rpx;
  424. height: 472rpx;
  425. font-size: 28rpx;
  426. color: #fff;
  427. font-weight: 600;
  428. background: #F3F4F6;
  429. border-radius: 20rpx;
  430. .contentTop {
  431. height: 400rpx;
  432. background-color: #F3F4F6;
  433. position: relative;
  434. .bigImg {
  435. position: absolute;
  436. top: 50%;
  437. left: 50%;
  438. transform: translate(-50%, -50%);
  439. width: 510rpx;
  440. height: 320rpx;
  441. }
  442. .smallImg {
  443. position: absolute;
  444. top: 50%;
  445. left: 50%;
  446. transform: translate(-50%, -50%);
  447. width: 116rpx;
  448. height: 116rpx;
  449. z-index: 1;
  450. }
  451. }
  452. .contentBottom {
  453. width: 650rpx;
  454. height: 72rpx;
  455. line-height: 72rpx;
  456. text-align: center;
  457. background: linear-gradient(270deg, #A890FE 0%, #FFAEAE 100%);
  458. border-radius: 0px 0px 20rpx 20rpx;
  459. }
  460. }
  461. .upload {
  462. margin: 20rpx auto;
  463. width: 690rpx;
  464. // height: 652rpx;
  465. padding: 24rpx 20rpx;
  466. background: #FDFCFE;
  467. box-shadow: 0px 0px 16rpx 0px rgba(0, 0, 0, 0.0400);
  468. border-radius: 24rpx;
  469. box-sizing: border-box;
  470. .title {
  471. font-weight: 500;
  472. font-size: 30rpx;
  473. color: #222222;
  474. text {
  475. color: #FF5B5B;
  476. }
  477. }
  478. }
  479. .form {
  480. padding: 0 30rpx;
  481. margin: 36rpx 30rpx 0;
  482. background-color: #fff;
  483. border-radius: 40rpx ;
  484. background: #fff;
  485. .item {
  486. height: 94rpx;
  487. line-height: 94rpx;
  488. border-bottom: 2rpx solid #F5F5F5;
  489. text {
  490. font-size: 30rpx;
  491. color: #222222;
  492. }
  493. input {
  494. text-align: right;
  495. }
  496. }
  497. }
  498. .top {
  499. position: relative;
  500. padding-top: 44rpx;
  501. text-align: center;
  502. font-size: 36rpx;
  503. font-weight: 600;
  504. image {
  505. width: 64rpx;
  506. height: 64rpx;
  507. position: absolute;
  508. left: 30rpx;
  509. }
  510. }
  511. </style>