|
|
|
@ -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"> |
|
|
|
<view class="goods-member" :id="'category-' + item.categoryId" v-for="(item,index) in productItem" :key="index" |
|
|
|
@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-img"> |
|
|
|
<img :src="item.productPicture" alt="" style="border-radius: 20rpx;"> |
|
|
|
<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.loadStatus = 'nomore'; |
|
|
|
if (res.code == 200) { |
|
|
|
that.productItem = res.result.records; |
|
|
|
that.productItem = [...that.shopRecommend, ...that.productItem]; |
|
|
|
if (that.searchForm.pageNum == 1) { |
|
|
|
that.productItem = res.result.records; |
|
|
|
} else { |
|
|
|
that.productItem = [...that.productItem, ...res.result.records]; |
|
|
|
} |
|
|
|
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){ |
|
|
|
//搭配的小料商品 |
|
|
|
that.productItem[i].isChecked = false |
|
|
|
that.moreBuyList.push(that.productItem[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log('好的',that.productItem) |
|
|
|
//获取当前店铺待成团列表 |
|
|
|
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) { |
|
|
|
let index = this.cartItems.findIndex(c => c.cartId === cartId); |
|
|
|
if (index !== -1) { |
|
|
|
@ -1296,6 +1327,12 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
buyingye() { |
|
|
|
uni.showToast({ |
|
|
|
title: '商品不在售卖时间!', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
}, |
|
|
|
getGroupPrice(item) { |
|
|
|
if (!this.groupId) { |
|
|
|
return this.$options.filters.slicePrice(item.productGroupBuyPrices); |
|
|
|
@ -1729,6 +1766,7 @@ |
|
|
|
padding-bottom: 20rpx; |
|
|
|
margin: 0 0 20rpx; |
|
|
|
background: #fff; |
|
|
|
position: relative; |
|
|
|
} |
|
|
|
|
|
|
|
.goods-list { |
|
|
|
|