indexTwo.vue 13 KB

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