Commit 9218b7e1 by 李萌

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

答题提交流程优化

See merge request !1
parents 70e885fd 309d76f5
......@@ -293,6 +293,12 @@ Page({
user_answer: answer.score,
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';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
......@@ -317,81 +323,115 @@ Page({
flag: true
})
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 {
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
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')
// wx.removeStorageSync('lb_descript')
// 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'
})
} 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');
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.data.charactersStatus == 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.data.charactersStatus == 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');
}
})
}
})
}
})
}
// 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');
// }
// })
// }
// })
})
}
},
......
......@@ -377,40 +377,39 @@ Page({
}
},
local() {
var that = this
var data = wx.getStorageSync('data');
if (!data) {
this.main();
}
var BMap = new bmap.BMapWX({
ak: 'ex35RMokKmaz0qyifXBl88IClsom3IdZ'
});
var str = '';
wx.getLocation({
type: 'wgs84',
success: function (res) {
var latitude = res.latitude
var longitude = res.longitude
var str = latitude + ',' + longitude
BMap.regeocoding({
// fail: fail,
location: str,
success: function (res) {
var s = res.originalData.result.addressComponent.city;
that.register(s)
},
fail: function () {
console.log('解析地址失败')
}
});
},
fail: function () {
let str = ''
that.register(str);
}
})
},
// local() {
// var that = this
// var data = wx.getStorageSync('data');
// if (!data) {
// this.main();
// }
// var BMap = new bmap.BMapWX({
// ak: 'ex35RMokKmaz0qyifXBl88IClsom3IdZ'
// });
// var str = '';
// wx.getLocation({
// type: 'wgs84',
// success: function (res) {
// var latitude = res.latitude
// var longitude = res.longitude
// var str = latitude + ',' + longitude
// BMap.regeocoding({
// location: str,
// success: function (res) {
// var s = res.originalData.result.addressComponent.city;
// that.register(s)
// },
// fail: function () {
// console.log('解析地址失败')
// }
// });
// },
// fail: function () {
// let str = ''
// that.register(str);
// }
// })
// },
queding: function () {
var data = wx.getStorageSync('data');
if (!data) {
......
......@@ -496,13 +496,10 @@ Page({
}
wx.setStorageSync("judgeSex", judgeSex);
wx.setStorageSync("allUserinfo", data);
// Api.fetchPost(urlt, data, (err, res) => {
wx.hideLoading()
clearTimeout(timer1)
// if (res.ret == 1) {
if (that.data.otype == 0 && that.data.lb_tz == '-1') {
wx.navigateTo({
// url: '/pages/swiper/swiper?otype=11',
url: '/pages/dati04/dati04?otype=11',
success: function () {
wx.hideLoading()
......@@ -588,15 +585,6 @@ Page({
}
})
}
// } else {
// Api.alert(res.msg, function () {
// that.setData({
// payInfo: true
// })
// });
// }
// });
}
}
})
......
......@@ -152,7 +152,7 @@ Page({
* a 接受的参数 数组
**/
dealData(a) {
console.log(a, 'a')
// console.log(a, 'a')
let classification = []
let arr1 = [];
for (var i in a) {
......@@ -180,7 +180,7 @@ Page({
if (arr1[i].arr.length != 0) {
arr2.push(arr1[i])
}
console.log(arr2,"arr2s")
// console.log(arr2,"arr2s")
this.setData({
arr: arr2,
})
......
......@@ -57,14 +57,14 @@ function formatNumber(n) {
return n[1] ? n : '0' + n
}
function getLoc(callback) {
wx.getLocation({
type: 'wgs84',
success: function (res) {
callback(res)
}
})
}
// function getLoc(callback) {
// wx.getLocation({
// type: 'wgs84',
// success: function (res) {
// callback(res)
// }
// })
// }
function stripTags(str, r_str = "") {
//去掉所有的html标记
......@@ -358,7 +358,7 @@ function validateIdCard(idCard) {
module.exports = {
base64src:base64src,
formatTime: formatTime,
getLoc: getLoc,
// getLoc: getLoc,
stripTags: stripTags,
imageUtil: imageUtil,
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