indexTwo.vue 11 KB

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