|
-
-
-
- var app = new Vue({
- el: '#app-subscription-form',
- data: {
- showLoading: false,
- loading: true,
- products: []
- },
-
- mounted: function() {
- this.init() ;
- this.loading = false ;
- },
-
- methods: {
- init: function() {
- var app = this ;
- this.showLoading = true ;
-
- axios.get("ajax-infos",{params: {idSubscription: $('#subscriptionform-id').val()}})
- .then(function(response) {
- app.products = response.data.products ;
- app.showLoading = false ;
- }) ;
- },
- changeQuantityProductSubscription: function(increase, product) {
- var step = step ? parseFloat(product.step) : 1 ;
- if(!product.quantity) product.quantity = 0 ;
- var quantity = parseFloat(product.quantity) ;
- if(!increase) {
- step = -step ;
- }
- if(quantity + step >= 0) {
- product.quantity = quantity + step ;
- }
- if(!product.quantity) product.quantity = '' ;
- }
- }
- });
|