作者 wumengyu

预约页面兼容ipx,修改个人资料学员编辑城市列表

... ... @@ -203,6 +203,18 @@ Page({
const self = this;
// console.log('load-experiment_id',options);
self.setData({experiment_id: +options.experiment_id});
wx.getSystemInfo({
success: function (res) {
console.log('获取屏幕',res);
if(res.screenHeight>736) {
self.setData({
is_long_screen:true,
})
}
}
})
},
/**
... ...
... ... @@ -13,7 +13,7 @@
</view>
<view class="section">
<scroll-view class="area_box" scroll-y>
<scroll-view class="area_box {{is_long_screen?'add-height-left':''}}" scroll-y>
<block wx:for="{{areaTest}}" wx:key="index">
<view class="area-test" data-index="{{index}}" wx:for-index="idx">
<view class="area">{{item.name}}</view>
... ... @@ -39,7 +39,7 @@
<scroll-view scroll-y class="test_describe">
{{description}}
</scroll-view>
<scroll-view class="time-list-box" scroll-y>
<scroll-view class="time-list-box {{is_long_screen?'add-height':''}}" scroll-y>
<view wx:for="{{session_list}}" wx:key="index" class="time-list" bindtap="chooseTime"
data-index="{{index}}" data-id="{{item.id}}" data-surplus_num="{{item.surplus_num}}">
<image src="../../../images/blue_line.png" wx:if="{{current_session_id === item.id}}"
... ...
... ... @@ -42,6 +42,9 @@ picker {
height: 900rpx;
background-color: #fff;
}
.add-height-left {
height: 1107rpx;
}
.area-test {
display: flex;
flex-direction: column;
... ... @@ -130,6 +133,9 @@ picker {
margin-bottom: 10rpx;
height: 680rpx;
}
.add-height {
height: 887rpx;
}
.time-list {
width: 100%;
height: 140rpx;
... ...
... ... @@ -25,8 +25,13 @@ Page({
data: {
name: '',
sex: ['男','女'],
sex_index:0,
is_sex_change:false,
default_sex: {id: 1,name: '男'},
city: ['北京市', '天津市', '河北省'],
// city: ['北京市', '天津市', '河北省'],
region: ['北京市', '北京市', '东城区'],
is_city_change:false,
customItem: '全部',
default_birth: '2008-11-11',
default_city: '北京市',
years: years,
... ... @@ -37,6 +42,13 @@ Page({
day: 2,
value: [9999, 1, 1],
},
bindRegionChange(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
region: e.detail.value,
is_city_change: true,
})
},
inputName(e) {
this.setData({
name: e.detail.value
... ... @@ -82,9 +94,9 @@ Page({
let params = {
id: self.data.current_student.id,
name: self.data.name || self.data.current_student.name,
sex: (self.data.sex[self.data.sex_index] === '男' ? 1 : 2) || (+self.data.current_student.sex === 1 ? 1 : 2),
sex: ((self.data.is_sex_change)&&self.data.sex[self.data.sex_index] == '男' ? 1 : (!self.data.is_sex_change&&+self.data.current_student.sex == 1 ? 1 : 2)),
birthday: self.data.birth_date || self.data.current_student.birthday,
city: self.data.city[self.data.city_index] || self.data.current_student.city,
city: self.data.is_city_change?self.data.region[0] + ',' + self.data.region[1] + ',' + self.data.region[2]:self.data.current_student.city,
};
app.post(url, params, header).then((res) => {
// console.log('保存', res);
... ... @@ -111,7 +123,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
// console.log('options', options);
console.log('options', options);
this.setData({
is_back: options.is_back?options.is_back:'',
current_student: options.current_student?JSON.parse(options.current_student):'',
... ... @@ -135,7 +147,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.setData({is_sex_change:false})
},
/**
... ...
... ... @@ -30,12 +30,28 @@
<view class="iconfont icon-daosanjiao"></view>
</view>
</picker>
<picker bindchange="cityPickerChange" value="{{city_index}}" range="{{city}}">
<!--<picker bindchange="cityPickerChange" value="{{city_index}}" range="{{city}}">-->
<!--<view class="select-box">-->
<!--<view class="select-picker">-->
<!--<view class="sex">城 市:</view>-->
<!--<view class="picker" wx:if="{{is_city_change}}">-->
<!--{{city[city_index]}}-->
<!--</view>-->
<!--<view wx:else>{{current_student.city}}</view>-->
<!--</view>-->
<!--<view class="iconfont icon-daosanjiao"></view>-->
<!--</view>-->
<!--</picker>-->
<picker
mode="region"
bindchange="bindRegionChange"
value="{{region}}"
>
<view class="select-box">
<view class="select-picker">
<view class="sex">城 市:</view>
<view class="picker" wx:if="{{is_city_change}}">
{{city[city_index]}}
{{region[0]}},{{region[1]}},{{region[2]}}
</view>
<view wx:else>{{current_student.city}}</view>
</view>
... ...
... ... @@ -154,7 +154,14 @@ Page({
if(res.this_page < res.total_page) {
this.setData({has_more: true});
}
// console.log('list', list);
res.list.forEach((item) => {
if(item.city.indexOf(',') > 0) { //城市带逗号
console.log(item.city.indexOf(','));
return item.city = item.city.split(',')[1]
}
console.log(item.city.indexOf(','));
});
console.log('list', res.list);
this.setData({student_list: this.data.student_list.concat(res.list)})
})
},
... ...