indexThree.vue 11 KB

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