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.
205 lines
4.4 KiB
205 lines
4.4 KiB
// pages/list/mayday/index.js
|
|
import commonApi from "../../../utils/https/common"
|
|
import util from "../../../utils/util"
|
|
let app = getApp();
|
|
Page({
|
|
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
bottoms:["scene","hotel","feiyi","sale","road","movieticket"],
|
|
areas:{},
|
|
list1:[],
|
|
list2:[],
|
|
list3:[],
|
|
list4:[],
|
|
list5:[],
|
|
list6:[],
|
|
maydayurl:null
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
// 获取打卡景点
|
|
commonApi._post("act/get_suzhou_areas",{}).then(res=>{
|
|
let areas={}
|
|
res.data.map(item=>{
|
|
areas[item.area_id]=item.area_title
|
|
})
|
|
this.setData({
|
|
areas:areas
|
|
})
|
|
})
|
|
commonApi._post('product/get_product_by_tag',{
|
|
tag_id:47,
|
|
offset:0,
|
|
limit:100
|
|
}).then(res=>{
|
|
res.data.list.map(item=>{
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[];
|
|
item.display_tags = item.display_tags.slice(0,2)
|
|
})
|
|
this.setData({
|
|
list1:res.data.list
|
|
})
|
|
})
|
|
commonApi._post('product/get_product_by_tag',{
|
|
tag_id:48,
|
|
offset:0,
|
|
limit:100
|
|
}).then(res=>{
|
|
res.data.list.map(item=>{
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[];
|
|
item.display_tags = item.display_tags.slice(0,2)
|
|
})
|
|
this.setData({
|
|
list2:res.data.list
|
|
})
|
|
})
|
|
commonApi._post('product/get_product_by_tag',{
|
|
tag_id:49,
|
|
offset:0,
|
|
limit:100
|
|
}).then(res=>{
|
|
res.data.list.map(item=>{
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[];
|
|
item.display_tags = item.display_tags.slice(0,2)
|
|
})
|
|
this.setData({
|
|
list3:res.data.list
|
|
})
|
|
})
|
|
commonApi._post('product/get_product_by_tag',{
|
|
tag_id:53,
|
|
offset:0,
|
|
limit:100
|
|
}).then(res=>{
|
|
res.data.list.map(item=>{
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[];
|
|
item.display_tags = item.display_tags.slice(0,2)
|
|
})
|
|
this.setData({
|
|
list4:res.data.list
|
|
})
|
|
})
|
|
commonApi._post('product/get_product_by_tag',{
|
|
tag_id:51,
|
|
offset:0,
|
|
limit:100
|
|
}).then(res=>{
|
|
res.data.list.map(item=>{
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[];
|
|
item.display_tags = item.display_tags.slice(0,2)
|
|
})
|
|
this.setData({
|
|
list5:res.data.list
|
|
})
|
|
})
|
|
commonApi._post('product/get_product_by_tag',{
|
|
tag_id:52,
|
|
offset:0,
|
|
limit:100
|
|
}).then(res=>{
|
|
res.data.list.map(item=>{
|
|
item.display_tags = item.display_tags?item.display_tags.split(","):[];
|
|
item.display_tags = item.display_tags.slice(0,2)
|
|
})
|
|
this.setData({
|
|
list6:res.data.list
|
|
})
|
|
})
|
|
commonApi._post("pbservice/Other/getClientConfig",{
|
|
unique_key:"wechatxcx"
|
|
}).then(res=>{
|
|
let data = JSON.parse(res.data);
|
|
this.setData({
|
|
maydayurl:data.maydayurl
|
|
})
|
|
})
|
|
},
|
|
gotoDetail:function(e){
|
|
let item = e.currentTarget.dataset.item;
|
|
util.gotoDetail(item)
|
|
},
|
|
gototop:function(){
|
|
wx.pageScrollTo({
|
|
duration: 300,
|
|
scrollTop:0
|
|
})
|
|
},
|
|
clickBanner:function(){
|
|
if(this.data.maydayurl){
|
|
app.globalData.weburl=this.data.maydayurl
|
|
wx.navigateTo({
|
|
url: '/pages/pbService/web/index'
|
|
})
|
|
}
|
|
},
|
|
scrollPage:function(e){
|
|
let index = e.currentTarget.dataset.index-1;
|
|
if(index==0){
|
|
this.gototop()
|
|
return;
|
|
}
|
|
let query = wx.createSelectorQuery().in(this);
|
|
query.select("#box"+index).boundingClientRect();
|
|
query.exec(function (res) {
|
|
wx.pageScrollTo({
|
|
duration: 300,
|
|
scrollTop:res[0].top - 50
|
|
})
|
|
});
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面初次渲染完成
|
|
*/
|
|
onReady: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面显示
|
|
*/
|
|
onShow: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面隐藏
|
|
*/
|
|
onHide: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面卸载
|
|
*/
|
|
onUnload: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面相关事件处理函数--监听用户下拉动作
|
|
*/
|
|
onPullDownRefresh: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 页面上拉触底事件的处理函数
|
|
*/
|
|
onReachBottom: function () {
|
|
|
|
},
|
|
|
|
/**
|
|
* 用户点击右上角分享
|
|
*/
|
|
onShareAppMessage: function () {
|
|
|
|
}
|
|
})
|