Browse Source

美食

master
jiazhipeng 7 months ago
parent
commit
6c74bc5d8e
  1. 546
      app.json
  2. 790
      pages/info/foodNew/index.js
  3. 7
      pages/info/foodNew/index.json
  4. 289
      pages/info/foodNew/index.wxml
  5. 1374
      pages/info/foodNew/index.wxss
  6. 35
      pages/info/foodProductInfo/index.js
  7. 20
      pages/info/foodProductInfo/index.wxml
  8. 18
      pages/info/foodProductInfo/index.wxss
  9. 194
      pages/list/foodNew/index.js
  10. 5
      pages/list/foodNew/index.json
  11. 48
      pages/list/foodNew/index.wxml
  12. 156
      pages/list/foodNew/index.wxss
  13. 31
      pages/order/food/index.js
  14. 6
      pages/order/food/index.wxml
  15. 86
      pages/user/order/foodOrderInfo/index.js
  16. 3
      pages/user/order/foodOrderInfo/index.json
  17. 98
      pages/user/order/foodOrderInfo/index.wxml
  18. 83
      pages/user/order/foodOrderInfo/index.wxss
  19. 15
      pages/user/order/sceneOrderInfo/index.wxml
  20. 23
      project.private.config.json
  21. 4
      utils/https.js

546
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": "我的"
}
]
}
}
]
}
}

790
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 () {
}
})

7
pages/info/foodNew/index.json

@ -0,0 +1,7 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader",
"code":"../../order/components/wxqrCode/index"
}
}

289
pages/info/foodNew/index.wxml

