indexTwo.vue 13 KB

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