Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-ces
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqinghua
wisdom-ces
Commits
1d8a2caf
Commit
1d8a2caf
authored
Oct 24, 2018
by
wangqinghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
color
parent
248312f9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
37 deletions
+51
-37
duty-sign-up.ts
src/pages/dutyALl/duty-sign-up/duty-sign-up.ts
+25
-29
list.ts
src/pages/surveyManage/list/list.ts
+26
-8
No files found.
src/pages/dutyALl/duty-sign-up/duty-sign-up.ts
View file @
1d8a2caf
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
AppService
}
from
"../../../service/appHttpService"
;
import
{
Geolocation
}
from
"@ionic-native/geolocation"
;
import
{
Component
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
}
from
'ionic-angular'
;
import
{
AppService
}
from
"../../../service/appHttpService"
;
import
{
Geolocation
}
from
"@ionic-native/geolocation"
;
import
*
as
moment
from
"moment"
;
declare
let
AMap
;
@
IonicPage
()
@
Component
({
selector
:
'page-duty-sign-up'
,
...
...
@@ -22,6 +21,7 @@ export class DutySignUpPage {
mainLng
=
121.444888
;
//经度
// mainLng = 121.393319; //经度test
nowDay
;
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
,
public
geolocation
:
Geolocation
)
{
}
...
...
@@ -31,55 +31,51 @@ export class DutySignUpPage {
this
.
nowDay
=
moment
().
format
(
'l'
);
console
.
log
(
this
.
nowDay
);
this
.
id
=
this
.
navParams
.
get
(
'id'
);
const
data
=
{
'id'
:
this
.
id
};
this
.
appService
.
ObserverHttpGetOption
(
'/wisdomgroup/schedule/hasSignIn'
,
data
)
.
subscribe
((
res
)
=>
{
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/schedule/mySchedleOfToday'
,
null
)
.
subscribe
((
res
)
=>
{
this
.
signState
=
res
.
json
();
})
}
//签到
signIn
(){
signIn
()
{
const
data
=
{
id
:
this
.
id
,
//值班记录id,
address
:
'上海市委组织部'
//签到地址
id
:
this
.
id
,
//值班记录id,
address
:
'上海市委组织部'
//签到地址
};
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/schedule/signIn'
,
data
)
.
subscribe
((
res
)
=>
{
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/schedule/signIn'
,
data
)
.
subscribe
((
res
)
=>
{
console
.
log
(
res
);
})
}
//签退
signBack
(){
signBack
()
{
this
.
calcuDistance
();
//
const data = {
//
id:this.id, //值班记录id,
//
address:'上海市委组织部' //签到地址
//
};
// this.appService.ObserverHttpGet('/wisdomgroup/schedule/signIn
',data)
//
.subscribe((res)=>{
//
console.log(res);
//
})
const
data
=
{
id
:
this
.
id
,
//值班记录id,
address
:
'上海市委组织部'
//签到地址
};
this
.
appService
.
ObserverHttpGet
(
'/wisdomgroup/schedule/signOut
'
,
data
)
.
subscribe
((
res
)
=>
{
console
.
log
(
res
);
})
}
//计算距离
calcuDistance
()
{
calcuDistance
()
{
this
.
geolocation
.
getCurrentPosition
().
then
((
resp
)
=>
{
console
.
log
(
resp
.
coords
.
latitude
);
console
.
log
(
resp
.
coords
.
longitude
);
const
distance
=
this
.
getDisance
(
this
.
mainLat
,
this
.
mainLng
,
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
const
distance
=
this
.
getDisance
(
this
.
mainLat
,
this
.
mainLng
,
resp
.
coords
.
latitude
,
resp
.
coords
.
longitude
);
console
.
log
(
distance
);
alert
(
'距离:'
+
distance
);
alert
(
'距离:'
+
distance
);
}).
catch
((
error
)
=>
{
console
.
log
(
error
);
});
}
getDisance
(
lat1
,
lng1
,
lat2
,
lng2
){
getDisance
(
lat1
,
lng1
,
lat2
,
lng2
)
{
let
radLat1
=
this
.
toRad
(
lat1
);
let
radLat2
=
this
.
toRad
(
lat2
);
let
deltaLat
=
radLat1
-
radLat2
;
...
...
src/pages/surveyManage/list/list.ts
View file @
1d8a2caf
import
{
Component
,
ViewChild
}
from
'@angular/core'
;
import
{
IonicPage
,
NavController
,
NavParams
,
Slides
}
from
'ionic-angular'
;
import
{
AlertController
,
IonicPage
,
NavController
,
NavParams
,
Slides
}
from
'ionic-angular'
;
import
{
ResultPage
}
from
"../result/result"
;
import
{
DesicrPage
}
from
"../item/desicr/desicr"
;
import
{
AppService
}
from
"../../../service/appHttpService"
;
...
...
@@ -33,7 +33,7 @@ export class ListPage {
temp
;
//选中的item
constructor
(
public
navCtrl
:
NavController
,
public
navParams
:
NavParams
,
public
appService
:
AppService
)
{
public
appService
:
AppService
,
public
alertCtrl
:
AlertController
)
{
}
ionViewDidEnter
()
{
...
...
@@ -138,18 +138,36 @@ export class ListPage {
//取消发布
cancel
(){
// 0 清除 1 不清除
const
data
=
{
'isdelete'
:
'1'
};
this
.
appService
.
alert
(
'确定取消发布该问卷吗'
,
(
res
)
=>
{
let
alert
=
this
.
alertCtrl
.
create
();
alert
.
setTitle
(
'确定取消发布该问卷吗?'
);
alert
.
addInput
({
type
:
'checkbox'
,
label
:
'清空该问卷答题数据'
,
value
:
'0'
,
checked
:
false
});
alert
.
addButton
(
'取消'
);
alert
.
addButton
({
text
:
'确定'
,
handler
:
res
=>
{
let
data
=
{
isdelete
:
''
};
if
(
res
.
length
==
0
){
data
.
isdelete
=
'1'
;
}
else
{
data
.
isdelete
=
'0'
;
}
this
.
appService
.
ObserverHttpForm
(
'/wisdomgroup/modules/question/cancel/'
,
this
.
temp
.
id
,
data
)
.
subscribe
((
res
)
=>
{
this
.
appService
.
popToastView
(
'取消发布成功'
,
'middle'
,
1000
);
this
.
selectPageMenu
(
this
.
swiperIndex
);
})
}
)
});
alert
.
present
();
}
...
...
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