index.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var link_1 = require('../mixins/link');
  4. var component_1 = require('../common/component');
  5. component_1.VantComponent({
  6. classes: [
  7. 'num-class',
  8. 'desc-class',
  9. 'thumb-class',
  10. 'title-class',
  11. 'price-class',
  12. 'origin-price-class',
  13. ],
  14. mixins: [link_1.link],
  15. props: {
  16. tag: String,
  17. num: String,
  18. desc: String,
  19. thumb: String,
  20. title: String,
  21. price: {
  22. type: String,
  23. observer: 'updatePrice',
  24. },
  25. centered: Boolean,
  26. lazyLoad: Boolean,
  27. thumbLink: String,
  28. originPrice: String,
  29. thumbMode: {
  30. type: String,
  31. value: 'aspectFit',
  32. },
  33. currency: {
  34. type: String,
  35. value: '¥',
  36. },
  37. },
  38. methods: {
  39. updatePrice: function () {
  40. var price = this.data.price;
  41. var priceArr = price.toString().split('.');
  42. this.setData({
  43. integerStr: priceArr[0],
  44. decimalStr: priceArr[1] ? '.' + priceArr[1] : '',
  45. });
  46. },
  47. onClickThumb: function () {
  48. this.jumpLink('thumbLink');
  49. },
  50. },
  51. });