Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
XAMJW-Hospita
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wechatminiprogram
XAMJW-Hospita
Commits
86889619
Commit
86889619
authored
Sep 08, 2023
by
李萌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
7b5f3d67
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
151 additions
and
114 deletions
+151
-114
pages/dati04/dati04.js
+65
-29
pages/info/info.js
+26
-12
project.config.json
+49
-73
project.private.config.json
+8
-0
utils/api.js
+3
-0
No files found.
pages/dati04/dati04.js
View file @
86889619
...
...
@@ -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,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
pages/info/info.js
View file @
86889619
...
...
@@ -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
//
})
//
});
//
}
//
});
}
}
})
...
...
project.config.json
View file @
86889619
{
"description"
:
"项目配置文件"
,
"packOptions"
:
{
"ignore"
:
[]
},
"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"
:
""
"description"
:
"项目配置文件"
,
"packOptions"
:
{
"ignore"
:
[],
"include"
:
[]
},
"enableEngineNative"
:
false
,
"useIsolateContext"
:
true
,
"userConfirmedBundleSwitch"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
,
"disableUseStrict"
:
false
,
"showES6CompileOption"
:
false
,
"useCompilerPlugins"
:
false
,
"minifyWXML"
:
true
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.17.0"
,
"appid"
:
"wx7e3adcd1c8801b3c"
,
"projectname"
:
"XLCT-XAMJW"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
},
"scripts"
:
{},
"staticServerOptions"
:
{
"baseURL"
:
""
,
"servePath"
:
""
},
"isGameTourist"
:
false
,
"condition"
:
{
"search"
:
{
"list"
:
[]
"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
,
"useIsolateContext"
:
true
,
"userConfirmedBundleSwitch"
:
false
,
"packNpmManually"
:
false
,
"packNpmRelationList"
:
[],
"minifyWXSS"
:
true
,
"disableUseStrict"
:
false
,
"showES6CompileOption"
:
false
,
"useCompilerPlugins"
:
false
,
"minifyWXML"
:
true
},
"conversation"
:
{
"list"
:
[]
},
"game"
:
{
"list"
:
[]
},
"plugin"
:
{
"list"
:
[]
},
"gamePlugin"
:
{
"list"
:
[]
},
"miniprogram"
:
{
"list"
:
[]
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.17.0"
,
"appid"
:
"wx7e3adcd1c8801b3c"
,
"projectname"
:
"XLCT-XAMJW"
,
"condition"
:
{},
"editorSetting"
:
{
"tabIndent"
:
"insertSpaces"
,
"tabSize"
:
4
}
}
}
\ No newline at end of file
project.private.config.json
0 → 100644
View file @
86889619
{
"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
utils/api.js
View file @
86889619
...
...
@@ -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方法
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment