decoratecasemsg.js 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. var app = getApp();
  2. var utils = require("../../../utils/http");
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. aid: '',
  9. title: '志远装饰数字化平台',
  10. customerFlag: false,
  11. articleObj: {},
  12. imgUrl: app.globalData.imgUrl,
  13. type: 1,
  14. nowflag: false,
  15. footflag: true,
  16. sharepersonMsg: app.globalData.sharepersonobj,
  17. employeeflag: false, //false是用户,true是员工
  18. priceflag: false,
  19. personMsg:app.globalData.personMsg
  20. },
  21. /**
  22. * 生命周期函数--监听页面加载
  23. */
  24. onLoad: function (options) {
  25. var that = this;
  26. wx.showLoading({
  27. title: '加载中...',
  28. })
  29. that.setData({
  30. aid: options.aid,
  31. personMsg:app.globalData.personMsg,
  32. sharepersonMsg: app.globalData.sharepersonobj,
  33. employeeflag: (!!app.globalData.personMsg.binded && app.globalData.personMsg.binded.state == '在职') ? true : false
  34. })
  35. that.artileMsg();
  36. },
  37. priceshowtap() {
  38. this.setData({
  39. priceflag: true
  40. })
  41. },
  42. closepricetap() {
  43. this.setData({
  44. priceflag: false
  45. })
  46. },
  47. artileMsg: function () {
  48. var that = this;
  49. utils.$post({
  50. url: app.globalData.webUrl + 'client/article/info',
  51. header: {
  52. 'Authorization': 'bearer ' + app.globalData.token
  53. },
  54. data: {
  55. article_id: that.data.aid
  56. },
  57. success: function (res) {
  58. if (res.data.code == '0') {
  59. that.setData({
  60. articleObj: res.data.data,
  61. title: res.data.data.title
  62. })
  63. wx.setNavigationBarTitle({
  64. title: res.data.data.title
  65. })
  66. var article = res.data.data.content;
  67. }
  68. setTimeout(function () {
  69. wx.hideLoading();
  70. }, 1000)
  71. }
  72. })
  73. },
  74. pricetap: function () {
  75. wx.navigateTo({
  76. url: '/customer/pages/figureprice/figureprice',
  77. })
  78. },
  79. designTap: function () {
  80. wx.navigateTo({
  81. url: '/customer/pages/findesign/findesign',
  82. })
  83. },
  84. phonrtap: function () {
  85. wx.makePhoneCall({
  86. phoneNumber: app.globalData.sharepersonobj.phone //仅为示例,并非真实的电话号码
  87. })
  88. },
  89. /**
  90. * 生命周期函数--监听页面初次渲染完成
  91. */
  92. onReady: function () {
  93. },
  94. /**
  95. * 生命周期函数--监听页面显示
  96. */
  97. onShow: function () {
  98. this.setData({
  99. personMsg:app.globalData.personMsg,
  100. sharepersonMsg: app.globalData.sharepersonobj,
  101. employeeflag: (!!app.globalData.personMsg.binded && app.globalData.personMsg.binded.state == '在职') ? true : false
  102. })
  103. },
  104. /**
  105. * 生命周期函数--监听页面隐藏
  106. */
  107. onHide: function () {
  108. },
  109. /**
  110. * 生命周期函数--监听页面卸载
  111. */
  112. onUnload: function () {
  113. },
  114. /**
  115. * 页面相关事件处理函数--监听用户下拉动作
  116. */
  117. onPullDownRefresh: function () {
  118. },
  119. /**
  120. * 页面上拉触底事件的处理函数
  121. */
  122. onReachBottom: function () {
  123. },
  124. /**
  125. * 用户点击右上角分享
  126. */
  127. // onShareAppMessage: function () {
  128. // console.log(this.data.share_user_id)
  129. // return {
  130. // title: '我是'+app.globalData.sharename+",这是我的个人微网。",
  131. // imageUrl:"../../../img/weiw.png",
  132. // path: '/pages/index/index?share_user_id='+this.data.share_user_id+"&sharename="+app.globalData.sharename
  133. // }
  134. // }
  135. })