phonebtn.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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. }
  37. },
  38. methods:{
  39. getClose(){
  40. this.$emit("getClose")
  41. },
  42. btns(){
  43. },
  44. async getPhoneNumber(e){
  45. const {iv,encryptedData} = e.detail;
  46. var that=this;
  47. uni.login({
  48. provider: 'weixin',
  49. success: (res) => {
  50. // 获取用户信息
  51. if(res.code) {
  52. var params={
  53. iv: iv,
  54. encryptedData: encryptedData,
  55. code : res.code,
  56. }
  57. // 登录还是注册
  58. that.$emit("getPhoneNumber",params)
  59. }
  60. }
  61. })
  62. },
  63. },
  64. onLoad: function() {
  65. }
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .box_hei{
  70. width: 100%;
  71. height: 100%;
  72. background: rgba(0,0,0,.8);
  73. position: fixed;
  74. top: 0;
  75. left: 0;
  76. z-index: 3;
  77. .hei_box{
  78. background: #fff;
  79. border-radius:22upx 22upx 0 0;
  80. height: 440upx;
  81. padding: 52upx 28upx 104upx;
  82. position: absolute;
  83. bottom:0;
  84. width: 100%;
  85. box-sizing: border-box;
  86. .box_top{
  87. padding: 0 18upx 62upx;
  88. .box_title{
  89. display: flex;
  90. justify-content: space-between;
  91. font-size: 30upx;
  92. margin-bottom: 30upx;
  93. view{
  94. display: flex;
  95. align-items: center;
  96. color: #333333;
  97. }
  98. .img{
  99. margin-right: 14upx;
  100. width: 180upx;
  101. height: 48upx;
  102. }
  103. .imgs{
  104. width: 40upx;
  105. height: 40upx;
  106. }
  107. }
  108. .box_nameq{
  109. color: #333333;
  110. font-size: 44upx;
  111. font-weight: bold;
  112. }
  113. }
  114. .box_phone{
  115. height: 106upx;
  116. display: flex;
  117. align-items: center;
  118. justify-content: space-between;
  119. font-size: 28upx;
  120. color: #A6A6A6;
  121. border-bottom: 1upx solid #EBEBEB;
  122. border-top: 1upx solid #EBEBEB;
  123. view{
  124. display: flex;
  125. align-items: center;
  126. }
  127. .img{
  128. width: 26upx;
  129. height: 22upx;
  130. }
  131. span{
  132. color: #333333;
  133. font-size: 32upx;
  134. padding-right: 18upx;
  135. font-weight: bold;
  136. }
  137. }
  138. .box_qita{
  139. height: 106upx;
  140. font-size: 28upx;
  141. color: #7CA4FC;
  142. line-height: 106upx;
  143. }
  144. .boxs{
  145. height: 50upx;
  146. }
  147. .box_btns{
  148. margin-top: 10upx;
  149. display: flex;
  150. justify-content: space-between;
  151. .box_btn{
  152. width: 324upx;
  153. height: 82upx;
  154. font-size: 32upx;
  155. display: flex;
  156. align-items: center;
  157. justify-content: center;
  158. border-radius: 4upx;
  159. }
  160. .box_btn1{
  161. background: #F3F3F3;
  162. color: #33B925;
  163. }
  164. .box_btn2{
  165. background: #37962B;
  166. color: #FFFFFF;
  167. }
  168. }
  169. }
  170. }
  171. </style>