ownerCertification.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  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. uni.showToast({
  275. icon:"none",
  276. title:"请输入手机号"
  277. })
  278. return
  279. }
  280. if(!this.houseId){
  281. uni.showToast({
  282. icon:"none",
  283. title:"请选择认证项目"
  284. })
  285. return
  286. }
  287. if(!this.certificateType){
  288. uni.showToast({
  289. icon:"none",
  290. title:"请选择证件类型"
  291. })
  292. return
  293. }
  294. if(!this.certificateNo){
  295. uni.showToast({
  296. icon:"none",
  297. title:"请输入证件号"
  298. })
  299. return
  300. }
  301. if(!this.roomNo){
  302. uni.showToast({
  303. icon:"none",
  304. title:"请输入房号"
  305. })
  306. return
  307. }
  308. if(!this.agree){
  309. uni.showToast({
  310. icon:"none",
  311. title:"请阅读并同意《入住协议》"
  312. })
  313. return
  314. }
  315. let ret = await this.$myRequest({
  316. url: "/user/regist/addOrUpdate",
  317. data: {
  318. "agreeState": this.agree?1:0,
  319. "captcha":this.verifity,
  320. "certificateNo": this.certificateNo,
  321. "certificateType": this.certificateType,
  322. "phone": this.mobile,
  323. "projectId": this.houseId,
  324. "roomNo": this.roomNo,
  325. "sex": this.gender,
  326. "sign": this.sign,
  327. "userId": app.globalData.userId,
  328. "username": this.name,
  329. "phoneFrom":this.mobileOld?1:2
  330. }
  331. })
  332. if (ret.data.success) {
  333. uni.navigateTo({
  334. url:'../certificationResultPage/certificationResultPage'
  335. })
  336. }else{
  337. uni.showToast({
  338. icon:"none",
  339. title:ret.data.message
  340. })
  341. }
  342. },
  343. },
  344. destroyed() {
  345. if(null!=this.timer){
  346. clearInterval(this.timer);
  347. this.timer = null;
  348. }
  349. },
  350. components:{
  351. dmAgreeement,
  352. dmPickerView
  353. }
  354. }
  355. </script>
  356. <style lang="scss">
  357. .yezhu_body{
  358. width: 100%;
  359. height: 100vh;
  360. position: relative;
  361. .user_info{
  362. background: #ffffff;
  363. .user_item{
  364. margin-left: 40rpx;
  365. margin-right: 40rpx;
  366. height: 98rpx;
  367. display: flex;
  368. justify-content: space-between;
  369. align-items: center;
  370. .item_name{
  371. width: 20%;
  372. font-size: 28rpx;
  373. font-family: Verdana, Verdana-Regular;
  374. font-weight: 400;
  375. text-align: left;
  376. color: #262626;
  377. }
  378. .item_right{
  379. width: 80%;
  380. font-size: 26rpx;
  381. font-family: Verdana, Verdana-Regular;
  382. font-weight: 400;
  383. text-align: right;
  384. color: #262626;
  385. display: flex;
  386. align-items: center;
  387. .item_right_name{
  388. width: 100%;
  389. }
  390. .item_right_name_placeholder{
  391. font-size: 26rpx;
  392. font-family: Verdana, Verdana-Regular;
  393. font-weight: 400;
  394. color: #b1b1b1;
  395. }
  396. .icon_right{
  397. width: 10rpx;
  398. height: 22rpx;
  399. margin-left: 19rpx;
  400. }
  401. .veritify{
  402. width: 140rpx;
  403. height: 50rpx;
  404. margin-left: 10rpx;
  405. line-height: 50rpx;
  406. background: #ffffff;
  407. border: 2rpx solid #f07423;
  408. border-radius: 8rpx;
  409. font-size: 20rpx;
  410. font-family: Verdana, Verdana-Regular;
  411. font-weight: 400;
  412. text-align: center;
  413. color: #f07423;
  414. }
  415. }
  416. }
  417. .user_line{
  418. margin-left: 40rpx;
  419. margin-right: 40rpx;
  420. height: 2px;
  421. background: #f8f8f8;
  422. }
  423. }
  424. .project_ino{
  425. background: #ffffff;
  426. margin-top: 20rpx;
  427. .user_item{
  428. margin-left: 40rpx;
  429. margin-right: 40rpx;
  430. height: 98rpx;
  431. display: flex;
  432. justify-content: space-between;
  433. align-items: center;
  434. .item_name{
  435. width: 20%;
  436. font-size: 28rpx;
  437. font-family: Verdana, Verdana-Regular;
  438. font-weight: 400;
  439. text-align: left;
  440. color: #262626;
  441. }
  442. .item_right{
  443. width: 80%;
  444. font-size: 26rpx;
  445. font-family: Verdana, Verdana-Regular;
  446. font-weight: 400;
  447. text-align: right;
  448. color: #262626;
  449. display: flex;
  450. align-items: center;
  451. .item_right_name{
  452. width: 100%;
  453. }
  454. .item_right_name_placeholder{
  455. font-size: 26rpx;
  456. font-family: Verdana, Verdana-Regular;
  457. font-weight: 400;
  458. color: #b1b1b1;
  459. }
  460. .icon_right{
  461. width: 10rpx;
  462. height: 22rpx;
  463. margin-left: 19rpx;
  464. }
  465. }
  466. }
  467. .user_line{
  468. margin-left: 40rpx;
  469. margin-right: 40rpx;
  470. height: 2px;
  471. background: #f8f8f8;
  472. }
  473. }
  474. .xieyi{
  475. display: flex;
  476. width: 100%;
  477. justify-content: center;
  478. position: absolute;
  479. bottom: 162rpx;
  480. left: 0;
  481. align-items: center;
  482. .icon_selected{
  483. width: 24rpx;
  484. height: 24rpx;
  485. margin-right: 20rpx;
  486. }
  487. .tongyi{
  488. font-size: 24rpx;
  489. font-family: Verdana, Verdana-Regular;
  490. font-weight: 400;
  491. color: #999999;
  492. display: inline-block;
  493. }
  494. .xieyi_text{
  495. font-size: 24rpx;
  496. font-family: Verdana, Verdana-Regular;
  497. font-weight: 400;
  498. color: #f07423;
  499. display: inline-block;
  500. }
  501. }
  502. .btn_next{
  503. width: calc(100% - 80rpx);
  504. box-sizing: border-box;
  505. margin-left: 40rpx;
  506. margin-right: 40rpx;
  507. height: 72rpx;
  508. line-height: 72rpx;
  509. background: #f07423;
  510. border-radius: 12rpx;
  511. font-size: 32rpx;
  512. font-family: Verdana, Verdana-Regular;
  513. font-weight: 400;
  514. text-align: center;
  515. color: #ffffff;
  516. position: absolute;
  517. bottom: 60rpx;
  518. left: 0;
  519. }
  520. }
  521. </style>