indexThree.vue 11 KB

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