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.
194 lines
4.6 KiB
194 lines
4.6 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:[]
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
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('scene/get_scene_by_tag',{
|
|
tag_id:29,
|
|
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
|
|
})
|
|
})
|
|
},
|
|
gotoDetail:function(e){
|
|
let item = e.currentTarget.dataset.item;
|
|
util.gotoDetail(item)
|
|
},
|
|
gototop:function(){
|
|
wx.pageScrollTo({
|
|
duration: 300,
|
|
scrollTop:0
|
|
})
|
|
},
|
|
clickBanner:function(){
|
|
wx.navigateToMiniProgram({
|
|
appId: 'wx336dcaf6a1ecf632',
|
|
page:'page/home/webview/webview?hideShare=0&src=https%3A%2F%2Fopen.weixin.qq.com%2Fconnect%2Foauth2%2Fauthorize%3Fappid%3Dwx3827070276e49e30%26redirect_uri%3Dhttps%3A%2F%2Fwx.17u.cn%2Fflight%2Fgetopenid.html%3Furl%3Dhttps%25253A%25252F%25252Fwx.17u.cn%25252Finternalcarrebornwechat%25252Fview%25252Fmain.html%252523%25252FspecialCarIndex%25252FinstantCar%25253Frefid%25253D1563845199%26showwxpaytitle%3D1%26response_type%3Dcode%26scope%3Dsnsapi_base%26state%3D123%26connect_redirect%3D1%23wechat_redirect'
|
|
})
|
|
},
|
|
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 () {
|
|
|
|
}
|
|
})
|