-
-
diff --git a/public/assets/wechat/blog_detail.html b/public/assets/wechat/blog_detail.html
index fa3a9f341..b820ed591 100644
--- a/public/assets/wechat/blog_detail.html
+++ b/public/assets/wechat/blog_detail.html
@@ -1,5 +1,6 @@
+
@@ -7,9 +8,7 @@
{{blog.title}}
-
+
{{blog.created_at}}
@@ -40,7 +39,8 @@
-
+
+
diff --git a/public/assets/wechat/course_discussion.html b/public/assets/wechat/course_discussion.html
index d1b65e629..f02c01ff6 100644
--- a/public/assets/wechat/course_discussion.html
+++ b/public/assets/wechat/course_discussion.html
@@ -1,5 +1,6 @@
+
@@ -14,9 +15,7 @@
来 源: |
{{discussion.course_project_name}} | 课程问答区 |
-
+
{{discussion.created_on}}
@@ -47,7 +46,8 @@
-
+
+
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html
index c10763bf8..0a85ed089 100644
--- a/public/assets/wechat/course_notice.html
+++ b/public/assets/wechat/course_notice.html
@@ -1,5 +1,6 @@
+
@@ -13,9 +14,7 @@
来 源: |
{{news.course_name}} | 课程通知 |
-
+
{{news.created_on}}
@@ -46,7 +45,8 @@
-
+
+
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html
index 2783bd317..e416b7313 100644
--- a/public/assets/wechat/homework_detail.html
+++ b/public/assets/wechat/homework_detail.html
@@ -1,5 +1,6 @@
+
@@ -15,13 +16,11 @@
来 源: |
{{homework.course_name}} | 课程作业 |
-
-
-
迟交扣分:{{homework.late_penalty}}分
-
缺评扣分:{{homework.absence_penalty}}分/作品
-
匿评开启时间:{{homework.evaluation_start}}
-
匿评关闭时间:{{homework.evaluation_end}}
-
+
+
迟交扣分:{{homework.late_penalty}}分
+
缺评扣分:{{homework.absence_penalty}}分/作品
+
匿评开启时间:{{homework.evaluation_start}}
+
匿评关闭时间:{{homework.evaluation_end}}
{{homework.publish_time}}
@@ -52,7 +51,8 @@
-
+
+
diff --git a/public/assets/wechat/issue_detail.html b/public/assets/wechat/issue_detail.html
index 035a7c98d..7b5db0afa 100644
--- a/public/assets/wechat/issue_detail.html
+++ b/public/assets/wechat/issue_detail.html
@@ -1,5 +1,6 @@
+
@@ -13,13 +14,11 @@
来 源: |
{{issue.project_name}} | 项目问题 |
-
-
-
状 态:{{issue.issue_status}}
- 优先级:{{issue.issue_priority}}
- 指派给:{{issue.issue_assigned_to}}
- 完成度:{{issue.done_ratio}}%
-
+
+
状 态:{{issue.issue_status}}
+ 优先级:{{issue.issue_priority}}
+ 指派给:{{issue.issue_assigned_to}}
+ 完成度:{{issue.done_ratio}}%
{{issue.created_on}}
@@ -50,8 +49,9 @@
-
-
+
+
+
diff --git a/public/assets/wechat/jour_message_detail.html b/public/assets/wechat/jour_message_detail.html
index 5ccbf6248..fada796f8 100644
--- a/public/assets/wechat/jour_message_detail.html
+++ b/public/assets/wechat/jour_message_detail.html
@@ -1,4 +1,5 @@
+
@@ -6,9 +7,7 @@
{{message.created_on}}
-
+
@@ -38,7 +37,8 @@
-
+
+
diff --git a/public/assets/wechat/project_discussion.html b/public/assets/wechat/project_discussion.html
index be639c1a0..bd863f5ed 100644
--- a/public/assets/wechat/project_discussion.html
+++ b/public/assets/wechat/project_discussion.html
@@ -1,5 +1,6 @@
+
@@ -13,9 +14,7 @@
来 源: |
{{discussion.course_project_name}} | 项目讨论区 |
-
+
{{discussion.created_on}}
@@ -46,7 +45,8 @@
-
+
+
diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js
index 1149ea131..9d0b045c3 100644
--- a/public/javascripts/wechat/app.js
+++ b/public/javascripts/wechat/app.js
@@ -7,9 +7,14 @@ if(debug===true){
//apiUrl = 'https://www.trustie.net/api/v1/';
}
+
app.factory('auth', function($http,$routeParams, $cookies, $q){
var _openid = '';
+ if(typeof g_openid !== 'undefined'){
+ _openid = g_openid;
+ }
+
if(debug===true){
_openid = "1";
}
@@ -62,16 +67,44 @@ app.factory('rms', function(){
return {save: save, get: get};
});
-app.controller('ActivityController',function($scope, $http, auth, rms, common){
+app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, auth, rms, common){
$scope.replaceUrl = function(url){
return url;
};
console.log("ActivityController load");
- $scope.activities = rms.get("activities") || [];
+
$scope.page = 0;
+ $scope.activities = rms.get("activities") || [];
+
+ var savePageConfig = function(){
+ rms.save('current_page', $scope.current_page);
+ rms.save('has_more', $scope.has_more);
+ rms.save('activities', $scope.activities);
+ }
+
+ var loadPageConfig = function(){
+ var current_page = rms.get('current_page');
+ var has_more = rms.get('has_more');
+ var activities = rms.get('activities');
+
+ if(typeof current_page !== 'undefined'){
+ $scope.page = current_page;
+ }
+ if(typeof has_more !== 'undefined'){
+ $scope.has_more = has_more;
+ }
+
+ }
var loadActData = function(page){
+ if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的
+ loadPageConfig();
+ var yOffset = rms.get("yoffset");
+ $location.hash(yOffset);
+ return;
+ }
+
$scope.page = page;
$http({
method: 'POST',
@@ -89,10 +122,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
} else {
$scope.activities = response.data.data;
}
- $scope.current_page = response.data.page;
- $scope.all_count = response.data.all_count;
- $scope.count = response.data.count;
+ $scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
+
console.log(response.data);
+
+ rms.save('current_page', $scope.page);
+ rms.save('has_more', $scope.has_more);
rms.save('activities', $scope.activities);
}, function errorCallback(response) {
});
@@ -108,6 +143,12 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
$scope.loadActData = loadActData;
+ //跳到详情页
+ $scope.goDetail = function(type, act_id,id){
+ rms.save("yoffset",'act_'+id);
+ $location.path('/'+type+'/'+act_id);
+ }
+
$scope.addPraise = function(act){
common.addCommonPraise(act);
};
@@ -116,6 +157,8 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
common.decreaseCommonPraise(act);
};
+
+
});
app.factory('common', function($http, auth, $routeParams){
@@ -483,37 +526,39 @@ app.directive('loadingSpinner', function ($http) {
});
app.config(['$routeProvider',"$httpProvider",function ($routeProvider, $httpProvider) {
+ var rootPath = '/assets/wechat/'
+
$routeProvider
.when('/activities', {
- templateUrl: 'activities.html',
+ templateUrl: rootPath + 'activities.html',
controller: 'ActivityController'
})
.when('/issues/:id', {
- templateUrl: 'issue_detail.html',
+ templateUrl: rootPath + 'issue_detail.html',
controller: 'IssueController'
})
.when('/project_discussion/:id', {
- templateUrl: 'project_discussion.html',
+ templateUrl: rootPath + 'project_discussion.html',
controller: 'DiscussionController'
})
.when('/homework/:id', {
- templateUrl: 'homework_detail.html',
+ templateUrl: rootPath + 'homework_detail.html',
controller: 'HomeworkController'
})
.when('/course_notice/:id', {
- templateUrl: 'course_notice.html',
+ templateUrl: rootPath + 'course_notice.html',
controller: 'CourseNoticeController'
})
.when('/course_discussion/:id', {
- templateUrl: 'course_discussion.html',
+ templateUrl: rootPath + 'course_discussion.html',
controller: 'DiscussionController'
})
.when('/journal_for_message/:id', {
- templateUrl: 'jour_message_detail.html',
+ templateUrl: rootPath + 'jour_message_detail.html',
controller: 'JournalsController'
})
.when('/blog_comment/:id', {
- templateUrl: 'blog_detail.html',
+ templateUrl: rootPath + 'blog_detail.html',
controller: 'BlogController'
})
.otherwise({
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css
index ba3eac3df..4a88f9705 100644
--- a/public/stylesheets/weui/weixin.css
+++ b/public/stylesheets/weui/weixin.css
@@ -4,6 +4,16 @@
/*基本样式*/
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";}
h1,h2,h3,h4,h5,p,pre {padding:0px; margin:0px;}
+blockquote {
+ border:1px solid #d4d4d4;
+ padding: 0.6em;
+ margin-left: 1.4em;
+ margin-right: 0.4em;
+ border-radius: 4px;
+ font-family: "Microsoft YaHei";
+ background-size: 100% 100%;
+ margin-top:5px;
+}
.f12 {font-size:12px;}
.f13 {font-size:13px;}
.f15 {font-size:15px;}
@@ -84,3 +94,5 @@ a.underline {text-decoration:underline;}
/*帖子锁定样式*/
.locked_btn_cir {background: url("/images/locked.png") 0 0 no-repeat; cursor: default;}
+
+.bg-grey {background-color:#c1c1c1;}