wangfukang 2 days ago
parent
commit
4e3c6235a1
  1. 64
      package1/group/groupBuySingle.vue
  2. 28
      package1/order/orderDetail.vue

64
package1/group/groupBuySingle.vue

@ -899,9 +899,21 @@
if (validPrices.length > 0) { if (validPrices.length > 0) {
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max));
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} else if (prices.length > 0) { } else if (prices.length > 0) {
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr)); this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr));
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} else { } else {
this.selectedGroupRule = {}; this.selectedGroupRule = {};
} }
@ -910,6 +922,12 @@
if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) { if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) {
this.selectedGroupRule = item.productGroupBuyPrices[0]; this.selectedGroupRule = item.productGroupBuyPrices[0];
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} else { } else {
this.selectedGroupRule = {}; this.selectedGroupRule = {};
} }
@ -922,6 +940,12 @@
} }
} }
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} }
this.$refs.pintuanGroupPopup.open('bottom') this.$refs.pintuanGroupPopup.open('bottom')
}, },
@ -1005,9 +1029,21 @@
if (validPrices.length > 0) { if (validPrices.length > 0) {
this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max)); this.selectedGroupRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max));
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} else if (prices.length > 0) { } else if (prices.length > 0) {
this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr)); this.selectedGroupRule = prices.reduce((prev, curr) => (prev.groupCount < curr.groupCount ? prev : curr));
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} else { } else {
this.selectedGroupRule = {}; this.selectedGroupRule = {};
} }
@ -1024,6 +1060,12 @@
if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) { if (item.productGroupBuyPrices && item.productGroupBuyPrices.length > 0) {
this.selectedGroupRule = item.productGroupBuyPrices[0]; this.selectedGroupRule = item.productGroupBuyPrices[0];
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
} else { } else {
this.selectedGroupRule = {}; this.selectedGroupRule = {};
} }
@ -1062,6 +1104,12 @@
selectGroupRule(rule) { selectGroupRule(rule) {
this.selectedGroupRule = rule; this.selectedGroupRule = rule;
this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice this.selectedGroupRule.groupPriceAndMore = this.selectedGroupRule.groupPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
}, },
submitAddToCart() { submitAddToCart() {
let specChoices = {}; let specChoices = {};
@ -1299,6 +1347,12 @@
} }
} }
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
}, },
sliceMsg2(val) { sliceMsg2(val) {
var name = '' var name = ''
@ -1326,6 +1380,12 @@
} }
} }
this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice this.selectedGroupRule.groupPriceAndMore = Number(this.selectedGroupRule.groupPrice) + moreBuyPrice
if(this.selectedCoupon){
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
}
for(let i = 0;i<this.moreBuyData.length;i++){ for(let i = 0;i<this.moreBuyData.length;i++){
if(this.moreBuyData[i].id == this.checkMoreBuyIndex){ if(this.moreBuyData[i].id == this.checkMoreBuyIndex){
this.moreBuyData[i].quantity = this.vModelValue this.moreBuyData[i].quantity = this.vModelValue
@ -1417,6 +1477,10 @@
}, },
selectCoupon(item) { selectCoupon(item) {
this.selectedCoupon = item; this.selectedCoupon = item;
this.selectedGroupRule.groupPriceAndMore -= parseFloat(this.selectedCoupon.discountAmount);
if(this.selectedGroupRule.groupPriceAndMore <= 0){
this.selectedGroupRule.groupPriceAndMore = 0.01
}
this.$refs.couponPopup.close(); this.$refs.couponPopup.close();
}, },
openCouponPopup() { openCouponPopup() {

28
package1/order/orderDetail.vue

@ -65,7 +65,9 @@
</view> </view>
</view> </view>
<view class="kaituan41"> <view class="kaituan41">
分享至微信 <uni-icons type="weixin" size="15"></uni-icons> <button open-type="share" style="background:transparent;border:none;color:inherit;font-size:inherit;display:inline-flex;align-items:center;">
分享至微信 <uni-icons type="weixin" size="15"></uni-icons>
</button>
</view> </view>
<view class="kaituan41" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)"> <view class="kaituan41" v-if="orderStatus(orderDetail)" @tap="returnPopupProp(orderDetail)">
取消订单 <uni-icons type="weixin" size="15"></uni-icons> 取消订单 <uni-icons type="weixin" size="15"></uni-icons>
@ -635,9 +637,33 @@
this.handleWorkerSelected(pendingWorker); this.handleWorkerSelected(pendingWorker);
} }
}, },
onShareAppMessage(res) {
let that = this
that.tui.request("/app/shop/getShopInfoById", "POST", {id:that.orderDetail.shopId,regionId:JSON.parse(uni.getStorageSync('area')).id}, false, true).then((res1) => {
if (res1.code == 200) {
let groupId = that.orderDetail.groupInfo.id;
let targetMembers = that.orderDetail.groupInfo.targetMembers;
let shopItemStr = encodeURIComponent(JSON.stringify(res1.result.shop));
let isFTF = that.orderDetail.orderType == 3 ? 1 : 0;
let path = `/package1/group/groupBuySingle?type=shop&item=${shopItemStr}&groupId=${groupId}&targetMembers=${targetMembers}&isFaceToFace=${isFTF}`;
return {
title: '快来一起拼单吧!',
path: path,
imageUrl:'https://jewel-shop.oss-cn-beijing.aliyuncs.com/62c9aa038b2541ad9c400a76ddae7ef8.png'
}
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res1) => {});
},
onUnload() { onUnload() {
uni.$off('updateDeliveryWorker'); uni.$off('updateDeliveryWorker');
}, },
methods: { methods: {
openCode(){ openCode(){
this.$refs.imgPopup.open() this.$refs.imgPopup.open()

Loading…
Cancel
Save