index.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. // pages/error/jiesuan/index.js
  2. const app = getApp();
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. id: 0,
  9. isprice: false,
  10. info: '',
  11. updateprive: 0
  12. },
  13. /**
  14. * 生命周期函数--监听页面加载
  15. */
  16. onLoad: function (options) {
  17. this.setData({id: options.id})
  18. },
  19. /**
  20. * 生命周期函数--监听页面显示
  21. */
  22. onShow: function () {
  23. this.getinfo()
  24. },
  25. getinfo() {
  26. let that = this;
  27. app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/abnormal_settlement", {id:that.data.id}, "get").then(function (res) {
  28. if (res.code != 200) {
  29. console.log(res.message.msg)
  30. wx.showLoading({
  31. title: res.message.msg,
  32. })
  33. } else {
  34. let pp = (res.message.data.order_price - res.message.data.coupon_money) - (res.message.data.total_price - res.message.data.freight)>=0?(res.message.data.order_price - res.message.data.coupon_money) - (res.message.data.total_price - res.message.data.freight) : 0
  35. that.setData({
  36. info: res.message.data,
  37. updateprive: pp
  38. })
  39. }
  40. wx.hideLoading();
  41. }).catch(function (err) {
  42. console.log(222);
  43. })
  44. },
  45. changep(e){
  46. this.setData({updateprive:e.detail.value})
  47. console.log(e.detail.value)
  48. },
  49. goback(){
  50. wx.navigateBack()
  51. },
  52. gophone(){
  53. wx.makePhoneCall({
  54. phoneNumber: this.data.info.phone
  55. })
  56. },
  57. changeisprice(){
  58. let that = this
  59. that.setData({isprice:!that.data.isprice})
  60. },
  61. /**
  62. * 生命周期函数--监听页面初次渲染完成
  63. */
  64. onReady: function () {
  65. },
  66. /**
  67. * 生命周期函数--监听页面隐藏
  68. */
  69. onHide: function () {
  70. },
  71. /**
  72. * 生命周期函数--监听页面卸载
  73. */
  74. onUnload: function () {
  75. },
  76. /**
  77. * 页面相关事件处理函数--监听用户下拉动作
  78. */
  79. onPullDownRefresh: function () {
  80. },
  81. /**
  82. * 页面上拉触底事件的处理函数
  83. */
  84. onReachBottom: function () {
  85. },
  86. /**
  87. * 用户点击右上角分享
  88. */
  89. onShareAppMessage: function () {
  90. }
  91. })