Commit f4cf084b by liuquan

修改他评

parent 80cc93bc
......@@ -43,8 +43,8 @@ Page({
select5: 0,
select6: 0,
username1: '',
grade:'',//年级
classGrade:'',//班级
grade: '', //年级
classGrade: '', //班级
hosiptiaFlag: true,
helpArr: [{
name: '核心型',
......@@ -73,7 +73,7 @@ Page({
moccupation: '', //母亲职业
mdegree: '', //母亲文化程度
jobnumber: '', //工号
idCard:'',//身份证号
idCard: '', //身份证号
hidden: true,
nocancel: true,
ishow: '',
......@@ -98,12 +98,10 @@ Page({
wx.login({
success: function (res) {
if (res.code) {
// var loadingPhoto = setTimeout(function () {
wx.showLoading({
title: '加载中...',
mask: true
})
// }, 1000)
var url = Api.HOST + 'applet.php?s=Applet/getopenid';
var data = {};
data.code = res.code;
......@@ -170,7 +168,7 @@ Page({
}
});
} else {
}
// let allData = wx.getStorageSync('data');
},
......@@ -284,129 +282,6 @@ Page({
})
},
/**
* 自定义函数--支付功能
* e---支付需要的参数
*
* */
pay(e, g_id) {
let that = this;
console.log("pay")
// app.getUserInfo(function (userInfo) {
var userInfo = wx.getStorageSync('userInfo');
if (!userInfo) {
app.getUserInfo();
}
var url = Api.HOST + 'wechat.php?s=Home/index';
var data = {};
var user = wx.getStorageSync('user');
data.openid = user.openid;
data.nickname = userInfo.nickName;
data.headimgurl = userInfo.avatarUrl;
data.unionid = user.unionid;
Api.fetchPost(url, data, (err, res) => {
wx.setStorageSync('data', res)
})
// })
var user = wx.getStorageSync('user');
var data = {};
data.openid = user.openid;
data.gold = e.money;
// 添加参数
var url = Api.HOST + 'wechat.php?s=Home/payrecord';
Api.fetchPost(url, data, (err, res) => {
if (res.ret == 1) {
var payargs = res.info.parameter;
wx.requestPayment({
timeStamp: payargs.timeStamp,
nonceStr: payargs.nonceStr,
package: payargs.package,
signType: payargs.signType,
paySign: payargs.paySign,
success: function (res) {
var data1 = {};
// 用户的openID 支付钱数 咨询师的unitID 微信的字符串认证
data1.openid = user.openid;
data1.gold = e.money;
data1.unitid = e.unitid;
data1.payargs = res.errMsg;
data1.type = 0;
data1.g_id = g_id;
// 咨询师的id
var url = Api.HOST + 'wechat.php?s=Home/paycs';
Api.fetchPost(url, data1, (err, res) => {
that.loaditem(e, g_id);
});
},
fail: function (res) {
// console.log(res,'shibai')
wx.switchTab({
url: '/pages/index/index',
})
}
})
} else {
Api.alert(res.msg);
}
});
},
// formSubmit: function (e) {
// var that = this;
// console.log('sssss', that.data.jobnumber)
// let url = Api.HOST + 'wechat.php?s=/Home/back_greeting';
// let url2 = Api.HOST + 'wechat.php?s=/Home/add_fromid';
// var user = wx.getStorageSync('user');
// var data = {
// job_number: that.data.jobnumber,
// name: that.data.username
// };
// var data2 = {
// openid: user.openid,
// fromid: e.detail.formId
// };
// Api.fetchPost(url2, data2, (err, res) => {
// // console.log('formSubmit', res)
// });
// Api.fetchPost(url, data, (err, res) => {
// if (res.ret == 0) {
// wx.showToast({
// title: res.msg,
// icon: 'none',
// duration: 2000
// })
// } else if (res.ret == 1) {
// wx.showModal({
// title: '',
// showCancel: false,
// confirmText: '下一步',
// confirmColor: '#37c0b8',
// content: res.msg,
// success(res) {
// if (res.confirm) {
// console.log('用户点击确定')
// that.submit();
// } else if (res.cancel) {
// console.log('用户点击取消')
// }
// }
// })
// }
// });
// },
//获取formid
formSubmit: function (e) {
console.log(e.detail.formId)
var that = this;
let url = Api.HOST + 'wechat.php?s=/Home/add_fromid';
var user = wx.getStorageSync('user');
var data = {
openid: user.openid,
fromid: e.detail.formId
};
Api.fetchPost(url, data, (err, res) => {
// console.log('formSubmit', res)
});
},
/**
* 自定义函数---加载量表数据
* 参数e--- measure_id---量表id
* money--量表支付的钱
......@@ -450,7 +325,7 @@ Page({
})
res[0].measure_id = data.measure_id;
wx.setStorageSync('lb_swiper_con', res)
if (res[0].type == 1) {} else if (Number(res[0].type) == 3) {
if (Number(res[0].type) == 3) {
// 瑞文
that.setData({
lb_tz: 3
......@@ -528,14 +403,9 @@ Page({
} else {
var user = wx.getStorageSync('user');
var unitid = wx.getStorageSync('data').unitid;
var allScore = wx.getStorageSync("testData");
var jifen = wx.getStorageSync("scoreData");
var time01 = wx.getStorageSync("time01");
var authorize = wx.getStorageSync("weiLb");
// let data1 = { user_number: user.openid };
var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two';
var data = {};
var itemData = wx.getStorageSync("itemData");
data.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
data.unitid = unitid ? unitid : '';
data.openid = user.openid;
......@@ -545,125 +415,21 @@ Page({
data.jobnumber = that.data.jobnumber; //工号
data.sheqvNumber = that.data.sheqvNumber;
data.workNumber = that.data.workNumber;
data.idCard = that.data.idCard||'';
data.username1=that.data.username1||'';
data.select=that.data.select||0;
if (that.data.is_yzm == 1) {
data.yzm = that.data.yzm;
}
// 新添加学历功能
data.edu = that.data.index;
if (that.data.unitid == '1311') {
data.giveBirth = that.data.select3; //生育情况
data.jobtitle = that.data.select4; //职称
data.jobDuty = that.data.select5; //工作职务
data.jobYears = that.data.select6; //工作年限
}
if (that.data.unitid == '1325'||that.data.unitid == '974') {
data.grade = that.data.grade; //年级
data.classGrade = that.data.classGrade; //班级
}
if (that.data.bid == '714' || that.data.bid == '713') {
data.politicsStatus = that.data.politicsStatus; //政治面貌
data.unitTime = that.data.unitTime; //进入单位时间
data.jobNature = that.data.jobNature[that.data.jobSelect];
data.postLevel = that.data.postLevel[that.data.postSelect];
}
if (that.data.hosiptiaFlag) { // 非池州市人民医院
data.hunfou = that.data.select; // 婚姻状况
data.ask_department = that.data.username1; // 单位名称
data.usernumber = that.data.usernumber; //编号
data.personnelclass = that.data.select2; //人员类别
} else { // 池州市人民医院
data.fage = that.data.fage; // 父亲年龄
data.foccupation = that.data.foccupation; //父亲职业
data.fdegree = that.data.fdegree; //父亲文化程度
data.mage = that.data.mage; // 母亲年龄
data.moccupation = that.data.moccupation; //母亲职业
data.mdegree = that.data.mdegree; //母亲文化程度
data.house = that.data.home; //家庭类型
}
if (that.data.hosiptiaFlag) { // 非池州市人民医院
//1018为施乐体检医院提交的信息
if (that.data.unitid == 1018) {
if (data.name == '' || data.jobnumber == '') {
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
} else if (that.data.bid == '714' || that.data.bid == '713') {
data.politicsStatus = that.data.politicsStatus; //政治面貌
data.unitTime = that.data.unitTime; //进入单位时间
data.jobNature = that.data.jobNature[that.data.jobSelect];
data.postLevel = that.data.postLevel[that.data.postSelect];
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0 || data.politicsStatus == "" || data.politicsStatus == 'null' || data.unitTime == "" || data.unitTime == 'null' || data.jobNature == "请选择" || data.postLevel == "请选择") {
// wx.hideLoading()
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
} else if (that.data.unitid == '1282') {
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0 || data.personnelclass == 0 || data.ask_department == '' || data.ask_department == 'null' || data.usernumber == '' || data.hunfou == 0) {
// wx.hideLoading()
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
} else if (that.data.unitid == '1311' ) {
console.log("data", data)
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0 || data.giveBirth == 0 || data.jobtitle == 0 || data.jobDuty == 0 || data.jobYears == 0) {
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
} else if (that.data.unitid == '1325'||that.data.unitid == '974' ) {
console.log("data", data)
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0 || data.grade == 'null' || data.grade =='' || data.classGrade == 'null' || data.classGrade == '') {
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
}else {
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0) {
// wx.hideLoading()
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
}
} else {
// console.log(data,'sdata');
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0 || data.fage.length < 1 || data.foccupation.length < 1 || data.fdegree.length < 1 || data.mage.length < 1 || data.moccupation.length < 1 || data.mdegree.length < 1 || data.house.length < 1) {
// wx.hideLoading()
clearTimeout(timer1)
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
if (Number(data.mage) < 18 || Number(data.fage) < 18 || Number(data.mage) > 100 || Number(data.fage) > 100) {
that.setData({
payInfo: true
})
Api.alert('请输入合理的年龄');
return;
}
data.edu = that.data.index||0;
console.log('data',data)
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0||data.idCard==""||data.username1==""||data.select==0) {
that.setData({
payInfo: true
})
Api.alert('请完善信息');
return;
}
var timer1 = setTimeout(function () {
// Api.alert("加载失败,请重试")
......@@ -790,13 +556,11 @@ Page({
var authorize = wx.getStorageSync('weiLb');
if (this.data.tplb != '1') {
data.openid = user.openid;
data.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
data.characters_id = authorize.characters_id || authorize.record_id;
} else {
// data.openid = user.openid;
var info = wx.getStorageSync('tplbDetail');
data.openid = info.z_openid;
data.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
data.characters_id = authorize.characters_id ||authorize.record_id;
}
Api.fetchPost(url, data, (err, res) => {
if (that.data.unitid == '1018') {
......@@ -810,7 +574,7 @@ Page({
if (res.info.cultural == '') {
res.info.cultural = 0;
} else {
res.info.cultural = res.info.cultural ? res.info.cultural : res.info.edu;
res.info.cultural = res.info.cultural || res.info.edu;
}
if (!res.info.birthday) {
res.info.birthday = "请选择";
......@@ -822,11 +586,13 @@ Page({
essentialData = JSON.parse(res.info.essential_information);
}
wx.setStorageSync('userInfo', res.info)
if (!that.data.hosiptiaFlag) {
that.setData({
username: res.info.name ? res.info.name : '',
usernumber: essentialData.usernumber ? essentialData.usernumber : '',
index: res.info.cultural,
username: res.info.name||'',
usernumber: essentialData.usernumber || '',
username1: essentialData.username1 || '',
select: essentialData.select || 0,
idCard:essentialData.idCard||'',
index: res.info.cultural||0,
date: res.info.birthday,
sex: res.info.xingbie,
home: res.info.house, // 家庭类型
......@@ -836,48 +602,9 @@ Page({
mage: res.info.mage, // 母亲年龄
moccupation: res.info.moccupation, //母亲职业
mdegree: res.info.mdegree, //母亲文化程度
jobnumber: res.info.jobnumber ? res.info.jobnumber : '', //工号
yzm: that.data.is_yzm == 1 ? essentialData.yzm : ''
});
} else {
that.setData({
username: res.info.name,
usernumber: essentialData.usernumber ? essentialData.usernumber : '',
index: res.info.cultural,
date: res.info.birthday,
sex: res.info.xingbie,
select: res.info.hunfou,
select2: essentialData.personnelclass ? essentialData.personnelclass : 0,
username1: res.info.ask_department,
jobnumber: res.info.jobnumber ? res.info.jobnumber : '', //工号
jobnumber: res.info.jobnumber ||'', //工号
yzm: that.data.is_yzm == 1 ? essentialData.yzm : ''
});
//怀集
if (that.data.unitid == '1311') {
console.log("essentialData", essentialData)
that.setData({
select3: Number(essentialData.giveBirth) ? Number(essentialData.giveBirth) : 0,
select4: Number(essentialData.jobtitle) ? Number(essentialData.jobtitle) : 0,
select5: Number(essentialData.jobDuty) ? Number(essentialData.jobDuty) : 0,
select6: Number(essentialData.jobYears) ? Number(essentialData.jobYears) : 0,
});
}
if (that.data.unitid == '1325'||that.data.unitid == '974') {
console.log("essentialData", essentialData)
that.setData({
grade : essentialData.grade||'', //年级
classGrade : essentialData.classGrade||'' //班级
});
}
if (that.data.bid == '714' || that.data.bid == '713') {
that.setData({
politicsStatus: essentialData.politicsStatus,
unitTime: essentialData.unitTime,
jobSelect: that.data.jobNature.indexOf(essentialData.jobNature),
postSelect: that.data.postLevel.indexOf(essentialData.postLevel),
});
}
}
}
});
},
......@@ -905,7 +632,7 @@ Page({
username: e.detail.value,
})
},
inputIdCard(e){
inputIdCard(e) {
this.setData({
idCard: e.detail.value,
})
......
......@@ -120,7 +120,8 @@
</view>
<view class="partyone">
身份证号
<input type='text' placeholder='请输入' bindinput="inputIdCard" value='{{idCard}}'></input>
<input type='text' placeholder='请输入' bindinput="inputIdCard" maxlength="18" value='{{idCard}}'>
</input>
</view>
<view class='partyone' wx:if='{{unitid==1282||unitid==904}}'>人员类别
<view class="section">
......
......@@ -112,7 +112,7 @@ Page({
var url = Api.HOST_xinli_lb + 'yiyuan/measure/' + res[0] + '.json';
var data = {};
data.measure_id = res[0];
Api.fetchGet(url, (err, res) => {
Api.fetchGetN(url, (err, res) => {
clearTimeout(loadPhoto)
wx.hideLoading()
that.setData({
......
......@@ -4,7 +4,7 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,
......
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