Commit 9aef76a5 by 李萌

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

Limeng info

查看合并请求 !1
parents 3acb8711 f0960ce9
......@@ -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
}
wx.setStorageSync('tplbDetail', tplbDetail)
// wx.navigateTo({
// url: '/pages/info1/info1?paramTopenid='+e.currentTarget.dataset.topenid,
// })
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) {
......
......@@ -9,7 +9,7 @@
<!-- <scroll-view scroll-y style="height: {{winH}}px;"> -->
<block>
<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'>
<image src='{{item.headimgurl}}'></image>
<view class='t-round'>{{item.lb_num}}</view>
......
......@@ -277,14 +277,27 @@ Page({
var lb_descript = wx.getStorageSync('lb_descript');
var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var lb_tz = wx.getStorageSync('lb_tz');
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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else {
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';
}
data.unitid = lb_descript.desc.unitid;
// 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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
// } else {
// 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 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 () {
wx.hideLoading()
wx.showToast({ icon: 'none', title: '您当前的网络不稳定,请检查网络重新提交', duration: 2000 })
......@@ -292,17 +305,28 @@ Page({
flag: true
})
}, 5000)
Api.fetchPostN(url, data, (err, res) => {
var formdata = wx.getStorageSync('allUserinfo');
let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
clearTimeout(uploadData)
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
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 lb_descript = wx.getStorageSync("lb_descript");
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title;
data1.res_id = res;
// data1.res_id = res;
data1.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
......@@ -349,8 +373,9 @@ Page({
url: '/pages/info1/info1?otype=1&otype1=1'
})
} else {
var g_id = wx.getStorageSync('g_id');
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) {
......@@ -359,7 +384,10 @@ Page({
wx.switchTab({
url: '/pages/record/record?lbtype=-1',
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({
})
}
},
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({
tijiao: function () {
let that = this;
if (this.data.flag) {
this.setData({
flag: false
})
// 计算答题时间
var startTime2 = wx.getStorageSync('startTime2');
var timeArr2 = wx.getStorageSync('timeArr2');
......@@ -170,16 +167,28 @@ Page({
console.log(time, 'time')
var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var answer = wx.getStorageSync('answerData_rw');
var user = wx.getStorageSync('user');
var lb_descript = wx.getStorageSync('lb_descript');
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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else {
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';
}
data.unitid = lb_descript.desc.unitid;
// 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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
// } else {
// 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 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 () {
wx.hideLoading()
wx.showToast({ icon: 'none', title: '您当前的网络不稳定,请检查网络重新提交', duration: 2000 })
......@@ -187,17 +196,28 @@ Page({
flag: true
})
}, 5000)
Api.fetchPostN(url, data, (err, res) => {
var formdata = wx.getStorageSync('allUserinfo');
let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
clearTimeout(uploadData)
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
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 lb_descript = wx.getStorageSync("lb_descript");
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title;
data1.res_id = res;
// data1.res_id = res;
data1.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
......@@ -245,8 +265,9 @@ Page({
}
})
} else {
var g_id = wx.getStorageSync('g_id');
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 () {
that.setData({ flag: true })
}
......@@ -259,7 +280,10 @@ Page({
url: '/pages/record/record?lbtype=-1',
success: function () {
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({
})
}
},
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) {
var num = e.currentTarget.dataset.num;
num = Number(num) - 2;
......
......@@ -1085,27 +1085,40 @@ Page({
answer.score.unshift(wx.getStorageSync('canvas'));
answer.answer.unshift(0);
}
if (lb_tp == '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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else {
var data = {
user_stime: time,
user_answer: answer.score,
answer: answer.answer,
user_number: user.openid,
measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id')
};
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
}
data.unitid = lb_descript.desc.unitid;
// if (lb_tp == '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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
// } else {
// var data = {
// user_stime: time,
// user_answer: answer.score,
// answer: answer.answer,
// user_number: user.openid,
// measure_id: lb_descript.id[0],
// g_id: wx.getStorageSync('g_id')
// };
// var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
// }
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 () {
wx.hideLoading()
wx.showToast({
......@@ -1117,24 +1130,34 @@ Page({
flag: true
})
}, 5000)
Api.fetchPostN(url, data, (err, res) => {
console.log(res, 'resllo')
var formdata = wx.getStorageSync('allUserinfo');
let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
// console.log(res, 'resllo')
clearTimeout(uploadData)
if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。")
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 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 lb_descript = wx.getStorageSync("lb_descript");
var authorize = wx.getStorageSync('weiLb');
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title;
data1.res_id = res;
// data1.res_id = res;
data1.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz');
......@@ -1158,7 +1181,7 @@ Page({
}
// clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => {
console.log('5555555555555', res)
// console.log('5555555555555', res)
if (err) {
that.setData({
flag: true
......@@ -1186,7 +1209,7 @@ Page({
})
}
console.log('res', res)
// console.log('res', res)
if (res == 1) {
// clearTimeout(timer)
......@@ -1208,8 +1231,9 @@ Page({
}
})
} else {
var g_id = wx.getStorageSync('g_id');
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 () {
that.setData({
flag: true
......@@ -1235,7 +1259,10 @@ Page({
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
}
})
}, 2000)
......@@ -1381,4 +1408,13 @@ Page({
}, 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({
var lb_descript = wx.getStorageSync('lb_descript');
var swiper_arr = wx.getStorageSync('swiper_arr');
var lb_tp = wx.getStorageSync('lb_tz')
if (lb_tp == '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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else {
var data = {
user_stime: time,
user_answer: answer.score,
answer: answer.answer,
user_number: user.openid,
measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id')
};
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
}
data.unitid = lb_descript.desc.unitid;
// if (lb_tp == '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 url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
// } else {
// var data = {
// user_stime: time,
// user_answer: answer.score,
// answer: answer.answer,
// user_number: user.openid,
// measure_id: lb_descript.id[0],
// g_id: wx.getStorageSync('g_id')
// };
// var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
// }
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 () {
wx.hideLoading()
wx.showToast({
......@@ -531,23 +544,34 @@ Page({
flag: true
})
}, 5000)
Api.fetchPostN(url, data, (err, res) => {
var formdata = wx.getStorageSync('allUserinfo');
let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
clearTimeout(uploadData)
if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。")
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 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 lb_descript = wx.getStorageSync("lb_descript");
var authorize = wx.getStorageSync('weiLb');
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title;
data1.res_id = res;
// data1.res_id = res;
data1.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz');
......@@ -617,8 +641,9 @@ Page({
}
})
} else {
var g_id = wx.getStorageSync('g_id');
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 () {
that.setData({
flag: true
......@@ -644,7 +669,10 @@ Page({
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
}
})
}, 2000)
......@@ -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({
mask: true
});
var user = wx.getStorageSync('user');
var lb_descript = wx.getStorageSync('lb_descript');
var lb_tp = wx.getStorageSync('lb_tz');
var user_stime = formatSeconds(this.data.takeTime)
if (lb_tp == '1') {
var data = {
user_stime: user_stime,
user_answer: sendDataScore,
answer: sendDataOption,
user_number: lb_descript.desc.z_openid,
measure_id: lb_descript.id[0]
};
} else {
var data = {
user_stime: user_stime,
user_answer: sendDataScore,
answer: sendDataOption,
user_number: user.openid,
measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id')
};
}
// if (lb_tp == '1') {
// var data = {
// user_stime: user_stime,
// user_answer: sendDataScore,
// answer: sendDataOption,
// user_number: lb_descript.desc.z_openid,
// measure_id: lb_descript.id[0]
// };
// } else {
// var data = {
// user_stime: user_stime,
// user_answer: sendDataScore,
// answer: sendDataOption,
// user_number: user.openid,
// measure_id: lb_descript.id[0],
// 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(() => {
wx.hideLoading();
wx.showToast({
......@@ -311,7 +325,10 @@ Page({
flag:true
})
}, 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)=>{
clearTimeout(uploadData);
if (+res == 0) {
......@@ -321,13 +338,21 @@ Page({
})
return;
}
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var data1 = {};
var ti_title = this.data.scaleData.measure_name;
var lb_descript = wx.getStorageSync("lb_descript");
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title;
data1.res_id = res;
// data1.res_id = res;
data1.user_stime = user_stime;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
......@@ -346,7 +371,8 @@ Page({
data1.unitid = lb_descript.desc.unitid;
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)=>{
if (res == 1 || res == 0) {
......@@ -386,8 +412,9 @@ Page({
}
})
} else {
var g_id = wx.getStorageSync('g_id');
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 () {
that.setData({
flag: true
......@@ -411,7 +438,10 @@ Page({
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
}
})
}, 2000)
......@@ -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 @@
<text wx:if="{{unitid==1311}}" style="color:red;font-size:30rpx;">\n您所填写的内容绝对保密,不会对您的生活、学习、工作造成任何的影响,请您放心作答。 </text>
</view>
</view>
<view wx:if='{{hosiptiaFlag}}'>
<view hidden="{{ishow.otype == 1}}">
<view wx:if='{{hosiptiaFlag}}'>
<view class="content" wx:if='{{unitid ==1018}}'>
<view class="partyone">工号
<input type='text' placeholder='请输入您的工号' bindinput="inputjobnumber" value='{{jobnumber}}'></input>
......@@ -116,8 +117,8 @@
</view>
<view class="partyone">
<block>单位名称</block>
<input type='text' placeholder='请输入' bindinput="inputChange1" value='{{username1}}'></input>
</view>
<input type='text' placeholder='请输入' bindinput="inputChange1" value='{{ask_department}}'></input>
</view>
<view class="partyone">
身份证号
<input type='text' placeholder='请输入' bindinput="inputIdCard" maxlength="18" value='{{idCard}}'>
......@@ -176,74 +177,73 @@
value='{{workNumber}}'></input>
</view>
</view>
</view>
<view wx:else>
<view class="content">
<view class="partyone">你的姓名
<input type='text' placeholder='请输入您的姓名' bindinput="inputChange" value='{{username}}'></input>
</view>
<view class="partyone">性别
<radio-group class="radio-group" bindchange="radioChange">
<label class="radio" wx:for="{{items}}" wx:key="key">
<radio value="{{item.name}}" checked="{{item.name==sex?true : false}}" color='#37c0b8' />{{item.value}}
</label>
</radio-group>
</view>
<view class="partyone">年龄
<view class="section">
<picker mode="date" value="{{date}}" start="{{startTime}}" end="{{endTime}}" bindchange="bindDateChange">
<view class="">
{{date}}
<!-- <image src="../../images/down.png"></image> -->
</view>
<view wx:else>
<view class="content">
<view class="partyone">你的姓名
<input type='text' placeholder='请输入您的姓名' bindinput="inputChange" value='{{username}}'></input>
</view>
<view class="partyone">性别
<radio-group class="radio-group" bindchange="radioChange">
<label class="radio" wx:for="{{items}}" wx:key="key">
<radio value="{{item.name}}" checked="{{item.name==sex?true : false}}" color='#37c0b8' />{{item.value}}
</label>
</radio-group>
</view>
<view class="partyone">年龄
<view class="section">
<picker mode="date" value="{{date}}" start="{{startTime}}" end="{{endTime}}" bindchange="bindDateChange">
<view class="">
{{date}}
<!-- <image src="../../images/down.png"></image> -->
</view>
</picker>
</view>
</picker>
</view>
</view>
<view class='partyone'>年级
<view class="section">
<view class="section__title"></view>
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
{{array[index]}}
<view class='partyone'>年级
<view class="section">
<view class="section__title"></view>
<picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
<view class="picker">
{{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>
</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>
</view>
</view>
<view class="footer" bindtap="submit">
<button >开始</button>
</view>
<view class='bottom-line'></view>
</block>
<view class='model-warp' hidden="{{hidden}}">
......@@ -252,7 +252,6 @@
<view class='model-txt-per model-t76'>
欢迎进入2020年度富士施乐员工心理健康体检
</view>
<view class='model-btn-per' bindtap='confirm'>确定</view>
</view>
</view>
\ No newline at end of file
var Api = require('../../utils/api.js');
import { validateIdCard } from '../../utils/util'
var app = getApp();
Page({
......@@ -58,10 +59,22 @@ Page({
mage: '', // 母亲年龄
moccupation: '', //母亲职业
mdegree: '', //母亲文化程度
idCard:''
idCard:'',
showInfo:'',//是否从列表第一次进去 1是 2-续答
},
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;
if(options.showInfo) {
that.setData({
showInfo:options.showInfo
})
}
var info = wx.getStorageSync('tplbDetail');
if (info.unitid == 737) {
this.setData({
......@@ -161,46 +174,93 @@ Page({
data.characters_id = info.g_id;
}
Api.fetchPost(url, data, (err, res) => {
if (res.info) {
if (res.info.cultural == '') {
res.info.cultural = 0;
} else {
// res.info.cultural = res.info.cultural;
res.info.cultural = res.info.cultural ? res.info.cultural : res.info.edu;
}
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, //母亲文化程度
});
if(wx.getStorageSync('allUserinfo')) {
console.log('用的缓存数据');
var storageUserinfo = wx.getStorageSync('allUserinfo');
if(storageUserinfo.edu == '') {
storageUserinfo.edu = 0;
} else {
storageUserinfo.edu = storageUserinfo.edu ? storageUserinfo.edu : 0;
}
if (!storageUserinfo.birthday) {
storageUserinfo.birthday = "请选择";
} else {
storageUserinfo.birthday = storageUserinfo.birthday;
}
if (!that.data.hosiptiaFlag) {
that.setData({
username: storageUserinfo.name ? storageUserinfo.name :'',
usernumber: storageUserinfo.usernumber ? storageUserinfo.usernumber : '',
username1: storageUserinfo.ask_department ? storageUserinfo.ask_department : '',
index: storageUserinfo.edu,
idCard:storageUserinfo.idCard ? storageUserinfo.idCard : '',
date: storageUserinfo.birthday,
sex: storageUserinfo.sex,
home: storageUserinfo.house, // 家庭类型
fage: storageUserinfo.fage, // 父亲年龄
foccupation: storageUserinfo.foccupation, //父亲职业
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 {
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,
});
console.log('用的后端接口数据');
if (res.info) {
if (res.info.cultural == '') {
res.info.cultural = 0;
} else {
// res.info.cultural = res.info.cultural;
res.info.cultural = res.info.cultural ? res.info.cultural : res.info.edu;
}
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) {
......@@ -239,16 +299,23 @@ Page({
})
},
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;
if (this.data.payInfo) {
this.setData({
payInfo: false
})
var unitid = wx.getStorageSync('data').unitid;
// var authorize = wx.getStorageSync("weiLb");
var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two';
var data = {};
var itemData = wx.getStorageSync("itemData");
......@@ -277,7 +344,7 @@ Page({
}
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()
clearTimeout(timer1)
that.setData({
......@@ -286,6 +353,20 @@ Page({
Api.alert('请完善信息');
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 {
// 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) {
......@@ -315,10 +396,11 @@ Page({
wx.showLoading({
title: '请稍后',
})
Api.fetchPost(urlt, data, (err, res) => {
wx.setStorageSync("allUserinfo", data);
// Api.fetchPost(urlt, data, (err, res) => {
wx.hideLoading()
clearTimeout(timer1)
if (res.ret == 1) {
// if (res.ret == 1) {
if (that.data.lb_tz == '1') {
wx.navigateTo({
url: '/pages/dati01/dati01?tplb=1',
......@@ -342,11 +424,10 @@ Page({
}
})
}
} else {
Api.alert(res.msg);
}
});
// } else {
// Api.alert(res.msg);
// }
// });
}
},
onUnload() {},
......
......@@ -3,6 +3,7 @@
<view class='top'>{{title1}}</view>
<view class='bn'><text>{{content}}</text></view>
</view>
<view hidden="{{showInfo != 1}}">
<view wx:if='{{hosiptiaFlag}}'>
<view class="content">
<view class="partyone" wx:if='{{unitid == 775 || unitid == 776}}'>工号
......@@ -48,8 +49,8 @@
</picker>
</view>
</view>
<view class="partyone">编号
<input type='text' placeholder='请输入编号' bindinput="inputChange2" value='{{usernumber}}'></input>
<view class="partyone">联系方式
<input type='text' placeholder='请输入联系方式' bindinput="inputChange2" value='{{usernumber}}'></input>
</view>
<view class="partyone">
身份证号
......@@ -123,6 +124,7 @@
</view>
</view>
</view>
</view>
<view class="footer" bindtap="submit">
<button>开始</button>
</view>
......
......@@ -68,8 +68,9 @@ Page({
})
},
lbTest(e) {
wx.setStorageSync('param_t_openid',e.currentTarget.dataset.t_openid);
let that = this;
console.log(this.data.payInfo)
// console.log(this.data.payInfo)
if (this.data.payInfo) {
this.setData({ payInfo: false })
var id = e.currentTarget.dataset.id;
......@@ -96,7 +97,7 @@ Page({
Api.fetchPost(urls, data2, (err, res) => {
if (this.data.delbtn == -1) {
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 () {
setTimeout(function () {
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 = '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_info = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // 个人咨询 弃用
var HOST_Linux = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // 加载Linux 服务器资讯
......@@ -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_xinli_lb = 'https://static.xiaodongai.com/'; // 量表
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请求方法
function fetchGet(url, callback) {
// return callback(null, top250)
......@@ -224,6 +227,7 @@ module.exports = {
HOST_xinli: HOST_xinli,
HOST: HOST,
HOST_info: HOST_info,
HOST_xlxl:HOST_xlxl,
fetchGet: fetchGet, //get方法
fetchGetN:fetchGetN,
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