- - - + + + + + {{item.menu_name}} + + + + + - @@ -85,28 +84,36 @@ - + + + + + - - - - + + + - + - + {{item.title}} + + {{tag}} + {{item.price/100}} @@ -118,7 +125,7 @@ - + @@ -134,7 +141,7 @@ - @@ -149,10 +156,30 @@ --> + + + + + + {{list[0].subtitle}} + + + + + + {{list[1].subtitle}} + + + + {{list[2].subtitle}} + + + + - @@ -169,14 +196,14 @@ - + 更多 > - + @@ -185,10 +212,10 @@ - + - + @@ -206,7 +233,7 @@ - + @@ -227,17 +254,31 @@ - - + + - - + + + + + + + + + {{item.menu_name}} + + + - + @@ -249,10 +290,10 @@ - + - + @@ -286,7 +327,7 @@ - + @@ -315,13 +356,16 @@ + + + - + - - + @@ -347,7 +391,7 @@ - @@ -361,7 +405,7 @@ - diff --git a/pages/index/index.wxss b/pages/index/index.wxss index 8f9ea1c..0e33f6c 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -2,18 +2,28 @@ /* 元旦修改 */ .bg{ - height: 100vh; + min-height: 100vh; overflow-x: hidden; overflow-y: auto; background-size: 100% 100%; background-repeat: no-repeat; + padding-bottom: 220rpx; /* background-color:#E8F9FA; */ + } -.swiper,.swiper image { - width: 100%; - display: block; - height: 908rpx; +.swiper{ + display: block; + width: 697rpx; + height: 340rpx; + margin: 0 auto; } +.swiper image { + display: block; + width: 100%; + height: 100%; + border-radius: 20rpx; +} + .top-box { display: flex; @@ -45,7 +55,7 @@ font-size: 25rpx; padding: 2rpx 5rpx; box-sizing: border-box; - background: rgba(255, 255, 255, 0.6); + background: #FFEEAD; } .search-box .iconfont { font-size: 30rpx; @@ -55,21 +65,17 @@ } .banner-main{ - position: absolute; - z-index: 3; + width: 100%; - left: 0; - bottom: 0rpx; - right: 0; display: flex; justify-content: space-between; - padding: 0rpx 20rpx 30rpx; + padding: 26rpx 20rpx 30rpx; box-sizing: border-box; /* background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.2)) */ } .banner-main image{ - width: 173.33rpx; - height: 173.33rpx; + width: 156rpx; + height: 156rpx; } .swiper .wx-swiper-dots.wx-swiper-dots-horizontal { @@ -88,19 +94,22 @@ /* padding-top: 63rpx; */ } + .top-icons { display: flex; - padding:0 20rpx; - align-items: center; + flex-wrap: wrap; + border-radius: 20rpx; + background: #FFEEAD; + padding-top: 13rpx; } .top-icon-item { - margin-bottom: 20rpx; + margin-bottom: 37rpx; line-height: 37rpx; font-size: 25rpx; color: #000; text-align: center; flex-shrink: 0; - width: 20%; + width: 25%; display: flex; align-items: center; justify-content: center; @@ -110,8 +119,8 @@ margin-right: 0; } .top-icon-item image { - width: 93.33rpx; - height: 93.33rpx; + width: 66.33rpx; + height: 66.33rpx; display: block; transition: all 0.2s; /* margin: 0 auto; */ @@ -131,7 +140,7 @@ margin: 0 25rpx; } .common-header-img{ - height: 106.67rpx; + width: 220.67rpx; } .small-swiper { @@ -156,7 +165,7 @@ .sale-road-boxes { display: flex; justify-content: space-between; - margin-top: 40rpx; + margin-top: 48rpx; position: relative; align-items: flex-end; } @@ -185,6 +194,7 @@ flex-direction: column; justify-content: space-between; } + .season-hot{ display: flex; } @@ -218,6 +228,23 @@ height: 100%; border-radius: 0; } + .season-hot .tags{ + width: 100%; + display: flex; + flex-wrap: nowrap; + overflow-x: hidden; + } + .season-hot .tag{ + height: 27rpx; + border: 1px solid #FF8623; + line-height: 27rpx; + padding: 0 10rpx; + font-weight: 500; + font-size: 20rpx; + color: #FF8623; + margin-right: 8rpx; + flex-shrink: 0; + } .xsth-more { margin-top: 19.33rpx; @@ -398,9 +425,8 @@ flex-wrap: wrap; } .new-pic { - width: 340rpx; - height: 146.67rpx; - margin-bottom: 20rpx; + width: 157.33rpx; + height: 226.67rpx; } .title-more { @@ -472,13 +498,13 @@ justify-content: space-between; } .hot-list-item { - width: 337rpx; + width: 340rpx; } .hot-item { background: white; /* box-shadow: -1rpx 1rpx 16rpx 0px rgba(6, 0, 1, 0.1); */ border-radius: 15rpx; - margin-bottom: 15rpx; + margin-bottom: 20rpx; height: 498rpx; } .hot-item image:nth-child(1) { @@ -761,14 +787,14 @@ .ggfw-list { display: grid; - grid-template-columns: repeat(4, 166rpx); + grid-template-columns: repeat(4, 157.33rpx); row-gap: 23rpx; justify-content: space-between; } .ggfw-list .ggfw { - width: 166rpx; - height: 133rpx; + width: 157.33rpx; + height: 130.67rpx; /* margin-bottom: 23rpx; */ } .ggfw image{ @@ -777,26 +803,95 @@ } .six-box-new { - width: 697rpx; + width: 100%; /* background: linear-gradient(-90deg, #FF9B6A, #D02E25); */ border-radius: 20rpx; - display: flex; - justify-content: space-between; - align-items: center; - overflow: scroll; - margin: 32rpx 0 53.33rpx; + margin: -40rpx 0 53.33rpx; z-index: 1; position: relative; } -.six-box-new image { - width: 333.33rpx; - height: 200rpx !important; - /* background: #FFE7C0; */ - border-radius: 20rpx; - flex-shrink: 0; - margin-right: 13.33rpx; +.six-box-new .big-image-box { + width: 100%; + height: 346rpx; + position: relative; + +} +.six-box-new .big-image-box image{ + width: 100%; + height: 100%; + border-radius: 20rpx 20rpx 0 0; +} +.six-box-new .big-image-box .text-container{ + width: 100%; + height: 100%; + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + font-weight: 500; + font-size: 24rpx; + color: #FFFFFF; + display: flex; + flex-direction: column; + justify-content: flex-end; + padding: 16rpx; + box-sizing: border-box; +} +.six-box-new .small-image-box{ + width: 100%; + padding: 10rpx 16rpx; + overflow-x: auto; + background: white; + display: flex; + flex-wrap: nowrap; + border-radius: 0 0 20rpx 20rpx; + box-sizing: border-box; + height: 120rpx; } +.six-box-new .small-image-box .small-image-item{ + width: 120rpx; + height: 100rpx; + background: #FF8623; + border-radius: 13rpx; + flex-shrink: 0; + margin-right: 27rpx; + position: relative; + box-sizing: border-box; + overflow: hidden; +} +.six-box-new .small-image-box .small-image-item.active{ + border: 2px solid #000; +} +.six-box-new .small-image-box .small-image-item:last-of-type{ + margin-right: 0rpx; +} +.six-box-new .small-image-box image{ + width: 100%; + height: 100%; + border-radius: 13rpx; +} +.six-box-new .small-image-box .small-image-item .text-box{ + width: 100%; + height: 40rpx; + position: absolute; + bottom: 0; + left: 0; + right: 0; + background: #FFC543; + font-weight: 500; + font-size: 23rpx; + color: #000000; + text-align: center; + line-height: 40rpx; + border-radius: 0 0 13rpx 13rpx; +} +.six-box-new .small-image-box .small-image-item.active .text-box{ + background: #FF8623; + color: #FFFFFF; +} + /* 春节金刚区字体颜色样式更换 */ .top-icon-text { color: #111111; @@ -944,4 +1039,67 @@ margin-top: 20rpx; margin-left: -6rpx; margin-right: 0rpx; + } + + .ai-fix{ + position: fixed; + width: 150.33rpx; + height: 200rpx; + bottom: 30rpx; + right: 24rpx; + z-index: 100; + } + .hot-prod-new{ + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + } + .hot-prod-left{ + width: 400rpx; + height: 350rpx; + position: relative; + } + .hot-prod-left .prod-img{ + width: 100%; + height: 100%; + border-radius: 20rpx; + } + .hot-prod-left .xpth-item-title{ + position: absolute; + width: 100%; + font-weight: 500; + font-size: 28rpx; + color: #FFFFFF; + bottom: 0; + left: 0; + right: 0; + top: 0; + height: 100%; + width: 100%; + background: linear-gradient(to bottom, rgba(0,0,0,0),rgba(0,0,0,0.5)) ; + display: flex; + border-radius: 20rpx; + padding: 0 8rpx 6rpx; + box-sizing: border-box; + overflow: hidden; + align-items: flex-end; + } + + .hot-prod-right{ + display: flex; + flex-direction: column; + justify-content: space-between; + height: 350rpx; + align-items: flex-end; + flex: 1; + width: 100rpx; + padding-left: 14rpx; + } + + .hot-prod-right .hot-right-item{ + + height: 167rpx; + width: 100%; + } \ No newline at end of file diff --git a/pages/info/foodProductInfo/index.js b/pages/info/foodProductInfo/index.js index d1af35f..105a45f 100644 --- a/pages/info/foodProductInfo/index.js +++ b/pages/info/foodProductInfo/index.js @@ -1,158 +1,907 @@ -// pages/info/sceneProductInfo/index.js +// pages/info/roadInfo/index.js +let device = wx.getSystemInfoSync(); +const ratio = device.windowWidth / 750; import commonApi from "../../../utils/https/common" +import QRCode from '../../../utils/weapp-qrcode.js' +import util from '../../../utils/util' let app = getApp() Page({ - /** - * 页面的初始数据 - */ - data: { - info:{}, - number:['一','二','三','四','五','六','七','八','九','十','十一','十二'], - skuIndex:0, - bookingInfo:null, - skuName:"", - retailId:'' - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - let api = commonApi._post - if(wx.getStorageSync("jstrip_token")){ - api = commonApi.user_post - } - if(options.retailId){ - this.setData({ - retailId:options.retailId - }) - } - api("product/get_product_detail",{ - id:options.id - }).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) - }) - // res.data.listimg = res.data.listimg?res.data.listimg.split(","):[]; - this.setData({ - info:res.data - }) - this.BroswerRecord() - console.log(res) - }) - }, - BroswerRecord:function(){ - setTimeout(()=>{ - if(app.globalData.uuid){ - commonApi._post('browse/browse_record',{ - type:"goods", - title:this.data.info.title, - drive:"mini", - source_id:this.data.info.id, - url:"/pages/info/foodProductInfo/index?id="+this.data.info.id, - uuid:app.globalData.uuid - }).then(res=>{ - }) - } - else { - this.BroswerRecord(); - } - },500) - }, - changeSku:function(e){ - this.setData({ - skuIndex:e.currentTarget.dataset.index - }) - }, - showNotice:function(e){ - let sku = e.currentTarget.dataset.sku; - this.setData({ - skuName:sku.sku_name, - bookingInfo:sku.sku_model - }) - }, - closeMask:function(){ - this.setData({ - skuName:"", - bookingInfo:null - }) - }, - gotoLocation:function(){ - let info = this.data.info; - if(info && info.lat && info.lon){ - wx.openLocation({ - latitude: Number(info.lat), - longitude: Number(info.lon) - }) - } - }, - order:function(e){ - app.globalData.couponInfo = null; - app.globalData.retailId = this.data.retailId; - app.globalData.product = e.currentTarget.dataset; - wx.navigateTo({ - url: '/pages/order/food/index', - }) - }, - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { + if (options.retailId) { + this.setData({ + retailId: options.retailId + }) + } + commonApi._post("product/get_product_detail", { + id: options.id + }).then(res => { + if (res.code == 0) { + wx.showToast({ + title: res.msg, + icon:'none' + }) + setTimeout(() => { + wx.navigateBack() + }, 1500); + return + } + 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]; + } + res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0 - }, + let resData = res.data + try { + if (resData.product_data && resData.is_package==1) { + for(let key in resData.product_data) { + resData.product_data[key] = JSON.parse(resData.product_data[key]) + } + // if (resData.product_data["住"]) { + // resData.product_data["住"] = JSON.parse(resData.product_data["住"]) + // } + // if (resData.product_data["游"]) { + // resData.product_data["游"] = JSON.parse(resData.product_data["游"]) + // } + // if (resData.product_data["食"]) { + // resData.product_data["食"] = JSON.parse(resData.product_data["食"]) + // } + } - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { + resData.shipment_tag_arr = [] + if (resData.shipment_tag) { + resData.shipment_tag_arr = resData.shipment_tag.split(',') + resData.shipment_tag_str = resData.shipment_tag_arr.join(' | ') + } + if (resData.service_tag) { + resData.service_tag_str = resData.service_tag.split(',').join(' | ') + } + if (resData.parameter_tag) { + resData.parameter_tag_str = resData.parameter_tag.split(',').join(' | ') + } - }, + if (resData.supplier_headimg) { + resData.supplier_headimg = that.showImg(resData.supplier_headimg) + } - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { + } catch(e) {} - }, + let swiperRange = this.data.swiperRange; + swiperRange.video = resData.videourl? { min: 0, max: 0 } : { min: -1, max: -1 } + swiperRange.picture = {min:swiperRange.video.max+1, max:swiperRange.video.max+1+resData.listimg.length-1} + swiperRange.sku = {min:swiperRange.picture.max+1,max:swiperRange.picture.max+1+resData.sku.length-1} + console.log(swiperRange) + this.setData({ + info: resData, + supplierId: res.data.scene_id, + iShop: res.data.scene_id ? true : false, + swiperRange: swiperRange, + }) - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { + // 获取补贴 + // commonApi.user_post("product/getProductAllowancePrice", { + // product_code: res.data.product_code + // }).then(resTwo => { + // if (resTwo && resTwo.code == 1) { + // this.setData({ + // allowance_data: resTwo.data + // }) + // } + // }) + this.BroswerRecord() + }) + // 获取评价列表 + commonApi._post("product/product_comment_list", { + product_id: options.id, + offset: 0, + limit: 3 + }).then(res => { + res.data.list.map(item => { + item.rate = Number(item.rate) + item.create_time = item.create_time.substring(0, 10) - }, + }) + this.setData({ + comment: res.data.list.splice(0, 5), + commentTotal: res.data.total + }) + let arr = this.data.comment + arr.map((item) => { + if (item.img_list) { + item.img_list = item.img_list.split(',') + } else { + item.img_list = [] + } + }) + this.setData({ + comment: arr + }) + }) - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { + commonApi._post("search/product_recommend", { + offset: 0, + limit: 4, + rand: true, + type: 'post', + product_ids:options.id, + }).then(res => { + try { + this.setData({ + tjList: res.data.list.slice(0,4) + }) + } catch (error) { + console.log(error); + } + }) + }, - }, + showImg (img) { + if (!img) { return img } + if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) { + return img; + } else { + // return "https://test.api.cloud.sz-trip.com"+img + return "https://static.ticket.sz-trip.com" + img; + } + }, - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { + gotolocation: function () { + let info = this.data.info; + wx.openLocation({ + latitude: Number(info.scene_lat), + longitude: Number(info.scene_lon), + name:info.scene_name, + address:info.scene_address + }) + }, - }, + callPhone :function () { + wx.makePhoneCall({ + phoneNumber: this.data.info.scene_tel, + }) + }, - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { + changeAllowance: function () { + this.setData({ + showAllowance: !this.data.showAllowance + }) + }, + BroswerRecord: function () { + setTimeout(() => { + if (app.globalData.uuid) { + commonApi._post('browse/browse_record', { + type: "goods", + title: this.data.info.title, + drive: "mini", + source_id: this.data.info.id, + url: "/pages/info/postProductInfo/index?id=" + this.data.info.id, + uuid: app.globalData.uuid + }).then(res => {}) + } else { + this.BroswerRecord(); + } + }, 500) + }, + like: function () { + let id = this.data.id, + isLike = this.data.isLike; + commonApi.user_post("product/" + (isLike == 1 ? "product_cancel_collection" : "product_collection"), { + product_id: id + }).then(res => { + if (res.code == 1) { + this.setData({ + isLike: isLike == 1 ? 0 : 1 + }) + } + }) + }, + changeMenu: function (e) { + let index = e.currentTarget.dataset.index, + that = this; + const query = wx.createSelectorQuery(); //创建节点查询器 + query.select("#box" + index).boundingClientRect() //选择toViewid获取位置信息 + query.selectViewport().scrollOffset() //获取页面查询位置的 + query.exec(function (res) { + let scrollTop = res[0].top + res[1].scrollTop - 110 * ratio - that.data.top; + wx.pageScrollTo({ + scrollTop: scrollTop + 4, + duration: 0 + }) + that.setData({ + type: index + }) + }) + }, + // onPageScroll: function (e) { + // let that = this, + // height = this.data.top; + // let topHeight = height; + // wx.createSelectorQuery().select('#menus').boundingClientRect(function (rect) { + // if (rect.top <= topHeight) { + // // 此时应该把menus固定在顶部 + // that.setData({ + // fixed: true + // }) + // } else { + // that.setData({ + // fixed: false + // }) + // } + // // 滚动时判断滚动到哪个部分了 + // const query = wx.createSelectorQuery(); //创建节点查询器 + // query.select("#box1").boundingClientRect() //选择toViewid获取位置信息 + // query.select("#box2").boundingClientRect() //选择toViewid获取位置信息 + // query.select("#box3").boundingClientRect() //选择toViewid获取位置信息 + // query.select("#box4").boundingClientRect() //选择toViewid获取位置信息 + // let minHeight = that.data.fixed ? (110 * ratio + height) : topHeight; + // query.exec(function (res) { + // if (res[3].top < minHeight) { + // that.setData({ + // type: 4 + // }) + // } else if (res[2].top < minHeight) { + // that.setData({ + // type: 3 + // }) + // }else if (res[1].top < minHeight) { + // that.setData({ + // type: 2 + // }) + // } else { + // that.setData({ + // type: 1 + // }) + // } + // }) + // }).exec() - } + // }, + showCart: function () { + commonApi.user_post('wx/get_user_keep', { + jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id, + title: this.data.info.title, + type: 'mini' + }).then(res => { + if (res.data.subscribe == 0) { + this.setData({ + wxqrcode: res.data.qrcode, + showQrCode: true + }) + } else { + if (this.data.info.sku.length == 0) { + wx.showToast({ + title: '该产品未设置规格,不能加购', + icon: 'none' + }) + return; + } + this.setData({ + skuFlag: "cart" + }) + let that = this + wx.createSelectorQuery().select('#skuImg').boundingClientRect(function (res) { + console.log(res) + that.setData({ + cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;' + }) + }).exec() + } + }) + }, + hideSku: function () { + this.setData({ + skuFlag: null, + cartImgInfo: null + }) + }, + minus: function () { + if (this.data.producNum == 1) return; + this.setData({ + producNum: this.data.producNum - 1 + }) + }, + add: function () { + this.setData({ + producNum: this.data.producNum + 1 + }) + }, + selectSku: function (e) { + let index = e.currentTarget.dataset.index; + this.setData({ + skuIndex: index, + swiperCurrent: index+this.data.swiperRange.picture.max+1 + }) + }, + showOrder: function () { + commonApi.user_post('wx/get_user_keep', { + jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id, + title: this.data.info.title, + type: 'mini' + }).then(res => { + if (res.data.subscribe == 0) { + this.setData({ + wxqrcode: res.data.qrcode, + showQrCode: true + }) + } else { + if (this.data.info.sku.length == 0) { + wx.showToast({ + title: '该产品未设置规格,不能购买', + icon: 'none' + }) + return; + } + let swiperCurrent = this.data.swiperCurrent; + let skuIndex = swiperCurrent - this.data.swiperRange.sku.min + console.log(swiperCurrent, skuIndex) + if (skuIndex<0) {skuIndex=0} + this.setData({ + skuFlag: 'order', + skuIndex: skuIndex, + swiperCurrent: skuIndex+this.data.swiperRange.picture.max+1 + }) + } + }) + }, + order: function (e) { + let buy_type = e.currentTarget.dataset.type + app.globalData.postProduct = [] + app.globalData.list = [] + commonApi.user_post("/product/checkStock", { + sku_id: this.data.info.sku[this.data.skuIndex].id, + }).then(res => { + if (res && res.code != 1) { + return; + } else { + if (buy_type == 'order') { + // util.pagePoint({ + // event: 'product_order', + // param: { + // id: this.data.info.id, + // type: this.data.info.type + // } + // }, 1) + // wx.setStorageSync('login_from', 'product_order_login') + // wx.setStorageSync('order_from', 'product_order_submit') + app.globalData.couponInfo = null; + // 购买 + let product = [{ + product: {...this.data.info,ZTPoint:this.data.ZTPoint}, + sku: this.data.info.sku[this.data.skuIndex], + productNum: this.data.producNum + }]; + app.globalData.retailId = this.data.retailId; + app.globalData.listName = null + app.globalData.product = product[0]; + wx.navigateTo({ + url: '/pages/order/food/index', + }) + } else { + let tag_id = this.data.info.tag_id,type = '' + if (tag_id.includes(20) || tag_id.includes(19)) { //文创 + type = '1' + }else if (tag_id.includes(5)) { //非遗 + type = '2' + }else { + type = '' + } + commonApi.user_post("cart/add_sku", { + sku_id: this.data.info.sku[this.data.skuIndex].id, + num: this.data.producNum, + type:type + }).then(res => { + if (res.code == 1) { + commonApi.user_post('cart/get_list', {}).then(res => { + this.setData({ + cartCount: res.data.length + }) + }) + // 加动效 + this.setData({ + skuFlag: null, + aniSkuIndex: this.data.skuIndex, + cartImgInfo: null + }) + setTimeout(() => { + this.setData({ + aniSkuIndex: -1 + }) + wx.showModal({ + title: "提示", + content: "去购物车结算?", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: '/pages/user/cartlist/list', + }) + } + } + }) + }, 650) + } + }) + } + } + }) + + }, + // 分享 + share: function () { + if (!wx.getStorageSync("jstrip_token")) { + util.pagePoint({ + event: 'product_share_login', + type: this.data.info.type, + id: this.data.info.id + }, 1) + commonApi.user_post("user/getMyInfo", {}).then(res => { + + }) + return; + } + if (!this.data.shareImg) { + wx.showToast({ + title: '图片生成中,稍后再试', + icon: 'none' + }) + return; + } + this.setData({ + showShareFlag: !this.data.showShareFlag + }) + }, + // 保存 + save() { + let url = this.data.shareImg, + that = this; + wx.authorize({ + /* 这个就是保存相册的 */ + scope: 'scope.writePhotosAlbum', + success() { + wx.saveImageToPhotosAlbum({ + filePath: url, + success(res) { + wx.showToast({ + title: '保存成功', + icon: "success" + }) + that.setData({ + showShareFlag: !this.data.showShareFlag + }) + util.pagePoint({ + event: 'product_share_save', + type: that.data.info.type, + id: that.data.info.id + }, 1) + }, + fail(res) { + wx.showToast({ + title: '保存失败', + icon: 'none' + }) + } + }) + }, + complete(res) { + console.log(res); + /* 这里判断一下如果没有授权重新打开设置选项 */ + wx.getSetting({ + success(res) { + if (!res.authSetting['scope.writePhotosAlbum']) { + /* 打开设置的方法 */ + // opensit(); + wx.showToast({ + title: '请打开权限后再试', + icon: 'none' + }) + } + } + }); + } + }); + + }, + pagePoint: function (e) { + util.pagePoint(e) + }, + // 绘制海报 + drawImg: function () { + var that = this, + userinfo = wx.getStorageSync('jstrip_userInfo'); + if (!userinfo) { + // 去登录 + return false; + } + const ctx = wx.createCanvasContext('imageCanvas'); + // const device = wx.getSystemInfoSync(); + // const ratio = device.screenWidth / 750; + + // 先获取到图片信息 + let promise2 = new Promise(function (resolve, reject) { + wx.getImageInfo({ + src: that.data.info.headimg, + success: function (res) { + resolve(res); + }, + fail: function (res) { + reject(res); + } + }) + }) + let promise3 = new Promise(function (resolve, reject) { + let userid = wx.getStorageSync('jstrip_userid') + new QRCode('myQrcode', { + text: 'https://m.cloud.sz-trip.com/MailMerchandiseDetail?id=' + that.data.info.id + '&sharedUserId=' + userid + '&channel=-1', + width: 500, + height: 500, + padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0 + correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度 + callback: (res) => { + resolve(res); + } + }) + }) + //成功得到图片信息后,开始绘图 + Promise.all([promise2, promise3]).then(imgs => { + ctx.save(); + ctx.beginPath(); //开始绘制 + that.handleBorderRect(ctx, 0, 0, 551 * ratio, 407 * ratio, 25 * ratio, '#ccc') + ctx.clip(); //画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因 + ctx.drawImage(imgs[0].path, 0, 0, 551 * ratio, 407 * ratio); + ctx.restore(); + ctx.save(); + that.handleBorderRect2(ctx, 0, 407 * ratio, 551 * ratio, 236 * ratio, 25 * ratio, '#fff') + ctx.restore(); + // 绘制二维码 + ctx.drawImage(imgs[1].path, 373 * ratio, 495 * ratio, 137 * ratio, 137 * ratio); + // 开始文字绘制 + ctx.setFillStyle("#000"); + ctx.setFontSize(30 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + that.drawText(ctx, that.data.info.title, 25 * ratio, 450 * ratio, 480 * ratio, ratio); + // 售价 + ctx.setFillStyle("#D62828"); + ctx.setFontSize(40 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + let price = "¥" + (that.data.info.price / 100); + let width = ctx.measureText(price).width; + ctx.fillText(price, 25 * ratio, 620 * ratio); + // 副标题 + ctx.setFillStyle("#999999"); + ctx.setFontSize(28 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + let subtitle = that.data.info.subtitle; + if (that.data.info.subtitle.length > 10) { + subtitle = that.data.info.subtitle.substr(0, 10) + '...' + } + ctx.fillText(subtitle, 25 * ratio, 540 * ratio); + // ctx.draw(); + // 划线价 + ctx.setFillStyle("#999999"); + ctx.setFontSize(32 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + let market_price = "¥" + (that.data.info.market_price / 100) + ctx.fillText(market_price, 40 * ratio + width, 620 * ratio); + let market_price_width = ctx.measureText(market_price).width; + // 划线 + ctx.beginPath() + ctx.setLineWidth(1) + ctx.moveTo(40 * ratio + width, 608 * ratio) + ctx.lineTo(45 * ratio + width + market_price_width, 608 * ratio) + ctx.stroke(); + // 长按识别二维码 + // ctx.setFillStyle("#666"); + // ctx.setFontSize(22 * ratio); //字大小 + // ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + // ctx.fillText("长按识别二维码", 404*ratio, 710*ratio); + // 长按图片转发或保存 + // ctx.setFillStyle("#000"); + // ctx.setFontSize(24 * ratio); //字大小 + // ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + // ctx.fillText("长按图片保存到本地",(592*ratio - ctx.measureText("长按图片保存到本地").width)/2, 740*ratio); + ctx.draw(); + // 转为图片 + setTimeout(() => { + wx.canvasToTempFilePath({ + x: 0, + y: 0, + canvasId: 'imageCanvas', + success: function (res) { + that.setData({ + shareImg: res.tempFilePath + }) + }, + fail(err) { + console.log('agdgjgdajhg', err) + } + }) + }, 500) + return false; + }).catch(err => { + console.log("this err", err) + }) + }, + // 圆角矩形 + handleBorderRect(ctx, x, y, w, h, r, color) { + ctx.beginPath(); + ctx.moveTo(x + w, y + h); + ctx.lineTo(x, y + h) + // 左上角 + ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI); + ctx.moveTo(x + r, y); + ctx.lineTo(x + w - r, y); + ctx.lineTo(x + w, y + r); + // 右上角 + ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI); + ctx.lineTo(x + w, y + h); + ctx.lineTo(x + w - r, y + h); + ctx.fillStyle = color; + ctx.fill(); + ctx.closePath(); + }, + handleBorderRect2(ctx, x, y, w, h, r, color) { + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(x + w, y) + // 右下角 + ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI); + ctx.lineTo(x + r, y + h); + ctx.lineTo(x, y + h - r); + // 左下角 + ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI); + ctx.lineTo(x, y); + ctx.lineTo(x, y); + ctx.fillStyle = color; + ctx.fill(); + ctx.closePath(); + }, + // 绘制两行文字 + drawText: function (ctx, str, x, y, canvasWidth, ratio) { + let row = [], + temp = "", + chr = str.split(""); + for (var a = 0; a < chr.length; a++) { + if (ctx.measureText(temp).width < canvasWidth) { + temp += chr[a]; + } else { + a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比 + row.push(temp); + temp = ""; + } + } + row.push(temp); + + //如果数组长度大于2 则截取前两个 + if (row.length > 2) { + var rowCut = row.slice(0, 2); + var rowPart = rowCut[1]; + var test = ""; + var empty = []; + for (var a = 0; a < rowPart.length; a++) { + if (ctx.measureText(test).width < canvasWidth - 30 * ratio) { + test += rowPart[a]; + } else { + break; + } + } + empty.push(test); + var group = empty[0] + "..." //这里只显示两行,超出的用...表示 + rowCut.splice(1, 1, group); + row = rowCut; + } + for (var b = 0; b < row.length; b++) { + ctx.fillText(row[b], x, y + b * 40 * ratio, canvasWidth); + } + }, + gotoDetail: function (e) { + let item = e.currentTarget.dataset.item; + util.pagePoint({ + event: 'recommend_click', + param: { + id: item.id, + type: item.type + } + }, 1) + if (item.type == 'travels') { + // 游记做特殊处理 其他都按照原来的来 + wx.navigateTo({ + url: '/pages/info/strategyInfo/index?id=' + item.s_id, + }) + } else { + util.gotoDetail(item); + } + }, + + gotolocation: function () { + let info = this.data.info; + wx.openLocation({ + latitude: Number(info.scene_lat), + longitude: Number(info.scene_lon), + name:info.scene_name, + address:info.scene_address + }) + }, + + viewImg:function(e){ + let item = e.currentTarget.dataset.item; + if (item.img_list.length>0) { + wx.previewImage({ + urls: item.img_list + }) + } + }, + + swiperChange (e) { + if(e.detail.source == "touch") { + let index = e.detail.current + this.setData({ + swiperCurrent: index + }) + } + console.log(e, this.data.swiperCurrent) + }, + changeSwiperCurrent (e) { + let index = e.currentTarget.dataset.index + this.setData({ + swiperCurrent: index + }) + }, + changeSimpleVal (e) { + let keyname = e.currentTarget.dataset.keyname; + let val = e.currentTarget.dataset.val; + let param = {} + param[keyname] = val + this.setData(param) + console.log(this.data) + }, + + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + app.globalData.postProduct = [] + if (!wx.getStorageSync('jstrip_token')) { + return; + } + if (this.data.info && this.data.info.id) { + commonApi.user_post("product/is_product_collection", { + product_id: this.data.info.id + }).then(res => { + this.setData({ + isLike: res.data + }) + this.drawImg() + }) + // commonApi.user_post('cart/get_list', {}).then(res => { + // this.setData({ + // cartCount: res.data.length + // }) + // }) + commonApi.user_post('cart/get_count', {noLogin: true}).then(res => { + this.setData({ + cartCount: res.data //1 + }) + }) + } else { + setTimeout(() => { + this.onShow() + }, 200) + } + }, + playVideo() { + // 播放视频需要把autoplay暂停 + this.setData({ + autoPlay: false + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } }) \ No newline at end of file diff --git a/pages/info/foodProductInfo/index.json b/pages/info/foodProductInfo/index.json index b5d8d8b..ab4ec76 100644 --- a/pages/info/foodProductInfo/index.json +++ b/pages/info/foodProductInfo/index.json @@ -1,6 +1,7 @@ { "usingComponents": { "title":"/pages/component/TitleHeader", - "notice":"/pages/component/notice/notice" + "code":"../../order/components/wxqrCode/index" + } } \ No newline at end of file diff --git a/pages/info/foodProductInfo/index.wxml b/pages/info/foodProductInfo/index.wxml index 16afd14..3491c6f 100644 --- a/pages/info/foodProductInfo/index.wxml +++ b/pages/info/foodProductInfo/index.wxml @@ -1,79 +1,285 @@ - + - - - - - - - - - - {{info.title}} - - {{item}} - {{info.price/100}} - + + + + + + + + + + + + + + + + + + + + + + + + + {{swiperCurrent+1}}/{{swiperRange.sku.max+1}} + + + + + 补贴价 + ¥{{ allowance_data.mini_price / 100 }}起 + 单品最高补贴{{ allowance_data.max_price / 100 }}元 + + + + + + {{info.price/100}}优惠前¥{{info.market_price/100}} + 已售{{info.sales_number>1000?"1000+":(info.sales_number||0)}} + + + + + {{info.title}} + + {{info.subtitle}} + + + + + + {{info.shipment_tag_str}} + + + + + {{info.service_tag_str}} + + + + + {{info.parameter_tag_str}} + + + + + + + + + + + + + + + + + + + + + + {{info.scene_name}} + + + + + {{info.scene_address}} + + + + + + + + + + + + 套餐详情 + + + + + + 购买须知 + + + + + + + + + + + + + 店铺 + + + + 客服 + + + - - - {{info.title}} + + + + 加入购物车 + 立即购买 + 该商品已下架 - - {{item.sku_name}} - - - - {{item}} + + + + + {{cartCount}} + + + + + + + + + + {{info.sku[skuIndex].price/100}} + + + 已选择:{{info.sku[skuIndex].sku_name}} + + + + + {{producNum}} + + + 限购{{info.sku[skuIndex].sku_model.traveller_limit_num}}件 - 预订须知>> - - {{item.price/100}} - 立即预订 - 立即预订 + + 产品分类({{info.sku.length}}) + + + + {{item.sku_name}} + + + + + + + {{skuFlag=='cart'?'确认':'立即购买'}} + 该商品已下架 - - - - 商家信息 - - - 商家电话:{{info.supplier_tel}} - - - - 商家地址:{{info.supplier_address}} - - - - 购买须知 - - - 套餐{{number[index]}} - - - - - - - - - - - 产品详情 + + + + + + + + - - + + + + + {{allowance_data.title}} + - \ No newline at end of file + + + + + + + + + + {{otherInfoShow==3?"产品参数":otherInfoShow==2?"服务说明":"发货说明"}} + + + + + + + + + + + + + 确定 + + + \ No newline at end of file diff --git a/pages/info/foodProductInfo/index.wxss b/pages/info/foodProductInfo/index.wxss index 4c609ce..90c2938 100644 --- a/pages/info/foodProductInfo/index.wxss +++ b/pages/info/foodProductInfo/index.wxss @@ -1,69 +1,96 @@ -/* pages/info/sceneProductInfo/index.wxss */ +/* pages/info/hotelProductInfo/index.wxss */ page { - background: #f2f2f2; + background: #F7F7F7; } + .swiper { width: 100%; - height: 400rpx; + height: 466.67rpx; } -.swiper image { - height: 400rpx; +.swiper image,.swiper video { + height: 466.67rpx; display: block; width: 100%; } +.swiper-bottom{ + position: absolute; + /* top: 750rpx; */ + bottom: 77rpx; + right: 0; + width: 90rpx; + height: fit-content; + display: flex; + flex-direction: column; + align-items: center; + font-weight: 500; + font-size: 24rpx; + color: rgba(255,255,255,0.5); + z-index: 1; +} +.swuper-bottom-bg{ + background: rgba(1, 0, 0, 0.6); + border-radius: 20rpx 0rpx 0rpx 20rpx; + display: flex; + flex-direction: column; + width: 100%; + padding: 8rpx 0; + margin-bottom: 12rpx; +} +.swiper-bottom-item{ + width: 100%; + text-align: center; + padding: 14rpx 0; +} +.swiper-bottom-item.active{ + color: #fff; +} +.swiper-bottom-item.bottom-number{ + max-width: 100%; + width: fit-content; + background: rgba(1, 0, 0, 0.6); + border-radius: 13rpx; + height: 40rpx; + line-height: 40rpx; + padding: 0 10rpx; + overflow: hidden; + box-sizing: border-box; +} + .top-info { - border-radius: 20rpx 20rpx 0 0; background: white; position: relative; z-index: 1; - margin-top: -20rpx; - padding: 20rpx 40rpx; } + .top-info .title { - font-size: 32rpx; - font-weight: 500; - color: #000; + font-weight: bold; + font-size: 33rpx; + color: #000000; } + .tags-box { - margin-top: 10rpx; display: flex; align-items: center; + font-weight: 500; + font-size: 25rpx; color: #0B898E; - font-size: 27rpx; - height: 50rpx; } + .tags-box .tag { - position: relative; - line-height: 20rpx; - font-size: 20rpx; - font-weight: 500; - line-height: 50rpx; - margin-right: 10rpx; -} -.tags-box .tag .line { - content: "1"; - display: block; - font-size: 0; - position: absolute; - left: 0; - right: 0; - background: #DAF3E9; - height: 8rpx; - top: 30rpx; - z-index: -1; -} -.tags-text { - flex: 1; - text-align: right; -} -.tags-box .iconfont { - margin-left: 4rpx; - font-size: 24rpx; + margin-top: 27rpx; + height: 40rpx; + line-height: 40rpx; + margin-right: 15rpx; + padding: 0 14rpx; + background: rgba(11, 137, 142, 0.1); + border-radius: 4rpx; } + .address-box { justify-content: space-between; margin-top: 0; } + .info-address { color: #666; font-size: 27rpx; @@ -71,57 +98,114 @@ page { height: 30rpx; line-height: 30rpx; } + .address-box .iconfont { font-size: 34rpx; } -.box { - margin: 20rpx; - padding: 0 20rpx; - background: white; - border-radius: 13rpx; -} -.box-top { - line-height: 120rpx; - border-top: 1rpx solid #d9d9d9; - font-weight: 500; - color: #000; - font-size: 35rpx; -} -.info-address { + +.date-all-box { + margin: 24rpx 20rpx; display: flex; justify-content: space-between; align-items: center; - margin-bottom: 30rpx; - color: #999; - font-size: 29rpx; -} -.info-address .iconfont { - color: #0B898E; + height: 80rpx; + border-radius: 13rpx; + background: #0B898E; font-size: 31rpx; + color: #fff; + font-weight: 500; + padding: 0 37rpx; } -.product-item { - margin: 0 20rpx; - padding: 27rpx 0; - border-bottom: 1rpx solid #ccc; + +.days { + text-align: center; + font-size: 400; + width: 84rpx; + line-height: 34rpx; + height: 34rpx; + border-radius: 18rpx; + border: 1px solid white; + font-size: 23rpx; } -.skutitle { - font-size: 29rpx; - color: #333; - font-weight: 500; + +.picker text { + font-weight: 400; + font-size: 21rpx; + margin-left: 13rpx; } -.product-box { + +.product-item { display: flex; align-items: flex-end; justify-content: space-between; - margin-top: 20rpx; + margin: 20rpx; + padding: 24rpx 20rpx; + background: white; + border-radius: 13rpx; } -.product-left { + +.product-item image { + width: 201rpx; + height: 201rpx; + border-radius: 10rpx; + margin-right: 26rpx; + flex-shrink: 0; +} + +.product-item .product-info { flex: 1; } + +.product-item .product-info .title { + font-size: 32rpx; + color: #000; + font-weight: 500; +} + +.product-right { + flex-shrink: 0; + margin-left: 20rpx; +} + +.product-right .price { + color: #D62828; + font-size: 40rpx; + font-weight: 500; +} + +.product-right .price::before { + content: "¥"; + font-size: 27rpx; + font-weight: 400; +} + +.product-right .btn { + color: #fff; + width: 120rpx; + line-height: 80rpx; + background: #D62828; + border-radius: 13rpx; + font-size: 31rpx; + font-weight: 500; + text-align: center; + margin-top: 20rpx; +} + +.product-info .subtitle { + font-size: 24rpx; + line-height: 36rpx; + height: 72rpx; + margin-top: 10rpx; + margin-bottom: 20rpx; + color: #999; + white-space: normal; +} + .product-tags { display: flex; align-items: center; } + .product-tag { font-size: 20rpx; color: #0B898E; @@ -131,57 +215,57 @@ page { padding: 0 15rpx; margin-right: 13rpx; } + .product-tags .product-tags:last-child { margin-right: 0; } -.order-tip-text { - margin-top: 33rpx; - font-size: 24rpx; - color: #666; + +.box { + /* margin: 20rpx; */ + /* background: white; */ + /* border-radius: 13rpx; */ + background: #f2f2f2; + padding: 20rpx; } -.product-right { - text-align: center; - flex-shrink: 0; +.comment-box{ + background: #fff; + margin: 20rpx 0; + width: 100%; + box-sizing: border-box; } -.product-right .price { - color: #D62828; - font-size: 24rpx; - margin-bottom: 20rpx; +.comment-box .no-comment{ + font-weight: 500; + font-size: 30rpx; + color: #999999; + padding-left: 18rpx; } -.product-right .price text:nth-child(2){ + +.box-top { + line-height: 95rpx; + border-bottom: 1rpx solid #d9d9d9; font-weight: 500; + color: #000; font-size: 33rpx; + padding: 0 20rpx; + background: #fff; + border-radius: 13rpx 13rpx 0 0; } -.product-right .price text:nth-child(3){ - color: #8D8D8D; - font-size: 20rpx; -} -.product-right .btn { - background: #D62828; - color: #fff; - border-radius: 30px; - line-height: 60rpx; - font-size: 29rpx; - font-weight: 500; - width: 176rpx; -} -.product-right .btn.disable { - background: #ccc; -} -.box .product-item:last-child { - border-bottom: none; -} + .box-top .iconfont { color: #0B898E; font-size: 33rpx; margin-right: 16rpx; } + .empty-box { text-align: center; padding: 40rpx 0; font-size: 23rpx; color: #333; + background: #fff; + border-radius: 0 0 13rpx 13rpx; } + .empty-btn { margin: 0 auto; margin-top: 30rpx; @@ -193,69 +277,385 @@ page { font-size: 32rpx; margin-bottom: 10rpx; } + .box-top .score { color: #D62828; font-size: 30rpx; font-weight: 400; margin-left: 11rpx; } + .product-comment { - margin: 0 20rpx; + /* margin: 0 20rpx; */ border-bottom: 1rpx solid #ccc; - padding: 33rpx 0; + /* padding: 33rpx 0; */ + padding: 28rpx 0rpx; + background: #fff; + width: 100%; + box-sizing: border-box; +} +.product-comment:last-of-type{ + border-bottom: none; } + .product-comment-top { display: flex; justify-content: space-between; color: #999999; - align-items: center; + align-items: flex-start; font-size: 24rpx; } -.product-comment-top image { + +.product-comment-top .avator-img { flex-shrink: 0; width: 57rpx; height: 57rpx; border-radius: 50%; } +.product-comment-top .comment-container{ + flex: 1; + width: 10rpx; + padding: 0 45rpx 0 15rpx; +} .product-comment-top .comment-info { - flex: 1; - margin: 0 15rpx; - color: #666; - font-size: 21rpx; + width: 100%; + height: 57rpx; + font-weight: bold; + font-size: 24rpx; + color: #666666; + display: flex; + align-items: center; } + .product-comment-top .comment-info .iconfont { color: #D62828; font-size: 22rpx; } -.product-comment-top .comment-info .iconfont text { + +.product-comment-top .comment-info .iconfont text { margin-right: 6rpx; } + .comment-content { - margin-left: 72rpx; - margin-top: 36rpx; - font-size: 28rpx; - color: #000; + width: 100%; + padding-top: 12rpx; + font-size: 27rpx; + color: #000; + font-weight: 500; } + .more-comment-btn { line-height: 93rpx; - margin-right: 20rpx; + /* margin-right: 20rpx; */ text-align: right; color: #999; font-size: 27rpx; font-weight: 500; + padding-right: 20rpx; + background: #fff; + border-radius: 0 0 13rpx 13rpx; } + .more-comment-btn .iconfont { margin-left: 6rpx; font-size: 24rpx; } + .all-comment-num { float: right; color: #999999; font-size: 27rpx; font-weight: 400; } -.icon-xin,.icon-shoucang { + +.scroll-all-box { + margin: 24rpx 0; + background: white; +} + +.scroll-menus { + padding: 0 40rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 29rpx; + color: #333; + height: 84rpx; + border-bottom: 1rpx solid #d9d9d9; +} + +.scroll-menu-item { + position: relative; + line-height: 84rpx; +} + +.scroll-menu-item.active::after { + content: "1"; + font-size: 0; + display: block; + position: absolute; + width: 46rpx; + height: 6rpx; + border-radius: 3rpx; + background: #0B898E; + left: 50%; + margin-left: -23rpx; + bottom: 0rpx; +} + +.fixed-menus { + position: fixed; + left: 0; + right: 0; + background: white; + z-index: 1; +} + +.info-title { + font-size: 35rpx; + font-weight: bold; + color: #000; + margin-bottom: 30rpx; +} + +.info-box { + padding: 20rpx 40rpx; +} + +.fixed-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + height: 140rpx; + background: white; + display: flex; + align-items: center; + box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); + padding: 0 40rpx; + color: #666666; + font-size: 23rpx; + justify-content: space-between; + text-align: center; + padding-left: 0; +} + +.fixed-bottom .iconfont { + font-size: 34rpx; + line-height: 40rpx; +} + +.btns { + color: #fff; + font-size: 32rpx; + font-weight: 500; + border-radius: 39rpx; + text-align: center; + display: flex; + align-items: center; + justify-content: center; +} + +.btns .btn { + width: 216rpx; + line-height: 78rpx; + background: #D62828; +} + +.btns .btn:nth-child(1) { + /* margin-right: 3rpx; */ + border-radius: 39rpx 0 0 39rpx; + background: #FD7601; +} + +.btns .btn:nth-child(2) { + border-radius: 0 39rpx 39rpx 0; +} + +.btns .btn.disable { + background: #ccc; +} + +.mask-content { + position: absolute; + left: 0; + right: 0; + bottom: 0; + width: 100%; +} + +.mask-content .icon-close { + position: absolute; + right: 40rpx; + top: 40rpx; +} + +.sku-info-box { + margin: 50rpx 25rpx; + display: flex; + justify-content: space-between; +} + +.sku-info-box image { + width: 173rpx; + height: 173rpx; + border-radius: 13rpx; + display: block; + margin-right: 15rpx; + flex-shrink: 0; +} + +.sku-info { + flex: 1; + width: 100rpx; + height: 173rpx; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.sku-price { + font-size: 40rpx; + font-weight: bold; + color: #F84A56; +} + +.sku-price::before { + content: "¥"; + font-size: 24rpx; + vertical-align: baseline; +} + +.sku-price view { + font-size: 24rpx; + color: #FFFFFF; + background-color: #D62828; + border-radius: 22rpx; + line-height: 44rpx; + margin-left: 7rpx; + padding: 0 20rpx; +} + +.sku-name { + font-size: 27rpx; + color: #666666; +} + +.sku-names { + display: flex; + font-weight: 500; + font-size: 27rpx; + color: #333333; + margin: 0 25rpx; + flex-wrap: wrap; + margin-bottom: 20rpx; + justify-content: space-between; + max-height: 800rpx; + min-height: 400rpx; + align-content: flex-start; +} + +.sku-name-item { + min-height: 67rpx; + border-radius: 13rpx; + margin-bottom: 34rpx; + max-width: 100%; + padding-right:15rpx; + min-width: 340rpx; + background: #EFEFEF; + display: flex; + align-items: center; + box-sizing: border-box; +} +.sku-name-item>image{ + width: 67rpx; + height: 100%; + border-radius: 13rpx; + flex-shrink: 0; +} +.sku-name-item .sku-name{ + flex:1; + /* width: 100rpx; */ + padding-left: 15rpx; + color: #333; +} + +.sku-name-item.active{ + color: #0B898E; + border: 1px solid #0B898E; + background: rgba(11, 137, 142, 0.1); +} +.sku-name-item.active .sku-name{ + color: #0B898E; + } + +.number-box { + display: flex; + align-items: center; + justify-content: space-between; + background: #EFEFEF; +border-radius: 13rpx; +padding: 10rpx 0; +box-sizing: border-box; +height: 53rpx; +width: 250rpx; + +} + +.number-box text { + flex: 1; + font-size: 29rpx; + color: #333; +} + +.number-box view { + text-align: center; + width: 80rpx; + height: 33rpx; + line-height: 33rpx; + font-size: 31rpx; + color: #000; +} + +.number-box view.number { + width: 94rpx; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +.limit-number{ + font-weight: 500;font-size: 27rpx;color: #666666;padding-left:20rpx; +} + +.btn-box { + height: 138rpx; + background: #FFFFFF; + box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); + display: flex; + align-items: center; + justify-content: center; position: fixed; + left: 0; + right: 0; + bottom: 0; +} + +.mask-btn { + width: 670rpx; + line-height: 78rpx; + background: #D62828; + border-radius: 39rpx; + color: #fff; + text-align: center; + font-size: 33rpx; + font-weight: 500; +} + +.mask-btn.disable { + background: #ccc; +} + +/* .icon-xin,.icon-shoucang { + position: absolute; right: 20rpx; margin-top: 20rpx; width: 60rpx; @@ -265,48 +665,660 @@ page { text-align: center; color: #fff; font-size: 36rpx; - z-index: 3; + z-index: 1; +} */ +.share-icon { + position: absolute; + right: 20rpx; + margin-top: 20rpx; + width: 60rpx; + height: 60rpx; + z-index: 1; + background-image: url("https://static.ticket.sz-trip.com/uploads/20250826/81287df192b80ea03318e06b2b19ebe1.png"); + background-size: 100% 100%; } + .icon-shoucang { color: #D62828; + font-size: 40rpx !important; + } -.tags-price { - flex: 1; - text-align: right; - color: #D62828; + +/* 购物车 */ +.cart-box { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 80rpx; + height: 80rpx; + background: #FFFFFF; + box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.2); + border-radius: 50%; + right: 20rpx; + bottom: 166rpx; + z-index: 15; } -.tags-price text:nth-child(1){ - font-size: 27rpx; + +.cart-box image { + display: block; + width: 49rpx; } -.tags-price text:nth-child(2){ - font-size: 40rpx; - font-weight: bold; + +.cart-num { + width: 26rpx; + border: 1rpx solid; + border-radius: 50%; + line-height: 26rpx; + text-align: center; + font-size: 23rpx; + color: #D20000; + position: absolute; + right: -2rpx; + top: -5rpx; } -.tags-price text:nth-child(3){ + +.headimg { + position: fixed; + z-index: 3; + left: -218rpx; + width: 218rpx; + height: 180rpx; + top: 0; +} + +.headimg.active { + transition: left .6s linear, top .6s cubic-bezier(0.5, -0.5, 1, 1), width .6s ease, height .6s ease; + width: 80rpx; + height: 80rpx; + left: 650rpx; + border-radius: 50%; +} + +.share-img-box { + /* width: 551rpx; */ + position: static; + background: none; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.share-img { + display: block; + width: 551rpx; +} + +.share-tips { + width: 426rpx; + height: 150rpx; + background: #FFFFFF; + border-radius: 25rpx; + margin-top: 25rpx; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 65rpx; + color: #999; + font-size: 24rpx; + text-align: center; + line-height: 40rpx; +} + +.share-tips .img { + display: block; + width: 55rpx; + margin: 0 auto; + margin-bottom: 4rpx; +} + +.tipimg { + position: absolute; + left: 50%; + margin-left: 16rpx; + width: 24rpx; + height: 24rpx; + background: #D62828; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + top: 34rpx; +} + +.tipimg image { + width: 21rpx; + display: block; + +} + +.save-btn { + width: 403rpx; + line-height: 77rpx; + background: #D62828; + border-radius: 39rpx; + text-align: center; + color: #fff; + font-size: 31rpx; + font-weight: 500; + margin-top: 50rpx; +} + +.allowance-box { + height: 113rpx; + background: url("https://static.ticket.sz-trip.com/uploads/20220602/7762b9c4be5adac1f3d0ab5228569821.png"); + background-size: 100% auto; + background-repeat: no-repeat; + padding: 30rpx 30rpx 10rpx; + font-size: 24rpx; + color: #FFFFFF; + margin-top: -60rpx; + position: relative; + display: flex; + justify-content: start; + align-items: baseline; +} + +.allowance-box .com-price { + font-size: 30rpx; + color: #FFFFFF; +} + +.allowance-box .com-price:before { + font-size: 18rpx; + color: #FFFFFF; +} + +.allowance-box .com-price:after { + font-size: 18rpx; + color: #FFFFFF; +} + +.allowance-box .yellow { + color: #DF2115; + padding: 8rpx 14rpx; + background-color: #FDEDD4; + margin-left: 20rpx; + border-radius: 30rpx; +} + +.mask-allowance .mask-content { + margin: auto; + width: auto; + top: initial; + bottom: initial; + padding: 20rpx; + width: 80%; +} + +.mask-allowance .mask-content .rule-title { + text-align: center; + margin-bottom: 20rpx; +} +.imgs{ + width: 133rpx; + height: 133rpx; + border-radius: 13rpx; +} +.img-box{ + width: 133rpx; +height: 133rpx; + position: relative; + overflow: hidden; +} +.img-box .more-img{ + height: 37rpx; + line-height: 37rpx; + background: #000; + border-radius: 13rpx 0rpx 13rpx 0rpx; + box-sizing: border-box; + padding: 0 5rpx; + font-weight: 500; + font-size: 23rpx; + color: #FFFFFF; + position: absolute; + bottom: 0; + right: 0; + opacity: 0.8; +} +.all{ + color: #fff; + position:absolute; + bottom: 17rpx; + right: 10rpx; + width: 200rpx; + height: 200rpx; + border-radius: 8rpx; + background-color: rgba(0, 0, 0, .5); +} +.all view{ + text-align: center; +} +.all view:first-child{ + font-size: 45rpx; + margin-top: 40rpx; +} +.all view:last-child{ + margin-top: 10rpx; +} +.sku{ + margin-left: 10rpx; + color: #666; + font-size: 24rpx; + margin-top: 8rpx; +} +.proad{ + margin: 20rpx; +} +.proad-title{ + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 16rpx; +} +.proad-title image{ + width: 292rpx; + height: 34rpx; +} +.pro-list{ + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; +} +.proitem{ + width: 334rpx; + height: 497rpx; + background: #FFFFFF; + border-radius: 10rpx; + margin-top: 20rpx; +} +.item-hd image{ + width: 334rpx; + height: 342rpx; + border-radius: 13rpx 13rpx; +} +.item-bm{ + padding: 8rpx 12rpx; +} +.protitle{ + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 400; + color: #000000; +} +.pro-price{ + color: #D62828; + font-weight: 500; + font-size: 30rpx; +} +.pro-price:before { + display: inline-block; + content:"¥"; + color: #D62828; font-size: 20rpx; +} + +.pro-price:after { + display: inline-block; + content:'起'; color: #999999; - margin-left: 4rpx; + font-size: 10px; +} +.icon-shop{ + width: 34rpx; + height: 36rpx; } -.sku-items { +.left-img{ display: flex; + width: 290rpx; + flex-shrink: 0; + justify-content: space-between; + padding: 0 40rpx; + box-sizing: border-box; +} +.no-shop{ + width: 230rpx; +} +.shop-box{ + display:flex; + flex-direction: column; align-items: center; - flex-wrap: wrap; - margin-bottom: 1rpx; + justify-content: space-between; + height: 70rpx; } -.sku-item { - padding: 0 46rpx; - font-size: 29rpx; - color: #666; - border: 1rpx solid #999; - line-height: 58rpx; - margin-right: 40rpx; - margin-bottom: 25rpx; + + .wineScene-price-container { + width: 750rpx; + height: 100rpx; + /* background: linear-gradient(-90deg,#FF413B, #FFAB2E); */ + background: #FD3856; + /* border-radius: 20rpx 20rpx 0rpx 0rpx; */ + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 26rpx; + box-sizing: border-box; + color: #FFFFFF; + font-size: 24rpx; + } + + .wineScene-price-container .wineSecne-price { + font-weight: bold; + font-size: 48rpx; + color: #FFFFFF; } -.sku-item.active { - background: #0B898E; - border-color: #0B898E; - color: #fff; +.wineScene-price-container .wineSecne-money { + font-size: 24rpx; + font-weight: 500; + /* text-decoration-line: line-through; */ + padding-left: 14rpx; +} +.wineScene-price-container .wineSecne-price::before { + font-size: 24rpx; + content: '¥'; +} + +.hotel-custom-detail{ + display: flex; + /* justify-content: space-between; */ + height: fit-content; + font-family: PingFang SC; + font-weight: 500; + font-size: 24rpx; + color: #666666; + margin-bottom: 20rpx; +} +.hotel-custom-detail .tip-info{ + width: 33rpx; + position: relative; + display: flex; + justify-content: center; + flex-shrink: 0; +} +.hotel-custom-detail .tip-info .tip{ + font-family: PingFang SC; + font-weight: 500; + font-size: 23rpx; + color: #FFFFFF; + width: 33rpx; + height: 33rpx; + background: #6394FD; + border-radius: 50%; + position: absolute; + top: 0; + left: 0; + text-align: center; + line-height: 33rpx; +} +.hotel-custom-detail .tip-info .info{ + width: 11rpx; + height: 100%; + background: #D0DFFE; + border-radius: 5rpx; +} + +.hotel-custom-right>view{ + margin-bottom: 20rpx; +} +.hotel-custom-right>view:last-of-type{ + margin-bottom: 0; +} +.map-container{ + background-image: url('https://static.ticket.sz-trip.com/jundaosuzhou/images/wineScene/locationBg.png'); + background-size: 100% 100%; + width: 100%; + height: 128rpx; + padding: 30rpx 26rpx; + display: flex; + align-items: center; + justify-content: space-between; + font-family: PingFang SC; + font-weight: 500; + font-size: 24rpx; + color: #666666; + box-sizing: border-box; +} +.map-container image{ + width: 29rpx; + height: 29rpx; +} + +.select-img{ + display: flex; + height: 80rpx; + position: relative; + margin-bottom: 26rpx; +} +.select-img image{ + width: 80rpx; + height: 80rpx; + border-radius: 13rpx; + margin-right:20rpx; + flex-shrink: 0; + box-sizing: border-box; +} +.select-img image.active{ + border: 2px solid #DC2525; +} +.select-img image.no-stock{ + border: none; + opacity: 0.5; +} +.select-img .select-img-text{ + font-weight: bold; + font-size: 24rpx; + color: #000000; + width: 51rpx; + height: 80rpx; + margin-right:20rpx; + display: flex; + align-items: center; +} +.select-img .other-imgs{ + flex: 1; + width: 100rpx; + overflow-x: auto; + display: flex; +} +.select-img .select-sku{ + position: absolute; + top: 0; + right: 0; + width: 25rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + background: white; + font-family: fangsong; + color: #999; +} +.sku-tips{ + width: 100%; + position: absolute; + bottom: 73rpx; + left: 0; + right: 0; + display: flex; + justify-content: center; +} +.sku-tips>view{ + width: fit-content; + max-width: 533rpx; + height: 53rpx; + background: rgba(1, 0, 0, 0.6); + border-radius: 27rpx; + padding: 0 28rpx; + line-height: 53rpx; + font-weight: 500; + font-size: 24rpx; + color: #FFFFFF; + margin: 0 auto; +} + +.shop-container{ + display: flex; + align-items: center; + margin-top: 20rpx; + padding: 32rpx 23rpx; + width: 100%; + background: white; + box-sizing: border-box; +} +.shop-container .shop-img{ + width: 113rpx; + height: 113rpx; + flex-shrink: 0; +} +.shop-container .shop-btn{ + width: 135rpx; +height: 57rpx; +border-radius: 13rpx; +border: 1px solid #0B898E; +font-weight: 500; +font-size: 31rpx; +color: #0B898E; +text-align: center; +line-height: 57rpx; +flex-shrink: 0; +} +.shop-container .textOver2{ + flex: 1; + width: 100rpx; + padding: 0 50rpx 0 20rpx; + font-weight: bold; +font-size: 32rpx; +color: #010101; +} + + + +.other-info-box{ +} +.other-info-box .other-info-item{ + display: flex; + align-items: center; + font-weight: 500; + font-size: 27rpx; + color: #666666; + margin-top: 30rpx; +} +.other-info-box .other-info-item image{ + width: 32rpx; + height: 32rpx; + flex-shrink: 0; +} +.other-info-box .view-arrow{ + font-family: fangsong; + color: #999; + width: 25rpx; + flex-shrink: 0; +} +.other-info-box .other-content{ + padding: 0 20rpx; + overflow: hidden; + flex: 1; + width: 100rpx; + +} + +.other-info-content{ + min-height: 600rpx; + padding: 32rpx 23rpx; +} +.other-info-content .title{ + font-weight: bold; + font-size: 33rpx; + color: #060001; + text-align: center; + margin-bottom: 36rpx; +} +.other-info-content .key-title{ + color: #060001; + font-size: 27.67rpx; + line-height: 40rpx; + font-weight: bold; +} +.other-info-content .key-content{ + color: #666; + font-size: 27.67rpx; + line-height: 40rpx; + margin-top: 6rpx; +} +.prod-param{ + display: flex; + align-items: flex-start; + margin-bottom: 45rpx; +} +.prod-param .prod-key{ + flex: 1; + flex-shrink: 0; + font-weight: 500; + font-size: 27rpx; + color: #666666; +} +.prod-param .prod-content{ + flex: 1; + flex-shrink: 0; + font-weight: 500; +font-size: 27rpx; +color: #000000; +} + +.hot-font{ + width: 31rpx; + height: 31rpx; + background: linear-gradient(-30deg, #FF4000, #FF8D23); + border-radius: 7rpx; + text-align: center; + line-height: 31rpx; + font-weight: 500; +font-size: 23rpx; +color: #FFFFFF; +display: inline-block; +margin-right: 10rpx; +} + +.shop-info{ + display: flex; + align-items: center; + justify-content: space-between; + background: white; + padding:30rpx 28rpx; + box-sizing: border-box; + word-break: break-all; +} +.shop-info .supplier-headImg{ + width: 113rpx; + height: 113rpx; + background: #BCBCBC; + border-radius: 13rpx; + flex-shrink: 0; +} +.shop-info .content{ + flex: 1; + height: 113rpx; + width: 1rpx; + padding-left: 12rpx; + font-weight: bold; + font-size: 31rpx; + color: #010101; + display: flex; + flex-direction: column; + justify-content: space-between; +} +.shop-info .content .address{ + font-weight: 500; + font-size: 24rpx; + color: #999999; +} +.shop-info .icon-phone{ + width: 47.33rpx; + height: 46.67rpx; + flex-shrink: 0; } -.details { - padding-bottom: 30rpx; +.shop-info .shop-com-width{ + width: 100rpx; + flex: 1; } \ No newline at end of file diff --git a/pages/map/index.wxml b/pages/map/index.wxml index 1f467da..473e478 100644 --- a/pages/map/index.wxml +++ b/pages/map/index.wxml @@ -24,18 +24,23 @@ 场馆 - + + + + 行李寄存 + 运河十景 + @@ -59,18 +64,18 @@ 游客中心 - + 行李寄存 - + 美食 diff --git a/pages/map/index.wxss b/pages/map/index.wxss index 9faef2f..240c678 100644 --- a/pages/map/index.wxss +++ b/pages/map/index.wxss @@ -583,7 +583,7 @@ display: flex; /* justify-content: space-around; */ flex-wrap: wrap; - width: calc(170rpx * 7); + width: calc(170rpx * 6); margin: 0 20rpx; } diff --git a/pages/order/components/date/index.wxss b/pages/order/components/date/index.wxss index 4c5d8e8..3ee82a9 100644 --- a/pages/order/components/date/index.wxss +++ b/pages/order/components/date/index.wxss @@ -123,6 +123,7 @@ right: 0; bottom: 0; padding-bottom: 50rpx; + z-index: 50; } .short-date { font-weight: 500; diff --git a/pages/order/food/index.js b/pages/order/food/index.js index bd05f06..1a3cf66 100644 --- a/pages/order/food/index.js +++ b/pages/order/food/index.js @@ -14,7 +14,8 @@ Page({ user:"", tel:"", showNoticeFlag:false, - coupon:null + coupon:null, + price: 0, }, /** @@ -34,6 +35,7 @@ Page({ }) }) console.log(app.globalData.product) + this.showAllPrice() }, showNotice:function(){ this.setData({ @@ -46,6 +48,34 @@ Page({ }) }, + getNewCoupon(e){ + this.setData({ + coupon:e.detail + }) + this.showAllPrice() + }, + + showAllPrice () { + console.log('couponInfo',app.globalData.couponInfo); + + let price + if (this.data.coupon) { + if (this.data.coupon.activity.discount_type == 'pricebreak') { + price = this.data.product.sku.price * this.data.productNum - this.data.coupon.activity.money + } else { + price =(this.data.product.sku.price * this.data.productNum * this.data.coupon.activity.fold)/ 10 + } + } else { + price = this.data.product.sku.price * this.data.productNum + } + if (price >0) { + this.setData({ price:price/100}) + }else { + this.setData({ price:0 }) + } + + }, + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -66,11 +96,14 @@ Page({ productNum:(this.data.productNum-1), coupon:null }) + this.showAllPrice() }, add:function(){ this.setData({ productNum:this.data.productNum+1 }) + this.showAllPrice() + }, userInput:function(e){ this.setData({ @@ -83,16 +116,16 @@ Page({ }) }, order:function(){ - if(!this.data.user){ - wx.showToast({ - title: '请输入预订人', - icon: 'none' - }) - return; - } + // if(!this.data.user){ + // wx.showToast({ + // title: '请输入联系人', + // icon: 'none' + // }) + // return; + // } if(!this.data.tel){ wx.showToast({ - title: '请输入手机号码', + title: '请输入手机号', icon: 'none' }) return; diff --git a/pages/order/food/index.wxml b/pages/order/food/index.wxml index 36b7601..4f4c5c3 100644 --- a/pages/order/food/index.wxml +++ b/pages/order/food/index.wxml @@ -4,32 +4,36 @@ - {{product.product.title+product.sku.sku_name}} - + {{product.product.title}} + {{product.sku.sku_name}} + + {{product.sku.price/100}} - - 购票数量 + + 购买数量 {{productNum}} + - 预订人: - - - - 手机号码: - + 手机号: + - + - 合计:¥{{((product.sku.price * productNum - (coupon?coupon.activity.money:0))>0?(product.sku.price * productNum - (coupon?coupon.activity.money:0)):0) / 100}} - 立即预约 + + 订单金额:¥{{price}} + + 提交订单 \ No newline at end of file diff --git a/pages/order/food/index.wxss b/pages/order/food/index.wxss index 37a9558..f9ec664 100644 --- a/pages/order/food/index.wxss +++ b/pages/order/food/index.wxss @@ -12,10 +12,11 @@ page { margin: 0 20rpx; font-size: 31rpx; color: #000; - font-weight: 500; + font-weight: 600; display: flex; align-items: center; } + .coupon-btn { width: 138rpx; line-height: 56rpx; @@ -29,48 +30,48 @@ page { display: flex; justify-content: space-between; padding: 30rpx 20rpx; - margin-bottom: 30rpx; + align-items: flex-start; } .skuinfo image { flex-shrink: 0; - width: 174rpx; - height: 143rpx; - border-radius: 7rpx; - margin-right: 23rpx; - background: red; + width: 147rpx; + height: 147rpx; + border-radius: 13rpx; + margin-right: 12rpx; } .right-info { flex: 1; width: 100%; + padding-right: 30rpx; } .sku-name { - font-size: 32rpx; - line-height: 47rpx; - height: 94rpx; - color: #333; - margin-bottom: 10rpx; + font-weight: bold; + font-size: 31rpx; + color: #333333; } -.info-tips { - display: flex; - justify-content: space-between; - align-items: center; - font-size: 27rpx; - color: #666; +.sku-name2{ + font-weight: 500; +font-size: 27rpx; +color: #999999; +margin-top: 30rpx; } -.info-tips .price { - font-size: 33rpx; - color: #000; +.info-tips { + font-weight: bold; + font-size: 33rpx; + color: #000000; + flex-shrink: 0; + flex-shrink: 0; } -.info-tips .price text { +.info-tips text { font-size: 24rpx; + font-weight: 400; } -.info-tips .iconfont { - font-size: 26rpx; -} + .box-title .iconfont { font-size: 28rpx; flex-shrink: 0; } + .number-box { font-size: 29rpx; font-weight: 500; @@ -95,7 +96,7 @@ page { flex: 1; display: block; font-size: 31rpx; - color: #666; + color: #000000; margin-left: 15rpx; font-weight: 400; } diff --git a/pages/order/orderList/index.wxml b/pages/order/orderList/index.wxml index d5c8c9c..2245a77 100644 --- a/pages/order/orderList/index.wxml +++ b/pages/order/orderList/index.wxml @@ -37,7 +37,7 @@ X{{item.num}} 出行人信息 - + 姓名:{{items.name}} diff --git a/pages/order/payresult/index.js b/pages/order/payresult/index.js index 642090c..981fcb8 100644 --- a/pages/order/payresult/index.js +++ b/pages/order/payresult/index.js @@ -54,7 +54,7 @@ Page({ } - util.gotoDetail(item) + util.gotoDetail(item, false, "&sourceFrom=recommend") }, gotoOrderList:function(){ if(!this.data.info) return; diff --git a/pages/order/scene/index.js b/pages/order/scene/index.js index eb8dba9..6d9a940 100644 --- a/pages/order/scene/index.js +++ b/pages/order/scene/index.js @@ -65,7 +65,7 @@ Page({ ticket_type:app.globalData.product.sku.ticket_type || 1, isCar:options.isCar, is_need_idcard:app.globalData.product.sku.sku_model.is_need_idcard, - is_authentication:app.globalData.product.sku.sku_model.is_authentication, + is_authentication:app.globalData.product.sku.sku_model.is_authentication || 0, is_real_name:app.globalData.product.sku.sku_model.is_real_name, date: app.globalData.product.date, time: app.globalData.product.time || {}, @@ -505,6 +505,8 @@ Page({ remark: remark, product_num: app.globalData.product.isGroup == 1 ? 1 : productNum, phone:this.data.phone,// 不实名的时候传的手机号参数 + // 美食预定 + reserve_mobile: product.product.type=="food"?this.data.phone:"", }], originate_order_id: this.data.kjId, gp_id: app.globalData.gp_id, @@ -541,8 +543,9 @@ Page({ if(app.globalData.list){ app.globalData.list[app.globalData.index] = this.data.product // app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList - if (app.globalData.list[app.globalData.index].sku.sku_model.is_authentication == 0) { + if (!app.globalData.list[app.globalData.index].sku.sku_model.is_authentication) { app.globalData.list[app.globalData.index].phone = this.data.phone + // app.globalData.list[app.globalData.index].reserve_mobile = this.data.phone app.globalData.list[app.globalData.index].linkmanList = [] }else { app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList diff --git a/pages/search/list/index.wxml b/pages/search/list/index.wxml index 6fc1997..a6b8cce 100644 --- a/pages/search/list/index.wxml +++ b/pages/search/list/index.wxml @@ -71,6 +71,17 @@ + + + + + {{item.ext.name}} + + {{item.ext.begin_date}}-{{item.ext.end_date}} + {{item.ext.from_platform}} + + + diff --git a/pages/search/list/index.wxss b/pages/search/list/index.wxss index 547b428..f0f819c 100644 --- a/pages/search/list/index.wxss +++ b/pages/search/list/index.wxss @@ -50,6 +50,7 @@ page { font-size: 29rpx; color: #333; overflow-x: auto; + overflow-y: hidden; } .search-type { flex-shrink: 0; @@ -160,6 +161,7 @@ page { font-size: 20rpx; line-height: 20rpx; align-items: center; + overflow: visible; } .scene-tag { position: relative; diff --git a/pages/user/order/foodOrderInfo/index.js b/pages/user/order/foodOrderInfo/index.js index 64d5732..a21abf8 100644 --- a/pages/user/order/foodOrderInfo/index.js +++ b/pages/user/order/foodOrderInfo/index.js @@ -20,7 +20,11 @@ Page({ codeImgs:[], minute:"", second:"", - pay_methods:app.globalData.pay_methods + pay_methods:app.globalData.pay_methods, + ids: [], + + lon: null, + lat: null, }, /** @@ -177,6 +181,23 @@ Page({ }) }, + + gotolocation: function () { + let info = this.data.info.order_product_list[0].supplier_info; + wx.openLocation({ + latitude: Number(info.lat), + longitude: Number(info.lon), + name:info.shop_name, + address:info.address + }) +}, + +callPhone :function () { + wx.makePhoneCall({ + phoneNumber: this.data.info.order_product_list[0].scene_detail.tel, + }) +}, + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -184,33 +205,52 @@ Page({ }, + getOrderInfo () { + commonApi.user_post("order/query",{ + order_id:this.data.id, + lon: this.data.lon, + lat: this.data.lat + }).then(res=>{ + if(res.data.create_time && res.data.auto_close_time && res.data.state=='UNPAID'){ + let time = (new Date(res.data.create_time.replace(/-/g,'/')).getTime() + Number(res.data.auto_close_time) * 1000); + this.daojishi(time); + } + console.log(res) + let state = "" + res.data.order_product_list.map(order=>{ + order.qrcode.map(item=>{ + item.stateText = app.globalData.codeState[item.state]; + }) + order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[]; + state = state + order.state; + }) + this.setData({ + isRefund:state.indexOf("REFUND")!=-1, + info:res.data, + product_model:res.data.order_product_list[0].product_model, + ids: res.data.order_product_list.map(x=>x.product_id).join(","), + }) + this.getCodeImg() + }) + }, + /** * 生命周期函数--监听页面显示 */ onShow: function () { - commonApi.user_post("order/query",{ - order_id:this.data.id - }).then(res=>{ - if(res.data.create_time && res.data.auto_close_time && res.data.state=='UNPAID'){ - let time = (new Date(res.data.create_time.replace(/-/g,'/')).getTime() + Number(res.data.auto_close_time) * 1000); - this.daojishi(time); - } - console.log(res) - let state = "" - res.data.order_product_list.map(order=>{ - order.qrcode.map(item=>{ - item.stateText = app.globalData.codeState[item.state]; - }) - order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[]; - state = state + order.state; - }) - this.setData({ - isRefund:state.indexOf("REFUND")!=-1, - info:res.data, - product_model:res.data.order_product_list[0].product_model - }) - this.getCodeImg() + let that = this + wx.getLocation({ + type: 'gcj02', + success: function (res) { + that.setData({lat:res.latitude,lon:res.longitude}) + that.getOrderInfo() + }, + fail:function(){ + that.getOrderInfo() + } }) + + }, /** diff --git a/pages/user/order/foodOrderInfo/index.json b/pages/user/order/foodOrderInfo/index.json index 35cf02f..3418379 100644 --- a/pages/user/order/foodOrderInfo/index.json +++ b/pages/user/order/foodOrderInfo/index.json @@ -1,5 +1,6 @@ { "usingComponents": { - "title":"/pages/component/TitleHeader" + "title":"/pages/component/TitleHeader", + "sptj":"/pages/component/proRec/proRec" } } \ No newline at end of file diff --git a/pages/user/order/foodOrderInfo/index.wxml b/pages/user/order/foodOrderInfo/index.wxml index 220255e..267a3d1 100644 --- a/pages/user/order/foodOrderInfo/index.wxml +++ b/pages/user/order/foodOrderInfo/index.wxml @@ -19,8 +19,9 @@ - - + + + {{item.product_title}} @@ -30,53 +31,77 @@ ¥ {{item.product_price/100}} x{{item.product_num}} - - - 商品总价 - ¥{{info.total_money/100}} - - - 运费 - ¥{{info.total_post_fee/100}} - - - 优惠券抵扣 - -¥{{info.preference_money/100}} - - - 需付款 - {{info.paid_money/100}} - - - 剩余时间:00:{{minute}}:{{second}} - 再次购买 - 退款详情 - 取消订单 - 取消订单 - 去评价 - 立即支付 - + + + + {{item.order_product_extend.reserve_username}} + {{item.order_product_extend.reserve_mobile}} + + {{item.state_text}} + + + 小计 + ¥{{item.paid_money/100}} + + + + 商家信息 + + + {{info.order_product_list[0].supplier_info.shop_name}} + + + + 营业时间 + {{info.order_product_list[0].supplier_info.business_hours}} + + + + + + {{info.order_product_list[0].supplier_info.address}} + 据您约{{info.order_product_list[0].supplier_info.distance}}km + + + + + + + + + + + - + 订单信息 - - 姓名:{{info.order_product_list[0].order_product_extend.reserve_username}} - - - 预留手机号:{{info.order_product_list[0].order_product_extend.reserve_mobile}} - + + 订单编号:{{info.order_id}} @@ -89,18 +114,48 @@ 支付方式:{{pay_methods[info.pay_method]}} + + 商品总额:¥{{info.total_money/100}} + + + 运费:¥{{info.total_post_fee/100}} + + + 优惠券:-¥{{info.preference_money/100}} + + + 实付金额:{{info.paid_money/100}} + + + 剩余时间:00:{{minute}}:{{second}} + + + + 再次购买 + 退款详情 + 取消订单 + 取消订单 + 去评价 + 立即支付 + - + + + + 联系客服 + + + diff --git a/pages/user/order/foodOrderInfo/index.wxss b/pages/user/order/foodOrderInfo/index.wxss index c0a17a4..053db7d 100644 --- a/pages/user/order/foodOrderInfo/index.wxss +++ b/pages/user/order/foodOrderInfo/index.wxss @@ -33,8 +33,6 @@ page { color: #333; font-size: 24rpx; padding-bottom: 20rpx; - border-bottom: 1rpx solid #d8d8d8; - margin-bottom: 10rpx; } .product-info image { width: 140rpx; @@ -63,19 +61,18 @@ page { justify-content: space-between; align-items: center; height: 45rpx; - color: #333; - font-size: 26rpx; -} -.all-total-item { - font-weight: bold; - height: 70rpx; - border-bottom: 1rpx solid #d8d8d8; + font-weight: 500; + font-size: 27rpx; + color: #666666; + margin-bottom: 10rpx; } -.all-total-item .price { - color: #D62828; - font-size: 36rpx; +.detail-item .price{ + color: #D62828; + font-size: 34rpx; + font-weight: bold; } -.all-total-item .price::before { + +.detail-item .price::before { content: "¥"; font-size: 26rpx; } @@ -286,4 +283,64 @@ page { font-size: 24rpx; color: #999; margin-top: 30rpx; +} + +.reserve-box{ + display: flex; + align-items: center; + justify-content: space-between; + font-weight: bold; + font-size: 31rpx; + color: #000000; +} +.state_text{ + font-weight: bold; + font-size: 31rpx; + color: #0B898E; + text-align: right; + margin: 20rpx 0; + padding-bottom: 20rpx; + border-bottom: 1px solid #D8D8D8; +} + +.supplier-mask{ + display: flex; + flex-direction: column; +} +.supplier-mask .supplier-mask-header{ + padding: 28rpx 26rpx; + font-weight: bold; + font-size: 31rpx; + color: #000000; +} +.mask-shop-info{ + font-weight: 500; + font-size: 31rpx; + color: #000000; +} +.shop-info-item{ + display: flex; + align-items: flex-start; + font-weight: 500; + font-size: 26rpx; + color: #000000; + padding: 20rpx 0; + word-wrap: break-all; +} +.shop-info-item .start-icon{ + width: 28rpx; + height: 28rpx; + margin: 4rpx 8rpx 0 0; + flex-shrink: 0; +} +.shop-info-item .subtitle{ + font-weight: 500; + font-size: 24rpx; + color: #666666; + margin-top: 26rpx; +} +.shop-info-item .icon-phone{ + width: 56rpx; + height: 56rpx; + margin-left: 40rpx; } \ No newline at end of file diff --git a/pages/user/order/list.js b/pages/user/order/list.js index 584fcc5..978a08f 100644 --- a/pages/user/order/list.js +++ b/pages/user/order/list.js @@ -114,6 +114,11 @@ Page({ ajaxes.push(ajax); indexes.push(index); } + // 权益卡只展示第一个 + if (item.is_order_card_product==1) { + item.order_product_list = [item.order_product_list[0]] + } + item.orderNum = orderNum; }) console.log(ajaxes) @@ -141,7 +146,7 @@ Page({ }, gotoDetail:function(e){ let item = e.currentTarget.dataset.item; - item = this.getChild(item) + // item = this.getChild(item) util.gotoOrder(item) }, diff --git a/pages/user/order/postOrderInfo/index.js b/pages/user/order/postOrderInfo/index.js index 6325b72..75339e3 100644 --- a/pages/user/order/postOrderInfo/index.js +++ b/pages/user/order/postOrderInfo/index.js @@ -23,7 +23,12 @@ Page({ pay_methods:app.globalData.pay_methods, tjList:[], showLoading:true, - ids:[] + ids:[], + + // 权益卡 + isCard: false, + cardPostList: [], + deliveryNum: 0, }, /** @@ -309,11 +314,36 @@ getInfo () { state = state + order.state; order.contacts_info = order.contacts_info?JSON.parse(order.contacts_info):[] }) + + // 权益卡 + let cardPostList = []; + let isCard= false; + let deliveryNum = 0; + if (res.data.order_product_list.some(v=>v.order_card_product)) { + cardPostList = res.data.order_product_list.slice(1) + res.data.order_product_list = [res.data.order_product_list[0]] + isCard = true; + cardPostList.forEach(v=>{ + console.log(v) + if (v.order_card_product) { + v.order_card_product.month = new Date(v.order_card_product.delivery_start_date).getMonth()+1 + v.order_card_product.delivery_start_date = v.order_card_product.delivery_start_date.slice(0,10) + v.order_card_product.delivery_end_date = v.order_card_product.delivery_end_date.slice(0,10) + } + if (['WAIT_DELIVERY', 'WAIT_COMMENT', 'COMPLETED'].includes(v.state)) { + deliveryNum += 1 + } + }) + } + this.setData({ isRefund:state.indexOf("REFUND")!=-1, info:res.data, product_model:res.data.order_product_list[0].product_model, - ids: proId.join(",") + ids: proId.join(","), + cardPostList: cardPostList, + isCard: isCard, + deliveryNum: deliveryNum }) this.getCodeImg() }) @@ -377,12 +407,35 @@ getInfo () { } else { res.data.is_all_confirm = false; } - + // 权益卡 + let cardPostList = []; + let isCard= false; + let deliveryNum = 0; + if (res.data.order_product_list.some(v=>v.order_card_product)) { + cardPostList = res.data.order_product_list.slice(1) + res.data.order_product_list = [res.data.order_product_list[0]] + isCard = true; + cardPostList.forEach(v=>{ + console.log(v) + if (v.order_card_product) { + v.order_card_product.month = new Date(v.order_card_product.delivery_start_date).getMonth()+1 + v.order_card_product.delivery_start_date = v.order_card_product.delivery_start_date.slice(0,10) + v.order_card_product.delivery_end_date = v.order_card_product.delivery_end_date.slice(0,10) + } + if (['WAIT_DELIVERY', 'WAIT_COMMENT', 'COMPLETED'].includes(v.state)) { + deliveryNum += 1 + } + }) + } + console.log(res.data, 'aaa') this.setData({ isRefund:state.indexOf("REFUND")!=-1, info:res.data, product_model:res.data.order_product_list[0].product_model, - ids: proId.join(",") + ids: proId.join(","), + cardPostList: cardPostList, + isCard: isCard, + deliveryNum: deliveryNum }) this.getCodeImg() }) diff --git a/pages/user/order/postOrderInfo/index.wxml b/pages/user/order/postOrderInfo/index.wxml index e7e887a..563d837 100644 --- a/pages/user/order/postOrderInfo/index.wxml +++ b/pages/user/order/postOrderInfo/index.wxml @@ -120,6 +120,57 @@ + + + + 物流信息 + {{item.showMore?"收起":"展开"}} + + + + 当前已发:{{deliveryNum}} + + + 当前待发:{{cardPostList.length - deliveryNum}} + + + + + + + + + + + {{shipment.order_card_product.month}}月 + + + + + {{shipment.sku_name}} + {{shipment.state_text}} + + + + 快递公司:{{shipment.post_detail_list[0].express_name}} + + + 快递单号: + + {{shipment.post_detail_list[0].courier_number}} 复制 + + + + + + 发货时间:{{shipment.order_card_product.delivery_start_date}} 至 {{shipment.order_card_product.delivery_end_date}} + + + + + + + @@ -169,6 +220,8 @@ 退款详情 确认收货 + 确认收货 + 申请退款 取消订单 去评价 diff --git a/pages/user/order/postOrderInfo/index.wxss b/pages/user/order/postOrderInfo/index.wxss index 6d3e75b..e02e564 100644 --- a/pages/user/order/postOrderInfo/index.wxss +++ b/pages/user/order/postOrderInfo/index.wxss @@ -371,11 +371,72 @@ color: #333333; width: fit-content; margin: 0 auto; box-sizing: border-box; - margin-top: 20rpx; } .expand-tip{ position: absolute; color: #0B898E; right: 0; bottom: 0; +} + +.line-card{ + + width: 90rpx; + display: flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + font-weight: bold; + font-size: 23rpx; + color: #999999; + position: relative; + /* height: 100%; */ +} +.line-card .line-dot{ + width: 33rpx; + height: 33rpx; + background: #CCCCCC; + border-radius: 50%; + position: absolute; + left: -16.5rpx; + top: calc(50% - 16.5rpx); + z-index: 3; +} +.first-line{ + height: 50%; + position: absolute; + top: 0; + width: 4rpx; + left: -2rpx; + z-index: 2; + background: white; + z-index: 2; +} +.last-line{ + height: 50%; + position: absolute; + bottom: 0; + width: 4rpx; + left: -2rpx; + z-index: 2; + background: white; + z-index: 2; +} +.my-shipment-place{ + box-sizing: border-box; + margin-left: 20rpx; + border-left: 1px solid #ccc; + padding-bottom: 20rpx; +} +.my-shipment-place:last-of-type{ + + padding-bottom: 0rpx; +} +.completed{ + color: #0b898e; +} +.line-dot image{ + width: 100%; + height: 100%; + border-radius: 50%; } \ No newline at end of file diff --git a/pages/user/order/sceneOrderInfo/index.js b/pages/user/order/sceneOrderInfo/index.js index 9e48030..d00901b 100644 --- a/pages/user/order/sceneOrderInfo/index.js +++ b/pages/user/order/sceneOrderInfo/index.js @@ -29,7 +29,9 @@ Page({ sysm2:false, sysm2Text:'更多', imgLen:[], - ids:[] + ids:[], + + isPost: false, // 有没有邮寄产品 }, /** @@ -316,7 +318,8 @@ Page({ isRefund:state.indexOf("REFUND")!=-1, info:res.data, product_model:"ticket"||res.data.order_product_list[0].product_model, - ids: proId.join(",") + ids: proId.join(","), + isPost: res.data.order_product_list.some(x=>x.product_model == 'post'), }) console.log(res.data); // debugger diff --git a/pages/user/order/sceneOrderInfo/index.wxml b/pages/user/order/sceneOrderInfo/index.wxml index 40c9dd0..8d5d702 100644 --- a/pages/user/order/sceneOrderInfo/index.wxml +++ b/pages/user/order/sceneOrderInfo/index.wxml @@ -38,20 +38,7 @@ @@ -98,9 +85,9 @@ - + - 手机号: {{item.phone}} + 手机号: {{item.phone || item.reserve_mobile}} @@ -246,7 +233,7 @@ 商品总价: ¥{{info.total_money/100}} - + 运费: diff --git a/pages/user/service/info/index.json b/pages/user/service/info/index.json index 35cf02f..d1688bb 100644 --- a/pages/user/service/info/index.json +++ b/pages/user/service/info/index.json @@ -1,5 +1,6 @@ { "usingComponents": { - "title":"/pages/component/TitleHeader" + "title":"/pages/component/TitleHeader", + "kefuCom": "/pages/component/kefu" } } \ No newline at end of file diff --git a/pages/user/service/info/index.wxml b/pages/user/service/info/index.wxml index 4de9a47..cc678e9 100644 --- a/pages/user/service/info/index.wxml +++ b/pages/user/service/info/index.wxml @@ -21,7 +21,7 @@ - + + + \ No newline at end of file diff --git a/pages/user/service/list/index.js b/pages/user/service/list/index.js index b9eedb9..f83638e 100644 --- a/pages/user/service/list/index.js +++ b/pages/user/service/list/index.js @@ -14,8 +14,7 @@ Page({ page_no:1, keyword:"", showModal: false, - // 成功 - ses:true, + }, diff --git a/pages/user/service/list/index.json b/pages/user/service/list/index.json index 35cf02f..d1688bb 100644 --- a/pages/user/service/list/index.json +++ b/pages/user/service/list/index.json @@ -1,5 +1,6 @@ { "usingComponents": { - "title":"/pages/component/TitleHeader" + "title":"/pages/component/TitleHeader", + "kefuCom": "/pages/component/kefu" } } \ No newline at end of file diff --git a/pages/user/service/list/index.wxml b/pages/user/service/list/index.wxml index 1081b19..2b3adbc 100644 --- a/pages/user/service/list/index.wxml +++ b/pages/user/service/list/index.wxml @@ -12,27 +12,6 @@ 没找到想要的答案?一键呼唤人工客服 - - - - - 即将跳转人工在线客服 - 客服服务时间:9:00-12:00, - 13:00-18:00 -如遇紧急情况可拨打 0512-66555111 18915532527 - - 取消 - - - - \ No newline at end of file + + + \ No newline at end of file diff --git a/pages/user/user.json b/pages/user/user.json index 8835af0..9157b74 100644 --- a/pages/user/user.json +++ b/pages/user/user.json @@ -1,3 +1,5 @@ { - "usingComponents": {} + "usingComponents": { + "kefuCom": "/pages/component/kefu" + } } \ No newline at end of file diff --git a/pages/user/user.wxml b/pages/user/user.wxml index 94f9bdb..7437bc7 100644 --- a/pages/user/user.wxml +++ b/pages/user/user.wxml @@ -131,7 +131,7 @@ 备案号:苏ICP备19064944号-3X@君到苏州 - + + \ No newline at end of file diff --git a/project.private.config.json b/project.private.config.json index 01b81b5..0e91f87 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -7,18 +7,11 @@ "miniprogram": { "list": [ { - "name": "pages/info/postProductInfo/index", - "pathName": "pages/info/postProductInfo/index", - "query": "id=457638", + "name": "subPackages/foodListNew/index", + "pathName": "subPackages/foodListNew/index", + "query": "", "launchMode": "default", "scene": null - }, - { - "name": "pages/info/roadInfo/index", - "pathName": "pages/info/roadInfo/index", - "query": "id=457643", - "scene": null, - "launchMode": "default" } ] } diff --git a/subPackages/foodListNew/index.js b/subPackages/foodListNew/index.js new file mode 100644 index 0000000..dd5a222 --- /dev/null +++ b/subPackages/foodListNew/index.js @@ -0,0 +1,198 @@ +// pages/list/theatre/index.js +import commonApi from "../../utils/https/common" +import util from "../../utils/util" +let app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + list:[], + tagList: [ + {id: 521, name: "品苏式面"}, + {id: 522, name: "尝农家乐"}, + // {id: 11, name: "鉴苏帮菜"}, + // {id: 12, name: "寻夜食堂"}, + ], // 父标签477 + total:1, + type:521, + + areas: [], + areaIndex:0, + + needDistance: false, + lat:"", + lon:"", + keywords:"" + }, + + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + wx.showShareMenu({ + withShareTicket: true, + menus: ['shareAppMessage', 'shareTimeline'] + }) + this.getList(); + this.getAreas(); + }, + + getAreas:function(){ + commonApi._post("supplier/get_area_list",{pid:320500}).then(res=>{ + this.setData({ + areas: [{id:0, name:"选择地区"},...res.data] + }) + }) + }, + changeArea:function(e){ + this.setData({ + areaIndex:e.detail.value, + list: [], + total:1, + }) + this.getList() + }, + selectDistance: function () { + this.setData({ + needDistance: !this.data.needDistance, + list: [], + total:1, + }) + this.getList() + }, + + search:function(e){ + this.setData({ + list:[], + keywords:e.detail.keywords, + total:1 + }) + this.getList() + }, + gotoDetail:function(e){ + let item = e.currentTarget.dataset.item; + // util.pagePoint({ + // event: 'food_detail_click', + // param: { + // id:item.id + // } + // },1) + wx.navigateTo({ + url: '/subPackages/foodNew/index?id='+item.id, + }) + }, + getList:function(){ + let list = this.data.list,that = this; + if(list.length>=this.data.total) return;0 + // // 距离排序 + if(this.data.needDistance && !this.data.lon){ + wx.getLocation({ + type: 'gcj02', + success: function (res) { + that.setData({ + lat:res.latitude, + lon:res.longitude + }) + that.realgetList() + }, + fail:function(){ + that.realgetList() + } + }) + } + else { + this.realgetList() + } + + }, + realgetList:function(){ + let list = this.data.list; + + let param = {} + if (this.data.needDistance) { + param = {lat:this.data.lat,lon:this.data.lon} + } + + commonApi._post("supplier/get_supplier_list",{ + supplier_tag_id: this.data.type, + area_id: (this.data.areas[this.data.areaIndex] || {id: 0}).id, + offset:list.length, + limit:10, + ...param, + keyword:this.data.keywords + }).then(res=>{ + this.setData({ + list:list.concat(res.data.list), + total:res.data.total + }) + }) + }, + changeType:function(e){ + this.setData({ + type:e.currentTarget.dataset.type, + list:[], + total:1 + }) + this.getList(); + }, + + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + this.getList() + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + onShareTimeline: function() { + return { + title: '君到苏州-剧场演出', + query: '', + imageUrl: 'https://static.ticket.sz-trip.com/xcxImages/index/icon4New.png' + } + } +}) \ No newline at end of file diff --git a/subPackages/foodListNew/index.json b/subPackages/foodListNew/index.json new file mode 100644 index 0000000..9134183 --- /dev/null +++ b/subPackages/foodListNew/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "search": "/pages/component/SearchHeader" + } +} \ No newline at end of file diff --git a/subPackages/foodListNew/index.wxml b/subPackages/foodListNew/index.wxml new file mode 100644 index 0000000..840716d --- /dev/null +++ b/subPackages/foodListNew/index.wxml @@ -0,0 +1,52 @@ + + + + + + {{item.name}} + + + + + + + {{areaIndex>0?areas[areaIndex].name:'选择地区'}} + + + + + 距离最近 + + + + + + + + + + + + {{item.supplier_name}} + + {{item.address}} + + {{item.distance}}km + + + + + + ¥{{prod.price?prod.price/100:0}} + {{prod.title}} + + + + + + + 暂无内容 + + + \ No newline at end of file diff --git a/subPackages/foodListNew/index.wxss b/subPackages/foodListNew/index.wxss new file mode 100644 index 0000000..52e5e37 --- /dev/null +++ b/subPackages/foodListNew/index.wxss @@ -0,0 +1,158 @@ +/* pages/list/theatre/index.wxss */ +page{ + background:#F7F7F7; + padding-bottom: 20rpx; +} + +.my-header-search{ + background: white; + position: fixed; + top: 0; + left: 0; + right: 0; +} +.my-header-search .bg-box .title-header{ + color: #999; +} +.my-header-search .title-header .icon-fanhui1{ + color: #333 !important; +} + +.sale-types { + background-image: url("https://static.ticket.sz-trip.com/uploads/20250924/e47d70fa4d99ac1804729b024cdf4d6a.png"); + background-size: 100% 100%; + width: 100%; + height: 466.67rpx; + display: flex; + align-items: flex-end; + padding: 0 26rpx 50rpx; + /* justify-content: space-between; */ + box-sizing: border-box; +} +.sale-type { + width: 160rpx; + height: 77.33rpx; + flex-shrink: 0; + font-weight: bold; + font-size: 28rpx; + color: #FE7429; + background-image: url("https://static.ticket.sz-trip.com/uploads/20250924/12b88d55fac2e526445d101f90eb9e0b.png"); + background-size: 100% 100%; + text-align: center; + line-height: 77rpx; + margin-right: 40rpx; +} +.sale-type.active { + font-weight: bold; + font-size: 28rpx; + color: #000000; + background-image: url("https://static.ticket.sz-trip.com/uploads/20250924/5c0f204a31181920f5561f2cdc725559.png"); +} +.search-fix{ + height: 95rpx; + width: 100%; + border-radius: 20rpx 20rpx 0 0; + background: #F7F7F7; + position: relative; + z-index: 2; + margin-top: -30rpx; + box-sizing: border-box; + padding: 0 144rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-weight: 500; + font-size: 24rpx; + color: #000000; +} +.feiyi-picker{ + + display: flex; + align-items: center; +} +.trian-down{ + margin-left: 13rpx; + width: 0; + height: 0; + /* 关键:左右边框宽度大于底部边框宽度,形成扁平效果 */ + border-left: 14rpx solid transparent; /* 左宽 */ + border-right: 14rpx solid transparent; /* 右宽 */ + border-top: 10rpx solid #999; /* 高度(数值越小越扁) */ +} +.prod-box{ + background: #F7F7F7; + border-radius: 20rpx 20rpx 0 0; + padding-top: 33rpx; +} + +.item { + background: #FFFFFF; + margin: 0rpx 27rpx 30rpx; + display: flex; + align-items: flex-start; + justify-content: space-between; + padding: 6rpx; + border-radius: 13rpx; +} +.item image { + width: 160rpx; + height: 160rpx; + background: #D1D7CB; + border-radius: 7rpx; + margin-right: 14rpx; + flex-shrink: 0; +} + +.info { + flex: 1; + width: 1rpx; + min-height: 160rpx; +} +.info .title { + font-weight: bold; + font-size: 31rpx; + color: #000000; + margin-bottom: 20rpx; +} +.info .subtitle { + font-weight: 500; + font-size: 24rpx; + color: #999999; +} +.info .line{ + width: 100%; + height: 1px; + background: #D8D8D8; + margin: 22rpx 0; +} + +.prod-item{ + font-weight: 500; + font-size: 24rpx; + color: #000000; + display: flex; + align-items: center; + margin-bottom: 20rpx; +} +.prod-item .hot{ + width: 31rpx; + height: 31rpx; + background: linear-gradient(-30deg, #FF4000, #FF8D23); + border-radius: 7rpx; + font-weight: 500; + font-size: 23rpx; + color: #FFFFFF; + text-align: center; + line-height: 31rpx; + margin-right: 17rpx; + flex-shrink: 0; +} +.prod-item .price{ + font-weight: bold; +font-size: 24rpx; +color: #D80000; +margin-right: 17rpx; +} + + + diff --git a/subPackages/foodNew/index.js b/subPackages/foodNew/index.js new file mode 100644 index 0000000..aa44650 --- /dev/null +++ b/subPackages/foodNew/index.js @@ -0,0 +1,798 @@ +// pages/info/roadInfo/index.js +let device = wx.getSystemInfoSync(); +const ratio = device.windowWidth / 750; +import commonApi from "../../utils/https/common" +import QRCode from '../../utils/weapp-qrcode.js' +import {pagePoint, gotoDetail} from '../../utils/util' +let app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + autoPlay: false, + fixed: false, + type: 1, + top: 0, + isLike: 0, + + info: null, + skuFlag: null, + producNum: 1, + skuIndex: 0, + aniSkuIndex: -1, + + cartTop: 0, + cartImgInfo: null, + cartCount: 0, + shareImg: null, + showShareFlag: false, + + + showQrCode: false, + wxqrcode: null, + + ZTPoint:'', + swiperCurrent: 0, + swiperRange: { + video: {min:0,max:0}, + picture: {min:0,max:0}, + sku: {min:0,max:0} + }, + otherInfoShow: 0, + + supplierInfo: null, + showShopInfo: false, + idIndex: 0, + + lon: null, + lat: null, + scrollLeft: 0, + scrollDom: "", + scrollDomLeft:0, + windowWidth: 375, + prod_phone: "", + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + console.log(options) + //删除临时存储的联系人 + wx.removeStorageSync('linkMan') + let rect = wx.getMenuButtonBoundingClientRect(), + that = this; + let height = (rect.top - device.statusBarHeight) * 2 + rect.height + device.statusBarHeight; + this.setData({top: height,id: options.id}) + // 获取购物车按钮的位置 + wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) { + console.log(res) + that.setData({ + cartTop: res.top + }) + }).exec() + if (options.ZTPoint) { + this.setData({ + ZTPoint: options.ZTPoint + }) + } + + wx.getLocation({ + type: 'gcj02', + success: function (res) { + that.setData({lat:res.latitude,lon:res.longitude}) + that.getShopInfo(options.id) + }, + fail:function(){ + that.getShopInfo(options.id) + } + }) + + const { windowWidth } = wx.getSystemInfoSync(); + this.setData({ windowWidth }); + console.log(windowWidth) + }, + + getShopInfo (id) { + commonApi._post("/supplier/get_supplier_products", + {supplier_id: id, lon: this.data.lon,lat: this.data.lat} + ).then(res => { + if (res.code == 0) { + wx.showToast({title: res.msg,icon:'none'}) + setTimeout(() => { wx.navigateBack()}, 1000); + return + } else { + // res.data.products = [...res.data.products,...res.data.products,...res.data.products,...res.data.products] + this.setData({ supplierInfo: res.data}) + + if (res.data.products.length>0) { + let id = res.data.products[0].id + this.getProductInfo(id) + } + } + }) + }, + + changeProduct (e) { + let _this = this; + let index = e.currentTarget.dataset.index; + let prod = e.currentTarget.dataset.item; + this.setData({ + idIndex: index + }) + this.getProductInfo(prod.id) + + let windowWidth = this.data.windowWidth; + let domId = e.currentTarget.id + wx.createSelectorQuery().select(`#${domId}`).boundingClientRect(rect => { + console.log(rect) + if (rect) { + let targetScrollLeft = rect.left + (rect.width / 2) - (windowWidth / 2)+_this.data.scrollLeft; + console.log((rect.width / 2) - (windowWidth / 2)) + this.setData({ + scrollLeft: targetScrollLeft||0, + scrollDomLeft: (rect.width / 2) - (windowWidth / 2), + + }); + this.setData({ + scrollDom: domId, + }) + } + }).exec() + + }, + + + getProductInfo (id) { + commonApi._post("product/get_product_detail", {id: id}).then(res => { + res.data.flag = res.data.sku.find(item => item.flag == 'on') ? res.data.flag : 0; + let resData = res.data + try { + resData.shipment_tag_arr = [] + if (resData.shipment_tag) { + resData.shipment_tag_arr = resData.shipment_tag.split(',') + resData.shipment_tag_str = resData.shipment_tag_arr.join(' | ') + } + if (resData.service_tag) { + resData.service_tag_str = resData.service_tag.split(',').join(' | ') + } + if (resData.parameter_tag) { + resData.parameter_tag_str = resData.parameter_tag.split(',').join(' | ') + } + if (resData.supplier_headimg) { + resData.supplier_headimg = that.showImg(resData.supplier_headimg) + } + + } catch(e) {} + + // let swiperRange = this.data.swiperRange; + // swiperRange.video = resData.videourl? { min: 0, max: 0 } : { min: -1, max: -1 } + // swiperRange.picture = {min:swiperRange.video.max+1, max:swiperRange.video.max+1+resData.listimg.length-1} + // swiperRange.sku = {min:swiperRange.picture.max+1,max:swiperRange.picture.max+1+resData.sku.length-1} + this.setData({ + info: resData, + // swiperRange: swiperRange, + shareImg: null, + prod_phone: resData.scene_tel + }) + + this.drawImg() + }) + }, + + showImg (img) { + if (!img) { return img } + if (img.indexOf('https://') != -1 || img.indexOf('http://') != -1) { + return img; + } else { + // return "https://test.api.cloud.sz-trip.com"+img + return "https://static.ticket.sz-trip.com" + img; + } + }, + + + BroswerRecord: function () { + setTimeout(() => { + if (app.globalData.uuid) { + commonApi._post('browse/browse_record', { + type: "goods", + title: this.data.info.title, + drive: "mini", + source_id: this.data.info.id, + url: "/pages/info/postProductInfo/index?id=" + this.data.info.id, + uuid: app.globalData.uuid + }).then(res => {}) + } else { + this.BroswerRecord(); + } + }, 500) + }, + + onPageScroll: function (e) { + let that = this, + height = this.data.top; + let topHeight = height; + wx.createSelectorQuery().select('#menus').boundingClientRect(function (rect) { + console.log(rect,height, e.scrollTop) + if (rect.top < topHeight) { + // 此时应该把menus固定在顶部 + that.setData({ fixed: true}) + } + if (e.scrollTop<100) { + that.setData({fixed: false}) + } + }).exec() + + }, + showCart: function () { + commonApi.user_post('wx/get_user_keep', { + jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id, + title: this.data.info.title, + type: 'mini' + }).then(res => { + if (res.data.subscribe == 0) { + this.setData({ + wxqrcode: res.data.qrcode, + showQrCode: true + }) + } else { + if (this.data.info.sku.length == 0) { + wx.showToast({ + title: '该产品未设置规格,不能加购', + icon: 'none' + }) + return; + } + this.setData({ + skuFlag: "cart" + }) + let that = this + wx.createSelectorQuery().select('#skuImg').boundingClientRect(function (res) { + console.log(res) + that.setData({ + cartImgInfo: 'top:' + res.top + 'px;left:' + res.left + 'px;' + }) + }).exec() + } + }) + }, + hideSku: function () { + this.setData({ + skuFlag: null, + cartImgInfo: null + }) + }, + minus: function () { + if (this.data.producNum == 1) return; + this.setData({ + producNum: this.data.producNum - 1 + }) + }, + add: function () { + this.setData({ + producNum: this.data.producNum + 1 + }) + }, + selectSku: function (e) { + let index = e.currentTarget.dataset.index; + this.setData({ + skuIndex: index, + swiperCurrent: index+this.data.swiperRange.picture.max+1 + }) + }, + showOrder: function () { + commonApi.user_post('wx/get_user_keep', { + jumpurl: '/pages/info/postProductInfo/index?id=' + this.data.id, + title: this.data.info.title, + type: 'mini' + }).then(res => { + if (res.data.subscribe == 0) { + this.setData({ + wxqrcode: res.data.qrcode, + showQrCode: true + }) + } else { + if (this.data.info.sku.length == 0) { + wx.showToast({ + title: '该产品未设置规格,不能购买', + icon: 'none' + }) + return; + } + let swiperCurrent = this.data.swiperCurrent; + let skuIndex = swiperCurrent - this.data.swiperRange.sku.min + console.log(swiperCurrent, skuIndex) + if (skuIndex<0) {skuIndex=0} + this.setData({ + skuFlag: 'order', + skuIndex: skuIndex, + swiperCurrent: skuIndex+this.data.swiperRange.picture.max+1 + }) + } + }) + }, + order: function (e) { + let skuFlag = e.currentTarget.dataset.type + app.globalData.postProduct = [] + app.globalData.list = [] + commonApi.user_post("/product/checkStock", { + sku_id: this.data.info.sku[this.data.skuIndex].id, + }).then(res => { + if (res && res.code != 1) { + return; + } else { + if (skuFlag == 'order') { + pagePoint({ + event: 'product_order', + param: { + id: this.data.info.id, + type: this.data.info.type + } + }, 1) + wx.setStorageSync('login_from', 'product_order_login') + wx.setStorageSync('order_from', 'product_order_submit') + app.globalData.couponInfo = null; + // 购买 + let product = [{ + product: {...this.data.info,ZTPoint:this.data.ZTPoint}, + sku: this.data.info.sku[this.data.skuIndex], + productNum: this.data.producNum + }]; + + app.globalData.listName = null + app.globalData.product = product[0]; + wx.navigateTo({ + url: '/pages/order/food/index', + }) + } else { + let tag_id = this.data.info.tag_id,type = '' + if (tag_id.includes(20) || tag_id.includes(19)) { //文创 + type = '1' + }else if (tag_id.includes(5)) { //非遗 + type = '2' + }else { + type = '' + } + commonApi.user_post("cart/add_sku", { + sku_id: this.data.info.sku[this.data.skuIndex].id, + num: this.data.producNum, + type:type + }).then(res => { + if (res.code == 1) { + commonApi.user_post('cart/get_list', {}).then(res => { + this.setData({ + cartCount: res.data.length + }) + }) + // 加动效 + this.setData({ + skuFlag: null, + aniSkuIndex: this.data.skuIndex, + cartImgInfo: null + }) + setTimeout(() => { + this.setData({ + aniSkuIndex: -1 + }) + wx.showModal({ + title: "提示", + content: "去购物车结算?", + success: function (res) { + if (res.confirm) { + wx.navigateTo({ + url: '/pages/user/cartlist/list', + }) + } + } + }) + }, 650) + } + }) + } + } + }) + + }, + // 分享 + share: function () { + if (!wx.getStorageSync("jstrip_token")) { + pagePoint({ + event: 'product_share_login', + type: this.data.info.type, + id: this.data.info.id + }, 1) + commonApi.user_post("user/getMyInfo", {}).then(res => { + + }) + return; + } + if (!this.data.shareImg) { + wx.showToast({ + title: '图片生成中,稍后再试', + icon: 'none' + }) + return; + } + this.setData({ + showShareFlag: !this.data.showShareFlag + }) + }, + // 保存 + save() { + let url = this.data.shareImg, + that = this; + wx.authorize({ + /* 这个就是保存相册的 */ + scope: 'scope.writePhotosAlbum', + success() { + wx.saveImageToPhotosAlbum({ + filePath: url, + success(res) { + wx.showToast({ + title: '保存成功', + icon: "success" + }) + that.setData({ + showShareFlag: !this.data.showShareFlag + }) + pagePoint({ + event: 'product_share_save', + type: that.data.info.type, + id: that.data.info.id + }, 1) + }, + fail(res) { + wx.showToast({ + title: '保存失败', + icon: 'none' + }) + } + }) + }, + complete(res) { + console.log(res); + /* 这里判断一下如果没有授权重新打开设置选项 */ + wx.getSetting({ + success(res) { + if (!res.authSetting['scope.writePhotosAlbum']) { + /* 打开设置的方法 */ + // opensit(); + wx.showToast({ + title: '请打开权限后再试', + icon: 'none' + }) + } + } + }); + } + }); + + }, + pagePoint: function (e) { + pagePoint(e) + }, + // 绘制海报 + drawImg: function () { + var that = this, + userinfo = wx.getStorageSync('jstrip_userInfo'); + if (!userinfo) { + // 去登录 + return false; + } + const ctx = wx.createCanvasContext('imageCanvas'); + // const device = wx.getSystemInfoSync(); + // const ratio = device.screenWidth / 750; + + // 先获取到图片信息 + let promise2 = new Promise(function (resolve, reject) { + wx.getImageInfo({ + src: that.data.info.headimg, + success: function (res) { + resolve(res); + }, + fail: function (res) { + reject(res); + } + }) + }) + let promise3 = new Promise(function (resolve, reject) { + let userid = wx.getStorageSync('jstrip_userid') + new QRCode('myQrcode', { + text: 'https://m.cloud.sz-trip.com/FoodShopDetail?id=' + that.data.info.id + '&sharedUserId=' + userid + '&channel=-1', + width: 500, + height: 500, + padding: 12, // 生成二维码四周自动留边宽度,不传入默认为0 + correctLevel: QRCode.CorrectLevel.H, // 二维码可辨识度 + callback: (res) => { + resolve(res); + } + }) + }) + //成功得到图片信息后,开始绘图 + Promise.all([promise2, promise3]).then(imgs => { + ctx.save(); + ctx.beginPath(); //开始绘制 + that.handleBorderRect(ctx, 0, 0, 551 * ratio, 407 * ratio, 25 * ratio, '#ccc') + ctx.clip(); //画好了圆 剪切 原始画布中剪切任意形状和尺寸。一旦剪切了某个区域,则所有之后的绘图都会被限制在被剪切的区域内 这也是我们要save上下文的原因 + ctx.drawImage(imgs[0].path, 0, 0, 551 * ratio, 407 * ratio); + ctx.restore(); + ctx.save(); + that.handleBorderRect2(ctx, 0, 407 * ratio, 551 * ratio, 236 * ratio, 25 * ratio, '#fff') + ctx.restore(); + // 绘制二维码 + ctx.drawImage(imgs[1].path, 373 * ratio, 495 * ratio, 137 * ratio, 137 * ratio); + // 开始文字绘制 + ctx.setFillStyle("#000"); + ctx.setFontSize(30 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + that.drawText(ctx, that.data.info.title, 25 * ratio, 450 * ratio, 480 * ratio, ratio); + // 售价 + ctx.setFillStyle("#D62828"); + ctx.setFontSize(40 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + let price = "¥" + (that.data.info.price / 100); + let width = ctx.measureText(price).width; + ctx.fillText(price, 25 * ratio, 620 * ratio); + // 副标题 + ctx.setFillStyle("#999999"); + ctx.setFontSize(28 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + let subtitle = that.data.info.subtitle; + if (that.data.info.subtitle.length > 10) { + subtitle = that.data.info.subtitle.substr(0, 10) + '...' + } + ctx.fillText(subtitle, 25 * ratio, 540 * ratio); + // ctx.draw(); + // 划线价 + ctx.setFillStyle("#999999"); + ctx.setFontSize(32 * ratio); //字大小 + ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + let market_price = "¥" + (that.data.info.market_price / 100) + ctx.fillText(market_price, 40 * ratio + width, 620 * ratio); + let market_price_width = ctx.measureText(market_price).width; + // 划线 + ctx.beginPath() + ctx.setLineWidth(1) + ctx.moveTo(40 * ratio + width, 608 * ratio) + ctx.lineTo(45 * ratio + width + market_price_width, 608 * ratio) + ctx.stroke(); + // 长按识别二维码 + // ctx.setFillStyle("#666"); + // ctx.setFontSize(22 * ratio); //字大小 + // ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + // ctx.fillText("长按识别二维码", 404*ratio, 710*ratio); + // 长按图片转发或保存 + // ctx.setFillStyle("#000"); + // ctx.setFontSize(24 * ratio); //字大小 + // ctx.setTextAlign('left'); //是否居中显示,参考点画布中线 + // ctx.fillText("长按图片保存到本地",(592*ratio - ctx.measureText("长按图片保存到本地").width)/2, 740*ratio); + ctx.draw(); + // 转为图片 + setTimeout(() => { + wx.canvasToTempFilePath({ + x: 0, + y: 0, + canvasId: 'imageCanvas', + success: function (res) { + that.setData({ + shareImg: res.tempFilePath + }) + }, + fail(err) { + console.log('agdgjgdajhg', err) + } + }) + }, 500) + return false; + }).catch(err => { + console.log("this err", err) + }) + }, + // 圆角矩形 + handleBorderRect(ctx, x, y, w, h, r, color) { + ctx.beginPath(); + ctx.moveTo(x + w, y + h); + ctx.lineTo(x, y + h) + // 左上角 + ctx.arc(x + r, y + r, r, Math.PI, 1.5 * Math.PI); + ctx.moveTo(x + r, y); + ctx.lineTo(x + w - r, y); + ctx.lineTo(x + w, y + r); + // 右上角 + ctx.arc(x + w - r, y + r, r, 1.5 * Math.PI, 2 * Math.PI); + ctx.lineTo(x + w, y + h); + ctx.lineTo(x + w - r, y + h); + ctx.fillStyle = color; + ctx.fill(); + ctx.closePath(); + }, + handleBorderRect2(ctx, x, y, w, h, r, color) { + ctx.beginPath(); + ctx.moveTo(x, y); + ctx.lineTo(x + w, y) + // 右下角 + ctx.arc(x + w - r, y + h - r, r, 0, 0.5 * Math.PI); + ctx.lineTo(x + r, y + h); + ctx.lineTo(x, y + h - r); + // 左下角 + ctx.arc(x + r, y + h - r, r, 0.5 * Math.PI, Math.PI); + ctx.lineTo(x, y); + ctx.lineTo(x, y); + ctx.fillStyle = color; + ctx.fill(); + ctx.closePath(); + }, + // 绘制两行文字 + drawText: function (ctx, str, x, y, canvasWidth, ratio) { + let row = [], + temp = "", + chr = str.split(""); + for (var a = 0; a < chr.length; a++) { + if (ctx.measureText(temp).width < canvasWidth) { + temp += chr[a]; + } else { + a--; //这里添加了a-- 是为了防止字符丢失,效果图中有对比 + row.push(temp); + temp = ""; + } + } + row.push(temp); + + //如果数组长度大于2 则截取前两个 + if (row.length > 2) { + var rowCut = row.slice(0, 2); + var rowPart = rowCut[1]; + var test = ""; + var empty = []; + for (var a = 0; a < rowPart.length; a++) { + if (ctx.measureText(test).width < canvasWidth - 30 * ratio) { + test += rowPart[a]; + } else { + break; + } + } + empty.push(test); + var group = empty[0] + "..." //这里只显示两行,超出的用...表示 + rowCut.splice(1, 1, group); + row = rowCut; + } + for (var b = 0; b < row.length; b++) { + ctx.fillText(row[b], x, y + b * 40 * ratio, canvasWidth); + } + }, + gotoDetail: function (e) { + let item = e.currentTarget.dataset.item; + pagePoint({ + event: 'recommend_click', + param: { + id: item.id, + type: item.type + } + }, 1) + if (item.type == 'travels') { + // 游记做特殊处理 其他都按照原来的来 + wx.navigateTo({ + url: '/pages/info/strategyInfo/index?id=' + item.s_id, + }) + } else { + gotoDetail(item); + } + }, + + gotolocation: function () { + let info = this.data.supplierInfo; + wx.openLocation({ + latitude: Number(info.lat), + longitude: Number(info.lon), + name:info.shop_name, + address:info.address + }) + }, + + callPhone :function () { + wx.makePhoneCall({ + phoneNumber: this.data.prod_phone, + }) + }, + + viewImg:function(e){ + let item = e.currentTarget.dataset.item; + if (item.img_list.length>0) { + wx.previewImage({ + urls: item.img_list + }) + } + }, + + swiperChange (e) { + if(e.detail.source == "touch") { + let index = e.detail.current + this.setData({ + swiperCurrent: index + }) + } + console.log(e, this.data.swiperCurrent) + }, + changeSwiperCurrent (e) { + let index = e.currentTarget.dataset.index + this.setData({ + swiperCurrent: index + }) + }, + changeSimpleVal (e) { + let keyname = e.currentTarget.dataset.keyname; + let val = e.currentTarget.dataset.val; + let param = {} + param[keyname] = val + this.setData(param) + console.log(this.data) + }, + + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + app.globalData.postProduct = [] + if (!wx.getStorageSync('jstrip_token')) { + return; + } + + commonApi.user_post('cart/get_count', {noLogin: true}).then(res => { + this.setData({ + cartCount: res.data //1 + }) + }) + + }, + playVideo() { + // 播放视频需要把autoplay暂停 + this.setData({ + autoPlay: false + }) + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + } +}) \ No newline at end of file diff --git a/subPackages/foodNew/index.json b/subPackages/foodNew/index.json new file mode 100644 index 0000000..2e64977 --- /dev/null +++ b/subPackages/foodNew/index.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader", + "code":"/pages/order/components/wxqrCode/index" + } +} \ No newline at end of file diff --git a/subPackages/foodNew/index.wxml b/subPackages/foodNew/index.wxml new file mode 100644 index 0000000..46f0ced --- /dev/null +++ b/subPackages/foodNew/index.wxml @@ -0,0 +1,290 @@ + + + + + + + + {{supplierInfo.shop_name}} + + + + + {{supplierInfo.address}} + + + + + + + + + + + {{item.subtitle}} + + + + + + + + + + + + + + + + + + + + + + + + {{item.sku_name}} + + + + + + + {{swiperCurrent+1}}/{{swiperRange.sku.max+1}} + + + + + + + + + {{info.price/100}}优惠前¥{{info.market_price/100}} + 已售{{info.sales_number>1000?"1000+":(info.sales_number||0)}} + + + + {{info.title}} + + {{info.subtitle}} + + + + + + {{info.shipment_tag_str}} + + + + + {{info.service_tag_str}} + + + + + {{info.parameter_tag_str}} + + + + + + + + + + + + + 套餐详情 + + + + + + + 购买须知 + + + + + + + + + + + + 客服 + + + + + + + + 加入购物车 + 立即购买 + 该商品已下架 + + + + + + {{cartCount}} + + + + + + + + + + {{info.sku[skuIndex].price/100}} + + + 已选择:{{info.sku[skuIndex].sku_name}} + + + + + {{producNum}} + + + 限购{{info.sku[skuIndex].sku_model.traveller_limit_num}}件 + + + + 产品分类({{info.sku.length}}) + + + + {{item.sku_name}} + + + + + + + {{skuFlag=='cart'?'确认':'立即购买'}} + + 该商品已下架 + + + + + + + + + + + + + + + + + + + + + + + {{otherInfoShow==3?"产品参数":otherInfoShow==2?"服务说明":"发货说明"}} + + + + + + + + + + + + + 确定 + + + + + + + + + + + 商家信息 + + {{supplierInfo.shop_name}} + + + + 营业时间 + {{supplierInfo.business_hours}} + + + + + + {{supplierInfo.address}} + 据您约{{supplierInfo.distance}}km + + + + + + + + 商家介绍 + + + + \ No newline at end of file diff --git a/subPackages/foodNew/index.wxss b/subPackages/foodNew/index.wxss new file mode 100644 index 0000000..1714e91 --- /dev/null +++ b/subPackages/foodNew/index.wxss @@ -0,0 +1,1374 @@ +/* pages/info/hotelProductInfo/index.wxss */ +page { + background: #F7F7F7; +} + +.shop-info{ + display: flex; + align-items: center; + justify-content: space-between; + background: white; + padding:30rpx 28rpx; + box-sizing: border-box; + word-break: break-all; +} +.shop-info .supplier-headImg{ + width: 113rpx; + height: 113rpx; + background: #BCBCBC; + border-radius: 13rpx; + flex-shrink: 0; +} +.shop-info .content{ + flex: 1; + height: 113rpx; + width: 1rpx; + padding-left: 12rpx; + font-weight: bold; + font-size: 31rpx; + color: #010101; + display: flex; + flex-direction: column; + justify-content: space-between; +} +.shop-info .content .address{ + font-weight: 500; + font-size: 24rpx; + color: #999999; +} +.shop-info .icon-phone{ + width: 47.33rpx; + height: 46.67rpx; + flex-shrink: 0; +} +.shop-info .shop-com-width{ + width: 100rpx; + flex: 1; +} + +.swiper { + width: 100%; + height: 466.67rpx; +} +.swiper image,.swiper video { +height: 466.67rpx; + display: block; + width: 100%; +} +.swiper-bottom{ + position: absolute; + /* top: 750rpx; */ + bottom: 77rpx; + right: 0; + width: 90rpx; + height: fit-content; + display: flex; + flex-direction: column; + align-items: center; + font-weight: 500; + font-size: 24rpx; + color: rgba(255,255,255,0.5); + z-index: 1; +} +.swuper-bottom-bg{ + background: rgba(1, 0, 0, 0.6); + border-radius: 20rpx 0rpx 0rpx 20rpx; + display: flex; + flex-direction: column; + width: 100%; + padding: 8rpx 0; + margin-bottom: 12rpx; +} +.swiper-bottom-item{ + width: 100%; + text-align: center; + padding: 14rpx 0; +} +.swiper-bottom-item.active{ + color: #fff; +} +.swiper-bottom-item.bottom-number{ + max-width: 100%; + width: fit-content; + background: rgba(1, 0, 0, 0.6); + border-radius: 13rpx; + height: 40rpx; + line-height: 40rpx; + padding: 0 10rpx; + overflow: hidden; + box-sizing: border-box; +} + +.top-info { + background: white; + position: relative; + z-index: 1; +} + +.top-info .title { + font-weight: bold; + font-size: 33rpx; + color: #000000; +} + +.tags-box { + display: flex; + align-items: center; + font-weight: 500; + font-size: 25rpx; + color: #0B898E; +} + +.tags-box .tag { + margin-top: 27rpx; + height: 40rpx; + line-height: 40rpx; + margin-right: 15rpx; + padding: 0 14rpx; + background: rgba(11, 137, 142, 0.1); + border-radius: 4rpx; +} + +.address-box { + justify-content: space-between; + margin-top: 0; +} + +.info-address { + color: #666; + font-size: 27rpx; + margin-bottom: 0rpx; + height: 30rpx; + line-height: 30rpx; +} + +.address-box .iconfont { + font-size: 34rpx; +} + +.date-all-box { + margin: 24rpx 20rpx; + display: flex; + justify-content: space-between; + align-items: center; + height: 80rpx; + border-radius: 13rpx; + background: #0B898E; + font-size: 31rpx; + color: #fff; + font-weight: 500; + padding: 0 37rpx; +} + +.days { + text-align: center; + font-size: 400; + width: 84rpx; + line-height: 34rpx; + height: 34rpx; + border-radius: 18rpx; + border: 1px solid white; + font-size: 23rpx; +} + +.picker text { + font-weight: 400; + font-size: 21rpx; + margin-left: 13rpx; +} + +.product-item { + display: flex; + align-items: flex-end; + justify-content: space-between; + margin: 20rpx; + padding: 24rpx 20rpx; + background: white; + border-radius: 13rpx; +} + +.product-item image { + width: 201rpx; + height: 201rpx; + border-radius: 10rpx; + margin-right: 26rpx; + flex-shrink: 0; +} + +.product-item .product-info { + flex: 1; +} + +.product-item .product-info .title { + font-size: 32rpx; + color: #000; + font-weight: 500; +} + +.product-right { + flex-shrink: 0; + margin-left: 20rpx; +} + +.product-right .price { + color: #D62828; + font-size: 40rpx; + font-weight: 500; +} + +.product-right .price::before { + content: "¥"; + font-size: 27rpx; + font-weight: 400; +} + +.product-right .btn { + color: #fff; + width: 120rpx; + line-height: 80rpx; + background: #D62828; + border-radius: 13rpx; + font-size: 31rpx; + font-weight: 500; + text-align: center; + margin-top: 20rpx; +} + +.product-info .subtitle { + font-size: 24rpx; + line-height: 36rpx; + height: 72rpx; + margin-top: 10rpx; + margin-bottom: 20rpx; + color: #999; + white-space: normal; +} + +.product-tags { + display: flex; + align-items: center; +} + +.product-tag { + font-size: 20rpx; + color: #0B898E; + border-radius: 16rpx; + line-height: 30rpx; + border: 1rpx solid; + padding: 0 15rpx; + margin-right: 13rpx; +} + +.product-tags .product-tags:last-child { + margin-right: 0; +} + +.box { + /* margin: 20rpx; */ + /* background: white; */ + /* border-radius: 13rpx; */ + background: #f2f2f2; + padding: 20rpx; +} +.comment-box{ + background: #fff; + margin: 20rpx 0; + width: 100%; + box-sizing: border-box; +} +.comment-box .no-comment{ + font-weight: 500; + font-size: 30rpx; + color: #999999; + padding-left: 18rpx; +} + +.box-top { + line-height: 95rpx; + border-bottom: 1rpx solid #d9d9d9; + font-weight: 500; + color: #000; + font-size: 33rpx; + padding: 0 20rpx; + background: #fff; + border-radius: 13rpx 13rpx 0 0; +} + +.box-top .iconfont { + color: #0B898E; + font-size: 33rpx; + margin-right: 16rpx; +} + +.empty-box { + text-align: center; + padding: 40rpx 0; + font-size: 23rpx; + color: #333; + background: #fff; + border-radius: 0 0 13rpx 13rpx; +} + +.empty-btn { + margin: 0 auto; + margin-top: 30rpx; + width: 283rpx; + line-height: 79rpx; + border: 1rpx solid #0B898E; + border-radius: 39rpx; + color: #0B898E; + font-size: 32rpx; + margin-bottom: 10rpx; +} + +.box-top .score { + color: #D62828; + font-size: 30rpx; + font-weight: 400; + margin-left: 11rpx; +} + +.product-comment { + /* margin: 0 20rpx; */ + border-bottom: 1rpx solid #ccc; + /* padding: 33rpx 0; */ + padding: 28rpx 0rpx; + background: #fff; + width: 100%; + box-sizing: border-box; +} +.product-comment:last-of-type{ + border-bottom: none; +} + +.product-comment-top { + display: flex; + justify-content: space-between; + color: #999999; + align-items: flex-start; + font-size: 24rpx; +} + +.product-comment-top .avator-img { + flex-shrink: 0; + width: 57rpx; + height: 57rpx; + border-radius: 50%; +} +.product-comment-top .comment-container{ + flex: 1; + width: 10rpx; + padding: 0 45rpx 0 15rpx; +} +.product-comment-top .comment-info { + width: 100%; + height: 57rpx; + font-weight: bold; + font-size: 24rpx; + color: #666666; + display: flex; + align-items: center; +} + +.product-comment-top .comment-info .iconfont { + color: #D62828; + font-size: 22rpx; +} + +.product-comment-top .comment-info .iconfont text { + margin-right: 6rpx; +} + +.comment-content { + width: 100%; + padding-top: 12rpx; + font-size: 27rpx; + color: #000; + font-weight: 500; +} + +.more-comment-btn { + line-height: 93rpx; + /* margin-right: 20rpx; */ + text-align: right; + color: #999; + font-size: 27rpx; + font-weight: 500; + padding-right: 20rpx; + background: #fff; + border-radius: 0 0 13rpx 13rpx; +} + +.more-comment-btn .iconfont { + margin-left: 6rpx; + font-size: 24rpx; +} + +.all-comment-num { + float: right; + color: #999999; + font-size: 27rpx; + font-weight: 400; +} + +.scroll-all-box { + margin: 24rpx 0; + background: white; +} + +.scroll-menus { + display: flex; + height: 100rpx; + background: #FFFFFF; + font-weight: 500; + font-size: 31rpx; + color: #000000; + box-sizing: border-box; +} + +.scroll-menu-item { + position: relative; + padding: 0 34rpx; + height: 100rpx; + box-sizing: border-box; + padding-top: 20rpx; + flex-shrink: 0; +} +.scroll-menu-item.active{ + color: #0B898E; +} + +.scroll-menu-item.active::after { + content: "1"; + font-size: 0; + display: block; + position: absolute; + width: 46rpx; + height: 6rpx; + border-radius: 3rpx; + background: #0B898E; + left: 50%; + margin-left: -23rpx; + bottom: 20rpx; +} + +.fixed-menus { + position: fixed; + left: 0; + right: 0; + background: white; + z-index: 5; +} + +.info-title { + font-size: 35rpx; + font-weight: bold; + color: #000; + margin-bottom: 30rpx; +} + +.info-box { + padding: 20rpx 40rpx; +} + +.fixed-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + height: 140rpx; + background: white; + display: flex; + align-items: center; + box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); + padding: 0 40rpx; + color: #666666; + font-size: 23rpx; + justify-content: space-between; + text-align: center; + padding-left: 0; + z-index: 10; +} + +.fixed-bottom .iconfont { + font-size: 34rpx; + line-height: 40rpx; +} + +.btns { + color: #fff; + font-size: 32rpx; + font-weight: 500; + border-radius: 39rpx; + text-align: center; + display: flex; + align-items: center; + justify-content: center; +} + +.btns .btn { + width: 216rpx; + line-height: 78rpx; + background: #D62828; +} + +.btns .btn:nth-child(1) { + /* margin-right: 3rpx; */ + border-radius: 39rpx 0 0 39rpx; + background: #FD7601; +} + +.btns .btn:nth-child(2) { + border-radius: 0 39rpx 39rpx 0; +} + +.btns .btn.disable { + background: #ccc; +} + +.mask-content { + position: absolute; + left: 0; + right: 0; + bottom: 0; + width: 100%; +} + +.mask-content .icon-close { + position: absolute; + right: 40rpx; + top: 40rpx; +} + +.sku-info-box { + margin: 50rpx 25rpx; + display: flex; + justify-content: space-between; +} + +.sku-info-box image { + width: 173rpx; + height: 173rpx; + border-radius: 13rpx; + display: block; + margin-right: 15rpx; + flex-shrink: 0; +} + +.sku-info { + flex: 1; + width: 100rpx; + height: 173rpx; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.sku-price { + font-size: 40rpx; + font-weight: bold; + color: #F84A56; +} + +.sku-price::before { + content: "¥"; + font-size: 24rpx; + vertical-align: baseline; +} + +.sku-price view { + font-size: 24rpx; + color: #FFFFFF; + background-color: #D62828; + border-radius: 22rpx; + line-height: 44rpx; + margin-left: 7rpx; + padding: 0 20rpx; +} + +.sku-name { + font-size: 27rpx; + color: #666666; +} + +.sku-names { + display: flex; + font-weight: 500; + font-size: 27rpx; + color: #333333; + margin: 0 25rpx; + flex-wrap: wrap; + margin-bottom: 20rpx; + justify-content: space-between; + max-height: 800rpx; + min-height: 400rpx; + align-content: flex-start; +} + +.sku-name-item { + min-height: 67rpx; + border-radius: 13rpx; + margin-bottom: 34rpx; + max-width: 100%; + padding-right:15rpx; + min-width: 340rpx; + background: #EFEFEF; + display: flex; + align-items: center; + box-sizing: border-box; +} +.sku-name-item>image{ + width: 67rpx; + height: 100%; + border-radius: 13rpx; + flex-shrink: 0; +} +.sku-name-item .sku-name{ + flex:1; + /* width: 100rpx; */ + padding-left: 15rpx; + color: #333; +} + +.sku-name-item.active{ + color: #0B898E; + border: 1px solid #0B898E; + background: rgba(11, 137, 142, 0.1); +} +.sku-name-item.active .sku-name{ + color: #0B898E; + } + +.number-box { + display: flex; + align-items: center; + justify-content: space-between; + background: #EFEFEF; +border-radius: 13rpx; +padding: 10rpx 0; +box-sizing: border-box; +height: 53rpx; +width: 250rpx; + +} + +.number-box text { + flex: 1; + font-size: 29rpx; + color: #333; +} + +.number-box view { + text-align: center; + width: 80rpx; + height: 33rpx; + line-height: 33rpx; + font-size: 31rpx; + color: #000; +} + +.number-box view.number { + width: 94rpx; + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; +} +.limit-number{ + font-weight: 500;font-size: 27rpx;color: #666666;padding-left:20rpx; +} + +.btn-box { + height: 138rpx; + background: #FFFFFF; + box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1); + display: flex; + align-items: center; + justify-content: center; + position: fixed; + left: 0; + right: 0; + bottom: 0; +} + +.mask-btn { + width: 670rpx; + line-height: 78rpx; + background: #D62828; + border-radius: 39rpx; + color: #fff; + text-align: center; + font-size: 33rpx; + font-weight: 500; +} + +.mask-btn.disable { + background: #ccc; +} + +/* .icon-xin,.icon-shoucang { + position: absolute; + right: 20rpx; + margin-top: 20rpx; + width: 60rpx; + line-height: 60rpx; + background: rgba(0, 0, 0, 0.4); + border-radius: 50%; + text-align: center; + color: #fff; + font-size: 36rpx; + z-index: 1; +} */ +.share-icon { + position: absolute; + right: 20rpx; + margin-top: 20rpx; + width: 60rpx; + height: 60rpx; + z-index: 1; + background-image: url("https://static.ticket.sz-trip.com/uploads/20250826/81287df192b80ea03318e06b2b19ebe1.png"); + background-size: 100% 100%; +} + +.icon-shoucang { + color: #D62828; + font-size: 40rpx !important; + +} + +/* 购物车 */ +.cart-box { + position: fixed; + display: flex; + align-items: center; + justify-content: center; + width: 80rpx; + height: 80rpx; + background: #FFFFFF; + box-shadow: 0px 0px 20rpx 0px rgba(0, 0, 0, 0.2); + border-radius: 50%; + right: 20rpx; + bottom: 166rpx; + z-index: 15; +} + +.cart-box image { + display: block; + width: 49rpx; +} + +.cart-num { + width: 26rpx; + border: 1rpx solid; + border-radius: 50%; + line-height: 26rpx; + text-align: center; + font-size: 23rpx; + color: #D20000; + position: absolute; + right: -2rpx; + top: -5rpx; +} + +.headimg { + position: fixed; + z-index: 3; + left: -218rpx; + width: 218rpx; + height: 180rpx; + top: 0; +} + +.headimg.active { + transition: left .6s linear, top .6s cubic-bezier(0.5, -0.5, 1, 1), width .6s ease, height .6s ease; + width: 80rpx; + height: 80rpx; + left: 650rpx; + border-radius: 50%; +} + +.share-img-box { + /* width: 551rpx; */ + position: static; + background: none; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.share-img { + display: block; + width: 551rpx; +} + +.share-tips { + width: 426rpx; + height: 150rpx; + background: #FFFFFF; + border-radius: 25rpx; + margin-top: 25rpx; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 65rpx; + color: #999; + font-size: 24rpx; + text-align: center; + line-height: 40rpx; +} + +.share-tips .img { + display: block; + width: 55rpx; + margin: 0 auto; + margin-bottom: 4rpx; +} + +.tipimg { + position: absolute; + left: 50%; + margin-left: 16rpx; + width: 24rpx; + height: 24rpx; + background: #D62828; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + top: 34rpx; +} + +.tipimg image { + width: 21rpx; + display: block; + +} + +.save-btn { + width: 403rpx; + line-height: 77rpx; + background: #D62828; + border-radius: 39rpx; + text-align: center; + color: #fff; + font-size: 31rpx; + font-weight: 500; + margin-top: 50rpx; +} + +.allowance-box { + height: 113rpx; + background: url("https://static.ticket.sz-trip.com/uploads/20220602/7762b9c4be5adac1f3d0ab5228569821.png"); + background-size: 100% auto; + background-repeat: no-repeat; + padding: 30rpx 30rpx 10rpx; + font-size: 24rpx; + color: #FFFFFF; + margin-top: -60rpx; + position: relative; + display: flex; + justify-content: start; + align-items: baseline; +} + +.allowance-box .com-price { + font-size: 30rpx; + color: #FFFFFF; +} + +.allowance-box .com-price:before { + font-size: 18rpx; + color: #FFFFFF; +} + +.allowance-box .com-price:after { + font-size: 18rpx; + color: #FFFFFF; +} + +.allowance-box .yellow { + color: #DF2115; + padding: 8rpx 14rpx; + background-color: #FDEDD4; + margin-left: 20rpx; + border-radius: 30rpx; +} + +.mask-allowance .mask-content { + margin: auto; + width: auto; + top: initial; + bottom: initial; + padding: 20rpx; + width: 80%; +} + +.mask-allowance .mask-content .rule-title { + text-align: center; + margin-bottom: 20rpx; +} +.imgs{ + width: 133rpx; + height: 133rpx; + border-radius: 13rpx; +} +.img-box{ + width: 133rpx; +height: 133rpx; + position: relative; + overflow: hidden; +} +.img-box .more-img{ + height: 37rpx; + line-height: 37rpx; + background: #000; + border-radius: 13rpx 0rpx 13rpx 0rpx; + box-sizing: border-box; + padding: 0 5rpx; + font-weight: 500; + font-size: 23rpx; + color: #FFFFFF; + position: absolute; + bottom: 0; + right: 0; + opacity: 0.8; +} +.all{ + color: #fff; + position:absolute; + bottom: 17rpx; + right: 10rpx; + width: 200rpx; + height: 200rpx; + border-radius: 8rpx; + background-color: rgba(0, 0, 0, .5); +} +.all view{ + text-align: center; +} +.all view:first-child{ + font-size: 45rpx; + margin-top: 40rpx; +} +.all view:last-child{ + margin-top: 10rpx; +} +.sku{ + margin-left: 10rpx; + color: #666; + font-size: 24rpx; + margin-top: 8rpx; +} +.proad{ + margin: 20rpx; +} +.proad-title{ + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 16rpx; +} +.proad-title image{ + width: 292rpx; + height: 34rpx; +} +.pro-list{ + display: flex; + justify-content: space-between; + align-items: center; + flex-wrap: wrap; +} +.proitem{ + width: 334rpx; + height: 497rpx; + background: #FFFFFF; + border-radius: 10rpx; + margin-top: 20rpx; +} +.item-hd image{ + width: 334rpx; + height: 342rpx; + border-radius: 13rpx 13rpx; +} +.item-bm{ + padding: 8rpx 12rpx; +} +.protitle{ + font-size: 28rpx; + font-family: PingFang SC; + font-weight: 400; + color: #000000; +} +.pro-price{ + color: #D62828; + font-weight: 500; + font-size: 30rpx; +} +.pro-price:before { + display: inline-block; + content:"¥"; + color: #D62828; + font-size: 20rpx; +} + +.pro-price:after { + display: inline-block; + content:'起'; + color: #999999; + font-size: 10px; +} +.icon-shop{ + width: 34rpx; + height: 36rpx; +} +.left-img{ + display: flex; + width: 290rpx; + flex-shrink: 0; + justify-content: space-between; + padding: 0 40rpx; + box-sizing: border-box; +} +.no-shop{ + width: 230rpx; +} +.shop-box{ + display:flex; + flex-direction: column; + align-items: center; + justify-content: space-between; + height: 70rpx; +} + + .wineScene-price-container { + width: 750rpx; + height: 100rpx; + /* background: linear-gradient(-90deg,#FF413B, #FFAB2E); */ + background: #FD3856; + /* border-radius: 20rpx 20rpx 0rpx 0rpx; */ + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 26rpx; + box-sizing: border-box; + color: #FFFFFF; + font-size: 24rpx; + } + + .wineScene-price-container .wineSecne-price { + font-weight: bold; + font-size: 48rpx; + color: #FFFFFF; +} +.wineScene-price-container .wineSecne-money { + font-size: 24rpx; + font-weight: 500; + /* text-decoration-line: line-through; */ + padding-left: 14rpx; +} +.wineScene-price-container .wineSecne-price::before { + font-size: 24rpx; + content: '¥'; +} + +.hotel-custom-detail{ + display: flex; + /* justify-content: space-between; */ + height: fit-content; + font-family: PingFang SC; + font-weight: 500; + font-size: 24rpx; + color: #666666; + margin-bottom: 20rpx; +} +.hotel-custom-detail .tip-info{ + width: 33rpx; + position: relative; + display: flex; + justify-content: center; + flex-shrink: 0; +} +.hotel-custom-detail .tip-info .tip{ + font-family: PingFang SC; + font-weight: 500; + font-size: 23rpx; + color: #FFFFFF; + width: 33rpx; + height: 33rpx; + background: #6394FD; + border-radius: 50%; + position: absolute; + top: 0; + left: 0; + text-align: center; + line-height: 33rpx; +} +.hotel-custom-detail .tip-info .info{ + width: 11rpx; + height: 100%; + background: #D0DFFE; + border-radius: 5rpx; +} + +.hotel-custom-right>view{ + margin-bottom: 20rpx; +} +.hotel-custom-right>view:last-of-type{ + margin-bottom: 0; +} +.map-container{ + background-image: url('https://static.ticket.sz-trip.com/jundaosuzhou/images/wineScene/locationBg.png'); + background-size: 100% 100%; + width: 100%; + height: 128rpx; + padding: 30rpx 26rpx; + display: flex; + align-items: center; + justify-content: space-between; + font-family: PingFang SC; + font-weight: 500; + font-size: 24rpx; + color: #666666; + box-sizing: border-box; +} +.map-container image{ + width: 29rpx; + height: 29rpx; +} + +.select-img{ + display: flex; + height: 80rpx; + position: relative; + margin-bottom: 26rpx; +} +.select-img image{ + width: 80rpx; + height: 80rpx; + border-radius: 13rpx; + margin-right:20rpx; + flex-shrink: 0; + box-sizing: border-box; +} +.select-img image.active{ + border: 2px solid #DC2525; +} +.select-img image.no-stock{ + border: none; + opacity: 0.5; +} +.select-img .select-img-text{ + font-weight: bold; + font-size: 24rpx; + color: #000000; + width: 51rpx; + height: 80rpx; + margin-right:20rpx; + display: flex; + align-items: center; +} +.select-img .other-imgs{ + flex: 1; + width: 100rpx; + overflow-x: auto; + display: flex; +} +.select-img .select-sku{ + position: absolute; + top: 0; + right: 0; + width: 25rpx; + height: 80rpx; + line-height: 80rpx; + text-align: center; + background: white; + font-family: fangsong; + color: #999; +} +.sku-tips{ + width: 100%; + position: absolute; + bottom: 73rpx; + left: 0; + right: 0; + display: flex; + justify-content: center; +} +.sku-tips>view{ + width: fit-content; + max-width: 533rpx; + height: 53rpx; + background: rgba(1, 0, 0, 0.6); + border-radius: 27rpx; + padding: 0 28rpx; + line-height: 53rpx; + font-weight: 500; + font-size: 24rpx; + color: #FFFFFF; + margin: 0 auto; +} + +.shop-container{ + display: flex; + align-items: center; + margin-top: 20rpx; + padding: 32rpx 23rpx; + width: 100%; + background: white; + box-sizing: border-box; +} +.shop-container .shop-img{ + width: 113rpx; + height: 113rpx; + flex-shrink: 0; +} +.shop-container .shop-btn{ + width: 135rpx; +height: 57rpx; +border-radius: 13rpx; +border: 1px solid #0B898E; +font-weight: 500; +font-size: 31rpx; +color: #0B898E; +text-align: center; +line-height: 57rpx; +flex-shrink: 0; +} +.shop-container .textOver2{ + flex: 1; + width: 100rpx; + padding: 0 50rpx 0 20rpx; + font-weight: bold; +font-size: 32rpx; +color: #010101; +} + + + +.other-info-box{ +} +.other-info-box .other-info-item{ + display: flex; + align-items: center; + font-weight: 500; + font-size: 27rpx; + color: #666666; + margin-top: 30rpx; +} +.other-info-box .other-info-item image{ + width: 32rpx; + height: 32rpx; + flex-shrink: 0; +} +.other-info-box .view-arrow{ + font-family: fangsong; + color: #999; + width: 25rpx; + flex-shrink: 0; +} +.other-info-box .other-content{ + padding: 0 20rpx; + overflow: hidden; + flex: 1; + width: 100rpx; + +} + +.other-info-content{ + min-height: 600rpx; + padding: 32rpx 23rpx; +} +.other-info-content .title{ + font-weight: bold; + font-size: 33rpx; + color: #060001; + text-align: center; + margin-bottom: 36rpx; +} +.other-info-content .key-title{ + color: #060001; + font-size: 27.67rpx; + line-height: 40rpx; + font-weight: bold; +} +.other-info-content .key-content{ + color: #666; + font-size: 27.67rpx; + line-height: 40rpx; + margin-top: 6rpx; +} +.prod-param{ + display: flex; + align-items: flex-start; + margin-bottom: 45rpx; +} +.prod-param .prod-key{ + flex: 1; + flex-shrink: 0; + font-weight: 500; + font-size: 27rpx; + color: #666666; +} +.prod-param .prod-content{ + flex: 1; + flex-shrink: 0; + font-weight: 500; +font-size: 27rpx; +color: #000000; +} + +.supplier-mask{ + min-height: 800rpx; + display: flex; + flex-direction: column; +} +.supplier-mask .supplier-mask-header{ + padding: 28rpx 26rpx; + font-weight: bold; + font-size: 31rpx; + color: #000000; +} +.mask-shop-info{ + padding: 0 26rpx; + font-weight: 500; + font-size: 31rpx; + color: #000000; +} +.shop-info-item{ + display: flex; + align-items: flex-start; + font-weight: 500; + font-size: 26rpx; + color: #000000; + padding: 20rpx 0; + word-wrap: break-all; +} +.shop-info-item .start-icon{ + width: 28rpx; + height: 28rpx; + margin: 4rpx 8rpx 0 0; + flex-shrink: 0; +} +.shop-info-item .subtitle{ + font-weight: 500; + font-size: 24rpx; + color: #666666; + margin-top: 26rpx; +} +.shop-info-item .icon-phone{ + width: 56rpx; + height: 56rpx; + margin-left: 40rpx; +} +.hot-font{ + width: 31rpx; + height: 31rpx; + background: linear-gradient(-30deg, #FF4000, #FF8D23); + border-radius: 7rpx; + text-align: center; + line-height: 31rpx; + font-weight: 500; +font-size: 23rpx; +color: #FFFFFF; +display: inline-block; +margin-right: 10rpx; +} \ No newline at end of file diff --git a/subPackages/gwcOrder/index.js b/subPackages/gwcOrder/index.js index 6d4ea30..5f410db 100644 --- a/subPackages/gwcOrder/index.js +++ b/subPackages/gwcOrder/index.js @@ -57,7 +57,7 @@ Page({ ticket_type:app.globalData.product.sku.ticket_type || 1, isCar:options.isCar, is_need_idcard:app.globalData.product.sku.sku_model.is_need_idcard, - is_authentication:app.globalData.product.sku.sku_model.is_authentication, + is_authentication:app.globalData.product.sku.sku_model.is_authentication || 0, is_real_name:app.globalData.product.sku.sku_model.is_real_name, }) console.log('-------',app.globalData.product.sku.sku_model.is_need_idcard); @@ -396,6 +396,9 @@ Page({ remark: remark, product_num: app.globalData.product.isGroup == 1 ? 1 : productNum, phone:this.data.phone,// 不实名的时候传的手机号参数 + // 美食类型 + reserve_mobile: product.product.type=='food'?this.data.phone:"", + }], originate_order_id: this.data.kjId, gp_id: app.globalData.gp_id, @@ -427,7 +430,7 @@ Page({ if(app.globalData.list){ app.globalData.list[app.globalData.index] = this.data.product // app.globalData.list[app.globalData.index].linkmanList = this.data.linkmanList - if (app.globalData.list[app.globalData.index].sku.sku_model.is_authentication == 0) { + if (!app.globalData.list[app.globalData.index].sku.sku_model.is_authentication) { app.globalData.list[app.globalData.index].phone = this.data.phone app.globalData.list[app.globalData.index].linkmanList = [] }else { diff --git a/subPackages/gwcOrder/index.wxml b/subPackages/gwcOrder/index.wxml index c28d857..6d08452 100644 --- a/subPackages/gwcOrder/index.wxml +++ b/subPackages/gwcOrder/index.wxml @@ -15,13 +15,14 @@ - {{product && product.isGroup!=1?'购票数量':'预约人数'}} + {{product && product.isGroup!=1?'数量':'预约人数'}} {{productNum}} - + @@ -63,7 +64,7 @@ {{product.product.title}}-{{product.sku.sku_name}} - 出行人信息 + {{product.product.type=="food"?'预定人信息':'出行人信息'}} diff --git a/utils/filter.wxs b/utils/filter.wxs index 2821b85..1e7865f 100644 --- a/utils/filter.wxs +++ b/utils/filter.wxs @@ -1,19 +1,45 @@ -var formateRichText = function(str){ - if(!str){ - return ""; +var formateRichText = function(str) { + if (!str) { + return ""; // 正确:函数内部的return } - var reg = getRegExp("') - reg = getRegExp("section","g"); - str = str.replace(reg, 'div'); - reg = getRegExp("↵","g"); - str = str.replace(reg, '
'); + + // 处理img标签 + var reg = getRegExp("'); + + reg = getRegExp("section", "g"); + str = str.replace(reg, "div"); + + reg = getRegExp("↵", "g"); + str = str.replace(reg, "
"); + return str; -} +}; + var gotoUrl = function(item){ var str = "/pages/info/" if(item.frontShowModel=='multisku'){ diff --git a/utils/util.js b/utils/util.js index 5fe8ecd..8756297 100644 --- a/utils/util.js +++ b/utils/util.js @@ -172,7 +172,7 @@ const checkLocation = function(){ }) }) } -const gotoDetail = (item,isPagePoint) =>{ +const gotoDetail = (item,isPagePoint,queryStr="") =>{ wx.removeStorageSync('prizeId'); let pagePointData = { param: { @@ -183,7 +183,7 @@ const gotoDetail = (item,isPagePoint) =>{ // 组合产品 跳线路 if (item.compose_product_id) { wx.navigateTo({ - url: '/pages/info/roadInfo/index?id='+item.compose_product_id + url: '/pages/info/roadInfo/index?id='+item.compose_product_id+queryStr }) return } @@ -191,12 +191,12 @@ const gotoDetail = (item,isPagePoint) =>{ if (item.is_package === 1) { wx.navigateTo({ - url: '/pages/info/postProductInfo/index?id='+item.id, + url: '/pages/info/postProductInfo/index?id='+item.id+queryStr, }) return }else if (item.is_package==2) { wx.navigateTo({ - url: '/subPackages/goods/oneCardTour/info/index?id='+item.scene_id + url: '/subPackages/goods/oneCardTour/info/index?id='+item.scene_id+queryStr }); return } @@ -207,7 +207,7 @@ const gotoDetail = (item,isPagePoint) =>{ case "tenscenic": wx.navigateTo({ - url: '/pages/info/foodInfo/index?id='+(item.scene_id || item.id) + url: '/pages/info/foodInfo/index?id='+(item.scene_id || item.id)+queryStr }) break; case "ticket": @@ -217,7 +217,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id) + url: '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id)+queryStr }) break; case "hotel": @@ -227,7 +227,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/hotelProductInfo/index?id='+(item.scene_id || item.id) + url: '/pages/info/hotelProductInfo/index?id='+(item.scene_id || item.id)+queryStr }) break; case "post": @@ -240,11 +240,11 @@ const gotoDetail = (item,isPagePoint) =>{ try { if (item.iShop) { wx.navigateTo({ - url: '/pages/info/postProductInfo/index?id='+item.id+'&iShop='+item.iShop+'&supplierId='+item.supplierId + url: '/pages/info/postProductInfo/index?id='+item.id+'&iShop='+item.iShop+'&supplierId='+item.supplierId+queryStr }) }else{ wx.navigateTo({ - url: '/pages/info/postProductInfo/index?id='+item.id + url: '/pages/info/postProductInfo/index?id='+item.id+queryStr }) } } catch (error) { @@ -260,7 +260,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/roadInfo/index?id='+item.id + url: '/pages/info/roadInfo/index?id='+item.id+queryStr }) break; case "coupon": @@ -271,7 +271,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/cardInfo/index?id='+item.id + url: '/pages/info/cardInfo/index?id='+item.id+queryStr }) break; case "show": @@ -282,24 +282,30 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/showInfo/index?id='+item.id + url: '/pages/info/showInfo/index?id='+item.id+queryStr }) break; case "food": // 产品 美食 wx.navigateTo({ - url: '/pages/info/foodProductInfo/index?id='+item.id + url: '/pages/info/foodProductInfo/index?id='+item.id+queryStr }) break; case "activity": // 活动 wx.navigateTo({ - url: '/pages/info/activityInfo/index?id='+(item.act_calendar_id || item.id) + url: '/pages/info/activityInfo/index?id='+(item.act_calendar_id || item.id)+queryStr }) break; + case "act_calendar": + // 活动 + wx.navigateTo({ + url: '/pages/info/activityInfo/index?id='+(item.act_calendar_id || item.id)+queryStr + }) + break; case "movie": // 产品 电影票 - let tempUrl = 'https://m.cloud.sz-trip.com'+`/MovieInfo?id=${item.third_id || item.id}`+'&title='+item.title + let tempUrl = 'https://m.cloud.sz-trip.com'+`/MovieInfo?id=${item.third_id || item.id}`+'&title='+item.title+queryStr wx.navigateTo({ url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl), // url: '/pages/list/movieticket/list/info/index?id='+(item.third_id || item.id)+'&title='+item.title @@ -308,7 +314,7 @@ const gotoDetail = (item,isPagePoint) =>{ case "cinema": // 产品 电影票 wx.navigateTo({ - url: '/pages/list/movieticket/list/cinema/index?id='+item.third_id+'&title='+item.title + url: '/pages/list/movieticket/list/cinema/index?id='+item.third_id+'&title='+item.title+queryStr }) break; case "scenic": @@ -318,7 +324,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id) + url: '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id)+queryStr }) break; case "room": @@ -328,7 +334,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/hotelProductInfo/index?id='+(item.scene_id || item.id) + url: '/pages/info/hotelProductInfo/index?id='+(item.scene_id || item.id)+queryStr }) break; case "venue": @@ -338,7 +344,7 @@ const gotoDetail = (item,isPagePoint) =>{ pagePoint(pagePointData,1) } wx.navigateTo({ - url: '/pages/info/museumInfo/index?id='+(item.scene_id || item.id) + url: '/pages/info/museumInfo/index?id='+(item.scene_id || item.id)+queryStr }) break; } @@ -386,12 +392,21 @@ const orderMoreTime = function(item){ } } const gotoOrder = function(item){ + + // 数量超过两个 购物车下单 跳H5 (小程序二维码没分开) + if (item.order_product_list.length>1) { + wx.navigateTo({ + url: "/pages/pbService/web/index?weburl=" + encodeURIComponent("https://m.cloud.sz-trip.com/TicketCartOrderDetail?order_id="+item.order_id), + }) + return; + } if(item.order_product_list[0].product_model=='ticket'){ wx.navigateTo({ url: '/pages/user/order/sceneOrderInfo/index?id='+item.order_id, }) return; } + if(item.order_product_list[0].product_model=='food'){ wx.navigateTo({ url: '/pages/user/order/foodOrderInfo/index?id='+item.order_id, @@ -745,7 +760,7 @@ const goProdInOtherPlatform = function (item) { webUrl+= `/OneCardTourDetail?id=${item.scene_id || item.id}` } - + webUrl+="&sourceFrom=recommend" wx.navigateToMiniProgram({ appId: appIdObj[platform], path: "/subPackages/webPage/webPage?url="+encodeURIComponent(webUrl),