indexThree.vue 13 KB

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