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.
114 lines
2.1 KiB
114 lines
2.1 KiB
|
11 months ago
|
// pages/list/theatre/index.js
|
||
|
|
import commonApi from "../../../utils/https/common"
|
||
|
|
import util from "../../../utils/util"
|
||
|
|
let app = getApp()
|
||
|
|
Page({
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面的初始数据
|
||
|
|
*/
|
||
|
|
data: {
|
||
|
|
list:[],
|
||
|
|
page_no: 0,
|
||
|
|
haveMore: true,
|
||
|
|
},
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面加载
|
||
|
|
*/
|
||
|
|
onLoad: function (options) {
|
||
|
|
wx.showShareMenu({
|
||
|
|
withShareTicket: true,
|
||
|
|
menus: ['shareAppMessage', 'shareTimeline']
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
gotoDetail:function(e){
|
||
|
|
let item = e.currentTarget.dataset.item;
|
||
|
|
if(item.outside_url) {
|
||
|
|
wx.navigateTo({
|
||
|
|
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(item.outside_url),
|
||
|
|
})
|
||
|
|
} else {
|
||
|
|
wx.navigateTo({
|
||
|
|
url: '/pages/info/strategyInfo/index?id=' + item.id,
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
},
|
||
|
|
getList:function(){
|
||
|
|
if (!this.data.haveMore) return
|
||
|
|
let list = this.data.list
|
||
|
|
|
||
|
|
commonApi._post("travels/getList", {
|
||
|
|
page_no: this.data.page_no,
|
||
|
|
page_num: 10,
|
||
|
|
// type_key: 'feiyishouzha',
|
||
|
|
type_key: 'someArt',
|
||
|
|
}).then(res => {
|
||
|
|
if (res) {
|
||
|
|
this.setData({list:list.concat(res.data.rows||[])})
|
||
|
|
if (res.data.rows.length<10) {
|
||
|
|
this.data.haveMore = false
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面初次渲染完成
|
||
|
|
*/
|
||
|
|
onReady: function () {
|
||
|
|
this.getList()
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面显示
|
||
|
|
*/
|
||
|
|
onShow: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面隐藏
|
||
|
|
*/
|
||
|
|
onHide: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 生命周期函数--监听页面卸载
|
||
|
|
*/
|
||
|
|
onUnload: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
||
|
|
*/
|
||
|
|
onPullDownRefresh: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 页面上拉触底事件的处理函数
|
||
|
|
*/
|
||
|
|
onReachBottom: function () {
|
||
|
|
this.getList()
|
||
|
|
},
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 用户点击右上角分享
|
||
|
|
*/
|
||
|
|
onShareAppMessage: function () {
|
||
|
|
|
||
|
|
},
|
||
|
|
onShareTimeline: function() {
|
||
|
|
return {
|
||
|
|
title: '君到苏州-剧场演出',
|
||
|
|
query: '',
|
||
|
|
imageUrl: 'https://static.ticket.sz-trip.com/xcxImages/index/icon4New.png'
|
||
|
|
}
|
||
|
|
}
|
||
|
|
})
|