tianyi 3 weeks ago
parent
commit
7ee008c482
  1. 4
      package1/group/groupBuyList.vue
  2. 133
      package1/group/groupBuySingle.vue

4
package1/group/groupBuyList.vue

@ -64,10 +64,10 @@
<view class="shop-member" v-for="(item,index) in shopList" :key="index" @tap="goDetail('shop',item)"> <view class="shop-member" v-for="(item,index) in shopList" :key="index" @tap="goDetail('shop',item)">
<view class="shop-top"> <view class="shop-top">
<view class="shop-img"> <view class="shop-img">
<img :src="item.shopIcon" alt="" @tap="goDetail('shop',item)"> <img :src="item.shopIcon" alt="">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png" alt="" style="width:30rpx;height:30rpx;position: absolute;top: 0;left: 0;background-size: 100%;" /> <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/6c4ab92a43c842d8bb22035bce1f65cc.png" alt="" style="width:30rpx;height:30rpx;position: absolute;top: 0;left: 0;background-size: 100%;" />
</view> </view>
<view class="shop-content" @tap="goDetail('shop',item)"> <view class="shop-content">
<view class="shop-name"> <view class="shop-name">
{{item.shopName}} {{item.shopName}}
</view> </view>

133
package1/group/groupBuySingle.vue

