tianyi 1 day ago
parent
commit
2747ffeb03
  1. 44
      package1/group/groupBuySingle.vue
  2. 37
      package1/order/orderDetail.vue

44
package1/group/groupBuySingle.vue

@ -101,7 +101,11 @@
<scroll-view class="goods-list" scroll-y :scroll-into-view="scrollIntoViewId" :scroll-top="goodsListScrollTop" @scroll="onGoodsListScroll" @scrolltoupper="onGoodsListScrollToTop" :scroll-with-animation="true"> <scroll-view class="goods-list" scroll-y :scroll-into-view="scrollIntoViewId" :scroll-top="goodsListScrollTop" @scroll="onGoodsListScroll" @scrolltoupper="onGoodsListScrollToTop" :scroll-with-animation="true">
<view class="goods-member" :id="'category-' + item.categoryId" v-for="(item,index) in productItem" :key="index" <view class="goods-member" :id="'category-' + item.categoryId" v-for="(item,index) in productItem" :key="index"
@tap="goDetail('product',item)"> @tap="goDetail('product',item)">
<view @tap.stop="buyingye" v-if="item.status == 1"
style="width: 100%;height:100%;position: absolute;top: 0;background: rgba(0, 0, 0, 0.1);z-index: 999;border-radius: 10px;">
</view>
<view class="goods-top"> <view class="goods-top">
<view class="goods-img"> <view class="goods-img">
<img :src="item.productPicture" alt="" style="border-radius: 20rpx;"> <img :src="item.productPicture" alt="" style="border-radius: 20rpx;">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png" <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png"
@ -788,16 +792,24 @@
that.tui.request("/app/product/getShareList", "POST", this.searchForm, false, false).then((res) => { that.tui.request("/app/product/getShareList", "POST", this.searchForm, false, false).then((res) => {
that.loadStatus = 'nomore'; that.loadStatus = 'nomore';
if (res.code == 200) { if (res.code == 200) {
that.productItem = res.result.records; if (that.searchForm.pageNum == 1) {
that.productItem = [...that.shopRecommend, ...that.productItem]; that.productItem = res.result.records;
} else {
that.productItem = [...that.productItem, ...res.result.records];
}
for(let i = 0;i<that.productItem.length;i++){ for(let i = 0;i<that.productItem.length;i++){
if(this.productItem[i].sellBeginTime !='' && this.productItem[i].sellEndTime != ''){
let isEndTime = this.isWithinBusinessHours(this.productItem[i].sellBeginTime,this.productItem[i].sellEndTime)
console.log(isEndTime)
this.productItem[i].status = isEndTime ? 0 : 1
}
if(that.productItem[i].isMoreBuy == 1){ if(that.productItem[i].isMoreBuy == 1){
// //
that.productItem[i].isChecked = false that.productItem[i].isChecked = false
that.moreBuyList.push(that.productItem[i]) that.moreBuyList.push(that.productItem[i])
} }
} }
console.log('好的',that.productItem)
// //
that.getOrderWait(); that.getOrderWait();
@ -1245,6 +1257,25 @@
}); });
} }
}, },
//
isWithinBusinessHours(begin, end) {
//
const now = new Date();
const currentMinutes = now.getHours() * 60 + now.getMinutes();
// "HH:MM"
const parseTime = (timeStr) => {
const [hours, minutes] = timeStr.split(':').map(Number);
return hours * 60 + minutes;
};
const startMinutes = parseTime(begin);
const endMinutes = parseTime(end);
console.log(currentMinutes +','+startMinutes +','+endMinutes)
//
return currentMinutes >= startMinutes && currentMinutes <= endMinutes;
},
adjustCart(cartId, delta) { adjustCart(cartId, delta) {
let index = this.cartItems.findIndex(c => c.cartId === cartId); let index = this.cartItems.findIndex(c => c.cartId === cartId);
if (index !== -1) { if (index !== -1) {
@ -1296,6 +1327,12 @@
}) })
} }
}, },
buyingye() {
uni.showToast({
title: '商品不在售卖时间!',
icon: 'none'
});
},
getGroupPrice(item) { getGroupPrice(item) {
if (!this.groupId) { if (!this.groupId) {
return this.$options.filters.slicePrice(item.productGroupBuyPrices); return this.$options.filters.slicePrice(item.productGroupBuyPrices);
@ -1729,6 +1766,7 @@
padding-bottom: 20rpx; padding-bottom: 20rpx;
margin: 0 0 20rpx; margin: 0 0 20rpx;
background: #fff; background: #fff;
position: relative;
} }
.goods-list { .goods-list {

37
package1/order/orderDetail.vue

@ -92,7 +92,7 @@
</view> </view>
</view> </view>
<view class="content"> <view class="content">
<view class="box1" style="display: flex;"> <view class="box1" style="display: flex;min-height: 80px;">
<view class="status-img"> <view class="status-img">
<img v-if="orderDetail.status == 0 || (orderDetail.status == 3 && orderDetail.deliveryType == 2)" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6cf6fff020614ebebb34f7c371e11331.png" alt="" /> <img v-if="orderDetail.status == 0 || (orderDetail.status == 3 && orderDetail.deliveryType == 2)" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6cf6fff020614ebebb34f7c371e11331.png" alt="" />
<img v-if="orderDetail.status == 2" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/35ff6276eb3a4e58b8baa724ca44d5dc.png" alt="" /> <img v-if="orderDetail.status == 2" src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/35ff6276eb3a4e58b8baa724ca44d5dc.png" alt="" />
@ -147,10 +147,10 @@
</view> </view>
</view> </view>
<view class="btn-box"> <view class="btn-box">
<view class="btn" v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2" @tap="openCode"> <view class="btn" v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2 &&orderDetail.userRequireMake == null" @tap="openCode">
核销取餐码 需要画二维码 核销取餐码
</view> </view>
<view class="btn" v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2" @tap="openCode"> <view class="btn" v-if="orderDetail.status == 3 && orderDetail.deliveryType == 2 &&orderDetail.userRequireMake == null" @tap="makeMeal">
立即备餐 立即备餐
</view> </view>
<view class="btn" style="width: 40%;" v-if="orderDetail.status == 2" @tap="openAddFeePopup"> <view class="btn" style="width: 40%;" v-if="orderDetail.status == 2" @tap="openAddFeePopup">
@ -670,6 +670,30 @@
} }
}); });
}, },
//
makeMeal(){
let that = this;
uni.showModal({
title: '提示',
content: "是否立刻通知商家备餐?",
success: function(res) {
if (res.confirm) {
that.tui.request("/mall/order/userRequireMake", "POST", {
orderId:that.orderDetail.id,
}, false, true).then((res) => {
if (res.code == 200) {
that.tui.toast('通知成功!');
that.getOrderDetail(that.orderId)
} else {
that.tui.toast(res.message);
return;
}
uni.hideLoading();
}).catch((res) => {});
}
}
});
},
checkSellTime(type){ checkSellTime(type){
this.sellTime = type; this.sellTime = type;
if(this.sellTime == 2){ if(this.sellTime == 2){
@ -1068,9 +1092,8 @@
.content{ .content{
position: absolute; position: absolute;
top: 200rpx; top: 220rpx;
width: 95%; width: 100%;
margin-left: 2.5%;
} }
.title-sreach{ .title-sreach{

Loading…
Cancel
Save