indexThree.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617
  1. <template>
  2. <view class="center">
  3. <view v-for="(item , index) in drivers" :Key="index" class="forList">
  4. <view class='flex' @click="navToDetailPage(item)">
  5. <view class="logo">
  6. {{item.logo}}
  7. </view>
  8. <view class="company">{{item.driverName}}</view>
  9. <view class="status" v-if="item.cover == '1'">
  10. 已覆盖
  11. </view>
  12. <view v-else>
  13. <view class="status" v-if="item.authenticationStatus == '已认证'">
  14. <image src="../../static/img/authentication/cert-personal@3x.png"
  15. style="width: 16px;height: 16px;top:3px;"></image>
  16. {{item.authenticationStatus}}
  17. </view>
  18. <view class="status1" v-if="item.authenticationStatus == '审核中'">
  19. {{item.authenticationStatus}}
  20. </view>
  21. <view class="status2" v-if="item.authenticationStatus == '未通过'">
  22. {{item.authenticationStatus}}
  23. </view>
  24. <view class="status3" v-if="item.authenticationStatus == '已覆盖'">
  25. {{item.authenticationStatus}}
  26. </view>
  27. </view>
  28. </view>
  29. <view class="geren">{{item.driverPhone}}</view>
  30. <hr style="margin: 10px 0;">
  31. <view class="flex options">
  32. <!-- <view class="yuan">
  33. <image src="../../static/img/authentication/selected(2).png"
  34. style="width: 16px;height: 16px;top: 3px;">设为默认</image>
  35. </view> -->
  36. <view class='but' v-if="item.authenticationStatus == '已覆盖'||item.authenticationStatus == '已认证'" @click="open(item)">更换手机号</view>
  37. <view class='but' v-if="item.authenticationStatus != '审核中'" @click="companyEdit(item)">修改</view>
  38. <view class='but' @click="deleteSJ(item)">删除</view>
  39. </view>
  40. <view v-if='pricestatus' class='shade'>
  41. <view class='shade-content'>
  42. <view class="titel">
  43. 更换手机号
  44. </view>
  45. <view class="cancel" @click='pricestatus=false'>×</view>
  46. <view class='shade-content-item'>
  47. <input v-model='price' placeholder="请输入手机号" maxlength="11" type="number" class="tainput" >
  48. </view>
  49. <view>
  50. <!--<view style='width:50%;display:inline-block;' @click='pricestatus=false'>取消</view>
  51. <view style='width:50%;display:inline-block;' @click='amendprice'>确定</view> -->
  52. <view class="determine" @click="getcode">
  53. 获取验证码
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. <!-- 填写验证码 -->
  59. <view v-if='pricestatusTwo' class='shade'>
  60. <view class='shade-content'>
  61. <view class="titel">
  62. 填写验证码
  63. </view>
  64. <text style="color:#AFB3BF;font-size: 14px;">验证码已发送至+86 {{price}}</text>
  65. <view class="cancel" @click='pricestatusTwo=false,pricestatus=false'>×</view>
  66. <view class='shade-content-item flex'>
  67. <input v-model='verifyCode' placeholder="填写验证码" type="number" class="tainput1" maxlength="6">
  68. <text style="color:#AFB3BF;font-size: 14px;" @click="resend()">{{sendText}}</text>
  69. </view>
  70. <view>
  71. <view class="flex">
  72. <text class="btns1 btn1" @click='pricestatusTwo=false'>取消</text>
  73. <view class="btns1 btn2" @click='amendprice(item)'>确定</view>
  74. </view>
  75. <!-- <view class="determine">
  76. 获取验证码
  77. </view> -->
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. <button class="btn btns" @click="Add">新增</button>
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. mapState
  88. } from 'vuex';
  89. export default {
  90. name: "buy",
  91. data() {
  92. return {
  93. businessman: {},
  94. identityAuthenticationInfo: {},
  95. drivers: {},
  96. pricestatus: false,
  97. pricestatusTwo: false,
  98. price: "",
  99. verifyCode: "",
  100. sendText: "60s后重发",
  101. id:"",
  102. }
  103. },
  104. computed: {
  105. ...mapState(['hasLogin', 'userInfo'])
  106. },
  107. onLoad() {
  108. this.getList()
  109. },
  110. onPullDownRefresh() {
  111. this.getList()
  112. uni.stopPullDownRefresh()
  113. },
  114. methods: {
  115. resend() {
  116. price
  117. if (this.sendText == "获取验证码") {
  118. this.getcode()
  119. }
  120. },
  121. open(item) {
  122. this.id = item.id
  123. this.pricestatus = !this.pricestatus
  124. },
  125. Add() {
  126. uni.navigateTo({
  127. url: `/pageD/identity/driverIdentity`
  128. })
  129. },
  130. getList() {
  131. this.identityAuthenticationInfo.commonId = this.userInfo.id
  132. this.$api.doRequest('get', '/driverViewInfo/selectDriverInfoPage', {
  133. pageSize: 10,
  134. currentPage: 1,
  135. commonId: this.userInfo.id,
  136. pcFlag: 0
  137. }, 'application/json;charset=UTF-8').then(res => {
  138. for(var i = 0 ; i < res.data.data.records.length ; i++){
  139. res.data.data.records[i].logo = res.data.data.records[i].driverName.substr(0,1)
  140. }
  141. this.drivers = res.data.data.records
  142. })
  143. .catch(res => {
  144. if(res.errmsg){
  145. uni.showToast({
  146. title: res.errmsg,
  147. icon: 'none',
  148. duration: 2000
  149. })
  150. }
  151. else{
  152. uni.showToast({
  153. title: "系统异常,请联系管理员",
  154. icon: 'none',
  155. duration: 2000
  156. })
  157. }
  158. });
  159. },
  160. amendprice(item) {
  161. var that = this
  162. that.identityAuthenticationInfo.driverPhone = that.price
  163. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  164. phone: this.price,
  165. verifyCode: this.verifyCode
  166. }).then(res => {
  167. if (res.data.code == 200) {
  168. that.$api.doRequest('get','/driverViewInfo/selectPhone',that.identityAuthenticationInfo)
  169. .then(res => {
  170. if (res.data.code == '11018') {
  171. uni.showModal({
  172. title: '提示',
  173. content: '该手机号已认证过司机,再次认证将覆盖之前的认证信息,是否确定认证?',
  174. success: function(res) {
  175. if (res.confirm) {
  176. that.identityAuthenticationInfo.id = item.id
  177. that.$api.doRequest('post','/driverViewInfo/api/modifyPhone',that.identityAuthenticationInfo).then(
  178. res => {
  179. uni.showToast({
  180. title: '提交成功',
  181. icon: 'none',
  182. duration: 2000
  183. })
  184. uni.navigateTo({
  185. url: `/pages/attestation/indexThree`,
  186. })
  187. }).catch(res => {
  188. uni.showToast({
  189. title: res.data.message,
  190. icon: 'none',
  191. duration: 2000
  192. })
  193. })
  194. } else if (res.cancel) {
  195. uni.showToast({
  196. title: '提交失败',
  197. icon: 'none',
  198. duration: 2000
  199. })
  200. }
  201. }
  202. });
  203. }else if(res.data.code == 200){
  204. that.identityAuthenticationInfo.id = item.id
  205. that.$api.doRequest('post','/driverViewInfo/api/modifyPhone',that.identityAuthenticationInfo).then(
  206. res => {
  207. uni.showToast({
  208. title: '提交成功',
  209. icon: 'none',
  210. duration: 2000
  211. })
  212. uni.navigateTo({
  213. url: `/pages/attestation/indexThree`,
  214. })
  215. }).catch(res => {
  216. uni.showToast({
  217. title: res.data.message,
  218. icon: 'none',
  219. duration: 2000
  220. })
  221. })
  222. }
  223. }).catch(res => {
  224. uni.showToast({
  225. title: res.data.message,
  226. icon: 'none',
  227. duration: 2000
  228. })
  229. })
  230. }
  231. })
  232. // if (res.data.code == 200) {
  233. // that.$api.doRequest('post',
  234. // '/identityAuthenticationInfo/api/modifyIdentityPhone',
  235. // that.identityAuthenticationInfo).then(
  236. // res => {
  237. // uni.showToast({
  238. // title: '提交成功',
  239. // icon: 'none',
  240. // duration: 2000
  241. // })
  242. // uni.navigateTo({
  243. // url: `/pages/attestation/indexTwo`,
  244. // })
  245. // }).catch(res => {
  246. // uni.showToast({
  247. // title: res.data.message,
  248. // icon: 'none',
  249. // duration: 2000
  250. // })
  251. // })
  252. // } else {
  253. // uni.showToast({
  254. // title: res.data.message,
  255. // icon: 'none',
  256. // duration: 2000
  257. // })
  258. // return
  259. // }
  260. // })
  261. // .catch(res => {
  262. // uni.showToast({
  263. // title: res.data.message,
  264. // icon: 'none',
  265. // duration: 2000
  266. // })
  267. // return
  268. // });
  269. },
  270. getcode() {
  271. if (!this.price) {
  272. uni.showToast({
  273. title: '请填写手机号!',
  274. icon: 'none',
  275. duration: 2000
  276. })
  277. return
  278. }
  279. if (this.price.length != 11 ) {
  280. uni.showToast({
  281. title: '请正确填写手机号!',
  282. icon: 'none',
  283. duration: 2000
  284. })
  285. return
  286. }
  287. this.pricestatusTwo = true
  288. // this.pricestatusTwo = !this.pricestatusTwo
  289. var that = this
  290. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.price)) {
  291. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  292. phone: this.price
  293. }).then(res => {
  294. if (res.data.code == 200) {
  295. that.sendDisabled = true
  296. let sec = 60
  297. let interval = setInterval(() => {
  298. sec--;
  299. that.sendText = sec + 's后重发'
  300. if (sec <= 0) {
  301. that.sendDisabled = false
  302. that.sendText = "获取验证码"
  303. clearInterval(interval)
  304. }
  305. }, 1000)
  306. } else {
  307. uni.showToast({
  308. title: res.data.message,
  309. icon: 'none',
  310. duration: 2000
  311. })
  312. }
  313. })
  314. .catch(res => {
  315. uni.showToast({
  316. title: res.data.message,
  317. icon: 'none',
  318. duration: 2000
  319. })
  320. });
  321. } else {
  322. uni.showToast({
  323. title: '请输入正确的手机号',
  324. icon: 'none',
  325. duration: 2000
  326. })
  327. }
  328. },
  329. navToDetailPage(item) {
  330. uni.navigateTo({
  331. url: `/pageD/identity/driverIdentityLook?id=${item.id}`
  332. })
  333. },
  334. deleteSJ(item) {
  335. this.deletes = {}
  336. this.deletes.id = item.id
  337. uni.showModal({
  338. content: '身份信息删除后不可恢复,是否确定删除?',
  339. showCancel: true,
  340. confirmText: '确定',
  341. success: (e) => {
  342. if(e.confirm){
  343. this.$api.doRequest('post', '/driverViewInfo/api/deleteDriver', this.deletes,
  344. 'application/json;charset=UTF-8').then(res => {
  345. if (res.data.code == 200) {
  346. this.$api.msg('删除成功!')
  347. this.getList()
  348. return
  349. }
  350. })
  351. .catch(res => {
  352. if(res.errmsg){
  353. uni.showToast({
  354. title: res.errmsg,
  355. icon: 'none',
  356. duration: 2000
  357. })
  358. }
  359. else{
  360. uni.showToast({
  361. title: "系统异常,请联系管理员",
  362. icon: 'none',
  363. duration: 2000
  364. })
  365. }
  366. });
  367. }
  368. },
  369. fail: () => {},
  370. complete: () => {}
  371. })
  372. },
  373. companyEdit(item) {
  374. uni.navigateTo({
  375. url: `/pageD/identity/driverIdentityEdit?id=${item.id}`
  376. })
  377. },
  378. }
  379. }
  380. </script>
  381. <style>
  382. .center {
  383. padding: 10px 20px;
  384. background-color: #F5F6FA;
  385. }
  386. .title {
  387. font-size: 22px;
  388. font-weight: 900;
  389. /* margin-top: 30px; */
  390. top: 50px;
  391. left: 24px;
  392. position: relative;
  393. }
  394. .company {
  395. font-size: 16px;
  396. font-weight: 600;
  397. margin-top: 10px;
  398. display: inline-block;
  399. margin-left: 10px;
  400. }
  401. .geren {
  402. color: #AFB3BF;
  403. font-size: 14px;
  404. margin-top: -10px;
  405. margin-left: 45px;
  406. }
  407. .infos {
  408. width: 100%;
  409. display: inline-table;
  410. }
  411. .info {
  412. line-height: 20px;
  413. }
  414. /* .but {
  415. border: 1px solid #CDCDCD;
  416. border-radius: 10px;
  417. } */
  418. .homePage {
  419. width: 101%;
  420. height: 200px;
  421. margin: 20px auto;
  422. }
  423. .logo {
  424. width: 35px;
  425. height: 35px;
  426. background-color: #FEECE6;
  427. color: #FE6430;
  428. font-weight: 600;
  429. font-size: 16px;
  430. text-align: center;
  431. line-height: 35px;
  432. padding: 0 3px;
  433. border-radius: 6px;
  434. display: inline-block;
  435. margin-top: 10px;
  436. }
  437. .forList {
  438. background: #FFFFFF;
  439. margin-top: 10px;
  440. padding: 10px 10px;
  441. border-radius: 16px;
  442. }
  443. .status {
  444. position: absolute;
  445. margin-top: 10px;
  446. right: 36px;
  447. color: #22C572;
  448. }
  449. .status1 {
  450. position: absolute;
  451. margin-top: 10px;
  452. right: 36px;
  453. color: #FE6430;
  454. }
  455. .status2 {
  456. position: absolute;
  457. margin-top: 10px;
  458. right: 36px;
  459. color: #FB1E1E;
  460. }
  461. .status3 {
  462. position: absolute;
  463. margin-top: 10px;
  464. right: 36px;
  465. color: #AFB3BF;
  466. }
  467. .btn {
  468. margin-top: 10px;
  469. background-color: #FFFFFF;
  470. border-radius: 25px;
  471. border: none;
  472. }
  473. .btns {
  474. background-color: #22C572;
  475. }
  476. .but {
  477. height: 33px;
  478. border: 1px solid #CDCDCD;
  479. border-radius: 20px;
  480. line-height: 30px;
  481. padding: 0 8px;
  482. text-align: center;
  483. margin-left: 20px;
  484. font-size: 14px;
  485. font-weight: 500;
  486. }
  487. .yuan {
  488. margin-top: 6px;
  489. font-size: 14px;
  490. font-weight: 500;
  491. }
  492. .shade-content {
  493. background: #fff;
  494. position: absolute;
  495. top: 50%;
  496. left: 50%;
  497. transform: translateX(-50%) translateY(-50%);
  498. z-index: 999999;
  499. text-align: center;
  500. border-radius: 20px;
  501. }
  502. .shade-content-item {
  503. width: 277px;
  504. text-align: center;
  505. height: 121px;
  506. padding: 35px 10px;
  507. }
  508. .shade {
  509. position: fixed;
  510. top: 0;
  511. left: 0;
  512. width: 100%;
  513. background: rgba(0, 0, 0, 0.1);
  514. height: 100%;
  515. z-index: 2;
  516. }
  517. .titel {
  518. font-size: 18px;
  519. font-weight: 600;
  520. margin-top: 20px;
  521. }
  522. .determine {
  523. width: 95px;
  524. height: 36px;
  525. background-color: #22C572;
  526. color: #FFFFFF;
  527. border-radius: 10px;
  528. margin: 0 auto;
  529. line-height: 36px;
  530. margin-top: -30px;
  531. margin-bottom: 20px;
  532. }
  533. .tainput {
  534. width: 70%;
  535. padding-left: 10px;
  536. margin: 0 auto;
  537. text-align: left;
  538. border-bottom: 1px solid #AFB3BF;
  539. border-radius: 3px;
  540. }
  541. .cancel {
  542. width: 20px;
  543. height: 20px;
  544. font-size: 20px;
  545. color: #8890B1;
  546. float: right;
  547. margin-right: 20px;
  548. margin-top: -25px;
  549. }
  550. .btns1 {
  551. width: 50%;
  552. font-size: 18px;
  553. line-height: 50px;
  554. text-align: center;
  555. border-top: 1px solid #EEEEEE;
  556. margin-top: -26px;
  557. }
  558. .btn1 {
  559. border-right: 1px solid #EEEEEE;
  560. color: #AFB3BF;
  561. }
  562. .btn2 {
  563. color: #22C572;
  564. }
  565. .tainput1 {
  566. width: 70%;
  567. padding-left: 10px;
  568. margin: 0 auto;
  569. text-align: left;
  570. border-radius: 3px;
  571. }
  572. .options{
  573. justify-content: flex-end;
  574. }
  575. </style>