indexThree.vue 13 KB

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