indexThree.vue 14 KB

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