@ -0,0 +1,289 @@
<!--pages/info/hotelProductInfo/index.wxml-->
<wxs src="../../../utils/filter.wxs" module="tool" />
<title title="产品详情"></title>
<view class="shop-info" bindtap="changeSimpleVal" data-keyname="showShopInfo" data-val="{{true}}">
<image class="supplier-headImg" src="{{supplierInfo.headimg}}" mode="aspectFill"></image>
<view class="content">
<view style="display: flex;align-items: flex-start;">
<view class="shop-title shop-com-width textOver2">{{supplierInfo.shop_name}}</view>
<image style="height: 25rpx;margin: 10rpx 68rpx 0 13rpx;" mode="heightFix" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/postDetail/rightIcon.png"></image>
<image class="icon-phone" catch:tap="callPhone" src="https://static.ticket.sz-trip.com/uploads/20250926/6d69afa7a2f955f60fd7cd5475e2b119.png"></image>
</view>
<view class="address" style="display: flex;align-items: center;justify-content: space-between;">
<view class="shop-com-width textOver" style="padding-right: 98rpx;">{{supplierInfo.address}}</view>
<image class="icon-phone" catch:tap="gotolocation" src="https://static.ticket.sz-trip.com/uploads/20250926/6ce5e0467e0745e5f1140b6757ada213.png"></image>
</view>
</view>
</view>
<view style="height: 20rpx;width: 100%;background: #F7F7F7;"></view>
<scroll-view scroll-x scroll-with-animation enable-flex scroll-left="{{scrollLeft}}" id="menus"
class="scroll-menus{{fixed?' fixed-menus':''}}" style="top:{{top}}px" wx:if="{{supplierInfo&&supplierInfo.products.length>0}}">
<view id="scrollView{{index}}" class="scroll-menu-item {{idIndex==index?'active':''}}"
wx:for="{{supplierInfo.products}}" data-item="{{item}}" data-index="{{index}}"
bind:tap="changeProduct">
{{item.subtitle}}
</view>
</scroll-view>
<view class="share-icon" bindtap="share"></view>
<image lazy-load wx:for="{{info.sku}}" style="{{aniSkuIndex==index?('top:'+cartTop+'px;'):('top:'+top+'px;'+cartImgInfo)}}" class="headimg{{aniSkuIndex==index?' active':''}}" src="{{info.headimg}}" mode="aspectFill"></image>
<view style="position: relative;">
<swiper class="swiper" wx:if="{{info}}" autoplay="{{autoPlay}}" current="{{swiperCurrent}}"
interval="{{2000}}" duration="{{300}}" bindchange="swiperChange">
<block wx:if="{{info.videourl}}" wx:key="*this">
<swiper-item>
<video bindplay="playVideo" src="{{info.videourl}}" autoplay="{{true}}" muted="{{true}}"
show-mute-btn="{{true}}" show-background-playback-button="{{false}}"
show-progress="{{false}}" enable-progress-gesture="{{false}}"></video>
<!-- <image lazy-load src="{{info.headimg}}" mode="aspectFill"></image> -->
</swiper-item>
</block>
<block wx:for="{{info.listimg}}" wx:key="*this">
<swiper-item>
<image lazy-load src="{{item}}" mode="aspectFill"></image>
</swiper-item>
</block>
<block wx:for="{{info.sku}}" wx:key="*this">
<swiper-item style="position: relative;">
<image lazy-load src="{{item.headimg}}" mode="aspectFill"></image>
<view class="sku-tips ">
<view class="textOver">{{item.sku_name}}</view>
</view>
</swiper-item>
</block>
</swiper>
<view class="swiper-bottom" wx:if="{{info}}">
<!-- <view class="swuper-bottom-bg">
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.video.min&&swiperCurrent<=swiperRange.video.max)?'active':''}}"
wx:if="{{info.videourl}}" bind:tap="changeSwiperCurrent" data-index="{{0}}">视频</view>
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.picture.min&&swiperCurrent<=swiperRange.picture.max)?'active':''}}"
bind:tap="changeSwiperCurrent" data-index="{{swiperRange.picture.min}}">图片</view>
<view class="swiper-bottom-item {{(swiperCurrent>=swiperRange.sku.min&&swiperCurrent<=swiperRange.sku.max)?'active':''}}"
bind:tap="changeSwiperCurrent" data-index="{{swiperRange.sku.min}}">款式</view>
</view> -->
<view class="swiper-bottom-item bottom-number active">{{swiperCurrent+1}}/{{swiperRange.sku.max+1}}</view>
</view>
</view>
<view wx:if="{{info}}">
<view class="top-info" style="padding: 0;" >
<view class="wineScene-price-container" >
<view class="wineSecne-price">{{info.price/100}}<text class="wineSecne-money">优惠前¥{{info.market_price/100}}</text></view>
<view>已售{{info.sales_number>1000?"1000+":(info.sales_number||0)}}</view>
</view>
<view style="padding: 20rpx 20rpx 20rpx 26rpx;">
<view class="title textOver2"><text class="hot-font">热</text>{{info.title}}</view>
<view class="tags-box textOver" wx:if="{{info.subtitle}}">
<view class="tag textOver" >{{info.subtitle}}</view>
</view>
<view class="other-info-box" >
<view class="other-info-item" style="align-items: flex-start;"bindtap="changeSimpleVal"
data-keyname="otherInfoShow" data-val="{{1}}" wx:if="{{info.shipment_tag}}">
<image lazy-load src="https://static.ticket.sz-trip.com/uploads/20250925/50f3e2316c3f3cc906fe4c78f127e960.png"></image>
<view class="other-content textOver" >{{info.shipment_tag_str}}</view>
<!-- <view style="margin-top: 6rpx;" class="view-arrow">></view> -->
</view>
<view class="other-info-item" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{2}}"
wx:if="{{info.service_tag_str}}">
<image lazy-load src="https://static.ticket.sz-trip.com/uploads/20250925/ce4323d9bcdf2ff03a0985ae4cbdabbe.png"></image>
<view class="other-content textOver">{{info.service_tag_str}}</view>
<!-- <view class="view-arrow">></view> -->
</view>
<view class="other-info-item" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{3}}"
wx:if="{{info.parameter_tag_str}}">
<image lazy-load src="https://static.ticket.sz-trip.com/uploads/20250925/958d9a3ed9404790ba5d17548e20fee8.png"></image>
<view class="other-content textOver">{{info.parameter_tag_str}}</view>
<!-- <view class="view-arrow">></view> -->
</view>
</view>
</view>
</view>
</view>
<view class="scroll-all-box" wx:if="{{info}}">
<view style="height:85rpx" wx:if="{{fixed}}"></view>
<view class="info-box" id="box1">
<view class="info-title">套餐详情</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.content)}}"></rich-text>
</view>
<view style="height: 20rpx;width: 100%;background: #F7F7F7;"></view>
<!-- <view class="info-box" id="box2">
<view class="info-title">费用说明</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.expense_info)}}"></rich-text>
</view> -->
<view class="info-box" id="box3">
<view class="info-title">购买须知</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text>
</view>
</view>
<view style="height:140rpx"></view>
<view class="fixed-bottom">
<view class="['left-img',{{!iShop?'no-shop':''}}]">
<navigator url="/pages/user/service/index" catchtap="pagePoint" data-event='product_customservice' class="kefu-box">
<view class="iconfont icon-kefu"></view>
<view>客服</view>
</navigator>
<view class="kefu-box"></view>
</view>
<view class="btns">
<!-- <view class="btn" bindtap="showCart">加入购物车</view> -->
<view class="btn" bindtap="order" data-type="order" wx:if="{{info && info.flag==1}}" style="background:#D62828;border-radius: 39rpx;" >立即购买</view>
<view class="btn disable" wx:elif="{{info}}" style="border-radius: 39rpx;">该商品已下架</view>
</view>
</view>
<!-- 购物车悬浮框 -->
<!-- <navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart">
<image lazy-load src="https://static.ticket.sz-trip.com/xcxImages/info/cart.png" mode="widthFix"></image>
<view class="cart-num">{{cartCount}}</view>
</navigator> -->
<view class="mask" wx:if="{{skuFlag}}">
<view class="mask-bg" bindtap="hideSku"></view>
<view class="mask-content">
<view class="iconfont icon-close" bindtap="hideSku"></view>
<view class="sku-info-box">
<image lazy-load id="skuImg" src="{{info.sku[skuIndex].headimg}}" mode="aspectFill"></image>
<view class="sku-info">
<view>
<view class="sku-price">{{info.sku[skuIndex].price/100}}
</view>
<view class="sku-name">已选择:{{info.sku[skuIndex].sku_name}}</view>
</view>
<view style="display: flex;align-items: center;">
<view class="number-box">
<view class="iconfont icon-sami-select" bindtap="minus"></view>
<view class="number">{{producNum}}</view>
<view class="iconfont icon-add-select" bindtap="add"></view>
</view>
<view class="limit-number" wx:if="{{info.sku[skuIndex].sku_model.traveller_limit_num>0}}">限购{{info.sku[skuIndex].sku_model.traveller_limit_num}}件</view>
</view>
</view>
</view>
<view style="font-weight: bold;font-size: 33rpx;color: #060001;margin:0rpx 25rpx 27rpx">产品分类({{info.sku.length}})</view>
<view class="sku-names">
<view bindtap="selectSku" data-index="{{index}}" class="sku-name-item {{index==skuIndex?' active':''}}"
wx:for="{{info.sku}}">
<image lazy-load src="{{item.headimg}}"></image>
<view class="sku-name textOver2">{{item.sku_name}}</view>
</view>
</view>
<view style="height:138rpx"></view>
<view class="btn-box">
<view class="mask-btn" bindtap="order" wx:if="{{info.sku[skuIndex].flag=='on'}}">{{skuFlag=='cart'?'确认':'立即购买'}}
</view>
<view class="mask-btn disable" wx:else>该商品已下架</view>
</view>
</view>
</view>
<view style="position:absolute;right:0;left:-10000rpx;top:-20000rpx;z-index:-1">
<canvas canvas-id='imageCanvas' class='imageCanvas' style="width:551rpx;height:643rpx;" disable-scroll='true'>
</canvas>
<canvas class="canvasCode" style="opacity:0;width:500px;height:500px" canvas-id="myQrcode"></canvas>
</view>
<view class="mask" wx:if="{{showShareFlag}}" style="align-items: center;">
<view class="mask-bg" bindtap="share"></view>
<view class="mask-content share-img-box">
<image lazy-load class="share-img" src="{{shareImg}}" mode="widthFix"></image>
<view class="share-tips">
<view style="position:relative">
<image lazy-load class="img" src="https://static.ticket.sz-trip.com/xcxImages/info/img.png" mode="widthFix">
</image>
<view>保存图片到相册</view>
<view class="tipimg">
<image lazy-load src="https://static.ticket.sz-trip.com/xcxImages/info/ok.png" mode="widthFix"></image>
</view>
</view>
<image lazy-load style="width:36rpx" src="https://static.ticket.sz-trip.com/xcxImages/info/arrow2.png" mode="widthFix"></image>
<view style="position:relative">
<image lazy-load class="img" src="https://static.ticket.sz-trip.com/xcxImages/info/code.png" mode="widthFix">
</image>
<view>微信识别二维码</view>
<view class="tipimg">
<image lazy-load src="https://static.ticket.sz-trip.com/xcxImages/info/ok1.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="save-btn" bindtap="save">保存到相册</view>
</view>
</view>
<code showModel="{{showQrCode}}" qrcode = "{{wxqrcode}}">
</code>
<!-- <view class="mask" wx:if="{{otherInfoShow>0}}"> -->
<view class="mask" wx:if="{{false}}">
<view class="mask-bg" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{0}}"></view>
<view class="mask-content">
<view class="iconfont icon-close" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{0}}"></view>
<view class="other-info-content">
<view class="title">{{otherInfoShow==3?"产品参数":otherInfoShow==2?"服务说明":"发货说明"}}</view>
<view wx:if="{{otherInfoShow==1}}">
<rich-text class="details" nodes="{{tool.formateRichText(info.shipment_info)}}"></rich-text>
</view>
<view wx:if="{{otherInfoShow==2}}">
<rich-text class="details" nodes="{{tool.formateRichText(info.service_info)}}"></rich-text>
</view>
<view wx:if="{{otherInfoShow==3}}">
<rich-text class="details" nodes="{{tool.formateRichText(info.parameter_info)}}"></rich-text>
</view>
</view>
<view style="height:138rpx"></view>
<view class="btn-box">
<view class="mask-btn" bindtap="changeSimpleVal" data-keyname="otherInfoShow" data-val="{{0}}">确定</view>
</view>
</view>
</view>
<!-- 店铺信息 -->
<view class="mask" wx:if="{{showShopInfo}}">
<view class="mask-bg" bindtap="changeSimpleVal" data-keyname="showShopInfo" data-val="{{false}}"></view>
<view class="mask-content supplier-mask">
<view class="iconfont icon-close" bindtap="changeSimpleVal" data-keyname="showShopInfo" data-val="{{false}}"></view>
<view class="supplier-mask-header">商家信息</view>
<view class="mask-shop-info">
<view>{{supplierInfo.shop_name}}</view>
<view class="shop-info-item">
<image class="start-icon" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/food/time.png"></image>
<view>
<view>营业时间</view>
<view class="subtitle">{{supplierInfo.business_hours}}</view>
</view>
</view>
<view class="shop-info-item" style="justify-content: space-between;">
<image class="start-icon" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/food/time.png"></image>
<view style="flex: 1;width: 100rpx;">
<view>{{supplierInfo.address}}</view>
<view class="subtitle" wx:if="{{supplierInfo.distance}}">据您约{{supplierInfo.distance}}km</view>
</view>
<image class="icon-phone" catch:tap="callPhone" src="https://static.ticket.sz-trip.com/uploads/20250926/6d69afa7a2f955f60fd7cd5475e2b119.png"></image>
<image class="icon-phone" catch:tap="gotolocation" src="https://static.ticket.sz-trip.com/uploads/20250926/6ce5e0467e0745e5f1140b6757ada213.png"></image>
</view>
</view>
<view style="height: 20rpx;width: 100%;background: #F7F7F7;"></view>
<view class="supplier-mask-header">商家介绍</view>
<rich-text style="padding: 0 28rpx;" class="details" nodes="{{tool.formateRichText(supplierInfo.content)}}"></rich-text >
<view style="width: 100%;height: 20rpx;"></view>
</view>
</view>

