From c18f209d03e8a15edc413ae6531164fd9decd0c2 Mon Sep 17 00:00:00 2001 From: Myth Date: Thu, 16 Sep 2021 17:42:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + app.json | 2 + pages/activity/autumnten/index.js | 151 +++++++++++++++++ pages/activity/autumnten/index.json | 5 + pages/activity/autumnten/index.wxml | 38 +++++ pages/activity/autumnten/index.wxss | 202 +++++++++++++++++++++++ pages/activity/autumnten/list/index.js | 138 ++++++++++++++++ pages/activity/autumnten/list/index.json | 5 + pages/activity/autumnten/list/index.wxml | 12 ++ pages/activity/autumnten/list/index.wxss | 54 ++++++ pages/activity/huawei/list/index.js | 17 +- pages/activity/huawei/list/index.wxml | 6 +- pages/activity/springten/index.wxml | 2 +- pages/index/index.js | 9 +- pages/info/activityInfo/index.wxml | 11 +- pages/info/activityInfo/index.wxss | 51 ++++++ pages/info/strategyInfo/index.wxss | 2 + pages/pbService/group/index.wxml | 3 +- pages/pbService/index.wxml | 4 +- pages/pbService/web/index.js | 26 ++- project.config.json | 2 +- project.private.config.json | 6 +- utils/https.js | 18 ++ 23 files changed, 743 insertions(+), 22 deletions(-) create mode 100644 pages/activity/autumnten/index.js create mode 100644 pages/activity/autumnten/index.json create mode 100644 pages/activity/autumnten/index.wxml create mode 100644 pages/activity/autumnten/index.wxss create mode 100644 pages/activity/autumnten/list/index.js create mode 100644 pages/activity/autumnten/list/index.json create mode 100644 pages/activity/autumnten/list/index.wxml create mode 100644 pages/activity/autumnten/list/index.wxss diff --git a/app.js b/app.js index ddaf72e..84b12c6 100644 --- a/app.js +++ b/app.js @@ -9,6 +9,7 @@ App({ commonApi._post("browse/get_uuid",{}).then(res=>{ // console.log('uuid',res); this.globalData.uuid = res.data.uuid; + wx.setStorageSync('uuid', res.data.uuid) }) // 展示本地存储能力 var logs = wx.getStorageSync('logs') || [] diff --git a/app.json b/app.json index 9558f6c..39de64c 100644 --- a/app.json +++ b/app.json @@ -133,7 +133,9 @@ "pages/activity/suyear/index", "pages/activity/spring2021/index", "pages/activity/springten/list/index", + "pages/activity/autumnten/list/index", "pages/activity/springten/index", + "pages/activity/autumnten/index", "pages/activity/newarrival/index", "pages/activity/artfestival/index", "pages/activity/redlist/index", diff --git a/pages/activity/autumnten/index.js b/pages/activity/autumnten/index.js new file mode 100644 index 0000000..240069b --- /dev/null +++ b/pages/activity/autumnten/index.js @@ -0,0 +1,151 @@ +// pages/activity/springten/index.js +import commonApi from "../../../utils/https/common" +import util from "../../../utils/util" +let app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + types:['必赏','必吃','必游','必玩','必购','必住','赏夜戏','品夜饮','尝夜宴','逛夜市'], + type:0, + list:[], + total:1, + areas:[], + areaIndex:-1 + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + // 获取当前定位 + commonApi._post("act/get_suzhou_areas").then(res=>{ + res.data.unshift({ + area_id:"", + area_title:"苏州" + }) + this.setData({ + areas:res.data, + areaIndex:0 + }) + }) + this.getList() + }, + changeArea:function(e){ + this.setData({ + areaIndex:e.detail.value, + list:[], + total:1 + }) + this.getList(); + }, + changeType:function(e){ + this.setData({ + type:e.currentTarget.dataset.type, + list:[], + total:1 + }) + 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?161+Number(this.data.type):171, + area_id:this.data.areaIndex>-1?this.data.areas[this.data.areaIndex].area_id:null + }).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?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 + }) + }) + }, + 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/autumnten/index.json b/pages/activity/autumnten/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/autumnten/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/autumnten/index.wxml b/pages/activity/autumnten/index.wxml new file mode 100644 index 0000000..fd70eec --- /dev/null +++ b/pages/activity/autumnten/index.wxml @@ -0,0 +1,38 @@ + + + + + + {{areas[areaIndex].area_title}} + + + + + + + {{item}} + + + + + + + + + + + + + {{item.title}} + 上榜理由:{{item.brief_intro}} + 地址:{{item.address}} + + + 打开导航 + 查看详情 + 立即预订 + + + + +查看更多 \ No newline at end of file diff --git a/pages/activity/autumnten/index.wxss b/pages/activity/autumnten/index.wxss new file mode 100644 index 0000000..334d544 --- /dev/null +++ b/pages/activity/autumnten/index.wxss @@ -0,0 +1,202 @@ +/* pages/activity/springten/index.wxss */ +page { + background: #fffce8; +} +.top-img { + display: block; + width: 100%; + position: absolute; + left: 0; + z-index: 0; +} +.type-icons { + position: relative; + z-index: 1; + margin: 0 20rpx; + margin-top: 357rpx; + display: flex; + flex-wrap: wrap; + justify-content: space-between; +} +.type-icon { + width: 131rpx; + height: 109rpx; + display: flex; + align-items: center; + justify-content: center; + text-align: center; + font-size: 28rpx; + color: #fff; + font-weight: 500; + position: relative; + margin-top: 20rpx; +} +.type-icon-active { + color: #000; +} +.icon-text { + position: absolute; + left: 0; + top: 0; + right: 0; + /* bottom: 20rpx; */ + line-height: 88rpx; + z-index: 1; +} +.type-icon image { + width: 131rpx; + height: 109rpx; +} +.type-icon-active image { + width: 131rpx; + height: 109rpx; +} +.list { + /* background:url(https://m.cloud.sz-trip.com/static/images/activity/topten/hua0326.png) repeat-y; */ + background-size: 100%; +} +.item-box { + margin: 0 20rpx; + padding-top: 23rpx; + margin-top: 20rpx; + position: relative; + width: 710rpx; + height: 200rpx; +} +.item-bg { + position: absolute; + left: 0; + right: 0; + width: 710rpx; + height: 183rpx; + background: #F59224; + border-radius: 13rpx; + top: 20rpx; + transform: rotate(2deg); +} +.lefticon,.righticon { + position: absolute; + top: 0; + margin-top: -30rpx; + display: block; + width: 53rpx; +} +.lefticon { + margin-left: -10rpx; +} +.righticon { + width: 42rpx; + right: 0; + margin-right: -10rpx; + margin-top: -20rpx; +} +.item { + background: white; + position: relative; + z-index: 1; + height: 177rpx; + width: 700rpx; + margin: 0 5rpx; + border-radius: 13rpx; +} +.nomore { + margin-top: 50rpx; + line-height: 50rpx; + font-size: 23rpx; + text-align: center; +} +.item-in { + display: flex; + padding: 20rpx; + justify-content: space-between; +} +.item-in image { + width: 199rpx; + height: 133rpx; + display: block; + flex-shrink: 0; +} +.item-info { + flex: 1; + width: 351rpx; + margin-left: 30rpx; +} +.item-title { + font-size: 35rpx; + font-weight: bold; +} +.item-tags { + display: flex; + margin-top: 30rpx; + margin-bottom: 18rpx; + font-size: 24rpx; +} +.item-tags .tag { + line-height: 36rpx; + background: linear-gradient(0deg, #BE8CDF, #724796); + border-radius: 7rpx; + color: #fff; + padding: 0 13rpx; + margin-right: 12rpx; +} +.item-tags .tag:last-child { + margin-right: 0; +} +.item-address { + font-size: 23rpx; + color: #666666; + width: 280rpx; +} +.item-result { + font-size: 25rpx; + color: #E06400; + margin:10rpx 0 +} +.item-btn { + position: absolute; + right: 20rpx; + bottom: 12rpx; + width: 160rpx; + line-height: 50rpx; + background: linear-gradient(180deg, #ED9C4D, #F9750A); + text-align: center; + color: #fff; + font-size: 29rpx; + border-radius: 27rpx; +} +.item-result span { + font-size: 25rpx !important; +} +.picker { + position: fixed; + right: 30rpx; + margin-top: 30rpx; + z-index: 2; + display: flex; + align-items: center; + width: 105rpx; + height: 52rpx; + border-radius: 26rpx; + justify-content: center; + background: #FFFFFF; + font-size: 27rpx; + border: 1rpx solid #333; +} +.picker .iconfont { + font-size: 20rpx; + margin-bottom: 4rpx; + 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/autumnten/list/index.js b/pages/activity/autumnten/list/index.js new file mode 100644 index 0000000..adf70ba --- /dev/null +++ b/pages/activity/autumnten/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/autumnten/list/index.json b/pages/activity/autumnten/list/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/activity/autumnten/list/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/activity/autumnten/list/index.wxml b/pages/activity/autumnten/list/index.wxml new file mode 100644 index 0000000..e5e70fa --- /dev/null +++ b/pages/activity/autumnten/list/index.wxml @@ -0,0 +1,12 @@ + + + + + + + {{item.title}} + {{item.address}} + + + + diff --git a/pages/activity/autumnten/list/index.wxss b/pages/activity/autumnten/list/index.wxss new file mode 100644 index 0000000..8b81772 --- /dev/null +++ b/pages/activity/autumnten/list/index.wxss @@ -0,0 +1,54 @@ +/* pages/activity/springten/list/index.wxss */ +.item { + width: 626rpx; + display: flex; + background: white; + /* 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%; + position: relative; + z-index: 1; + border-radius: 13rpx; +} +.item-bg { + background: #F59224; + border-radius: 13rpx; + top: 20rpx; + transform: rotate(2deg); + position: absolute; + left: 25rpx; + right: 25rpx; + top: 0; + /* height: 130rpx; */ + bottom: 0; +} +.item-box { + position: relative; + height: 130rpx; + margin: 50rpx 0; + display: flex; + align-items: center; + justify-content: center; +} +.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/activity/huawei/list/index.js b/pages/activity/huawei/list/index.js index 75f924f..b97fc66 100644 --- a/pages/activity/huawei/list/index.js +++ b/pages/activity/huawei/list/index.js @@ -1,5 +1,6 @@ // pages/activity/huawei/list/index.js import commonApi from "../../../../utils/https/common" +let app = getApp() Page({ /** @@ -26,11 +27,12 @@ Page({ if(options.user_id){ let user_id = wx.getStorageSync('jstrip_userid'); if(user_id!=options.user_id){ - this.setData({ - user_id:options.user_id + app.globalData.weburl = 'https://m.cloud.sz-trip.com/photoWorksDetail?id='+options.id+'&type_id='+options.type_id + wx.redirectTo({ + url: '/pages/pbService/web/index' }) + return; } - } commonApi.user_post("actonline/act_online/isSign",{id:options.id}).then(res=>{ if(res.code==1){ @@ -192,9 +194,16 @@ Page({ if(this.data.list.length>0){ return { title:"帮我投一票吧~", - path:"/pages/activity/huawei/list/index?id="+this.data.id+"&user_id="+this.data.list[0].user.id, + path:'/pages/activity/huawei/list/index?id='+this.data.list[0].act_online_id+'&type_id='+this.data.list[0].act_online_type+'&user_id='+this.data.list[0].user.id+'&did='+this.data.list[0].id, imageUrl:this.data.list[0].img } } + else { + return { + title:"君到苏州摄影大赛作品", + path:"/pages/pbService/web/index?url="+encodeURIComponent('https://m.cloud.sz-trip.com/photoWorksList?id=6'), + imageUrl:"https://m.cloud.sz-trip.com/static/images/logobai.png" + } + } } }) \ No newline at end of file diff --git a/pages/activity/huawei/list/index.wxml b/pages/activity/huawei/list/index.wxml index e176f74..e0829b4 100644 --- a/pages/activity/huawei/list/index.wxml +++ b/pages/activity/huawei/list/index.wxml @@ -25,13 +25,13 @@ {{list[0].desc}} 规则 - + - 您还未上传作品,快去上传吧! - + 投票已开始,无法上传作品! + diff --git a/pages/activity/springten/index.wxml b/pages/activity/springten/index.wxml index 82fcc59..5eb19f4 100644 --- a/pages/activity/springten/index.wxml +++ b/pages/activity/springten/index.wxml @@ -14,7 +14,7 @@ - + diff --git a/pages/index/index.js b/pages/index/index.js index 2780952..17d0c1f 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -341,18 +341,23 @@ Page({ page = page[page.length-1].split("?") console.log(page[0]) let url = this.data.urltopage[page[0]]; - console.log(url) if(url && url.indexOf('map')!=-1){ let types = ['','scenic','venue','post','restaurant','relic','tenscenic','cinema','academes'],type = page[1]?page[1].split("="):[]; wx.reLaunch({ url: url+"?type="+(type[1]?types.findIndex(t=>t==type[1]):null) }) } - else { + else if(url){ wx.navigateTo({ url: url, }) } + else { + app.globalData.weburl = item.tdata; + wx.navigateTo({ + url:"/pages/pbService/web/index" + }) + } } break; case 4: diff --git a/pages/info/activityInfo/index.wxml b/pages/info/activityInfo/index.wxml index b65803a..3a5e3f8 100644 --- a/pages/info/activityInfo/index.wxml +++ b/pages/info/activityInfo/index.wxml @@ -9,7 +9,7 @@ --> - + {{info.name}} @@ -32,6 +32,15 @@ 活动详情 + + + + {{info.scene_data.title}} + {{info.scene_data.address}} + 查看详情 + + + \ No newline at end of file diff --git a/pages/pbService/web/index.js b/pages/pbService/web/index.js index 0d59da0..95355ee 100644 --- a/pages/pbService/web/index.js +++ b/pages/pbService/web/index.js @@ -1,5 +1,6 @@ // pages/pbService/web/index.js -const app = getApp() +let app = getApp() +import userApi from "../../../utils/https/user" Page({ /** @@ -13,9 +14,26 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { - this.setData({ - webUrl:app.globalData.weburl - }) + if(app.globalData.weburl.indexOf('m.cloud.sz-trip.com')!=-1){ + userApi.user_post("user/getMyInfo").then(res=>{ + let weburl = app.globalData.weburl + if(weburl.indexOf('?')!=-1){ + weburl += '&token='+res.data.token; + } + else { + weburl += '?token='+res.data.token + } + this.setData({ + info:res.data, + webUrl:weburl + }) + }) + } + else { + this.setData({ + webUrl:app.globalData.weburl + }) + } }, /** diff --git a/project.config.json b/project.config.json index 2786333..88a16c0 100644 --- a/project.config.json +++ b/project.config.json @@ -4,7 +4,7 @@ "ignore": [] }, "setting": { - "urlCheck": true, + "urlCheck": false, "es6": true, "enhance": false, "postcss": true, diff --git a/project.private.config.json b/project.private.config.json index 8e31d8e..e54964c 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -13,9 +13,9 @@ "miniprogram": { "list": [ { - "name": "pages/pbService/group/index", - "pathName": "pages/pbService/group/index", - "query": "id=6", + "name": "pages/pbService/web/index", + "pathName": "pages/pbService/web/index", + "query": "url=https%3A%2F%2Fm.cloud.sz-trip.com%2FphotoWorksDetail%3Fid%3D1157%26type_id%3D1", "scene": null }, { diff --git a/utils/https.js b/utils/https.js index 0beebeb..0b2ddb5 100644 --- a/utils/https.js +++ b/utils/https.js @@ -81,6 +81,15 @@ function _post(url,data={}) { // icon: "none", // }) // } + if(url.indexOf('product/get_product_detail')!=-1){ + // 如果是产品详情的话 需要加埋点 + console.log(res.data) + return; + _post('browse/ProductStatistics',{ + uuid:wx.getStorageSync('uuid'), + product_id:'1' + }) + } resolved(res.data); } else { @@ -180,6 +189,15 @@ function user_post(url,data={}){ }) } } + if(url.indexOf('product/get_product_detail')!=-1){ + // 如果是产品详情的话 需要加埋点 + _post('browse/ProductStatistics',{ + uuid:wx.getStorageSync('uuid'), + product_id:res.data.data.id, + product_name:res.data.data.title, + type:res.data.data.type + }) + } resolved(res.data); } else {