| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- const util = require('../../utils/util.js')
- Page({
- data: {
- publisherId: '',
- publisherInfo: {},
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- if (options.id) {
- this.setData({
- publisherId: options.id
- })
- wx.showLoading({
- title: "正在加载"
- })
- wx.cloud.callFunction({
- name: 'getPublisher',
- data: {
- pub_id: this.data.publisherId
- }
- }).then(res => {
- wx.hideLoading()
- if (res.result.status !== 'OK') {
- wx.showToast({
- title: res.result.errMsg,
- icon: 'none'
- })
- return
- }
- this.setData({
- publisherInfo: res.result.data
- })
- })
- } else {
- const eventChannel = this.getOpenerEventChannel()
- eventChannel.on('loadCommonData', res => {
- this.setData({
- publisherId: res.data._id,
- publisherInfo: res.data
- })
- })
- }
- }
- })
|