indexThree.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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. 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. 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. }
  373. .infos {
  374. width: 100%;
  375. display: inline-table;
  376. }
  377. .info {
  378. line-height: 20px;
  379. }
  380. /* .but {
  381. border: 1px solid #CDCDCD;
  382. border-radius: 10px;
  383. } */
  384. .homePage {
  385. width: 101%;
  386. height: 200px;
  387. margin: 20px auto;
  388. }
  389. .logo {
  390. width: 35px;
  391. height: 35px;
  392. background-color: #FEECE6;
  393. color: #FE6430;
  394. font-weight: 600;
  395. font-size: 16px;
  396. text-align: center;
  397. line-height: 35px;
  398. padding: 0 3px;
  399. border-radius: 6px;
  400. display: inline-block;
  401. margin-top: 10px;
  402. }
  403. .forList {
  404. background: #FFFFFF;
  405. margin-top: 10px;
  406. padding: 10px 10px;
  407. border-radius: 16px;
  408. }
  409. .status {
  410. position: absolute;
  411. margin-top: 10px;
  412. right: 36px;
  413. color: #22C572;
  414. }
  415. .status1 {
  416. position: absolute;
  417. margin-top: 10px;
  418. right: 36px;
  419. color: #FE6430;
  420. }
  421. .status2 {
  422. position: absolute;
  423. margin-top: 10px;
  424. right: 36px;
  425. color: #FB1E1E;
  426. }
  427. .status3 {
  428. position: absolute;
  429. margin-top: 10px;
  430. right: 36px;
  431. color: #AFB3BF;
  432. }
  433. .btn {
  434. margin-top: 10px;
  435. background-color: #FFFFFF;
  436. border-radius: 25px;
  437. border: none;
  438. }
  439. .btns {
  440. background-color: #22C572;
  441. }
  442. .but {
  443. height: 33px;
  444. border: 1px solid #CDCDCD;
  445. border-radius: 20px;
  446. line-height: 30px;
  447. padding: 0 8px;
  448. text-align: center;
  449. margin-left: 20px;
  450. font-size: 14px;
  451. font-weight: 500;
  452. }
  453. .yuan {
  454. margin-top: 6px;
  455. font-size: 14px;
  456. font-weight: 500;
  457. }
  458. .shade-content {
  459. background: #fff;
  460. position: absolute;
  461. top: 50%;
  462. left: 50%;
  463. transform: translateX(-50%) translateY(-50%);
  464. z-index: 999999;
  465. text-align: center;
  466. border-radius: 20px;
  467. }
  468. .shade-content-item {
  469. width: 277px;
  470. text-align: center;
  471. height: 121px;
  472. padding: 35px 10px;
  473. }
  474. .shade {
  475. position: fixed;
  476. top: 0;
  477. left: 0;
  478. width: 100%;
  479. background: rgba(0, 0, 0, 0.1);
  480. height: 100%;
  481. z-index: 2;
  482. }
  483. .titel {
  484. font-size: 18px;
  485. font-weight: 600;
  486. margin-top: 20px;
  487. }
  488. .determine {
  489. width: 95px;
  490. height: 36px;
  491. background-color: #22C572;
  492. color: #FFFFFF;
  493. border-radius: 10px;
  494. margin: 0 auto;
  495. line-height: 36px;
  496. margin-top: -30px;
  497. margin-bottom: 20px;
  498. }
  499. .tainput {
  500. width: 70%;
  501. padding-left: 10px;
  502. margin: 0 auto;
  503. text-align: left;
  504. border-bottom: 1px solid #AFB3BF;
  505. border-radius: 3px;
  506. }
  507. .cancel {
  508. width: 20px;
  509. height: 20px;
  510. font-size: 20px;
  511. color: #8890B1;
  512. float: right;
  513. margin-right: 20px;
  514. margin-top: -25px;
  515. }
  516. .btns1 {
  517. width: 50%;
  518. font-size: 18px;
  519. line-height: 50px;
  520. text-align: center;
  521. border-top: 1px solid #EEEEEE;
  522. margin-top: -26px;
  523. }
  524. .btn1 {
  525. border-right: 1px solid #EEEEEE;
  526. color: #AFB3BF;
  527. }
  528. .btn2 {
  529. color: #22C572;
  530. }
  531. .tainput1 {
  532. width: 70%;
  533. padding-left: 10px;
  534. margin: 0 auto;
  535. text-align: left;
  536. border-radius: 3px;
  537. }
  538. .options{
  539. justify-content: flex-end;
  540. }
  541. </style>