| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- const util = require('../../utils/util.js')
- Page({
- data: {
- publisherInfo: {},
- },
- // processData: function (start, arr) {
- // for (let i = start; i < arr.length; i++) {
- // arr[i].time = util.handleDate(arr[i].time)
- // }
- // this.setData({
- // mainDatas: arr
- // })
- // wx.hideLoading()
- // },
- // onLoad: function (options) {
- // wx.showLoading({
- // title: "加载中"
- // })
- // const db = wx.cloud.database()
- // db.collection("publisherInfoData").doc(options.id).get({
- // success: function (res) {
- // this.setData({
- // publisherInfo: res.data
- // })
- // db.collection("mainData").where({
- // publisherName: this.data.publisherInfo.publisherName
- // }).orderBy("time", "desc").limit(20).get({
- // success: function (res) {
- // this.processData(0, res.data)
- // }.bind(this)
- // })
- // }.bind(this)
- // })
- // db.collection("likeData").where({
- // type: "publisher",
- // id: options.id
- // }).get({
- // success: function (res) {
- // this.setData({
- // like: res.data.length
- // })
- // }.bind(this)
- // })
- // },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- wx.showLoading({
- title: "加载中"
- })
- wx.cloud.callFunction({
- name: 'getPublisher',
- data: {
- pub_id: options.id
- }
- }).then(res => {
- wx.hideLoading()
- this.setData({
- publisherInfo: res.result.data
- })
- })
- }
- })
|