indexThree.vue 13 KB

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