1374
pages/info/foodNew/index.wxss

File diff suppressed because it is too large

35
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 = [{

20
pages/info/foodProductInfo/index.wxml

@ -22,9 +22,9 @@
<block wx:for="{{info.sku}}" wx:key="*this">
<swiper-item style="position: relative;">
<image lazy-load src="{{item.headimg}}" mode="aspectFill"></image>
<view class="sku-tips ">
<!-- <view class="sku-tips ">
<view class="textOver">{{item.sku_name}}</view>
</view>
</view> -->
</swiper-item>
</block>
</swiper>
@ -56,9 +56,9 @@
<view style="padding: 20rpx 20rpx 20rpx 26rpx;">
<view class="title textOver2">{{info.title}}</view>
<view class="tags-box textOver">
<view class="tag textOver" wx:for="{{info.display_tags}}">{{item}}</view>
<view class="title textOver2"><text class="hot-font">热</text>{{info.title}}</view>
<view class="tags-box textOver" wx:if="{{info.subtitle}}">
<view class="tag textOver" >{{info.subtitle}}</view>
</view>
<view class="other-info-box" >
@ -98,6 +98,7 @@
<view class="info-title">套餐详情</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.content)}}"></rich-text>
</view>
<view style="height: 20rpx;width: 100%;background: #F7F7F7;"></view>
<!-- <view class="info-box" id="box2">
<view class="info-title">费用说明</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.expense_info)}}"></rich-text>
@ -106,7 +107,6 @@
<view class="info-title">购买须知</view>
<rich-text class="details" nodes="{{tool.formateRichText(info.book_info)}}"></rich-text>
</view>
<view style="height: 20rpx;width: 100%;background: #F7F7F7;"></view>
<!-- <view class="info-box" id="box4" style="padding: 20rpx 26rpx;">
<view class="info-title">产品推荐</view>
@ -127,7 +127,7 @@
<view style="height:140rpx"></view>
<view class="fixed-bottom">
<view class="['left-img',{{!iShop?'no-shop':''}}]">
<navigator wx:if="{{iShop}}" url="/pages/list/store/index?id={{supplierId}}" catchtap="pagePoint" data-event='product_customservice' class="shop-box">
<navigator wx:if="{{iShop}}" url="/pages/info/foodNew/index?id={{supplierId}}" catchtap="pagePoint" data-event='product_customservice' class="shop-box">
<view class="shop-box">
<image lazy-load class="icon-shop" src="https://static.ticket.sz-trip.com/uploads/20230220/cc7bfaf50dccd354c56a1ad40d730b2e.png" mode="aspectFill"/>
<view>店铺</view>
@ -147,15 +147,15 @@
<view class="btns">
<!-- <view class="btn" bindtap="showCart">加入购物车</view> -->
<view class="btn" bindtap="showOrder" wx:if="{{info && info.flag==1}}" style="background:#D62828;border-radius: 39rpx;" >立即购买</view>
<view class="btn" bindtap="order" data-type="order" wx:if="{{info && info.flag==1}}" style="background:#D62828;border-radius: 39rpx;" >立即购买</view>
<view class="btn disable" wx:elif="{{info}}" style="border-radius: 39rpx;">该商品已下架</view>
</view>
</view>
<!-- 购物车悬浮框 -->
<navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart">
<!-- <navigator url="/pages/user/cartlist/list" catchtap="pagePoint" data-event='product_cart_click' class="cart-box" id="cart">
<image lazy-load src="https://static.ticket.sz-trip.com/xcxImages/info/cart.png" mode="widthFix"></image>
<view class="cart-num">{{cartCount}}</view>
</navigator>
</navigator> -->
<view class="mask" wx:if="{{skuFlag}}">
<view class="mask-bg" bindtap="hideSku"></view>
<view class="mask-content">

