ownerCertification.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <template>
  2. <view class="yezhu_body">
  3. <view class="user_info">
  4. <view class="user_line">
  5. </view>
  6. <view class="user_item">
  7. <text class="item_name">姓名</text>
  8. <view class="item_right">
  9. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="text" :value="name" placeholder="请输入姓名" @blur='inputName' @confirm='inputName'/>
  10. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  11. </view>
  12. </view>
  13. <view class="user_line">
  14. </view>
  15. <view class="user_item">
  16. <text class="item_name">性别</text>
  17. <view class="item_right" @click="showGender">
  18. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="text" :value="genderStr" placeholder="请选择" disabled/>
  19. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  20. </view>
  21. </view>
  22. <view class="user_line">
  23. </view>
  24. <view class="user_item">
  25. <text class="item_name">手机号</text>
  26. <view class="item_right">
  27. <input v-if="mobileOld" placeholder-class="item_right_name_placeholder" type='number' maxlength="11" class="item_right_name" :value="mobileOld" disabled/>
  28. <input v-else placeholder-class="item_right_name_placeholder" type='number' maxlength="11" style="width: calc(100% - 150rpx);" class="item_right_name" :value="mobile" placeholder="请输入" @blur='inputMobile' @confirm='inputMobile'/>
  29. <view class="veritify" @click="getVeritify" v-if="!mobileOld">
  30. {{veritifyTxt}}
  31. </view>
  32. <image v-if="mobileOld" class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  33. </view>
  34. </view>
  35. <view class="user_item" v-if="!mobileOld&&showInputVerifity">
  36. <text class="item_name">验证码</text>
  37. <view class="item_right">
  38. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="text" :value="verifity" placeholder="请输入" @blur='inputVerifity' @confirm='inputVerifity'/>
  39. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="project_ino">
  44. <view class="user_line">
  45. </view>
  46. <view class="user_item">
  47. <text class="item_name">认证项目</text>
  48. <view class="item_right" @click="chooseHouse">
  49. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="text" :value="houseName" placeholder="请选择" disabled/>
  50. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  51. </view>
  52. </view>
  53. <view class="user_line">
  54. </view>
  55. <view class="user_item">
  56. <text class="item_name">证件类型</text>
  57. <view class="item_right" @click="chooseCertificateType">
  58. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="text" :value="certificateTypeStr" placeholder="请选择" disabled/>
  59. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  60. </view>
  61. </view>
  62. <view class="user_line">
  63. </view>
  64. <view class="user_item">
  65. <text class="item_name">证件号</text>
  66. <view class="item_right">
  67. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="idcard" :value="certificateNo" placeholder="请输入" @blur='inputId' @confirm='inputId'/>
  68. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  69. </view>
  70. </view>
  71. <view class="user_line">
  72. </view>
  73. <view class="user_item">
  74. <text class="item_name">填写房号</text>
  75. <view class="item_right">
  76. <input placeholder-class="item_right_name_placeholder" class="item_right_name" type="text" :value="roomNo" placeholder="请输入" @blur='inputRoomNo' @confirm='inputRoomNo'/>
  77. <image class="icon_right" src="../../static/icons/icon_right_yezhu.png" mode=""></image>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="xieyi" @click="showXieyi">
  82. <image class="icon_selected" v-if="agree" src="../../static/icons/icon_yezhu_selected.png" mode=""></image>
  83. <image class="icon_selected" v-else src="../../static/icons/icon_yezhu_unselected.png" mode=""></image>
  84. <text class="tongyi">我已阅读并同意</text>
  85. <text class="xieyi_text">《入驻协议》</text>
  86. </view>
  87. <view class="btn_next" @click="addOrUpdate">
  88. 下一步
  89. </view>
  90. <dmAgreeement ref='agreement' @agree='agreeXieyi'></dmAgreeement>
  91. <dmPickerView ref="genderPicker" :options="genderList" :value="gender" @confirm="confirm" title="筛选时间维度"></dmPickerView>
  92. <dmPickerView ref="housePicker" :options="houseList" :value="houseId" @confirm="houseConfirm" title="筛选时间维度"></dmPickerView>
  93. <dmPickerView ref="certificateTypePicker" :options="certificateTypeList" :value="certificateType" @confirm="certificateTypeConfirm" title="筛选时间维度"></dmPickerView>
  94. <login-notice></login-notice>
  95. <login></login>
  96. </view>
  97. </template>
  98. <script>
  99. import dmAgreeement from "../../components/subComponents/dmAgreement.vue";
  100. import dmPickerView from "../../components/subComponents/dmPickerView.vue";
  101. let app = getApp();
  102. export default {
  103. data() {
  104. return {
  105. agree:false,
  106. veritifyTxt:"获取验证码",
  107. genderList:[
  108. {
  109. title:"男",
  110. value:"1"
  111. },
  112. {
  113. title:"女",
  114. value:"0"
  115. }
  116. ],
  117. gender:"",
  118. genderStr:"",
  119. houseId:"",
  120. houseName:"",
  121. houseList:[],
  122. certificateType:"1",
  123. certificateTypeStr:"",
  124. certificateTypeList:[{
  125. title:"中国居民大陆身份证",
  126. value:"1"
  127. },{
  128. title:"香港居民身份证",
  129. value:"2"
  130. },{
  131. title:"护照",
  132. value:"3"
  133. }],
  134. mobileOld:"",
  135. mobile:"",
  136. verifity:"",
  137. name:"",
  138. certificateNo:"",
  139. roomNo:"",
  140. timer:null,
  141. countdownTimes:120,
  142. showInputVerifity:true
  143. };
  144. },
  145. created() {
  146. this.queryProjectBox();
  147. },
  148. methods:{
  149. agreeXieyi(){
  150. this.agree = true
  151. },
  152. showXieyi(){
  153. this.$refs.agreement.show()
  154. },
  155. showGender(){
  156. this.$refs.genderPicker.show();
  157. },
  158. confirm(e){
  159. this.genderStr = e.selItem.title;
  160. this.gender = e.selItem.value;
  161. },
  162. chooseCertificateType(){
  163. this.$refs.certificateTypePicker.show();
  164. },
  165. certificateTypeConfirm(e){
  166. this.certificateTypeStr = e.selItem.title;
  167. this.certificateType = e.selItem.value;
  168. },
  169. async queryProjectBox() {
  170. let ret = await this.$myRequest({
  171. url: "/project/queryProjectBox",
  172. data: {
  173. "onlineStatus": "1",
  174. }
  175. })
  176. this.houseList = [];
  177. if (ret.data.success) {
  178. let houseList = ret.data.list || [];
  179. let count = 0;
  180. while (count<houseList.length){
  181. this.houseList.push({
  182. title:houseList[count].name,
  183. value:houseList[count].id,
  184. })
  185. count++;
  186. }
  187. }
  188. },
  189. async getVeritify(){
  190. if(!this.mobile){
  191. uni.showToast({
  192. icon:"none",
  193. title:"请输入手机号"
  194. })
  195. return
  196. }
  197. var phone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
  198. if (!phone.test(this.mobile)) {
  199. uni.showToast({
  200. icon:"none",
  201. title:"请输入正确的手机号"
  202. })
  203. return
  204. }
  205. this.showInputVerifity = true;
  206. if(this.timer&&this.countdownTimes>=0){
  207. return
  208. }
  209. let ret = await this.$myRequest({
  210. url: "/sms/sendSmsVerifyCode",
  211. data: {
  212. "phone": this.mobile,
  213. },
  214. method:"GET"
  215. })
  216. this.houseList = [];
  217. if (ret.data.success) {
  218. this.countdown();
  219. }
  220. },
  221. chooseHouse(){
  222. this.$refs.housePicker.show();
  223. },
  224. houseConfirm(e){
  225. this.houseId = e.selItem.value;
  226. this.houseName = e.selItem.title
  227. },
  228. countdown(){
  229. this.timer = setInterval(()=>{
  230. this.countdownTimes--;
  231. this.veritifyTxt = this.countdownTimes+"s"
  232. if(this.countdownTimes<=0){
  233. clearInterval(this.timer);
  234. this.timer = null;
  235. this.veritifyTxt = '获取验证码';
  236. this.countdownTimes = 120;
  237. }
  238. },1000)
  239. },
  240. inputName(e){
  241. this.name = e.detail.value
  242. },
  243. inputMobile(e){
  244. this.mobile = e.detail.value
  245. },
  246. inputVerifity(e){
  247. this.verifity = e.detail.value
  248. },
  249. inputId(e){
  250. this.certificateNo = e.detail.value
  251. },
  252. inputRoomNo(e){
  253. this.roomNo = e.detail.value
  254. },
  255. async addOrUpdate() {
  256. if(!this.name){
  257. uni.showToast({
  258. icon:"none",
  259. title:"请输入姓名"
  260. })
  261. return
  262. }
  263. if(!this.gender){
  264. uni.showToast({
  265. icon:"none",
  266. title:"请选择性别"
  267. })
  268. return
  269. }
  270. if(!this.mobile){
  271. uni.showToast({
  272. icon:"none",
  273. title:"请输入手机号"
  274. })
  275. return
  276. }
  277. if(!this.houseId){
  278. uni.showToast({
  279. icon:"none",
  280. title:"请选择认证项目"
  281. })
  282. return
  283. }
  284. if(!this.certificateType){
  285. uni.showToast({
  286. icon:"none",
  287. title:"请选择证件类型"
  288. })
  289. return
  290. }
  291. if(!this.certificateNo){
  292. uni.showToast({
  293. icon:"none",
  294. title:"请输入证件号"
  295. })
  296. return
  297. }
  298. if(!this.roomNo){
  299. uni.showToast({
  300. icon:"none",
  301. title:"请输入房号"
  302. })
  303. return
  304. }
  305. if(!this.agree){
  306. uni.showToast({
  307. icon:"none",
  308. title:"请阅读并同意《入住协议》"
  309. })
  310. return
  311. }
  312. let ret = await this.$myRequest({
  313. url: "/user/regist/addOrUpdate",
  314. data: {
  315. "agreeState": this.agree?1:0,
  316. "captcha":this.verifity,
  317. "certificateNo": this.certificateNo,
  318. "certificateType": this.certificateType,
  319. "phone": this.mobile,
  320. "projectId": this.houseId,
  321. "roomNo": this.roomNo,
  322. "sex": this.gender,
  323. "sign": this.sign,
  324. "userId": app.globalData.userId,
  325. "username": this.name,
  326. "phoneFrom":this.mobileOld?1:2
  327. }
  328. })
  329. if (ret.data.success) {
  330. uni.navigateTo({
  331. url:'../certificationResultPage/certificationResultPage'
  332. })
  333. }else{
  334. uni.showToast({
  335. icon:"none",
  336. title:ret.data.message
  337. })
  338. }
  339. },
  340. },
  341. destroyed() {
  342. if(null!=this.timer){
  343. clearInterval(this.timer);
  344. this.timer = null;
  345. }
  346. },
  347. components:{
  348. dmAgreeement,
  349. dmPickerView
  350. }
  351. }
  352. </script>
  353. <style lang="scss">
  354. .yezhu_body{
  355. width: 100%;
  356. height: 100vh;
  357. position: relative;
  358. .user_info{
  359. background: #ffffff;
  360. .user_item{
  361. margin-left: 40rpx;
  362. margin-right: 40rpx;
  363. height: 98rpx;
  364. display: flex;
  365. justify-content: space-between;
  366. align-items: center;
  367. .item_name{
  368. width: 20%;
  369. font-size: 28rpx;
  370. font-family: Verdana, Verdana-Regular;
  371. font-weight: 400;
  372. text-align: left;
  373. color: #262626;
  374. }
  375. .item_right{
  376. width: 80%;
  377. font-size: 26rpx;
  378. font-family: Verdana, Verdana-Regular;
  379. font-weight: 400;
  380. text-align: right;
  381. color: #262626;
  382. display: flex;
  383. align-items: center;
  384. .item_right_name{
  385. width: 100%;
  386. }
  387. .item_right_name_placeholder{
  388. font-size: 26rpx;
  389. font-family: Verdana, Verdana-Regular;
  390. font-weight: 400;
  391. color: #b1b1b1;
  392. }
  393. .icon_right{
  394. width: 10rpx;
  395. height: 22rpx;
  396. margin-left: 19rpx;
  397. }
  398. .veritify{
  399. width: 140rpx;
  400. height: 50rpx;
  401. margin-left: 10rpx;
  402. line-height: 50rpx;
  403. background: #ffffff;
  404. border: 2rpx solid #f07423;
  405. border-radius: 8rpx;
  406. font-size: 20rpx;
  407. font-family: Verdana, Verdana-Regular;
  408. font-weight: 400;
  409. text-align: center;
  410. color: #f07423;
  411. }
  412. }
  413. }
  414. .user_line{
  415. margin-left: 40rpx;
  416. margin-right: 40rpx;
  417. height: 2px;
  418. background: #f8f8f8;
  419. }
  420. }
  421. .project_ino{
  422. background: #ffffff;
  423. margin-top: 20rpx;
  424. .user_item{
  425. margin-left: 40rpx;
  426. margin-right: 40rpx;
  427. height: 98rpx;
  428. display: flex;
  429. justify-content: space-between;
  430. align-items: center;
  431. .item_name{
  432. width: 20%;
  433. font-size: 28rpx;
  434. font-family: Verdana, Verdana-Regular;
  435. font-weight: 400;
  436. text-align: left;
  437. color: #262626;
  438. }
  439. .item_right{
  440. width: 80%;
  441. font-size: 26rpx;
  442. font-family: Verdana, Verdana-Regular;
  443. font-weight: 400;
  444. text-align: right;
  445. color: #262626;
  446. display: flex;
  447. align-items: center;
  448. .item_right_name{
  449. width: 100%;
  450. }
  451. .item_right_name_placeholder{
  452. font-size: 26rpx;
  453. font-family: Verdana, Verdana-Regular;
  454. font-weight: 400;
  455. color: #b1b1b1;
  456. }
  457. .icon_right{
  458. width: 10rpx;
  459. height: 22rpx;
  460. margin-left: 19rpx;
  461. }
  462. }
  463. }
  464. .user_line{
  465. margin-left: 40rpx;
  466. margin-right: 40rpx;
  467. height: 2px;
  468. background: #f8f8f8;
  469. }
  470. }
  471. .xieyi{
  472. display: flex;
  473. width: 100%;
  474. justify-content: center;
  475. position: absolute;
  476. bottom: 162rpx;
  477. left: 0;
  478. align-items: center;
  479. .icon_selected{
  480. width: 24rpx;
  481. height: 24rpx;
  482. margin-right: 20rpx;
  483. }
  484. .tongyi{
  485. font-size: 24rpx;
  486. font-family: Verdana, Verdana-Regular;
  487. font-weight: 400;
  488. color: #999999;
  489. display: inline-block;
  490. }
  491. .xieyi_text{
  492. font-size: 24rpx;
  493. font-family: Verdana, Verdana-Regular;
  494. font-weight: 400;
  495. color: #f07423;
  496. display: inline-block;
  497. }
  498. }
  499. .btn_next{
  500. width: calc(100% - 80rpx);
  501. box-sizing: border-box;
  502. margin-left: 40rpx;
  503. margin-right: 40rpx;
  504. height: 72rpx;
  505. line-height: 72rpx;
  506. background: #f07423;
  507. border-radius: 12rpx;
  508. font-size: 32rpx;
  509. font-family: Verdana, Verdana-Regular;
  510. font-weight: 400;
  511. text-align: center;
  512. color: #ffffff;
  513. position: absolute;
  514. bottom: 60rpx;
  515. left: 0;
  516. }
  517. }
  518. </style>