index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <view>
  3. <view class="transparentDom" v-if="clickDom" @tap="onSoHAuth"></view>
  4. <view class='authContainer' v-else>
  5. <view class='no-authorize'>
  6. <view class='closeIconBtn' @tap='onSoHAuth'>×</view>
  7. <view class='shopInfoBox'>
  8. <view class='imgPic'><image class='img' mode='widthFix' :src='shopInfo.shop_image || "/static/logo.jpg"'></image></view>
  9. <view class='stitle'>{{isGetTel ? '欢迎来到 - '+shopInfo.shop_name:'您还未登录'}}</view>
  10. </view>
  11. <view class='no-authorize_title'>为提更供优质的服务,需要获取以下信息</view>
  12. <view class='no-authorize_text'>
  13. <text>·</text> {{isGetTel ? '获得你微信绑定的手机号码':'获得你的公开信息 (昵称、头像、地区及性别)'}}
  14. </view>
  15. <div class="checkbox-box flex_r flex_ac" v-if='!isGetTel'>
  16. <checkbox-group @change="checkboxChange" class="flex_r flex_ac">
  17. <label class="checkbox flex_r flex_ac">
  18. <checkbox class='checkboxCom' value="agree" checked />
  19. <view>我同意</view>
  20. </label>
  21. <span @click="goto('/pages/agreement/index',{tit:'隐私协议',type:26})" class="hover_a">《用户服务协议》</span>
  22. <text>和</text>
  23. <span @click="goto('/pages/agreement/index',{tit:'隐私协议',type:27})" class="hover_a">《隐私协议》</span>
  24. </checkbox-group>
  25. </div>
  26. <view class="btnBar flex_r flex_ac flex_jb">
  27. <button class='no-authorize_btn unSetBtn' @tap="onSoHAuth">{{isGetTel ? "暂不授权" : "暂不登录"}}</button>
  28. <button open-type="getPhoneNumber" class='no-authorize_btn' @getphonenumber="onGotPhoneNumber" lang="zh_CN">立即登录</button>
  29. <!-- <button open-type="getUserInfo" class='no-authorize_btn' @getuserinfo="onGotUserInfo" lang="zh_CN" v-else>获取用户信息</button> -->
  30. <!-- <button open-type="getUserInfo" class='no-authorize_btn' @tap="onGotUserInfo" lang="zh_CN">立即登录</button> -->
  31. <!-- <button @tap="getUserProfile" v-else> 获取头像昵称 </button> -->
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. var app = getApp();
  39. //#ifdef MP
  40. var appEv = app.$vm.$options;
  41. //#endif
  42. //#ifdef H5
  43. var appEv = app.$options;
  44. //#endif
  45. export default {
  46. props:{
  47. shopInfo:{
  48. type: Object
  49. },
  50. isGetTel: {
  51. type: Boolean,
  52. observer: function (res) {
  53. if(res){
  54. // this.clickDom = false
  55. }
  56. }
  57. },
  58. },
  59. data() {
  60. return{
  61. isDisabled: false,
  62. clickDom: true
  63. }
  64. },
  65. methods:{
  66. onSoHAuth(){
  67. this.clickDom = !this.clickDom
  68. },
  69. closeAuthCom(){
  70. this.$emit('closeAuthCom');
  71. },
  72. onGotUserInfo (e) {
  73. this.$emit('authSuccess');
  74. },
  75. onGotPhoneNumber(e){
  76. this.$emit('authGetTelSuccess', e);
  77. },
  78. checkboxChange(e) {
  79. var value = e.detail.value;
  80. this.isDisabled = value.length == 0
  81. },
  82. }
  83. }
  84. </script>
  85. <style lang="scss">
  86. .transparentDom,
  87. .authContainer{
  88. position: fixed;
  89. top: 0;
  90. left: 0;
  91. right: 0;
  92. bottom: 0;
  93. width: 100%;
  94. height: 100%;
  95. margin: 0;
  96. padding: 0;
  97. z-index: 1999999999999999999;
  98. }
  99. .authContainer{
  100. background-color: rgba(0,0,0,0.4);
  101. display: flex;
  102. display: -webkit-flex;
  103. align-items: center;
  104. }
  105. .no-authorize{
  106. background-color: #fff;
  107. padding: 0 32rpx 60rpx;
  108. width: 84%;
  109. position: absolute;
  110. left: 8%;
  111. right: 8%;
  112. box-sizing: border-box;
  113. border-radius: 20rpx;
  114. }
  115. .closeIconBtn{
  116. position: absolute;
  117. top: 24rpx;
  118. right: 24rpx;
  119. border: 1px solid #808080;
  120. color: #303030;
  121. font-size: 18px;
  122. height: 44rpx;
  123. width: 44rpx;
  124. text-align: center;
  125. border-radius: 50%;
  126. line-height: 40rpx;
  127. font-weight: 600;
  128. }
  129. .shopInfoBox{
  130. width: 100%;
  131. padding: 96rpx 20rpx 60rpx;
  132. display: flex;
  133. display: -webkit-flex;
  134. align-items: center;
  135. box-sizing: border-box;
  136. }
  137. .shopInfoBox .imgPic{
  138. width: 144rpx;
  139. height: 144rpx;
  140. /* margin-right: 30rpx; */
  141. box-shadow: 0rpx 4rpx 16rpx rgba(68,169,47,0.2);
  142. border-radius: 50%;
  143. overflow: hidden;
  144. flex-grow: 1;
  145. display: flex;
  146. display: -webkit-flex;
  147. align-items: center;
  148. position: absolute;
  149. left: 50%;
  150. top: -72rpx;
  151. margin-left: -72rpx;
  152. background-color: #fff;
  153. }
  154. .shopInfoBox .imgPic .img{
  155. display: block;
  156. width: 144rpx;
  157. height: 144rpx;
  158. }
  159. .shopInfoBox .stitle{
  160. font-size: 40rpx;
  161. font-weight: 500;
  162. color: #121212;
  163. flex-grow: 0;
  164. /* width: calc(100% - 110rpx); */
  165. width: 100%;
  166. text-align: center;
  167. }
  168. .no-authorize_title{
  169. font-size: 30rpx;
  170. font-weight: 500;
  171. color: #121212;
  172. line-height: 1.5;
  173. padding-bottom: 12rpx;
  174. text-align: center;
  175. }
  176. .no-authorize_text{
  177. font-size: 24rpx;
  178. color: #999;
  179. line-height: 1.6;
  180. text-align: center;
  181. }
  182. .btnBar{
  183. margin-top: 70rpx;
  184. overflow: hidden;
  185. }
  186. .no-authorize_btn{
  187. background: #44a92f;
  188. color: #fff;
  189. font-size: 30rpx;
  190. min-width: calc(50% - 12rpx);
  191. box-sizing: border-box;
  192. margin: unset;
  193. border-radius: 60rpx;
  194. border: 2rpx solid #44a92f;
  195. }
  196. .isDisabledBtn{
  197. border-color: #ccc;
  198. color: #aaa;
  199. background: #eee;
  200. }
  201. .unSetBtn{
  202. background: #fff;
  203. color: #44a92f;
  204. }
  205. .no-authorize_btn::after{
  206. border: none;
  207. }
  208. .checkbox-box{
  209. margin-top: 60rpx;
  210. margin-bottom: -20px;
  211. font-size: 28rpx;
  212. }
  213. .checkbox-box text{
  214. /* color: #07d; */
  215. /* color: #44A92F; */
  216. color: #44a92f;
  217. }
  218. .checkbox-box .checkbox .checkboxCom{
  219. transform: scale(0.84);
  220. -webkit-transform: scale(0.84);
  221. }
  222. </style>