wufa.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="index" :style="'padding-top:'+padtop+'px'">
  3. <!-- 头部 -->
  4. <navbar :back="false" title="扫码登录" :bgcolor="backgroundColor" color="#fff" fixed zIndex="1010" :center="true"
  5. :custom='true' @getTop="getTop" back="true" />
  6. <view class="header">
  7. <img :src="subimg" alt="" class="img">
  8. <span class="sapn">扫码成功</span>
  9. <view class="sub_txt">请确认授权登录</view>
  10. </view>
  11. <view class="naver" @click="smit">
  12. 授权登录
  13. </view>
  14. </view>
  15. </template>
  16. <script>
  17. import url from "@/util/url";
  18. let {
  19. host
  20. } = url
  21. export default {
  22. data() {
  23. return {
  24. type: 0, //判断是否是登录页面跳转的
  25. telephone: '',
  26. subimg: require("@/static/images/submit.png"),
  27. padtop: this.$http._GET.customBarH || 0,
  28. backgroundColor: 'linear-gradient(90deg, #A00517, #E93030)',
  29. };
  30. },
  31. onLoad(e) {
  32. console.log(e)
  33. this.type = e.code
  34. // this.telephone = 15855353281
  35. this.telephone = uni.getStorageSync('phone')
  36. },
  37. onUnload() {
  38. uni.switchTab({
  39. url: '/pages/tab/about_we',
  40. })
  41. },
  42. methods: {
  43. getTop(e) {
  44. this.padtop = e
  45. },
  46. smit() {
  47. var _this = this
  48. let object = {
  49. "uuid": _this.type,
  50. "phone": _this.telephone,
  51. // cardType:'ID_CARD',
  52. };
  53. uni.request({
  54. url: host + '/scanCode/phoneScanLogin',
  55. method: 'POST',
  56. data: JSON.stringify(object),
  57. header: {
  58. 'Content-Type': 'application/json',
  59. },
  60. success: function(res) {
  61. console.log(res)
  62. if (res.data.code == "200") {
  63. uni.showToast({
  64. title: '登录成功',
  65. duration: 1000,
  66. icon: 'none'
  67. });
  68. setTimeout(() => {
  69. uni.navigateBack({
  70. delta: 2
  71. })
  72. }, 1000)
  73. } else {
  74. uni.showToast({
  75. title: res.msg,
  76. duration: 1000,
  77. icon: 'none'
  78. });
  79. }
  80. },
  81. fail: function(error) {
  82. uni.showToast({
  83. title: error.msg,
  84. duration: 1000,
  85. icon: 'none'
  86. });
  87. }
  88. })
  89. // console.log(object)
  90. // this.$http.post("scanCode/phoneScanLogin",JSON.stringify(object),true).then(res => {
  91. // console.log(res)
  92. // if(res.code=="200"){
  93. // uni.showToast({
  94. // title: '登录成功',
  95. // duration: 1000,
  96. // icon: 'none'
  97. // });
  98. // setTimeout(() => {
  99. // uni.navigateBack({
  100. // delta:2
  101. // })
  102. // },1000)
  103. // }else {
  104. // uni.showToast({
  105. // title: res.msg,
  106. // duration: 1000,
  107. // icon: 'none'
  108. // });
  109. // }
  110. // })
  111. }
  112. }
  113. }
  114. </script>
  115. <style lang="scss">
  116. .index {
  117. height: 100vh;
  118. // background-color: #dbebf8;
  119. .header {
  120. display: flex;
  121. flex-direction: column;
  122. align-items: center;
  123. padding-top: 132upx;
  124. box-sizing: border-box;
  125. .img {
  126. width: 238rpx;
  127. height: 256rpx;
  128. display: block;
  129. margin: 0 auto 56rpx;
  130. // width: 400upx;
  131. }
  132. span {
  133. font-size: 35upx;
  134. color: #666;
  135. width: 414upx;
  136. text-align: center;
  137. line-height: 50upx;
  138. }
  139. .sapn {
  140. font-size: 42upx;
  141. color: #333;
  142. // width: 414upx;
  143. font-weight: 700;
  144. text-align: center;
  145. line-height: 50upx;
  146. margin-bottom: 15upx;
  147. }
  148. .sapnteo {
  149. font-size: 28upx;
  150. color: #666;
  151. // width: 414upx;
  152. // font-weight: 700;
  153. text-align: center;
  154. line-height: 50upx;
  155. }
  156. }
  157. }
  158. .sub_txt {
  159. font-size: 26rpx;
  160. color: #666666;
  161. text-align: center;
  162. width: 260rpx;
  163. margin: 0 auto 90rpx;
  164. }
  165. .naver {
  166. width: 416rpx;
  167. height: 84rpx;
  168. width: 208px;
  169. height: 42px;
  170. background: linear-gradient(90deg, #A00517, #E93030);
  171. border-radius: 21px;
  172. display: flex;
  173. align-items: center;
  174. justify-content: center;
  175. font-size: 30rpx;
  176. color: #ffffff;
  177. margin: 0 auto 0;
  178. }
  179. </style>