authrz.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="content">
  3. <view class="">
  4. <view class="" style="padding: 50rpx 30rpx;font-size: 50rpx;">
  5. 實名認證
  6. </view>
  7. <view class=""
  8. style="width: 720rpx;height: 80rpx;background-color: #fff;margin: auto;line-height: 80rpx;padding:0 10rpx;border-radius: 20rpx;font-size: 26rpx;">
  9. 完成實名認證後能夠獲得相應的權益
  10. </view>
  11. <view class=""
  12. style="width: 720rpx;height: 80rpx;background-color: #fff;margin: auto;line-height: 80rpx;padding:0 10rpx;border-radius: 20rpx;font-size: 26rpx;">
  13. 高級實名
  14. </view>
  15. </view>
  16. <view class="up-wrap">
  17. <view class="up-tit">
  18. 上傳身份證正面
  19. </view>
  20. <view class="up-img" @click="upcardzm()">
  21. <image :src="cardzm" mode="heightFix" v-if="cardzm"></image>
  22. <image src="../../static/img/flower.png" mode="heightFix" v-else></image>
  23. </view>
  24. <view class="up-tit">
  25. 上傳身份證背面
  26. </view>
  27. <view class="up-img" @click="upcardfm()">
  28. <image :src="cardfm" mode="heightFix" v-if="cardfm"></image>
  29. <image src="../../static/img/flower.png" mode="heightFix" v-else></image>
  30. </view>
  31. <view class="up-btn" @click="upauthrz()">
  32. 高級提交
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. import {
  39. upauthrz,
  40. upimg
  41. } from '@/api/login.js'
  42. import { upload } from '@/api/wallet.js'
  43. export default {
  44. data() {
  45. return {
  46. cardzm: '',
  47. cardfm: ''
  48. }
  49. },
  50. onLoad() {
  51. },
  52. onShow() {
  53. },
  54. onReachBottom() {
  55. },
  56. onReady() {
  57. },
  58. methods: {
  59. upcardzm() {
  60. upload({
  61. filename: ''
  62. }).then(data => {
  63. console.log('data', data);
  64. this.cardzm = data[0].src;
  65. });
  66. },
  67. upcardfm() {
  68. upload({
  69. filename: ''
  70. }).then(data => {
  71. console.log('data', data);
  72. this.cardfm = data[0].src;
  73. });
  74. },
  75. upauthrz() {
  76. let obj = this
  77. if(obj.cardzm == '') {
  78. return obj.$api.msg('請上傳身份證正面')
  79. }
  80. if(obj.cardfm == '') {
  81. return obj.$api.msg('請上傳身份證反面')
  82. }
  83. upauthrz({
  84. cardzm: obj.cardzm,
  85. cardfm: obj.cardfm
  86. }).then(res => {
  87. uni.showToast({
  88. title: '提交成功',
  89. duration: 2000,
  90. position: 'top'
  91. });
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss">
  98. .up-wrap {
  99. width: 720rpx;
  100. height: 860rpx;
  101. border-radius: 20rpx;
  102. background-color: #fff;
  103. margin: 30rpx auto;
  104. padding: 20rpx;
  105. font-size: 32rpx;
  106. .up-tit {
  107. height: 80rpx;
  108. line-height: 80rpx;
  109. }
  110. .up-img {
  111. height: 240rpx;
  112. margin-top: 20rpx ;
  113. image {
  114. height: 200rpx;
  115. display: block;
  116. margin: auto;
  117. }
  118. }
  119. .up-btn {
  120. margin: 20rpx auto 0;
  121. width: 680rpx;
  122. height: 80rpx;
  123. line-height: 80rpx;
  124. text-align: center;
  125. color: #000;
  126. font-size: 28rpx;
  127. background:linear-gradient(to left,#eeb80d,#ffe35b);
  128. border-radius: 20rpx;
  129. }
  130. }
  131. </style>