@@ -0,0 +1,82 @@ | |||||
// components/userNumberSync.ts | |||||
import request from '../utils/request' | |||||
Component({ | |||||
/** | |||||
* 组件的属性列表 | |||||
*/ | |||||
properties: { | |||||
show: { | |||||
type: Boolean, | |||||
value: false | |||||
}, | |||||
}, | |||||
/** | |||||
* 组件的初始数据 | |||||
*/ | |||||
data: { | |||||
isNotRead: true | |||||
}, | |||||
/** | |||||
* 组件的方法列表 | |||||
*/ | |||||
methods: { | |||||
closeBox(e) { | |||||
const id = e.target.id | |||||
if (id == 'componentBG') { | |||||
this.setData({ | |||||
show: false | |||||
}) | |||||
} | |||||
}, | |||||
getphonenumber(e) { | |||||
const sessionKey = wx.getStorageSync('sessionKey') | |||||
this.doGetUserPhone(e.detail.encryptedData, e.detail.iv, sessionKey, request.appId) | |||||
}, | |||||
/** 获取手机号授权 */ | |||||
doGetUserPhone(encryptedData, iv, sessionKey, appId) { | |||||
request.post({ | |||||
url: '/api/user/getUserPhone', | |||||
data: { | |||||
encryptedData, | |||||
iv, | |||||
sessionKey, | |||||
appId | |||||
} | |||||
}).then(res => { | |||||
console.log(res, 'getUserPhone'); | |||||
wx.showToast({ | |||||
title: '登录成功!', | |||||
icon: 'success' | |||||
}) | |||||
this.setData({ | |||||
show: false | |||||
}) | |||||
}).catch(err => { | |||||
console.log(err, 'err'); | |||||
}) | |||||
}, | |||||
agreedClick() { | |||||
this.setData({ | |||||
isNotRead: !this.data.isNotRead | |||||
}) | |||||
}, | |||||
// 跳转至用户协议页面 | |||||
checkUserProtocol() { | |||||
wx.navigateTo({ | |||||
url: '/pages/userProtocol/userProtocol', | |||||
}) | |||||
}, | |||||
skip() { | |||||
this.setData({ | |||||
show: false | |||||
}) | |||||
} | |||||
} | |||||
}) |
@@ -0,0 +1,3 @@ | |||||
{ | |||||
"component": true | |||||
} |
@@ -0,0 +1,104 @@ | |||||
/* components/userNumberSync.wxss */ | |||||
.component { | |||||
position: fixed; | |||||
top: 0; | |||||
left: 0; | |||||
width: 100%; | |||||
height: 100%; | |||||
transition: all 0.3s; | |||||
z-index: -100; | |||||
&.active { | |||||
background-color: #000000a2; | |||||
z-index: 999; | |||||
} | |||||
.checkBox { | |||||
position: fixed; | |||||
bottom: -800rpx; | |||||
width: 100%; | |||||
height: 0rpx; | |||||
background-color: #ffffff; | |||||
border-radius: 5% 5% 0 0; | |||||
transition: all 0.3s; | |||||
z-index: -100; | |||||
&.active { | |||||
bottom: 0; | |||||
height: 55%; | |||||
z-index: 999; | |||||
} | |||||
.logo { | |||||
width: 200rpx; | |||||
height: 200rpx; | |||||
margin: 50rpx auto; | |||||
margin-bottom: 90rpx; | |||||
image { | |||||
width: 100%; | |||||
} | |||||
.title { | |||||
text-align: center; | |||||
font-weight: 600; | |||||
font-size: 50rpx; | |||||
color: #4b4b4b; | |||||
} | |||||
} | |||||
.memberNotice { | |||||
text-align: center; | |||||
font-weight: 200; | |||||
} | |||||
.getPhoneNumber { | |||||
width: 70%; | |||||
border-radius: 20rpx; | |||||
margin-top: 50rpx; | |||||
} | |||||
.skip { | |||||
text-align: center; | |||||
margin: 40rpx 0; | |||||
} | |||||
.userProtocolModel { | |||||
text-align: center; | |||||
margin-bottom: 30rpx; | |||||
.textInside { | |||||
position: relative; | |||||
.agreeButton { | |||||
position: absolute; | |||||
left: 80rpx; | |||||
width: 35rpx; | |||||
height: 35rpx; | |||||
line-height: 35rpx; | |||||
border: 1px solid #464646; | |||||
border-radius: 50% 50%; | |||||
color: #ffffff; | |||||
text-align: center; | |||||
image { | |||||
width: 100%; | |||||
height: 100%; | |||||
} | |||||
&.active { | |||||
border: 0px solid #464646; | |||||
} | |||||
} | |||||
.userProtocol { | |||||
text-align: center; | |||||
color: #929292; | |||||
text-decoration: underline; | |||||
margin-bottom: 15rpx; | |||||
} | |||||
} | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,25 @@ | |||||
<!--components/userNumberSync.wxml--> | |||||
<view class="{{show ? 'component active' : 'component'}}" bindtap="closeBox" id="componentBG"> | |||||
<view class="{{show ? 'checkBox active' : 'checkBox'}}"> | |||||
<view class="logo"> | |||||
<image src="../asset/icon/tiny-Chat-rotate.png" mode="widthFix" /> | |||||
<view class="title">小闲聊</view> | |||||
</view> | |||||
<view class="memberNotice">成为小闲聊会员,享受更多权益</view> | |||||
<button open-type="getPhoneNumber" class="getPhoneNumber" type="primary" bindgetphonenumber="getphonenumber" disabled="{{isNotRead}}">微信一键登录</button> | |||||
<view class="skip" bindtap="skip">暂时跳过</view> | |||||
<view class="userProtocolModel"> | |||||
<view class="textInside"> | |||||
<view class="{{isNotRead ? 'agreeButton' : 'agreeButton active'}}" bindtap="agreedClick"> | |||||
<image wx:if="{{!isNotRead}}" src="../asset/icon/success.png" mode="" /> | |||||
</view> | |||||
<text>我已阅读并同意</text> | |||||
<text class="userProtocol" bindtap="checkUserProtocol">《用户协议及隐私政策》</text> | |||||
</view> | |||||
</view> | |||||
</view> | |||||
</view> |
@@ -1,23 +0,0 @@ | |||||
// components/userNumberSync.ts | |||||
Component({ | |||||
/** | |||||
* 组件的属性列表 | |||||
*/ | |||||
properties: { | |||||
}, | |||||
/** | |||||
* 组件的初始数据 | |||||
*/ | |||||
data: { | |||||
}, | |||||
/** | |||||
* 组件的方法列表 | |||||
*/ | |||||
methods: { | |||||
} | |||||
}) |
@@ -1,4 +0,0 @@ | |||||
{ | |||||
"component": true, | |||||
"usingComponents": {} | |||||
} |
@@ -1 +0,0 @@ | |||||
/* components/userNumberSync.wxss */ |
@@ -1,2 +0,0 @@ | |||||
<!--components/userNumberSync.wxml--> | |||||
<text>components/userNumberSync.wxml</text> |
@@ -12,7 +12,8 @@ Page({ | |||||
orderList: [], | orderList: [], | ||||
imgUrl: 'https://formall.oss-accelerate.aliyuncs.com/ga/payOrder-1.png', | imgUrl: 'https://formall.oss-accelerate.aliyuncs.com/ga/payOrder-1.png', | ||||
currentIndex: null, | currentIndex: null, | ||||
currentId: '' | |||||
currentId: '', | |||||
isShowNumberCheck: false | |||||
}, | }, | ||||
/** | /** | ||||
@@ -84,6 +85,9 @@ Page({ | |||||
}, | }, | ||||
createPayOrder() { | createPayOrder() { | ||||
// this.setData({ | |||||
// isShowNumberCheck: true | |||||
// }) | |||||
const data = { | const data = { | ||||
appId: request.appId | appId: request.appId | ||||
} | } | ||||
@@ -1,5 +1,7 @@ | |||||
{ | { | ||||
"navigationBarTitleText": "延续会员", | "navigationBarTitleText": "延续会员", | ||||
"navigationBarBackgroundColor": "#ededed", | "navigationBarBackgroundColor": "#ededed", | ||||
"usingComponents": {} | |||||
"usingComponents": { | |||||
"userNumberChkeck": "../../components/userNumberChkeck" | |||||
} | |||||
} | } |
@@ -144,7 +144,7 @@ page { | |||||
} | } | ||||
.salePrice { | .salePrice { | ||||
font-size: 28rpx; | |||||
font-size: 25rpx; | |||||
margin-bottom: 10rpx; | margin-bottom: 10rpx; | ||||
.lightHigh { | .lightHigh { | ||||
@@ -36,4 +36,6 @@ | |||||
<button class="btn" type="primary" bindtap="createPayOrder">立即购买</button> | <button class="btn" type="primary" bindtap="createPayOrder">立即购买</button> | ||||
</view> | </view> | ||||
</view> | |||||
</view> | |||||
<userNumberChkeck show="{{isShowNumberCheck}}"></userNumberChkeck> |
@@ -36,7 +36,7 @@ | |||||
"miniprogram/pages/orderDetail/orderDetail.js", | "miniprogram/pages/orderDetail/orderDetail.js", | ||||
"miniprogram/pages/userProtocol/userProtocol.js", | "miniprogram/pages/userProtocol/userProtocol.js", | ||||
"miniprogram/pages/mine/mine.js", | "miniprogram/pages/mine/mine.js", | ||||
"miniprogram/components/userNumberSync.js", | |||||
"miniprogram/components/userNumberChkeck.js", | |||||
], | ], | ||||
"exclude": [ | "exclude": [ | ||||
"node_modules" | "node_modules" | ||||