Ver Fonte

[FIX] products prices

Gogs há 7 anos atrás
pai
commit
8d6126bd25
1 ficheiros alterados com 4 adições e 2 exclusões
  1. 4 2
      src/components/ProductCard.vue

+ 4 - 2
src/components/ProductCard.vue

@@ -3,7 +3,7 @@
         h2.product-title {{ data.name }}
         h2.product-title {{ data.name }}
         img.product-image(:src="this.data.image_medium ? 'data:image/png;base64,' + this.data.image_medium : '/web/static/src/img/placeholder.png'")
         img.product-image(:src="this.data.image_medium ? 'data:image/png;base64,' + this.data.image_medium : '/web/static/src/img/placeholder.png'")
         .product-price
         .product-price
-            span Gs {{ data.list_price }}
+            span {{ getPrice() }}
         .product-qty
         .product-qty
 </template>
 </template>
 
 
@@ -28,7 +28,9 @@
             }
             }
         },
         },
         methods: {
         methods: {
-            //  TODO
+            getPrice() {
+                return accounting.formatMoney(this.data.list_price, '₲', 0, '.', ',')
+            },
             drawImage() {
             drawImage() {
                 let ctx = this.$el.querySelector('.product-image').getContext('2d')
                 let ctx = this.$el.querySelector('.product-image').getContext('2d')
                 let img = new Image()
                 let img = new Image()