Commit 0c28943d by 高淑倩

modify: 我的会员_textarea

parent 20165474
...@@ -18,14 +18,8 @@ wxService.page({ ...@@ -18,14 +18,8 @@ wxService.page({
name:'已失效' name:'已失效'
} }
], ],
navIndex:'1',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
queryData:{
//"couponId": 0,
//"memberId": 0,
//"status": ""
},
totalPages: 0, totalPages: 0,
totalElements: 0, totalElements: 0,
invalidTotalElements: 0, invalidTotalElements: 0,
...@@ -37,60 +31,62 @@ wxService.page({ ...@@ -37,60 +31,62 @@ wxService.page({
}, },
//滑动切换 //滑动切换
swiperTab: function (e) { swiperTab: function (e) {
var that = this; const {current} = e.detail
that.setData({ console.log('current',current)
currentTab: e.detail.current this.setData({
currentTab: current
}); });
// 可使用
if(current == 0){
this.getCouponList(this.data.pageNo,this.data.pageSize,1)
}else if( current == 1){
// 失效
this.getCouponList(this.data.pageNo,this.data.pageSize,0)
}
}, },
//点击切换 //点击切换
clickTab: function (e) { clickTab: function (e) {
var that = this; const {current} = e.target.dataset
if (this.data.currentTab === e.target.dataset.current) { if (this.data.currentTab === current) {
return false; return false;
} else { } else {
that.setData({ this.setData({
currentTab: e.target.dataset.current currentTab: current
}) })
} }
// 可使用
if( current == 0 ){
this.getCouponList(this.data.pageNo,this.data.pageSize,1)
}else if( current == 1){
// 失效
this.getCouponList(this.data.pageNo,this.data.pageSize,0)
}
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) {}, onLoad () {},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow () {
this.setData({ this.getCouponList(this.data.pageNo,this.data.pageSize,1)
'queryData.status': this.data.navIndex
})
this.getCouponList(this.data.pageNo,this.data.pageSize)
}, },
//切换tab
// switchTab(e){
// this.setData({
// navIndex: e.currentTarget.dataset.index,
// 'queryData.status': e.currentTarget.dataset.index
// })
// this.getCouponList(this.data.pageNo,this.data.pageSize)
// },
handelPresentCouponCode(e) { handelPresentCouponCode(e) {
let data = e.currentTarget.dataset let data = e.currentTarget.dataset
wxService.router(`/pages/couponDetail/couponDetail`).search(data) wxService.router(`/pages/couponDetail/couponDetail`).search(data)
}, },
//获取优惠券列表 //获取优惠券列表
getCouponList(pageNo,pageSize){ getCouponList(pageNo,pageSize,status){
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
this.setData({
'queryData.status': this.data.navIndex const params = {
}) status
// const params = this.data.queryData }
const params = {}
wxService.post(`/coupon/coupon/listWithMember?number=${pageNo}&size=${pageSize}`, params).then(res => { wxService.post(`/coupon/coupon/listWithMember?number=${pageNo}&size=${pageSize}`, params).then(res => {
const {result,data} = res.data const {result,data} = res.data
if(result == 0){ if(result == 0){
...@@ -117,9 +113,12 @@ wxService.page({ ...@@ -117,9 +113,12 @@ wxService.page({
if (this.data.pageNo < this.data.totalPages) { if (this.data.pageNo < this.data.totalPages) {
this.setData({ this.setData({
pageNo: this.data.pageNo + 1, pageNo: this.data.pageNo + 1,
// loadDataDone: true
}) })
this.getCouponList(this.data.pageNo,this.data.pageSize) if(this.data.currentTab == 0){
this.getCouponList(this.data.pageNo,this.data.pageSize, 1)
} else {
this.getCouponList(this.data.pageNo,this.data.pageSize, 0)
}
} else { } else {
this.setData({ this.setData({
noMoreCoupon: true noMoreCoupon: true
......
...@@ -19,7 +19,8 @@ wxService.page({ ...@@ -19,7 +19,8 @@ wxService.page({
} }
], ],
sexIndex:0, sexIndex:0,
date:'' date:'',
focus: false
}, },
/** /**
...@@ -35,7 +36,9 @@ wxService.page({ ...@@ -35,7 +36,9 @@ wxService.page({
onShow: function () { onShow: function () {
}, },
bindTextAreaBlur: function(e) {
console.log(e.detail.value)
},
//性别选择 //性别选择
bindSexChange(e){ bindSexChange(e){
this.setData({ this.setData({
......
...@@ -23,15 +23,19 @@ ...@@ -23,15 +23,19 @@
<view class='form-info'> <view class='form-info'>
<form> <form>
<view class='form-section'> <view class='form-section'>
<view class='form-label'>姓名</view> <label class='form-label'>姓名</label>
<input class='form-input' name="input" placeholder="用户姓名" /> <view>
<input class='form-input' name="input" placeholder="用户姓名" />
</view>
</view> </view>
<view class='form-section'> <view class='form-section'>
<view class='form-label'>手机号</view> <label class='form-label'>手机号</label>
<input class='form-input' name="input" placeholder="请输入手机号" /> <view>
<input class='form-input' name="input" placeholder="请输入手机号" />
</view>
</view> </view>
<view class='form-section'> <view class='form-section'>
<view class='form-label'>性别</view> <label class='form-label'>性别</label>
<picker bindchange="bindSexChange" value="{{sexIndex}}" range="{{sexArray}}" range-key="name" class='form-picker'> <picker bindchange="bindSexChange" value="{{sexIndex}}" range="{{sexArray}}" range-key="name" class='form-picker'>
<view class="picker"> <view class="picker">
{{sexArray[sexIndex].name ? sexArray[sexIndex].name : '请选择性别'}} {{sexArray[sexIndex].name ? sexArray[sexIndex].name : '请选择性别'}}
...@@ -39,7 +43,7 @@ ...@@ -39,7 +43,7 @@
</picker> </picker>
</view> </view>
<view class='form-picker-section'> <view class='form-picker-section'>
<view class='form-label'>生日</view> <label class='form-label'>生日</label>
<picker <picker
mode="date" mode="date"
value="{{date}}" value="{{date}}"
...@@ -54,12 +58,16 @@ ...@@ -54,12 +58,16 @@
</view> </view>
<view class='form-section'> <view class='form-section'>
<view class='form-label'>邮箱</view> <label class='form-label'>邮箱</label>
<input class='form-input' name="input" placeholder="请输入邮箱" /> <view>
<input class='form-input' name="input" placeholder="请输入邮箱" />
</view>
</view> </view>
<view class='form-section'> <view class='form-section'>
<view class='form-label'>地址</view> <label class='form-label'>地址</label>
<input class='form-input' name="input" placeholder="请填写真实收件地址" /> <view>
<textarea class='form-input' bindblur="bindTextAreaBlur" auto-height placeholder="请填写真实收件地址" />
</view>
</view> </view>
<button type='primary' class='btn-primary' style="background-color: rgb(2, 186, 112);">确认</button> <button type='primary' class='btn-primary' style="background-color: rgb(2, 186, 112);">确认</button>
</form> </form>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
position: relative; position: relative;
width: 650rpx; width: 650rpx;
height: 260rpx; height: 260rpx;
box-shadow: 0 0 40rpx 1rpx #666666; box-shadow: 0 0 40rpx 1rpx #ccc;
border-radius: 7rpx; border-radius: 7rpx;
padding-top: 30rpx; padding-top: 30rpx;
} }
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
display: flex;
} }
.form-label,.form-input,.form-picker{ .form-label,.form-input,.form-picker{
display: inline-block; display: inline-block;
......
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