authrz.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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="cardzmt" 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="cardfmt" 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. cardzmt: '',
  48. cardfm: '',
  49. cardfmt: '',
  50. }
  51. },
  52. onLoad() {
  53. },
  54. onShow() {
  55. },
  56. onReachBottom() {
  57. },
  58. onReady() {
  59. },
  60. methods: {
  61. upcardzm() {
  62. upload({
  63. filename: ''
  64. }).then(data => {
  65. console.log('data', data);
  66. this.cardzm = data[0].img;
  67. this.cardzmt = data[0].src;
  68. });
  69. },
  70. upcardfm() {
  71. upload({
  72. filename: ''
  73. }).then(data => {
  74. console.log('data', data);
  75. this.cardfm = data[0].img;
  76. this.cardfmt = data[0].src;
  77. });
  78. },
  79. upauthrz() {
  80. let obj = this
  81. if(obj.cardzm == '') {
  82. return obj.$api.msg('請上傳身份證正面')
  83. }
  84. if(obj.cardfm == '') {
  85. return obj.$api.msg('請上傳身份證反面')
  86. }
  87. upauthrz({
  88. cardzm: obj.cardzm,
  89. cardfm: obj.cardfm
  90. }).then(res => {
  91. uni.showToast({
  92. title: '提交成功',
  93. duration: 2000,
  94. position: 'top'
  95. });
  96. })
  97. }
  98. }
  99. }
  100. </script>
  101. <style lang="scss">
  102. .up-wrap {
  103. width: 720rpx;
  104. height: 860rpx;
  105. border-radius: 20rpx;
  106. background-color: #fff;
  107. margin: 30rpx auto;
  108. padding: 20rpx;
  109. font-size: 32rpx;
  110. .up-tit {
  111. height: 80rpx;
  112. line-height: 80rpx;
  113. }
  114. .up-img {
  115. height: 240rpx;
  116. margin-top: 20rpx ;
  117. image {
  118. height: 200rpx;
  119. display: block;
  120. margin: auto;
  121. }
  122. }
  123. .up-btn {
  124. margin: 20rpx auto 0;
  125. width: 680rpx;
  126. height: 80rpx;
  127. line-height: 80rpx;
  128. text-align: center;
  129. color: #000;
  130. font-size: 28rpx;
  131. background:linear-gradient(to left,#eeb80d,#ffe35b);
  132. border-radius: 20rpx;
  133. }
  134. }
  135. </style>