ownerCertification.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  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. onLoad(param) {
  146. this.mobileOld = param.mobile;
  147. },
  148. created() {
  149. this.queryProjectBox();
  150. },
  151. methods:{
  152. agreeXieyi(){
  153. this.agree = true
  154. },
  155. showXieyi(){
  156. this.$refs.agreement.show()
  157. },
  158. showGender(){
  159. this.$refs.genderPicker.show();
  160. },
  161. confirm(e){
  162. this.genderStr = e.selItem.title;
  163. this.gender = e.selItem.value;
  164. },
  165. chooseCertificateType(){
  166. this.$refs.certificateTypePicker.show();
  167. },
  168. certificateTypeConfirm(e){
  169. this.certificateTypeStr = e.selItem.title;
  170. this.certificateType = e.selItem.value;
  171. },
  172. async queryProjectBox() {
  173. let ret = await this.$myRequest({
  174. url: "/project/queryProjectBox",
  175. data: {
  176. "onlineStatus": "1",
  177. }
  178. })
  179. this.houseList = [];
  180. if (ret.data.success) {
  181. let houseList = ret.data.list || [];
  182. let count = 0;
  183. while (count<houseList.length){
  184. this.houseList.push({
  185. title:houseList[count].name,
  186. value:houseList[count].id,
  187. })
  188. count++;
  189. }
  190. }
  191. },
  192. async getVeritify(){
  193. if(!this.mobile){
  194. uni.showToast({
  195. icon:"none",
  196. title:"请输入手机号"
  197. })
  198. return
  199. }
  200. var phone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/
  201. if (!phone.test(this.mobile)) {
  202. uni.showToast({
  203. icon:"none",
  204. title:"请输入正确的手机号"
  205. })
  206. return
  207. }
  208. this.showInputVerifity = true;
  209. if(this.timer&&this.countdownTimes>=0){
  210. return
  211. }
  212. let ret = await this.$myRequest({
  213. url: "/sms/sendSmsVerifyCode",
  214. data: {
  215. "phone": this.mobile,
  216. },
  217. method:"GET"
  218. })
  219. this.houseList = [];
  220. if (ret.data.success) {
  221. this.countdown();
  222. }
  223. },
  224. chooseHouse(){
  225. this.$refs.housePicker.show();
  226. },
  227. houseConfirm(e){
  228. this.houseId = e.selItem.value;
  229. this.houseName = e.selItem.title
  230. },
  231. countdown(){
  232. this.timer = setInterval(()=>{
  233. this.countdownTimes--;
  234. this.veritifyTxt = this.countdownTimes+"s"
  235. if(this.countdownTimes<=0){
  236. clearInterval(this.timer);
  237. this.timer = null;
  238. this.veritifyTxt = '获取验证码';
  239. this.countdownTimes = 120;
  240. }
  241. },1000)
  242. },
  243. inputName(e){
  244. this.name = e.detail.value
  245. },
  246. inputMobile(e){
  247. this.mobile = e.detail.value
  248. },
  249. inputVerifity(e){
  250. this.verifity = e.detail.value
  251. },
  252. inputId(e){
  253. this.certificateNo = e.detail.value
  254. },
  255. inputRoomNo(e){
  256. this.roomNo = e.detail.value
  257. },
  258. async addOrUpdate() {
  259. if(!this.name){
  260. uni.showToast({
  261. icon:"none",
  262. title:"请输入姓名"
  263. })
  264. return
  265. }
  266. if(!this.gender){
  267. uni.showToast({
  268. icon:"none",
  269. title:"请选择性别"
  270. })
  271. return
  272. }
  273. if(!this.mobile){
  274. if(!this.mobileOld){
  275. uni.showToast({
  276. icon:"none",
  277. title:"请输入手机号"
  278. })
  279. return
  280. }
  281. }
  282. if(!this.houseId){
  283. uni.showToast({
  284. icon:"none",
  285. title:"请选择认证项目"
  286. })
  287. return
  288. }
  289. if(!this.certificateType){
  290. uni.showToast({
  291. icon:"none",
  292. title:"请选择证件类型"
  293. })
  294. return
  295. }
  296. if(!this.certificateNo){
  297. uni.showToast({
  298. icon:"none",
  299. title:"请输入证件号"
  300. })
  301. return
  302. }
  303. if(!this.roomNo){
  304. uni.showToast({
  305. icon:"none",
  306. title:"请输入房号"
  307. })
  308. return
  309. }
  310. if(!this.agree){
  311. uni.showToast({
  312. icon:"none",
  313. title:"请阅读并同意《入住协议》"
  314. })
  315. return
  316. }
  317. let ret = await this.$myRequest({
  318. url: "/user/regist/addOrUpdate",
  319. data: {
  320. "agreeState": this.agree?1:0,
  321. "captcha":this.verifity,
  322. "certificateNo": this.certificateNo,
  323. "certificateType": this.certificateType,
  324. "phone": this.mobileOld?this.mobileOld:this.mobile,
  325. "projectId": this.houseId,
  326. "roomNo": this.roomNo,
  327. "sex": this.gender,
  328. "sign": this.sign,
  329. "userId": app.globalData.userId,
  330. "username": this.name,
  331. "phoneFrom":this.mobileOld?2:1
  332. }
  333. })
  334. if (ret.data.success) {
  335. uni.navigateTo({
  336. url:'../certificationResultPage/certificationResultPage'
  337. })
  338. }else{
  339. uni.showToast({
  340. icon:"none",
  341. title:ret.data.message
  342. })
  343. }
  344. },
  345. },
  346. destroyed() {
  347. if(null!=this.timer){
  348. clearInterval(this.timer);
  349. this.timer = null;
  350. }
  351. },
  352. components:{
  353. dmAgreeement,
  354. dmPickerView
  355. }
  356. }
  357. </script>
  358. <style lang="scss">
  359. .yezhu_body{
  360. width: 100%;
  361. height: 100vh;
  362. position: relative;
  363. .user_info{
  364. background: #ffffff;
  365. .user_item{
  366. margin-left: 40rpx;
  367. margin-right: 40rpx;
  368. height: 98rpx;
  369. display: flex;
  370. justify-content: space-between;
  371. align-items: center;
  372. .item_name{
  373. width: 20%;
  374. font-size: 28rpx;
  375. font-family: Verdana, Verdana-Regular;
  376. font-weight: 400;
  377. text-align: left;
  378. color: #262626;
  379. }
  380. .item_right{
  381. width: 80%;
  382. font-size: 26rpx;
  383. font-family: Verdana, Verdana-Regular;
  384. font-weight: 400;
  385. text-align: right;
  386. color: #262626;
  387. display: flex;
  388. align-items: center;
  389. .item_right_name{
  390. width: 100%;
  391. }
  392. .item_right_name_placeholder{
  393. font-size: 26rpx;
  394. font-family: Verdana, Verdana-Regular;
  395. font-weight: 400;
  396. color: #b1b1b1;
  397. }
  398. .icon_right{
  399. width: 10rpx;
  400. height: 22rpx;
  401. margin-left: 19rpx;
  402. }
  403. .veritify{
  404. width: 140rpx;
  405. height: 50rpx;
  406. margin-left: 10rpx;
  407. line-height: 50rpx;
  408. background: #ffffff;
  409. border: 2rpx solid #f07423;
  410. border-radius: 8rpx;
  411. font-size: 20rpx;
  412. font-family: Verdana, Verdana-Regular;
  413. font-weight: 400;
  414. text-align: center;
  415. color: #f07423;
  416. }
  417. }
  418. }
  419. .user_line{
  420. margin-left: 40rpx;
  421. margin-right: 40rpx;
  422. height: 2px;
  423. background: #f8f8f8;
  424. }
  425. }
  426. .project_ino{
  427. background: #ffffff;
  428. margin-top: 20rpx;
  429. .user_item{
  430. margin-left: 40rpx;
  431. margin-right: 40rpx;
  432. height: 98rpx;
  433. display: flex;
  434. justify-content: space-between;
  435. align-items: center;
  436. .item_name{
  437. width: 20%;
  438. font-size: 28rpx;
  439. font-family: Verdana, Verdana-Regular;
  440. font-weight: 400;
  441. text-align: left;
  442. color: #262626;
  443. }
  444. .item_right{
  445. width: 80%;
  446. font-size: 26rpx;
  447. font-family: Verdana, Verdana-Regular;
  448. font-weight: 400;
  449. text-align: right;
  450. color: #262626;
  451. display: flex;
  452. align-items: center;
  453. .item_right_name{
  454. width: 100%;
  455. }
  456. .item_right_name_placeholder{
  457. font-size: 26rpx;
  458. font-family: Verdana, Verdana-Regular;
  459. font-weight: 400;
  460. color: #b1b1b1;
  461. }
  462. .icon_right{
  463. width: 10rpx;
  464. height: 22rpx;
  465. margin-left: 19rpx;
  466. }
  467. }
  468. }
  469. .user_line{
  470. margin-left: 40rpx;
  471. margin-right: 40rpx;
  472. height: 2px;
  473. background: #f8f8f8;
  474. }
  475. }
  476. .xieyi{
  477. display: flex;
  478. width: 100%;
  479. justify-content: center;
  480. position: absolute;
  481. bottom: 162rpx;
  482. left: 0;
  483. align-items: center;
  484. .icon_selected{
  485. width: 24rpx;
  486. height: 24rpx;
  487. margin-right: 20rpx;
  488. }
  489. .tongyi{
  490. font-size: 24rpx;
  491. font-family: Verdana, Verdana-Regular;
  492. font-weight: 400;
  493. color: #999999;
  494. display: inline-block;
  495. }
  496. .xieyi_text{
  497. font-size: 24rpx;
  498. font-family: Verdana, Verdana-Regular;
  499. font-weight: 400;
  500. color: #f07423;
  501. display: inline-block;
  502. }
  503. }
  504. .btn_next{
  505. width: calc(100% - 80rpx);
  506. box-sizing: border-box;
  507. margin-left: 40rpx;
  508. margin-right: 40rpx;
  509. height: 72rpx;
  510. line-height: 72rpx;
  511. background: #f07423;
  512. border-radius: 12rpx;
  513. font-size: 32rpx;
  514. font-family: Verdana, Verdana-Regular;
  515. font-weight: 400;
  516. text-align: center;
  517. color: #ffffff;
  518. position: absolute;
  519. bottom: 60rpx;
  520. left: 0;
  521. }
  522. }
  523. </style>