18
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;
}

194
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'
}
}
})

5
pages/list/foodNew/index.json

@ -0,0 +1,5 @@
{
"usingComponents": {
"search": "/pages/component/SearchHeader"
}
}

48
pages/list/foodNew/index.wxml

@ -0,0 +1,48 @@
<!--pages/list/theatre/index.wxml-->
<wxs src="../../../utils/filter.wxs" module="tool" />
<view class="my-header-search">
<search bind:onload="search" transparent="1"></search>
<view class="sale-types no-scrollbar">
<view wx:for="{{tagList}}" wx:key="id" class="sale-type{{type==item.id?' active':''}}"
bindtap="changeType" data-type="{{item.id}}">{{item.name}}</view>
</view>
<view class="search-fix">
<view>
<picker mode="selector" value="{{areaIndex}}" range="{{areas}}" range-key="name" bindchange="changeArea">
<view class="picker feiyi-picker">
<text>{{areaIndex>0?areas[areaIndex].name:'选择地区'}}</text>
<view class="trian-down"></view>
</view>
</picker>
</view>
<view bind:tap="selectDistance">距离最近</view>
</view>
</view>
<view style="height:700rpx"></view>
<view class="prod-box">
<view bindtap="gotoDetail" data-item="{{item}}" class="item" wx:for="{{list}}">
<image lazy-load src="{{item.headimg}}" mode="aspectFill"></image>
<view class="info">
<view class="textOver2 title">{{item.supplier_name}}</view>
<view class="textOver subtitle">{{item.address}}</view>
<view class="line" wx:if="{{item.hot_products.length>0}}"></view>
<view class="prod-container" wx:for="{{item.hot_products}}" wx:for-item="prod" wx:for-index="indexs" wx:key="indexs">
<view class="prod-item textOver">
<text class="hot">热</text>
<text class="price">¥{{prod.price?prod.price/100:0}}</text>
<text class="prod-name">{{prod.title}}</text>
</view>
</view>
</view>
</view>
<view wx:if="{{list.length==0}}" class="common-empty" style="z-index:-1">
<image lazy-load mode="widthFix" src="https://static.ticket.sz-trip.com/xcxImages/other/nodata.png"></image>
<view>暂无内容</view>
</view>
</view>

