|
@@ -2,6 +2,8 @@ const tools = require('../../utils/tools.js');
|
|
|
const app = require('../../utils/util.js');
|
|
|
Page({
|
|
|
data: {
|
|
|
+ jobArr: [],
|
|
|
+ jobtext: '请选择',
|
|
|
kaihutext: '请选择',
|
|
|
kaihuList: [{
|
|
|
name: '高中'
|
|
@@ -65,7 +67,13 @@ Page({
|
|
|
radio: event.detail,
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ jobChange(e) {
|
|
|
+ console.log(e)
|
|
|
+ this.setData({
|
|
|
+ jobIndex: e.detail.value,
|
|
|
+ jobtext: this.data.jobArr[e.detail.value].dictLabel
|
|
|
+ })
|
|
|
+ },
|
|
|
share() {
|
|
|
this.setData({
|
|
|
show: true
|
|
@@ -96,7 +104,7 @@ Page({
|
|
|
date = new Date(date);
|
|
|
return `${date.getFullYear()-1}/${date.getMonth() + 1}/${date.getDate()}`;
|
|
|
},
|
|
|
- kaihuListChange (e) {
|
|
|
+ kaihuListChange(e) {
|
|
|
console.log(e, "8888888888888")
|
|
|
this.setData({
|
|
|
kaihuindex: e.detail.value,
|
|
@@ -133,7 +141,7 @@ Page({
|
|
|
peixunText: ''
|
|
|
});
|
|
|
},
|
|
|
- parameterTap: function (e) { //e是获取e.currentTarget.dataset.id所以是必备的,跟前端的data-id获取的方式差不多
|
|
|
+ parameterTap: function (e) {
|
|
|
let that = this
|
|
|
let this_checked = e.currentTarget.dataset.id
|
|
|
let parameterList = this.data.parameter //获取Json数组
|
|
@@ -148,7 +156,6 @@ Page({
|
|
|
parameter: parameterList
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
formSubmit(e) {
|
|
|
if (!e.detail.value.username) {
|
|
|
this.setData({
|
|
@@ -250,13 +257,14 @@ Page({
|
|
|
peixunshijianTrue: false
|
|
|
})
|
|
|
}
|
|
|
- console.log(this.data.kaihuList,this.data.kaihuindex,"000000")
|
|
|
+ console.log(this.data.jobArr,this.data.jobIndex, "55555555")
|
|
|
e.detail.value.culture = this.data.kaihuList[this.data.kaihuindex].name;
|
|
|
+ e.detail.value.studentDuty = this.data.jobtext;
|
|
|
e.detail.value.tenure = this.data.tenure;
|
|
|
e.detail.value.sessionKey = this.data.sessionKey;
|
|
|
let aa = e.detail.value
|
|
|
console.log(aa, "00000000")
|
|
|
- if (aa.culture && aa.mcajor && aa.school && aa.studentDuty && aa.tenure && aa.studentDept) {
|
|
|
+ if (aa.culture && aa.school && aa.studentDuty && aa.tenure && aa.studentDept) {
|
|
|
wx.request({
|
|
|
url: app.globalData.publicUrl + '/wx/student/upStudent',
|
|
|
method: "post",
|
|
@@ -271,7 +279,6 @@ Page({
|
|
|
mcajor: aa.mcajor,
|
|
|
},
|
|
|
success: () => {
|
|
|
- console.log("提交成功");
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: '报到成功',
|
|
@@ -298,18 +305,10 @@ Page({
|
|
|
} else {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
- content: '请补全信息',
|
|
|
- success() {
|
|
|
-
|
|
|
- }
|
|
|
+ content: '请补全除了“所学专业”以外的其他信息'
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
-
|
|
|
timeFormat(date, fmt) {
|
|
|
let o = {
|
|
|
"M+": date.getMonth() + 1, //月份
|
|
@@ -328,6 +327,27 @@ Page({
|
|
|
return fmt;
|
|
|
|
|
|
},
|
|
|
+ getjob(sessionKey) {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/position',
|
|
|
+ method: "get",
|
|
|
+ data: {
|
|
|
+ sessionKey
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ let Arr=[];
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ let newdata = {};
|
|
|
+ newdata.dictLabel = item.dictLabel;
|
|
|
+ Arr.push(newdata);
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ jobArr:Arr
|
|
|
+ })
|
|
|
+ console.log(this.data.jobArr,'我是新组成的数组')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
onReady: function () {},
|
|
|
async onLoad() {
|
|
|
const sessionKey = await tools.checkSessionAndLogin();
|
|
@@ -336,6 +356,7 @@ Page({
|
|
|
sessionKey: sessionKey
|
|
|
})
|
|
|
this.getBanner(sessionKey);
|
|
|
+ this.getjob(sessionKey)
|
|
|
},
|
|
|
getBanner(sessionKey) {
|
|
|
wx.request({
|
|
@@ -345,7 +366,7 @@ Page({
|
|
|
sessionKey: sessionKey,
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log(res)
|
|
|
+ console.log(res.data.data.studentDuty)
|
|
|
if (res.data.code == 0) {
|
|
|
this.data.parameter.forEach(item => {
|
|
|
if (item.value == res.data.data.studentSex) {
|
|
@@ -356,7 +377,7 @@ Page({
|
|
|
info: res.data.data,
|
|
|
parameter: this.data.parameter,
|
|
|
studentDept: res.data.data.studentDept,
|
|
|
- studentDuty: res.data.data.studentDuty,
|
|
|
+ jobtext: res.data.data.studentDuty,
|
|
|
kaihutext: res.data.data.culture,
|
|
|
major: res.data.data.major,
|
|
|
tenure: res.data.data.tenure,
|
|
@@ -365,5 +386,5 @@ Page({
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
- },
|
|
|
+ }
|
|
|
})
|