parent
d466b09f3f
commit
52d4d36097
@ -0,0 +1,15 @@
|
||||
<div class="post-container">
|
||||
<div class="qr-code-wrap">
|
||||
<div class="qr-code-box">
|
||||
<div class="share-class-name">{{course.name}}</div>
|
||||
<div class="qr-img-wrap"><img src="/images/wechat/QR-code.jpg" width="152" class="qr-code-img" /></div>
|
||||
<div class="invitation-code-wrap">邀请码:{{course.invite_code}}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="share-code-wrap">
|
||||
<a href="javascript:void(0);" class="share-code-btn">分享邀请码</a>
|
||||
<div class="share-code-instruction"> 1.将此页面分享给好友,邀请好友加入班级<br />
|
||||
2.通过微信扫一扫加入班级<br />
|
||||
3.输入邀请码加入班级</div>
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Created by guange on 16/6/22.
|
||||
*/
|
||||
|
||||
|
||||
app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config','auth', function($scope, $http, $routeParams, config, auth){
|
||||
var vm = $scope;
|
||||
|
||||
vm.course = {};
|
||||
var courseid = $routeParams.id;
|
||||
$http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
|
||||
function(response){
|
||||
console.log(response.data);
|
||||
vm.course = response.data.data;
|
||||
}
|
||||
);
|
||||
|
||||
}]);
|
@ -1,11 +1,47 @@
|
||||
app.controller('MyClassController', ['$scope', function($scope){
|
||||
app.controller('MyClassController', ['$scope', 'config','$http', 'auth','$location','$routeParams', function($scope, config, $http, auth, $location, $routeParams){
|
||||
|
||||
var vm = $scope;
|
||||
var courseid = $routeParams.id;
|
||||
|
||||
vm.currentTab = 1;
|
||||
vm.tab = function(index){
|
||||
vm.currentTab = index;
|
||||
console.log(vm.currentTab);
|
||||
vm.searchText = '';
|
||||
console.log(vm.currentTab);
|
||||
if(index == 2){
|
||||
if(vm.students.length<=0){
|
||||
$http.get(config.apiUrl + 'courses/students?token='+auth.token()+'&course_id='+courseid).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
vm.students = response.data.data;
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
vm.course = {};
|
||||
vm.students = [];
|
||||
vm.teachers = [];
|
||||
|
||||
vm.invite = function(){
|
||||
$location.path("/invite_code").search({id: courseid});
|
||||
};
|
||||
|
||||
$http.get(config.apiUrl+ 'courses/'+courseid+"?token="+auth.token()).then(
|
||||
function(response){
|
||||
console.log(response.data);
|
||||
vm.course = response.data.data;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
if(vm.teachers.length<=0){
|
||||
$http.get(config.apiUrl + 'courses/teachers?token='+auth.token()+'&course_id='+courseid).then(
|
||||
function(response) {
|
||||
console.log(response.data);
|
||||
vm.teachers = response.data.data;
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
}]);
|
Loading…
Reference in new issue