socialforge/public/javascripts/wechat/controllers/invite_code.js

33 lines
952 B
JavaScript
Raw Normal View History

2016-07-29 16:13:25 +08:00
/**
* Created by guange on 16/6/22.
*/
2016-08-02 17:36:59 +08:00
app.controller('InviteCodeController', ['$scope','$http', '$routeParams','config','auth','wx', function($scope, $http, $routeParams, config, auth, wx){
2016-07-29 16:13:25 +08:00
var vm = $scope;
2016-08-02 17:36:59 +08:00
wx.ready(function(){
wx.onMenuShareTimeline({
title: '定制的标题', // 分享标题
2016-08-02 17:48:51 +08:00
link: 'http://wechat.trustie.net/', // 分享链接
imgUrl: 'http://wechat.trustie.net/images/logo2.png', // 分享图标
2016-08-02 17:36:59 +08:00
success: function () {
console.log("share successed.");
},
cancel: function () {
console.log("share canceled.");
}
});
});
2016-07-29 16:13:25 +08:00
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;
}
);
}]);