diff --git a/package1/buyFood/buyFood.vue b/package1/buyFood/buyFood.vue
index 1990ab1..61aa03f 100644
--- a/package1/buyFood/buyFood.vue
+++ b/package1/buyFood/buyFood.vue
@@ -191,6 +191,30 @@
+
+
+
+
+
+
+ {{cartItem.productName}}
+
+
+
+ {{getSpecDisplayString(cartItem.specs)}}
+
+
+
+
+ X{{cartItem.quantity}}
+
+
+ ¥{{cartItem.attributeListPrice | sliceMsg}}
+
+
+
+
@@ -388,6 +412,18 @@
deliveryTimeOp,
addressList
},
+ filters: {
+ sliceMsg(val) {
+ var name = ''
+ if (typeof(val) == 'string') {
+ let newObj = JSON.parse(val)
+ for (let as in newObj) {
+ name = newObj[as].specPrice
+ }
+ }
+ return name;
+ }
+ },
onLoad(option) {
if (option.shopItem) {
this.shopItem = JSON.parse(decodeURIComponent(option.shopItem));
@@ -408,7 +444,15 @@
computed: {
goodsAmountCalc() {
if (this.isGroupBuy && this.groupItem) {
- return parseFloat(this.groupItem.groupRule.groupPrice);
+ if(this.groupItem.item.moreBuyData){
+ let allPrice = parseFloat(this.groupItem.groupRule.groupPrice)
+ for(let a = 0;a acc + (curr.quantity * parseFloat(curr.price)), 0);
}
@@ -714,16 +758,39 @@
}
return null;
},
+ sliceMsg1(val) {
+ var name = ''
+ if (typeof(val) == 'string') {
+ let newObj = JSON.parse(val)
+ for (let as in newObj) {
+ name = newObj[as].specPrice
+ }
+ }
+ return name;
+ },
submitOrderToBackend() {
let isJoiningFaceToFace = this.isGroupBuy && this.groupItem && this.groupItem.groupId && this.groupItem
.isFaceToFace;
let items = [];
if (this.isGroupBuy && this.groupItem) {
+ if(this.groupItem.item.moreBuyData){
+ for(let a = 0;a
-
-
-
-
-
-
-
- 无骨双拼|招牌炸鸡套餐
+
+
+
+
+
+
+
+
+
+
+ {{item.productName}}
+
+
+ 拼团¥{{item.groupPrice}}
+
+
-
- 拼团¥59.90
+
+
+
+
+
+ +
+
+
+ 差{{item.targetMembers - item.currentMembers}}人拼成
-
-
-
-
- +
-
-
- 差1人拼成
-
-
+
-
+
@@ -134,7 +141,7 @@
style="background: rgba(166, 255, 234, 0.3);margin-right: 6%;border: 1px solid rgba(166, 255, 234, 0.5);">
直接购买¥{{item.attributeListPrice | sliceMsg}}
-
+
拼团购买¥{{ getGroupPrice(item) }}
@@ -283,10 +290,31 @@
+
+
+ 搭配小食
+
+
+
+
+
+
+
+
+ ¥{{spec.attributeListPrice | sliceMsg}} ✕ {{spec.quantity ? spec.quantity : ''}}
+
+
+ {{spec.productName}}
+
+
+
+
-
+
成团选择
@@ -302,34 +330,6 @@
-
-
- 他们都在拼
-
-
-
-
-
-
-
-
- +
-
-
-
- 二人拼
-
-
- 差1人拼成
-
-
-
-
- 去拼单
-
-
-
@@ -363,86 +363,17 @@
-
+
-
-
-
-
-
-
- {{currentItem.productName}}
-
-
-
- 月售 100+
-
-
-
-
- ¥{{currentItem.attributeListPrice | sliceMsg}}
-
-
- 拼团¥{{currentItem.productGroupBuyPrices | slicePrice}}
-
-
-
+ 快来加入一起成团吧!
-
+
-
-
-
-
- +
-
-
-
- 二人拼
-
-
- 差1人拼成
-
-
-
-
- 去拼单
-
-
-
-
-
-
-
-
- +
-
-
-
- 二人拼
-
-
- 差1人拼成
-
-
-
-
- 去拼单
-
-
-
-
-
+
- 二人拼
+ {{item.targetMembers}}人拼
- 差1人拼成
+ 差{{item.targetMembers - item.currentMembers}}人拼成
@@ -551,13 +482,18 @@
productItem: [],
tuanzhangOrder:{},
cartItems: [],
+ moreBuyData:[],
+ vModelValue:0,
currentItem: {},
+ checkMoreBuyIndex:'',
parsedSpecs: [],
+ moreBuyList:[],
selectedGroupRule: {},
pageNum: 1,
total: 1,
// 导航栏高度(用于sticky top偏移)
navBarHeight: 0,
+ orderListWait:[],
// 分类栏距离页面顶部的距离(用于上滑检测)
menuListOffsetTop: 0,
lastScrollTop: 0,
@@ -567,7 +503,7 @@
shopId: '',
delFlag: 1,
pageNum: 1,
- pageSize: '10',
+ pageSize: '100',
categoryId: ''
},
menuButtonInfo: {},
@@ -577,6 +513,8 @@
targetMembers: 2,
backendTotalAmount: 0,
currentOrderId: '',
+ onlineWorkerInterval:2500,
+ onlineWorkerDuration:500,
menuList: [{
categoryName: '猜你喜欢',
id: '',
@@ -690,6 +628,7 @@
}
this.getCategory(this.shopItem.id);
this.getProduct('');
+ this.getOrderWait();
},
onShow() {
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect();
@@ -715,12 +654,16 @@
that.tui.request("/app/product/getShareList", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore';
if (res.code == 200) {
- if (that.searchForm.pageNum == 1) {
- that.productItem = res.result.records;
- } else {
- that.productItem = [...that.productItem, ...res.result.records];
+ that.productItem = res.result.records;
+ for(let i = 0;i {
+ that.loadStatus = 'nomore';
+ if (res.code == 200) {
+ that.orderListWait = res.result;
+ that.$forceUpdate();
+ } else {
+ that.tui.toast(res.message);
+ return;
+ }
+ uni.hideLoading();
+ }).catch((res) => {});
+ },
openPopup(type, index, item) {
if (type == 'car') {
this.$refs.carPopup.open('bottom')
@@ -896,6 +861,13 @@
}
// Pack data for checkout
+ this.currentItem.moreBuyData = []
+ for(let i = 0;i 0){
+ this.currentItem.moreBuyData.push(this.moreBuyData[i])
+ }
+ }
+
let goData = {
item: this.currentItem,
groupRule: this.selectedGroupRule,
@@ -905,6 +877,7 @@
isFaceToFace: this.groupId ? this.isFaceToFaceGroup : (isFaceToFace || false)
};
// Directly navigate to checkout
+ console.log("111",this.currentItem)
uni.navigateTo({
url: '/package1/buyFood/buyFood?item=' + encodeURIComponent(JSON.stringify(goData)) +
'&shopItem=' + encodeURIComponent(JSON.stringify(this.shopItem)) + '&packageFee=' +
@@ -926,7 +899,7 @@
userId: uni.getStorageSync('id') || 'test-user123',
shopId: this.shopItem.id,
deliveryType: this.tuanzhangOrder.deliveryType,
- packageFee: packageFee,
+ packageFee: this.tuanzhangOrder.deliveryType == 1 ? this.packageFee : 0,
remark: '',
items: items,
receiverName: '',
@@ -937,7 +910,7 @@
shopAddress: this.shopItem.shopAddress || '',
groupId: this.groupId
};
-
+ payload.regionId = JSON.parse(uni.getStorageSync('area')).id
uni.showLoading({ title: '创建订单中...' });
this.tui.request("/mall/order/create", "POST", payload, false, false).then(res => {
uni.hideLoading();
@@ -1051,6 +1024,48 @@
let bestRule = validPrices.reduce((max, obj) => (obj.groupCount > max.groupCount ? obj : max));
return parseFloat(bestRule.groupPrice).toFixed(2);
},
+ selectMoreBuy(item,index){
+ this.checkMoreBuyIndex = item.id
+ this.moreBuyList[index].isChecked = !this.moreBuyList[index].isChecked;
+ let isHas = false
+ let index1 = ''
+ for(let i = 0;i