indexTwo.vue 13 KB

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