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
9218b7e1
Commit
9218b7e1
authored
Apr 18, 2024
by
李萌
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'limeng-量表提交流程优化' into 'master'
答题提交流程优化 See merge request
!1
parents
70e885fd
309d76f5
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1227 additions
and
800 deletions
+1227
-800
pages/dati/dati.js
+111
-71
pages/dati03/dati03.js
+130
-88
pages/dati04/dati04.js
+194
-140
pages/dati05/dati05.js
+188
-113
pages/dati06/dati06.js
+385
-230
pages/dati08/dati08.js
+175
-101
pages/fenxiang/fenxiang.js
+33
-34
pages/info/info.js
+0
-12
pages/liangbiao/liangbiao.js
+2
-2
utils/util.js
+9
-9
No files found.
pages/dati/dati.js
View file @
9218b7e1
...
...
@@ -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');
// }
// })
// }
// })
})
}
},
...
...
pages/dati03/dati03.js
View file @
9218b7e1
...
...
@@ -72,7 +72,7 @@ Page({
var
num
=
e
.
currentTarget
.
dataset
.
num
;
var
answer
=
e
.
currentTarget
.
dataset
.
answer
;
var
score
=
e
.
currentTarget
.
dataset
.
score
;
console
.
log
(
num
,
'idnidnidn'
)
//
console.log(num, 'idnidnidn')
this
.
setData
({
num
:
num
})
...
...
@@ -104,13 +104,13 @@ Page({
},
next
:
function
(
e
)
{
console
.
log
(
e
)
//
console.log(e)
let
that
=
this
;
var
lb_rw
=
wx
.
getStorageSync
(
'lb_rw'
);
var
answerData_rw
=
wx
.
getStorageSync
(
'answerData_rw'
);
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
)
{
var
len
=
lb_rw
[
e
].
answer
.
length
==
6
?
1
:
2
;
this
.
setData
({
...
...
@@ -162,19 +162,12 @@ Page({
}
var
thisTime
=
Date
.
parse
(
new
Date
());
var
cha
=
thisTime
-
startTime2
+
chaTime2
;
console
.
log
(
cha
,
'cha'
)
//
console.log(cha, 'cha')
var
time
=
Api
.
reversalTime
(
cha
)
console
.
log
(
time
,
'time'
)
//
console.log(time, 'time')
var
liangbiaoCon
=
wx
.
getStorageSync
(
'liangbiaoCon'
);
var
answer
=
wx
.
getStorageSync
(
'answerData_rw'
);
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
ndata
=
{
measure_id
:
lb_descript
.
id
[
0
],
...
...
@@ -184,7 +177,13 @@ Page({
user_answer
:
answer
.
score
,
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
.
uid
=
6
;
ndata
.
submit_type
=
2
;
...
...
@@ -208,86 +207,129 @@ 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
;
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
.
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
})
wx
.
removeStorageSync
(
'answerData_rw'
)
wx
.
removeStorageSync
(
'chaTime2'
)
wx
.
removeStorageSync
(
'endTime'
)
wx
.
removeStorageSync
(
'startTime2'
)
wx
.
removeStorageSync
(
'timeArr2'
)
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'
,
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'
);
}
else
if
(
res
.
data
.
charactersStatus
==
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
'
);
}
})
}
})
}
})
}
// 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');
// }
// })
// }
// })
})
}
},
...
...
pages/dati04/dati04.js
View file @
9218b7e1
...
...
@@ -1072,12 +1072,9 @@ Page({
var
time
=
Api
.
reversalTime
(
cha
)
var
user
=
wx
.
getStorageSync
(
'user'
);
var
answer
=
wx
.
getStorageSync
(
'answer_swiper'
);
console
.
log
(
answer
.
score
.
length
,
'answer.score.length;'
)
for
(
let
i
=
0
;
i
<
answer
.
score
.
length
;
i
++
)
{
answer
.
score
[
i
]
=
answer
.
score
[
i
].
replace
(
/
[\r\n]
/g
,
''
);
}
console
.
log
(
'answer.score.lengthwwwww;'
)
var
lb_descript
=
wx
.
getStorageSync
(
'lb_descript'
);
var
swiper_arr
=
wx
.
getStorageSync
(
'swiper_arr'
);
var
lb_tp
=
wx
.
getStorageSync
(
'lb_tz'
)
...
...
@@ -1085,26 +1082,6 @@ 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';
// }
var
stoUser
=
wx
.
getStorageSync
(
'user'
);
var
ndata
=
{
measure_id
:
lb_descript
.
id
[
0
],
...
...
@@ -1114,6 +1091,13 @@ 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
;
...
...
@@ -1134,142 +1118,212 @@ Page({
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
)
{
}
else
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_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
)
=>
{
// 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
flag
:
true
})
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
})
}
})
if
(
res
.
data
.
charactersStatus
==
1
||
res
.
data
.
charactersStatus
==
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
{
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
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'请稍后再试'
,
icon
:
'none'
,
duration
:
2000
})
}
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
})
}
},
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
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'
);
}
})
wx
.
removeStorageSync
(
'lb_descript'
);
wx
.
removeStorageSync
(
'allUserinfo'
);
wx
.
removeStorageSync
(
'g_id'
);
wx
.
removeStorageSync
(
'param_t_openid'
);
}
})
},
2000
)
}
else
{
},
2000
)
}
}
// var swiper_arr = wx.getStorageSync('swiper_arr');
// var data1 = {};
// 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];
// }
// 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 {
// }
// })
})
}
},
...
...
pages/dati05/dati05.js
View file @
9218b7e1
...
...
@@ -528,6 +528,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
;
...
...
@@ -552,132 +558,201 @@ Page({
if
(
Number
(
res
)
==
0
)
{
Api
.
alert
(
"提交失败,请重新提交。"
)
return
;
}
if
(
Number
(
res
.
code
)
==
-
1
)
{
}
else
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_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
})
}
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
})
}
})
flag
:
true
})
if
(
res
.
data
.
charactersStatus
==
1
||
res
.
data
.
charactersStatus
==
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
{
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
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'请稍后再试'
,
icon
:
'none'
,
duration
:
2000
})
}
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
})
}
},
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
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'
);
}
})
wx
.
removeStorageSync
(
'lb_descript'
);
wx
.
removeStorageSync
(
'allUserinfo'
);
wx
.
removeStorageSync
(
'g_id'
);
wx
.
removeStorageSync
(
'param_t_openid'
);
}
})
},
2000
)
}
})
},
2000
)
}
}
// var swiper_arr = wx.getStorageSync('swiper_arr');
// var data1 = {};
// 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
// })
// }
// 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)
// }
// })
})
}
},
...
...
pages/dati06/dati06.js
View file @
9218b7e1
...
...
@@ -651,6 +651,12 @@ var pageData = {
user_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'
;
ndata
.
unitid
=
lb_descript
.
desc
.
unitid
;
ndata
.
uid
=
6
;
...
...
@@ -671,137 +677,210 @@ var pageData = {
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
)
{
}
else
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_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
})
}
})
flag
:
true
})
if
(
res
.
data
.
charactersStatus
==
1
||
res
.
data
.
charactersStatus
==
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
{
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
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'请稍后再试'
,
icon
:
'none'
,
duration
:
2000
})
}
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
})
}
},
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
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'
);
}
})
wx
.
removeStorageSync
(
'lb_descript'
);
wx
.
removeStorageSync
(
'allUserinfo'
);
wx
.
removeStorageSync
(
'g_id'
);
wx
.
removeStorageSync
(
'param_t_openid'
);
}
})
},
2000
)
}
else
{
}
})
},
2000
)
}
else
{
}
}
// 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 {
// 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 = {
user_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'
;
ndata
.
unitid
=
lb_descript
.
desc
.
unitid
;
ndata
.
uid
=
6
;
...
...
@@ -1011,140 +1096,210 @@ var pageData = {
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
)
{
}
else
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_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
)
=>
{
// 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
})
}
})
flag
:
true
})
if
(
res
.
data
.
charactersStatus
==
1
||
res
.
data
.
charactersStatus
==
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
{
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
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'请稍后再试'
,
icon
:
'none'
,
duration
:
2000
})
}
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
})
}
},
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
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'
);
}
})
wx
.
removeStorageSync
(
'lb_descript'
);
wx
.
removeStorageSync
(
'allUserinfo'
);
wx
.
removeStorageSync
(
'g_id'
);
wx
.
removeStorageSync
(
'param_t_openid'
);
}
})
},
2000
)
}
else
{
},
2000
)
}
else
{
}
}
// var swiper_arr = wx.getStorageSync('swiper_arr');
// var data1 = {};
// 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 {
// }
// })
})
}
},
...
...
pages/dati08/dati08.js
View file @
9218b7e1
...
...
@@ -7,6 +7,7 @@ import {
sendAnswerOption
}
from
'../../utils/scale/dati08.js'
import
datiTestData
from
'../../utils/scale/dati08TestData'
var
Api
=
require
(
'../../utils/api.js'
);
Page
({
data
:
{
currentIndex
:
0
,
...
...
@@ -309,6 +310,12 @@ Page({
user_answer
:
sendDataScore
,
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'
;
ndata
.
unitid
=
lb_descript
.
desc
.
unitid
;
ndata
.
uid
=
6
;
...
...
@@ -328,8 +335,7 @@ Page({
var
formdata
=
wx
.
getStorageSync
(
'allUserinfo'
);
let
newdata
=
Object
.
assign
({...
ndata
,...
formdata
});
newdata
=
this
.
removeEmptyProperties
(
newdata
);
// var url = HOST_xinli + 'xinli/index.php/Api/add_res';
fetchPostN
(
url
,
data
,(
err
,
res
)
=>
{
fetchPostN
(
url
,
newdata
,(
err
,
res
)
=>
{
clearTimeout
(
uploadData
);
if
(
+
res
==
0
)
{
wx
.
showModal
({
...
...
@@ -337,118 +343,186 @@ Page({
title
:
"提交失败,请重新提交。"
})
return
;
}
if
(
Number
(
res
.
code
)
==
-
1
)
{
}
else
if
(
Number
(
res
.
code
)
==
-
1
)
{
wx
.
hideLoading
();
Api
.
alert
(
res
.
msg
)
that
.
setData
({
flag
:
true
})
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
{
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 = HOST + 'wechat.php?s=Home/del_vip'
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
})
}
if
(
res
.
data
.
charactersStatus
==
1
||
res
.
data
.
charactersStatus
==
0
)
{
wx
.
removeStorageSync
(
'lb_swiper_con'
);
//删除答题记录缓存
wx
.
removeStorageSync
(
'answerRecordCache05'
)
//删除计时
wx
.
removeStorageSync
(
'takeTime05'
)
wx
.
hideLoading
();
}
else
{
wx
.
hideLoading
()
wx
.
showToast
({
title
:
'请稍后再试'
,
icon
:
'none'
,
duration
:
2000
})
}
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
that
.
setData
({
flag
:
true
})
}
if
(
res
.
data
.
charactersStatus
==
1
)
{
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
.
data
.
charactersStatus
==
0
)
{
wx
.
showToast
({
title
:
'上传成功'
,
icon
:
'success'
,
duration
:
2000
})
}
},
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
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'
);
}
})
wx
.
removeStorageSync
(
'lb_descript'
);
wx
.
removeStorageSync
(
'allUserinfo'
);
wx
.
removeStorageSync
(
'g_id'
);
wx
.
removeStorageSync
(
'param_t_openid'
);
}
})
},
2000
)
}
else
{
},
2000
)
}
else
{
}
}
// 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.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 {
}
})
//
}
//
})
})
}
},
...
...
pages/fenxiang/fenxiang.js
View file @
9218b7e1
...
...
@@ -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
)
{
...
...
pages/info/info.js
View file @
9218b7e1
...
...
@@ -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
// })
// });
// }
// });
}
}
})
...
...
pages/liangbiao/liangbiao.js
View file @
9218b7e1
...
...
@@ -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
,
})
...
...
utils/util.js
View file @
9218b7e1
...
...
@@ -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
,
...
...
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