Browse Source

顺手购

master
chenkainan 3 months ago
parent
commit
8053f76024
  1. 6
      pages/info/sceneProductInfo/index.js
  2. 18
      pages/order/WineSceneOrder/index.js
  3. 8
      pages/order/WineSceneOrder/index.wxml
  4. 19
      pages/order/WineSceneOrder/index.wxss
  5. 4
      pages/order/components/coupon/index.wxml
  6. 8
      pages/order/components/smoothlyOrder/index.js
  7. 4
      pages/order/components/smoothlyOrder/index.wxml
  8. 14
      pages/order/food/index.js
  9. 9
      pages/order/food/index.wxml
  10. 19
      pages/order/food/index.wxss
  11. 53
      pages/order/postOrder/index.js
  12. 9
      pages/order/postOrder/index.wxml
  13. 18
      pages/order/postOrder/index.wxss
  14. 10
      pages/order/roadOrder/index.js
  15. 7
      pages/order/roadOrder/index.wxml
  16. 19
      pages/order/roadOrder/index.wxss
  17. 15
      pages/order/showOrderNew/index.js
  18. 10
      pages/order/showOrderNew/index.wxml
  19. 19
      pages/order/showOrderNew/index.wxss
  20. 9
      project.private.config.json
  21. 8
      utils/util.js

6
pages/info/sceneProductInfo/index.js

