indexTwo.vue 11 KB

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