orderInfoExpress.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Component({
  2. properties: {
  3. order: {
  4. type: Object,
  5. observer: function (t) {
  6. let real_total = t.order_info.real_total * 1;
  7. var goodsTotal = parseFloat(real_total) - parseFloat(t.order_info.shipping_fare);
  8. let h = {};
  9. h.goodsTotal = goodsTotal.toFixed(2);
  10. let shipping_tel = t && t.order_info.shipping_tel || '';
  11. if(!shipping_tel) shipping_tel = t && t.order_info.ziti_mobile || '';
  12. if(shipping_tel) {
  13. var pat=/(\d{7})\d*(\d{0})/;
  14. let tel = shipping_tel.replace(pat,'$1****$2');
  15. h.tel = tel;
  16. }
  17. this.setData(h);
  18. }
  19. },
  20. showNickname: {
  21. type: Boolean,
  22. default: false
  23. },
  24. hidePhone: {
  25. type: Number,
  26. default: 0
  27. },
  28. groupInfo: {
  29. type: Object,
  30. default: {
  31. group_name: '社区',
  32. owner_name: '团长',
  33. diyshipname: '快递费',
  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: String,
  48. presale: {
  49. type: Object,
  50. default: {}
  51. }
  52. },
  53. data: {
  54. isCalling: false
  55. },
  56. methods: {
  57. callTelphone: function (t) {
  58. var e = this;
  59. this.data.isCalling || (this.data.isCalling = true, wx.makePhoneCall({
  60. phoneNumber: t.currentTarget.dataset.phone,
  61. complete: function () {
  62. e.data.isCalling = false;
  63. }
  64. }));
  65. },
  66. goExpress: function(){
  67. let order_id = this.data.order.order_info.order_id;
  68. wx.navigateTo({
  69. url: '/lionfish_comshop/pages/order/goods_express?id=' + order_id,
  70. })
  71. }
  72. }
  73. });