This commit is contained in:
Pererinha 2015-04-06 19:37:58 -03:00
parent 5037c2e5c9
commit 084ab2db41
4 changed files with 28 additions and 17 deletions

View File

@ -45,7 +45,7 @@
<p>
You are <b>{{account.user.points.away_free_delivery}}</b> points away from a <strong>free delivery</strong>.<br>
Earn points by ordering food, sharing your order, or referring friends.<br>
Get your friends to enter your code {{account.user.invite_code}} in the Notes section of their first order, and they will get $3 off and you a delivery free ;)
Get your friends to enter your code {{referral.invite_code}} in the Notes section of their first order, and you'll both get a free delivery ;)
<br>
<b></b>
</p>

View File

@ -5,9 +5,9 @@
<div class="two-col">
<div ng-show="account.user.invite_code">
<div ng-show="referral.invite_code">
<p>
Get your friends to enter <b>your referral code</b> in the Notes section of their first order, and they will get $3 off and you a delivery free ;)
Get your friends to enter <b>your referral code</b> in the Notes section of their first order, and you'll both get a free delivery ;)
</p><br/>
</div>
@ -17,7 +17,7 @@
<div class="hide-desktop">
<a href="{{referral.sms}}" target="_blank">
<button class="button green button-invite">
<button class="button lightorange button-invite">
<i class="fa fa-comment"></i> <span>Invite Friends</span>
</button>
</a>
@ -39,7 +39,7 @@
</div>
<br><br>
<p>Your code: <span class="referal-text-spacer"></span><b>{{account.user.invite_code}}</b></p>
<p>Your code: <span class="referal-text-spacer"></span><b>{{referral.invite_code}}</b></p>
<div class="hide-mobile">
<br>
<p>Invite URL: <span class="referal-text-spacer"></span><input class="referal-text-box" type="text" ng-simulate-read-only="{{referral.cleaned_url()}}" value="http://{{referral.cleaned_url()}}"></p>

View File

@ -17,20 +17,32 @@
<div class="divider"></div>
<div ng-show="account.user.invite_code" class="hide-mobile">
<div ng-show="referral.invite_code">
<p>
Get your friends to enter <b>your referral code</b> in the Notes section of their first order, and they will get $3 off and you a delivery free ;)
Get your friends to enter <b>your referral code</b> in the Notes section of their first order, and you'll both get a free delivery ;)
</p>
<br><br>
</div>
</div>
<div class="two-col">
<div class="hide-desktop">
<button class="button lightorange button-invite" ng-click="navigation.link('/free-food','push')">
<span>Free food</span>
</button>
<a href="{{referral.sms}}">
<button class="button lightorange button-invite">
<i class="fa fa-comment"></i> <span>Invite Friends</span>
</button>
</a>
<br><br>
<p>Your code: <span class="referal-text-spacer"></span><b>{{referral.invite_code}}</b></p>
<div class="hide-mobile">
<br>
<p>Invite URL: <span class="referal-text-spacer"></span><input class="referal-text-box" type="text" ng-simulate-read-only="{{referral.cleaned_url()}}" value="http://{{referral.cleaned_url()}}"></p>
</div>
</div>
@ -49,7 +61,7 @@
</div>
<br><br>
<p class="hide-mobile">Your code: <span class="referal-text-spacer"></span><b>{{account.user.invite_code}}</b></p>
<p class="hide-mobile">Your code: <span class="referal-text-spacer"></span><b>{{referral.invite_code}}</b></p>
<div class="hide-mobile">
<br>
<p>Invite URL: <span class="referal-text-spacer"></span><input class="referal-text-box" type="text" ng-simulate-read-only="{{referral.cleaned_url()}}" value="http://{{referral.cleaned_url()}}"></p>

View File

@ -1401,6 +1401,8 @@ NGApp.controller('OrdersCtrl', function ($timeout, $scope, $http, $location, Acc
ReferralService.getInviteCode();
}
ReferralService.getStatus();
$scope.account = AccountService;
// Alias to method AccountSignOut.do()
@ -1432,24 +1434,21 @@ NGApp.controller('OrdersCtrl', function ($timeout, $scope, $http, $location, Acc
value : ReferralService.value,
limit : ReferralService.limit,
invites : ReferralService.invites,
enabled : ReferralService.enabled
enabled : ReferralService.enabled,
invite_code: ReferralService.invite_code
}
$scope.referral.cleaned_url = function(){
return ReferralService.cleaned_url();
}
// Load the invite_url
if( !ReferralService.invite_url ){
ReferralService.getStatus();
}
$scope.$on( 'referralStatusLoaded', function(e, data) {
$scope.referral.invites = ReferralService.invites;
$scope.referral.limit = ReferralService.limit;
$scope.referral.invite_url = ReferralService.invite_url;
$scope.referral.value = ReferralService.value;
$scope.referral.enabled = ReferralService.enabled;
$scope.referral.invite_code = ReferralService.invite_code;
$scope.referral.sms = ReferralService.sms();
});