@ -75,6 +75,12 @@ Page({
util.back()
return;
}
if(options.id) {
let tempUrl = util.detailDomain+`/ScenicDetail?id=${options.id}`
wx.navigateTo({
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl),
})
}
if (options.retailId) {
this.setData({
retailId: options.retailId

18
pages/order/WineSceneOrder/index.js

@ -45,7 +45,8 @@ Page({
couponFlag:false,
smoothlyTotal: 0,
maxCouponObject: null
maxCouponObject: null,
couponCom: null
},
/**
@ -100,7 +101,11 @@ Page({
},
// 调用子组件清除优惠券方法
callOtherCompMethod: function(e) {
this.couponCom.setNullCoupon()
console.log(this.selectAllComponents("#coupon")[0])
this.selectAllComponents("#coupon")[0].setNullCoupon()
this.setData({
coupon:null
})
},
showBookingInfo: function (e) {
this.setData({
@ -246,11 +251,12 @@ Page({
},
totalPrice(price) {
let allPrice = this.data.singlePrice * this.data.productNum
let prices = 0
console.log(this.data.smoothlyTotal,111111)
let prices = allPrice
// 顺手购价格
allPrice += this.data.smoothlyTotal || 0;
prices = allPrice
if (!this.data.coupon) {
allPrice += this.data.smoothlyTotal || 0;
}
if (this.data.coupon) {
if (this.data.coupon.activity.discount_type == 'pricebreak') {

8
pages/order/WineSceneOrder/index.wxml

@ -42,13 +42,13 @@
<!-- 顺手购组件 -->
<smoothly-order
wx:if="{{product.product.id}}"
wx:if="{{product.product.id && !coupon.id}}"
id="smoothlyOrderComp"
productId="{{product.product.id}}"
bind:callOtherComp="callOtherCompMethod"
bind:updateTotalPrice="handleUpdateTotalPrice"
></smoothly-order>
<view style="height:200rpx"></view>
<view class="fixed-bottom" >
<view class="fixed-price-box" ><text>合计:</text>
<text class="price">¥{{price}}</text>
@ -58,4 +58,8 @@
<notice bookingInfo="{{bookingInfo}}" skuName="{{bookingInfoTitle}}" wx:if="{{bookingInfo}}" bind:close="closeMask">
</notice>
<!-- <view class="tishi" wx-if="{{coupon.id && smoothlyTotal > 0}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/thyh/user/tanhaos.png" mode="aspectFill"></image>
购买须知:使用优惠券的组合订单均不支持部分退款
</view> -->
</view>

19
pages/order/WineSceneOrder/index.wxss

@ -452,3 +452,22 @@ page {
content: "¥";
font-size: 24rpx;
}
.tishi {
width: 100%;
height: 67rpx;
background: #FFDEDE;
font-weight: bold;
font-size: 27rpx;
color: #D62828;
display: flex;
align-items: center;
position: fixed;
left: 0;
bottom: 113rpx;
}
.tishi image {
width: 26.67rpx;
height: 26.67rpx;
margin: 0 12rpx 0 26rpx;
}

4
pages/order/components/coupon/index.wxml

@ -2,9 +2,9 @@
<navigator url="/pages/order/coupon/index?money={{money}}&sku={{sku}}&sourceFrom={{sourceFrom}}" class="box">
<view class="box-title">
<view style="flex:1">优惠券</view>
<view class="coupon-left" wx:if="{{maxCouponPrice > 0 && maxCouponPrice != coupon.activity.money}}">
<!-- <view class="coupon-left" wx:if="{{maxCouponPrice > 0 && maxCouponPrice != coupon.activity.money}}">
¥{{maxCouponPrice / 100}}优惠券可用
</view>
</view> -->
<view wx:if="{{coupon}}">
<view wx:if="{{coupon.activity.discount_type == 'pricebreak'}}">
-¥{{coupon.activity.money/100}}

8
pages/order/components/smoothlyOrder/index.js

@ -32,6 +32,11 @@ Component({
sommthlyIndex: 0
})
this.getList()
// 组件初始化时,通知父组件重置价格为 0
this.triggerEvent('updateTotalPrice', {
total: 0
});
}
},
observers: {
@ -67,10 +72,11 @@ Component({
methods: {
// 查看规格信息
showSkuInfo(e) {
console.log(e)
this.setData({
showItem: e.currentTarget.dataset.item,
showSkuPopup: true,
content: '<img src="https://static.ticket.sz-trip.com/uploads/20241115/19e939ccf37d7301d82eea2545887218.jpg" style="width: 100%;" /><img src="https://static.ticket.sz-trip.com/uploads/20241115/1d3674e6bdfd5474c7b275b80e9cf56e.jpg" alt="" /><img src="https://static.ticket.sz-trip.com/uploads/20241115/02ff69565931d68464c4f25e30cd78ca.jpg" alt="" /><img src="https://static.ticket.sz-trip.com/uploads/20241115/3c66960d9a403be441dc03afd6346cc1.jpg" alt="" /><img src="https://static.ticket.sz-trip.com/uploads/20241115/420a6830644e16d03e6523e468019579.jpg" alt="" /><img src="https://static.ticket.sz-trip.com/uploads/20241115/b92b9d61f47905292c780faf7cb78762.jpg" alt="" />'
content: e.currentTarget.dataset.item.content
})
console.log(this.data.showItem)
},

4
pages/order/components/smoothlyOrder/index.wxml

@ -53,13 +53,13 @@
wx:if="{{item.postMoney > 0}}">(另需运费¥{{item.postMoney / 100}})</text></view>
<view class="product-btn flex-between">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/combinedLine/del.png"
bindtap="decreaseSkuNum" data-item="{{item}}" wx:if="{{item.buyNum > 0}}" mode="widthFix" />
catchtap="decreaseSkuNum" data-item="{{item}}" wx:if="{{item.buyNum > 0}}" mode="widthFix" />
<view wx:else></view>
<view style="width: 100%;text-align: center;" wx:if="{{item.buyNum > 0}}">{{item.buyNum}}
</view>
<view wx:else></view>
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/combinedLine/add.png"
bindtap="increaseSkuNum" data-item="{{item}}" mode="widthFix" />
catchtap="increaseSkuNum" data-item="{{item}}" mode="widthFix" />
</view>
</view>
</view>

14
pages/order/food/index.js

@ -17,7 +17,8 @@ Page({
coupon:null,
price: 0,
smoothlyTotal: 0,
maxCouponObject: null
maxCouponObject: null,
couponCom: null
},
/**
@ -50,6 +51,9 @@ Page({
// 调用子组件清除优惠券方法
callOtherCompMethod: function(e) {
this.couponCom.setNullCoupon()
this.setData({
coupon:null
})
},
showNotice:function(){
this.setData({
@ -75,10 +79,13 @@ Page({
let price = this.data.product.sku.price * this.data.productNum
let allPrice = 0
// 顺手购价格
price += this.data.smoothlyTotal || 0;
allPrice = price
// 顺手购价格
if (!this.data.coupon) {
price += this.data.smoothlyTotal || 0;
}
if (this.data.coupon) {
if (this.data.coupon.activity.discount_type == 'pricebreak') {
price = price - this.data.coupon.activity.money
@ -153,7 +160,6 @@ Page({
},
order:function(){
const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
console.log(smoothlyComp,smoothlyComp.emitOrder())
if(smoothlyComp) {
// 检查是否有选中的顺手购商品
const hasSelected = smoothlyComp.hasSelectedGoods();

9
pages/order/food/index.wxml

@ -32,14 +32,14 @@
<!-- 顺手购组件 -->
<smoothly-order
wx:if="{{product.product.id}}"
wx:if="{{product.product.id && !coupon.id}}"
id="smoothlyOrderComp"
productId="{{product.product.id}}"
bind:callOtherComp="callOtherCompMethod"
bind:updateTotalPrice="handleUpdateTotalPrice"
></smoothly-order>
<view style="height:113rpx"></view>
<view style="height:200rpx"></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">¥{{price}}</text></view>
@ -47,3 +47,8 @@ bind:updateTotalPrice="handleUpdateTotalPrice"
<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>
<!-- <view class="tishi" wx-if="{{coupon.id && smoothlyTotal > 0}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/thyh/user/tanhaos.png" mode="aspectFill"></image>
购买须知:使用优惠券的组合订单均不支持部分退款
</view> -->

19
pages/order/food/index.wxss

@ -133,3 +133,22 @@ margin-top: 30rpx;
font-size: 36rpx;
margin-left: 10rpx;
}
.tishi {
width: 100%;
height: 67rpx;
background: #FFDEDE;
font-weight: bold;
font-size: 27rpx;
color: #D62828;
display: flex;
align-items: center;
position: fixed;
left: 0;
bottom: 113rpx;
}
.tishi image {
width: 26.67rpx;
height: 26.67rpx;
margin: 0 12rpx 0 26rpx;
}

53
pages/order/postOrder/index.js

@ -57,12 +57,16 @@ Page({
this.setData({
smoothlyTotal: e.detail.total
});
console.log(123456)
// 重新计算总价
this.changePrice();
},
// 调用子组件清除优惠券方法
callOtherCompMethod: function(e) {
this.couponCom.setNullCoupon()
this.setData({
coupon: null
})
},
handleProduct () {
app.globalData.postProduct.forEach((item,index) => {
@ -212,6 +216,15 @@ Page({
},
minus: function (e) {
if(this.data.coupon){
wx.showToast({
title: '订单价格发生变化,请重新选择优惠券',
icon: 'none'
})
}
this.couponCom.setNullCoupon()
app.globalData.couponInfo = null;
let index = e.currentTarget.dataset.index, product = this.data.product;
let productNum = product[index].productNum;
if (productNum <= 1) return;
@ -237,10 +250,6 @@ Page({
changePrice: function () {
let product = this.data.product, price = 0, allPrice = 0;
// 顺手购价格
price += this.data.smoothlyTotal || 0;
allPrice = price
product.map(item => {
price = price + item.sku.price * item.productNum;
if (this.data.allowance_data && this.data.select_allowance && this.data.allowance_price) {
@ -248,19 +257,27 @@ Page({
price -= this.data.allowance_price * item.productNum < spread_price ? this.data.allowance_price * item.productNum : spread_price
}
})
if (this.data.coupon && this.data.showPrice != price) {
wx.showToast({
title: '订单价格发生变化,请重新选择优惠券',
icon: 'none'
})
app.globalData.couponInfo = null;
if (!this.data.kjId && !this.data.gp_id) {
this.couponCom.setNullCoupon()
}
this.setData({
coupon: null
})
}
allPrice = price
// 顺手购价格
if (!this.data.coupon) {
price += this.data.smoothlyTotal || 0;
}
// if (this.data.coupon && this.data.showPrice != price) {
// wx.showToast({
// title: '订单价格发生变化,请重新选择优惠券',
// icon: 'none'
// })
// app.globalData.couponInfo = null;
// if (!this.data.kjId && !this.data.gp_id) {
// this.couponCom.setNullCoupon()
// }
// this.setData({
// coupon: null
// })
// }
this.setData({
showPrice: app.globalData.kjId ? 0 : price
})
@ -568,6 +585,8 @@ Page({
this.setData({
coupon:e.detail
})
this.changePrice()
},
/**

9
pages/order/postOrder/index.wxml

@ -118,7 +118,7 @@
<!-- 顺手购组件 -->
<smoothly-order
wx:if="{{product.length > 0 && flag!='mix' && showYhq}}"
wx:if="{{product.length > 0 && flag!='mix' && showYhq && !coupon.id}}"
id="smoothlyOrderComp"
productId="{{product[0].product.id}}"
bind:callOtherComp="callOtherCompMethod"
@ -127,7 +127,7 @@ type="{{product[0].user_select_type == 0 ? 'post' : ''}}"
postId="{{address.id}}"
></smoothly-order>
<view style="height:113rpx"></view>
<view style="height:200rpx"></view>
<view class="fixed-bottom" wx:if="{{product}}">
<view class="fixed-price-box" wx:if="{{!prizeId}}">
<view wx:if="{{coupon && showYhq}}">
@ -156,3 +156,8 @@ postId="{{address.id}}"
<rich-text nodes="{{allowance_data.content}}"></rich-text>
</view>
</view>
<!-- <view class="tishi" wx-if="{{coupon.id && smoothlyTotal > 0}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/thyh/user/tanhaos.png" mode="aspectFill"></image>
购买须知:使用优惠券的组合订单均不支持部分退款
</view> -->

18
pages/order/postOrder/index.wxss

@ -313,3 +313,21 @@ page {
height: 26.67rpx;
margin-right: 12rpx;
}
.tishi {
width: 100%;
height: 67rpx;
background: #FFDEDE;
font-weight: bold;
font-size: 27rpx;
color: #D62828;
display: flex;
align-items: center;
position: fixed;
left: 0;
bottom: 113rpx;
}
.tishi image {
width: 26.67rpx;
height: 26.67rpx;
margin: 0 12rpx 0 26rpx;
}

10
pages/order/roadOrder/index.js

@ -70,14 +70,18 @@ Page({
// 调用子组件清除优惠券方法
callOtherCompMethod: function(e) {
this.couponCom.setNullCoupon()
this.setData({
coupon: null,
})
},
showAllPrice() {
let price = app.globalData.product.price
let allPrice = 0
let allPrice = price
// 顺手购价格
price += this.data.smoothlyTotal || 0;
allPrice = price
if (!this.data.coupon) {
price += this.data.smoothlyTotal || 0;
}
if (this.data.coupon) {
if (this.data.coupon.activity.discount_type == 'pricebreak') {

7
pages/order/roadOrder/index.wxml

@ -33,7 +33,7 @@
<!-- 顺手购组件 -->
<smoothly-order
wx:if="{{product.id}}"
wx:if="{{product.id && !coupon.id}}"
id="smoothlyOrderComp"
productId="{{product.id}}"
bind:callOtherComp="callOtherCompMethod"
@ -74,3 +74,8 @@ bind:updateTotalPrice="handleUpdateTotalPrice"
</view>
</view>
</view>
<!-- <view class="tishi" wx-if="{{coupon.id && smoothlyTotal > 0}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/thyh/user/tanhaos.png" mode="aspectFill"></image>
购买须知:使用优惠券的组合订单均不支持部分退款
</view> -->

19
pages/order/roadOrder/index.wxss

@ -186,3 +186,22 @@ page {
box-shadow: 0px 0px 16rpx 0px rgba(6, 0, 1, 0.1);
z-index: 1;
}
.tishi {
width: 100%;
height: 67rpx;
background: #FFDEDE;
font-weight: bold;
font-size: 27rpx;
color: #D62828;
display: flex;
align-items: center;
position: fixed;
left: 0;
bottom: 113rpx;
}
.tishi image {
width: 26.67rpx;
height: 26.67rpx;
margin: 0 12rpx 0 26rpx;
}

15
pages/order/showOrderNew/index.js

@ -127,7 +127,10 @@ Page({
},
// 调用子组件清除优惠券方法
callOtherCompMethod: function(e) {
this.couponCom.setNullCoupon()
this.selectAllComponents("#coupon")[0].setNullCoupon()
this.setData({
coupon: null,
})
},
hideDate: function () {
this.setData({
@ -296,11 +299,11 @@ Page({
},
totalPrice(price) {
let allPrice = this.data.singlePrice * this.data.productNum
let prices = 0
console.log(this.data.smoothlyTotal,111111)
let prices = allPrice
// 顺手购价格
allPrice += this.data.smoothlyTotal || 0;
prices = allPrice
if (!this.data.coupon) {
allPrice += this.data.smoothlyTotal || 0;
}
if (this.data.coupon) {
if (this.data.coupon.activity.discount_type == 'pricebreak') {
allPrice = allPrice - this.data.coupon.activity.money
@ -338,7 +341,7 @@ Page({
this.setData({
maxCouponObject: {
price: prices,
skuIds: skuIds.toString()
skuIds: skuIds.toString()
}
})
},

10
pages/order/showOrderNew/index.wxml

@ -50,7 +50,7 @@
<!-- 顺手购组件 -->
<smoothly-order
wx:if="{{product.product.id}}"
wx:if="{{product.product.id && !coupon.id}}"
id="smoothlyOrderComp"
productId="{{product.product.id}}"
bind:callOtherComp="callOtherCompMethod"
@ -59,7 +59,13 @@
<view style="{{type=='museum' || type=='activity'?'height:138rpx':'height:113rpx'}}"></view>
<view style="{{type=='museum' || type=='activity'?'height:188rpx':'height:163rpx'}}"></view>
<!-- <view class="tishi" wx-if="{{coupon.id && smoothlyTotal > 0}}">
<image src="https://static.ticket.sz-trip.com/jundaosuzhou/images/thyh/user/tanhaos.png" mode="aspectFill"></image>
购买须知:使用优惠券的组合订单均不支持部分退款
</view> -->
<view class="fixed-bottom">
<view class="fixed-price-box" wx:if="{{kjId || prizeId}}"><text>合计:</text><text class="price">¥0</text></view>
<view class="fixed-price-box" wx:else><text>合计:</text>

19
pages/order/showOrderNew/index.wxss

@ -456,3 +456,22 @@ text-align: center;
content: "¥";
font-size: 24rpx;
}
.tishi {
width: 100%;
height: 67rpx;
background: #FFDEDE;
font-weight: bold;
font-size: 27rpx;
color: #D62828;
display: flex;
align-items: center;
position: fixed;
left: 0;
bottom: 113rpx;
}
.tishi image {
width: 26.67rpx;
height: 26.67rpx;
margin: 0 12rpx 0 26rpx;
}

9
project.private.config.json

@ -9,7 +9,7 @@
{
"name": "pages/info/postProductInfo/index",
"pathName": "pages/info/postProductInfo/index",
"query": "id=464888",
"query": "id=464726",
"scene": null,
"launchMode": "default"
},
@ -20,6 +20,13 @@
"launchMode": "default",
"scene": null
},
{
"name": "pages/info/roadInfo/index",
"pathName": "pages/info/roadInfo/index",
"query": "id=463608",
"launchMode": "default",
"scene": null
},
{
"name": "pages/info/showInfo/index",
"pathName": "pages/info/showInfo/index",

8
utils/util.js

@ -207,7 +207,7 @@ const gotoDetail = (item,isPagePoint,queryStr="") =>{
}
console.log(item)
let tempUrl = ''
switch(item.type){
case "tenscenic":
@ -221,7 +221,9 @@ const gotoDetail = (item,isPagePoint,queryStr="") =>{
pagePointData.event='ticket_detail_click'
pagePoint(pagePointData,1)
}
// tempUrl = detailDomain+`/ScenicDetail?id=${item.scene_id || item.id}`
wx.navigateTo({
// url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl),
url: '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id)+queryStr
})
break;
@ -310,7 +312,7 @@ const gotoDetail = (item,isPagePoint,queryStr="") =>{
break;
case "movie":
// 产品 电影票
let tempUrl = 'https://m.cloud.sz-trip.com'+`/MovieInfo?id=${item.third_id || item.id}`+'&title='+item.title+queryStr
tempUrl = 'https://m.cloud.sz-trip.com'+`/MovieInfo?id=${item.third_id || item.id}`+'&title='+item.title+queryStr
wx.navigateTo({
url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl),
// url: '/pages/list/movieticket/list/info/index?id='+(item.third_id || item.id)+'&title='+item.title
@ -328,7 +330,9 @@ const gotoDetail = (item,isPagePoint,queryStr="") =>{
pagePointData.event='ticket_detail_click'
pagePoint(pagePointData,1)
}
// tempUrl = detailDomain+`/ScenicDetail?id=${item.scene_id || item.id}`
wx.navigateTo({
// url: '/pages/pbService/web/index?weburl=' + encodeURIComponent(tempUrl),
url: '/pages/info/sceneProductInfo/index?id='+(item.scene_id || item.id)+queryStr
})
break;

Loading…
Cancel
Save