publisherDetail.js 619 B

1234567891011121314151617181920212223242526272829303132333435
  1. const util = require('../../utils/util.js')
  2. Page({
  3. data: {
  4. publisherInfo: {},
  5. },
  6. /**
  7. * 生命周期函数--监听页面加载
  8. */
  9. onLoad: function (options) {
  10. wx.showLoading({
  11. title: "加载中"
  12. })
  13. wx.cloud.callFunction({
  14. name: 'getPublisher',
  15. data: {
  16. pub_id: options.id
  17. }
  18. }).then(res => {
  19. wx.hideLoading()
  20. if (res.result.status !== 'OK') {
  21. wx.showToast({
  22. title: res.result.errMsg,
  23. icon: 'none'
  24. })
  25. return
  26. }
  27. this.setData({
  28. publisherInfo: res.result.data
  29. })
  30. })
  31. }
  32. })