156
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;
}

31
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 })
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/

6
pages/order/food/index.wxml

@ -28,10 +28,12 @@
<input type="number" value="{{tel}}" bindinput="telInput" placeholder="请输入手机号"></input>
</view>
</view>
<coupon id="coupon" money="{{product.sku.price * productNum}}" sku="{{product.sku.id}}"></coupon>
<coupon id="coupon" bind:getNewCoupon = 'getNewCoupon' money="{{product.sku.price * productNum}}" sku="{{product.sku.id}}"></coupon>
<view style="height:113rpx"></view>
<view class="fixed-bottom" wx:if="{{product}}">
<view class="fixed-price-box"><text>订单金额:</text><text class="price">¥{{((product.sku.price * productNum - (coupon?coupon.activity.money:0))>0?(product.sku.price * productNum - (coupon?coupon.activity.money:0)):0) / 100}}</text></view>
<!-- <view class="fixed-price-box"><text>订单金额:</text><text class="price">¥{{((product.sku.price * productNum - (coupon?coupon.activity.money:0))>0?(product.sku.price * productNum - (coupon?coupon.activity.money:0)):0) / 100}}</text></view> -->
<view class="fixed-price-box"><text>订单金额:</text><text class="price">¥{{price}}</text></view>
<view class="fixed-btn" bindtap="order">提交订单</view>
</view>
<notice bind:close="closeNotice" wx:if="{{showNoticeFlag}}" bookingInfo="{{product.sku.sku_model}}" skuName="{{product.sku.sku_name}}"></notice>

