indexThree.vue 10 KB

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