You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
1.7 KiB

// pages/activity_topics/topics.js
import {
httpUtil,
} from '../../../utils/util.js'
Page({
/**
* 页面的初始数据
*/
data: {
topic_list: [], //图片列表
topic_info:[],//分享标题和图片
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let mini_activity_id=options.mini_activity_id
httpUtil("/api/v1/topic-detail", "get", {
mini_activity_id
}).then(res => {
this.setData({
topic_list: res.topic_detail,
topic_info:res.topic_info
})
if(!res.topic_info.topic_title){return}
wx.setNavigationBarTitle({
title:res.topic_info.topic_title
})
})
},
onChange(e){
let url=e.currentTarget.dataset.route
if(!url){return}
wx.navigateTo({
url
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function (e) {
let title=this.data.topic_info.topic_title
let imageUrl=this.data.topic_info.share_pic
return { //自定义转发内容
title,
imageUrl //不设置此字段时,默认截取当前页面作为展示的图片
}
}
})