86
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()
}
})
},
/**

3
pages/user/order/foodOrderInfo/index.json

@ -1,5 +1,6 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader"
"title":"/pages/component/TitleHeader",
"sptj":"/pages/component/proRec/proRec"
}
}

98
pages/user/order/foodOrderInfo/index.wxml

@ -19,8 +19,9 @@
<!-- 美食的 -->
<view class="box" wx:if="{{product_model=='food'}}" style="padding-bottom:0">
<view wx:if="{{info.order_product_list && info.order_product_list.length>0}}" class="product-info" wx:for="{{info.order_product_list}}">
<view class="box" wx:if="{{product_model=='food'}}">
<view wx:if="{{info.order_product_list && info.order_product_list.length>0}}" wx:for="{{info.order_product_list}}">
<view class="product-info">
<image lazy-load src="{{item.sku_headimg}}" mode="aspectFill"></image>
<view class="title-box textOver2">
<view class="title textOver2">{{item.product_title}}</view>
@ -30,53 +31,65 @@
<view style="margin-bottom:10rpx">¥ {{item.product_price/100}}</view>
<view>x{{item.product_num}}</view>
</view>
</view>
<view class="detail-item">
<text>商品总价</text>
<text>¥{{info.total_money/100}}</text>
</view>
<view class="reserve-box">
<view >{{item.order_product_extend.reserve_username}}</view>
<view >{{item.order_product_extend.reserve_mobile}}</view>
</view>
<view class="state_text">{{item.state_text}}</view>
<view class="detail-item">
<text>商品总额:</text>
<text style="font-weight: bold;color: #111111;">¥{{info.total_money/100}}</text>
</view>
<view class="detail-item" wx:if="{{info.total_post_fee}}">
<text>运费</text>
<text>¥{{info.total_post_fee/100}}</text>
<text style="font-weight: bold;color: #111111;">¥{{info.total_post_fee/100}}</text>
</view>
<view class="detail-item" wx:if="{{info.preference_money}}">
<text>优惠券抵扣</text>
<text>-¥{{info.preference_money/100}}</text>
<text>优惠券</text>
<text style="font-weight: bold;color: #111111;">-¥{{info.preference_money/100}}</text>
</view>
<view class="detail-item all-total-item" style="border-bottom:none">
<text>需付款</text>
<view class="detail-item">
<text>实付金额:</text>
<view class="price">{{info.paid_money/100}}</view>
</view>
<view class="btns" style="border-top:1rpx solid #ccc" wx:if="{{info.state!='CLOSED'}}">
<view class="scene-rest-time" wx:if="{{info.state=='UNPAID'}}">剩余时间:00:{{minute}}:{{second}}</view>
<navigator url="/pages/info/foodProductInfo/index?id={{info.order_product_list[0].product_id}}" class="btn">再次购买</navigator>
<navigator wx:if="{{info.state!='UNPAID'}}" url="../refundInfo/index?id={{info.order_id}}" class="btn" wx:if="{{isRefund}}">退款详情</navigator>
<view class="btn" wx:if="{{info.state=='PAID'}}" bindtap="refund">取消订单</view>
<view class="btn" wx:if="{{info.state=='UNPAID'}}" bindtap="close">取消订单</view>
<navigator url="/pages/order/comment/index?id={{info.order_id}}" class="btn active1" wx:if="{{info.state=='WAIT_COMMENT'}}">去评价</navigator>
<navigator url="/pages/order/pay/index?id={{id}}" class="btn active" wx:if="{{info.state=='UNPAID'}}">立即支付</navigator>
</view>
</view>
<view class="box" wx:if="{{info && product_model=='food'}}">
<view class="box-title">商家信息</view>
<view class="detail-item">
<text>{{info.order_product_list[0].scene_detail.title}}</text>
</view>
<view class="detail-item">
<text>商家电话:{{info.order_product_list[0].scene_detail.tel}}</text>
</view>
<view class="detail-item">
<text>商家地址:{{info.order_product_list[0].scene_detail.address}}</text>
<view class=" supplier-mask">
<view class="mask-shop-info">
<view>{{info.order_product_list[0].supplier_info.shop_name}}</view>
<view class="shop-info-item">
<image class="start-icon" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/food/time.png"></image>
<view>
<view>营业时间</view>
<view class="subtitle">{{info.order_product_list[0].supplier_info.business_hours}}</view>
</view>
</view>
<view class="shop-info-item" style="justify-content: space-between;">
<image class="start-icon" src="https://static.ticket.sz-trip.com/jundaosuzhou/images/food/address.png"></image>
<view style="flex: 1;width: 100rpx;">
<view>{{info.order_product_list[0].supplier_info.address}}</view>
<view class="subtitle" wx:if="{{info.order_product_list[0].supplier_info.distance>0}}">据您约{{info.order_product_list[0].supplier_info.distance}}km</view>
</view>
<image class="icon-phone" catch:tap="callPhone" src="https://static.ticket.sz-trip.com/uploads/20250926/6d69afa7a2f955f60fd7cd5475e2b119.png"></image>
<image class="icon-phone" catch:tap="gotolocation" src="https://static.ticket.sz-trip.com/uploads/20250926/6ce5e0467e0745e5f1140b6757ada213.png"></image>
</view>
</view>
</view>
</view>
<view class="box" wx:if="{{info && product_model=='food'}}">
<view class="box-title">订单信息</view>
<view class="detail-item">
<text>姓名:{{info.order_product_list[0].order_product_extend.reserve_username}}</text>
</view>
<view class="detail-item">
<text>预留手机号:{{info.order_product_list[0].order_product_extend.reserve_mobile}}</text>
</view>
<view class="detail-item">
<text>订单编号:{{info.order_id}}</text>
</view>
@ -89,18 +102,33 @@
<view class="detail-item" wx:if="{{info.pay_method}}">
<text>支付方式:{{pay_methods[info.pay_method]}}</text>
</view>
<view class="btns" style="border-top:1rpx solid #ccc" wx:if="{{info.state!='CLOSED'}}">
<view class="scene-rest-time" wx:if="{{info.state=='UNPAID'}}">剩余时间:00:{{minute}}:{{second}}</view>
<navigator url="/pages/info/foodProductInfo/index?id={{info.order_product_list[0].product_id}}" class="btn">再次购买</navigator>
<navigator wx:if="{{info.state!='UNPAID'}}" url="../refundInfo/index?id={{info.order_id}}" class="btn" wx:if="{{isRefund}}">退款详情</navigator>
<view class="btn" wx:if="{{info.state=='PAID'}}" bindtap="refund">取消订单</view>
<view class="btn" wx:if="{{info.state=='UNPAID'}}" bindtap="close">取消订单</view>
<navigator url="/pages/order/comment/index?id={{info.order_id}}" class="btn active1" wx:if="{{info.state=='WAIT_COMMENT'}}">去评价</navigator>
<navigator url="/pages/order/pay/index?id={{id}}" class="btn active" wx:if="{{info.state=='UNPAID'}}">立即支付</navigator>
</view>
</view>
<view class="box" wx:if="{{info && product_model=='food'}}">
<!-- <view class="box" wx:if="{{info && product_model=='food'}}">
<view class="box-title">使用说明</view>
<rich-text class="detail-item" style="display:block;height:auto" nodes="{{tool.formateRichText(info.order_product_list[0].sku_model.bookinfo)}}"></rich-text>
</view>
</view> -->
<!-- <view class="box" wx:if="{{info && product_model=='food'}}">
<view class="box-title">退款须知</view>
<rich-text class="detail-item" style="display:block;height:auto" nodes="{{tool.formateRichText(info.order_product_list[0].sku_model.refund_info)}}"></rich-text>
</view> -->
<sptj ids="{{ ids }}"></sptj>
<navigator url="/pages/user/service/index" wx:if="{{info && info.state!='CLOSED'}}" class="bottom-btn">
<image lazy-load src="https://static.ticket.sz-trip.com/xcxImages/index/service.png" mode="widthFix"></image>联系客服
</navigator>
<view style="width: 100%;height: 50rpx;"></view>
<view class="mask" wx:if="{{feeInfoFlag}}">
<view class="mask-bg" bindtap="showFeeInfo"></view>
<view class="mask-content">

83
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;
}

15
pages/user/order/sceneOrderInfo/index.wxml

@ -38,20 +38,7 @@
<!-- 景点订单详情需要这个 -->
<!-- <view class="box" wx:if='{{product_model=="ticket"}}'>
<view class="scene-box">
<view class="scene-box-left">
<view wx:if="{{info.state=='UNPAID'}}">库存有限,请尽快完成付款</view>
<view wx:if="{{info.state=='CLOSED' || info.state=='REFUND'}}">您的订单已取消,您可以通过苏州文旅总入口再次预订</view>
<view wx:if="{{info.order_product_list[0].state=='WAIT_USE'}}">预定已成功,祝您出游愉快</view>
<view>订单号:{{info.order_id}}</view>
<view>下单时间:{{info.create_time}}</view>
</view>
<view class="scene-box-right">
<view class="price">¥{{info.paid_money/100}}</view>
<view bindtap="showFeeInfo">费用明细</view>
</view>
</view>
</view> -->
<!--景点订单详情需要这个 -->
<view class="box" wx:for="{{info.order_product_list}}" wx:for-index='index'>
@ -135,6 +122,8 @@
</view>
<view wx:elif=""></view>
<view wx:else>
<view class="product-info" bindtap="goDetail" data-set='{{item}}'>
<view class="product-info-top">

23
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
}
]
}

4
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/"

Loading…
Cancel
Save