Commit 9218b7e1 by 李萌

Merge branch 'limeng-量表提交流程优化' into 'master'

答题提交流程优化

See merge request !1
parents 70e885fd 309d76f5
...@@ -293,6 +293,12 @@ Page({ ...@@ -293,6 +293,12 @@ Page({
user_answer: answer.score, user_answer: answer.score,
answer: answer.answer, answer: answer.answer,
}; };
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData'; var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
...@@ -317,81 +323,115 @@ Page({ ...@@ -317,81 +323,115 @@ Page({
flag: true flag: true
}) })
return; return;
}
var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var data1 = {};
// 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.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
data1.unitid = unitid;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
// console.log(lb_descript.desc.measure_id)
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
Api.fetchPost(urls, data1, (err, res) => {
if (err) {
that.setData({ that.setData({
flag: true flag: true
}) })
} wx.hideLoading()
that.setData({ wx.removeStorageSync('answerData')
flag: true wx.removeStorageSync('chaTime')
}) wx.removeStorageSync('endTime')
wx.hideLoading() wx.removeStorageSync('startTime')
wx.removeStorageSync('answerData') wx.removeStorageSync('timeArr')
wx.removeStorageSync('chaTime') wx.removeStorageSync('lbCon')
wx.removeStorageSync('endTime') wx.removeStorageSync('liangbiaoCon')
wx.removeStorageSync('startTime') if (res.data.charactersStatus == 1) {
wx.removeStorageSync('timeArr') var lb_tz = wx.getStorageSync('lb_tz');
wx.removeStorageSync('lbCon') if (lb_tz == '1') {
wx.removeStorageSync('liangbiaoCon') wx.reLaunch({
// wx.removeStorageSync('lb_descript') url: '/pages/info1/info1?otype=1&otype1=1'
// console.log(res) })
} else {
if (res == 1) { var g_id = wx.getStorageSync('g_id');
var lb_tz = wx.getStorageSync('lb_tz'); wx.reLaunch({
if (lb_tz == '1') { url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
wx.reLaunch({ })
url: '/pages/info1/info1?otype=1&otype1=1' }
}) } else if (res.data.charactersStatus == 0) {
} else { wx.removeStorageSync('tplbDetail')
var g_id = wx.getStorageSync('g_id'); wx.removeStorageSync('weiLb')
wx.reLaunch({ wx.switchTab({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`, url: '/pages/record/record?lbtype=-1',
}) success: function () {
} wx.removeStorageSync('lb_descript');
} else if (res == 0) { wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('tplbDetail') wx.removeStorageSync('g_id');
wx.removeStorageSync('weiLb') wx.removeStorageSync('param_t_openid');
wx.switchTab({ }
url: '/pages/record/record?lbtype=-1', })
success: function () {
wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid');
} }
}) }
} // var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
}) // var data1 = {};
// 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.user_stime = time;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// data1.unitid = unitid;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// // console.log(lb_descript.desc.measure_id)
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// Api.fetchPost(urls, data1, (err, res) => {
// if (err) {
// that.setData({
// flag: true
// })
// }
// that.setData({
// flag: true
// })
// wx.hideLoading()
// wx.removeStorageSync('answerData')
// wx.removeStorageSync('chaTime')
// wx.removeStorageSync('endTime')
// wx.removeStorageSync('startTime')
// wx.removeStorageSync('timeArr')
// wx.removeStorageSync('lbCon')
// wx.removeStorageSync('liangbiaoCon')
// if (res == 1) {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// 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&g_id=${g_id}`,
// })
// }
// } else if (res == 0) {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.switchTab({
// url: '/pages/record/record?lbtype=-1',
// success: function () {
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }
// })
}) })
} }
}, },
......
...@@ -72,7 +72,7 @@ Page({ ...@@ -72,7 +72,7 @@ Page({
var num = e.currentTarget.dataset.num; var num = e.currentTarget.dataset.num;
var answer = e.currentTarget.dataset.answer; var answer = e.currentTarget.dataset.answer;
var score = e.currentTarget.dataset.score; var score = e.currentTarget.dataset.score;
console.log(num, 'idnidnidn') // console.log(num, 'idnidnidn')
this.setData({ this.setData({
num: num num: num
}) })
...@@ -104,13 +104,13 @@ Page({ ...@@ -104,13 +104,13 @@ Page({
}, },
next: function (e) { next: function (e) {
console.log(e) // console.log(e)
let that = this; let that = this;
var lb_rw = wx.getStorageSync('lb_rw'); var lb_rw = wx.getStorageSync('lb_rw');
var answerData_rw = wx.getStorageSync('answerData_rw'); var answerData_rw = wx.getStorageSync('answerData_rw');
if (lb_rw.length <= answerData_rw.score.length) { if (lb_rw.length <= answerData_rw.score.length) {
console.log(this.data.num < lb_rw.length, '1') // console.log(this.data.num < lb_rw.length, '1')
if (this.data.num < lb_rw.length) { if (this.data.num < lb_rw.length) {
var len = lb_rw[e].answer.length == 6 ? 1 : 2; var len = lb_rw[e].answer.length == 6 ? 1 : 2;
this.setData({ this.setData({
...@@ -162,19 +162,12 @@ Page({ ...@@ -162,19 +162,12 @@ Page({
} }
var thisTime = Date.parse(new Date()); var thisTime = Date.parse(new Date());
var cha = thisTime - startTime2 + chaTime2; var cha = thisTime - startTime2 + chaTime2;
console.log(cha, 'cha') // console.log(cha, 'cha')
var time = Api.reversalTime(cha) var time = Api.reversalTime(cha)
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 lb_descript = wx.getStorageSync('lb_descript'); 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';
// }
var user = wx.getStorageSync('user'); var user = wx.getStorageSync('user');
var ndata = { var ndata = {
measure_id: lb_descript.id[0], measure_id: lb_descript.id[0],
...@@ -184,7 +177,13 @@ Page({ ...@@ -184,7 +177,13 @@ Page({
user_answer: answer.score, user_answer: answer.score,
answer: answer.answer, answer: answer.answer,
}; };
var url = Api.HOST_huaiji + 'amedical.php/gauge/pcAddData'; var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
ndata.submit_type = 2; ndata.submit_type = 2;
...@@ -208,86 +207,129 @@ Page({ ...@@ -208,86 +207,129 @@ Page({
flag: true flag: true
}) })
return; return;
}
var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
var data1 = {};
// 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.user_stime = time;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
data1.unitid = unitid;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
Api.fetchPost(urls, data1, (err, res) => {
if (err) {
that.setData({ that.setData({
flag: true flag: true
}) })
} wx.removeStorageSync('answerData_rw')
that.setData({ wx.removeStorageSync('chaTime2')
flag: true wx.removeStorageSync('endTime')
}) wx.removeStorageSync('startTime2')
wx.removeStorageSync('answerData_rw') wx.removeStorageSync('timeArr2')
wx.removeStorageSync('chaTime2') wx.removeStorageSync('lbCon')
wx.removeStorageSync('endTime') wx.removeStorageSync('liangbiaoCon')
wx.removeStorageSync('startTime2') if (res.data.charactersStatus == 1) {
wx.removeStorageSync('timeArr2') var lb_tz = wx.getStorageSync('lb_tz');
wx.removeStorageSync('lbCon') if (lb_tz == '1') {
wx.removeStorageSync('liangbiaoCon') wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
console.log(res) success: function () {
that.setData({ flag: true })
if (res == 1) { }
var lb_tz = wx.getStorageSync('lb_tz'); })
if (lb_tz == '1') { } else {
wx.reLaunch({ var g_id = wx.getStorageSync('g_id');
url: '/pages/info1/info1?otype=1&otype1=1', wx.reLaunch({
success: function () { url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
that.setData({ flag: true }) success: function () {
} that.setData({ flag: true })
}) }
} else { })
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () {
that.setData({ flag: true })
} }
}) } else if (res.data.charactersStatus == 0) {
} wx.removeStorageSync('tplbDetail')
} else if (res == 0) { wx.removeStorageSync('weiLb')
wx.removeStorageSync('tplbDetail') wx.reLaunch({
wx.removeStorageSync('weiLb') url: '/pages/record/record?lbtype=-1',
wx.reLaunch({ success: function () {
url: '/pages/record/record?lbtype=-1', that.setData({ flag: true })
success: function () { wx.removeStorageSync('lb_descript');
that.setData({ flag: true }) wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('lb_descript'); wx.removeStorageSync('g_id');
wx.removeStorageSync('allUserinfo'); wx.removeStorageSync('param_t_openid');
wx.removeStorageSync('g_id'); }
wx.removeStorageSync('param_t_openid'); })
} }
}) }
} // var liangbiaoCon = wx.getStorageSync('liangbiaoCon');
}) // var data1 = {};
// 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.user_stime = time;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// data1.unitid = unitid;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// Api.fetchPost(urls, data1, (err, res) => {
// if (err) {
// that.setData({
// flag: true
// })
// }
// that.setData({
// flag: true
// })
// wx.removeStorageSync('answerData_rw')
// wx.removeStorageSync('chaTime2')
// wx.removeStorageSync('endTime')
// wx.removeStorageSync('startTime2')
// wx.removeStorageSync('timeArr2')
// wx.removeStorageSync('lbCon')
// wx.removeStorageSync('liangbiaoCon')
// console.log(res)
// if (res == 1) {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// url: '/pages/info1/info1?otype=1&otype1=1',
// success: function () {
// that.setData({ flag: true })
// }
// })
// } else {
// var g_id = wx.getStorageSync('g_id');
// wx.reLaunch({
// url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
// success: function () {
// that.setData({ flag: true })
// }
// })
// }
// } else if (res == 0) {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.reLaunch({
// url: '/pages/record/record?lbtype=-1',
// success: function () {
// that.setData({ flag: true })
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }
// })
}) })
} }
}, },
......
...@@ -1072,12 +1072,9 @@ Page({ ...@@ -1072,12 +1072,9 @@ Page({
var time = Api.reversalTime(cha) var time = Api.reversalTime(cha)
var user = wx.getStorageSync('user'); var user = wx.getStorageSync('user');
var answer = wx.getStorageSync('answer_swiper'); var answer = wx.getStorageSync('answer_swiper');
console.log(answer.score.length, 'answer.score.length;')
for (let i = 0; i < answer.score.length; i++) { for (let i = 0; i < answer.score.length; i++) {
answer.score[i] = answer.score[i].replace(/[\r\n]/g, ''); answer.score[i] = answer.score[i].replace(/[\r\n]/g, '');
} }
console.log('answer.score.lengthwwwww;')
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')
...@@ -1085,26 +1082,6 @@ Page({ ...@@ -1085,26 +1082,6 @@ 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') {
// 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 stoUser = wx.getStorageSync('user');
var ndata = { var ndata = {
measure_id: lb_descript.id[0], measure_id: lb_descript.id[0],
...@@ -1114,6 +1091,13 @@ Page({ ...@@ -1114,6 +1091,13 @@ Page({
user_answer: answer.score, user_answer: answer.score,
answer: answer.answer, answer: answer.answer,
}; };
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData'; var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
...@@ -1134,142 +1118,212 @@ Page({ ...@@ -1134,142 +1118,212 @@ Page({
let newdata = Object.assign({...ndata,...formdata}); let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata); newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => { 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;
} } else if (Number(res.code) == -1) {
if (Number(res.code) == -1) {
wx.hideLoading(); wx.hideLoading();
Api.alert(res.msg) Api.alert(res.msg)
that.setData({ that.setData({
flag: true flag: true
}) })
return; return;
}
var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {};
// 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.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
var tp_characters_id = wx.getStorageSync("tplbDetail");
data1.unitid = unitid;
data1.characters_id = tp_characters_id.g_id;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
// clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => {
// console.log('5555555555555', res)
if (err) {
that.setData({ that.setData({
flag: true flag: true
})
}
that.setData({
flag: true
})
if (res == 1 || res == 0) {
wx.removeStorageSync('answer_swiper')
wx.removeStorageSync('swiper_arr')
wx.removeStorageSync('chaTime')
wx.removeStorageSync('endTime')
wx.removeStorageSync('startTime')
wx.removeStorageSync('timeArr')
wx.removeStorageSync('lb_swiper_con')
wx.hideLoading();
} else {
wx.hideLoading()
wx.showToast({
title: '请稍后再试',
icon: 'none',
duration: 2000
})
}
// console.log('res', res)
if (res == 1) {
// clearTimeout(timer)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
}) })
wx.removeStorageSync('canvas') if (res.data.charactersStatus == 1 || res.data.charactersStatus == 0) {
setTimeout(function () { wx.removeStorageSync('answer_swiper')
var lb_tz = wx.getStorageSync('lb_tz'); wx.removeStorageSync('swiper_arr')
if (lb_tz == '1') { wx.removeStorageSync('chaTime')
wx.reLaunch({ wx.removeStorageSync('endTime')
url: '/pages/info1/info1?otype=1&otype1=1', wx.removeStorageSync('startTime')
success: function () { wx.removeStorageSync('timeArr')
that.setData({ wx.removeStorageSync('lb_swiper_con')
flag: true wx.hideLoading();
})
}
})
} else { } else {
var g_id = wx.getStorageSync('g_id'); wx.hideLoading()
wx.reLaunch({ wx.showToast({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`, title: '请稍后再试',
success: function () { icon: 'none',
that.setData({ duration: 2000
flag: true })
}
if (res.data.charactersStatus == 1) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () {
that.setData({
flag: true
})
}
}) })
} }
}, 2000)
} else if (res.data.charactersStatus == 0) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
}) })
} setTimeout(function () {
}, 2000) wx.removeStorageSync('tplbDetail')
} else if (res == 0) { wx.removeStorageSync('weiLb')
// clearTimeout(timer) wx.reLaunch({
wx.showToast({ url: '/pages/record/record',
title: '上传成功', success: function () {
icon: 'success', that.setData({
duration: 2000 flag: true
}) })
setTimeout(function () { wx.removeStorageSync('lb_descript');
wx.removeStorageSync('tplbDetail') wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('weiLb') wx.removeStorageSync('g_id');
wx.reLaunch({ wx.removeStorageSync('param_t_openid');
// url: '/pages/end/end?lbtype=-1', }
url: '/pages/record/record',
success: function () {
that.setData({
flag: true
}) })
wx.removeStorageSync('lb_descript'); }, 2000)
wx.removeStorageSync('allUserinfo'); }
wx.removeStorageSync('g_id'); }
wx.removeStorageSync('param_t_openid'); // var swiper_arr = wx.getStorageSync('swiper_arr');
} // var data1 = {};
}) // var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips';
}, 2000) // var ti_title = swiper_arr[0].measure_name;
} else { // 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.user_stime = time;
// data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// var tp_characters_id = wx.getStorageSync("tplbDetail");
// data1.unitid = unitid;
// data1.characters_id = tp_characters_id.g_id;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// clearTimeout(timer)
// Api.fetchPost(urls, data1, (err, res) => {
// // console.log('5555555555555', res)
// if (err) {
// that.setData({
// flag: true
// })
// }
// that.setData({
// flag: true
// })
// if (res == 1 || res == 0) {
// wx.removeStorageSync('answer_swiper')
// wx.removeStorageSync('swiper_arr')
// wx.removeStorageSync('chaTime')
// wx.removeStorageSync('endTime')
// wx.removeStorageSync('startTime')
// wx.removeStorageSync('timeArr')
// wx.removeStorageSync('lb_swiper_con')
// wx.hideLoading();
} // } else {
}) // wx.hideLoading()
// wx.showToast({
// title: '请稍后再试',
// icon: 'none',
// duration: 2000
// })
// }
// // console.log('res', res)
// if (res == 1) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// wx.removeStorageSync('canvas')
// setTimeout(function () {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// url: '/pages/info1/info1?otype=1&otype1=1',
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// } else {
// var g_id = wx.getStorageSync('g_id');
// wx.reLaunch({
// url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// }
// }, 2000)
// } else if (res == 0) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// setTimeout(function () {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.reLaunch({
// // url: '/pages/end/end?lbtype=-1',
// url: '/pages/record/record',
// success: function () {
// that.setData({
// flag: true
// })
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }, 2000)
// } else {
// }
// })
}) })
} }
}, },
......
...@@ -528,6 +528,12 @@ Page({ ...@@ -528,6 +528,12 @@ Page({
user_answer: answer.score, user_answer: answer.score,
answer: answer.answer, answer: answer.answer,
}; };
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData'; var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
...@@ -552,132 +558,201 @@ Page({ ...@@ -552,132 +558,201 @@ Page({
if (Number(res) == 0) { if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。") Api.alert("提交失败,请重新提交。")
return; return;
} } else if (Number(res.code) == -1) {
if (Number(res.code) == -1) {
wx.hideLoading(); wx.hideLoading();
Api.alert(res.msg) Api.alert(res.msg)
that.setData({ that.setData({
flag: true flag: true
}) })
return; return;
}
var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {};
// 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.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
var tp_characters_id = wx.getStorageSync("tplbDetail");
data1.unitid = unitid;
data1.characters_id = tp_characters_id.g_id;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
// clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => {
if (err) {
that.setData({ that.setData({
flag: true flag: true
}) })
} if (res.data.charactersStatus == 1 || res.data.charactersStatus == 0) {
that.setData({ wx.removeStorageSync('answer_swiper')
flag: true wx.removeStorageSync('swiper_arr')
}) wx.removeStorageSync('chaTime')
if (res == 1 || res == 0) { wx.removeStorageSync('endTime')
wx.removeStorageSync('answer_swiper') wx.removeStorageSync('startTime')
wx.removeStorageSync('swiper_arr') wx.removeStorageSync('timeArr')
wx.removeStorageSync('chaTime') wx.removeStorageSync('lb_swiper_con')
wx.removeStorageSync('endTime') wx.hideLoading();
wx.removeStorageSync('startTime')
wx.removeStorageSync('timeArr')
wx.removeStorageSync('lb_swiper_con')
wx.hideLoading();
} else {
wx.hideLoading()
wx.showToast({
title: '请稍后再试',
icon: 'none',
duration: 2000
})
}
if (res == 1) {
// clearTimeout(timer)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else { } else {
var g_id = wx.getStorageSync('g_id'); wx.hideLoading()
wx.reLaunch({ wx.showToast({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`, title: '请稍后再试',
success: function () { icon: 'none',
that.setData({ duration: 2000
flag: true })
}
if (res.data.charactersStatus == 1) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () {
that.setData({
flag: true
})
}
}) })
} }
}, 2000)
} else if (res.data.charactersStatus == 0) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
}) })
} setTimeout(function () {
}, 2000) wx.removeStorageSync('tplbDetail')
} else if (res == 0) { wx.removeStorageSync('weiLb')
// clearTimeout(timer) wx.reLaunch({
wx.showToast({ url: '/pages/record/record',
title: '上传成功', success: function () {
icon: 'success', that.setData({
duration: 2000 flag: true
}) })
setTimeout(function () { wx.removeStorageSync('lb_descript');
wx.removeStorageSync('tplbDetail') wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('weiLb') wx.removeStorageSync('g_id');
wx.reLaunch({ wx.removeStorageSync('param_t_openid');
// url: '/pages/end/end?lbtype=-1', }
url: '/pages/record/record',
success: function () {
that.setData({
flag: true
}) })
wx.removeStorageSync('lb_descript'); }, 2000)
wx.removeStorageSync('allUserinfo'); }
wx.removeStorageSync('g_id'); }
wx.removeStorageSync('param_t_openid'); // var swiper_arr = wx.getStorageSync('swiper_arr');
} // var data1 = {};
}) // var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips';
}, 2000) // 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.user_stime = time;
// data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// var tp_characters_id = wx.getStorageSync("tplbDetail");
// data1.unitid = unitid;
// data1.characters_id = tp_characters_id.g_id;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// Api.fetchPost(urls, data1, (err, res) => {
// if (err) {
// that.setData({
// flag: true
// })
// }
// that.setData({
// flag: true
// })
// if (res == 1 || res == 0) {
// wx.removeStorageSync('answer_swiper')
// wx.removeStorageSync('swiper_arr')
// wx.removeStorageSync('chaTime')
// wx.removeStorageSync('endTime')
// wx.removeStorageSync('startTime')
// wx.removeStorageSync('timeArr')
// wx.removeStorageSync('lb_swiper_con')
// wx.hideLoading();
// } else {
// wx.hideLoading()
// wx.showToast({
// title: '请稍后再试',
// icon: 'none',
// duration: 2000
// })
// }
// if (res == 1) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// wx.removeStorageSync('canvas')
// setTimeout(function () {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// url: '/pages/info1/info1?otype=1&otype1=1',
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// } else {
// var g_id = wx.getStorageSync('g_id');
// wx.reLaunch({
// url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// }
// }, 2000)
// } else if (res == 0) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// setTimeout(function () {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.reLaunch({
// // url: '/pages/end/end?lbtype=-1',
// url: '/pages/record/record',
// success: function () {
// that.setData({
// flag: true
// })
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }, 2000)
// }
// })
}) })
} }
}, },
......
...@@ -651,6 +651,12 @@ var pageData = { ...@@ -651,6 +651,12 @@ var pageData = {
user_answer: JSON.stringify(that.data.userInfo), user_answer: JSON.stringify(that.data.userInfo),
answer: JSON.stringify(that.data.userInfo), answer: JSON.stringify(that.data.userInfo),
}; };
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData'; var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
...@@ -671,137 +677,210 @@ var pageData = { ...@@ -671,137 +677,210 @@ var pageData = {
let newdata = Object.assign({...ndata,...formdata}); let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata); newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => { 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;
} } else if (Number(res.code) == -1) {
if (Number(res.code) == -1) {
wx.hideLoading(); wx.hideLoading();
Api.alert(res.msg) Api.alert(res.msg)
that.setData({ that.setData({
flag: true flag: true
}) })
return; return;
}
var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {};
// 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.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
var tp_characters_id = wx.getStorageSync("tplbDetail");
data1.unitid = unitid;
data1.characters_id = tp_characters_id.g_id;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
// clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => {
if (err) {
that.setData({ that.setData({
flag: true flag: true
}) })
} if (res.data.charactersStatus == 1 || res.data.charactersStatus == 0) {
that.setData({ wx.removeStorageSync('answer_swiper')
flag: true wx.removeStorageSync('swiper_arr')
}) wx.removeStorageSync('chaTime')
if (res == 1 || res == 0) { wx.removeStorageSync('endTime')
wx.removeStorageSync('answer_swiper') wx.removeStorageSync('startTime')
wx.removeStorageSync('swiper_arr') wx.removeStorageSync('timeArr')
wx.removeStorageSync('chaTime') wx.removeStorageSync('lb_swiper_con')
wx.removeStorageSync('endTime') wx.hideLoading();
wx.removeStorageSync('startTime')
wx.removeStorageSync('timeArr')
wx.removeStorageSync('lb_swiper_con')
wx.hideLoading();
} else {
wx.hideLoading()
wx.showToast({
title: '请稍后再试',
icon: 'none',
duration: 2000
})
}
console.log('res', res)
if (res == 1) {
// clearTimeout(timer)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else { } else {
var g_id = wx.getStorageSync('g_id'); wx.hideLoading()
wx.reLaunch({ wx.showToast({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`, title: '请稍后再试',
success: function () { icon: 'none',
that.setData({ duration: 2000
flag: true })
}
if (res.data.charactersStatus == 1) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () {
that.setData({
flag: true
})
}
}) })
} }
}, 2000)
} else if (res.data.charactersStatus == 0) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
}) })
} setTimeout(function () {
}, 2000) wx.removeStorageSync('tplbDetail')
} else if (res == 0) { wx.removeStorageSync('weiLb')
// clearTimeout(timer) wx.reLaunch({
wx.showToast({ url: '/pages/record/record',
title: '上传成功', success: function () {
icon: 'success', that.setData({
duration: 2000 flag: true
}) })
setTimeout(function () { wx.removeStorageSync('lb_descript');
wx.removeStorageSync('tplbDetail') wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('weiLb') wx.removeStorageSync('g_id');
wx.reLaunch({ wx.removeStorageSync('param_t_openid');
// url: '/pages/end/end?lbtype=-1', }
url: '/pages/record/record',
success: function () {
that.setData({
flag: true
}) })
wx.removeStorageSync('lb_descript'); }, 2000)
wx.removeStorageSync('allUserinfo'); } else {
wx.removeStorageSync('g_id'); }
wx.removeStorageSync('param_t_openid'); }
} // var swiper_arr = wx.getStorageSync('swiper_arr');
}) // var data1 = {};
}, 2000) // // var urls = Api.HOST + 'wechat.php?s=Home/del_vip';
} else { // 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.user_stime = time;
// data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// var tp_characters_id = wx.getStorageSync("tplbDetail");
// data1.unitid = unitid;
// data1.characters_id = tp_characters_id.g_id;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// clearTimeout(timer)
// Api.fetchPost(urls, data1, (err, res) => {
// if (err) {
// that.setData({
// flag: true
// })
// }
// that.setData({
// flag: true
// })
// if (res == 1 || res == 0) {
// wx.removeStorageSync('answer_swiper')
// wx.removeStorageSync('swiper_arr')
// wx.removeStorageSync('chaTime')
// wx.removeStorageSync('endTime')
// wx.removeStorageSync('startTime')
// wx.removeStorageSync('timeArr')
// wx.removeStorageSync('lb_swiper_con')
// wx.hideLoading();
// } else {
// wx.hideLoading()
// wx.showToast({
// title: '请稍后再试',
// icon: 'none',
// duration: 2000
// })
// }
// console.log('res', res)
// if (res == 1) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// wx.removeStorageSync('canvas')
// setTimeout(function () {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// url: '/pages/info1/info1?otype=1&otype1=1',
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// } else {
// var g_id = wx.getStorageSync('g_id');
// wx.reLaunch({
// url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// }
// }, 2000)
// } else if (res == 0) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// setTimeout(function () {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.reLaunch({
// // url: '/pages/end/end?lbtype=-1',
// url: '/pages/record/record',
// success: function () {
// that.setData({
// flag: true
// })
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }, 2000)
// } else {
// }
// })
}) })
} }
}, },
...@@ -991,6 +1070,12 @@ var pageData = { ...@@ -991,6 +1070,12 @@ var pageData = {
user_answer: JSON.stringify(that.data.userInfo1), user_answer: JSON.stringify(that.data.userInfo1),
answer: JSON.stringify(that.data.userInfo1), answer: JSON.stringify(that.data.userInfo1),
}; };
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData'; var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
...@@ -1011,140 +1096,210 @@ var pageData = { ...@@ -1011,140 +1096,210 @@ var pageData = {
let newdata = Object.assign({...ndata,...formdata}); let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata); newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => { 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;
} } else if (Number(res.code) == -1) {
if (Number(res.code) == -1) {
wx.hideLoading(); wx.hideLoading();
Api.alert(res.msg) Api.alert(res.msg)
that.setData({ that.setData({
flag: true flag: true
}) })
return; return;
}
var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {};
// 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.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
var tp_characters_id = wx.getStorageSync("tplbDetail");
data1.unitid = unitid;
data1.characters_id = tp_characters_id.g_id;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = user.openid;
data1.is_type = 1;
data1.unitid = lb_descript.desc.unitid;
data1.measure_id = lb_descript.id[0];
}
// clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => {
// console.log('5555555555555', res)
if (err) {
that.setData({ that.setData({
flag: true flag: true
}) })
} if (res.data.charactersStatus == 1 || res.data.charactersStatus == 0) {
that.setData({ wx.removeStorageSync('answer_swiper')
flag: true wx.removeStorageSync('swiper_arr')
}) wx.removeStorageSync('chaTime')
if (res == 1 || res == 0) { wx.removeStorageSync('endTime')
wx.removeStorageSync('answer_swiper') wx.removeStorageSync('startTime')
wx.removeStorageSync('swiper_arr') wx.removeStorageSync('timeArr')
wx.removeStorageSync('chaTime') wx.removeStorageSync('lb_swiper_con')
wx.removeStorageSync('endTime') wx.hideLoading();
wx.removeStorageSync('startTime')
wx.removeStorageSync('timeArr')
wx.removeStorageSync('lb_swiper_con')
wx.hideLoading();
} else {
wx.hideLoading()
wx.showToast({
title: '请稍后再试',
icon: 'none',
duration: 2000
})
}
console.log('res', res)
if (res == 1) {
// clearTimeout(timer)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else { } else {
var g_id = wx.getStorageSync('g_id'); wx.hideLoading()
wx.reLaunch({ wx.showToast({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`, title: '请稍后再试',
success: function () { icon: 'none',
that.setData({ duration: 2000
flag: true })
}
if (res.data.charactersStatus == 1) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
wx.removeStorageSync('canvas')
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () {
that.setData({
flag: true
})
}
}) })
} }
}, 2000)
} else if (res.data.charactersStatus == 0) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
}) })
} setTimeout(function () {
}, 2000) wx.removeStorageSync('tplbDetail')
} else if (res == 0) { wx.removeStorageSync('weiLb')
// clearTimeout(timer) wx.reLaunch({
wx.showToast({ url: '/pages/record/record',
title: '上传成功', success: function () {
icon: 'success', that.setData({
duration: 2000 flag: true
}) })
setTimeout(function () { wx.removeStorageSync('lb_descript');
wx.removeStorageSync('tplbDetail') wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('weiLb') wx.removeStorageSync('g_id');
wx.reLaunch({ wx.removeStorageSync('param_t_openid');
// url: '/pages/end/end?lbtype=-1', }
url: '/pages/record/record',
success: function () {
that.setData({
flag: true
}) })
wx.removeStorageSync('lb_descript'); }, 2000)
wx.removeStorageSync('allUserinfo'); } else {
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid'); }
} }
}) // var swiper_arr = wx.getStorageSync('swiper_arr');
}, 2000) // var data1 = {};
} else { // 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.user_stime = time;
// data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// var tp_characters_id = wx.getStorageSync("tplbDetail");
// data1.unitid = unitid;
// data1.characters_id = tp_characters_id.g_id;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// Api.fetchPost(urls, data1, (err, res) => {
// if (err) {
// that.setData({
// flag: true
// })
// }
// that.setData({
// flag: true
// })
// if (res == 1 || res == 0) {
// wx.removeStorageSync('answer_swiper')
// wx.removeStorageSync('swiper_arr')
// wx.removeStorageSync('chaTime')
// wx.removeStorageSync('endTime')
// wx.removeStorageSync('startTime')
// wx.removeStorageSync('timeArr')
// wx.removeStorageSync('lb_swiper_con')
// wx.hideLoading();
} // } else {
}) // wx.hideLoading()
// wx.showToast({
// title: '请稍后再试',
// icon: 'none',
// duration: 2000
// })
// }
// console.log('res', res)
// if (res == 1) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// wx.removeStorageSync('canvas')
// setTimeout(function () {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// url: '/pages/info1/info1?otype=1&otype1=1',
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// } else {
// var g_id = wx.getStorageSync('g_id');
// wx.reLaunch({
// url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// }
// }, 2000)
// } else if (res == 0) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// setTimeout(function () {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.reLaunch({
// // url: '/pages/end/end?lbtype=-1',
// url: '/pages/record/record',
// success: function () {
// that.setData({
// flag: true
// })
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }, 2000)
// } else {
// }
// })
}) })
} }
}, },
......
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
sendAnswerOption sendAnswerOption
} from '../../utils/scale/dati08.js' } from '../../utils/scale/dati08.js'
import datiTestData from '../../utils/scale/dati08TestData' import datiTestData from '../../utils/scale/dati08TestData'
var Api = require('../../utils/api.js');
Page({ Page({
data: { data: {
currentIndex: 0, currentIndex: 0,
...@@ -309,6 +310,12 @@ Page({ ...@@ -309,6 +310,12 @@ Page({
user_answer: sendDataScore, user_answer: sendDataScore,
answer: sendDataOption, answer: sendDataOption,
}; };
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
ndata.is_type = 0;
} else {
ndata.is_type = 1;
}
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData'; var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid; ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6; ndata.uid = 6;
...@@ -328,8 +335,7 @@ Page({ ...@@ -328,8 +335,7 @@ Page({
var formdata = wx.getStorageSync('allUserinfo'); var formdata = wx.getStorageSync('allUserinfo');
let newdata = Object.assign({...ndata,...formdata}); let newdata = Object.assign({...ndata,...formdata});
newdata = this.removeEmptyProperties(newdata); newdata = this.removeEmptyProperties(newdata);
// var url = HOST_xinli + 'xinli/index.php/Api/add_res'; fetchPostN(url,newdata,(err,res)=>{
fetchPostN(url,data,(err,res)=>{
clearTimeout(uploadData); clearTimeout(uploadData);
if (+res == 0) { if (+res == 0) {
wx.showModal({ wx.showModal({
...@@ -337,118 +343,186 @@ Page({ ...@@ -337,118 +343,186 @@ Page({
title: "提交失败,请重新提交。" title: "提交失败,请重新提交。"
}) })
return; return;
} } else if (Number(res.code) == -1) {
if (Number(res.code) == -1) {
wx.hideLoading(); wx.hideLoading();
Api.alert(res.msg) Api.alert(res.msg)
that.setData({ that.setData({
flag: true flag: true
}) })
return; 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.user_stime = user_stime;
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
var unitid = wx.getStorageSync("unitid");
data1.unitid = unitid;
data1.z_openid = lb_descript.desc.z_openid;
data1.t_openid = lb_descript.desc.t_openid;
data1.openid = lb_descript.desc.z_openid;
data1.is_type = 0;
data1.measure_id = lb_descript.id[0];
} else { } else {
data1.z_openid = user.openid; if (res.data.charactersStatus == 1 || res.data.charactersStatus == 0) {
data1.t_openid = lb_descript.desc.t_openid; wx.removeStorageSync('lb_swiper_con');
data1.openid = user.openid; //删除答题记录缓存
data1.is_type = 1; wx.removeStorageSync('answerRecordCache05')
data1.unitid = lb_descript.desc.unitid; //删除计时
data1.measure_id = lb_descript.id[0]; wx.removeStorageSync('takeTime05')
} wx.hideLoading();
// var urls = HOST + 'wechat.php?s=Home/del_vip' }else {
var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips' wx.hideLoading()
fetchPost(urls,data1,(err,res)=>{ wx.showToast({
title: '请稍后再试',
if (res == 1 || res == 0) { icon: 'none',
wx.removeStorageSync('lb_swiper_con'); duration: 2000
//删除答题记录缓存
wx.removeStorageSync('answerRecordCache05')
//删除计时
wx.removeStorageSync('takeTime05')
wx.hideLoading();
}else {
wx.hideLoading()
wx.showToast({
title: '请稍后再试',
icon: 'none',
duration: 2000
})
that.setData({
flag: true
})
}
if (res == 1) {
// clearTimeout(timer)
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
})
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
}) })
} else { that.setData({
var g_id = wx.getStorageSync('g_id'); flag: true
wx.reLaunch({ })
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`, }
success: function () { if (res.data.charactersStatus == 1) {
that.setData({ wx.showToast({
flag: true title: '上传成功',
icon: 'success',
duration: 2000
})
setTimeout(function () {
var lb_tz = wx.getStorageSync('lb_tz');
if (lb_tz == '1') {
wx.reLaunch({
url: '/pages/info1/info1?otype=1&otype1=1',
success: function () {
that.setData({
flag: true
})
}
})
} else {
var g_id = wx.getStorageSync('g_id');
wx.reLaunch({
url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
success: function () {
that.setData({
flag: true
})
}
}) })
} }
}, 2000)
} else if (res.data.charactersStatus == 0) {
wx.showToast({
title: '上传成功',
icon: 'success',
duration: 2000
}) })
} setTimeout(function () {
}, 2000) wx.removeStorageSync('tplbDetail')
} else if (res == 0) { wx.removeStorageSync('weiLb')
wx.showToast({ wx.reLaunch({
title: '上传成功', url: '/pages/record/record',
icon: 'success', success: function () {
duration: 2000 that.setData({
}) flag: true
setTimeout(function () { })
wx.removeStorageSync('tplbDetail') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('weiLb') wx.removeStorageSync('allUserinfo');
wx.reLaunch({ wx.removeStorageSync('g_id');
url: '/pages/record/record', wx.removeStorageSync('param_t_openid');
success: function () { }
that.setData({
flag: true
}) })
wx.removeStorageSync('lb_descript'); }, 2000)
wx.removeStorageSync('allUserinfo'); } else {
wx.removeStorageSync('g_id');
wx.removeStorageSync('param_t_openid'); }
} }
}) // var data1 = {};
}, 2000) // var ti_title = this.data.scaleData.measure_name;
} else { // 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.user_stime = user_stime;
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// var unitid = wx.getStorageSync("unitid");
// data1.unitid = unitid;
// data1.z_openid = lb_descript.desc.z_openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = lb_descript.desc.z_openid;
// data1.is_type = 0;
// data1.measure_id = lb_descript.id[0];
// } else {
// data1.z_openid = user.openid;
// data1.t_openid = lb_descript.desc.t_openid;
// data1.openid = user.openid;
// data1.is_type = 1;
// data1.unitid = lb_descript.desc.unitid;
// data1.measure_id = lb_descript.id[0];
// }
// var urls = Api.HOST_xlxl + 'wechat.php?s=Home/del_vips'
// fetchPost(urls,data1,(err,res)=>{
// if (res == 1 || res == 0) {
// wx.removeStorageSync('lb_swiper_con');
// //删除答题记录缓存
// wx.removeStorageSync('answerRecordCache05')
// //删除计时
// wx.removeStorageSync('takeTime05')
// wx.hideLoading();
// }else {
// wx.hideLoading()
// wx.showToast({
// title: '请稍后再试',
// icon: 'none',
// duration: 2000
// })
// that.setData({
// flag: true
// })
// }
// if (res == 1) {
// // clearTimeout(timer)
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// setTimeout(function () {
// var lb_tz = wx.getStorageSync('lb_tz');
// if (lb_tz == '1') {
// wx.reLaunch({
// url: '/pages/info1/info1?otype=1&otype1=1',
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// } else {
// var g_id = wx.getStorageSync('g_id');
// wx.reLaunch({
// url: `/pages/info/info?otype=1&otype1=1&ishow=1&g_id=${g_id}`,
// success: function () {
// that.setData({
// flag: true
// })
// }
// })
// }
// }, 2000)
// } else if (res == 0) {
// wx.showToast({
// title: '上传成功',
// icon: 'success',
// duration: 2000
// })
// setTimeout(function () {
// wx.removeStorageSync('tplbDetail')
// wx.removeStorageSync('weiLb')
// wx.reLaunch({
// url: '/pages/record/record',
// success: function () {
// that.setData({
// flag: true
// })
// wx.removeStorageSync('lb_descript');
// wx.removeStorageSync('allUserinfo');
// wx.removeStorageSync('g_id');
// wx.removeStorageSync('param_t_openid');
// }
// })
// }, 2000)
// } else {
} // }
}) // })
}) })
} }
}, },
......
...@@ -377,40 +377,39 @@ Page({ ...@@ -377,40 +377,39 @@ Page({
} }
}, },
local() { // local() {
var that = this // var that = this
var data = wx.getStorageSync('data'); // var data = wx.getStorageSync('data');
if (!data) { // if (!data) {
this.main(); // this.main();
} // }
var BMap = new bmap.BMapWX({ // var BMap = new bmap.BMapWX({
ak: 'ex35RMokKmaz0qyifXBl88IClsom3IdZ' // ak: 'ex35RMokKmaz0qyifXBl88IClsom3IdZ'
}); // });
var str = ''; // var str = '';
wx.getLocation({ // wx.getLocation({
type: 'wgs84', // type: 'wgs84',
success: function (res) { // success: function (res) {
var latitude = res.latitude // var latitude = res.latitude
var longitude = res.longitude // var longitude = res.longitude
var str = latitude + ',' + longitude // var str = latitude + ',' + longitude
BMap.regeocoding({ // BMap.regeocoding({
// fail: fail, // location: str,
location: str, // success: function (res) {
success: function (res) { // var s = res.originalData.result.addressComponent.city;
var s = res.originalData.result.addressComponent.city; // that.register(s)
that.register(s) // },
}, // fail: function () {
fail: function () { // console.log('解析地址失败')
console.log('解析地址失败') // }
} // });
}); // },
}, // fail: function () {
fail: function () { // let str = ''
let str = '' // that.register(str);
that.register(str); // }
} // })
}) // },
},
queding: function () { queding: function () {
var data = wx.getStorageSync('data'); var data = wx.getStorageSync('data');
if (!data) { if (!data) {
......
...@@ -496,13 +496,10 @@ Page({ ...@@ -496,13 +496,10 @@ Page({
} }
wx.setStorageSync("judgeSex", judgeSex); wx.setStorageSync("judgeSex", judgeSex);
wx.setStorageSync("allUserinfo", data); wx.setStorageSync("allUserinfo", data);
// Api.fetchPost(urlt, data, (err, res) => {
wx.hideLoading() wx.hideLoading()
clearTimeout(timer1) clearTimeout(timer1)
// if (res.ret == 1) {
if (that.data.otype == 0 && that.data.lb_tz == '-1') { if (that.data.otype == 0 && that.data.lb_tz == '-1') {
wx.navigateTo({ wx.navigateTo({
// url: '/pages/swiper/swiper?otype=11',
url: '/pages/dati04/dati04?otype=11', url: '/pages/dati04/dati04?otype=11',
success: function () { success: function () {
wx.hideLoading() wx.hideLoading()
...@@ -588,15 +585,6 @@ Page({ ...@@ -588,15 +585,6 @@ Page({
} }
}) })
} }
// } else {
// Api.alert(res.msg, function () {
// that.setData({
// payInfo: true
// })
// });
// }
// });
} }
} }
}) })
......
...@@ -152,7 +152,7 @@ Page({ ...@@ -152,7 +152,7 @@ Page({
* a 接受的参数 数组 * a 接受的参数 数组
**/ **/
dealData(a) { dealData(a) {
console.log(a, 'a') // console.log(a, 'a')
let classification = [] let classification = []
let arr1 = []; let arr1 = [];
for (var i in a) { for (var i in a) {
...@@ -180,7 +180,7 @@ Page({ ...@@ -180,7 +180,7 @@ Page({
if (arr1[i].arr.length != 0) { if (arr1[i].arr.length != 0) {
arr2.push(arr1[i]) arr2.push(arr1[i])
} }
console.log(arr2,"arr2s") // console.log(arr2,"arr2s")
this.setData({ this.setData({
arr: arr2, arr: arr2,
}) })
......
...@@ -57,14 +57,14 @@ function formatNumber(n) { ...@@ -57,14 +57,14 @@ function formatNumber(n) {
return n[1] ? n : '0' + n return n[1] ? n : '0' + n
} }
function getLoc(callback) { // function getLoc(callback) {
wx.getLocation({ // wx.getLocation({
type: 'wgs84', // type: 'wgs84',
success: function (res) { // success: function (res) {
callback(res) // callback(res)
} // }
}) // })
} // }
function stripTags(str, r_str = "") { function stripTags(str, r_str = "") {
//去掉所有的html标记 //去掉所有的html标记
...@@ -358,7 +358,7 @@ function validateIdCard(idCard) { ...@@ -358,7 +358,7 @@ function validateIdCard(idCard) {
module.exports = { module.exports = {
base64src:base64src, base64src:base64src,
formatTime: formatTime, formatTime: formatTime,
getLoc: getLoc, // getLoc: getLoc,
stripTags: stripTags, stripTags: stripTags,
imageUtil: imageUtil, imageUtil: imageUtil,
Base64: Base64, Base64: Base64,
......
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