diff --git a/app.json b/app.json index 6c8267c..deaf6de 100644 --- a/app.json +++ b/app.json @@ -113,7 +113,9 @@ "pages/activity/year2020/index", "pages/activity/suyear/index", "pages/activity/spring2021/index", - "pages/activity/springten/index" + "pages/activity/springten/list/index", + "pages/activity/springten/index", + "pages/activity/newarrival/index" ], "permission": { "scope.userLocation": { diff --git a/pages/activity/newarrival/index.js b/pages/activity/newarrival/index.js new file mode 100644 index 0000000..5e23eb2 --- /dev/null +++ b/pages/activity/newarrival/index.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/activity/newarrival/index.json b/pages/activity/newarrival/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/activity/newarrival/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/activity/newarrival/index.wxml b/pages/activity/newarrival/index.wxml new file mode 100644 index 0000000..1b11062 --- /dev/null +++ b/pages/activity/newarrival/index.wxml @@ -0,0 +1,67 @@ + + +景点门票 +新品来袭 爆款推荐 + + + + {{item.title}} + + {{item}} + + + {{item.price?item.price/100:0}} + 点击预定 + + + + +文创特产 +甄选好货 口碑之选 + + + + {{item.title}} + + {{item}} + + + {{item.price?item.price/100:0}} + 点击预定 + + + + +演出精选 +精湛演出 生动体验 + + + + {{item.title}} + + {{item}} + + + {{item.price?item.price/100:0}} + 点击预定 + + + + +更多精选 +精挑细选 好物推荐 + + + + {{item.title}} + + {{item}} + + + {{item.price?item.price/100:0}} + 点击预定 + + + + + \ No newline at end of file diff --git a/pages/activity/newarrival/index.wxss b/pages/activity/newarrival/index.wxss new file mode 100644 index 0000000..b8dffea --- /dev/null +++ b/pages/activity/newarrival/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/activity/springten/index.js b/pages/activity/springten/index.js index 10ccc59..8abb360 100644 --- a/pages/activity/springten/index.js +++ b/pages/activity/springten/index.js @@ -53,7 +53,7 @@ Page({ if(this.data.total<=this.data.list.length) return; commonApi._post("scene/get_scene_by_tag",{ offset:this.data.list.length, - limit:10, + limit:30, tag_id:this.data.type!=0?17+Number(this.data.type):27, area_id:this.data.areaIndex>-1?this.data.areas[this.data.areaIndex].area_id:null }).then(res=>{ @@ -139,7 +139,7 @@ Page({ * 页面上拉触底事件的处理函数 */ onReachBottom: function () { - this.getList() + // this.getList() }, /** diff --git a/pages/activity/springten/index.wxml b/pages/activity/springten/index.wxml index 7d5d1ba..bd179b8 100644 --- a/pages/activity/springten/index.wxml +++ b/pages/activity/springten/index.wxml @@ -24,10 +24,10 @@ 地址:{{item.address}} - - 打开导航 + 打开导航 查看详情 立即预订 - —— 没有更多了 —— - \ No newline at end of file + + +查看更多 \ No newline at end of file diff --git a/pages/activity/springten/index.wxss b/pages/activity/springten/index.wxss index 004aa87..a592a67 100644 --- a/pages/activity/springten/index.wxss +++ b/pages/activity/springten/index.wxss @@ -145,4 +145,15 @@ margin-left: 4rpx; } .areatext { +} +.btn { + width: 220rpx; + line-height: 57rpx; + text-align: center; + background: #FFFFFF; + border: 1rpx solid #999999; + border-radius: 29rpx; + color: #333; + font-size: 23rpx; + margin: 40rpx auto; } \ No newline at end of file diff --git a/pages/activity/springten/list/index.js b/pages/activity/springten/list/index.js new file mode 100644 index 0000000..adf70ba --- /dev/null +++ b/pages/activity/springten/list/index.js @@ -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 () { + + } +}) \ No newline at end of file diff --git a/pages/activity/springten/list/index.json b/pages/activity/springten/list/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/springten/list/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/springten/list/index.wxml b/pages/activity/springten/list/index.wxml new file mode 100644 index 0000000..644c35e --- /dev/null +++ b/pages/activity/springten/list/index.wxml @@ -0,0 +1,9 @@ + + + + + {{item.title}} + {{item.address}} + + + diff --git a/pages/activity/springten/list/index.wxss b/pages/activity/springten/list/index.wxss new file mode 100644 index 0000000..1c2d96f --- /dev/null +++ b/pages/activity/springten/list/index.wxss @@ -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; +} \ No newline at end of file diff --git a/pages/list/activitynew/index.js b/pages/list/activitynew/index.js index 002e549..1f42361 100644 --- a/pages/list/activitynew/index.js +++ b/pages/list/activitynew/index.js @@ -171,6 +171,22 @@ Page({ area_key:this.data.areas[this.data.area].area_code, page_num:10 }).then(res=>{ + let now = new Date().getTime(); + res.data.rows.map(item=>{ + if(item.end_date){ + let end_date = item.end_date; + if(end_date.indexOf(":")==-1){ + end_date = end_date+" 23:59:59"; + } + end_date = new Date(end_date.replace(/-/g,'/')).getTime(); + if(end_date + 已结束 {{item.from_platform}} + diff --git a/pages/list/activitynew/index.wxss b/pages/list/activitynew/index.wxss index 290422e..9feabb3 100644 --- a/pages/list/activitynew/index.wxss +++ b/pages/list/activitynew/index.wxss @@ -134,6 +134,20 @@ page { align-items: center; justify-content: space-between; padding: 27rpx 22rpx; + position: relative; +} +.end-mask { + position: absolute; + right: 22rpx; + top: 27rpx; + text-align: center; + width: 320rpx; + height: 220rpx; + line-height: 220rpx; + z-index: 1; + background:rgba(0, 0, 0, 0.5); + color:#fff; + border-radius: 10rpx; } .activity-item-out { box-shadow: -1rpx 1rpx 16rpx 0px rgba(6, 0, 1, 0.1); diff --git a/pages/list/sale/index.js b/pages/list/sale/index.js index bb1de6d..256ad42 100644 --- a/pages/list/sale/index.js +++ b/pages/list/sale/index.js @@ -38,7 +38,6 @@ Page({ list:this.data.list.concat(res.data) }) this.daojishi() - console.log(res) }) }, daojishi:function(){ diff --git a/pages/list/sale/index.wxml b/pages/list/sale/index.wxml index 6db22ed..944e580 100644 --- a/pages/list/sale/index.wxml +++ b/pages/list/sale/index.wxml @@ -1,8 +1,7 @@ 正在疯抢 - 即将开抢 - 明日预告 + 活动预告 diff --git a/pages/user/bindtel/index.js b/pages/user/bindtel/index.js index 2379540..5bd9716 100644 --- a/pages/user/bindtel/index.js +++ b/pages/user/bindtel/index.js @@ -25,7 +25,7 @@ Page({ onLoad: function (options) { this.changeImgCode(); this.setData({ - regToken: decodeURIComponent(options.regToken) || null + regToken: options.regToken?decodeURIComponent(options.regToken):null }) }, cancel:function(){ diff --git a/project.private.config.json b/project.private.config.json index 67eafcc..54f4646 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -20,14 +20,14 @@ "scene": null }, { - "name": "春天十大必游", - "pathName": "pages/activity/springten/index", + "name": "新品专题", + "pathName": "pages/activity/newarrival/index", "query": "", "scene": null }, { - "name": "pages/activity/suyear/index", - "pathName": "pages/activity/suyear/index", + "name": "pages/list/activitynew/index", + "pathName": "pages/list/activitynew/index", "query": "id=0000000000LINELINEINFO18082257199008", "scene": null },