Commit 86889619 by 李萌

no message

parent 7b5f3d67
......@@ -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,
// 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],
};
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else {
var data = {
user_stime: time,
g_id: wx.getStorageSync('g_id'),
openid:stoUser.openid ? stoUser.openid : '',
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;
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,35 @@ 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 + '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 +1182,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 +1210,7 @@ Page({
})
}
console.log('res', res)
// console.log('res', res)
if (res == 1) {
// clearTimeout(timer)
......@@ -1235,7 +1259,9 @@ Page({
that.setData({
flag: true
})
wx.removeStorageSync('lb_descript')
wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('param_t_openid');
}
})
}, 2000)
......@@ -1381,4 +1407,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
......@@ -205,7 +205,10 @@ Page({
})
});
} else {
wx.setStorageSync('weiLb', res)
wx.setStorageSync('weiLb', res);
if(res.t_openid) {
wx.setStorageSync('param_t_openid',res.t_openid);
}
// 是否有未做完的题
if (res.unitid == 737) {
that.setData({
......@@ -388,6 +391,16 @@ Page({
wx.setStorageSync('lb_swiper_con', lb_swiper_con);
},
submit: function () {
var userOpenid = wx.getStorageSync('user').openid;
if(userOpenid == '' || userOpenid == 'undefined' || userOpenid == null || userOpenid == 'null' || userOpenid == 'NULL') {
Api.alert("数据异常,请尝试重新进入小程序");
return false;
}
var paramtOpenid = wx.getStorageSync('param_t_openid');
if(paramtOpenid == '' || paramtOpenid == 'undefined' || paramtOpenid == null || paramtOpenid == 'null' || paramtOpenid == 'NULL') {
Api.alert("请重新扫码");
return false;
}
var that = this;
if (this.data.measure_id == 86) {
that.cmi();
......@@ -405,7 +418,7 @@ Page({
var user = wx.getStorageSync('user');
var unitid = wx.getStorageSync('data').unitid;
var authorize = wx.getStorageSync("weiLb");
var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two';
// var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two';
var data = {};
data.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
data.unitid = unitid ? unitid : '';
......@@ -466,10 +479,11 @@ Page({
judgeSex = 1;
}
wx.setStorageSync("judgeSex", judgeSex);
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.otype == 0 && that.data.lb_tz == '-1') {
wx.navigateTo({
// url: '/pages/swiper/swiper?otype=11',
......@@ -559,14 +573,14 @@ Page({
})
}
} else {
Api.alert(res.msg, function () {
that.setData({
payInfo: true
})
});
}
});
// } else {
// Api.alert(res.msg, function () {
// that.setData({
// payInfo: true
// })
// });
// }
// });
}
}
})
......
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
"ignore": [],
"include": []
},
"setting": {
"urlCheck": false,
......@@ -45,33 +46,9 @@
"libVersion": "2.17.0",
"appid": "wx7e3adcd1c8801b3c",
"projectname": "XLCT-XAMJW",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 4
}
}
\ No newline at end of file
{
"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
......@@ -8,6 +8,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 +226,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