Commit aa8b5ec0 by 高淑倩

生日日期不能选择之后

parent bd1c1c3e
......@@ -11,7 +11,7 @@ wxService.page({
* 页面的初始数据
*/
data: {
endTime: '', // 2017-09-01
date: '',
focus: false,
memberCardNo: '',
......@@ -33,7 +33,6 @@ wxService.page({
}
],
index: 0,
date: '',
},
bindPickerChange(e) {
this.setData({
......@@ -45,29 +44,64 @@ wxService.page({
*/
onLoad(options) {
wx.hideShareMenu();
console.log('onload')
const { memberCardNo, memberId } = wx.getStorageSync('_baseUserInfo')
// if(memberCardNo){
// }
},
//微信支付
onTapWxPay() {
//调用接口回调拼接数据 TODO
this.getPayCodeParam();
},
//获取小程序支付码配置参数
getPayCodeParam() {
wxService.get(`/platform/brand/openOfflinePayView`).then(res => {
if (!res) return false;
const { result, data } = res && res.data || res && res.result
if (result == 0) {
wx.openOfflinePayView({
appId: data.appId,
nonceStr: data.nonceStr,
package: data.package,
signType: data.signType,
timeStamp: data.timeStamp,
paySign: data.paySign,
success: function (res) {
console.log('success', res)
},
fail: function (res) {
console.log('error', res)
},
complete: function (res) {
console.log('complete', res)
}
})
// this.setInternal();
}
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
console.log('onshow')
// 取会员卡号
const { memberCardNo, memberId } = wx.getStorageSync('_baseUserInfo')
if (memberCardNo && memberId) {
// 获取当前日期
const currentDate = utils.formatDate(new Date())
this.setData({
endTime: currentDate
}, () => {
this.setData({
memberCardNo,
memberId
}, () => {
// 获取会员信息
this.getMemberFind()
})
})
}
},
......
{
"navigationBarTitleText": "我的会员",
"usingComponents": {
"go-home": "/component/goHome/goHome"
}
"usingComponents": {}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@
</view>
<view class='user-qr-code'>
<canvas canvas-id="barcode" binderror="canvasIdErrorCallback" />
<view class='wx-pay-code' bindtap="onTapWxPay">微信支付</view>
</view>
</view>
......@@ -63,8 +64,7 @@
<picker
mode="date"
value="{{date}}"
start=""
end=""
end="{{endTime}}"
name="birthday"
disabled="{{memberInfo.birthday}}"
bindchange="bindDateChange"
......@@ -112,7 +112,5 @@
<button type='primary' class='btn-primary' form-type="submit" style="background-color: rgb(2, 186, 112);">确认</button>
</form>
</view>
<!--goHome-->
<go-home />
</view>
......@@ -59,7 +59,7 @@ page{
background-color: #ffffff;
border-radius: 7rpx;
display: flex;
height: 200rpx;
height: 300rpx;
flex-direction: column;
justify-content: center;
align-items: center;
......@@ -125,3 +125,20 @@ textarea {
font-size: 14px;
box-sizing: border-box;
}
.wx-pay-code{
padding-left: 0;
width: 50%;
height: 80rpx;
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
box-sizing: border-box;
margin-top: 40rpx;
color: #ffffff;
background: rgb(2, 186, 112);
}
.wx-pay-code:active{
opacity: 0.7;
}
\ No newline at end of file
......@@ -14,6 +14,15 @@ const formatTime = date => {
return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
}
/*格式化日期 2017-09-01*/
const formatDate = date => {
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
return [year, month, day].map(formatNumber).join('-')
}
/* 获取当前页url */
function getCurrentPageUrl() {
var pages = getCurrentPages() // 获取加载的页面
......@@ -351,6 +360,7 @@ module.exports = {
// _: underscore,
HandlerDataOnPage,
formatTime: formatTime,
formatDate,
getAppUserInfo,
formatNumber: formatNumber,
logger: new Logger(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment