Commit 86889619 by 李萌

no message

parent 7b5f3d67
...@@ -1085,27 +1085,40 @@ Page({ ...@@ -1085,27 +1085,40 @@ Page({
answer.score.unshift(wx.getStorageSync('canvas')); answer.score.unshift(wx.getStorageSync('canvas'));
answer.answer.unshift(0); answer.answer.unshift(0);
} }
if (lb_tp == '1') { // if (lb_tp == '1') {
var data = { // var data = {
user_stime: time, // user_stime: time,
user_answer: answer.score, // user_answer: answer.score,
answer: answer.answer, // answer: answer.answer,
user_number: lb_descript.desc.z_openid, // user_number: lb_descript.desc.z_openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
}; // };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} else { // } else {
var data = { // var data = {
user_stime: time, // user_stime: time,
user_answer: answer.score, // user_answer: answer.score,
answer: answer.answer, // answer: answer.answer,
user_number: user.openid, // user_number: user.openid,
measure_id: lb_descript.id[0], // measure_id: lb_descript.id[0],
g_id: wx.getStorageSync('g_id') // g_id: wx.getStorageSync('g_id')
}; // };
var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res'; // var url = Api.HOST_xinli + 'xinli/index.php/Api/add_res';
} // }
data.unitid = lb_descript.desc.unitid; var stoUser = wx.getStorageSync('user');
var ndata = {
measure_id: lb_descript.id[0],
user_stime: time,
g_id: wx.getStorageSync('g_id'),
openid:stoUser.openid ? stoUser.openid : '',
user_answer: answer.score,
answer: answer.answer,
};
var url = Api.HOST_xlxl + 'amedical.php/gauge/pcAddData';
ndata.unitid = lb_descript.desc.unitid;
ndata.uid = 6;
ndata.submit_type = 2;
ndata.t_openid = wx.getStorageSync('param_t_openid');
var uploadData = setTimeout(function () { var uploadData = setTimeout(function () {
wx.hideLoading() wx.hideLoading()
wx.showToast({ wx.showToast({
...@@ -1117,24 +1130,35 @@ Page({ ...@@ -1117,24 +1130,35 @@ Page({
flag: true flag: true
}) })
}, 5000) }, 5000)
var formdata = wx.getStorageSync('allUserinfo');
Api.fetchPostN(url, data, (err, res) => { let newdata = Object.assign({...ndata,...formdata});
console.log(res, 'resllo') newdata = this.removeEmptyProperties(newdata);
Api.fetchPostN(url, newdata, (err, res) => {
// console.log(res, 'resllo')
clearTimeout(uploadData) clearTimeout(uploadData)
if (Number(res) == 0) { if (Number(res) == 0) {
Api.alert("提交失败,请重新提交。") Api.alert("提交失败,请重新提交。")
return; return;
} }
if (Number(res.code) == -1) {
wx.hideLoading();
Api.alert(res.msg)
that.setData({
flag: true
})
return;
}
var swiper_arr = wx.getStorageSync('swiper_arr'); var swiper_arr = wx.getStorageSync('swiper_arr');
var data1 = {}; var data1 = {};
var urls = Api.HOST + 'wechat.php?s=Home/del_vip'; // var urls = Api.HOST + 'wechat.php?s=Home/del_vip';
var urls = Api.HOST + 'wechat.php?s=Home/del_vips';
var ti_title = swiper_arr[0].measure_name; var ti_title = swiper_arr[0].measure_name;
var lb_descript = wx.getStorageSync("lb_descript"); var lb_descript = wx.getStorageSync("lb_descript");
var authorize = wx.getStorageSync('weiLb'); var authorize = wx.getStorageSync('weiLb');
data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time; data1.g_time = lb_descript.desc.g_time || lb_descript.desc.time;
data1.measure_name = ti_title; data1.measure_name = ti_title;
data1.res_id = res; // data1.res_id = res;
data1.user_stime = time; data1.user_stime = time;
data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id; data1.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
var lb_tz = wx.getStorageSync('lb_tz'); var lb_tz = wx.getStorageSync('lb_tz');
...@@ -1158,7 +1182,7 @@ Page({ ...@@ -1158,7 +1182,7 @@ Page({
} }
// clearTimeout(timer) // clearTimeout(timer)
Api.fetchPost(urls, data1, (err, res) => { Api.fetchPost(urls, data1, (err, res) => {
console.log('5555555555555', res) // console.log('5555555555555', res)
if (err) { if (err) {
that.setData({ that.setData({
flag: true flag: true
...@@ -1186,7 +1210,7 @@ Page({ ...@@ -1186,7 +1210,7 @@ Page({
}) })
} }
console.log('res', res) // console.log('res', res)
if (res == 1) { if (res == 1) {
// clearTimeout(timer) // clearTimeout(timer)
...@@ -1235,7 +1259,9 @@ Page({ ...@@ -1235,7 +1259,9 @@ Page({
that.setData({ that.setData({
flag: true flag: true
}) })
wx.removeStorageSync('lb_descript') wx.removeStorageSync('lb_descript');
wx.removeStorageSync('allUserinfo');
wx.removeStorageSync('param_t_openid');
} }
}) })
}, 2000) }, 2000)
...@@ -1381,4 +1407,13 @@ Page({ ...@@ -1381,4 +1407,13 @@ Page({
}, 200) }, 200)
} }
}, },
removeEmptyProperties:function (obj) {
// 将对象转换为 [key, value] 数组
const entries = Object.entries(obj);
// 过滤掉属性值为空字符串的属性
const filteredEntries = entries.filter(([key, value]) => value !== ""&&value != 0&&value != 'undefined'&&value != null&&value != 'null'&&value != 'NULL');
// 将过滤后的数组转换回对象
const filteredObj = Object.fromEntries(filteredEntries);
return filteredObj;
},
}) })
\ No newline at end of file
...@@ -205,7 +205,10 @@ Page({ ...@@ -205,7 +205,10 @@ Page({
}) })
}); });
} else { } 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) { if (res.unitid == 737) {
that.setData({ that.setData({
...@@ -388,6 +391,16 @@ Page({ ...@@ -388,6 +391,16 @@ Page({
wx.setStorageSync('lb_swiper_con', lb_swiper_con); wx.setStorageSync('lb_swiper_con', lb_swiper_con);
}, },
submit: function () { 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; var that = this;
if (this.data.measure_id == 86) { if (this.data.measure_id == 86) {
that.cmi(); that.cmi();
...@@ -405,7 +418,7 @@ Page({ ...@@ -405,7 +418,7 @@ Page({
var user = wx.getStorageSync('user'); var user = wx.getStorageSync('user');
var unitid = wx.getStorageSync('data').unitid; var unitid = wx.getStorageSync('data').unitid;
var authorize = wx.getStorageSync("weiLb"); var authorize = wx.getStorageSync("weiLb");
var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two'; // var urlt = Api.HOST + 'wechat.php?s=Home/stinfo_two';
var data = {}; var data = {};
data.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id; data.characters_id = authorize.characters_id ? authorize.characters_id : authorize.record_id;
data.unitid = unitid ? unitid : ''; data.unitid = unitid ? unitid : '';
...@@ -466,10 +479,11 @@ Page({ ...@@ -466,10 +479,11 @@ Page({
judgeSex = 1; judgeSex = 1;
} }
wx.setStorageSync("judgeSex", judgeSex); wx.setStorageSync("judgeSex", judgeSex);
Api.fetchPost(urlt, data, (err, res) => { wx.setStorageSync("allUserinfo", data);
// Api.fetchPost(urlt, data, (err, res) => {
wx.hideLoading() wx.hideLoading()
clearTimeout(timer1) clearTimeout(timer1)
if (res.ret == 1) { // if (res.ret == 1) {
if (that.data.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/swiper/swiper?otype=11',
...@@ -559,14 +573,14 @@ Page({ ...@@ -559,14 +573,14 @@ Page({
}) })
} }
} else { // } else {
Api.alert(res.msg, function () { // Api.alert(res.msg, function () {
that.setData({ // that.setData({
payInfo: true // payInfo: true
}) // })
}); // });
} // }
}); // });
} }
} }
}) })
......
{ {
"description": "项目配置文件", "description": "项目配置文件",
"packOptions": { "packOptions": {
"ignore": [] "ignore": [],
}, "include": []
"setting": {
"urlCheck": false,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"lazyloadPlaceholderEnable": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}, },
"enableEngineNative": false, "setting": {
"useIsolateContext": true, "urlCheck": false,
"userConfirmedBundleSwitch": false, "es6": true,
"packNpmManually": false, "enhance": false,
"packNpmRelationList": [], "postcss": true,
"minifyWXSS": true, "preloadBackgroundData": false,
"disableUseStrict": false, "minified": true,
"showES6CompileOption": false, "newFeature": false,
"useCompilerPlugins": false, "coverView": true,
"minifyWXML": true "nodeModules": false,
}, "autoAudits": false,
"compileType": "miniprogram", "showShadowRootInWxmlPanel": true,
"libVersion": "2.17.0", "scopeDataCheck": false,
"appid": "wx7e3adcd1c8801b3c", "uglifyFileName": false,
"projectname": "XLCT-XAMJW", "checkInvalidKey": true,
"debugOptions": { "checkSiteMap": true,
"hidedInDevtools": [] "uploadWithSourceMap": true,
}, "compileHotReLoad": false,
"scripts": {}, "lazyloadPlaceholderEnable": false,
"staticServerOptions": { "useMultiFrameRuntime": true,
"baseURL": "", "useApiHook": true,
"servePath": "" "useApiHostProcess": true,
}, "babelSetting": {
"isGameTourist": false, "ignore": [],
"condition": { "disablePlugins": [],
"search": { "outputPath": ""
"list": [] },
"enableEngineNative": false,
"useIsolateContext": true,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": true,
"disableUseStrict": false,
"showES6CompileOption": false,
"useCompilerPlugins": false,
"minifyWXML": true
}, },
"conversation": { "compileType": "miniprogram",
"list": [] "libVersion": "2.17.0",
}, "appid": "wx7e3adcd1c8801b3c",
"game": { "projectname": "XLCT-XAMJW",
"list": [] "condition": {},
}, "editorSetting": {
"plugin": { "tabIndent": "insertSpaces",
"list": [] "tabSize": 4
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
} }
}
} }
\ 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/"; // 加载 ...@@ -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_banner = 'https://www.xiaodongai.com/xiaodongai/kongtian/'; // banner
var HOST_xinli_lb = 'https://static.xiaodongai.com/'; // 量表 var HOST_xinli_lb = 'https://static.xiaodongai.com/'; // 量表
var HOST_Share = "https://static.xiaodongai.com/xiaodong_yiyuan/kongtian/"; var HOST_Share = "https://static.xiaodongai.com/xiaodong_yiyuan/kongtian/";
// var HOST_xlxl = 'https://online-xlxl.xiaodongai.com/';
var HOST_xlxl = 'https://demos-xlxl.xiaodongai.com/';
// get请求方法 // get请求方法
function fetchGet(url, callback) { function fetchGet(url, callback) {
// return callback(null, top250) // return callback(null, top250)
...@@ -224,6 +226,7 @@ module.exports = { ...@@ -224,6 +226,7 @@ module.exports = {
HOST_xinli: HOST_xinli, HOST_xinli: HOST_xinli,
HOST: HOST, HOST: HOST,
HOST_info: HOST_info, HOST_info: HOST_info,
HOST_xlxl:HOST_xlxl,
fetchGet: fetchGet, //get方法 fetchGet: fetchGet, //get方法
fetchGetN:fetchGetN, fetchGetN:fetchGetN,
fetchPost: fetchPost, //post方法 fetchPost: fetchPost, //post方法
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment