Commit dc8bdf09 by txy

'接口添加token'

parent cb12119d
...@@ -16,7 +16,13 @@ ...@@ -16,7 +16,13 @@
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/examine/bootstrap.js"></script> <script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/examine/bootstrap.js"></script>
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/examine/lightbox.min.js"></script> <script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/examine/lightbox.min.js"></script>
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/dialog.js"></script> <script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/dialog.js"></script>
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"></script> <!-- <script type="text/javascript" th:inline="javascript">
var currentTime = [[${currentTime}]];
var rules = JSON.parse([[${rules}]]);
var data = JSON.parse([[${data}]]);
var user = JSON.parse([[${user}]]);
var jsSdk = JSON.parse([[${jsSdk}]]);
</script> -->
</head> </head>
<body> <body>
...@@ -53,153 +59,7 @@ ...@@ -53,153 +59,7 @@
</div> </div>
</div> </div>
</div> </div>
<script>
$(document).ready(function(){
// 获取个人信息
userTabInfo();
// 获取活动名称
getActivityTitle();
});
function pass(){
var activityCode = getQueryString('activityCode');
var params = {
activityCode: activityCode,
reviewStatus: 1,
userId: getQueryString('UserId')
}
$.ajax({
type: 'PUT',
url: baseUrl + '/ACTIVITY/sz/review-user/' + activityCode,
data: params,
success: function(data) {
if(data.status == 200) {
$.dialog({
type: "alert",
contentHtml: "<p style='text-align:center;'>操作成功</p>",
onClosed: function(){
window.location.reload()
}
});
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
});
}
function refuse(){
var activityCode = getQueryString('activityCode');
var params = {
activityCode: activityCode,
reviewStatus: 0,
userId: getQueryString('UserId')
}
$.ajax({
type: 'PUT',
url: baseUrl + '/ACTIVITY/sz/review-user/' + activityCode,
data: params,
success: function(data) {
if(data.status == 200) {
$.dialog({
type: "alert",
contentHtml: "<p style='text-align:center;'>操作成功</p>",
onClosed: function(){
window.location.reload()
}
});
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
});
}
// 个人信息展示
function userTabInfo() {
var id = getQueryString('UserId');
var activityCode = getQueryString('activityCode');
var params = {
id: id
}
$.ajax({
type: 'GET',
url: baseUrl + '/ACTIVITY/sz/search/' + activityCode,
data: params,
success: function(data) {
if(data.status == 200) {
var userInfoObj = data.result && data.result.records && data.result.records[0];
$("#userName").text(userInfoObj.name);
$("#voteCount").text(userInfoObj.voteNum);
$("#userPhone").text(userInfoObj.userPhone);
$("#orgName").text(userInfoObj.orgName);
$("#enounce").text(userInfoObj.declaration);
$("#userImage img").attr("src", userInfoObj.imageUrl);
$("#userImage").attr("href", userInfoObj.imageUrl).show();
var reviewStatus = userInfoObj.reviewStatus;
// reviewStatus 0-待审核 1-审核通过 2-审核未通过
if(reviewStatus == 1||reviewStatus == 2){
$(".edit-btn").addClass("hide");
if(reviewStatus == 1){
$(".status-msg").addClass("text-success").html("已通过");
}else if(reviewStatus == 2){
$(".status-msg").addClass("text-danger").html("已驳回");
}
}else if(reviewStatus == 0){
$(".status-msg").hide();
$(".edit-btn").removeClass("hide");
}
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
})
}
// 获取活动名称
function getActivityTitle() {
var activityCode = getQueryString('activityCode');
var params = {
activityCode: activityCode
}
$.ajax({
type: 'GET',
url: baseUrl + '/ACTIVITY/'+ activityCode +'/settings',
data: params,
success: function(data) {
if(data.status == 200) {
var title = data.result.settings.szText.h5Title;
$('#examineTitle').text(title);
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
})
}
</script>
</body> </body>
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/common.js"></script>
<script type="text/javascript" src="https://space-api.check.icaremgt.com/ACTIVITY/gitlab-static?url=http://gitlab.icaremgt.com/tanxinyu/h5_activity/raw/master/showPhotos/js/page/examine.js"></script>
</html> </html>
...@@ -202,6 +202,9 @@ function getActivityTitle() { ...@@ -202,6 +202,9 @@ function getActivityTitle() {
type: 'GET', type: 'GET',
url: baseUrl + '/ACTIVITY/'+ activityCode +'/settings', url: baseUrl + '/ACTIVITY/'+ activityCode +'/settings',
data: params, data: params,
headers: {
'x-token': getToken()
},
success: function(data) { success: function(data) {
if(data.status == 200) { if(data.status == 200) {
var title = data.result.settings.szText.h5Title; var title = data.result.settings.szText.h5Title;
......
$(document).ready(function(){
setToken();
// 获取个人信息
userTabInfo();
// 获取活动名称
getActivityTitle();
});
function pass(){
var activityCode = getQueryString('activityCode');
var params = {
activityCode: activityCode,
reviewStatus: 1,
userId: getQueryString('UserId')
}
$.ajax({
type: 'PUT',
url: baseUrl + '/ACTIVITY/sz/review-user/' + activityCode,
headers: {
'x-token': getToken()
},
data: params,
success: function(data) {
if(data.status == 200) {
$.dialog({
type: "alert",
contentHtml: "<p style='text-align:center;'>操作成功</p>",
onClosed: function(){
window.location.reload()
}
});
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
});
}
function refuse(){
var activityCode = getQueryString('activityCode');
var params = {
activityCode: activityCode,
reviewStatus: 0,
userId: getQueryString('UserId')
}
$.ajax({
type: 'PUT',
url: baseUrl + '/ACTIVITY/sz/review-user/' + activityCode,
data: params,
headers: {
'x-token': getToken()
},
success: function(data) {
if(data.status == 200) {
$.dialog({
type: "alert",
contentHtml: "<p style='text-align:center;'>操作成功</p>",
onClosed: function(){
window.location.reload()
}
});
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
});
}
// 个人信息展示
function userTabInfo() {
var id = getQueryString('UserId');
var activityCode = getQueryString('activityCode');
var params = {
id: id
}
$.ajax({
type: 'GET',
url: baseUrl + '/ACTIVITY/sz/search/' + activityCode,
data: params,
headers: {
'x-token': getToken()
},
success: function(data) {
if(data.status == 200) {
var userInfoObj = data.result && data.result.records && data.result.records[0];
$("#userName").text(userInfoObj.name);
$("#voteCount").text(userInfoObj.voteNum);
$("#userPhone").text(userInfoObj.userPhone);
$("#orgName").text(userInfoObj.orgName);
$("#enounce").text(userInfoObj.declaration);
$("#userImage img").attr("src", userInfoObj.imageUrl);
$("#userImage").attr("href", userInfoObj.imageUrl).show();
var reviewStatus = userInfoObj.reviewStatus;
// reviewStatus 0-待审核 1-审核通过 2-审核未通过
if(reviewStatus == 1||reviewStatus == 2){
$(".edit-btn").addClass("hide");
if(reviewStatus == 1){
$(".status-msg").addClass("text-success").html("已通过");
}else if(reviewStatus == 2){
$(".status-msg").addClass("text-danger").html("已驳回");
}
}else if(reviewStatus == 0){
$(".status-msg").hide();
$(".edit-btn").removeClass("hide");
}
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
})
}
// 获取活动名称
function getActivityTitle() {
var activityCode = getQueryString('activityCode');
var params = {
activityCode: activityCode
}
$.ajax({
type: 'GET',
url: baseUrl + '/ACTIVITY/'+ activityCode +'/settings',
data: params,
headers: {
'x-token': getToken()
},
success: function(data) {
if(data.status == 200) {
var title = data.result.settings.szText.h5Title;
$('#examineTitle').text(title);
}
},
error: function() {
$.dialog({
type : 'tips',
autoClose : 3000,
infoText : '请求超时,请尝试刷新页面!'
});
}
})
}
\ No newline at end of file
...@@ -189,6 +189,9 @@ function getAjaxListSearch(type,page,callback) { ...@@ -189,6 +189,9 @@ function getAjaxListSearch(type,page,callback) {
type: 'GET', type: 'GET',
url: baseUrl + '/ACTIVITY/sz/search/' + activityCode, url: baseUrl + '/ACTIVITY/sz/search/' + activityCode,
data: params, data: params,
headers: {
'x-token': getToken()
},
success: function(data) { success: function(data) {
if(data.status == 200) { if(data.status == 200) {
if(type == 'player' || type == 'search') { if(type == 'player' || type == 'search') {
...@@ -324,6 +327,9 @@ function voteClickFn(){ ...@@ -324,6 +327,9 @@ function voteClickFn(){
type: 'PUT', type: 'PUT',
url: baseUrl + '/ACTIVITY/sz/vote/' + activityCode, url: baseUrl + '/ACTIVITY/sz/vote/' + activityCode,
data: params, data: params,
headers: {
'x-token': getToken()
},
success: function(data) { success: function(data) {
if(data.status == 200) { if(data.status == 200) {
$('#act1185354268270 span').text(data.result.voteNumDay) $('#act1185354268270 span').text(data.result.voteNumDay)
......
...@@ -260,6 +260,9 @@ function getOrgNameFn() { ...@@ -260,6 +260,9 @@ function getOrgNameFn() {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: baseUrl + '/ORG/hospital/community/hospitalInfo/' + orgId, url: baseUrl + '/ORG/hospital/community/hospitalInfo/' + orgId,
headers: {
'x-token': getToken()
},
success: function(data) { success: function(data) {
if(data.code == 200) { if(data.code == 200) {
$('#act11739232574395').val(data.records.orgName) $('#act11739232574395').val(data.records.orgName)
......
...@@ -171,6 +171,9 @@ function userTabInfo() { ...@@ -171,6 +171,9 @@ function userTabInfo() {
type: 'GET', type: 'GET',
url: baseUrl + '/ACTIVITY/sz/search/' + activityCode, url: baseUrl + '/ACTIVITY/sz/search/' + activityCode,
data: params, data: params,
headers: {
'x-token': getToken()
},
success: function(data) { success: function(data) {
if(data.status == 200) { if(data.status == 200) {
var userInfoObj = data.result && data.result.records && data.result.records[0] var userInfoObj = data.result && data.result.records && data.result.records[0]
...@@ -211,6 +214,9 @@ function voteClickFn(){ ...@@ -211,6 +214,9 @@ function voteClickFn(){
type: 'PUT', type: 'PUT',
url: baseUrl + '/ACTIVITY/sz/vote/' + activityCode, url: baseUrl + '/ACTIVITY/sz/vote/' + activityCode,
data: params, data: params,
headers: {
'x-token': getToken()
},
success: function(data) { success: function(data) {
gb_vote_loaded = false gb_vote_loaded = false
if(data.status == 200) { if(data.status == 200) {
......
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