indexThree.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  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. that.$api.doRequest('post','/driverViewInfo/api/modifyPhone',that.identityAuthenticationInfo).then(
  165. res => {
  166. uni.showToast({
  167. title: '提交成功',
  168. icon: 'none',
  169. duration: 2000
  170. })
  171. uni.navigateTo({
  172. url: `/pages/attestation/indexThree`,
  173. })
  174. }).catch(res => {
  175. uni.showToast({
  176. title: res.data.message,
  177. icon: 'none',
  178. duration: 2000
  179. })
  180. })
  181. } else if (res.cancel) {
  182. uni.showToast({
  183. title: '提交失败',
  184. icon: 'none',
  185. duration: 2000
  186. })
  187. }
  188. }
  189. });
  190. }else if(res.data.code == 200){
  191. that.identityAuthenticationInfo.id = item.id
  192. that.$api.doRequest('post','/driverViewInfo/api/modifyPhone',that.identityAuthenticationInfo).then(
  193. res => {
  194. uni.showToast({
  195. title: '提交成功',
  196. icon: 'none',
  197. duration: 2000
  198. })
  199. uni.navigateTo({
  200. url: `/pages/attestation/indexThree`,
  201. })
  202. }).catch(res => {
  203. uni.showToast({
  204. title: res.data.message,
  205. icon: 'none',
  206. duration: 2000
  207. })
  208. })
  209. }
  210. }).catch(res => {
  211. uni.showToast({
  212. title: res.data.message,
  213. icon: 'none',
  214. duration: 2000
  215. })
  216. })
  217. }
  218. })
  219. // if (res.data.code == 200) {
  220. // that.$api.doRequest('post',
  221. // '/identityAuthenticationInfo/api/modifyIdentityPhone',
  222. // that.identityAuthenticationInfo).then(
  223. // res => {
  224. // uni.showToast({
  225. // title: '提交成功',
  226. // icon: 'none',
  227. // duration: 2000
  228. // })
  229. // uni.navigateTo({
  230. // url: `/pages/attestation/indexTwo`,
  231. // })
  232. // }).catch(res => {
  233. // uni.showToast({
  234. // title: res.data.message,
  235. // icon: 'none',
  236. // duration: 2000
  237. // })
  238. // })
  239. // } else {
  240. // uni.showToast({
  241. // title: res.data.message,
  242. // icon: 'none',
  243. // duration: 2000
  244. // })
  245. // return
  246. // }
  247. // })
  248. // .catch(res => {
  249. // uni.showToast({
  250. // title: res.data.message,
  251. // icon: 'none',
  252. // duration: 2000
  253. // })
  254. // return
  255. // });
  256. },
  257. getcode() {
  258. if (!this.price) {
  259. uni.showToast({
  260. title: '请填写手机号!',
  261. icon: 'none',
  262. duration: 2000
  263. })
  264. return
  265. }
  266. if (this.price.length != 11 ) {
  267. uni.showToast({
  268. title: '请正确填写手机号!',
  269. icon: 'none',
  270. duration: 2000
  271. })
  272. return
  273. }
  274. this.pricestatusTwo = true
  275. // this.pricestatusTwo = !this.pricestatusTwo
  276. var that = this
  277. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.price)) {
  278. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  279. phone: this.price
  280. }).then(res => {
  281. if (res.data.code == 200) {
  282. that.sendDisabled = true
  283. let sec = 60
  284. let interval = setInterval(() => {
  285. sec--;
  286. that.sendText = sec + 's后重发'
  287. if (sec <= 0) {
  288. that.sendDisabled = false
  289. that.sendText = "获取验证码"
  290. clearInterval(interval)
  291. }
  292. }, 1000)
  293. } else {
  294. uni.showToast({
  295. title: res.data.message,
  296. icon: 'none',
  297. duration: 2000
  298. })
  299. }
  300. })
  301. .catch(res => {
  302. uni.showToast({
  303. title: res.data.message,
  304. icon: 'none',
  305. duration: 2000
  306. })
  307. });
  308. } else {
  309. uni.showToast({
  310. title: '请输入正确的手机号',
  311. icon: 'none',
  312. duration: 2000
  313. })
  314. }
  315. },
  316. navToDetailPage(item) {
  317. uni.navigateTo({
  318. url: `/pageD/identity/driverIdentityLook?id=${item.id}`
  319. })
  320. },
  321. deleteSJ(item) {
  322. this.deletes = {}
  323. this.deletes.id = item.id
  324. uni.showModal({
  325. content: '身份信息删除后不可恢复,是否确定删除?',
  326. showCancel: true,
  327. confirmText: '确定',
  328. success: (e) => {
  329. if(e.confirm){
  330. this.$api.doRequest('post', '/driverViewInfo/api/deleteDriver', this.deletes,
  331. 'application/json;charset=UTF-8').then(res => {
  332. if (res.data.code == 200) {
  333. this.$api.msg('删除成功!')
  334. this.getList()
  335. return
  336. }
  337. })
  338. .catch(res => {
  339. uni.showToast({
  340. title: res.errmsg,
  341. icon: 'none',
  342. duration: 2000
  343. })
  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>