diff --git a/pages/info/sceneProductInfo/index.js b/pages/info/sceneProductInfo/index.js
index 6514471..0e26700 100644
--- a/pages/info/sceneProductInfo/index.js
+++ b/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
diff --git a/pages/order/WineSceneOrder/index.js b/pages/order/WineSceneOrder/index.js
index d218f29..0f1a429 100644
--- a/pages/order/WineSceneOrder/index.js
+++ b/pages/order/WineSceneOrder/index.js
@@ -42,7 +42,11 @@ Page({
showDate:false,
showDate2:false,
showYhq:null,
- couponFlag:false
+ couponFlag:false,
+
+ smoothlyTotal: 0,
+ maxCouponObject: null,
+ couponCom: null
},
/**
@@ -77,7 +81,8 @@ Page({
}
this.setData({singlePrice: this.data.product.sku.price})
- this.showAllPrice()
+ // this.showAllPrice()
+ this.totalPrice(this.data.singlePrice)
console.log(this.data);
console.log(this.data.product.product.ZTPoint)
@@ -86,7 +91,22 @@ Page({
},
-
+ // 子组件发生改变时更新价格
+ handleUpdateTotalPrice(e) {
+ this.setData({
+ smoothlyTotal: e.detail.total
+ });
+ // 重新计算总价
+ this.totalPrice(this.data.singlePrice)
+ },
+ // 调用子组件清除优惠券方法
+ callOtherCompMethod: function(e) {
+ console.log(this.selectAllComponents("#coupon")[0])
+ this.selectAllComponents("#coupon")[0].setNullCoupon()
+ this.setData({
+ coupon:null
+ })
+ },
showBookingInfo: function (e) {
this.setData({
bookingInfo: this.data.product.sku.sku_model,
@@ -230,15 +250,22 @@ Page({
this.totalPrice(this.data.singlePrice)
},
totalPrice(price) {
- let allPrice
+ let allPrice = this.data.singlePrice * this.data.productNum
+ let prices = allPrice
+
+ // 顺手购价格
+ if (!this.data.coupon) {
+ allPrice += this.data.smoothlyTotal || 0;
+ }
+
if (this.data.coupon) {
if (this.data.coupon.activity.discount_type == 'pricebreak') {
- allPrice = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
+ allPrice = allPrice - this.data.coupon.activity.money
} else {
- allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
+ allPrice =(allPrice * this.data.coupon.activity.fold)/ 10
}
} else {
- allPrice = this.data.singlePrice * this.data.productNum
+ allPrice = allPrice
}
// allPrice = price * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0)
@@ -254,10 +281,40 @@ Page({
})
}
console.log('singlePrice',this.data.singlePrice);
+
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ const skuIds = []
+ skuIds.push(this.data.product.sku.id)
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSkuIds = smoothlyComp.hasSelectedGoods();
+ if(hasSkuIds) {
+ skuIds.push(...smoothlyComp.emitSkuIds())
+ }
+ }
+ this.setData({
+ maxCouponObject: {
+ price: prices,
+ skuIds: skuIds.toString()
+ }
+ })
},
order:function() {
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSelected = smoothlyComp.hasSelectedGoods();
+ if(hasSelected && !smoothlyComp.data.address) {
+ wx.showToast({
+ title: '请选择收货地址',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
let linkmanList = this.data.linkmanList, productNum = this.data.productNum, date = this.data.date, time = this.data.time, remark = this.data.remark, product = this.data.product;
let linkmanIds = [];
@@ -282,6 +339,12 @@ Page({
team_id: app.globalData.team_id,
}
+
+ // 顺手购下单参数
+ if(smoothlyComp && smoothlyComp.emitOrder() && smoothlyComp.emitOrder().length) {
+ data.product_list.push(...smoothlyComp.emitOrder())
+ }
+
if (app.globalData.from) {
data.system_name = app.globalData.from;
}
@@ -383,7 +446,8 @@ Page({
this.setData({
coupon:e.detail
})
- this.showAllPrice()
+ // this.showAllPrice()
+ this.totalPrice(this.data.singlePrice)
},
/**
diff --git a/pages/order/WineSceneOrder/index.json b/pages/order/WineSceneOrder/index.json
index 6e93399..42dca0a 100644
--- a/pages/order/WineSceneOrder/index.json
+++ b/pages/order/WineSceneOrder/index.json
@@ -3,6 +3,7 @@
"title":"/pages/component/TitleHeader",
"contact":"../components/contact/index",
"coupon":"../components/coupon/index",
- "notice":"/pages/component/notice/notice"
+ "notice":"/pages/component/notice/notice",
+ "smoothly-order": "/pages/order/components/smoothlyOrder/index"
}
}
\ No newline at end of file
diff --git a/pages/order/WineSceneOrder/index.wxml b/pages/order/WineSceneOrder/index.wxml
index e2f5348..254ec69 100644
--- a/pages/order/WineSceneOrder/index.wxml
+++ b/pages/order/WineSceneOrder/index.wxml
@@ -38,10 +38,17 @@
-
-
+ money="{{singlePrice * productNum}}" sku="{{product.sku.id}}" couponFlag="{{couponFlag}}" maxCouponObject="{{maxCouponObject}}">
+
+
+
合计:
¥{{price}}
@@ -51,4 +58,8 @@
+
\ No newline at end of file
diff --git a/pages/order/WineSceneOrder/index.wxss b/pages/order/WineSceneOrder/index.wxss
index 3e49fea..6676d7b 100644
--- a/pages/order/WineSceneOrder/index.wxss
+++ b/pages/order/WineSceneOrder/index.wxss
@@ -1,6 +1,7 @@
/* pages/.wxss */
page {
background: #f6f6f6;
+ padding-bottom: 150rpx;
}
.group-order {
@@ -450,4 +451,23 @@ page {
.s-price::before {
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;
}
\ No newline at end of file
diff --git a/pages/order/components/address/index.js b/pages/order/components/address/index.js
index b105bf0..6f7e6cd 100644
--- a/pages/order/components/address/index.js
+++ b/pages/order/components/address/index.js
@@ -11,7 +11,10 @@ Component({
addGlobalClass: true
},
properties: {
-
+ showSelect: {
+ type: Boolean,
+ value: true
+ },
},
/**
diff --git a/pages/order/components/address/index.wxml b/pages/order/components/address/index.wxml
index ad0299e..9609703 100644
--- a/pages/order/components/address/index.wxml
+++ b/pages/order/components/address/index.wxml
@@ -1,4 +1,4 @@
-
+
收货地址
选择
diff --git a/pages/order/components/coupon/index.js b/pages/order/components/coupon/index.js
index 883a94b..7b6cf8a 100644
--- a/pages/order/components/coupon/index.js
+++ b/pages/order/components/coupon/index.js
@@ -2,93 +2,112 @@
import commonApi from "../../../../utils/https/common"
let app = getApp()
Component({
- /**
- * 组件的属性列表
- */
- properties: {
- money:{
- type:String,
- value:"0"
- },
- sku:{
- type:String,
- value:""
- },
- couponFlag:{
- type:Boolean,
- value:false,
- observer(nv, ov) {
- console.log(nv,ov)
- if (nv) {
- app.globalData.couponInfo = null
- this.setData({
- coupon:null
- })
- }
- }
- }
- },
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ money: {
+ type: String,
+ value: "0"
+ },
+ sku: {
+ type: String,
+ value: ""
+ },
+ couponFlag: {
+ type: Boolean,
+ value: false,
+ observer(nv, ov) {
+ console.log(nv, ov)
+ if (nv) {
+ app.globalData.couponInfo = null
+ this.setData({
+ coupon: null
+ })
+ }
+ }
+ },
+ maxCouponObject: {
+ type: Object,
+ value: null,
+ observer(nv, ov) {
+ console.log(111, nv, ov)
+ this.getMaxPrice()
+ }
+ }
+ },
- /**
- * 组件的初始数据
- */
- data: {
- coupon:null
- },
- pageLifetimes: {
- show: function() {
- this.getMaxCoupon()
- }
- },
- lifetimes:{
- attached(){
- },
- },
- /**
- * 组件的方法列表
- */
- methods: {
- setNullCoupon:function(){
- app.globalData.couponInfo = null
- this.setData({
- coupon:null
- })
- },
- getMaxCoupon(){
- // console.log(app.globalData.couponInfo);
- console.log(this.data.coupon);
- if (app.globalData.couponInfo===false) {
- this.setData({
- coupon:null
- })
- this.triggerEvent('getNewCoupon',null);
- }else{
- commonApi.user_post('coupon/use_max_coupon_list',{
- money:this.data.money,
- sku_ids:this.data.sku
- }).then(res=>{
- if (app.globalData.couponInfo&&app.globalData.couponInfo.hasOwnProperty('SubCoupon')) {
- this.setData({
- coupon:app.globalData.couponInfo
- })
- this.triggerEvent('getNewCoupon',app.globalData.couponInfo);
- console.log("我用的原来的数据");
- }else{
- console.log("我用的新的数据");
- console.log('123123132',res.data);
- if ( Object.keys(res.data).length!=0) {
- app.globalData.couponInfo = res.data
- this.setData({
- coupon:res.data
- })
- console.log(this.data.coupon);
- this.triggerEvent('getNewCoupon',res.data);
- }
- }
- })
- }
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ coupon: null,
+ maxCouponPrice: 0
+ },
+ pageLifetimes: {
+ show: function() {
+ this.getMaxCoupon()
+ }
+ },
+ lifetimes: {
+ attached() {},
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ setNullCoupon: function() {
+ console.log(44154)
+ app.globalData.couponInfo = null
+ this.setData({
+ coupon: null
+ })
+ },
+ getMaxCoupon() {
+ // console.log(app.globalData.couponInfo);
+ console.log(this.data.coupon);
+ if (app.globalData.couponInfo === false) {
+ this.setData({
+ coupon: null
+ })
+ this.triggerEvent('getNewCoupon', null);
+ } else {
+ commonApi.user_post('coupon/use_max_coupon_list', {
+ money: this.data.money,
+ sku_ids: this.data.sku
+ }).then(res => {
+ if (app.globalData.couponInfo && app.globalData.couponInfo.hasOwnProperty(
+ 'SubCoupon')) {
+ this.setData({
+ coupon: app.globalData.couponInfo
+ })
+ this.triggerEvent('getNewCoupon', app.globalData.couponInfo);
+ console.log("我用的原来的数据");
+ } else {
+ console.log("我用的新的数据");
+ console.log('123123132', res.data);
+ if (Object.keys(res.data).length != 0) {
+ app.globalData.couponInfo = res.data
+ this.setData({
+ coupon: res.data
+ })
+ console.log(this.data.coupon);
+ this.triggerEvent('getNewCoupon', res.data);
+ }
+ }
+ })
+ }
+ },
+ getMaxPrice() {
+ commonApi.user_post('coupon/use_max_coupon_list', {
+ money: this.data.maxCouponObject.price,
+ sku_ids: this.data.maxCouponObject.skuIds
+ }).then(res => {
+ this.setData({
+ maxCouponPrice: res.data.activity.money
+ })
+ })
+ }
+ },
- }
- },
-
-})
+})
\ No newline at end of file
diff --git a/pages/order/components/coupon/index.wxml b/pages/order/components/coupon/index.wxml
index d93a9e6..e37cf14 100644
--- a/pages/order/components/coupon/index.wxml
+++ b/pages/order/components/coupon/index.wxml
@@ -2,14 +2,18 @@
优惠券
+
- -{{coupon.activity.money/100}}
+ -¥{{coupon.activity.money/100}}
{{coupon.activity.fold}}折
- 请选择
+
+ >
diff --git a/pages/order/components/coupon/index.wxss b/pages/order/components/coupon/index.wxss
index 0a1745c..15d6205 100644
--- a/pages/order/components/coupon/index.wxss
+++ b/pages/order/components/coupon/index.wxss
@@ -8,17 +8,27 @@
height: 113rpx;
margin: 0 20rpx;
font-size: 31rpx;
- color: #000;
+ color: #E30000;
font-weight: 500;
display: flex;
align-items: center;
}
.coupon-btn {
- width: 138rpx;
+ width: 50rpx;
line-height: 56rpx;
- border: 1px solid #333333;
+ /* border: 1px solid #333333; */
border-radius: 29rpx;
text-align: center;
font-size: 28rpx;
- color: #000;
+ color: #333333;
+}
+.coupon-left {
+ line-height: 40rpx;
+ background: #FFDEDE;
+ border-radius: 13rpx;
+ padding: 0 18rpx;
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #E30000;
+ margin-right: 20rpx;
}
\ No newline at end of file
diff --git a/pages/order/components/smoothlyOrder/index.js b/pages/order/components/smoothlyOrder/index.js
new file mode 100644
index 0000000..1441696
--- /dev/null
+++ b/pages/order/components/smoothlyOrder/index.js
@@ -0,0 +1,313 @@
+import commonApi from "../../../../utils/https/common"
+let app = getApp()
+Component({
+ properties: {
+ productId: {
+ type: [String, Number],
+ value: ''
+ },
+ postId: {
+ type: [String, Number],
+ value: ''
+ },
+ type: {
+ type: String,
+ value: ''
+ }
+ },
+ data: {
+ addressList: [],
+ addressIndex: -1,
+ address: null,
+ smoothlyList: [],
+ sommthlyIndex: 0,
+ showAddressPopup: false,
+ showItem: null,
+ showSkuPopup: false,
+ content: ''
+ },
+ lifetimes: {
+ attached() {
+ this.setData({
+ sommthlyIndex: 0
+ })
+ this.getList()
+
+ // 组件初始化时,通知父组件重置价格为 0
+ this.triggerEvent('updateTotalPrice', {
+ total: 0
+ });
+ }
+ },
+ observers: {
+ 'type': function(newVal, oldVal) {
+ // 当从邮寄切换到自提时
+ if (oldVal === 'post' && newVal !== 'post') {
+ // 重置所有商品邮费
+ const smoothlyList = this.data.smoothlyList.map(item => ({
+ ...item,
+ postMoney: 0
+ }))
+ this.setData({
+ smoothlyList,
+ addressIndex: -1
+ })
+ // 重新计算总价
+ this.calculateTotalPrice()
+ } else if (newVal === 'post') {
+ // 切换到邮寄时重新计算邮费
+ this.showPostMoney()
+ }
+ },
+ 'postId': function(newVal, oldVal) {
+ // 只有当当前是邮寄类型时,才重新计算邮费
+ if (this.data.type === 'post' && newVal !== oldVal) {
+ this.showPostMoney()
+ }
+ }
+ },
+ onload() {
+ this.couponCom = this.selectAllComponents("#coupon")[0];
+ },
+ methods: {
+ // 查看规格信息
+ showSkuInfo(e) {
+ console.log(e)
+ this.setData({
+ showItem: e.currentTarget.dataset.item,
+ showSkuPopup: true,
+ content: e.currentTarget.dataset.item.content
+ })
+ console.log(this.data.showItem)
+ },
+ closePopup() {
+ this.setData({
+ showSkuPopup: false
+ })
+ },
+ // 是否有选中商品
+ hasSelectedGoods() {
+ return this.data.smoothlyList.some(item => (item.buyNum || 0) > 0);
+ },
+ // 规格id
+ emitSkuIds() {
+ let skuIds = []
+ this.data.smoothlyList.forEach(item => {
+ if (item.buyNum > 0) {
+ skuIds.push(item.sku_id)
+ }
+ });
+ return skuIds;
+ },
+ // 下单参数
+ emitOrder() {
+ let orderList = []
+ this.data.smoothlyList.forEach(item => {
+ if (item.buyNum > 0) {
+ orderList.push({
+ type: item.type,
+ product_id: item.id,
+ sku_id: item.sku_id,
+ post: this.data.type == 'post' ? this.data.postId : (this.data.address ?
+ this.data
+ .address.id : ''),
+ product_num: item.buyNum,
+ use_type: 0,
+ is_batch_shipment: 0,
+ })
+ }
+ })
+ return orderList
+ },
+ switchSmoothlyList() {
+ const {
+ smoothlyList,
+ sommthlyIndex
+ } = this.data
+ // 重置当前商品数量
+ smoothlyList[sommthlyIndex].buyNum = 0
+
+ // 更新索引
+ const newIndex = sommthlyIndex < smoothlyList.length - 1 ? sommthlyIndex + 1 : 0
+ this.setData({
+ smoothlyList,
+ sommthlyIndex: newIndex
+ })
+
+ this.showPostMoney().then(() => {
+ this.calculateTotalPrice()
+ })
+ },
+ setNullCoupons() {
+ if (app.globalData.couponInfo != null) {
+ wx.showToast({
+ title: '订单价格发生变化,请重新选择优惠券',
+ icon: 'none'
+ })
+
+ this.triggerEvent('callOtherComp', {
+ methodName: 'setNullCoupon', // 要调用的子组件B的方法名
+ });
+ }
+ },
+ setAddress(e) {
+ console.log(e.detail);
+ this.setData({
+ address: e.detail
+ })
+ this.showPostMoney().then(() => {
+ this.calculateTotalPrice()
+ })
+ },
+ showAddress() {
+ const childComp = this.selectComponent('#addressComp');
+ if (!childComp) {
+ wx.showToast({
+ title: '组件未加载完成',
+ icon: 'none'
+ });
+ return;
+ }
+ childComp.showLinkman()
+ },
+ 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;
+ }
+ },
+ getList() {
+ commonApi.user_post('product/get_convenient_purchase', {
+ page: 1,
+ limit: 100,
+ product_id: this.data.productId
+ }).then(res => {
+ if (res.data) {
+ const smoothlyList = res.data.map(i => ({
+ ...i,
+ headimg: this.showImg(i.headimg),
+ buyNum: 0,
+ postMoney: 0
+ }));
+ this.setData({
+ smoothlyList
+ });
+ }
+ })
+ },
+ showPostMoney() {
+ const {
+ type,
+ postId,
+ addressList,
+ addressIndex,
+ smoothlyList
+ } = this.data
+
+ if (type == 'post') {
+ if (!postId) return Promise.resolve()
+ } else {
+ if (!this.data.address) return Promise.resolve()
+ }
+
+ const promises = smoothlyList.map(item => {
+ if (item.buyNum > 0) {
+ return commonApi.user_post("order/get_post_price", {
+ sku_id: item.sku_id,
+ num: item.buyNum,
+ consignee_id: type == 'post' ? postId : (this.data.address ? this.data
+ .address.id : '')
+ }).then(res => {
+ if (res.code == 1) {
+ // 更新对应商品的邮费
+ const newList = [...smoothlyList]
+ const idx = newList.findIndex(i => i.sku_id === item.sku_id)
+ console.log(res.data.price)
+ if (idx > -1) {
+ newList[idx].postMoney = res.data.price
+ this.setData({
+ smoothlyList: newList
+ })
+ }
+ }
+ })
+ }
+ return Promise.resolve()
+ })
+
+ return Promise.all(promises)
+ },
+ decreaseSkuNum(e) {
+ const item = e.currentTarget.dataset.item
+ const {
+ smoothlyList
+ } = this.data
+
+ if (item.buyNum > 0) {
+ // 找到对应商品并更新数量
+ const newList = smoothlyList.map(i => {
+ if (i.sku_id === item.sku_id) {
+ return {
+ ...i,
+ buyNum: i.buyNum - 1
+ }
+ }
+ return i
+ })
+
+ this.setData({
+ smoothlyList: newList
+ })
+ this.setNullCoupons()
+ this.showPostMoney().then(() => {
+ this.calculateTotalPrice()
+ })
+ }
+ },
+
+ increaseSkuNum(e) {
+ const item = e.currentTarget.dataset.item
+ const {
+ smoothlyList
+ } = this.data
+
+ // 找到对应商品并更新数量
+ const newList = smoothlyList.map(i => {
+ if (i.sku_id === item.sku_id) {
+ return {
+ ...i,
+ buyNum: i.buyNum + 1
+ }
+ }
+ return i
+ })
+
+ this.setData({
+ smoothlyList: newList
+ })
+
+ this.showPostMoney().then(() => {
+ this.calculateTotalPrice()
+ })
+ },
+ // 计算总价
+ calculateTotalPrice() {
+ let total = 0;
+ this.data.smoothlyList.forEach(item => {
+ if (item.buyNum > 0) {
+ const itemPrice = parseFloat(item.price) * item.buyNum;
+ total += itemPrice + item.postMoney;
+ }
+ });
+ this.triggerEvent('updateTotalPrice', {
+ total
+ });
+ return total;
+ },
+ }
+})
\ No newline at end of file
diff --git a/pages/order/components/smoothlyOrder/index.json b/pages/order/components/smoothlyOrder/index.json
new file mode 100644
index 0000000..0111e85
--- /dev/null
+++ b/pages/order/components/smoothlyOrder/index.json
@@ -0,0 +1,6 @@
+{
+ "component": true,
+ "usingComponents": {
+ "address":"../../components/address/index"
+ }
+}
\ No newline at end of file
diff --git a/pages/order/components/smoothlyOrder/index.wxml b/pages/order/components/smoothlyOrder/index.wxml
new file mode 100644
index 0000000..3a6c7d6
--- /dev/null
+++ b/pages/order/components/smoothlyOrder/index.wxml
@@ -0,0 +1,80 @@
+
+
+
+
+ 顺手带一件
+
+
+ 换一换
+
+
+
+
+
+
+
+
+ 收货地址 点击填写收货地址
+
+
+
+
+
+
+ 收货地址
+
+
+ {{address.name}}{{address.tel}}
+
+
+ {{address.address}}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.title}}
+
+
+ {{item.sku_name}}
+
+ {{item.price / 100}}(另需运费¥{{item.postMoney / 100}})
+
+
+
+ {{item.buyNum}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/order/components/smoothlyOrder/index.wxss b/pages/order/components/smoothlyOrder/index.wxss
new file mode 100644
index 0000000..993b443
--- /dev/null
+++ b/pages/order/components/smoothlyOrder/index.wxss
@@ -0,0 +1,254 @@
+.flex-between {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.container {
+ width: 750rpx;
+}
+
+.box {
+ width: 700rpx;
+ background: #FFFFFF;
+ border-radius: 9.33rpx;
+ padding: 0 21.33rpx 46.67rpx;
+ margin: 0 auto;
+ box-sizing: border-box;
+}
+
+.top-title {
+ height: 110rpx;
+ font-weight: bold;
+ font-size: 30.67rpx;
+ color: #000000;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.refresh-btn {
+ font-weight: bold;
+ font-size: 28rpx;
+ color: #0B898E;
+ display: flex;
+ align-items: center;
+}
+
+.refresh-btn image {
+ width: 32rpx;
+ margin-right: 13.33rpx;
+}
+
+.address-box {
+ width: 655.33rpx;
+ height: 80rpx;
+ background: rgba(11, 137, 142, .06);
+ border-radius: 13.33rpx;
+ padding: 0 21.33rpx;
+ font-weight: 500;
+ font-size: 26.67rpx;
+ color: #0B898E;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ box-sizing: border-box;
+}
+
+.address-box .location {
+ width: 42.67rpx;
+ margin-right: 26.67rpx;
+}
+
+.address-box .rightIcon {
+ width: 20rpx;
+}
+
+.address-boxs {
+ width: 655.33rpx;
+ height: 133.33rpx;
+ background: #F7F7F7;
+ border-radius: 13.33rpx;
+ padding: 13.33rpx 21.33rpx;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ box-sizing: border-box;
+}
+
+.address-boxs .location {
+ width: 42.67rpx;
+ margin-right: 26.67rpx;
+}
+
+.address-boxs .content {
+ display: flex;
+ align-items: center;
+ margin-right: 33.33rpx;
+}
+
+.address-boxs .content .left {
+ font-weight: 500;
+ font-size: 26.67rpx;
+ color: #000000;
+}
+
+.address-boxs .content .right {
+ width: 333.33rpx;
+ margin-left: 16.67rpx;
+}
+
+.address-boxs .content .right .top {
+ font-weight: 400;
+ font-size: 30.67rpx;
+ color: #000000;
+}
+
+.address-boxs .content .right .top text {
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #666666;
+ margin-left: 33.33rpx;
+}
+
+.address-boxs .content .right .bottom {
+ margin-top: 6.67rpx;
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #666666;
+}
+
+.address-boxs .rightIcon {
+ width: 33.33rpx;
+}
+
+.product-item {
+ height: 153.33rpx;
+ display: flex;
+ width: 100%;
+ margin-top: 40rpx;
+}
+
+.product-item .product-img {
+ width: 153.33rpx;
+ height: 153.33rpx;
+ border-radius: 13.33rpx;
+ margin-right: 20rpx;
+}
+
+.product-item .product-content {
+ flex: 1;
+ height: 153.33rpx;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+}
+
+.product-item .product-content .title-boxs {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.product-item .product-content .title-boxs .title {
+ width: 445.33rpx;
+ font-weight: 500;
+ font-size: 28rpx;
+ color: #000000;
+}
+
+.product-item .product-content .title-boxs image {
+ width: 20rpx;
+}
+
+.product-item .product-content .subtitle {
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #999999;
+}
+
+.product-item .product-content .price {
+ font-weight: 500;
+ font-size: 33.33rpx;
+ color: #E30000;
+}
+
+.product-item .product-content .price::before {
+ content: '¥';
+ font-size: 24rpx;
+}
+
+.product-item .product-content .price text {
+ font-weight: 500;
+ font-size: 24rpx;
+ color: #E30000;
+ margin-left: 6.67rpx;
+}
+
+.product-item .product-content .product-btn {
+ width: 160rpx;
+ font-weight: bold;
+ font-size: 28rpx;
+ color: #111111;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.product-item .product-content .product-btn image {
+ width: 46.67rpx;
+ flex-shrink: 0;
+}
+
+.sku-box {
+ width: 100vw;
+ height: 100vh;
+ background: rgba(0, 0, 0, 0.3);
+ position: fixed;
+ z-index: 99;
+ left: 0;
+ bottom: 0;
+}
+
+.sku-popup {
+ position: fixed;
+ left: 0;
+ bottom: 0;
+ width: 100%;
+ height: 60vh;
+ background-color: #fff;
+ padding: 20rpx;
+ box-sizing: border-box;
+ overflow-x: hidden;
+}
+
+.sku-name {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 35rpx;
+ font-weight: bold;
+ height: 80rpx;
+ padding: 0 20rpx;
+ box-sizing: border-box;
+}
+.sku-name span {
+ font-weight: 400;
+}
+
+.sku-content {
+ width: 100%;
+ height: 50vh;
+ overflow-y: auto;
+ overflow-x: hidden;
+ max-width: 100%;
+}
+
+.sz-xcx-fwb-img {
+ width: 100% !important;
+ height: auto !important;
+ display: block !important;
+ margin: 0 auto !important;
+ object-fit: contain !important;
+ max-width: 100% !important;
+}
\ No newline at end of file
diff --git a/pages/order/food/index.js b/pages/order/food/index.js
index 1a3cf66..003669e 100644
--- a/pages/order/food/index.js
+++ b/pages/order/food/index.js
@@ -16,6 +16,9 @@ Page({
showNoticeFlag:false,
coupon:null,
price: 0,
+ smoothlyTotal: 0,
+ maxCouponObject: null,
+ couponCom: null
},
/**
@@ -37,6 +40,21 @@ Page({
console.log(app.globalData.product)
this.showAllPrice()
},
+ // 子组件发生改变时更新价格
+ handleUpdateTotalPrice(e) {
+ this.setData({
+ smoothlyTotal: e.detail.total
+ });
+ // 重新计算总价
+ this.showAllPrice();
+ },
+ // 调用子组件清除优惠券方法
+ callOtherCompMethod: function(e) {
+ this.couponCom.setNullCoupon()
+ this.setData({
+ coupon:null
+ })
+ },
showNotice:function(){
this.setData({
showNoticeFlag:true
@@ -58,22 +76,47 @@ Page({
showAllPrice () {
console.log('couponInfo',app.globalData.couponInfo);
- let price
+ let price = this.data.product.sku.price * this.data.productNum
+ let allPrice = 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 = this.data.product.sku.price * this.data.productNum - this.data.coupon.activity.money
+ price = price - this.data.coupon.activity.money
} else {
- price =(this.data.product.sku.price * this.data.productNum * this.data.coupon.activity.fold)/ 10
+ price =(price * this.data.coupon.activity.fold)/ 10
}
} else {
- price = this.data.product.sku.price * this.data.productNum
+ price = price
}
if (price >0) {
this.setData({ price:price/100})
}else {
this.setData({ price:0 })
}
-
+
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ const skuIds = []
+ skuIds.push(this.data.product.sku.id)
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSkuIds = smoothlyComp.hasSelectedGoods();
+ if(hasSkuIds) {
+ skuIds.push(...smoothlyComp.emitSkuIds())
+ }
+ }
+ this.setData({
+ maxCouponObject: {
+ price: allPrice,
+ skuIds: skuIds.toString()
+ }
+ })
},
/**
@@ -116,6 +159,19 @@ Page({
})
},
order:function(){
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSelected = smoothlyComp.hasSelectedGoods();
+ if(hasSelected && !smoothlyComp.data.address) {
+ wx.showToast({
+ title: '请选择收货地址',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
// if(!this.data.user){
// wx.showToast({
// title: '请输入联系人',
@@ -143,6 +199,12 @@ Page({
source:"WECHATXCX",
coupon_id:this.data.coupon?this.data.coupon.id:null
};
+
+ // 顺手购下单参数
+ if(smoothlyComp && smoothlyComp.emitOrder() && smoothlyComp.emitOrder().length) {
+ product_list.push(...smoothlyComp.emitOrder())
+ }
+
if(app.globalData.from){
data.system_name = app.globalData.from;
}
diff --git a/pages/order/food/index.json b/pages/order/food/index.json
index fe0a5a2..84c6148 100644
--- a/pages/order/food/index.json
+++ b/pages/order/food/index.json
@@ -2,6 +2,7 @@
"usingComponents": {
"title":"/pages/component/TitleHeader",
"notice":"/pages/component/notice/notice",
- "coupon":"/pages/order/components/coupon/index"
+ "coupon":"/pages/order/components/coupon/index",
+ "smoothly-order": "/pages/order/components/smoothlyOrder/index"
}
}
\ No newline at end of file
diff --git a/pages/order/food/index.wxml b/pages/order/food/index.wxml
index 4f4c5c3..4e2da04 100644
--- a/pages/order/food/index.wxml
+++ b/pages/order/food/index.wxml
@@ -28,12 +28,27 @@
-
-
+
+
+
+
+
+
订单金额:¥{{price}}
提交订单
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/pages/order/food/index.wxss b/pages/order/food/index.wxss
index f9ec664..33525e4 100644
--- a/pages/order/food/index.wxss
+++ b/pages/order/food/index.wxss
@@ -132,4 +132,23 @@ margin-top: 30rpx;
color: #D62828;
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;
}
\ No newline at end of file
diff --git a/pages/order/postOrder/index.js b/pages/order/postOrder/index.js
index c9e6397..a13f797 100644
--- a/pages/order/postOrder/index.js
+++ b/pages/order/postOrder/index.js
@@ -29,12 +29,16 @@ Page({
showYhq:null,
pickupIndex: null,
+
+ smoothlyTotal: 0,
+ maxCouponObject: null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
+ console.log(this.data.product)
this.setData({
from: options.from,
kjId: app.globalData.kjId,
@@ -45,8 +49,25 @@ Page({
showYhq:app.globalData.listName?false:true
})
this.handleProduct()
+ console.log(this.data.product)
+ },
+
+ // 子组件发生改变时更新价格
+ handleUpdateTotalPrice(e) {
+ 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) => {
item.keyIndex = index
@@ -195,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;
@@ -218,7 +248,8 @@ Page({
this.changePrice()
},
changePrice: function () {
- let product = this.data.product, price = 0;
+ let product = this.data.product, price = 0, allPrice = 0;
+
product.map(item => {
price = price + item.sku.price * item.productNum;
if (this.data.allowance_data && this.data.select_allowance && this.data.allowance_price) {
@@ -226,24 +257,62 @@ 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
})
+
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ const skuIds = []
+ skuIds.push(this.data.sku_id)
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSkuIds = smoothlyComp.hasSelectedGoods();
+ if(hasSkuIds) {
+ skuIds.push(...smoothlyComp.emitSkuIds())
+ }
+ }
+ this.setData({
+ maxCouponObject: {
+ price: allPrice,
+ skuIds: skuIds.toString()
+ }
+ })
},
order: function () {
+ // 顺手带一件是否选择收货地址
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ if(smoothlyComp && this.data.product[0].user_select_type == 1) {
+ // 检查是否有选中的顺手购商品
+ const hasSelected = smoothlyComp.hasSelectedGoods();
+ if(hasSelected && !smoothlyComp.data.address) {
+ wx.showToast({
+ title: '请选择收货地址',
+ icon: 'none'
+ })
+ return;
+ }
+ }
for(let info of this.data.product) {
if (info.user_select_type == 0) {
@@ -327,6 +396,12 @@ Page({
gp_id: app.globalData.gp_id,
team_id: app.globalData.team_id
};
+
+ // 顺手购下单参数
+ if(smoothlyComp && smoothlyComp.emitOrder() && smoothlyComp.emitOrder().length) {
+ product_list.push(...smoothlyComp.emitOrder())
+ }
+
if (this.data.select_allowance) data.is_allowance = 1
if (app.globalData.from) {
data.system_name = app.globalData.from;
@@ -348,10 +423,11 @@ Page({
data.channel = ZTPointProduct.product.ZTPoint
}
console.log(app.globalData.list,this.data.flag)
+
if(!app.globalData.list || app.globalData.list.length == 0){
// 判断混合下单
let use_type = product_list[0].use_type
- if (product_list.some(x=>x.use_type!=use_type)) {
+ if (product_list.some(x=>x.use_type!=use_type) && !(smoothlyComp && smoothlyComp.emitOrder() && smoothlyComp.emitOrder().length)) {
app.globalData.productPrice = (this.data.showPrice + this.data.postFee - (this.data.coupon?this.data.coupon.activity.money:0))/100;
app.globalData.createDate = data
wx.redirectTo({
@@ -509,6 +585,8 @@ Page({
this.setData({
coupon:e.detail
})
+
+ this.changePrice()
},
/**
diff --git a/pages/order/postOrder/index.json b/pages/order/postOrder/index.json
index e69fb76..7cfd16d 100644
--- a/pages/order/postOrder/index.json
+++ b/pages/order/postOrder/index.json
@@ -2,6 +2,7 @@
"usingComponents": {
"title":"/pages/component/TitleHeader",
"address":"../components/address/index",
- "coupon":"../components/coupon/index"
+ "coupon":"../components/coupon/index",
+ "smoothly-order": "/pages/order/components/smoothlyOrder/index"
}
}
\ No newline at end of file
diff --git a/pages/order/postOrder/index.wxml b/pages/order/postOrder/index.wxml
index 582fcf4..00ed078 100644
--- a/pages/order/postOrder/index.wxml
+++ b/pages/order/postOrder/index.wxml
@@ -114,8 +114,20 @@
-
-
+
+
+
+
+
+
@@ -143,4 +155,9 @@
{{allowance_data.title}}
-
\ No newline at end of file
+
+
+
\ No newline at end of file
diff --git a/pages/order/postOrder/index.wxss b/pages/order/postOrder/index.wxss
index 5cb30b8..aea3156 100644
--- a/pages/order/postOrder/index.wxss
+++ b/pages/order/postOrder/index.wxss
@@ -1,6 +1,7 @@
/* pages/order/post/index.wxss */
page {
background: #f6f6f6;
+ padding-bottom: 150rpx;
}
.sendwayArea{
@@ -311,4 +312,22 @@ page {
width: 26.67rpx;
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;
}
\ No newline at end of file
diff --git a/pages/order/roadOrder/index.js b/pages/order/roadOrder/index.js
index ed17b65..e81d26c 100644
--- a/pages/order/roadOrder/index.js
+++ b/pages/order/roadOrder/index.js
@@ -22,13 +22,16 @@ Page({
price:0,
coupon:app.globalData.couponInfo,
sku_ids:"",
- prizeId:null
+ prizeId:null,
+ smoothlyTotal: 0,
+ maxCouponObject: null
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
+ this.couponCom = this.selectAllComponents("#coupon")[0];
this.setData({
prizeId:wx.getStorageSync('prizeId')
})
@@ -54,8 +57,66 @@ Page({
console.log(this.data)
// 获取默认联系人
this.getLinkmanList()
+ // this.showAllPrice()
+ },
+ // 子组件发生改变时更新价格
+ handleUpdateTotalPrice(e) {
+ this.setData({
+ smoothlyTotal: e.detail.total
+ });
+ // 重新计算总价
+ this.showAllPrice();
+ },
+ // 调用子组件清除优惠券方法
+ callOtherCompMethod: function(e) {
+ this.couponCom.setNullCoupon()
+ this.setData({
+ coupon: null,
+ })
+ },
+ showAllPrice() {
+ let price = app.globalData.product.price
+ let 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
+ } else {
+ price =(price * this.data.coupon.activity.fold)/ 10
+ }
+ } else {
+ price = price
+ }
+ if (price >0) {
+ this.setData({ price:price/100})
+ }else {
+ this.setData({ price:0 })
+ }
+
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ const skuIds = []
+ skuIds.push(this.data.sku_ids)
+ console.log(skuIds)
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSkuIds = smoothlyComp.hasSelectedGoods();
+ if(hasSkuIds) {
+ skuIds.push(...smoothlyComp.emitSkuIds())
+ }
+ }
+ this.setData({
+ maxCouponObject: {
+ price: allPrice,
+ skuIds: skuIds.toString()
+ }
+ })
+ console.log(this.data.maxCouponObject)
},
-
showLinkman:function(e){
if(!this.data.linkmanFlag) {
let skuIndex = e.currentTarget.dataset.index,linkmans = this.data.linkmans[skuIndex],linkmanList = this.data.linkmanList;
@@ -200,6 +261,19 @@ Page({
})
},
order:function(){
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSelected = smoothlyComp.hasSelectedGoods();
+ if(hasSelected && !smoothlyComp.data.address) {
+ wx.showToast({
+ title: '请选择收货地址',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
let sku = this.data.sku,product = this.data.product,linkmans = this.data.linkmans,product_list = [],reserve_mobile = this.data.reserve_mobile;
if(!reserve_mobile) {
wx.showToast({
@@ -246,6 +320,12 @@ Page({
if(orderFlag==false){
return;
}
+
+ // 顺手购下单参数
+ if(smoothlyComp && smoothlyComp.emitOrder() && smoothlyComp.emitOrder().length) {
+ product_list.push(...smoothlyComp.emitOrder())
+ }
+
let data = {
product_list:product_list,
coupon_id:this.data.coupon?this.data.coupon.id:null,
@@ -281,6 +361,7 @@ Page({
this.setData({
coupon:e.detail
})
+ this.showAllPrice()
},
// 一日游合同确认签字
// ondayConfirm:function(){
diff --git a/pages/order/roadOrder/index.json b/pages/order/roadOrder/index.json
index 8172ad6..f35301a 100644
--- a/pages/order/roadOrder/index.json
+++ b/pages/order/roadOrder/index.json
@@ -1,6 +1,7 @@
{
"usingComponents": {
"title":"/pages/component/TitleHeader",
- "coupon":"/pages/order/components/coupon/index"
+ "coupon":"/pages/order/components/coupon/index",
+ "smoothly-order": "/pages/order/components/smoothlyOrder/index"
}
}
\ No newline at end of file
diff --git a/pages/order/roadOrder/index.wxml b/pages/order/roadOrder/index.wxml
index 52331d5..193d220 100644
--- a/pages/order/roadOrder/index.wxml
+++ b/pages/order/roadOrder/index.wxml
@@ -29,7 +29,16 @@
-
+
+
+
+
\ No newline at end of file
diff --git a/pages/order/roadOrder/index.wxss b/pages/order/roadOrder/index.wxss
index 916a21f..b5e17e3 100644
--- a/pages/order/roadOrder/index.wxss
+++ b/pages/order/roadOrder/index.wxss
@@ -1,6 +1,7 @@
/* pages/order/roadOrder/index.wxss */
page {
background: #f6f6f6;
+ padding-bottom: 150rpx;
}
.top-box {
padding: 30rpx 47rpx;
@@ -184,4 +185,23 @@ page {
padding-left: 25rpx;
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;
}
\ No newline at end of file
diff --git a/pages/order/showOrderNew/index.js b/pages/order/showOrderNew/index.js
index 99eff0f..abf846d 100644
--- a/pages/order/showOrderNew/index.js
+++ b/pages/order/showOrderNew/index.js
@@ -46,6 +46,8 @@ Page({
showDate2:false,
showYhq:null,
couponFlag:false,
+ smoothlyTotal: 0,
+ maxCouponObject: null
},
/**
@@ -115,6 +117,21 @@ Page({
// showDate: true,
// })
// },
+ // 子组件发生改变时更新价格
+ handleUpdateTotalPrice(e) {
+ this.setData({
+ smoothlyTotal: e.detail.total
+ });
+ // 重新计算总价
+ this.totalPrice(this.data.singlePrice)
+ },
+ // 调用子组件清除优惠券方法
+ callOtherCompMethod: function(e) {
+ this.selectAllComponents("#coupon")[0].setNullCoupon()
+ this.setData({
+ coupon: null,
+ })
+ },
hideDate: function () {
this.setData({
showDate: false
@@ -281,15 +298,20 @@ Page({
this.totalPrice(this.data.singlePrice)
},
totalPrice(price) {
- let allPrice
+ let allPrice = this.data.singlePrice * this.data.productNum
+ let prices = allPrice
+ // 顺手购价格
+ if (!this.data.coupon) {
+ allPrice += this.data.smoothlyTotal || 0;
+ }
if (this.data.coupon) {
if (this.data.coupon.activity.discount_type == 'pricebreak') {
- allPrice = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
+ allPrice = allPrice - this.data.coupon.activity.money
} else {
- allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
+ allPrice =(allPrice * this.data.coupon.activity.fold)/ 10
}
} else {
- allPrice = this.data.singlePrice * this.data.productNum
+ allPrice = allPrice
}
// allPrice = price * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0)
@@ -305,6 +327,23 @@ Page({
})
}
console.log('singlePrice',this.data.singlePrice);
+
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ const skuIds = []
+ skuIds.push(this.data.product.sku.id)
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSkuIds = smoothlyComp.hasSelectedGoods();
+ if(hasSkuIds) {
+ skuIds.push(...smoothlyComp.emitSkuIds())
+ }
+ }
+ this.setData({
+ maxCouponObject: {
+ price: prices,
+ skuIds: skuIds.toString()
+ }
+ })
},
changeDate: function (e) {
console.log('打印',e);
@@ -372,6 +411,19 @@ Page({
this.hideDate()
},
order:function() {
+ const smoothlyComp = this.selectComponent("#smoothlyOrderComp");
+ if(smoothlyComp) {
+ // 检查是否有选中的顺手购商品
+ const hasSelected = smoothlyComp.hasSelectedGoods();
+ if(hasSelected && !smoothlyComp.data.address) {
+ wx.showToast({
+ title: '请选择收货地址',
+ icon: 'none'
+ })
+ return;
+ }
+ }
+
let linkmanList = this.data.linkmanList, productNum = this.data.productNum, date = this.data.date, time = this.data.time, remark = this.data.remark, product = this.data.product;
let linkmanIds = [];
if (linkmanList.length==0 && this.data.is_authentication == 1) {
@@ -432,6 +484,12 @@ Page({
team_id: app.globalData.team_id,
linkmanList:this.data.is_authentication == 1?this.data.linkmanList:[]
}
+
+ // 顺手购下单参数
+ if(smoothlyComp && smoothlyComp.emitOrder() && smoothlyComp.emitOrder().length) {
+ data.product_list.push(...smoothlyComp.emitOrder())
+ }
+
if (app.globalData.from) {
data.system_name = app.globalData.from;
}
@@ -609,7 +667,8 @@ Page({
coupon:e.detail
})
- this.showAllPrice()
+ // this.showAllPrice()
+ this.totalPrice(this.data.singlePrice)
},
/**
diff --git a/pages/order/showOrderNew/index.json b/pages/order/showOrderNew/index.json
index 19927e7..54c1962 100644
--- a/pages/order/showOrderNew/index.json
+++ b/pages/order/showOrderNew/index.json
@@ -4,6 +4,7 @@
"contact":"../components/contact/index",
"coupon":"../components/coupon/index",
"notice":"/pages/component/notice/notice",
- "date":"/pages/order/components/date"
+ "date":"/pages/order/components/date",
+ "smoothly-order": "/pages/order/components/smoothlyOrder/index"
}
}
\ No newline at end of file
diff --git a/pages/order/showOrderNew/index.wxml b/pages/order/showOrderNew/index.wxml
index 380b633..6ff55d1 100644
--- a/pages/order/showOrderNew/index.wxml
+++ b/pages/order/showOrderNew/index.wxml
@@ -46,11 +46,26 @@
-->
+ money="{{singlePrice * productNum}}" sku="{{product.sku.id}}" couponFlag="{{couponFlag}}" maxCouponObject="{{maxCouponObject}}">
+
+
+
-
+
+
+
+
合计:¥0
合计:
diff --git a/pages/order/showOrderNew/index.wxss b/pages/order/showOrderNew/index.wxss
index 3780f39..baf7582 100644
--- a/pages/order/showOrderNew/index.wxss
+++ b/pages/order/showOrderNew/index.wxss
@@ -1,6 +1,7 @@
/* pages/.wxss */
page {
background: #f6f6f6;
+ padding-bottom: 150rpx;
}
.group-order {
@@ -454,4 +455,23 @@ text-align: center;
.s-price::before {
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;
}
\ No newline at end of file
diff --git a/project.private.config.json b/project.private.config.json
index e6ba547..cecb42b 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -6,12 +6,54 @@
"condition": {
"miniprogram": {
"list": [
+ {
+ "name": "pages/info/postProductInfo/index",
+ "pathName": "pages/info/postProductInfo/index",
+ "query": "id=464726",
+ "scene": null,
+ "launchMode": "default"
+ },
+ {
+ "name": "pages/info/roadInfo/index",
+ "pathName": "pages/info/roadInfo/index",
+ "query": "id=463608",
+ "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",
+ "query": "id=465394",
+ "launchMode": "default",
+ "scene": null
+ },
+ {
+ "name": "pages/info/postProductInfo/index",
+ "pathName": "pages/info/postProductInfo/index",
+ "query": "id=460201&ZTPoint=%E7%94%84%E9%80%89%E6%99%AF%E9%85%92%E5%A5%97%E9%A4%90",
+ "launchMode": "default",
+ "scene": null
+ },
+ {
+ "name": "subPackages/foodNew/index",
+ "pathName": "subPackages/foodNew/index",
+ "query": "id=914667",
+ "launchMode": "default",
+ "scene": null
+ },
{
"name": "pages/info/roadInfo/index",
"pathName": "pages/info/roadInfo/index",
"query": "id=457033",
- "scene": null,
- "launchMode": "default"
+ "launchMode": "default",
+ "scene": null
},
{
"name": "pages/info/roadInfo/index",
@@ -109,5 +151,5 @@
},
"projectname": "%E8%8B%8F%E5%B7%9E%E6%96%87%E6%97%85",
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
- "libVersion": "3.9.3"
+ "libVersion": "3.7.12"
}
\ No newline at end of file
diff --git a/utils/util.js b/utils/util.js
index 8620a24..5f6b883 100644
--- a/utils/util.js
+++ b/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;