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