index.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // lionfish_comshop/components/goodsInfo/index.js
  2. Component({
  3. properties: {
  4. order: {
  5. type: Object,
  6. observer: function (t) {
  7. let real_total = t.order_info.real_total * 1;
  8. let shipping_tel = t && t.order_info && t.order_info.shipping_tel || '';
  9. var goodsTotal = parseFloat(real_total) - parseFloat(t.order_info.shipping_fare);
  10. let h = {};
  11. h.goodsTotal = goodsTotal;
  12. if(shipping_tel) {
  13. shipping_tel = "" + shipping_tel;
  14. var pat=/(\d{3})\d*(\d{4})/;
  15. let tel = shipping_tel.replace(pat,'$1****$2');
  16. h.tel = tel;
  17. }
  18. this.setData(h);
  19. }
  20. },
  21. showNickname: {
  22. type: Boolean,
  23. default: false
  24. },
  25. hidePhone: {
  26. type: Number,
  27. default: 0
  28. },
  29. groupInfo: {
  30. type: Object,
  31. default: {
  32. group_name: '社区',
  33. owner_name: '团长',
  34. delivery_ziti_name: '社区自提',
  35. delivery_tuanzshipping_name: '团长配送',
  36. delivery_express_name: '快递配送'
  37. }
  38. },
  39. hideInfo: {
  40. type: Boolean,
  41. default: false
  42. },
  43. goodsTot: {
  44. type: Number,
  45. default: 0
  46. },
  47. goods_sale_unit: {
  48. type: String
  49. }
  50. },
  51. data: {
  52. isCalling: false
  53. },
  54. methods: {
  55. callTelphone: function(t) {
  56. var e = this;
  57. this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
  58. phoneNumber: t.currentTarget.dataset.phone,
  59. complete: function() {
  60. e.data.isCalling = false;
  61. }
  62. }));
  63. }
  64. }
  65. })