Commit 46b764c0b840777490d73a1896e788493ebfa52c

Authored by taiyuan
1 parent 303fb7b4

授权登录页增加阅读同意选择项

pages/togoin/togoin.js
... ... @@ -64,6 +64,14 @@ Page({
64 64  
65 65 //-- 会员授权 --
66 66 bindGetUserInfo: function(ee) {
  67 +
  68 + if(!this.data.isAgree) {
  69 + wx.showToast({
  70 + title: '请先勾选同意协议',
  71 + icon: 'none',
  72 + });
  73 + return false;
  74 + }
67 75 var that = this;
68 76 //-- 点击授权 --
69 77 that.getUserProfile(function(res){
... ... @@ -286,7 +294,30 @@ Page({
286 294 close_pop_back:function(){
287 295 this.close_pop();
288 296 wx.navigateBack({ delta: 1})
289   - }
  297 + },
  298 +
  299 +
  300 + // 是否同意协议
  301 + isAgree(e) {
  302 + let isAgree = null;
  303 + if(e.detail.value[0]) {
  304 + isAgree = true;
  305 + } else {
  306 + isAgree = false;
  307 + };
  308 + // this.data.isAgree = isAgree;
  309 + this.setData({
  310 + isAgree,
  311 + });
  312 + },
  313 +
  314 +
  315 + //通过路径跳转到其他页面
  316 + goto: function(e) {
  317 + console.log('xxxx', e);
  318 + var url = e.currentTarget.dataset.url;
  319 + getApp().goto(url);
  320 + },
290 321  
291 322  
292 323  
... ...
pages/togoin/togoin.wxml
... ... @@ -2,7 +2,7 @@
2 2  
3 3 <!-- 登录图 -->
4 4 <view >
5   - <view class="logins flex-center2 ali-c flex" style="position: relative;top: 120rpx;">
  5 + <view class="logins flex-center2 ali-c flex" style="padding-top: 120rpx;">
6 6 <image mode="widthFix" bindtap="go_index" class="login_img_back" src="{{imghots}}/miniapp/images/loginbg.jpg"></image>
7 7 <view class="middle_view">
8 8 <image bindtap="go_index" class="login_img" src="{{store_logo}}" binderror="bind_bnerr" lazy-load="true" data-errorimg="store_logo"></image>
... ... @@ -14,6 +14,13 @@
14 14 <!-- 登录按钮 -->
15 15 <view>
16 16 <view class="phones">
  17 +
  18 + <view bindtap="" class="user-name flex-vertical fs24 jc-center">
  19 + <checkbox-group bindchange="isAgree">
  20 + <checkbox value="true"/>
  21 + </checkbox-group>
  22 + <view class="user-name-txt">我已阅读同意 <text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=0">《用户使用协议》</text>与<text class="red" bindtap="goto" data-url="/packageA/pages/parseHtml/parseHtml?t=1">《隐私政策》</text></view>
  23 + </view>
17 24  
18 25 <!-- 授权获取基础信息 -->
19 26 <block wx:if="{{canIUseGetUserProfile}}">
... ...
pages/togoin/togoin.wxss
... ... @@ -4,7 +4,7 @@ page{
4 4 }
5 5 .logins {
6 6 width: 100%;
7   - padding-bottom: 130rpx;
  7 + /* padding-bottom: 130rpx; */
8 8 background-position: center;
9 9 background-repeat: no-repeat;
10 10 background-size: cover
... ... @@ -26,7 +26,7 @@ page{
26 26 border-radius: 48rpx;
27 27 color: rgb(255,255,255);
28 28 font-size: 32rpx;
29   - margin-top:150rpx;
  29 + margin-top: 40rpx;
30 30 }
31 31 .we_chat{
32 32 width: 55rpx;
... ... @@ -65,3 +65,9 @@ button{
65 65 .middle_view{
66 66 position: absolute; left: 0; width: 100%; text-align: center;
67 67 }
  68 +
  69 +/*checkbox 选项框大小 */
  70 +checkbox .wx-checkbox-input {
  71 + width: 30rpx;
  72 + height: 30rpx;
  73 +}
... ...