|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
// pages/index/index.js
|
|
|
|
|
import {
|
|
|
|
|
httpUtil,location_city
|
|
|
|
|
httpUtil,
|
|
|
|
|
location_city
|
|
|
|
|
} from '../../../utils/util'
|
|
|
|
|
Page({
|
|
|
|
|
|
|
|
|
@ -19,6 +20,10 @@ Page({
|
|
|
|
|
{ sort_type: '2', list: 'newMake', page: '1', has_more: 'false' },
|
|
|
|
|
{ sort_type: '3', list: 'newMake', page: '1', has_more: 'false' },
|
|
|
|
|
],
|
|
|
|
|
screen_list: [], //开屏广告信息
|
|
|
|
|
// screen_imgUrl: 'https://mahuaimage2.oss-cn-qingdao.aliyuncs.com/mini_app/video/61382ab58bf84d41d8cd98f00b204e9800998ecf8427e.jpg',
|
|
|
|
|
isActionMarkShow: false, //开屏广告
|
|
|
|
|
isGiftMarkShow: false //首页弹窗
|
|
|
|
|
},
|
|
|
|
|
// 轮播图
|
|
|
|
|
bindchange(e) {
|
|
|
|
@ -76,7 +81,9 @@ search1(){
|
|
|
|
|
city_id
|
|
|
|
|
}).then(res2 => {
|
|
|
|
|
that.setData({
|
|
|
|
|
city_list: res2,city_id:res2.current.city_id,city:res2.current.city_name
|
|
|
|
|
city_list: res2,
|
|
|
|
|
city_id: res2.current.city_id,
|
|
|
|
|
city: res2.current.city_name
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -84,20 +91,42 @@ search1(){
|
|
|
|
|
let sort_type = 1
|
|
|
|
|
let page = 1
|
|
|
|
|
this.get_show_list(city_id, sort_type, page)
|
|
|
|
|
// 获取开屏广告
|
|
|
|
|
httpUtil("/api/v1/home-promotion", "get", {
|
|
|
|
|
city_id
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.length == 0) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let key = wx.getStorageSync('key')
|
|
|
|
|
if (key.id == res.id) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.setData({
|
|
|
|
|
screen_list: res,
|
|
|
|
|
isActionMarkShow: true
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
wx.stopPullDownRefresh()
|
|
|
|
|
},
|
|
|
|
|
// 获取演出列表方法封装
|
|
|
|
|
get_show_list(city_id, sort_type, page) {
|
|
|
|
|
httpUtil("/api/v1/show-list", "get", {
|
|
|
|
|
city_id,sort_type,page
|
|
|
|
|
city_id,
|
|
|
|
|
sort_type,
|
|
|
|
|
page
|
|
|
|
|
}).then(res => {
|
|
|
|
|
let show_list = this.data.show_list
|
|
|
|
|
show_list[sort_type - 1].list = res.show_list
|
|
|
|
|
show_list[sort_type - 1].has_more = res.has_more
|
|
|
|
|
this.setData({
|
|
|
|
|
show_list,current_list:res.show_list,no_more:!res.has_more
|
|
|
|
|
show_list,
|
|
|
|
|
current_list: res.show_list,
|
|
|
|
|
no_more: !res.has_more
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
banner_nav: function (e) {
|
|
|
|
|
let url = e.currentTarget.dataset.key
|
|
|
|
|
console.log("前往地址:", url)
|
|
|
|
@ -123,6 +152,26 @@ banner_nav:function(e){
|
|
|
|
|
url: '/pages/opera/show/show_detail?cycle_id=' + e.currentTarget.dataset.cycle_id,
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
cancle_mark(e) {
|
|
|
|
|
let id=e.currentTarget.dataset.id
|
|
|
|
|
wx.setStorageSync('key', {id:id})
|
|
|
|
|
this.setData({
|
|
|
|
|
isActionMarkShow: false,
|
|
|
|
|
isGiftMarkShow: true
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
advertisementMark_show() {
|
|
|
|
|
this.setData({
|
|
|
|
|
isActionMarkShow: true,
|
|
|
|
|
isGiftMarkShow: false
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onlinkurl(e) {
|
|
|
|
|
let link_url = e.currentTarget.dataset.link_url
|
|
|
|
|
wx.navigateTo({
|
|
|
|
|
url: link_url
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
|
*/
|
|
|
|
@ -140,12 +189,11 @@ banner_nav:function(e){
|
|
|
|
|
this.refresh_info(getApp().globalData.city_id)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
|
|
|
*/
|
|
|
|
|
onReady: function () {
|
|
|
|
|
|
|
|
|
|
wx.setStorageSync('key', { id: '' })
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -171,9 +219,11 @@ banner_nav:function(e){
|
|
|
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
|
|
|
*/
|
|
|
|
|
onPullDownRefresh: function () {
|
|
|
|
|
wx.reLaunch({
|
|
|
|
|
url: '/pages/index/index/index'
|
|
|
|
|
})
|
|
|
|
|
// wx.reLaunch({
|
|
|
|
|
// url: '/pages/index/index/index'
|
|
|
|
|
// })
|
|
|
|
|
this.refresh_info(getApp().globalData.city_id)
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -193,7 +243,9 @@ banner_nav:function(e){
|
|
|
|
|
show_list[this.data.swith_area].page = page
|
|
|
|
|
show_list[this.data.swith_area].has_more = res.has_more
|
|
|
|
|
this.setData({
|
|
|
|
|
show_list,current_list: show_list[this.data.swith_area].list,no_more:!res.has_more
|
|
|
|
|
show_list,
|
|
|
|
|
current_list: show_list[this.data.swith_area].list,
|
|
|
|
|
no_more: !res.has_more
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|