From 0079e1bd2c206d37fd7f567d13aae916ef2391a8 Mon Sep 17 00:00:00 2001 From: Myth Date: Thu, 15 Jul 2021 17:31:24 +0800 Subject: [PATCH] 1 --- app.js | 55 +++++++++++++- app.json | 4 +- pages/culture/index.wxml | 7 +- pages/culture/index.wxss | 5 ++ pages/culture/info/index.wxml | 6 +- pages/culture/infoindex.json | 3 - pages/culture/infoindex.wxml | 2 - pages/culture/infoindex.wxss | 1 - pages/info/cardInfo/index.js | 12 +++ pages/info/foodProductInfo/index.js | 9 +++ pages/info/museumInfo/index.js | 6 +- pages/info/postProductInfo/index.js | 6 +- pages/info/roadInfo/index.js | 12 ++- pages/info/sceneProductInfo/index.js | 24 +++++- pages/list/activitynew/index.js | 6 ++ .../daysu/detail/index.js} | 2 +- pages/list/daysu/detail/index.json | 5 ++ pages/list/daysu/detail/index.wxml | 2 + pages/list/daysu/detail/index.wxss | 1 + pages/list/daysu/index.js | 76 +++++++++++++++++++ pages/list/daysu/index.json | 5 ++ pages/list/daysu/index.wxml | 20 +++++ pages/list/daysu/index.wxss | 22 ++++++ pages/list/hotel/index.js | 11 ++- pages/list/movieticket/index.js | 6 ++ pages/list/scene/index.js | 11 ++- pages/list/six/index.wxml | 46 ++++++++++- pages/list/six/index.wxss | 49 +++++++++++- pages/list/store/index.wxml | 2 +- pages/list/techan/index.wxml | 2 +- pages/order/card/index.js | 3 + pages/order/food/index.js | 3 + pages/order/hotel/index.js | 3 + pages/order/movie/index.js | 3 + pages/order/postOrder/index.js | 3 + pages/order/road/index.js | 4 + pages/order/roadOrder/index.js | 3 + pages/order/scene/index.js | 3 + pages/order/showOrder/index.js | 3 + pages/pbService/bike/index.js | 16 ++-- pages/pbService/index.wxml | 4 + pages/pbService/sceneComfort/index.js | 9 ++- pages/pbService/sceneComfort/index.wxss | 1 + pages/pbService/wwcx/index.js | 9 ++- pages/user/bindtel/index.js | 3 + pages/user/retail/apply/index.js | 28 +++++++ pages/user/retail/goods/index.js | 2 +- pages/user/retail/goods/index.wxml | 6 +- pages/user/retail/goods/index.wxss | 5 -- pages/user/user.wxml | 4 +- project.private.config.json | 12 +-- utils/https.js | 4 +- 52 files changed, 490 insertions(+), 59 deletions(-) delete mode 100644 pages/culture/infoindex.json delete mode 100644 pages/culture/infoindex.wxml delete mode 100644 pages/culture/infoindex.wxss rename pages/{culture/infoindex.js => list/daysu/detail/index.js} (95%) create mode 100644 pages/list/daysu/detail/index.json create mode 100644 pages/list/daysu/detail/index.wxml create mode 100644 pages/list/daysu/detail/index.wxss create mode 100644 pages/list/daysu/index.js create mode 100644 pages/list/daysu/index.json create mode 100644 pages/list/daysu/index.wxml create mode 100644 pages/list/daysu/index.wxss diff --git a/app.js b/app.js index f459511..ddaf72e 100644 --- a/app.js +++ b/app.js @@ -1,7 +1,8 @@ //app.js import commonApi from "./utils/https/common" App({ - onLaunch: function () { + onLaunch: function (options) { + let rect = wx.getSystemInfoSync(); this.globalData.safeBottom = rect.safeArea?(rect.safeArea.bottom - rect.safeArea.height):0 // 获取uuid @@ -40,8 +41,60 @@ App({ } } }) + this.getShareCategoryId() }, + getShareCategoryId:function(){ + commonApi._post("share/getShareList",{}).then(res=>{ + let CategoryIds = {} + res.data.map(item=>{ + CategoryIds[item.mini] = item.id; + }) + this.globalData.CategoryIds = CategoryIds; + this.overShare(); + }) + }, + //重写分享方法 + overShare: function () { + //监听路由切换 + //间接实现全局设置分享内容 + let that = this; + wx.onAppRoute(function (res) { + //获取加载的页面 + let pages = getCurrentPages(), + //获取当前页面的对象 + view = pages[pages.length - 1]; + if(view && view.options && view.options.category_id){ + that.globalData.category_id = view.options.category_id; + commonApi._post("share/share",{ + id:view.options.category_id, + url:view.route + }).then(res=>{ + console.log(res) + }) + } + let category_id = that.globalData.CategoryIds[view.route] || null; + if(view.route.indexOf('bike/index')!=-1 && !category_id){ + category_id = that.globalData.CategoryIds[view.route+'?type='+view.options.type] + } + if (category_id) { + view.options = view.options?view.options:{}; + let str=[]; + for(let i in view.options){ + str.push(i+'='+view.options[i]) + } + str = str.join("&"); + view.onShareAppMessage = function () { + //你的分享配置 + return { + path: view.route+'?'+str+'&category_id='+category_id + }; + } + } + }) +}, globalData: { + CategoryIds:{},//分享出去的页面id + category_id:"",//分享进来的参数 from:"",// 是否是从其他小程序跳转过来的 如果是从其他小程序跳转的话 会记录 uuid:null,// 设备唯一uuid // 苏州市政府的经纬度 diff --git a/app.json b/app.json index 4fcfee2..d0534fd 100644 --- a/app.json +++ b/app.json @@ -91,6 +91,8 @@ "pages/list/message/index", "pages/list/minitrip/index", "pages/list/oneday/index", + "pages/list/daysu/index", + "pages/list/daysu/detail/index", "pages/pbService/index", "pages/pbService/museum/index", "pages/pbService/museum/info/index", @@ -138,7 +140,7 @@ "pages/group/mine/index", "pages/group/info/index", "pages/culture/index", - "pages/culture/infoindex" + "pages/culture/info/index" ], "permission": { "scope.userLocation": { diff --git a/pages/culture/index.wxml b/pages/culture/index.wxml index eac9351..ff28094 100644 --- a/pages/culture/index.wxml +++ b/pages/culture/index.wxml @@ -29,9 +29,10 @@ {{item.name}} - {{item.begin_date}}-{{item.end_date}} - - {{item.supplier_name}} + {{item.begin_date}}-{{item.end_date}} + ~ + + {{item.supplier_name}} diff --git a/pages/culture/index.wxss b/pages/culture/index.wxss index efba63e..dacceee 100644 --- a/pages/culture/index.wxss +++ b/pages/culture/index.wxss @@ -126,11 +126,14 @@ .item .textOver2 { font-size: 30rpx; color: #333; + line-height: 42rpx; + height: 84rpx; } .info-bottom { display: flex; justify-content: space-between; align-items: center; + width: 100%; } .info-bottom .info-btn { width: 140rpx; @@ -140,9 +143,11 @@ line-height: 40rpx; text-align: center; color: #fff; + flex-shrink: 0; } .right-info { flex: 1; + width: 400rpx; } .info-bottom .info-btn.borderbtn { background: white; diff --git a/pages/culture/info/index.wxml b/pages/culture/info/index.wxml index 5b4855b..42595d9 100644 --- a/pages/culture/info/index.wxml +++ b/pages/culture/info/index.wxml @@ -1,6 +1,6 @@ - + @@ -19,8 +19,8 @@ - + \ No newline at end of file diff --git a/pages/culture/infoindex.json b/pages/culture/infoindex.json deleted file mode 100644 index 8835af0..0000000 --- a/pages/culture/infoindex.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/pages/culture/infoindex.wxml b/pages/culture/infoindex.wxml deleted file mode 100644 index 183f63b..0000000 --- a/pages/culture/infoindex.wxml +++ /dev/null @@ -1,2 +0,0 @@ - -pages/culture/infoindex.wxml diff --git a/pages/culture/infoindex.wxss b/pages/culture/infoindex.wxss deleted file mode 100644 index 0b05612..0000000 --- a/pages/culture/infoindex.wxss +++ /dev/null @@ -1 +0,0 @@ -/* pages/culture/infoindex.wxss */ \ No newline at end of file diff --git a/pages/info/cardInfo/index.js b/pages/info/cardInfo/index.js index edf0fe7..ff2ab40 100644 --- a/pages/info/cardInfo/index.js +++ b/pages/info/cardInfo/index.js @@ -49,6 +49,18 @@ Page({ id:options.id }).then(res=>{ res.data.display_tags = (res.data.display_tags?res.data.display_tags.split(","):[]).splice(0,2); + + + // 如果带有指定skuid的话 那么取指定的sku展示 + if(options.skuid){ + for(let i = 0;i{ item.sku_model.recharge = item.sku_model.recharge?item.sku_model.recharge.split(","):[]; item.sku_model.recharge.map(item=>{ diff --git a/pages/info/foodProductInfo/index.js b/pages/info/foodProductInfo/index.js index ac39664..d1af35f 100644 --- a/pages/info/foodProductInfo/index.js +++ b/pages/info/foodProductInfo/index.js @@ -33,6 +33,15 @@ Page({ }).then(res=>{ let tags = res.data.display_tags?res.data.display_tags.split(","):[]; res.data.tags = tags.splice(0,2); + // 如果带有指定skuid的话 那么取指定的sku展示 + if(options.skuid){ + for(let i = 0;i{ item.display_tags = (item.display_tags?item.display_tags.split(','):[]).splice(0,2) }) diff --git a/pages/info/museumInfo/index.js b/pages/info/museumInfo/index.js index 60a4de1..cc79036 100644 --- a/pages/info/museumInfo/index.js +++ b/pages/info/museumInfo/index.js @@ -42,9 +42,13 @@ Page({ }).then(res=>{ // res.data.listimg = res.data.listimg?res.data.listimg.split(","):[]; if(res.data.product_venue && res.data.product_venue.sku && res.data.product_venue.sku[0]){ + let sku = res.data.product_venue.sku[0]; + if(options.skuid){ + sku = res.data.product_venue.sku.find(item=>item.id==options.skuid); + } let product = { product:res.data.product_venue, - sku:res.data.product_venue.sku[0] + sku:sku }; app.globalData.product = product; this.setData({ diff --git a/pages/info/postProductInfo/index.js b/pages/info/postProductInfo/index.js index 10d7791..9a6252c 100644 --- a/pages/info/postProductInfo/index.js +++ b/pages/info/postProductInfo/index.js @@ -41,7 +41,11 @@ Page({ commonApi._post("product/get_product_detail",{ id:options.id }).then(res=>{ - res.data.display_tags = (res.data.display_tags?res.data.display_tags.split(","):[]).splice(0,2) + res.data.display_tags = (res.data.display_tags?res.data.display_tags.split(","):[]).splice(0,2); + if(options.skuid){ + let sku = res.data.sku.find(item=>item.id==options.skuid); + res.data.sku = [sku]; + } this.setData({ info:res.data }) diff --git a/pages/info/roadInfo/index.js b/pages/info/roadInfo/index.js index 2b8e5cc..d926014 100644 --- a/pages/info/roadInfo/index.js +++ b/pages/info/roadInfo/index.js @@ -15,7 +15,8 @@ Page({ info:null, comment:[], commentTotal:0, - retailId:"" + retailId:"", + retailSkuId:"" }, /** @@ -41,6 +42,13 @@ Page({ id:options.id }).then(res=>{ res.data.display_tags = (res.data.display_tags?res.data.display_tags.split(","):[]).splice(0,2); + if(options.skuid){ + let sku = res.data.sku.find(item=>item.id==options.skuid); + res.data.sku = [sku]; + this.setData({ + retailSkuId:options.skuid + }) + } this.setData({ info:res.data }) @@ -149,7 +157,7 @@ Page({ } app.globalData.retailId = this.data.retailId; wx.navigateTo({ - url: '/pages/order/road/index?id='+this.data.info.id + url: '/pages/order/road/index?id='+this.data.info.id+(this.data.retailSkuId?('&skuid='+this.data.retailSkuId):'') }) }, diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js index 67c88c4..695620c 100644 --- a/pages/info/sceneProductInfo/index.js +++ b/pages/info/sceneProductInfo/index.js @@ -57,6 +57,29 @@ Page({ return; } res.data.display_tags = (res.data.display_tags?res.data.display_tags.split(","):[]).splice(0,2); + // 如果是带有指定good_id的 那么取指定的 + if(options.gid){ + let pItem = res.data.product.find(item=>item.id==options.gid); + if(pItem){ + res.data.product = [pItem]; + } + } + // 如果带有指定skuid的话 那么取指定的sku展示 + if(options.skuid){ + let pItem = null; + for(let i = 0;i{ product.sku.map(sku=>{ @@ -217,6 +240,5 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function () { - } }) \ No newline at end of file diff --git a/pages/list/activitynew/index.js b/pages/list/activitynew/index.js index 1f42361..f3ae26e 100644 --- a/pages/list/activitynew/index.js +++ b/pages/list/activitynew/index.js @@ -47,6 +47,12 @@ Page({ area_code:"", area_name:"苏州市" }) + if(options.area_code){ + let index = res.data.findIndex(item=>item.area_code==options.area_code); + this.setData({ + area:index + }) + } this.setData({ areas:res.data }) diff --git a/pages/culture/infoindex.js b/pages/list/daysu/detail/index.js similarity index 95% rename from pages/culture/infoindex.js rename to pages/list/daysu/detail/index.js index c5573f2..e3428d0 100644 --- a/pages/culture/infoindex.js +++ b/pages/list/daysu/detail/index.js @@ -1,4 +1,4 @@ -// pages/culture/infoindex.js +// pages/list/daysu/detail/index.js Page({ /** diff --git a/pages/list/daysu/detail/index.json b/pages/list/daysu/detail/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/list/daysu/detail/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/list/daysu/detail/index.wxml b/pages/list/daysu/detail/index.wxml new file mode 100644 index 0000000..0d72969 --- /dev/null +++ b/pages/list/daysu/detail/index.wxml @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/pages/list/daysu/detail/index.wxss b/pages/list/daysu/detail/index.wxss new file mode 100644 index 0000000..b74578e --- /dev/null +++ b/pages/list/daysu/detail/index.wxss @@ -0,0 +1 @@ +/* pages/list/daysu/detail/index.wxss */ \ No newline at end of file diff --git a/pages/list/daysu/index.js b/pages/list/daysu/index.js new file mode 100644 index 0000000..068c414 --- /dev/null +++ b/pages/list/daysu/index.js @@ -0,0 +1,76 @@ +// pages/list/daysu/index.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + showVideo:false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + }, + play:function(){ + this.setData({ + showVideo:true + }) + }, + videoend:function(){ + this.setData({ + showVideo:false + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + 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/daysu/index.json b/pages/list/daysu/index.json new file mode 100644 index 0000000..35cf02f --- /dev/null +++ b/pages/list/daysu/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader" + } +} \ No newline at end of file diff --git a/pages/list/daysu/index.wxml b/pages/list/daysu/index.wxml new file mode 100644 index 0000000..17fd6b1 --- /dev/null +++ b/pages/list/daysu/index.wxml @@ -0,0 +1,20 @@ + + + + + + + + + + + diff --git a/pages/list/daysu/index.wxss b/pages/list/daysu/index.wxss new file mode 100644 index 0000000..5f30a76 --- /dev/null +++ b/pages/list/daysu/index.wxss @@ -0,0 +1,22 @@ +/* pages/list/daysu/index.wxss */ +.intro-box { + position: absolute; + right: 0; + top: 42rpx; + width: 139rpx; + height: 67rpx; +} +.video-box { + position: absolute; + width: 697rpx; + height: 392rpx; + left: 27rpx; + top: 1297rpx; +} +.more-btn { + top: 1790rpx; + position: absolute; + right: 26rpx; + left: 507rpx; + height: 30rpx; +} \ No newline at end of file diff --git a/pages/list/hotel/index.js b/pages/list/hotel/index.js index 1ba78f1..7a1da73 100644 --- a/pages/list/hotel/index.js +++ b/pages/list/hotel/index.js @@ -10,13 +10,19 @@ Page({ type:5, total:1, list:[], - keywords:"" + keywords:"", + area_id:null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { + if(options.area_id){ + this.setData({ + area_id:options.area_id + }) + } this.getList() }, search:function(e){ @@ -39,7 +45,8 @@ Page({ limit:10, sort:"weight", tag_id:this.data.type, - title:this.data.keywords + title:this.data.keywords, + area_id:this.data.area_id }).then(res=>{ res.data.list.map(item=>{ console.log(item.third_supplier_type) diff --git a/pages/list/movieticket/index.js b/pages/list/movieticket/index.js index 5fb3a3f..df8c5d5 100644 --- a/pages/list/movieticket/index.js +++ b/pages/list/movieticket/index.js @@ -26,6 +26,12 @@ Page({ area_id:"", area_title:"苏州" }) + if(options.area_id){ + let index = res.data.findIndex(item=>item.area_id==options.area_id); + this.setData({ + areaIndex:index==-1?0:index + }) + } this.setData({ areas:res.data }) diff --git a/pages/list/scene/index.js b/pages/list/scene/index.js index 452e4ea..2318c38 100644 --- a/pages/list/scene/index.js +++ b/pages/list/scene/index.js @@ -12,7 +12,8 @@ Page({ total:1, latitude:"", longitude:"", - keywords:'' + keywords:'', + area_id:'' }, /** @@ -20,6 +21,11 @@ Page({ */ onLoad: function (options) { let that = this; + if(options.area_id){ + this.setData({ + area_id:options.area_id + }) + } wx.getLocation({ type: 'gcj02', success: function (res) { @@ -57,7 +63,8 @@ Page({ lat:this.data.latitude, offset:list.length, sort:"weight", - title:this.data.keywords + title:this.data.keywords, + area_id:this.data.area_id }).then(res=>{ res.data.list.map(item=>{ item.tags = item.tags?item.tags.split(","):[]; diff --git a/pages/list/six/index.wxml b/pages/list/six/index.wxml index a4cd9b9..f287261 100644 --- a/pages/list/six/index.wxml +++ b/pages/list/six/index.wxml @@ -9,19 +9,59 @@ - + + +文旅服务 + + + + 活动日历 + + + + 景点门票 + + + + 酒店住宿 + + + + 电影购票 + + +公共服务 + + + + 景区舒适度 + + + + 停车场 + + + + 公共自行车 + + + + 文物查询 + +周边推荐 {{item.title}} {{item.address}} - {{item.price/100}} + {{item.price/100}} + 免费 diff --git a/pages/list/six/index.wxss b/pages/list/six/index.wxss index 48f6536..4bcfd63 100644 --- a/pages/list/six/index.wxss +++ b/pages/list/six/index.wxss @@ -14,7 +14,10 @@ display: flex; align-items: center; justify-content: space-between; - margin: 30rpx 48rpx; + position: absolute; + left: 50rpx; + margin-top: -80rpx; + color: #fff; } .types-box .picker { display: flex; @@ -23,6 +26,7 @@ height: 54rpx; border: 1rpx solid #ccc; border-radius: 4rpx; + border-radius: 27rpx; } .types-box .picker .iconfont { width: 60rpx; @@ -80,4 +84,47 @@ color: #D62828; font-size: 33rpx; font-weight: 500; +} +.new-title { + margin: 0 25rpx; + margin-top: 50rpx; + font-size: 33rpx; + font-weight: bold; + margin-bottom: 40rpx; +} +.new-icons { + display: flex; + justify-content: space-between; + text-align: center; + margin: 0 25rpx; + font-size: 27rpx; +} +.new-icons image { + display: block; + width: 100rpx; + height: 100rpx; + border-radius: 50%; + background: white; + box-shadow: 3rpx 6rpx 18rpx 5rpx rgba(227, 127, 61, 0.24); + margin: 0 auto; + margin-bottom: 20rpx; +} +.new-icon { + width: 131rpx; + margin-bottom: 20rpx; +} +.new-icon image.green-shadow { + box-shadow: 3rpx 6rpx 18rpx 5rpx rgba(41, 176, 100, 0.24); +} +.new-icon image.purple-shadow { + box-shadow: 3rpx 6rpx 18rpx 5rpx rgba(128, 76, 220, 0.24); +} +.new-icon image.blue-shadow { + box-shadow: 3rpx 6rpx 18rpx 5rpx rgba(57, 92, 219, 0.24); +} +.new-icon image.red-shadow { + box-shadow: 3rpx 6rpx 18rpx 5rpx rgba(234, 92, 92, 0.24); +} +.new-icon image.yellow-shadow { + box-shadow: 3rpx 6rpx 18rpx 5rpx rgba(194, 123, 20, 0.24); } \ No newline at end of file diff --git a/pages/list/store/index.wxml b/pages/list/store/index.wxml index 544dfa4..cd3d20f 100644 --- a/pages/list/store/index.wxml +++ b/pages/list/store/index.wxml @@ -1,7 +1,7 @@ - + 实名认证 diff --git a/project.private.config.json b/project.private.config.json index 98429e3..0cad5de 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -13,9 +13,9 @@ "miniprogram": { "list": [ { - "name": "pages/user/user", - "pathName": "pages/user/user", - "query": "user_id=25&id=68&originate_id=109", + "name": "pages/list/six/index", + "pathName": "pages/list/six/index", + "query": "id=5442&retailId=17020017459&skuid=1209&gid=3841", "scene": null }, { @@ -25,8 +25,8 @@ "scene": null }, { - "name": "pages/group/index", - "pathName": "pages/group/index", + "name": "pages/list/daysu/index", + "pathName": "pages/list/daysu/index", "query": "id=0000000000LINELINEINFO18082257199008", "scene": null }, @@ -51,7 +51,7 @@ { "name": "PRPark", "pathName": "pages/pbService/PRpark/index", - "query": "type=2", + "query": "category_id=27", "scene": null }, { diff --git a/utils/https.js b/utils/https.js index ebfd83b..bec3577 100644 --- a/utils/https.js +++ b/utils/https.js @@ -1,8 +1,8 @@ var app = getApp(); import util from "../utils/util" import userApi from "../utils/https/user.js"; -const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; -// const baseUrl = "https://api.cloud.sz-trip.com/api/"; +// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; +const baseUrl = "https://api.cloud.sz-trip.com/api/"; const orders = ['','weight','distance','sale_number','sale_price','price']; //封装GET请求 function _get(url,data) {