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. <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. <view v-if="drivers.length==0">
  83. <button class="btn btns" @click="Add">新增</button>
  84. </view>
  85. </view>
  86. </template>
  87. <script>
  88. import {
  89. mapState
  90. } from 'vuex';
  91. export default {
  92. name: "buy",
  93. data() {
  94. return {
  95. businessman: {},
  96. identityAuthenticationInfo: {},
  97. drivers: {},
  98. pricestatus: false,
  99. pricestatusTwo: false,
  100. price: "",
  101. verifyCode: "",
  102. sendText: "60s后重发",
  103. id:"",
  104. }
  105. },
  106. computed: {
  107. ...mapState(['hasLogin', 'userInfo'])
  108. },
  109. onLoad() {
  110. this.getList()
  111. },
  112. onPullDownRefresh() {
  113. this.getList()
  114. setTimeout(function () {
  115. uni.stopPullDownRefresh();
  116. }, 1000);
  117. },
  118. methods: {
  119. resend() {
  120. price
  121. if (this.sendText == "获取验证码") {
  122. this.getcode()
  123. }
  124. },
  125. open(item) {
  126. this.id = item.id
  127. this.pricestatus = !this.pricestatus
  128. },
  129. Add() {
  130. uni.navigateTo({
  131. url: `/pageD/identity/driverIdentity`
  132. })
  133. },
  134. getList() {
  135. this.identityAuthenticationInfo.commonId = this.userInfo.id
  136. this.$api.doRequest('get', '/driverViewInfo/selectDriverInfoPage', {
  137. pageSize: 10,
  138. currentPage: 1,
  139. commonId: this.userInfo.id,
  140. pcFlag: 0
  141. }, 'application/json;charset=UTF-8').then(res => {
  142. console.log(res.data.data.records)
  143. for(var i = 0 ; i < res.data.data.records.length ; i++){
  144. res.data.data.records[i].logo = res.data.data.records[i].driverName.substr(0,1)
  145. }
  146. this.drivers = res.data.data.records
  147. })
  148. .catch(res => {
  149. if(res.errmsg){
  150. uni.showToast({
  151. title: res.errmsg,
  152. icon: 'none',
  153. duration: 2000
  154. })
  155. }
  156. else{
  157. uni.showToast({
  158. title: "系统异常,请联系管理员",
  159. icon: 'none',
  160. duration: 2000
  161. })
  162. }
  163. });
  164. },
  165. amendprice(item) {
  166. var that = this
  167. that.identityAuthenticationInfo.driverPhone = that.price
  168. this.$api.doRequest('get', '/commonUser/loginVerifyCode', {
  169. phone: this.price,
  170. verifyCode: this.verifyCode
  171. }).then(res => {
  172. if (res.data.code == 200) {
  173. that.$api.doRequest('get','/driverViewInfo/selectPhone',that.identityAuthenticationInfo)
  174. .then(res => {
  175. if (res.data.code == '11018') {
  176. uni.showModal({
  177. title: '提示',
  178. content: '该手机号已认证过司机,再次认证将覆盖之前的认证信息,是否确定认证?',
  179. success: function(res) {
  180. if (res.confirm) {
  181. that.identityAuthenticationInfo.id = item.id
  182. that.$api.doRequest('post','/driverViewInfo/api/modifyPhone',that.identityAuthenticationInfo).then(
  183. res => {
  184. uni.showToast({
  185. title: '提交成功',
  186. icon: 'none',
  187. duration: 2000
  188. })
  189. uni.navigateTo({
  190. url: `/pages/attestation/indexThree`,
  191. })
  192. }).catch(res => {
  193. uni.showToast({
  194. title: res.data.message,
  195. icon: 'none',
  196. duration: 2000
  197. })
  198. })
  199. } else if (res.cancel) {
  200. uni.showToast({
  201. title: '提交失败',
  202. icon: 'none',
  203. duration: 2000
  204. })
  205. }
  206. }
  207. });
  208. }else if(res.data.code == 200){
  209. that.identityAuthenticationInfo.id = item.id
  210. that.$api.doRequest('post','/driverViewInfo/api/modifyPhone',that.identityAuthenticationInfo).then(
  211. res => {
  212. uni.showToast({
  213. title: '提交成功',
  214. icon: 'none',
  215. duration: 2000
  216. })
  217. uni.navigateTo({
  218. url: `/pages/attestation/indexThree`,
  219. })
  220. }).catch(res => {
  221. uni.showToast({
  222. title: res.data.message,
  223. icon: 'none',
  224. duration: 2000
  225. })
  226. })
  227. }
  228. }).catch(res => {
  229. uni.showToast({
  230. title: res.data.message,
  231. icon: 'none',
  232. duration: 2000
  233. })
  234. })
  235. }
  236. })
  237. },
  238. getcode() {
  239. if (!this.price) {
  240. uni.showToast({
  241. title: '请填写手机号!',
  242. icon: 'none',
  243. duration: 2000
  244. })
  245. return
  246. }
  247. if (this.price.length != 11 ) {
  248. uni.showToast({
  249. title: '请正确填写手机号!',
  250. icon: 'none',
  251. duration: 2000
  252. })
  253. return
  254. }
  255. this.pricestatusTwo = true
  256. var that = this
  257. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.price)) {
  258. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  259. phone: this.price
  260. }).then(res => {
  261. if (res.data.code == 200) {
  262. that.sendDisabled = true
  263. let sec = 60
  264. let interval = setInterval(() => {
  265. sec--;
  266. that.sendText = sec + 's后重发'
  267. if (sec <= 0) {
  268. that.sendDisabled = false
  269. that.sendText = "获取验证码"
  270. clearInterval(interval)
  271. }
  272. }, 1000)
  273. } else {
  274. uni.showToast({
  275. title: res.data.message,
  276. icon: 'none',
  277. duration: 2000
  278. })
  279. }
  280. })
  281. .catch(res => {
  282. uni.showToast({
  283. title: res.data.message,
  284. icon: 'none',
  285. duration: 2000
  286. })
  287. });
  288. } else {
  289. uni.showToast({
  290. title: '请输入正确的手机号',
  291. icon: 'none',
  292. duration: 2000
  293. })
  294. }
  295. },
  296. navToDetailPage(item) {
  297. uni.navigateTo({
  298. url: `/pageD/identity/driverIdentityLook?id=${item.id}`
  299. })
  300. },
  301. deleteSJ(item) {
  302. this.deletes = {}
  303. this.deletes.id = item.id
  304. uni.showModal({
  305. content: '身份信息删除后不可恢复,是否确定删除?',
  306. showCancel: true,
  307. confirmText: '确定',
  308. success: (e) => {
  309. if(e.confirm){
  310. this.$api.doRequest('post', '/driverViewInfo/api/deleteDriver', this.deletes,
  311. 'application/json;charset=UTF-8').then(res => {
  312. if (res.data.code == 200) {
  313. this.$api.msg('删除成功!')
  314. this.getList()
  315. return
  316. }
  317. })
  318. .catch(res => {
  319. if(res.errmsg){
  320. uni.showToast({
  321. title: res.errmsg,
  322. icon: 'none',
  323. duration: 2000
  324. })
  325. }
  326. else{
  327. uni.showToast({
  328. title: "系统异常,请联系管理员",
  329. icon: 'none',
  330. duration: 2000
  331. })
  332. }
  333. });
  334. }
  335. },
  336. fail: () => {},
  337. complete: () => {}
  338. })
  339. },
  340. companyEdit(item) {
  341. uni.navigateTo({
  342. url: `/pageD/identity/driverIdentityEdit?id=${item.id}`
  343. })
  344. },
  345. }
  346. }
  347. </script>
  348. <style>
  349. .center {
  350. padding: 10px 20px;
  351. background-color: #F5F6FA;
  352. }
  353. .title {
  354. font-size: 22px;
  355. font-weight: 900;
  356. /* margin-top: 30px; */
  357. top: 50px;
  358. left: 24px;
  359. position: relative;
  360. }
  361. .company {
  362. font-size: 16px;
  363. font-weight: 600;
  364. margin-top: 10px;
  365. display: inline-block;
  366. margin-left: 10px;
  367. }
  368. .geren {
  369. color: #AFB3BF;
  370. font-size: 14px;
  371. margin-top: -10px;
  372. margin-left: 45px;
  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>