phonebtn.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view>
  3. <view class="box_hei" @click="getClose" v-if="type">
  4. <view @click.stop="btns" class="hei_box">
  5. <view class="box_top">
  6. <view class="box_title">
  7. <view>
  8. 智能校管家 申请使用
  9. </view>
  10. </view>
  11. <view class="box_nameq">你的手机号码</view>
  12. </view>
  13. <!-- <view class="boxs"></view> -->
  14. <view class="box_btns">
  15. <view @click="getClose" class="box_btn box_btn1">拒绝</view>
  16. <button class="box_btn box_btn2" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">允许</button>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. // import tabSearch from "@/components/toptab/search.vue"
  24. import {getweChatOpenid} from "@/api/login.js"
  25. export default {
  26. props:{
  27. type:{
  28. type:Boolean,
  29. default () {
  30. return true
  31. }
  32. },
  33. },
  34. data(){
  35. return{
  36. sucimg:require("@/static/images/mine/success.png")
  37. }
  38. },
  39. methods:{
  40. getClose(){
  41. this.$emit("getClose")
  42. },
  43. btns(){
  44. },
  45. async getPhoneNumber(e){
  46. const {iv,encryptedData} = e.detail;
  47. var that=this;
  48. uni.login({
  49. provider: 'weixin',
  50. success: (res) => {
  51. // 获取用户信息
  52. if(res.code) {
  53. var params={
  54. iv: iv,
  55. encryptedData: encryptedData,
  56. code : res.code,
  57. }
  58. // 登录还是注册
  59. that.$emit("getPhoneNumber",params)
  60. }
  61. }
  62. })
  63. },
  64. },
  65. onLoad: function() {
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. .box_hei{
  71. width: 100%;
  72. height: 100%;
  73. background: rgba(0,0,0,.8);
  74. position: fixed;
  75. top: 0;
  76. left: 0;
  77. z-index: 3;
  78. .hei_box{
  79. background: #fff;
  80. border-radius:22upx 22upx 0 0;
  81. height: 440upx;
  82. padding: 52upx 28upx 104upx;
  83. position: absolute;
  84. bottom:0;
  85. width: 100%;
  86. box-sizing: border-box;
  87. .box_top{
  88. padding: 0 18upx 62upx;
  89. .box_title{
  90. display: flex;
  91. justify-content: space-between;
  92. font-size: 30upx;
  93. margin-bottom: 30upx;
  94. view{
  95. display: flex;
  96. align-items: center;
  97. color: #333333;
  98. }
  99. .img{
  100. margin-right: 14upx;
  101. width: 180upx;
  102. height: 48upx;
  103. }
  104. .imgs{
  105. width: 40upx;
  106. height: 40upx;
  107. }
  108. }
  109. .box_nameq{
  110. color: #333333;
  111. font-size: 44upx;
  112. font-weight: bold;
  113. }
  114. }
  115. .box_phone{
  116. height: 106upx;
  117. display: flex;
  118. align-items: center;
  119. justify-content: space-between;
  120. font-size: 28upx;
  121. color: #A6A6A6;
  122. border-bottom: 1upx solid #EBEBEB;
  123. border-top: 1upx solid #EBEBEB;
  124. view{
  125. display: flex;
  126. align-items: center;
  127. }
  128. .img{
  129. width: 26upx;
  130. height: 22upx;
  131. }
  132. span{
  133. color: #333333;
  134. font-size: 32upx;
  135. padding-right: 18upx;
  136. font-weight: bold;
  137. }
  138. }
  139. .box_qita{
  140. height: 106upx;
  141. font-size: 28upx;
  142. color: #7CA4FC;
  143. line-height: 106upx;
  144. }
  145. .boxs{
  146. height: 50upx;
  147. }
  148. .box_btns{
  149. margin-top: 10upx;
  150. display: flex;
  151. justify-content: space-between;
  152. .box_btn{
  153. width: 324upx;
  154. height: 82upx;
  155. font-size: 32upx;
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. border-radius: 4upx;
  160. }
  161. .box_btn1{
  162. background: #F3F3F3;
  163. color: #33B925;
  164. }
  165. .box_btn2{
  166. background: #37962B;
  167. color: #FFFFFF;
  168. }
  169. }
  170. }
  171. }
  172. </style>