indexThree.vue 13 KB

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