From 6c74bc5d8e9692b5e41feb94aeaf0fd701eb3615 Mon Sep 17 00:00:00 2001 From: jiazhipeng Date: Fri, 26 Sep 2025 16:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BE=8E=E9=A3=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.json | 546 ++++---- pages/info/foodNew/index.js | 790 +++++++++++ pages/info/foodNew/index.json | 7 + pages/info/foodNew/index.wxml | 289 ++++ pages/info/foodNew/index.wxss | 1374 ++++++++++++++++++++ pages/info/foodProductInfo/index.js | 35 +- pages/info/foodProductInfo/index.wxml | 20 +- pages/info/foodProductInfo/index.wxss | 18 +- pages/list/foodNew/index.js | 194 +++ pages/list/foodNew/index.json | 5 + pages/list/foodNew/index.wxml | 48 + pages/list/foodNew/index.wxss | 156 +++ pages/order/food/index.js | 31 +- pages/order/food/index.wxml | 6 +- pages/user/order/foodOrderInfo/index.js | 86 +- pages/user/order/foodOrderInfo/index.json | 3 +- pages/user/order/foodOrderInfo/index.wxml | 98 +- pages/user/order/foodOrderInfo/index.wxss | 83 +- pages/user/order/sceneOrderInfo/index.wxml | 15 +- project.private.config.json | 23 +- utils/https.js | 4 +- 21 files changed, 3432 insertions(+), 399 deletions(-) create mode 100644 pages/info/foodNew/index.js create mode 100644 pages/info/foodNew/index.json create mode 100644 pages/info/foodNew/index.wxml create mode 100644 pages/info/foodNew/index.wxss create mode 100644 pages/list/foodNew/index.js create mode 100644 pages/list/foodNew/index.json create mode 100644 pages/list/foodNew/index.wxml create mode 100644 pages/list/foodNew/index.wxss diff --git a/app.json b/app.json index 0f44cc5..0a9a26d 100644 --- a/app.json +++ b/app.json @@ -1,283 +1,285 @@ { - "pages": [ - "pages/index/index", - "pages/map/index", - "pages/pbService/aiHelpYou/index", - "pages/search/index", - "pages/search/list/index", - "pages/login/index", - "pages/old/index", - "pages/old/user/index", - "pages/old/profile/index", - "pages/old/nickname/index", - "pages/old/linkman/index", - "pages/old/linkman/add/index", - "pages/order/comment/index", - "pages/order/coupon/index", - "pages/order/pay/index", - "pages/order/payresult/index", - "pages/order/showSeat/index", - "pages/order/show/index", - "pages/order/road/index", - "pages/order/roadOrder/index", - "pages/order/movie/index", - "pages/order/food/index", - "pages/order/scene/index", - "pages/order/sceneCart/index", - "pages/order/hotel/index", - "pages/order/card/index", - "pages/order/joinOrder/index", - "pages/order/joinOrder/success/index", - "pages/order/joinOrder/history/index", - "pages/order/postOrder/index", - "pages/order/showOrder/index", - "pages/info/newsInfo/index", - "pages/info/hotelProductInfo/index", - "pages/info/museumInfo/index", - "pages/info/sceneProductInfo/index", - "pages/info/sceneProductInfoNew/index", - "pages/info/foodInfo/index", - "pages/info/roadInfo/index", - "pages/info/cardInfo/index", - "pages/info/foodProductInfo/index", - "pages/info/postProductInfo/index", - "pages/info/sceneInfo/index", - "pages/info/hotelInfo/index", - "pages/info/activityInfo/index", - "pages/info/showInfo/index", - "pages/info/strategyInfo/index", - "pages/info/guideInfo/index", - "pages/info/groupOrderInfo/index", - "pages/info/culturalUnitInfo/index", - "pages/info/redmapInfo/index", - "pages/user/user", - "pages/user/retail/index", - "pages/user/retail/apply/index", - "pages/user/retail/goods/index", - "pages/user/retail/list/index", - "pages/user/retail/order/index", - "pages/user/coupon/index", - "pages/user/videoCoupon/index", - "pages/user/verify/index", - "pages/user/cartlist/list", - "pages/user/couponCenter/index", - "pages/user/order/list", - "pages/user/order/team/list", - "pages/user/order/sceneOrderInfo/index", - "pages/user/order/foodOrderInfo/index", - "pages/user/order/lineOrderInfo/index", - "pages/user/order/couponOrderInfo/index", - "pages/user/order/hotelOrderInfo/index", - "pages/user/order/postOrderInfo/index", - "pages/user/order/expressInfo/index", - "pages/user/order/movieOrderInfo/index", - "pages/user/order/activityOrderInfo/index", - "pages/user/order/museumOrderInfo/index", - "pages/user/order/refundInfo/index", - "pages/user/service/index", - "pages/user/service/list/index", - "pages/user/service/info/index", - "pages/user/address/index", - "pages/user/profile/index", - "pages/user/bindtel/index", - "pages/user/nickname/index", - "pages/user/likes/index", - "pages/user/email/index", - "pages/supplier/index", - "pages/supplier/apply/index", - "pages/supplier/good/index", - "pages/list/mayday/index", - "pages/list/feiyi/index", - "pages/list/haoxing/index", - "pages/list/culturalUnit/index", - "pages/list/food/index", - "pages/list/techan/index", - "pages/list/museum/index", - "pages/list/store/index", - "pages/list/activity/index", - "pages/list/activitynew/index", - "pages/list/road/index", - "pages/list/hotel/index", - "pages/list/strategy/index", - "pages/list/night/index", - "pages/list/sale/index", - "pages/list/movieticket/index", - "pages/list/movieticket/list/seats/index", - "pages/list/movieticket/list/cinema/index", - "pages/list/movieticket/list/ticket/index", - "pages/list/movieticket/list/web/index", - "pages/list/movieticket/list/info/index", - "pages/list/theatre/index", - "pages/list/card/index", - "pages/list/six/index", - "pages/list/scene/index", - "pages/list/comments/index", - "pages/list/message/index", - "pages/list/minitrip/index", - "pages/list/oneday/index", - "pages/list/daysu/index", - "pages/list/daysu/detail/index", - "pages/pbService/index", - "pages/pbService/activity/index", - "pages/pbService/museum/index", - "pages/pbService/museum/info/index", - "pages/pbService/PRpark/index", - "pages/pbService/sceneComfort/index", - "pages/pbService/gym/index", - "pages/pbService/gym/info/index", - "pages/pbService/bus/index", - "pages/pbService/bus/search/index", - "pages/pbService/bus/lineinfo/index", - "pages/pbService/security/index", - "pages/pbService/web/index", - "pages/pbService/feiyi/index", - "pages/pbService/bike/index", - "pages/pbService/feiyi/info/index", - "pages/pbService/appreciate/index", - "pages/pbService/appreciate/info/index", - "pages/pbService/library/index", - "pages/pbService/library/bookinfo/index", - "pages/pbService/library/getpoint/index", - "pages/pbService/library/mybook/index", - "pages/pbService/wbdw/index", - "pages/pbService/wbdw/info/index", - "pages/pbService/wwcx/index", - "pages/pbService/wwcx/info/index", - "pages/pbService/wwcx/search/index", - "pages/pbService/group/index", - "pages/ask/index", - "pages/ask/info/index", - "pages/ask/my/index", - "pages/activity/graduate/index", - "pages/activity/year2020/index", - "pages/activity/suyear/index", - "pages/activity/spring2021/index", - "pages/activity/springten/list/index", - "pages/activity/autumnten/list/index", - "pages/activity/springten/index", - "pages/activity/autumnten/index", - "pages/activity/newarrival/index", - "pages/activity/artfestival/index", - "pages/activity/redlist/index", - "pages/activity/subway/index", - "pages/activity/tenscenic/index", + "pages": [ + "pages/index/index", + "pages/map/index", + "pages/pbService/aiHelpYou/index", + "pages/search/index", + "pages/search/list/index", + "pages/login/index", + "pages/old/index", + "pages/old/user/index", + "pages/old/profile/index", + "pages/old/nickname/index", + "pages/old/linkman/index", + "pages/old/linkman/add/index", + "pages/order/comment/index", + "pages/order/coupon/index", + "pages/order/pay/index", + "pages/order/payresult/index", + "pages/order/showSeat/index", + "pages/order/show/index", + "pages/order/road/index", + "pages/order/roadOrder/index", + "pages/order/movie/index", + "pages/order/food/index", + "pages/order/scene/index", + "pages/order/sceneCart/index", + "pages/order/hotel/index", + "pages/order/card/index", + "pages/order/joinOrder/index", + "pages/order/joinOrder/success/index", + "pages/order/joinOrder/history/index", + "pages/order/postOrder/index", + "pages/order/showOrder/index", + "pages/info/newsInfo/index", + "pages/info/hotelProductInfo/index", + "pages/info/museumInfo/index", + "pages/info/sceneProductInfo/index", + "pages/info/sceneProductInfoNew/index", + "pages/info/foodInfo/index", + "pages/info/roadInfo/index", + "pages/info/cardInfo/index", + "pages/info/foodProductInfo/index", + "pages/info/postProductInfo/index", + "pages/info/sceneInfo/index", + "pages/info/hotelInfo/index", + "pages/info/activityInfo/index", + "pages/info/showInfo/index", + "pages/info/strategyInfo/index", + "pages/info/guideInfo/index", + "pages/info/groupOrderInfo/index", + "pages/info/culturalUnitInfo/index", + "pages/info/redmapInfo/index", + "pages/user/user", + "pages/user/retail/index", + "pages/user/retail/apply/index", + "pages/user/retail/goods/index", + "pages/user/retail/list/index", + "pages/user/retail/order/index", + "pages/user/coupon/index", + "pages/user/videoCoupon/index", + "pages/user/verify/index", + "pages/user/cartlist/list", + "pages/user/couponCenter/index", + "pages/user/order/list", + "pages/user/order/team/list", + "pages/user/order/sceneOrderInfo/index", + "pages/user/order/foodOrderInfo/index", + "pages/user/order/lineOrderInfo/index", + "pages/user/order/couponOrderInfo/index", + "pages/user/order/hotelOrderInfo/index", + "pages/user/order/postOrderInfo/index", + "pages/user/order/expressInfo/index", + "pages/user/order/movieOrderInfo/index", + "pages/user/order/activityOrderInfo/index", + "pages/user/order/museumOrderInfo/index", + "pages/user/order/refundInfo/index", + "pages/user/service/index", + "pages/user/service/list/index", + "pages/user/service/info/index", + "pages/user/address/index", + "pages/user/profile/index", + "pages/user/bindtel/index", + "pages/user/nickname/index", + "pages/user/likes/index", + "pages/user/email/index", + "pages/supplier/index", + "pages/supplier/apply/index", + "pages/supplier/good/index", + "pages/list/mayday/index", + "pages/list/feiyi/index", + "pages/list/haoxing/index", + "pages/list/culturalUnit/index", + "pages/list/food/index", + "pages/list/techan/index", + "pages/list/museum/index", + "pages/list/store/index", + "pages/list/activity/index", + "pages/list/activitynew/index", + "pages/list/road/index", + "pages/list/hotel/index", + "pages/list/strategy/index", + "pages/list/night/index", + "pages/list/sale/index", + "pages/list/movieticket/index", + "pages/list/movieticket/list/seats/index", + "pages/list/movieticket/list/cinema/index", + "pages/list/movieticket/list/ticket/index", + "pages/list/movieticket/list/web/index", + "pages/list/movieticket/list/info/index", + "pages/list/theatre/index", + "pages/list/card/index", + "pages/list/six/index", + "pages/list/scene/index", + "pages/list/comments/index", + "pages/list/message/index", + "pages/list/minitrip/index", + "pages/list/oneday/index", + "pages/list/daysu/index", + "pages/list/daysu/detail/index", + "pages/pbService/index", + "pages/pbService/activity/index", + "pages/pbService/museum/index", + "pages/pbService/museum/info/index", + "pages/pbService/PRpark/index", + "pages/pbService/sceneComfort/index", + "pages/pbService/gym/index", + "pages/pbService/gym/info/index", + "pages/pbService/bus/index", + "pages/pbService/bus/search/index", + "pages/pbService/bus/lineinfo/index", + "pages/pbService/security/index", + "pages/pbService/web/index", + "pages/pbService/feiyi/index", + "pages/pbService/bike/index", + "pages/pbService/feiyi/info/index", + "pages/pbService/appreciate/index", + "pages/pbService/appreciate/info/index", + "pages/pbService/library/index", + "pages/pbService/library/bookinfo/index", + "pages/pbService/library/getpoint/index", + "pages/pbService/library/mybook/index", + "pages/pbService/wbdw/index", + "pages/pbService/wbdw/info/index", + "pages/pbService/wwcx/index", + "pages/pbService/wwcx/info/index", + "pages/pbService/wwcx/search/index", + "pages/pbService/group/index", + "pages/ask/index", + "pages/ask/info/index", + "pages/ask/my/index", + "pages/activity/graduate/index", + "pages/activity/year2020/index", + "pages/activity/suyear/index", + "pages/activity/spring2021/index", + "pages/activity/springten/list/index", + "pages/activity/autumnten/list/index", + "pages/activity/springten/index", + "pages/activity/autumnten/index", + "pages/activity/newarrival/index", + "pages/activity/artfestival/index", + "pages/activity/redlist/index", + "pages/activity/subway/index", + "pages/activity/tenscenic/index", "pages/activity/huawei/index", "pages/activity/huawei/form/index", "pages/activity/huawei/result/index", "pages/activity/huawei/upload/index", "pages/activity/huawei/uploadres/index", "pages/activity/huawei/list/index", - "pages/kj/index", - "pages/kj/his/index", - "pages/kj/info/index", - "pages/kj/mine/index", - "pages/group/index", - "pages/group/apply/index", - "pages/group/mine/index", - "pages/group/info/index", - "pages/culture/index", - "pages/culture/info/index", - "pages/user/logout/index", - "pages/order/orderList/index", - "pages/user/linkman/add/index", - "pages/user/address/add/index", - "pages/user/linkman/index", - "pages/user/userPrivacy/index", - "pages/user/personalInfo/index", - "pages/info/luggageInfo/index", - "pages/order/WineSceneOrder/index", - "pages/order/showOrderNew/index", - "pages/user/order/showOrderInfo/index", - "pages/user/suggest/suggest" - ], - "subpackages": [ + "pages/kj/index", + "pages/kj/his/index", + "pages/kj/info/index", + "pages/kj/mine/index", + "pages/group/index", + "pages/group/apply/index", + "pages/group/mine/index", + "pages/group/info/index", + "pages/culture/index", + "pages/culture/info/index", + "pages/user/logout/index", + "pages/order/orderList/index", + "pages/user/linkman/add/index", + "pages/user/address/add/index", + "pages/user/linkman/index", + "pages/user/userPrivacy/index", + "pages/user/personalInfo/index", + "pages/info/luggageInfo/index", + "pages/order/WineSceneOrder/index", + "pages/order/showOrderNew/index", + "pages/user/order/showOrderInfo/index", + "pages/user/suggest/suggest", + "pages/list/foodNew/index", + "pages/info/foodNew/index" + ], + "subpackages": [ + { + "root": "subPackages", + "pages": [ + "indexs/index", + "index/index", + "techanNew/index", + "techanCart/index", + "feiyiNew/index", + "postSearch/index", + "gwcOrder/index", + "indexGQ/index", + "transferPage/transferPage", + "password/overview/overview", + "password/setting/setting", + "goods/oneCardTour/info/index", + "feiyiNew/CGCIndex/index", + "feiyiNew/CGCLetter/index", + "feiyiNew/CGCTime/index" + ] + }, + { + "root": "subPackageCheckPoint", + "pages": [ + "pages/index/index", + "pages/scopemap/index", + "pages/detailsmap/index", + "pages/content/index", + "pages/web/index" + ] + } + ], + "plugins": { + "live-player-plugin": { + "version": "1.3.5", + "provider": "wx2b03c6e691cd7370" + } + }, + "requiredPrivateInfos": [ + "getLocation", + "choosePoi", + "chooseAddress" + ], + "permission": { + "scope.userLocation": { + "desc": "你的位置信息将用于小程序位置接口的效果展示" + } + }, + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#fff", + "navigationBarTitleText": "君到苏州(文化旅游总入口)", + "navigationBarTextStyle": "black", + "navigationStyle": "custom" + }, + "lazyCodeLoading": "requiredComponents", + "style": "v2", + "sitemapLocation": "sitemap.json", + "tabBar": { + "color": "#000000", + "selectedColor": "#000000", + "borderStyle": "white", + "list": [ { - "root": "subPackages", - "pages": [ - "indexs/index", - "index/index", - "techanNew/index", - "techanCart/index", - "feiyiNew/index", - "postSearch/index", - "gwcOrder/index", - "indexGQ/index", - "transferPage/transferPage", - "password/overview/overview", - "password/setting/setting", - "goods/oneCardTour/info/index", - "feiyiNew/CGCIndex/index", - "feiyiNew/CGCLetter/index", - "feiyiNew/CGCTime/index" - ] + "pagePath": "pages/index/index", + "iconPath": "/images/index.png", + "selectedIconPath": "/images/index_seld.png", + "text": "首页", + "shareTimeline": true }, { - "root": "subPackageCheckPoint", - "pages": [ - "pages/index/index", - "pages/scopemap/index", - "pages/detailsmap/index", - "pages/content/index", - "pages/web/index" - ] - } - ], - "plugins": { - "live-player-plugin": { - "version": "1.3.5", - "provider": "wx2b03c6e691cd7370" - } - }, - "requiredPrivateInfos": [ - "getLocation", - "choosePoi", - "chooseAddress" - ], - "permission": { - "scope.userLocation": { - "desc": "你的位置信息将用于小程序位置接口的效果展示" + "pagePath": "pages/pbService/aiHelpYou/index", + "iconPath": "/images/ai.png", + "selectedIconPath": "/images/ai_seld.png", + "text": "AI" + }, + { + "pagePath": "pages/map/index", + "iconPath": "/images/map.png", + "selectedIconPath": "/images/map_seld.png", + "text": "图游" + }, + { + "pagePath": "pages/user/user", + "iconPath": "/images/user.png", + "selectedIconPath": "/images/user_seld.png", + "text": "我的" } - }, - "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#fff", - "navigationBarTitleText": "君到苏州(文化旅游总入口)", - "navigationBarTextStyle": "black", - "navigationStyle": "custom" - }, - "lazyCodeLoading": "requiredComponents", - "style": "v2", - "sitemapLocation": "sitemap.json", - "tabBar": { - "color": "#000000", - "selectedColor": "#000000", - "borderStyle": "white", - "list": [ - { - "pagePath": "pages/index/index", - "iconPath": "/images/index.png", - "selectedIconPath": "/images/index_seld.png", - "text": "首页", - "shareTimeline": true - }, - { - "pagePath": "pages/pbService/aiHelpYou/index", - "iconPath": "/images/ai.png", - "selectedIconPath": "/images/ai_seld.png", - "text": "AI" - }, - { - "pagePath": "pages/map/index", - "iconPath": "/images/map.png", - "selectedIconPath": "/images/map_seld.png", - "text": "图游" - }, - { - "pagePath": "pages/user/user", - "iconPath": "/images/user.png", - "selectedIconPath": "/images/user_seld.png", - "text": "我的" - } - ] - } - } \ No newline at end of file + ] + } +} \ No newline at end of file diff --git a/pages/info/foodNew/index.js b/pages/info/foodNew/index.js new file mode 100644 index 0000000..6d25d54 --- /dev/null +++ b/pages/info/foodNew/index.js @@ -0,0 +1,790 @@ +// 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: { + 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, + windowWidth: 375, + }, + + /** + * 生命周期函数--监听页面加载 + */ + 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(e, targetScrollLeft) + this.setData({ + scrollLeft: targetScrollLeft + }); + } + }).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, + }) + + 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') { + 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.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.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.supplierInfo.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/pages/info/foodNew/index.json b/pages/info/foodNew/index.json new file mode 100644 index 0000000..ab4ec76 --- /dev/null +++ b/pages/info/foodNew/index.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "title":"/pages/component/TitleHeader", + "code":"../../order/components/wxqrCode/index" + + } +} \ No newline at end of file diff --git a/pages/info/foodNew/index.wxml b/pages/info/foodNew/index.wxml new file mode 100644 index 0000000..93f199b --- /dev/null +++ b/pages/info/foodNew/index.wxml @@ -0,0 +1,289 @@ + + + + + + + + {{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}} + + + + + + + + + + + + + + 套餐详情 + + + + + + + 购买须知 + + + + + + + + + + + + 客服 + + + + + + + + + 立即购买 + 该商品已下架 + + + + + + + + + + + + + {{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/pages/info/foodNew/index.wxss b/pages/info/foodNew/index.wxss new file mode 100644 index 0000000..f3c5af7 --- /dev/null +++ b/pages/info/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: 750rpx; +} +.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: 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/pages/info/foodProductInfo/index.js b/pages/info/foodProductInfo/index.js index a5d0eb6..6a7fde7 100644 --- a/pages/info/foodProductInfo/index.js +++ b/pages/info/foodProductInfo/index.js @@ -62,12 +62,12 @@ Page({ id: options.id }) // 获取购物车按钮的位置 - wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) { - console.log(res) - that.setData({ - cartTop: res.top - }) - }).exec() + // wx.createSelectorQuery().select('#cart').boundingClientRect(function (res) { + // console.log(res) + // that.setData({ + // cartTop: res.top + // }) + // }).exec() if (options.ZTPoint) { this.setData({ ZTPoint: options.ZTPoint @@ -395,7 +395,8 @@ Page({ } }) }, - order: function () { + order: function (e) { + let buy_type = e.currentTarget.dataset.type app.globalData.postProduct = [] app.globalData.list = [] commonApi.user_post("/product/checkStock", { @@ -404,16 +405,16 @@ Page({ 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') + 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 = [{ diff --git a/pages/info/foodProductInfo/index.wxml b/pages/info/foodProductInfo/index.wxml index 2afc10c..df11404 100644 --- a/pages/info/foodProductInfo/index.wxml +++ b/pages/info/foodProductInfo/index.wxml @@ -22,9 +22,9 @@ - + @@ -56,9 +56,9 @@ - {{info.title}} - - {{item}} + {{info.title}} + + {{info.subtitle}} @@ -98,6 +98,7 @@ 套餐详情 + - 立即购买 + 立即购买 该商品已下架 - + diff --git a/pages/info/foodProductInfo/index.wxss b/pages/info/foodProductInfo/index.wxss index 74cd9b1..35fe5d5 100644 --- a/pages/info/foodProductInfo/index.wxss +++ b/pages/info/foodProductInfo/index.wxss @@ -1,6 +1,6 @@ /* pages/info/hotelProductInfo/index.wxss */ page { - background: #f2f2f2; + background: #F7F7F7; } .swiper { @@ -25,7 +25,7 @@ page { font-weight: 500; font-size: 24rpx; color: rgba(255,255,255,0.5); - z-index: 10; + z-index: 1; } .swuper-bottom-bg{ background: rgba(1, 0, 0, 0.6); @@ -1264,4 +1264,18 @@ color: #010101; 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; } \ No newline at end of file diff --git a/pages/list/foodNew/index.js b/pages/list/foodNew/index.js new file mode 100644 index 0000000..d928f30 --- /dev/null +++ b/pages/list/foodNew/index.js @@ -0,0 +1,194 @@ +// pages/list/theatre/index.js +import commonApi from "../../../utils/https/common" +import util from "../../../utils/util" +let app = getApp() +Page({ + + /** + * 页面的初始数据 + */ + data: { + list:[], + tagList: [ + {id: 9, name: "品苏式面"}, + {id: 10, name: "尝农家乐"}, + {id: 11, name: "鉴苏帮菜"}, + {id: 12, name: "寻夜食堂"}, + ], // 父标签477 + total:1, + type:9, + + 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: '/pages/info/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; + + 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, + // lat:this.data.lat, + // lon:this.data.lon, + 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/pages/list/foodNew/index.json b/pages/list/foodNew/index.json new file mode 100644 index 0000000..9134183 --- /dev/null +++ b/pages/list/foodNew/index.json @@ -0,0 +1,5 @@ +{ + "usingComponents": { + "search": "/pages/component/SearchHeader" + } +} \ No newline at end of file diff --git a/pages/list/foodNew/index.wxml b/pages/list/foodNew/index.wxml new file mode 100644 index 0000000..718e178 --- /dev/null +++ b/pages/list/foodNew/index.wxml @@ -0,0 +1,48 @@ + + + + + + {{item.name}} + + + + + + + {{areaIndex>0?areas[areaIndex].name:'选择地区'}} + + + + + 距离最近 + + + + + + + + + + + + {{item.supplier_name}} + {{item.address}} + + + + + ¥{{prod.price?prod.price/100:0}} + {{prod.title}} + + + + + + + 暂无内容 + + + \ No newline at end of file diff --git a/pages/list/foodNew/index.wxss b/pages/list/foodNew/index.wxss new file mode 100644 index 0000000..593b84d --- /dev/null +++ b/pages/list/foodNew/index.wxss @@ -0,0 +1,156 @@ +/* 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; +} +.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; +} +.prod-item .price{ + font-weight: bold; +font-size: 24rpx; +color: #D80000; +margin-right: 17rpx; +} + + + diff --git a/pages/order/food/index.js b/pages/order/food/index.js index 9dff63a..6af10de 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, }, /** @@ -46,6 +47,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 }) + } + + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/order/food/index.wxml b/pages/order/food/index.wxml index a732f57..91d0358 100644 --- a/pages/order/food/index.wxml +++ b/pages/order/food/index.wxml @@ -28,10 +28,12 @@ - + - 订单金额:¥{{((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/user/order/foodOrderInfo/index.js b/pages/user/order/foodOrderInfo/index.js index 64d5732..18adada 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].supplier_info.phone, + }) +}, + /** * 生命周期函数--监听页面初次渲染完成 */ @@ -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..c015640 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,65 @@ ¥ {{item.product_price/100}} x{{item.product_num}} - - - 商品总价 - ¥{{info.total_money/100}} + + + + {{item.order_product_extend.reserve_username}} + {{item.order_product_extend.reserve_mobile}} + + {{item.state_text}} + + + 商品总额: + ¥{{info.total_money/100}} 运费 - ¥{{info.total_post_fee/100}} + ¥{{info.total_post_fee/100}} - 优惠券抵扣 - -¥{{info.preference_money/100}} + 优惠券: + -¥{{info.preference_money/100}} - - 需付款 + + 实付金额: {{info.paid_money/100}} - - 剩余时间:00:{{minute}}:{{second}} - 再次购买 - 退款详情 - 取消订单 - 取消订单 - 去评价 - 立即支付 + + + 商家信息 - - {{info.order_product_list[0].scene_detail.title}} - - - 商家电话:{{info.order_product_list[0].scene_detail.tel}} - - - 商家地址:{{info.order_product_list[0].scene_detail.address}} + + + + {{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 +102,33 @@ 支付方式:{{pay_methods[info.pay_method]}} + + 剩余时间: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/sceneOrderInfo/index.wxml b/pages/user/order/sceneOrderInfo/index.wxml index 8c27714..acd1c1b 100644 --- a/pages/user/order/sceneOrderInfo/index.wxml +++ b/pages/user/order/sceneOrderInfo/index.wxml @@ -38,20 +38,7 @@ @@ -135,6 +122,8 @@ + + diff --git a/project.private.config.json b/project.private.config.json index 01b81b5..f1281d1 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -7,18 +7,25 @@ "miniprogram": { "list": [ { - "name": "pages/info/postProductInfo/index", - "pathName": "pages/info/postProductInfo/index", - "query": "id=457638", + "name": "pages/activity/huawei/index", + "pathName": "pages/activity/huawei/index", + "query": "", + "scene": null, + "launchMode": "default" + }, + { + "name": "pages/info/roadInfo/index", + "pathName": "pages/list/foodNew/index", + "query": "", "launchMode": "default", "scene": null }, { - "name": "pages/info/roadInfo/index", - "pathName": "pages/info/roadInfo/index", - "query": "id=457643", - "scene": null, - "launchMode": "default" + "name": "pages/info/postProductInfo/index", + "pathName": "pages/info/foodProductInfo/index", + "query": "id=457647", + "launchMode": "default", + "scene": null } ] } diff --git a/utils/https.js b/utils/https.js index d55ab84..b0f9a8b 100644 --- a/utils/https.js +++ b/utils/https.js @@ -1,8 +1,8 @@ var app = getApp(); import util from "../utils/util" // import userApi from "../utils/https/user.js"; -// const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; -let baseUrl = "https://api.cloud.sz-trip.com/api/"; +const baseUrl = "https://test.api.cloud.sz-trip.com/api/"; +// let baseUrl = "https://api.cloud.sz-trip.com/api/"; const env = wx.getAccountInfoSync().miniProgram.envVersion if (env == 'develop1') { baseUrl = "https://test.api.cloud.sz-trip.com/api/"