indexThree.vue 11 KB

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