Commit 0c28943d by 高淑倩

modify: 我的会员_textarea

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