diff --git a/pages/info/foodProductInfo/index.js b/pages/info/foodProductInfo/index.js index d1af35f..a5d0eb6 100644 --- a/pages/info/foodProductInfo/index.js +++ b/pages/info/foodProductInfo/index.js @@ -1,158 +1,890 @@ -// 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.supplier_id, + iShop: res.data.supplier_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 () { + 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 () { + 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 (this.data.skuFlag == '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) + } + }) + } + } + }) - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { + }, + // 分享 + 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..2afc10c 100644 --- a/pages/info/foodProductInfo/index.wxml +++ b/pages/info/foodProductInfo/index.wxml @@ -1,79 +1,264 @@ - + - - - - - - - - - - {{info.title}} - - {{item}} - {{info.price/100}} - + + + + + + + + + + + + + + + + + + + + {{item.sku_name}} + + + + + + + {{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}} + + {{item}} + + + + + + {{info.shipment_tag_str}} + + + + + {{info.service_tag_str}} + + + + + {{info.parameter_tag_str}} + + + + + + + + + + + + + + + + + + 套餐详情 + + + + + 购买须知 + + + + + + + + + + + + + + 店铺 + + + + 客服 + + + - - - {{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..74cd9b1 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; } + .swiper { width: 100%; - height: 400rpx; + height: 750rpx; } -.swiper image { - height: 400rpx; +.swiper image,.swiper video { + height: 750rpx; 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: 10; +} +.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,603 @@ 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; +} + +.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; + } -.tags-price text:nth-child(3){ + +.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; } -.sku-items { +.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; - 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; } -.details { - padding-bottom: 30rpx; +.prod-param .prod-content{ + flex: 1; + flex-shrink: 0; + font-weight: 500; +font-size: 27rpx; +color: #000000; } \ No newline at end of file diff --git a/pages/order/food/index.js b/pages/order/food/index.js index bd05f06..9dff63a 100644 --- a/pages/order/food/index.js +++ b/pages/order/food/index.js @@ -85,14 +85,14 @@ Page({ order:function(){ if(!this.data.user){ wx.showToast({ - title: '请输入预订人', + 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..a732f57 100644 --- a/pages/order/food/index.wxml +++ b/pages/order/food/index.wxml @@ -4,32 +4,34 @@ - {{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}} - 立即预约 + 订单金额:¥{{((product.sku.price * productNum - (coupon?coupon.activity.money:0))>0?(product.sku.price * productNum - (coupon?coupon.activity.money:0)):0) / 100}} + 提交订单 \ No newline at end of file diff --git a/pages/order/food/index.wxss b/pages/order/food/index.wxss index 37a9558..0b1e087 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,47 @@ 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; } -.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 +95,7 @@ page { flex: 1; display: block; font-size: 31rpx; - color: #666; + color: #000000; margin-left: 15rpx; font-weight: 400; }