indexThree.vue 11 KB

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