@ -61,7 +61,7 @@
<swiper class="zaixian-swiper" vertical circular :autoplay="orderListWait.length > 1" <swiper class="zaixian-swiper" vertical circular :autoplay="orderListWait.length > 1"
:interval="onlineWorkerInterval" :duration="onlineWorkerDuration"> :interval="onlineWorkerInterval" :duration="onlineWorkerDuration">
<swiper-item v-for="(item,index) in orderListWait" :key="index"> <swiper-item v-for="(item,index) in orderListWait" :key="index">
<view> <view style="display: flex;">
<view class="pintuan-left"> <view class="pintuan-left">
<view class="pintuan-left-img"> <view class="pintuan-left-img">
<img :src="item.productPicture" alt=""> <img :src="item.productPicture" alt="">
@ -90,14 +90,11 @@
</swiper> </swiper>
</view> </view>
<!-- 分类栏移到goods-list外层position:sticky才能生效 --> <!-- 分类栏移到goods-list外层position:sticky才能生效 -->
<view class="menu-list" id="menuList" <view style="display: flex;height: 72%;margin-top: 10px;">
:style="{'top': navBarHeight + 'px','background':lastScrollTop>200?'#fff':''}"> <view id="menuList" style="border-right: 1px solid #eee;font-weight: 700;font-size: 14px;">
<view class="menu1" @tap="checkTab(index)" v-for="(item,index) in menuList" :key="index" <view class="menu1" @tap="checkTab(index)" v-for="(item,index) in menuList" :key="index"
:style="{'font-size':item.checked?'40rpx':'30rpx','color':item.checked?'rgba(0, 35, 28, 1)':'#777'}"> :style="{'border-radius':item.checked?'10px':'','color':item.checked?'rgba(0, 35, 28, 1)':'#777','background':item.checked?'#fff':'','border-right':item.checked?'5px solid #48D1CC;':''}">
<view style="width: 180rpx;">{{item.categoryName}}</view> <view style="width: 160rpx;">{{item.categoryName}}</view>
<img v-if="item.checked" class="checked-img"
src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/4bb5fc7725cb4a7a84d1d3a15f05b39c.png"
alt="" />
</view> </view>
</view> </view>
<view class="goods-list"> <view class="goods-list">
@ -118,6 +115,8 @@
<view class="goods-deal1"> <view class="goods-deal1">
月售 <text> 100+</text> 月售 <text> 100+</text>
</view> </view>
</view>
<view class="shop-tag1">
<view class="goods-tag" @tap.stop="openOrderWait(item)" v-if="item.orderListWait != undefined && item.orderListWait.length > 0"> <view class="goods-tag" @tap.stop="openOrderWait(item)" v-if="item.orderListWait != undefined && item.orderListWait.length > 0">
<view class="pintuan-right-img"> <view class="pintuan-right-img">
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/94f91382e76c4f289d53fbf858e8732b.png" <img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/94f91382e76c4f289d53fbf858e8732b.png"
@ -129,26 +128,24 @@
</view> </view>
</view> </view>
</view> </view>
<view class="shop-tag1">
<text
style="padding: 4rpx 10rpx;background: rgba(223, 255, 176, 1);color: #777;border-radius: 6rpx;">
{{item.attributeListPrice | sliceMsg1}}
</text>
</view>
</view> </view>
</view> </view>
<view class="goods-bottom"> <view class="goods-bottom">
<view v-if="item.productGroupBuyPrices != null && item.isMoreBuy != 1" class="goods-btn" style="margin-left: 6%;" :style="{'float':groupId != ''?'right':''}" @tap="openPopup('xiadan','pintuan',item)">
拼团购买¥{{ getGroupPrice(item) }}
</view>
<view class="goods-btn" v-if="!groupId" @tap="openPopup('xiadan','dandu',item)" <view class="goods-btn" v-if="!groupId" @tap="openPopup('xiadan','dandu',item)"
style="background: rgba(166, 255, 234, 0.3);margin-right: 6%;border: 1px solid rgba(166, 255, 234, 0.5);"> style="background: rgba(166, 255, 234, 0.3);border: 1px solid rgba(166, 255, 234, 0.5);height:68rpx;">
直接购买¥{{item.attributeListPrice | sliceMsg}} 直接购买¥{{item.attributeListPrice | sliceMsg}}
</view> </view>
<view v-if="item.productGroupBuyPrices != null && item.isMoreBuy != 1" class="goods-btn" :style="{'float':groupId != ''?'right':''}" @tap="openPopup('xiadan','pintuan',item)">
拼团购买¥{{ getGroupPrice(item) }}
</view> </view>
</view> </view>
<uni-load-more :status="loadStatus" @change="onChange" />
<view style="height: 80px;width: 100%;"></view>
</view> </view>
</view> </view>
<uni-load-more :status="loadStatus" @change="onChange" />
</view> </view>
<view style="width: 100%;height: 160rpx;"></view> <view style="width: 100%;height: 160rpx;"></view>
<view class="bottom"> <view class="bottom">
@ -549,12 +546,6 @@
} }
return name; return name;
}, },
sliceMsg1(val) {
var name = '正在有'
let aa = Math.floor(Math.random() * (15 - 5 + 1)) + 1;
name += aa + '人下单'
return name;
},
slicePrice(val) { slicePrice(val) {
let begin = '' let begin = ''
if (val != null) { if (val != null) {
@ -568,32 +559,6 @@
return begin; return begin;
} }
}, },
onPageScroll(e) {
const scrollTop = e.scrollTop;
const isScrollingUp = scrollTop < this.lastScrollTop;
//
// 80px
if (isScrollingUp && scrollTop < 80 && !this.isSwitching) {
const currIdx = this.menuList.findIndex(m => m.checked);
if (currIdx > 0) {
this._switchCategory(currIdx - 1);
}
}
this.lastScrollTop = scrollTop;
},
onReachBottom() {
//
if (this.searchForm.pageNum < this.total) {
this.searchForm.pageNum++;
this.getProduct(this.searchForm.categoryId);
return;
}
//
const currIdx = this.menuList.findIndex(m => m.checked);
if (currIdx !== -1 && currIdx < this.menuList.length - 1) {
this._switchCategory(currIdx + 1);
}
},
onLoad(option) { onLoad(option) {
this.type = option.type; this.type = option.type;
if (option.groupId) { if (option.groupId) {
@ -672,17 +637,6 @@
that.total = res.result.pages; // pages = that.total = res.result.pages; // pages =
that.pageNum = that.searchForm.pageNum; that.pageNum = that.searchForm.pageNum;
//
// isSwitching_switchCategory isSwitching=true
if (res.result.records.length === 0) {
const currIdx = that.menuList.findIndex(m => m.checked);
if (currIdx !== -1 && currIdx < that.menuList.length - 1) {
console.log('000000000000')
//
that.isSwitching = false;
that._switchCategory(currIdx + 1);
}
}
that.$forceUpdate(); that.$forceUpdate();
} else { } else {
that.tui.toast(res.message); that.tui.toast(res.message);
@ -711,16 +665,6 @@
uni.hideLoading() uni.hideLoading()
}).catch((res) => {}) }).catch((res) => {})
}, },
// isSwitching
_switchCategory(index) {
if (this.isSwitching) return;
this.isSwitching = true;
this.checkTab(index);
// 400ms200ms200ms
setTimeout(() => {
this.isSwitching = false;
}, 400);
},
checkTab(index) { checkTab(index) {
for (let i = 0; i < this.menuList.length; i++) { for (let i = 0; i < this.menuList.length; i++) {
this.menuList[i].checked = (i === index); this.menuList[i].checked = (i === index);
@ -731,13 +675,6 @@
this.total = 1; this.total = 1;
this.productItem = []; this.productItem = [];
this.getProduct(this.menuList[index].id); this.getProduct(this.menuList[index].id);
// nav-bar
// menuListOffsetTop - navBarHeight 使sticky
const target = this.menuListOffsetTop - this.navBarHeight;
uni.pageScrollTo({
scrollTop: target > 0 ? target : 0,
duration: 200
});
}, },
openOrderWait(item){ openOrderWait(item){
this.chooseWaitType = false this.chooseWaitType = false
@ -1284,6 +1221,7 @@
height: 100%; height: 100%;
font-size: 24rpx; font-size: 24rpx;
position: relative; position: relative;
overflow: hidden;
} }
/* 顶部背景图随页面滚动(不固定) */ /* 顶部背景图随页面滚动(不固定) */
@ -1335,6 +1273,7 @@
margin-top: -150rpx; margin-top: -150rpx;
position: relative; position: relative;
z-index: 1; z-index: 1;
height: 88%;
} }
.shop-img { .shop-img {
@ -1498,9 +1437,8 @@
} }
.goods-member { .goods-member {
padding: 20rpx 0; padding-bottom: 20rpx;
margin-bottom: 20rpx; margin: 0 0 20rpx;
border-radius: 20rpx;
background: #fff; background: #fff;
} }
@ -1509,10 +1447,11 @@
height: auto; height: auto;
border-radius: 20rpx; border-radius: 20rpx;
margin: 0 auto 20rpx; margin: 0 auto 20rpx;
overflow: scroll;
} }
.goods-top { .goods-top {
padding: 20rpx 0; padding: 20rpx;
display: flex; display: flex;
} }
@ -1559,7 +1498,7 @@
.goods-tag { .goods-tag {
display: flex; display: flex;
margin: 0; margin: 0;
width: 40%; width: 100%;
} }
.goods-content-bottom { .goods-content-bottom {
@ -1583,9 +1522,8 @@
} }
.goods-bottom { .goods-bottom {
display: flex;
width: 95%; width: 95%;
margin: 20rpx auto; margin: 0 auto;
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
} }
@ -1595,8 +1533,9 @@
width: 47%; width: 47%;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
font-weight: 600; font-weight: 700;
border-radius: 20rpx; border-radius: 20rpx;
float:right;
} }
.bottom { .bottom {
@ -1890,20 +1829,6 @@
margin-bottom: 10rpx; margin-bottom: 10rpx;
} }
.menu-list {
height: 90rpx;
width: 100%;
overflow-x: scroll;
display: flex;
overflow-y: hidden;
position: sticky;
top: 0;
z-index: 90;
background: #F5F8F5;
align-items: center;
padding-bottom: 8rpx;
}
.checked-img { .checked-img {
width: 180rpx; width: 180rpx;
height: 20rpx; height: 20rpx;
@ -1913,10 +1838,10 @@
} }
.menu1 { .menu1 {
width: 180rpx; width: 160rpx;
height: 70rpx; height: 90rpx;
position: relative; position: relative;
margin-left: 30rpx; text-align: center;
line-height: 70rpx; line-height: 90rpx;
} }
</style> </style>
Loading…
Cancel
Save