indexTwo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599
  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()1
  231. uni.showToast({
  232. title: res.data.message,
  233. icon: 'none',
  234. duration: 2000
  235. })
  236. }
  237. })
  238. .catch(res => {
  239. uni.showToast({
  240. title: res.data.message,
  241. icon: 'none',
  242. duration: 2000
  243. })
  244. });
  245. },
  246. getcode() {
  247. if (!this.price) {
  248. uni.showToast({
  249. title: '请填写手机号!',
  250. icon: 'none',
  251. duration: 2000
  252. })
  253. return
  254. }
  255. if (this.price.length != 11) {
  256. uni.showToast({
  257. title: '请正确填写手机号!',
  258. icon: 'none',
  259. duration: 2000
  260. })
  261. return
  262. }
  263. this.pricestatusTwo = true
  264. // this.pricestatusTwo = !this.pricestatusTwo
  265. var that = this
  266. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.price)) {
  267. this.$api.doRequest('get', '/commonUser/sendVerifyCode', {
  268. phone: this.price
  269. }).then(res => {
  270. if (res.data.code == 200) {
  271. that.sendDisabled = true
  272. let sec = 60
  273. let interval = setInterval(() => {
  274. sec--;
  275. that.sendText = sec + 's后重发'
  276. if (sec <= 0) {
  277. that.sendDisabled = false
  278. that.sendText = "获取验证码"
  279. clearInterval(interval)
  280. }
  281. }, 1000)
  282. } else {
  283. uni.showToast({
  284. title: res.data.message,
  285. icon: 'none',
  286. duration: 2000
  287. })
  288. }
  289. })
  290. .catch(res => {
  291. uni.showToast({
  292. title: res.data.message,
  293. icon: 'none',
  294. duration: 2000
  295. })
  296. });
  297. } else {
  298. uni.showToast({
  299. title: '请输入正确的手机号',
  300. icon: 'none',
  301. duration: 2000
  302. })
  303. }
  304. },
  305. navToDetailPage(item) {
  306. uni.navigateTo({
  307. url: `/pageD/identity/companyIdentityLook?id=${item.id}`
  308. })
  309. },
  310. deleteLS(item) {
  311. uni.showModal({
  312. // title: '登录提示',
  313. content: '身份信息删除后不可恢复,是否确定删除?',
  314. showCancel: true,
  315. confirmText: '确定',
  316. success: (e) => {
  317. this.$api.doRequest('post',
  318. '/identityAuthenticationInfo/api/deleteIdentityAuthenticationInfo', {
  319. id: item.id
  320. }, 'application/json;charset=UTF-8').then(res => {
  321. this.procurementPlanInfos = res.data.data.records
  322. if (res.errmsg == "Success") {
  323. this.$api.msg('删除成功!')
  324. this.getList()
  325. return
  326. }
  327. })
  328. .catch(res => {
  329. uni.showToast({
  330. title: res.errmsg,
  331. icon: 'none',
  332. duration: 2000
  333. })
  334. });
  335. },
  336. fail: () => {},
  337. complete: () => {}
  338. })
  339. },
  340. companyEdit(item) {
  341. uni.navigateTo({
  342. url: `/pageD/identity/companyIdentityEdit?id=${item.id}`
  343. })
  344. },
  345. }
  346. }
  347. </script>
  348. <style>
  349. .center {
  350. padding: 10px 20px;
  351. background-color: #F5F6FA;
  352. }
  353. .title {
  354. font-size: 22px;
  355. font-weight: 900;
  356. /* margin-top: 30px; */
  357. top: 50px;
  358. left: 24px;
  359. position: relative;
  360. }
  361. .company {
  362. font-size: 16px;
  363. font-weight: 600;
  364. margin-top: 10px;
  365. display: inline-block;
  366. margin-left: 10px;
  367. }
  368. .geren {
  369. color: #AFB3BF;
  370. font-size: 14px;
  371. margin-top: -10px;
  372. margin-left: 46px;
  373. }
  374. .infos {
  375. width: 100%;
  376. display: inline-table;
  377. }
  378. .info {
  379. line-height: 20px;
  380. }
  381. .but {
  382. height: 33px;
  383. border: 1px solid #CDCDCD;
  384. border-radius: 20px;
  385. line-height: 30px;
  386. padding: 0 8px;
  387. text-align: center;
  388. margin-left: 20px;
  389. font-size: 14px;
  390. font-weight: 500;
  391. }
  392. .yuan {
  393. margin-top: 6px;
  394. font-size: 14px;
  395. font-weight: 500;
  396. }
  397. .homePage {
  398. width: 101%;
  399. height: 200px;
  400. margin: 20px auto;
  401. }
  402. .logo {
  403. width: 35px;
  404. height: 35px;
  405. background-color: #E9F8F0;
  406. color: #22C572;
  407. text-align: center;
  408. line-height: 35px;
  409. padding: 0 3px;
  410. border-radius: 6px;
  411. display: inline-block;
  412. margin-top: 10px;
  413. }
  414. .forList {
  415. background: #FFFFFF;
  416. margin-top: 10px;
  417. padding: 10px 10px;
  418. border-radius: 16px;
  419. }
  420. .status {
  421. position: absolute;
  422. margin-top: 10px;
  423. right: 36px;
  424. color: #22C572;
  425. }
  426. .status1 {
  427. position: absolute;
  428. margin-top: 10px;
  429. right: 36px;
  430. color: #FE6430;
  431. }
  432. .status2 {
  433. position: absolute;
  434. margin-top: 10px;
  435. right: 36px;
  436. color: #FB1E1E;
  437. }
  438. .status3 {
  439. position: absolute;
  440. margin-top: 10px;
  441. right: 36px;
  442. color: #AFB3BF;
  443. }
  444. .btn {
  445. margin-top: 10px;
  446. background-color: #FFFFFF;
  447. border-radius: 25px;
  448. border: none;
  449. }
  450. .btns {
  451. background-color: #22C572;
  452. }
  453. .shade-content {
  454. background: #fff;
  455. position: absolute;
  456. top: 50%;
  457. left: 50%;
  458. transform: translateX(-50%) translateY(-50%);
  459. z-index: 2;
  460. text-align: center;
  461. border-radius: 20px;
  462. }
  463. .shade-content-item {
  464. width: 277px;
  465. text-align: center;
  466. height: 121px;
  467. padding: 35px 10px;
  468. }
  469. .shade {
  470. position: fixed;
  471. top: 0;
  472. left: 0;
  473. width: 100%;
  474. background: rgba(0, 0, 0, 0.1);
  475. height: 100%;
  476. z-index: 2;
  477. }
  478. .titel {
  479. font-size: 18px;
  480. font-weight: 600;
  481. margin-top: 20px;
  482. }
  483. .determine {
  484. width: 95px;
  485. height: 36px;
  486. background-color: #22C572;
  487. color: #FFFFFF;
  488. border-radius: 10px;
  489. margin: 0 auto;
  490. line-height: 36px;
  491. margin-top: -30px;
  492. margin-bottom: 20px;
  493. }
  494. .tainput {
  495. width: 70%;
  496. padding-left: 10px;
  497. margin: 0 auto;
  498. text-align: left;
  499. border-bottom: 1px solid #AFB3BF;
  500. border-radius: 3px;
  501. }
  502. .tainput1 {
  503. width: 70%;
  504. padding-left: 10px;
  505. margin: 0 auto;
  506. text-align: left;
  507. /* border-bottom: 1px solid #AFB3BF; */
  508. border-radius: 3px;
  509. }
  510. .cancel {
  511. width: 20px;
  512. height: 20px;
  513. font-size: 20px;
  514. color: #AFB3BF;
  515. float: right;
  516. margin-right: 20px;
  517. margin-top: -25px;
  518. }
  519. .btns1 {
  520. width: 50%;
  521. font-size: 18px;
  522. line-height: 50px;
  523. text-align: center;
  524. border-top: 1px solid #EEEEEE;
  525. margin-top: -26px;
  526. }
  527. .btn1 {
  528. border-right: 1px solid #EEEEEE;
  529. color: #AFB3BF;
  530. }
  531. .btn2 {
  532. color: #22C572;
  533. }
  534. .default1 {
  535. width: 16px;
  536. height: 16px;
  537. border: 1px solid #AFB3BF;
  538. border-radius: 8px;
  539. text-align: center;
  540. line-height: 16px;
  541. color: #FFFFFF;
  542. margin-right: 3px;
  543. margin-top: 2px;
  544. }
  545. .default2 {
  546. width: 16px;
  547. height: 16px;
  548. border: 1px solid #AFB3BF;
  549. border-radius: 8px;
  550. text-align: center;
  551. line-height: 16px;
  552. color: #FFFFFF;
  553. margin-right: 3px;
  554. margin-top: 2px;
  555. background-color: #22C572;
  556. }
  557. .options {
  558. justify-content: flex-end;
  559. }
  560. </style>