diff --git a/app.json b/app.json index e52187c..f4b03de 100644 --- a/app.json +++ b/app.json @@ -58,6 +58,7 @@ "pages/user/nickname/index", "pages/user/likes/index", "pages/user/email/index", + "pages/list/mayday/index", "pages/list/feiyi/index", "pages/list/haoxing/index", "pages/list/food/index", diff --git a/pages/list/mayday/index.js b/pages/list/mayday/index.js new file mode 100644 index 0000000..b405eb3 --- /dev/null +++ b/pages/list/mayday/index.js @@ -0,0 +1,205 @@ +// 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 () { + + } +}) \ No newline at end of file diff --git a/pages/list/mayday/index.json b/pages/list/mayday/index.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/pages/list/mayday/index.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/pages/list/mayday/index.wxml b/pages/list/mayday/index.wxml new file mode 100644 index 0000000..c99af69 --- /dev/null +++ b/pages/list/mayday/index.wxml @@ -0,0 +1,131 @@ + + + + + + + + + + + + + + + + + + + {{areas[item.area_id]}} + + {{item.title}} + + {{item}} + + + {{item.price/100}} + 立即购买 + + + + + + + + + + + + + + + + + TOP{{index+1}} + + + + {{item.title}} + 地址:{{item.address || item.scene_address}} + 电话:{{item.scene_tel}} + 点击预约 + + + + + + + + {{areas[item.area_id]}} + + {{item.title}} + + {{item}} + + + {{item.price/100}} + 立即购买 + + + + + + + {{areas[item.area_id]}} + + {{item.title}} + + {{item}} + + + {{item.price/100}} + 立即购买 + + + + + + + {{areas[item.area_id]}} + + {{item.title}} + + {{item}} + + + {{item.price/100}} + 立即购买 + + + + + + + {{areas[item.area_id]}} + + {{item.title}} + + {{item}} + + + {{item.price/100}} + 立即购买 + + + + + + + + + + + + + + + + + + TOP + \ No newline at end of file diff --git a/pages/list/mayday/index.wxss b/pages/list/mayday/index.wxss new file mode 100644 index 0000000..5f6b25e --- /dev/null +++ b/pages/list/mayday/index.wxss @@ -0,0 +1,278 @@ +/* pages/list/mayday/index.wxss */ +.btns { + position: absolute; + left: 41rpx; + right: 41rpx; + top: 683rpx; + display: flex; + flex-wrap: wrap; + justify-content: space-between; + z-index: 1; +} +.btn { + height: 69rpx; + margin-bottom: 15rpx; + flex-shrink: 0; +} +page { + background: #69bff2; + width: 100%; + overflow-x: hidden; + font-family: "MicrosoftYaHei"; +} +.content { + background: url(https://sz-qd.oss-cn-hangzhou.aliyuncs.com/xcxImages/mayday/bg.png); + background-size: 100%; + background-repeat: repeat-y; + padding-top: 72rpx; +} +.main-img { + display: block; + width: 100%; +} +.content .main-img { + width: 377rpx; + margin: 0 auto; + margin-top: 50rpx; +} +.list { + display: flex; + justify-content: space-between; + margin: 0 16rpx; + flex-wrap: wrap; +} +.item { + width: 336rpx; + background-color: #fed78e; + border-radius: 20rpx; + padding: 7rpx; + position: relative; + margin-bottom: 20rpx; + color: #4b4b4b; +} +.city-box { + position: absolute; + z-index: 1; + left: 7rpx; + top: 7rpx; + line-height: 60rpx; + border-radius: 20rpx 0 20rpx 0; + background: #da902f; + padding: 0 20rpx; + font-size: 31rpx; +} +.headimg { + width: 336rpx; + height: 301rpx; + border-radius: 20rpx; +} +.item .title { + font-size: 31rpx; + width: 316rpx; + margin: 0 10rpx; +} +.tags { + display: flex; + font-size: 15rpx; + color: #fff; + margin: 0 10rpx; +} +.tag { + background-color: #a1c443; + border-radius: 7rpx; + line-height: 23rpx; + padding: 0 16rpx; + margin-right: 10rpx; +} +.tags .tag:last-child { + margin-right: 0; +} +.tags .tag:nth-child(2){ + background: #da902f; +} +.item-bottom { + display: flex; + align-items: center; + justify-content: space-between; + margin: 0 10rpx; +} +.item-bottom .price { + font-size: 43rpx; + font-weight: bold; +} +.item-bottom .price::before { + content: "¥"; + font-size: 21rpx; + font-weight: normal; +} +.item-bottom .price::after { + content: "起"; + font-size: 16rpx; + font-weight: normal; +} +.item-btn { + width: 121rpx; + line-height: 37rpx; + border-radius: 18rpx; + background-color: #ffffff; + box-shadow: 0rpx 3rpx 11rpx 0rpx rgba(2, 25, 62, 0.27); + color: #66b578; + font-size: 20rpx; + text-align: center; +} +.new-item { + position: relative; + margin: 0 30rpx; + margin-bottom: 70rpx; + margin-top: 30rpx; + margin-right: 36rpx; +} +.new-item .iconimg { + transform: rotate(10deg); + width: 46rpx; + display: block; + position: absolute; + left: 80rpx; + top: -40rpx; +} +.new-item .iconimg:nth-child(2){ + right: 40rpx; + left: auto; +} +.new-item .iconimg1 { + width: 60rpx; + display: block; + position: absolute; + left: 40rpx; + top: -40rpx; + z-index: 2; +} +.new-item .topbg { + position: absolute; + width: 172rpx; + left: 50%; + margin-left: -86rpx; + top: -10rpx; +} +.new-item .topbg image { + display: block; + width: 172rpx; +} +.topbg-text { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; + color: #ffe0ac; + font-size: 29rpx; +} +.new-item-bg { + width: 100%; + height: 340rpx; + padding: 7rpx; + border-radius: 20rpx; + background: white; + transform: rotate(-2deg); + position: relative; + z-index: 1; +} +.new-headimg { + display: block; + width: 340rpx; + height: 290rpx; + margin-left: 20rpx; + border-radius: 10rpx; +} +.new-item-bg-in { + background: #4fb5f1; + height: 100%; + border-radius: 20rpx; +} +.new-item-bg1 { + position: absolute; + left: 0; + right: 0; + top: 0; + z-index: 1; + transform: rotate(2deg); +} +.new-item-info { + background: #fdda97; + height: calc(100% - 20rpx); + padding-top: 20rpx; + border-radius: 20rpx; + display: flex; + align-items: center; +} +.new-info { + transform: rotate(-2deg); + flex: 1; + width: 200rpx; + text-align: center; + font-size: 17rpx; + color: #282828; + display: flex; + align-items: center; + justify-content: center; + flex-direction: column; + margin-right: 10rpx; + margin-left: 10rpx; +} +.new-info view { + width: 100%; +} +.new-info-title { + font-size: 36rpx; + color: #e9472e; + margin-bottom: 10rpx; + font-weight: bold; +} +.new-item-btn { + width: 232rpx !important; + line-height: 60rpx; + background-color: #ed5032; + margin: 0 auto; + color: #fff; + border-radius: 30rpx; + font-size: 36rpx; + margin-top: 20rpx; +} +.bottom-btns { + position: absolute; + left: 22rpx; + right: 22rpx; + top: 0; + bottom: 0; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} +.bottom-btn { + width: 165rpx; + height: 183rpx; +} +.bottom-btns .bottom-btn:nth-child(-n+2){ + width: 343rpx; + height: 187rpx; +} + +.totop-box { + position: fixed; + right: 30rpx; + bottom: 30rpx; + width: 100rpx; + height: 100rpx; + background: rgba(0, 0, 0, 0.5); + z-index: 3; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + color: #fff; + font-size: 30rpx; + flex-direction: column; +} \ No newline at end of file diff --git a/pages/list/movieticket/list/info/index.js b/pages/list/movieticket/list/info/index.js index dc235d6..6246e89 100644 --- a/pages/list/movieticket/list/info/index.js +++ b/pages/list/movieticket/list/info/index.js @@ -18,7 +18,7 @@ Page({ commonApi._post("Cinema/getMovieDetail",{ show_id:options.id }).then(res=>{ - let showFlag = new Date(res.data.open_day.replace(/-/,'/')).getTime()<=new Date().getTime(); + let showFlag = new Date(res.data.open_day.replace(/-/g,'/')).getTime()<=new Date().getTime(); res.data.listimg = res.data.listimg.split(",") || [] this.setData({ info:res.data, diff --git a/pages/list/movieticket/list/info/index.wxml b/pages/list/movieticket/list/info/index.wxml index 18443c9..8960ea8 100644 --- a/pages/list/movieticket/list/info/index.wxml +++ b/pages/list/movieticket/list/info/index.wxml @@ -4,15 +4,15 @@ {{info.title}} - {{info.duration}}分钟/{{info.type}}/{{info.country}} - {{info.open_day}}在{{info.country}}上映 - 评分:{{info.remark}} + {{info.duration?(info.duration+'分钟/'):''}}{{info.type?(info.type+'/'):''}}{{info.country}} + {{info.open_day}}{{info.country?('在'+info.country):''}}上映 + 评分:{{info.remark}} - 演职人员 - 导演:{{info.director}} - 主演:{{info.leading_role}} + 演职人员 + 导演:{{info.director}} + 主演:{{info.leading_role}} 简介 {{info.content}} diff --git a/pages/list/strategy/index.js b/pages/list/strategy/index.js index 1b46bb8..c7fecba 100644 --- a/pages/list/strategy/index.js +++ b/pages/list/strategy/index.js @@ -9,7 +9,9 @@ Page({ list:[], page_no:1, total:1, - keywords:"" + keywords:"", + type:0, + showKeyword:"" }, /** @@ -18,9 +20,25 @@ Page({ onLoad: function (options) { this.getList() }, - search:function(e){ + changeType:function(e){ + let type = e.currentTarget.dataset.type; + if(type==this.data.type) return; this.setData({ - keywords:e.detail.keywords, + list:[], + page_no:1, + total:1, + type:type + }) + this.getList() + }, + changeKeyword:function(e){ + this.setData({ + showKeyword:e.detail.value + }) + }, + search:function(){ + this.setData({ + keywords:this.data.showKeyword, total:1, list:[], page_no:1 @@ -31,7 +49,7 @@ Page({ let list = this.data.list; if(this.data.total<=list.length) return; commonApi._post("travels/getList",{ - type_key:"", + type_key:this.data.type==1?'travelguide':"", title:this.data.keywords, page_no:this.data.page_no, page_num:10 @@ -45,6 +63,33 @@ Page({ console.log(res) }) }, + showPdf:function(e){ + let pdf = e.currentTarget.dataset.pdf; + wx.showLoading({ + title: '加载中,请稍后', + }) + commonApi._post("travels/addView",{ + id:e.currentTarget.dataset.id + }).then(res=>{ + }) + wx.downloadFile({ + // 示例 url,并非真实存在 + url: pdf, + success: function (res) { + const filePath = res.tempFilePath; + wx.openDocument({ + filePath: filePath, + complete:function(){ + wx.hideLoading() + } + }) + }, + fail:function(e){ + wx.hideLoading() + } + }) + + }, /** * 生命周期函数--监听页面初次渲染完成 diff --git a/pages/list/strategy/index.json b/pages/list/strategy/index.json index 31997d8..35cf02f 100644 --- a/pages/list/strategy/index.json +++ b/pages/list/strategy/index.json @@ -1,5 +1,5 @@ { "usingComponents": { - "search-header": "/pages/component/SearchHeader" + "title":"/pages/component/TitleHeader" } } \ No newline at end of file diff --git a/pages/list/strategy/index.wxml b/pages/list/strategy/index.wxml index 7cea830..1876c22 100644 --- a/pages/list/strategy/index.wxml +++ b/pages/list/strategy/index.wxml @@ -1,10 +1,28 @@ - - - + + + + + + 搜索 + + + + + + + 游记攻略 + + + + + 旅游指南 + + + {{item.title}} - + {{item.subtitle}} @@ -16,8 +34,21 @@ {{item.view_number}} - - - 暂无内容 + + + + + {{item.title}} + + + + + {{item.view_number}} + + 查看详情 > + + + + 暂无内容 \ No newline at end of file diff --git a/pages/list/strategy/index.wxss b/pages/list/strategy/index.wxss index 5e2b063..56cfab8 100644 --- a/pages/list/strategy/index.wxss +++ b/pages/list/strategy/index.wxss @@ -2,30 +2,97 @@ display: block; width: 100%; } -.list { - margin-top: -20rpx; +page { + background: #C1E678; +} +.search-box { + position: absolute; + left: 30rpx; + right: 30rpx; + height: 60rpx; + background: #FFFFFF; + border: 2rpx solid #548027; + border-radius: 30rpx; + box-sizing: border-box; + display: flex; + align-items: center; + justify-content: space-between; + padding-left: 18rpx; + padding-right: 5rpx; + color: #999; + font-size: 26rpx; + margin-top: 20rpx; +} +.search-box input { + flex: 1; + background: none; + display: block; + margin: 0 15rpx; +} +.search-btn { + width: 110rpx; + line-height: 50rpx; + text-align: center; + color: #fff; + background: #548027; + border-radius: 25rpx; +} +.types { + display: flex; + margin: 0 50rpx; + justify-content: space-between; + height: 100rpx; + margin-top: 30rpx; +} +.type { + display: flex; + align-items: center; + justify-content: center; + height: 80rpx; + border-radius: 40rpx; + width: 300rpx; + background:white; position: relative; - z-index: 1; - background: white; - box-shadow: 0px 0px 8rpx 0px rgba(7, 0, 2, 0.3); - border-radius: 20rpx 20rpx 0 0; - padding: 0 34rpx; +} +.type .bgimg { + position: absolute; + display: block; + left: 0; + width: 300rpx; + height: 100rpx; + top: 0; + z-index: -1; +} +.types .iconimg { + display: block; + width: 40rpx; + margin-right: 18rpx; + height: 40rpx; +} +.type.active { + background: none; + color: #fff; +} +.list { + padding: 0 30rpx; } .item { - padding: 28rpx 0; - border-bottom: 1rpx solid #ccc; + padding: 22rpx; + padding-bottom: 34rpx; + background: white; + border-radius: 20rpx; + margin-top: 20rpx; } .title { width: 100%; - font-size: 33rpx; - font-weight: 500; + font-size: 32rpx; color: #000; display: flex; align-items: flex-start; } .subtitle { - font-size: 25rpx; - color: #666; + font-size: 26rpx; + color: #333; margin: 33rpx 0; } .list .item:last-child { @@ -40,8 +107,8 @@ .strategy-bottom { display: flex; align-items: center; - font-size: 20rpx; - color: #666; + font-size: 22rpx; + color: #999; } .strategy-bottom image { display: block; @@ -61,6 +128,10 @@ .strategy-bottom .iconfont { margin-left: 40rpx; flex-shrink: 0; - font-size: 30rpx; + font-size: 32rpx; margin-right: 8rpx; +} +.btn { + color: #548027; + font-size: 22rpx; } \ No newline at end of file diff --git a/pages/map/index.js b/pages/map/index.js index b83beac..8fcb741 100644 --- a/pages/map/index.js +++ b/pages/map/index.js @@ -117,8 +117,8 @@ Page({ }) }) // 运河十景还需要获取是否有购票、线路、住宿、攻略菜单栏 如果没有的话菜单栏要隐藏 - let ajaxes = [commonApi._post("product/get_product_by_type",{ - type:"ticket", + let ajaxes = [commonApi._post("scene/get_scene_by_type",{ + type:"scenic", type_id:"", tenscenic_id:info.info.id, offset:0, @@ -132,10 +132,18 @@ Page({ limit:10 }), commonApi._post("scene/get_scene_by_type",{ - type_id:"2", tenscenic_id:info.info.id, offset:0, - limit:10 + limit:10, + type:"room", + type_id:"" + }), + commonApi._post("scene/get_scene_by_type",{ + tenscenic_id:info.info.id, + offset:0, + limit:10, + type:"restaurant", + type_id:"" }), commonApi._post("travels/getList",{ tenscenic_id:info.info.id, @@ -158,7 +166,11 @@ Page({ } if(res[3].data.total>0){ if(menuIndex==-1) menuIndex = 3; - menus[3] = "攻略" + menus[3] = "美食" + } + if(res[4].data.total>0){ + if(menuIndex==-1) menuIndex = 4; + menus[4] = "攻略" } this.setData({ menus:menus, @@ -211,14 +223,19 @@ Page({ } switch(menu){ case "购票": + service="scene/get_scene_by_type"; + data.type="scenic"; break; case "线路": data.type="line"; break; case "住宿": - data.type_id="2"; - data.type=null; service="scene/get_scene_by_type"; + data.type="room"; + break; + case "美食": + service="scene/get_scene_by_type"; + data.type="restaurant"; break; case "攻略": delete data.type; @@ -250,7 +267,7 @@ Page({ }) } }, - gotoDetail:function(e){ + gotoDetailNew:function(e){ let item = e.currentTarget.dataset.item; util.gotoDetail(item); }, diff --git a/pages/map/index.wxml b/pages/map/index.wxml index 74f589d..f4e7935 100644 --- a/pages/map/index.wxml +++ b/pages/map/index.wxml @@ -67,7 +67,7 @@ {{item}} - + @@ -99,7 +99,7 @@ - + 查看更多 diff --git a/pages/map/index.wxss b/pages/map/index.wxss index c6bed8c..61e092c 100644 --- a/pages/map/index.wxss +++ b/pages/map/index.wxss @@ -198,7 +198,7 @@ border-bottom: 1rpx solid #ccc; } .map-item-menu { - width: 25%; + width: 20%; text-align: center; position: relative; font-size: 33rpx; diff --git a/pages/user/order/list.js b/pages/user/order/list.js index 6216d61..cdfddbe 100644 --- a/pages/user/order/list.js +++ b/pages/user/order/list.js @@ -35,6 +35,13 @@ Page({ }) }, + gotoWeb:function(e){ + let web = e.currentTarget.dataset.web; + app.globalData.weburl = web; + wx.navigateTo({ + url: '/pages/pbService/web/index', + }) + }, changeKeyword:function(e){ this.setData({ keywords:e.detail.value diff --git a/pages/user/order/list.wxml b/pages/user/order/list.wxml index 3469928..359edd4 100644 --- a/pages/user/order/list.wxml +++ b/pages/user/order/list.wxml @@ -39,7 +39,7 @@ - 行程规划 + 行程规划 再次购买 立即评价 取消预订 diff --git a/project.config.json b/project.config.json index 9f22940..65cd319 100644 --- a/project.config.json +++ b/project.config.json @@ -4,7 +4,7 @@ "ignore": [] }, "setting": { - "urlCheck": false, + "urlCheck": true, "es6": true, "enhance": false, "postcss": true, diff --git a/project.private.config.json b/project.private.config.json index 9393637..ed3da28 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -19,8 +19,8 @@ "scene": null }, { - "name": "新品专题", - "pathName": "pages/activity/newarrival/index", + "name": "五一", + "pathName": "pages/list/mayday/index", "query": "", "scene": null }, @@ -55,8 +55,8 @@ "scene": null }, { - "name": "pages/user/order/list", - "pathName": "pages/user/order/list", + "name": "pages/list/strategy/index", + "pathName": "pages/list/strategy/index", "query": "id=10973", "scene": null }