19 changed files with 528 additions and 16 deletions
@ -0,0 +1,122 @@ |
|||
// pages/activity/newarrival/index.js
|
|||
import commonApi from "../../../utils/https/common" |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
list1:[], |
|||
list2:[], |
|||
list3:[], |
|||
list4:[] |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
let tag_id=43; |
|||
commonApi._post('product/get_product_by_tag',{ |
|||
tag_id: tag_id, |
|||
offset: 0, |
|||
limit: 100, |
|||
}).then(res=>{ |
|||
res.data.list.map(item=>{ |
|||
item.display_tags = item.display_tags.split(",") || []; |
|||
item.display_tags = item.display_tags.splice(0,2) |
|||
}) |
|||
this.setData({ |
|||
list1:res.data.list |
|||
}) |
|||
}) |
|||
commonApi._post('product/get_product_by_tag',{ |
|||
tag_id: tag_id+1, |
|||
offset: 0, |
|||
limit: 100, |
|||
}).then(res=>{ |
|||
res.data.list.map(item=>{ |
|||
item.display_tags = item.display_tags.split(",") || []; |
|||
item.display_tags = item.display_tags.splice(0,2) |
|||
}) |
|||
this.setData({ |
|||
list2:res.data.list |
|||
}) |
|||
}) |
|||
commonApi._post('product/get_product_by_tag',{ |
|||
tag_id: tag_id+2, |
|||
offset: 0, |
|||
limit: 100, |
|||
}).then(res=>{ |
|||
res.data.list.map(item=>{ |
|||
item.display_tags = item.display_tags.split(",") || []; |
|||
item.display_tags = item.display_tags.splice(0,2) |
|||
}) |
|||
this.setData({ |
|||
list3:res.data.list |
|||
}) |
|||
}) |
|||
commonApi._post('product/get_product_by_tag',{ |
|||
tag_id: tag_id+3, |
|||
offset: 0, |
|||
limit: 100, |
|||
}).then(res=>{ |
|||
res.data.list.map(item=>{ |
|||
item.display_tags = item.display_tags.split(",") || []; |
|||
item.display_tags = item.display_tags.splice(0,2) |
|||
}) |
|||
this.setData({ |
|||
list4:res.data.list |
|||
}) |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"usingComponents": {} |
|||
} |
|||
@ -0,0 +1,67 @@ |
|||
<!--pages/activity/newarrival/index.wxml--> |
|||
<image src="https://m.cloud.sz-trip.com/static/images/activity/newarrival/topBac.png" mode="widthFix" class="main-img"></image> |
|||
<view class="title">景点门票</view> |
|||
<view class="subtitle">新品来袭 爆款推荐</view> |
|||
<view class="list" wx:if="{{list1.length}}"> |
|||
<view class="item" wx:for="{{list1}}"> |
|||
<image src="{{item.headimg}}" mode="aspectFill"></image> |
|||
<view class="product-title textOver">{{item.title}}</view> |
|||
<view class="product-tags"> |
|||
<view class="product-tag textOver" wx:for="{{item.display_tags}}">{{item}}</view> |
|||
</view> |
|||
<view class="product-bottom"> |
|||
<view class="price">{{item.price?item.price/100:0}}</view> |
|||
<view class="btn">点击预定</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="title">文创特产</view> |
|||
<view class="subtitle">甄选好货 口碑之选</view> |
|||
<view class="list" wx:if="{{list2.length}}"> |
|||
<view class="item" wx:for="{{list2}}"> |
|||
<image src="{{item.headimg}}" mode="aspectFill"></image> |
|||
<view class="product-title textOver">{{item.title}}</view> |
|||
<view class="product-tags"> |
|||
<view class="product-tag textOver" wx:for="{{item.display_tags}}">{{item}}</view> |
|||
</view> |
|||
<view class="product-bottom"> |
|||
<view class="price">{{item.price?item.price/100:0}}</view> |
|||
<view class="btn">点击预定</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="title">演出精选</view> |
|||
<view class="subtitle">精湛演出 生动体验</view> |
|||
<view class="list" wx:if="{{list3.length}}"> |
|||
<view class="item" wx:for="{{list3}}"> |
|||
<image src="{{item.headimg}}" mode="aspectFill"></image> |
|||
<view class="product-title textOver">{{item.title}}</view> |
|||
<view class="product-tags"> |
|||
<view class="product-tag textOver" wx:for="{{item.display_tags}}">{{item}}</view> |
|||
</view> |
|||
<view class="product-bottom"> |
|||
<view class="price">{{item.price?item.price/100:0}}</view> |
|||
<view class="btn">点击预定</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
|
|||
<view class="title">更多精选</view> |
|||
<view class="subtitle">精挑细选 好物推荐</view> |
|||
<view class="list" wx:if="{{list4.length}}"> |
|||
<view class="item" wx:for="{{list4}}"> |
|||
<image src="{{item.headimg}}" mode="aspectFill"></image> |
|||
<view class="product-title textOver">{{item.title}}</view> |
|||
<view class="product-tags"> |
|||
<view class="product-tag textOver" wx:for="{{item.display_tags}}">{{item}}</view> |
|||
</view> |
|||
<view class="product-bottom"> |
|||
<view class="price">{{item.price?item.price/100:0}}</view> |
|||
<view class="btn">点击预定</view> |
|||
</view> |
|||
</view> |
|||
</view> |
|||
<image class="logo" src="https://m.cloud.sz-trip.com/static/images/activity/newarrival/botLogo.png" mode="widthFix"></image> |
|||
<view style="height:1rpx"></view> |
|||
@ -0,0 +1,95 @@ |
|||
/* pages/activity/newarrival/index.wxss */ |
|||
.main-img { |
|||
display: block; |
|||
width: 100%; |
|||
} |
|||
page { |
|||
background: #d4effc; |
|||
color: #5a8db9; |
|||
} |
|||
.title,.subtitle { |
|||
text-align: center; |
|||
} |
|||
.title { |
|||
font-size: 43rpx; |
|||
font-weight: bold; |
|||
} |
|||
.subtitle { |
|||
font-size: 32rpx; |
|||
line-height: 60rpx; |
|||
} |
|||
.list { |
|||
background: linear-gradient(to bottom,#e0f6f2,#b0e6e2); |
|||
display: flex; |
|||
flex-wrap: wrap; |
|||
justify-content: space-between; |
|||
padding: 20rpx; |
|||
margin: 20rpx 13rpx; |
|||
border-radius: 7rpx; |
|||
padding-bottom: 8rpx; |
|||
} |
|||
.item { |
|||
margin-bottom: 12rpx; |
|||
width: 330rpx; |
|||
} |
|||
.item image { |
|||
width: 330rpx; |
|||
height: 272rpx; |
|||
display: block; |
|||
border-radius: 7rpx; |
|||
} |
|||
.product-title { |
|||
color: #4a4a4a; |
|||
font-size: 23rpx; |
|||
text-align: center; |
|||
line-height: 50rpx; |
|||
} |
|||
.product-tags { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
color: #fff; |
|||
font-size: 16rpx; |
|||
height: 23rpx; |
|||
line-height: 23rpx; |
|||
} |
|||
.product-tag { |
|||
padding: 0 12rpx; |
|||
margin-right: 10rpx; |
|||
background-color: #5da980; |
|||
border-radius: 7rpx; |
|||
} |
|||
.product-tags .product-tag:nth-child(2){ |
|||
background: #c39f70; |
|||
} |
|||
.product-tags .product-tag:last-child { |
|||
margin-right: 0; |
|||
} |
|||
.product-bottom { |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: center; |
|||
} |
|||
.price { |
|||
color: #d60000; |
|||
font-size: 38rpx; |
|||
flex-shrink: 0; |
|||
} |
|||
.price::before { |
|||
content: "¥"; |
|||
font-size: 16rpx; |
|||
} |
|||
.btn { |
|||
width: 83rpx; |
|||
line-height: 29rpx; |
|||
text-align: center; |
|||
color: #fff; |
|||
font-size: 17rpx; |
|||
margin-left: 10rpx; |
|||
background:#d60000; |
|||
} |
|||
.logo { |
|||
width: 132rpx; |
|||
margin: 60rpx auto; |
|||
display: block; |
|||
} |
|||
@ -0,0 +1,138 @@ |
|||
// pages/activity/springten/list/index.js
|
|||
import commonApi from "../../../../utils/https/common" |
|||
import util from "../../../../utils/util" |
|||
Page({ |
|||
|
|||
/** |
|||
* 页面的初始数据 |
|||
*/ |
|||
data: { |
|||
types:['必赏','必吃','必游','必玩','必购','必住','赏夜戏','品夜饮','尝夜宴','逛夜市'], |
|||
type:0, |
|||
list:[], |
|||
area_id:"" |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面加载 |
|||
*/ |
|||
onLoad: function (options) { |
|||
this.setData({ |
|||
type:options.type, |
|||
area_id:options.area_id |
|||
}) |
|||
this.getList(); |
|||
}, |
|||
getList:function(){ |
|||
if(this.data.total<=this.data.list.length) return; |
|||
commonApi._post("scene/get_scene_by_tag",{ |
|||
offset:this.data.list.length, |
|||
limit:30, |
|||
tag_id:this.data.type!=0?17+Number(this.data.type):27, |
|||
area_id:this.data.area_id |
|||
}).then(res=>{ |
|||
res.data.list.map(item=>{ |
|||
if(item.type && item.type.indexOf('tenscenic')!=-1){ |
|||
item.isYunHe = true; |
|||
} |
|||
else { |
|||
item.isYunHe = false; |
|||
} |
|||
item.brief_intro = item.brief_intro.replace(/<\/?.+?>/g,""); |
|||
item.display_tags = item.display_tags?item.display_tags.split(","):[]; |
|||
item.display_tags = item.display_tags.splice(0,2); |
|||
}) |
|||
this.setData({ |
|||
list:this.data.list.concat(res.data.list), |
|||
total:res.data.count |
|||
}) |
|||
}) |
|||
}, |
|||
detail:function(e){ |
|||
let item = e.currentTarget.dataset.item; |
|||
if(item.is_nav){ |
|||
this.gotoLocation(e); |
|||
} |
|||
else if(item.type && item.type.indexOf('tenscenic')!=-1){ |
|||
this.gotoFoodInfo(e) |
|||
} |
|||
else { |
|||
this.gotoDetail(e) |
|||
} |
|||
}, |
|||
gotoWeb:function(e){ |
|||
let item = e.currentTarget.dataset.item; |
|||
app.globalData.weburl = item.ext_link; |
|||
wx.navigateTo({ |
|||
url: '/pages/pbService/web/index', |
|||
}) |
|||
}, |
|||
gotoDetail:function(e){ |
|||
let item = e.currentTarget.dataset.item; |
|||
util.gotoDetail(item) |
|||
}, |
|||
gotoLocation:function(e){ |
|||
let item = e.currentTarget.dataset.item; |
|||
wx.openLocation({ |
|||
latitude: item.lat, |
|||
longitude: item.lon, |
|||
name:item.title, |
|||
address:item.address |
|||
}) |
|||
}, |
|||
gotoFoodInfo:function(e){ |
|||
let item = e.currentTarget.dataset.item; |
|||
wx.navigateTo({ |
|||
url: '/pages/info/foodInfo/index?id='+item.id, |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面初次渲染完成 |
|||
*/ |
|||
onReady: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面显示 |
|||
*/ |
|||
onShow: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面隐藏 |
|||
*/ |
|||
onHide: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 生命周期函数--监听页面卸载 |
|||
*/ |
|||
onUnload: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面相关事件处理函数--监听用户下拉动作 |
|||
*/ |
|||
onPullDownRefresh: function () { |
|||
|
|||
}, |
|||
|
|||
/** |
|||
* 页面上拉触底事件的处理函数 |
|||
*/ |
|||
onReachBottom: function () { |
|||
this.getList() |
|||
}, |
|||
|
|||
/** |
|||
* 用户点击右上角分享 |
|||
*/ |
|||
onShareAppMessage: function () { |
|||
|
|||
} |
|||
}) |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"usingComponents": { |
|||
"title":"/pages/component/TitleHeader" |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
<!--pages/activity/springten/list/index.wxml--> |
|||
<title title="{{types[type]}}榜单"></title> |
|||
<view class="item" wx:for="{{list}}" bindtap="detail" data-item="{{item}}"> |
|||
<view style="flex:1;width:500rpx"> |
|||
<view class="title textOver">{{item.title}}</view> |
|||
<view class="address textOver"><text class="iconfont icon-location"></text>{{item.address}}</view> |
|||
</view> |
|||
<image src="https://static.ticket.sz-trip.com/uploads/20210401/62fed792ae34b824a7c3ae1a30a142c8.png" mode="aspectFill"></image> |
|||
</view> |
|||
@ -0,0 +1,30 @@ |
|||
/* pages/activity/springten/list/index.wxss */ |
|||
.item { |
|||
margin: 26rpx; |
|||
display: flex; |
|||
background:url(https://static.ticket.sz-trip.com/uploads/20210401/09b3cdf766827f3194a021511cf33030.png); |
|||
height: 116rpx; |
|||
padding: 0 30rpx; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
background-size: 100% 100%; |
|||
} |
|||
.item image { |
|||
width: 86rpx; |
|||
height: 86rpx; |
|||
display: block; |
|||
flex-shrink: 0; |
|||
} |
|||
.item .title { |
|||
font-size: 32rpx; |
|||
font-weight: bold; |
|||
} |
|||
.item .address { |
|||
color: #666; |
|||
font-size: 24rpx; |
|||
margin-top: 8rpx; |
|||
} |
|||
.item .iconfont { |
|||
font-size: 24rpx; |
|||
margin-right: 4rpx; |
|||
} |
|||
Loading…
Reference in new issue