master
Lee-1203 2022-01-24 17:53:50 +08:00
parent 53cac40425
commit 68d6bada56
5 changed files with 90 additions and 91 deletions

View File

@ -14,7 +14,7 @@ Page({
{ {
// "iconPath": "/image/icon_component.png", // "iconPath": "/image/icon_component.png",
// "selectedIconPath": "/image/icon_component.png", // "selectedIconPath": "/image/icon_component.png",
"text": "个人信息" "text": "个人中心"
}, },
// { // {
// // "iconPath": "/image/yingyong.png", // // "iconPath": "/image/yingyong.png",

View File

@ -30,7 +30,7 @@ Page({
{ {
// "iconPath": "/image/icon_biz.png", // "iconPath": "/image/icon_biz.png",
// "selectedIconPath": "/image/icon_biz.png", // "selectedIconPath": "/image/icon_biz.png",
"text": "考生信息" "text": "个人中心"
} }
], ],
}, },

View File

@ -50,9 +50,9 @@
color: #333333; color: #333333;
font-size: 28rpx; font-size: 28rpx;
} }
.revise-box{ .revise-box .checkbox-group{
display: flex; display: flex;
justify-content: space-between; justify-content: flex-start;
flex-wrap: wrap; flex-wrap: wrap;
font-size: 32rpx; font-size: 32rpx;
line-height: 80rpx; line-height: 80rpx;
@ -61,7 +61,7 @@
.revise-box2{ .revise-box2{
justify-content: flex-start; justify-content: flex-start;
} }
.revise-box>label{ .revise-box .checkbox-group label{
width: 32%; width: 32%;
display: flex; display: flex;
align-items: center; align-items: center;

View File

@ -35,36 +35,13 @@
选科组合 选科组合
</view> </view>
<view class="revise-box"> <view class="revise-box">
<label class="checkbox"> <checkbox-group class="checkbox-group" onChange="onChangeA" name="libsA">
<checkbox value="物理" checked=""/> <label class="checkbox" a:for="{{subjectArray}}" a:for-index="subjectIndex" a:for-item="item" a:if="{{subjectIndex < 6}}">
<view class="point"></view> <checkbox value="{{subjectIndex + 1}}" checked=""/>
<text class="checkbox-text">物理</text> <view class="point"></view>
</label> <text class="checkbox-text">{{item}}</text>
<label class="checkbox"> </label>
<checkbox value="化学" checked=""/> </checkbox-group>
<view class="point"></view>
<text class="checkbox-text">化学</text>
</label>
<label class="checkbox">
<checkbox value="生物" checked=""/>
<view class="point"></view>
<text class="checkbox-text">生物</text>
</label>
<label class="checkbox">
<checkbox value="历史" checked=""/>
<view class="point"></view>
<text class="checkbox-text">历史</text>
</label>
<label class="checkbox">
<checkbox value="地理" checked=""/>
<view class="point"></view>
<text class="checkbox-text">地理</text>
</label>
<label class="checkbox">
<checkbox value="政治" checked=""/>
<view class="point"></view>
<text class="checkbox-text">政治</text>
</label>
</view> </view>
</view> </view>
@ -101,16 +78,18 @@
是否提前批 是否提前批
</view> </view>
<view class="revise-box revise-box2"> <view class="revise-box revise-box2">
<label class="checkbox"> <checkbox-group class="checkbox-group" onChange="onChangeB" name="libsB">
<checkbox value="艺考生" checked=""/> <label class="checkbox">
<view class="point"></view> <checkbox value="0" checked=""/>
<text class="checkbox-text">艺考生</text> <view class="point"></view>
</label> <text class="checkbox-text">艺考生</text>
<label class="checkbox"> </label>
<checkbox value="体考生" checked=""/> <label class="checkbox">
<view class="point"></view> <checkbox value="1" checked=""/>
<text class="checkbox-text">体考生</text> <view class="point"></view>
</label> <text class="checkbox-text">体考生</text>
</label>
</checkbox-group>
</view> </view>
</view> </view>
@ -119,7 +98,7 @@
预估/模考成绩(非必填) 预估/模考成绩(非必填)
</view> </view>
<view class="revise-box"> <view class="revise-box">
<input class="revise-input" placeholder="" /> <input class="revise-input" onInput="bindStudentExpect" placeholder="" />
</view> </view>
</view> </view>
@ -128,7 +107,7 @@
预估/模考省内排名(非必填) 预估/模考省内排名(非必填)
</view> </view>
<view class="revise-box"> <view class="revise-box">
<input class="revise-input" placeholder="" /> <input class="revise-input" onInput="bindStudentRanking" placeholder="" />
</view> </view>
</view> </view>
</view> </view>

View File

@ -1,35 +1,33 @@
Page({ Page({
data: { data: {
//电话
mobile: '',
//姓名
studentName: '',
// 地区 // 地区
addrArray: [], addrArray: [],
addrObj: [], addrObj: [],
addrIndex: 0, addrIndex: 0,
// 学科 // 学科
subjectArray: [], subjectArray: [],
subjectObj: [], subjectValue: [],
subjectIndex: 0, subjectIndex: 0,
// 毕业时间 // 毕业时间
yearArray: ['2022', '2021', '2020','2019'], yearArray: [],
yearIndex: 0, yearIndex: 0,
// 性别
sexArray: ['未知','男', '女'], sexArray: ['未知','男', '女'],
sexIndex: 0, sexIndex: 0,
mobile: '',//电话
studentName: '',//姓名 advance: [],// 是否提前批
student_gender: '',//性别 achievementExpect:'',//预估或模考成绩
student_native: '', //考籍(省级)编号 provinceRanking: '',//预估/省内排名
student_native_str: '',//考籍(省级)名称
student_subject: '',//选科组合选科ID多个用英文逗号分割
student_exam_year: '',//高考年份
achievement_arts: '',//艺考成绩,-1表示未考用户留空时默认传值为-1
achievement_PE:'',//体考成绩,-1表示未考用户留空时默认传值为-1
achievement_expect:'',//预估或模考成绩
province_ranking: '',//预估/省内排名
achievement_high: '',//高考成绩,-1表示未考用户留空时默认传值为-1
studentInfo: []
}, },
onLoad() { onLoad() {
this.getAddrArray(); this.getAddrArray();
this.getSubjectArray(); this.getSubjectArray();
this.getDate();
dd.setNavigationBar({ dd.setNavigationBar({
title: '完善考生信息', title: '完善考生信息',
backgroundColor: '#FFFFFF', backgroundColor: '#FFFFFF',
@ -41,6 +39,24 @@ Page({
bindMobile(e) { bindMobile(e) {
this.data.mobile = e.detail.value this.data.mobile = e.detail.value
}, },
bindStudentExpect(e) {
this.data.achievementExpect = e.detail.value
},
bindStudentRanking(e) {
this.data.provinceRanking = e.detail.value
},
getDate(){
const date = new Date();
let year = Math.trunc(date.getFullYear());
let end = year + 10;
let newArray=[];
for(let i=year; i<= end; i++){
newArray.push(i);
}
this.setData({
yearArray: newArray
})
},
// 获取地区 // 获取地区
getAddrArray(){ getAddrArray(){
let params = { let params = {
@ -91,20 +107,20 @@ Page({
token = res.data.token; token = res.data.token;
dd.utils.$http('/api/dictionary/subjects','GET',params,token).then( dd.utils.$http('/api/dictionary/subjects','GET',params,token).then(
(data) => { (data) => {
console.log(data,22) let list = data.data.data;
// let list = data.data.data; let newArray = [];
// let newArray = []; list.forEach(item=>{
// list.forEach(item=>{ let obj = {
// let obj = { id: item.id,
// code: item.code, name: item.name
// name: item.name }
// } newArray.push(obj.name);
// newArray.push(obj.name); })
// this.data.addrObj.push(obj); this.setData({
// }) subjectArray: newArray
// this.setData({ })
// subjectArrayy: newArray
// }) // console.log(this.data.subjectObj,22)
}, },
(err) => { (err) => {
console.log('错误:'+err); console.log('错误:'+err);
@ -116,13 +132,21 @@ Page({
} }
}); });
}, },
onChangeA(e) {
// console.log(e,123);
this.data.subjectValue = e
},
onChangeB(e) {
// console.log(e,123);
this.data.advance = e
},
bindAddrChange(e) { bindAddrChange(e) {
// console.log('picker发送选择改变携带值为', e.detail.value); // console.log('picker发送选择改变携带值为', e.detail.value);
this.setData({ this.setData({
addrIndex: e.detail.value, addrIndex: e.detail.value,
}); });
}, },
bindYearChange(e) { bindYearChange(e) {
// console.log('picker发送选择改变携带值为', e.detail.value); // console.log('picker发送选择改变携带值为', e.detail.value);
this.setData({ this.setData({
@ -144,12 +168,12 @@ Page({
student_gender: this.data.sexIndex,//性别 student_gender: this.data.sexIndex,//性别
student_native: this.data.addrObj[this.data.addrIndex].code, //考籍(省级)编号 student_native: this.data.addrObj[this.data.addrIndex].code, //考籍(省级)编号
student_native_str: this.data.addrObj[this.data.addrIndex].name,//考籍(省级)名称 student_native_str: this.data.addrObj[this.data.addrIndex].name,//考籍(省级)名称
student_subject: '',//选科组合选科ID多个用英文逗号分割 student_subject: this.data.subjectValue,//选科组合选科ID多个用英文逗号分割
student_exam_year: '',//高考年份 student_exam_year: this.data.yearArray[this.data.yearIndex],//高考年份
achievement_arts: '',//艺考成绩,-1表示未考用户留空时默认传值为-1 achievement_arts: this.data.advance,//艺考成绩,-1表示未考用户留空时默认传值为-1
achievement_PE:'',//体考成绩,-1表示未考用户留空时默认传值为-1 achievement_PE:'',//体考成绩,-1表示未考用户留空时默认传值为-1
achievement_expect:'',//预估或模考成绩 achievement_expect: this.data.achievementExpect,//预估或模考成绩
province_ranking: '',//预估/省内排名 province_ranking: this.data.provinceRanking,//预估/省内排名
achievement_high: '',//高考成绩,-1表示未考用户留空时默认传值为-1 achievement_high: '',//高考成绩,-1表示未考用户留空时默认传值为-1
}; };
console.log(params,2255) console.log(params,2255)
@ -161,15 +185,11 @@ Page({
token = res.data.token; token = res.data.token;
dd.utils.$http('/api/user/edit-student-info','POST',params,token).then( dd.utils.$http('/api/user/edit-student-info','POST',params,token).then(
(data) => { (data) => {
let list = data.data.data; dd.alert({
console.log(list,999); content: '写入成功'
let newArray = []; });
let array = { dd.navigateBack({
delta: 1
}
newArray = array;
this.setData({
studentInfo: newArray
}) })
}, },
(err) => { (err) => {