indexThree.vue 11 KB

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