|
|
@@ -1360,24 +1360,63 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
- app.controller('InviteCtrl', ['$scope', 'toaster', '$modalInstance', 'enname', function ($scope, toaster, $modalInstance, enname) {
|
|
|
+ app.controller('InviteCtrl', ['$scope', 'toaster', '$modalInstance', 'enname', 'InvitationRecord', '$modal', function ($scope, toaster, $modalInstance, enname, InvitationRecord, $modal) {
|
|
|
$scope.enter = {
|
|
|
vendname: enname
|
|
|
};
|
|
|
|
|
|
$scope.save = function (enter) {
|
|
|
- if (!enter.vendusertel) {
|
|
|
- toaster.pop('info', '提示', '请填写手机号,方便通知客户');
|
|
|
- } else {
|
|
|
- $modalInstance.close(enter);
|
|
|
- }
|
|
|
+ // 先检验是否已注册
|
|
|
+ InvitationRecord.enterpriseList({name: enter.vendname}, {}, function(data) {
|
|
|
+ $scope.existEn = data;
|
|
|
+ if ($scope.existEn.length == 0) {
|
|
|
+ $modalInstance.close(enter);
|
|
|
+ var modalInstance = $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/tpl/index/baseInfo/modal/QQshare_modal.html',
|
|
|
+ controller: 'QQShareCtrl',
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
+ $scope.viewDetail = function() {
|
|
|
+ $scope.exist = 1;
|
|
|
+ }
|
|
|
$scope.cancel = function () {
|
|
|
$modalInstance.dismiss();
|
|
|
}
|
|
|
+
|
|
|
}]);
|
|
|
|
|
|
+ /**
|
|
|
+ * QQ分享
|
|
|
+ */
|
|
|
+ app.controller('QQShareCtrl', ['$scope', 'InvitationRecord', function($scope, InvitationRecord) {
|
|
|
+ InvitationRecord.getInviteUrl({}, function(data) {
|
|
|
+ $scope.inviteUrl = data.url;
|
|
|
+ var p = {
|
|
|
+ url: $scope.inviteUrl, /*获取URL,可加上来自分享到QQ标识,方便统计*/
|
|
|
+ // desc: 'hejq', /*分享理由(风格应模拟用户对话),支持多分享语随机展现(使用|分隔)*/
|
|
|
+ // title: '', /*分享标题(可选)*/
|
|
|
+ // summary: '', /*分享摘要(可选)*/
|
|
|
+ // pics: '', /*分享图片(可选)*/
|
|
|
+ // flash: '', /*视频地址(可选)*/
|
|
|
+ // site: '', /*分享来源(可选) 如:QQ分享*/
|
|
|
+ // style: '201',
|
|
|
+ // width: 32,
|
|
|
+ // height: 32
|
|
|
+ };
|
|
|
+ var s = [];
|
|
|
+ for(var i in p){
|
|
|
+ s.push(i + '=' + encodeURIComponent(p[i]||''));
|
|
|
+ }
|
|
|
+ s.join('&');
|
|
|
+ $scope.QQshare = function() {
|
|
|
+ window.open("http://connect.qq.com/widget/shareqq/index.html?" + s)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }]);
|
|
|
|
|
|
app.controller('ReInviteCtrl', ['$scope', 'toaster', '$modalInstance', 'id', 'InvitationRecord', function ($scope, toaster, $modalInstance, id, InvitationRecord) {
|
|
|
|
|
|
@@ -21396,7 +21435,7 @@ define(['toaster', 'charts', 'ngTable', 'common/services', 'common/directives',
|
|
|
}]);
|
|
|
|
|
|
// 企业圈查询收到待处理的数目
|
|
|
- app.controller('RequestAmountCtrl', ['$scope', 'AddPartnerMyRequest', '$modal', function ($scope, AddPartnerMyRequest, $modal) {
|
|
|
+ app.controller('RequestAmountCtrl', ['$scope', 'AddPartnerMyRequest', '$modal', 'InvitationRecord', 'toaster', function ($scope, AddPartnerMyRequest, $modal, InvitationRecord, toaster) {
|
|
|
AddPartnerMyRequest.requestAmount({}, function (data) {
|
|
|
$scope.requestTodo = data;
|
|
|
});
|