Commit 9aef76a5 by 李萌

合并分支 'limeng-info' 到 'master'

Limeng info

查看合并请求 !1
parents 3acb8711 f0960ce9
...@@ -74,8 +74,11 @@ Page({ ...@@ -74,8 +74,11 @@ Page({
measure_id_t: measure_id_t, name: name, time: time1, t_openid: t_openid, z_openid: z_openid, g_id: g_id, unitid: unitid measure_id_t: measure_id_t, name: name, time: time1, t_openid: t_openid, z_openid: z_openid, g_id: g_id, unitid: unitid
} }
wx.setStorageSync('tplbDetail', tplbDetail) wx.setStorageSync('tplbDetail', tplbDetail)
// wx.navigateTo({
// url: '/pages/info1/info1?paramTopenid='+e.currentTarget.dataset.topenid,
// })
wx.navigateTo({ wx.navigateTo({
url: '/pages/info1/info1', url: '/pages/info1/info1?g_id='+ e.currentTarget.dataset.gid + '&showInfo=1'+'&paramTopenid='+e.currentTarget.dataset.topenid,
}) })
}, },
time(timestamp) { time(timestamp) {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<!-- <scroll-view scroll-y style="height: {{winH}}px;"> --> <!-- <scroll-view scroll-y style="height: {{winH}}px;"> -->
<block> <block>
<view class="list no_line"> <view class="list no_line">
<view class='record_1' wx:for="{{result}}" wx:for-item="item" bindtap='test' data-measure_id_t="{{item.measure_id_t}}" data-name="{{item.name}}" data-t_openid="{{item.t_openid}}" data-z_openid="{{item.z_openid}}" data-time="{{item.time01}}" data-t="{{item.g_time}}" data-img="{{item.headimgurl}}" data-measure_name_t="{{item.measure_name_t}}" data-idx="{{item.id}}" wx:for-index="index" wx:key="key"> <view class='record_1' wx:for="{{result}}" wx:for-item="item" bindtap='test' data-gid="{{item.g_id}}" data-measure_id_t="{{item.measure_id_t}}" data-topenid="{{item.t_openid}}" data-name="{{item.name}}" data-t_openid="{{item.t_openid}}" data-z_openid="{{item.z_openid}}" data-time="{{item.time01}}" data-t="{{item.g_time}}" data-img="{{item.headimgurl}}" data-measure_name_t="{{item.measure_name_t}}" data-idx="{{item.id}}" wx:for-index="index" wx:key="key">
<view class='pho'> <view class='pho'>
<image src='{{item.headimgurl}}'></image> <image src='{{item.headimgurl}}'></image>
<view class='t-round'>{{item.lb_num}}</view> <view class='t-round'>{{item.lb_num}}</view>
......
...@@ -277,14 +277,27 @@ Page({ ...@@ -277,14 +277,27 @@ Page({
var lb_descript = wx.getStorageSync('lb_descript'); var lb_descript = wx.getStorageSync('lb_descript');
var liangbiaoCon = wx.getStorageSync('liangbiaoCon'); var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') { // if (lb_tz == '1') {
var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: lb_descript.desc.z_openid, measure_id: lb_descript.id[0], }; // var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: lb_descript.desc.z_openid, measure_id: lb_descript.id[0], };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else { // } else {
var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: user.openid, measure_id: lb_descript.id[0], }; // var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: user.openid, measure_id: lb_descript.id[0], };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} // }
data.unitid = lb_descript.desc.unitid; var stoUser = wx.getStorageSync('user');
var ndata = {
measure_id: lb_descript.id[0],
user_stime: time,
g_id: wx.getStorageSync('g_id'),
openid:stoUser.openid ? stoUser.openid:'',
user_answer: answer.score,
answer: answer.answer,
};
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
ndata.submit_type = 2;
ndata.t_openid = wx.getStorageSync('param_t_openid');
var uploadData = setTimeout(function () { var uploadData = setTimeout(function () {
wx.hideLoading() wx.hideLoading()
wx.showToast({ icon: 'none', title: '您当前的网络不稳定,请检查网络重新提交', duration: 2000 }) wx.showToast({ icon: 'none', title: '您当前的网络不稳定,请检查网络重新提交', duration: 2000 })
...@@ -292,17 +305,28 @@ Page({ ...@@ -292,17 +305,28 @@ Page({
flag: true flag: true
}) })
}, 5000) }, 5000)
var formdata = wx.getStorageSync('allUserinfo');
Api.fetchPostN(url, data, (err, res) => { let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
clearTimeout(uploadData) clearTimeout(uploadData)
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var liangbiaoCon = wx.getStorageSync('liangbiaoCon'); var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var data1 = {}; var data1 = {};
var urls = Api.HOST + 'wechat.php?s=Home/del_vip'; // var urls = Api.HOST + 'wechat.php?s=Home/del_vip';
var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips';
var ti_title = liangbiaoCon.res[0].measure_name; var ti_title = liangbiaoCon.res[0].measure_name;
var lb_descript = wx.getStorageSync("lb_descript"); var lb_descript = wx.getStorageSync("lb_descript");
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time; data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title; data1.measure_name = ti_title;
data1.res_id = res; // data1.res_id = res;
data1.user_stime = time; data1.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') { if (lb_tz == '1') {
...@@ -349,8 +373,9 @@ Page({ ...@@ -349,8 +373,9 @@ Page({
url: '/pages/info1/info1?otype=1&otype1=1' url: '/pages/info1/info1?otype=1&otype1=1'
}) })
} else { } else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({ wx.reLaunch({
url: '/pages/info/info?otype=1&otype1=1&ishow=1', url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
}) })
} }
} else if (res == 0) { } else if (res == 0) {
...@@ -359,7 +384,10 @@ Page({ ...@@ -359,7 +384,10 @@ Page({
wx.switchTab({ wx.switchTab({
url: '/pages/record/record?lbtype=-1', url: '/pages/record/record?lbtype=-1',
success: function () { success: function () {
wx.removeStorageSync('lb_descript') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
} }
}) })
} }
...@@ -367,6 +395,15 @@ Page({ ...@@ -367,6 +395,15 @@ Page({
}) })
} }
}, },
removeEmptyProperties:function (obj) {
// 将对象转换为 [key, value] 数组
const entries = Object.entries(obj);
// 过滤掉属性值为空字符串的属性
const filteredEntries = entries.filter(([key, value]) => value !== ""&&value != 0&&value != 'undefined'&&value != null&&value != 'null'&&value != 'NULL');
// 将过滤后的数组转换回对象
const filteredObj = Object.fromEntries(filteredEntries);
return filteredObj;
},
/** /**
* 自定义函数---上一个 * 自定义函数---上一个
* 功能:返回上一个 * 功能:返回上一个
......
...@@ -147,12 +147,9 @@ Page({ ...@@ -147,12 +147,9 @@ Page({
tijiao: function () { tijiao: function () {
let that = this; let that = this;
if (this.data.flag) { if (this.data.flag) {
this.setData({ this.setData({
flag: false flag: false
}) })
// 计算答题时间 // 计算答题时间
var startTime2 = wx.getStorageSync('startTime2'); var startTime2 = wx.getStorageSync('startTime2');
var timeArr2 = wx.getStorageSync('timeArr2'); var timeArr2 = wx.getStorageSync('timeArr2');
...@@ -170,16 +167,28 @@ Page({ ...@@ -170,16 +167,28 @@ Page({
console.log(time, 'time') console.log(time, 'time')
var liangbiaoCon = wx.getStorageSync('liangbiaoCon'); var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var answer = wx.getStorageSync('answerData_rw'); var answer = wx.getStorageSync('answerData_rw');
var user = wx.getStorageSync('user');
var lb_descript = wx.getStorageSync('lb_descript'); var lb_descript = wx.getStorageSync('lb_descript');
if (liangbiaoCon.talp == '1') { // if (liangbiaoCon.talp == '1') {
var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: user.openid, measure_id: lb_descript.id[0], }; // var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: user.openid, measure_id: lb_descript.id[0], };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else { // } else {
var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: user.openid, measure_id: lb_descript.id[0], }; // var data = { user_stime: time, user_answer: answer.score, answer: answer.answer, user_number: user.openid, measure_id: lb_descript.id[0], };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} // }
data.unitid = lb_descript.desc.unitid; var user = wx.getStorageSync('user');
var ndata = {
measure_id: lb_descript.id[0],
user_stime: time,
g_id: wx.getStorageSync('g_id'),
openid:user.openid ? user.openid : '',
user_answer: answer.score,
answer: answer.answer,
};
var url = Api.HOST_huaiji + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
ndata.submit_type = 2;
ndata.t_openid = wx.getStorageSync('param_t_openid');
var uploadData = setTimeout(function () { var uploadData = setTimeout(function () {
wx.hideLoading() wx.hideLoading()
wx.showToast({ icon: 'none', title: '您当前的网络不稳定,请检查网络重新提交', duration: 2000 }) wx.showToast({ icon: 'none', title: '您当前的网络不稳定,请检查网络重新提交', duration: 2000 })
...@@ -187,17 +196,28 @@ Page({ ...@@ -187,17 +196,28 @@ Page({
flag: true flag: true
}) })
}, 5000) }, 5000)
var formdata = wx.getStorageSync('allUserinfo');
Api.fetchPostN(url, data, (err, res) => { let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
clearTimeout(uploadData) clearTimeout(uploadData)
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var liangbiaoCon = wx.getStorageSync('liangbiaoCon'); var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var data1 = {}; var data1 = {};
var urls = Api.HOST + 'wechat.php?s=Home/del_vip'; // var urls = Api.HOST + 'wechat.php?s=Home/del_vip';
var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips';
var ti_title = liangbiaoCon.res[0].measure_name; var ti_title = liangbiaoCon.res[0].measure_name;
var lb_descript = wx.getStorageSync("lb_descript"); var lb_descript = wx.getStorageSync("lb_descript");
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time; data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title; data1.measure_name = ti_title;
data1.res_id = res; // data1.res_id = res;
data1.user_stime = time; data1.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') { if (lb_tz == '1') {
...@@ -245,8 +265,9 @@ Page({ ...@@ -245,8 +265,9 @@ Page({
} }
}) })
} else { } else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({ wx.reLaunch({
url: '/pages/info/info?otype=1&otype1=1&ishow=1', url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () { success: function () {
that.setData({ flag: true }) that.setData({ flag: true })
} }
...@@ -259,7 +280,10 @@ Page({ ...@@ -259,7 +280,10 @@ Page({
url: '/pages/record/record?lbtype=-1', url: '/pages/record/record?lbtype=-1',
success: function () { success: function () {
that.setData({ flag: true }) that.setData({ flag: true })
wx.removeStorageSync('lb_descript') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
} }
}) })
} }
...@@ -267,6 +291,15 @@ Page({ ...@@ -267,6 +291,15 @@ Page({
}) })
} }
}, },
removeEmptyProperties:function (obj) {
// 将对象转换为 [key, value] 数组
const entries = Object.entries(obj);
// 过滤掉属性值为空字符串的属性
const filteredEntries = entries.filter(([key, value]) => value !== ""&&value != 0&&value != 'undefined'&&value != null&&value != 'null'&&value != 'NULL');
// 将过滤后的数组转换回对象
const filteredObj = Object.fromEntries(filteredEntries);
return filteredObj;
},
preve: function (e) { preve: function (e) {
var num = e.currentTarget.dataset.num; var num = e.currentTarget.dataset.num;
num = Number(num) - 2; num = Number(num) - 2;
......
...@@ -1085,27 +1085,40 @@ Page({ ...@@ -1085,27 +1085,40 @@ Page({
answer.score.unshift(wx.getStorageSync('canvas')); answer.score.unshift(wx.getStorageSync('canvas'));
answer.answer.unshift(0); answer.answer.unshift(0);
} }
if (lb_tp == '1') { // if (lb_tp == '1') {
var data = { // var data = {
user_stime: time, // user_stime: time,
user_answer: answer.score, // user_answer: answer.score,
answer: answer.answer, // answer: answer.answer,
user_number: lb_descript.desc.z_openid, // user_number: lb_descript.desc.z_openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
}; // };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else { // } else {
var data = { // var data = {
user_stime: time, // user_stime: time,
user_answer: answer.score, // user_answer: answer.score,
answer: answer.answer, // answer: answer.answer,
user_number: user.openid, // user_number: user.openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id') // g_id: wx.getStorageSync('g_id')
}; // };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} // }
data.unitid = lb_descript.desc.unitid; var stoUser = wx.getStorageSync('user');
var ndata = {
measure_id: lb_descript.id[0],
user_stime: time,
g_id: wx.getStorageSync('g_id'),
openid:stoUser.openid ? stoUser.openid : '',
user_answer: answer.score,
answer: answer.answer,
};
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
ndata.submit_type = 2;
ndata.t_openid = wx.getStorageSync('param_t_openid');
var uploadData = setTimeout(function () { var uploadData = setTimeout(function () {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
...@@ -1117,24 +1130,34 @@ Page({ ...@@ -1117,24 +1130,34 @@ Page({
flag: true flag: true
}) })
}, 5000) }, 5000)
var formdata = wx.getStorageSync('allUserinfo');
Api.fetchPostN(url, data, (err, res) => { let newdata = Object.assign({...ndata,...formdata});
console.log(res, 'resllo') newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
// console.log(res, 'resllo')
clearTimeout(uploadData) clearTimeout(uploadData)
if (Number(res) == 0) { if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。") Api.alert("提交失败,请重新提交。")
return; return;
} }
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var swiper_arr = wx.getStorageSync('swiper_arr'); var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {}; var data1 = {};
// var urls = Api.HOST + 'wechat.php?s=Home/del_vip';
var urls = Api.HOST + 'wechat.php?s=Home/del_vip'; var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips';
var ti_title = swiper_arr[0].measure_name; var ti_title = swiper_arr[0].measure_name;
var lb_descript = wx.getStorageSync("lb_descript"); var lb_descript = wx.getStorageSync("lb_descript");
var authorize = wx.getStorageSync('weiLb'); var authorize = wx.getStorageSync('weiLb');
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time; data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title; data1.measure_name = ti_title;
data1.res_id = res; // data1.res_id = res;
data1.user_stime = time; data1.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id; data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
...@@ -1158,7 +1181,7 @@ Page({ ...@@ -1158,7 +1181,7 @@ Page({
} }
// clearTimeout(timer) // clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => { Api.fetchPost(urls, data1, (err, res) => {
console.log('5555555555555', res) // console.log('5555555555555', res)
if (err) { if (err) {
that.setData({ that.setData({
flag: true flag: true
...@@ -1186,7 +1209,7 @@ Page({ ...@@ -1186,7 +1209,7 @@ Page({
}) })
} }
console.log('res', res) // console.log('res', res)
if (res == 1) { if (res == 1) {
// clearTimeout(timer) // clearTimeout(timer)
...@@ -1208,8 +1231,9 @@ Page({ ...@@ -1208,8 +1231,9 @@ Page({
} }
}) })
} else { } else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({ wx.reLaunch({
url: '/pages/info/info?otype=1&otype1=1&ishow=1', url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () { success: function () {
that.setData({ that.setData({
flag: true flag: true
...@@ -1235,7 +1259,10 @@ Page({ ...@@ -1235,7 +1259,10 @@ Page({
that.setData({ that.setData({
flag: true flag: true
}) })
wx.removeStorageSync('lb_descript') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
} }
}) })
}, 2000) }, 2000)
...@@ -1381,4 +1408,13 @@ Page({ ...@@ -1381,4 +1408,13 @@ Page({
}, 200) }, 200)
} }
}, },
removeEmptyProperties:function (obj) {
// 将对象转换为 [key, value] 数组
const entries = Object.entries(obj);
// 过滤掉属性值为空字符串的属性
const filteredEntries = entries.filter(([key, value]) => value !== ""&&value != 0&&value != 'undefined'&&value != null&&value != 'null'&&value != 'NULL');
// 将过滤后的数组转换回对象
const filteredObj = Object.fromEntries(filteredEntries);
return filteredObj;
},
}) })
\ No newline at end of file
...@@ -499,27 +499,40 @@ Page({ ...@@ -499,27 +499,40 @@ Page({
var lb_descript = wx.getStorageSync('lb_descript'); var lb_descript = wx.getStorageSync('lb_descript');
var swiper_arr = wx.getStorageSync('swiper_arr'); var swiper_arr = wx.getStorageSync('swiper_arr');
var lb_tp = wx.getStorageSync('lb_tz') var lb_tp = wx.getStorageSync('lb_tz')
if (lb_tp == '1') { // if (lb_tp == '1') {
var data = { // var data = {
user_stime: time, // user_stime: time,
user_answer: answer.score, // user_answer: answer.score,
answer: answer.answer, // answer: answer.answer,
user_number: lb_descript.desc.z_openid, // user_number: lb_descript.desc.z_openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
}; // };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else { // } else {
var data = { // var data = {
user_stime: time, // user_stime: time,
user_answer: answer.score, // user_answer: answer.score,
answer: answer.answer, // answer: answer.answer,
user_number: user.openid, // user_number: user.openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id') // g_id: wx.getStorageSync('g_id')
}; // };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} // }
data.unitid = lb_descript.desc.unitid; var stoUser = wx.getStorageSync('user');
var ndata = {
measure_id: lb_descript.id[0],
user_stime: time,
g_id: wx.getStorageSync('g_id'),
openid:stoUser.openid ? stoUser.openid : '',
user_answer: answer.score,
answer: answer.answer,
};
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
ndata.submit_type = 2;
ndata.t_openid = wx.getStorageSync('param_t_openid');
var uploadData = setTimeout(function () { var uploadData = setTimeout(function () {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
...@@ -531,23 +544,34 @@ Page({ ...@@ -531,23 +544,34 @@ Page({
flag: true flag: true
}) })
}, 5000) }, 5000)
var formdata = wx.getStorageSync('allUserinfo');
Api.fetchPostN(url, data, (err, res) => { let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
clearTimeout(uploadData) clearTimeout(uploadData)
if (Number(res) == 0) { if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。") Api.alert("提交失败,请重新提交。")
return; return;
} }
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var swiper_arr = wx.getStorageSync('swiper_arr'); var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {}; var data1 = {};
var urls = Api.HOST + 'wechat.php?s=Home/del_vip'; // var urls = Api.HOST + 'wechat.php?s=Home/del_vip';
var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips';
var ti_title = swiper_arr[0].measure_name; var ti_title = swiper_arr[0].measure_name;
var lb_descript = wx.getStorageSync("lb_descript"); var lb_descript = wx.getStorageSync("lb_descript");
var authorize = wx.getStorageSync('weiLb'); var authorize = wx.getStorageSync('weiLb');
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time; data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title; data1.measure_name = ti_title;
data1.res_id = res; // data1.res_id = res;
data1.user_stime = time; data1.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id; data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
...@@ -617,8 +641,9 @@ Page({ ...@@ -617,8 +641,9 @@ Page({
} }
}) })
} else { } else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({ wx.reLaunch({
url: '/pages/info/info?otype=1&otype1=1&ishow=1', url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () { success: function () {
that.setData({ that.setData({
flag: true flag: true
...@@ -644,7 +669,10 @@ Page({ ...@@ -644,7 +669,10 @@ Page({
that.setData({ that.setData({
flag: true flag: true
}) })
wx.removeStorageSync('lb_descript') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
} }
}) })
}, 2000) }, 2000)
...@@ -653,4 +681,13 @@ Page({ ...@@ -653,4 +681,13 @@ Page({
}) })
} }
}, },
removeEmptyProperties:function (obj) {
// 将对象转换为 [key, value] 数组
const entries = Object.entries(obj);
// 过滤掉属性值为空字符串的属性
const filteredEntries = entries.filter(([key, value]) => value !== ""&&value != 0&&value != 'undefined'&&value != null&&value != 'null'&&value != 'NULL');
// 将过滤后的数组转换回对象
const filteredObj = Object.fromEntries(filteredEntries);
return filteredObj;
},
}) })
\ No newline at end of file
...@@ -274,32 +274,46 @@ Page({ ...@@ -274,32 +274,46 @@ Page({
mask: true mask: true
}); });
var user = wx.getStorageSync('user');
var lb_descript = wx.getStorageSync('lb_descript'); var lb_descript = wx.getStorageSync('lb_descript');
var lb_tp = wx.getStorageSync('lb_tz'); var lb_tp = wx.getStorageSync('lb_tz');
var user_stime = formatSeconds(this.data.takeTime) var user_stime = formatSeconds(this.data.takeTime)
if (lb_tp == '1') { // if (lb_tp == '1') {
var data = { // var data = {
user_stime: user_stime, // user_stime: user_stime,
user_answer: sendDataScore, // user_answer: sendDataScore,
answer: sendDataOption, // answer: sendDataOption,
user_number: lb_descript.desc.z_openid, // user_number: lb_descript.desc.z_openid,
measure_id: lb_descript.id[0] // measure_id: lb_descript.id[0]
}; // };
} else { // } else {
var data = { // var data = {
user_stime: user_stime, // user_stime: user_stime,
user_answer: sendDataScore, // user_answer: sendDataScore,
answer: sendDataOption, // answer: sendDataOption,
user_number: user.openid, // user_number: user.openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id') // g_id: wx.getStorageSync('g_id')
}; // };
} // }
console.log(data); // console.log(data);
data.unitid = lb_descript.desc.unitid; // data.unitid = lb_descript.desc.unitid;
var user = wx.getStorageSync('user');
var ndata = {
measure_id: lb_descript.id[0],
user_stime: user_stime,
g_id: wx.getStorageSync('g_id'),
openid:user.openid ? user.openid : '',
user_answer: sendDataScore,
answer: sendDataOption,
};
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
ndata.submit_type = 2;
ndata.t_openid = wx.getStorageSync('param_t_openid');
var uploadData = setTimeout(() => { var uploadData = setTimeout(() => {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
...@@ -311,7 +325,10 @@ Page({ ...@@ -311,7 +325,10 @@ Page({
flag:true flag:true
}) })
}, 5000); }, 5000);
var url = HOST_xinli + 'xinli/index.php/Api/add_res'; var formdata = wx.getStorageSync('allUserinfo');
let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
// var url = HOST_xinli + 'xinli/index.php/Api/add_res';
fetchPostN(url,data,(err,res)=>{ fetchPostN(url,data,(err,res)=>{
clearTimeout(uploadData); clearTimeout(uploadData);
if (+res == 0) { if (+res == 0) {
...@@ -321,13 +338,21 @@ Page({ ...@@ -321,13 +338,21 @@ Page({
}) })
return; return;
} }
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var data1 = {}; var data1 = {};
var ti_title = this.data.scaleData.measure_name; var ti_title = this.data.scaleData.measure_name;
var lb_descript = wx.getStorageSync("lb_descript"); var lb_descript = wx.getStorageSync("lb_descript");
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time; data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title; data1.measure_name = ti_title;
data1.res_id = res; // data1.res_id = res;
data1.user_stime = user_stime; data1.user_stime = user_stime;
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') { if (lb_tz == '1') {
...@@ -346,7 +371,8 @@ Page({ ...@@ -346,7 +371,8 @@ Page({
data1.unitid = lb_descript.desc.unitid; data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0]; data1.measure_id = lb_descript.id[0];
} }
var urls = HOST + 'wechat.php?s=Home/del_vip' // var urls = HOST + 'wechat.php?s=Home/del_vip'
var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips'
fetchPost(urls,data1,(err,res)=>{ fetchPost(urls,data1,(err,res)=>{
if (res == 1 || res == 0) { if (res == 1 || res == 0) {
...@@ -386,8 +412,9 @@ Page({ ...@@ -386,8 +412,9 @@ Page({
} }
}) })
} else { } else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({ wx.reLaunch({
url: '/pages/info/info?otype=1&otype1=1&ishow=1', url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () { success: function () {
that.setData({ that.setData({
flag: true flag: true
...@@ -411,7 +438,10 @@ Page({ ...@@ -411,7 +438,10 @@ Page({
that.setData({ that.setData({
flag: true flag: true
}) })
wx.removeStorageSync('lb_descript') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
} }
}) })
}, 2000) }, 2000)
...@@ -421,5 +451,14 @@ Page({ ...@@ -421,5 +451,14 @@ Page({
}) })
}) })
} }
} },
removeEmptyProperties:function (obj) {
// 将对象转换为 [key, value] 数组
const entries = Object.entries(obj);
// 过滤掉属性值为空字符串的属性
const filteredEntries = entries.filter(([key, value]) => value !== ""&&value != 0&&value != 'undefined'&&value != null&&value != 'null'&&value != 'NULL');
// 将过滤后的数组转换回对象
const filteredObj = Object.fromEntries(filteredEntries);
return filteredObj;
},
}) })
\ No newline at end of file
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<text wx:if="{{unitid==1311}}" style="color:red;font-size:30rpx;">\n您所填写的内容绝对保密,不会对您的生活、学习、工作造成任何的影响,请您放心作答。 </text> <text wx:if="{{unitid==1311}}" style="color:red;font-size:30rpx;">\n您所填写的内容绝对保密,不会对您的生活、学习、工作造成任何的影响,请您放心作答。 </text>
</view> </view>
</view> </view>
<view wx:if='{{hosiptiaFlag}}'> <view hidden="{{ishow.otype == 1}}">
<view wx:if='{{hosiptiaFlag}}'>
<view class="content" wx:if='{{unitid ==1018}}'> <view class="content" wx:if='{{unitid ==1018}}'>
<view class="partyone">工号 <view class="partyone">工号
<input type='text' placeholder='请输入您的工号' bindinput="inputjobnumber" value='{{jobnumber}}'></input> <input type='text' placeholder='请输入您的工号' bindinput="inputjobnumber" value='{{jobnumber}}'></input>
...@@ -116,8 +117,8 @@ ...@@ -116,8 +117,8 @@
</view> </view>
<view class="partyone"> <view class="partyone">
<block>单位名称</block> <block>单位名称</block>
<input type='text' placeholder='请输入' bindinput="inputChange1" value='{{username1}}'></input> <input type='text' placeholder='请输入' bindinput="inputChange1" value='{{ask_department}}'></input>
</view> </view>
<view class="partyone"> <view class="partyone">
身份证号 身份证号
<input type='text' placeholder='请输入' bindinput="inputIdCard" maxlength="18" value='{{idCard}}'> <input type='text' placeholder='请输入' bindinput="inputIdCard" maxlength="18" value='{{idCard}}'>
...@@ -176,74 +177,73 @@ ...@@ -176,74 +177,73 @@
value='{{workNumber}}'></input> value='{{workNumber}}'></input>
</view> </view>
</view> </view>
</view> </view>
<view wx:else> <view wx:else>
<view class="content"> <view class="content">
<view class="partyone">你的姓名 <view class="partyone">你的姓名
<input type='text' placeholder='请输入您的姓名' bindinput="inputChange" value='{{username}}'></input> <input type='text' placeholder='请输入您的姓名' bindinput="inputChange" value='{{username}}'></input>
</view> </view>
<view class="partyone">性别 <view class="partyone">性别
<radio-group class="radio-group" bindchange="radioChange"> <radio-group class="radio-group" bindchange="radioChange">
<label class="radio" wx:for="{{items}}" wx:key="key"> <label class="radio" wx:for="{{items}}" wx:key="key">
<radio value="{{item.name}}" checked="{{item.name==sex?true : false}}" color='#37c0b8' />{{item.value}} <radio value="{{item.name}}" checked="{{item.name==sex?true : false}}" color='#37c0b8' />{{item.value}}
</label> </label>
</radio-group> </radio-group>
</view> </view>
<view class="partyone">年龄 <view class="partyone">年龄
<view class="section"> <view class="section">
<picker mode="date" value="{{date}}" start="{{startTime}}" end="{{endTime}}" bindchange="bindDateChange"> <picker mode="date" value="{{date}}" start="{{startTime}}" end="{{endTime}}" bindchange="bindDateChange">
<view class=""> <view class="">
{{date}} {{date}}
<!-- <image src="../../images/down.png"></image> --> <!-- <image src="../../images/down.png"></image> -->
</view>
</picker>
</view> </view>
</picker>
</view> </view>
</view> <view class='partyone'>年级
<view class='partyone'>年级 <view class="section">
<view class="section"> <view class="section__title"></view>
<view class="section__title"></view> <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}"> <view class="picker">
<view class="picker"> {{array[index]}}
{{array[index]}} </view>
</picker>
</view>
</view>
<view class="partyone">父亲年龄
<input type='number' placeholder='请输入您父亲的年龄' bindinput="fage" value='{{fage}}'></input>
</view>
<view class="partyone">父亲职业
<input type='text' placeholder='请输入您父亲的职业' bindinput="foccupation" value='{{foccupation}}'></input>
</view>
<view class="partyone">父亲文化程度
<input type='text' placeholder='请输入您父亲的文化程度' bindinput="fdegree" value='{{fdegree}}'></input>
</view>
<view class="partyone">母亲年龄
<input type='number' placeholder='请输入您母亲的年龄' bindinput="mage" value='{{mage}}'></input>
</view>
<view class="partyone">母亲职业
<input type='text' placeholder='请输入您母亲的职业' bindinput="moccupation" value='{{moccupation}}'></input>
</view>
<view class="partyone">母亲文化程度
<input type='text' placeholder='请输入您母亲的文化程度' bindinput="mdegree" value='{{mdegree}}'></input>
</view>
<view class='con-box clearfix' style='margin-top: 40rpx;'>
<view class='con-box-title'>家庭类型</view>
<view class='con-box-con'>
<radio-group class="radio-group-six" bindchange="radioChangeHelp">
<label class="radio" wx:for="{{helpArr}}" wx:key="key">
<radio value="{{item.name}}" checked="{{item.name==home?true : false}}" color='#fbb040' />{{item.value}}
</label>
</radio-group>
</view> </view>
</picker>
</view> </view>
</view>
<view class="partyone">父亲年龄
<input type='number' placeholder='请输入您父亲的年龄' bindinput="fage" value='{{fage}}'></input>
</view>
<view class="partyone">父亲职业
<input type='text' placeholder='请输入您父亲的职业' bindinput="foccupation" value='{{foccupation}}'></input>
</view>
<view class="partyone">父亲文化程度
<input type='text' placeholder='请输入您父亲的文化程度' bindinput="fdegree" value='{{fdegree}}'></input>
</view>
<view class="partyone">母亲年龄
<input type='number' placeholder='请输入您母亲的年龄' bindinput="mage" value='{{mage}}'></input>
</view>
<view class="partyone">母亲职业
<input type='text' placeholder='请输入您母亲的职业' bindinput="moccupation" value='{{moccupation}}'></input>
</view>
<view class="partyone">母亲文化程度
<input type='text' placeholder='请输入您母亲的文化程度' bindinput="mdegree" value='{{mdegree}}'></input>
</view>
<view class='con-box clearfix' style='margin-top: 40rpx;'>
<view class='con-box-title'>家庭类型</view>
<view class='con-box-con'>
<radio-group class="radio-group-six" bindchange="radioChangeHelp">
<label class="radio" wx:for="{{helpArr}}" wx:key="key">
<radio value="{{item.name}}" checked="{{item.name==home?true : false}}" color='#fbb040' />{{item.value}}
</label>
</radio-group>
</view> </view>
</view>
</view> </view>
</view> </view>
<view class="footer" bindtap="submit"> <view class="footer" bindtap="submit">
<button >开始</button> <button >开始</button>
</view> </view>
<view class='bottom-line'></view> <view class='bottom-line'></view>
</block> </block>
<view class='model-warp' hidden="{{hidden}}"> <view class='model-warp' hidden="{{hidden}}">
...@@ -252,7 +252,6 @@ ...@@ -252,7 +252,6 @@
<view class='model-txt-per model-t76'> <view class='model-txt-per model-t76'>
欢迎进入2020年度富士施乐员工心理健康体检 欢迎进入2020年度富士施乐员工心理健康体检
</view> </view>
<view class='model-btn-per' bindtap='confirm'>确定</view> <view class='model-btn-per' bindtap='confirm'>确定</view>
</view> </view>
</view> </view>
\ No newline at end of file
var Api = require('../../utils/api.js'); var Api = require('../../utils/api.js');
import { validateIdCard } from '../../utils/util'
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -58,10 +59,22 @@ Page({ ...@@ -58,10 +59,22 @@ Page({
mage: '', // 母亲年龄 mage: '', // 母亲年龄
moccupation: '', //母亲职业 moccupation: '', //母亲职业
mdegree: '', //母亲文化程度 mdegree: '', //母亲文化程度
idCard:'' idCard:'',
showInfo:'',//是否从列表第一次进去 1是 2-续答
}, },
onLoad: function(options) { onLoad: function(options) {
if(options.g_id) {
wx.setStorageSync('g_id',options.g_id);
}
if(options.paramTopenid) {
wx.setStorageSync('param_t_openid',options.paramTopenid);
}
var that = this; var that = this;
if(options.showInfo) {
that.setData({
showInfo:options.showInfo
})
}
var info = wx.getStorageSync('tplbDetail'); var info = wx.getStorageSync('tplbDetail');
if (info.unitid == 737) { if (info.unitid == 737) {
this.setData({ this.setData({
...@@ -161,46 +174,93 @@ Page({ ...@@ -161,46 +174,93 @@ Page({
data.characters_id = info.g_id; data.characters_id = info.g_id;
} }
Api.fetchPost(url, data, (err, res) => { Api.fetchPost(url, data, (err, res) => {
if (res.info) { if(wx.getStorageSync('allUserinfo')) {
if (res.info.cultural == '') { console.log('用的缓存数据');
res.info.cultural = 0; var storageUserinfo = wx.getStorageSync('allUserinfo');
} else { if(storageUserinfo.edu == '') {
// res.info.cultural = res.info.cultural; storageUserinfo.edu = 0;
res.info.cultural = res.info.cultural ? res.info.cultural : res.info.edu; } else {
} storageUserinfo.edu = storageUserinfo.edu ? storageUserinfo.edu : 0;
if (!res.info.birthday) { }
res.info.birthday = "请选择"; if (!storageUserinfo.birthday) {
} else { storageUserinfo.birthday = "请选择";
res.info.birthday = res.info.birthday; } else {
} storageUserinfo.birthday = storageUserinfo.birthday;
if (!that.data.hosiptiaFlag) { }
that.setData({ if (!that.data.hosiptiaFlag) {
username: res.info.name, that.setData({
index: res.info.cultural, username: storageUserinfo.name ? storageUserinfo.name :'',
idCard:res.info.idCard, usernumber: storageUserinfo.usernumber ? storageUserinfo.usernumber : '',
date: res.info.birthday, username1: storageUserinfo.ask_department ? storageUserinfo.ask_department : '',
sex: res.info.xingbie, index: storageUserinfo.edu,
home: res.info.house, // 家庭类型 idCard:storageUserinfo.idCard ? storageUserinfo.idCard : '',
fage: res.info.fage, // 父亲年龄 date: storageUserinfo.birthday,
foccupation: res.info.foccupation, //父亲职业 sex: storageUserinfo.sex,
fdegree: res.info.fdegree, //父亲文化程度 home: storageUserinfo.house, // 家庭类型
mage: res.info.mage, // 母亲年龄 fage: storageUserinfo.fage, // 父亲年龄
moccupation: res.info.moccupation, //母亲职业 foccupation: storageUserinfo.foccupation, //父亲职业
mdegree: res.info.mdegree, //母亲文化程度 fdegree: storageUserinfo.fdegree, //父亲文化程度
}); mage: storageUserinfo.mage, // 母亲年龄
moccupation: storageUserinfo.moccupation, //母亲职业
mdegree: storageUserinfo.mdegree, //母亲文化程度
});
} else {
that.setData({
username: storageUserinfo.name ? storageUserinfo.name :'',
index: storageUserinfo.edu,
date: storageUserinfo.birthday,
// sex: res.info.xingbie,
usernumber: storageUserinfo.usernumber ? storageUserinfo.usernumber : '',
sex: storageUserinfo.sex,
select: storageUserinfo.hunfou ? storageUserinfo.hunfou : 0,
username1: storageUserinfo.ask_department ? storageUserinfo.ask_department : '',
idCard:storageUserinfo.idCard ? storageUserinfo.idCard : '',
});
}
} else { } else {
that.setData({ console.log('用的后端接口数据');
username: res.info.name, if (res.info) {
index: res.info.cultural, if (res.info.cultural == '') {
date: res.info.birthday, res.info.cultural = 0;
// sex: res.info.xingbie, } else {
sex: res.info.xingbie ? res.info.xingbie : res.info.sex, // res.info.cultural = res.info.cultural;
select: res.info.hunfou, res.info.cultural = res.info.cultural ? res.info.cultural : res.info.edu;
username1: res.info.ask_department, }
idCard:res.info.idCard, if (!res.info.birthday) {
}); res.info.birthday = "请选择";
} else {
res.info.birthday = res.info.birthday;
}
if (!that.data.hosiptiaFlag) {
that.setData({
username: res.info.name,
index: res.info.cultural,
idCard:res.info.idCard,
date: res.info.birthday,
sex: res.info.xingbie,
home: res.info.house, // 家庭类型
fage: res.info.fage, // 父亲年龄
foccupation: res.info.foccupation, //父亲职业
fdegree: res.info.fdegree, //父亲文化程度
mage: res.info.mage, // 母亲年龄
moccupation: res.info.moccupation, //母亲职业
mdegree: res.info.mdegree, //母亲文化程度
});
} else {
that.setData({
username: res.info.name,
index: res.info.cultural,
date: res.info.birthday,
// sex: res.info.xingbie,
sex: res.info.xingbie ? res.info.xingbie : res.info.sex,
select: res.info.hunfou,
username1: res.info.ask_department,
idCard:res.info.idCard,
});
}
}
} }
}
}); });
}, },
inputChange: function(e) { inputChange: function(e) {
...@@ -239,16 +299,23 @@ Page({ ...@@ -239,16 +299,23 @@ Page({
}) })
}, },
submit: function() { submit: function() {
var userOpenid = wx.getStorageSync('user').openid;
if(userOpenid == '' || userOpenid == 'undefined' || userOpenid == null) {
Api.alert("数据异常,请尝试重新进入小程序");
return false;
}
var paramtOpenid = wx.getStorageSync('param_t_openid');
if(paramtOpenid == '' || paramtOpenid == 'undefined' || paramtOpenid == null) {
Api.alert("请重新扫码");
return false;
}
var that = this; var that = this;
if (this.data.payInfo) { if (this.data.payInfo) {
this.setData({ this.setData({
payInfo: false payInfo: false
}) })
var unitid = wx.getStorageSync('data').unitid; var unitid = wx.getStorageSync('data').unitid;
// var authorize = wx.getStorageSync("weiLb"); // var authorize = wx.getStorageSync("weiLb");
var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two'; var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two';
var data = {}; var data = {};
var itemData = wx.getStorageSync("itemData"); var itemData = wx.getStorageSync("itemData");
...@@ -277,7 +344,7 @@ Page({ ...@@ -277,7 +344,7 @@ Page({
} }
if (that.data.hosiptiaFlag) { // 非池州市人民医院 if (that.data.hosiptiaFlag) { // 非池州市人民医院
if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0) { if (data.name == '' || data.name == 'null' || data.sex == "null" || data.sex == "" || data.birthday == '' || data.birthday == 'null' || data.edu == 0||data.idCard==""||data.ask_department==""||data.hunfou==0) {
// wx.hideLoading() // wx.hideLoading()
clearTimeout(timer1) clearTimeout(timer1)
that.setData({ that.setData({
...@@ -286,6 +353,20 @@ Page({ ...@@ -286,6 +353,20 @@ Page({
Api.alert('请完善信息'); Api.alert('请完善信息');
return; return;
} }
if( data.usernumber=='' || data.usernumber == 'null' || data.usernumber.length != 11){
that.setData({
payInfo: true
})
Api.alert('请填写正确的手机号');
return;
}
if(!validateIdCard(data.idCard)){
that.setData({
payInfo: true
})
Api.alert('请填写正确的身份证号');
return;
}
} else { } else {
// console.log(data) // console.log(data)
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) { 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) {
...@@ -315,10 +396,11 @@ Page({ ...@@ -315,10 +396,11 @@ Page({
wx.showLoading({ wx.showLoading({
title: '请稍后', title: '请稍后',
}) })
Api.fetchPost(urlt, data, (err, res) => { wx.setStorageSync("allUserinfo", data);
// Api.fetchPost(urlt, data, (err, res) => {
wx.hideLoading() wx.hideLoading()
clearTimeout(timer1) clearTimeout(timer1)
if (res.ret == 1) { // if (res.ret == 1) {
if (that.data.lb_tz == '1') { if (that.data.lb_tz == '1') {
wx.navigateTo({ wx.navigateTo({
url: '/pages/dati01/dati01?tplb=1', url: '/pages/dati01/dati01?tplb=1',
...@@ -342,11 +424,10 @@ Page({ ...@@ -342,11 +424,10 @@ Page({
} }
}) })
} }
// } else {
} else { // Api.alert(res.msg);
Api.alert(res.msg); // }
} // });
});
} }
}, },
onUnload() {}, onUnload() {},
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<view class='top'>{{title1}}</view> <view class='top'>{{title1}}</view>
<view class='bn'><text>{{content}}</text></view> <view class='bn'><text>{{content}}</text></view>
</view> </view>
<view hidden="{{showInfo != 1}}">
<view wx:if='{{hosiptiaFlag}}'> <view wx:if='{{hosiptiaFlag}}'>
<view class="content"> <view class="content">
<view class="partyone" wx:if='{{unitid == 775 || unitid == 776}}'>工号 <view class="partyone" wx:if='{{unitid == 775 || unitid == 776}}'>工号
...@@ -48,8 +49,8 @@ ...@@ -48,8 +49,8 @@
</picker> </picker>
</view> </view>
</view> </view>
<view class="partyone">编号 <view class="partyone">联系方式
<input type='text' placeholder='请输入编号' bindinput="inputChange2" value='{{usernumber}}'></input> <input type='text' placeholder='请输入联系方式' bindinput="inputChange2" value='{{usernumber}}'></input>
</view> </view>
<view class="partyone"> <view class="partyone">
身份证号 身份证号
...@@ -123,6 +124,7 @@ ...@@ -123,6 +124,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<view class="footer" bindtap="submit"> <view class="footer" bindtap="submit">
<button>开始</button> <button>开始</button>
</view> </view>
......
...@@ -68,8 +68,9 @@ Page({ ...@@ -68,8 +68,9 @@ Page({
}) })
}, },
lbTest(e) { lbTest(e) {
wx.setStorageSync('param_t_openid',e.currentTarget.dataset.t_openid);
let that = this; let that = this;
console.log(this.data.payInfo) // console.log(this.data.payInfo)
if (this.data.payInfo) { if (this.data.payInfo) {
this.setData({ payInfo: false }) this.setData({ payInfo: false })
var id = e.currentTarget.dataset.id; var id = e.currentTarget.dataset.id;
...@@ -96,7 +97,7 @@ Page({ ...@@ -96,7 +97,7 @@ Page({
Api.fetchPost(urls, data2, (err, res) => { Api.fetchPost(urls, data2, (err, res) => {
if (this.data.delbtn == -1) { if (this.data.delbtn == -1) {
wx.navigateTo({ wx.navigateTo({
url: '/pages/info/info?otype=1&otype1=1&ishow=0&g_id='+res.info.g_id+'&is_yzm='+res.info.is_yzm, url: '/pages/info/info?otype=3&otype1=1&ishow=0&g_id='+res.info.g_id+'&is_yzm='+res.info.is_yzm,
success: function () { success: function () {
setTimeout(function () { setTimeout(function () {
that.setData({ payInfo: true }) that.setData({ payInfo: true })
......
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "XLCT-XAMJW",
"setting": {
"compileHotReLoad": true
}
}
\ No newline at end of file
var HOST_xinli = 'https://www.xiaodongai.com/xiaodong_yiyuan/'; // 提交量表 var HOST_xinli = 'https://www.xiaodongai.com/xiaodong_yiyuan/'; // 提交量表
// var HOST_xinli = 'http://123.207.162.160/xiaodong_yiyuan/';//测试 // var HOST_xinli = 'http://123.207.162.160/xiaodong_yiyuan/';//测试
var HOST = 'https://xam.xiaodongai.com/kongtian/'; // var HOST = 'https://xam.xiaodongai.com/kongtian/';
var HOST = 'https://demos-xam.xiaodongai.com/kongtian/';
// var HOST = 'http://123.207.162.160/xiaodong_yiyuan/kongtian/'; // var HOST = 'http://123.207.162.160/xiaodong_yiyuan/kongtian/';
var HOST_info = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // 个人咨询 弃用 var HOST_info = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // 个人咨询 弃用
var HOST_Linux = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // 加载Linux 服务器资讯 var HOST_Linux = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // 加载Linux 服务器资讯
...@@ -8,6 +9,8 @@ var HOST_P_K = "https://static.xiaodongai.com/xiaodongai/kongtian/"; // 加载 ...@@ -8,6 +9,8 @@ var HOST_P_K = "https://static.xiaodongai.com/xiaodongai/kongtian/"; // 加载
var HOST_banner = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // banner var HOST_banner = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // banner
var HOST_xinli_lb = 'https://static.xiaodongai.com/'; // 量表 var HOST_xinli_lb = 'https://static.xiaodongai.com/'; // 量表
var HOST_Share = "https://static.xiaodongai.com/xiaodong_yiyuan/kongtian/"; var HOST_Share = "https://static.xiaodongai.com/xiaodong_yiyuan/kongtian/";
// var HOST_xlxl = 'https://online-xlxl.xiaodongai.com/';
var HOST_xlxl = 'https://demos-xlxl.xiaodongai.com/';
// get请求方法 // get请求方法
function fetchGet(url, callback) { function fetchGet(url, callback) {
// return callback(null, top250) // return callback(null, top250)
...@@ -224,6 +227,7 @@ module.exports = { ...@@ -224,6 +227,7 @@ module.exports = {
HOST_xinli: HOST_xinli, HOST_xinli: HOST_xinli,
HOST: HOST, HOST: HOST,
HOST_info: HOST_info, HOST_info: HOST_info,
HOST_xlxl:HOST_xlxl,
fetchGet: fetchGet, //get方法 fetchGet: fetchGet, //get方法
fetchGetN:fetchGetN, fetchGetN:fetchGetN,
fetchPost: fetchPost, //post方法 fetchPost: fetchPost, //post方法
......
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