|
|
|
@ -80,21 +80,21 @@ |
|
|
|
<view class="goods-list"> |
|
|
|
<view class="menu-list"> |
|
|
|
<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','width':item.checked?'90px':'70px'}"> |
|
|
|
<view style="width: 90px;">{{item.name}}</view> |
|
|
|
<view style="width: 90px;">{{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 class="goods-member"> |
|
|
|
<view class="goods-member" v-for="(item,index) in productItem" :key="index" @tap="goDetail('product',item)"> |
|
|
|
<view class="goods-top"> |
|
|
|
<view class="goods-img"> |
|
|
|
<img src="/static/images/img/shangpintu.png" alt=""> |
|
|
|
<img :src="item.productPicture" alt="" style="border-radius: 10px;"> |
|
|
|
<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 class="goods-content" @tap="goDetail('goodsDetail')"> |
|
|
|
<view class="goods-name"> |
|
|
|
牛仔农庄(医专店) |
|
|
|
{{item.productName}} |
|
|
|
</view> |
|
|
|
<view class="goods-content-center"> |
|
|
|
<view class="goods-deal1"> |
|
|
|
@ -111,23 +111,21 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="goods-content-bottom"> |
|
|
|
<view style="font-size: 28rpx;line-height: 54rpx;margin-right: 20rpx;"> |
|
|
|
¥90.00 |
|
|
|
</view> |
|
|
|
<view class="pintuan-left-price"> |
|
|
|
拼团<text style="color: red;">¥59.90</text> |
|
|
|
</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 class="goods-bottom"> |
|
|
|
<view class="goods-btn" @tap="openPopup('pintuan',1)" |
|
|
|
<view class="goods-btn" @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);"> |
|
|
|
直接购买 |
|
|
|
直接购买¥{{item.attributeListPrice | sliceMsg}} |
|
|
|
</view> |
|
|
|
<view class="goods-btn" @tap="openPopup('pintuan',0)"> |
|
|
|
拼团购买¥15.00 |
|
|
|
<view class="goods-btn" @tap="openPopup('xiadan','pintuan',item)"> |
|
|
|
拼团购买¥{{item.productGroupBuyPrices | slicePrice}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
@ -136,7 +134,7 @@ |
|
|
|
<view style="width: 100%;height: 160rpx;"></view> |
|
|
|
<view class="bottom"> |
|
|
|
<view class="bottom-left"> |
|
|
|
<view style="position: relative;width: 60rpx;height: 80rpx;margin-top: 20rpx;" @tap="openPopup('car')"> |
|
|
|
<view style="position: relative;width: 60rpx;height: 80rpx;margin-top: 20rpx;" @tap="openPopup('car','','')"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/60db52398a65459e9541881c926986a4.png" alt="" /> |
|
|
|
<view class="bottom-dot">1</view> |
|
|
|
</view> |
|
|
|
@ -159,7 +157,7 @@ |
|
|
|
</view> |
|
|
|
<view class="goods-top" style="padding: 0;"> |
|
|
|
<view class="goods-img"> |
|
|
|
<img src="/static/images/img/shangpintu.png" alt=""> |
|
|
|
<img src="/static/images/img/shangpintu.png" alt="" style="border-radius: 10px;"> |
|
|
|
<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%;" /> |
|
|
|
@ -197,7 +195,7 @@ |
|
|
|
<view style="width: 100%;height: 160rpx;"></view> |
|
|
|
<view class="bottom" style="padding-bottom: 10px;"> |
|
|
|
<view class="bottom-left"> |
|
|
|
<view style="width: 60rpx;height: 80rpx;margin-top: 10rpx;" @tap="openPopup('car')"> |
|
|
|
<view style="width: 60rpx;height: 80rpx;margin-top: 10rpx;" @tap="openPopup('car','','')"> |
|
|
|
<img src="https://jewel-shop.oss-cn-beijing.aliyuncs.com/60db52398a65459e9541881c926986a4.png" alt="" /> |
|
|
|
</view> |
|
|
|
<view class="bottom-price" style="line-height: 24px;"> |
|
|
|
@ -220,7 +218,7 @@ |
|
|
|
</view> |
|
|
|
<view class="goods-top"> |
|
|
|
<view class="goods-img"> |
|
|
|
<img src="/static/images/img/shangpintu.png" alt=""> |
|
|
|
<img src="/static/images/img/shangpintu.png" alt="" style="border-radius: 10px;"> |
|
|
|
<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%;" /> |
|
|
|
@ -396,28 +394,56 @@ |
|
|
|
shopItem:{}, |
|
|
|
productItem:{}, |
|
|
|
productId:'', |
|
|
|
productItem:[], |
|
|
|
buyCar:new Map(), |
|
|
|
pageNum:1, |
|
|
|
searchForm:{ |
|
|
|
shopId:'', |
|
|
|
pageNum: 1, |
|
|
|
pageSize: '10', |
|
|
|
categoryId:'' |
|
|
|
}, |
|
|
|
menuButtonInfo: {}, |
|
|
|
isPintuan:true, |
|
|
|
menuList:[{ |
|
|
|
name:'猜你喜欢', |
|
|
|
categoryName:'猜你喜欢', |
|
|
|
id:'', |
|
|
|
checked:true |
|
|
|
},{ |
|
|
|
name:'超值套餐', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
name:'清爽解腻', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
name:'随心搭配', |
|
|
|
checked:false |
|
|
|
},{ |
|
|
|
name:'风味炸鸡', |
|
|
|
checked:false |
|
|
|
}] |
|
|
|
} |
|
|
|
}, |
|
|
|
components: { |
|
|
|
|
|
|
|
}, |
|
|
|
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; |
|
|
|
}, |
|
|
|
sliceMsg1(val) { |
|
|
|
var name = '正在有' |
|
|
|
let aa = Math.floor(Math.random() * (15 - 5 + 1)) + 1; |
|
|
|
name+=aa+'人下单' |
|
|
|
return name; |
|
|
|
}, |
|
|
|
slicePrice(val){ |
|
|
|
let begin = '' |
|
|
|
if(val != null){ |
|
|
|
begin = val[0].groupPrice |
|
|
|
for(let i = 0;i < val.length;i++){ |
|
|
|
if(val[i].groupPrice < begin){ |
|
|
|
begin = val[i].groupPrice |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return begin; |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
this.type = option.type |
|
|
|
@ -426,12 +452,52 @@ |
|
|
|
}else{ |
|
|
|
this.productItem = JSON.parse(option.item) |
|
|
|
} |
|
|
|
console.log(this.shopItem) |
|
|
|
this.getCategory(this.shopItem.id) |
|
|
|
this.getProduct('') |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
getProduct(categoryId){ |
|
|
|
let that = this |
|
|
|
this.searchForm.shopId = this.shopItem.id |
|
|
|
this.searchForm.categoryId = categoryId |
|
|
|
that.tui.request("/app/product/getShareList", "POST", this.searchForm, false, false).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if (that.pageNum == 1) { |
|
|
|
that.productItem = res.result.records |
|
|
|
} else { |
|
|
|
that.productItem = [...that.productItem, ...res.result.records] |
|
|
|
} |
|
|
|
that.$forceUpdate() |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
return |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
getCategory(id){ |
|
|
|
let that = this |
|
|
|
that.tui.request("/app/productCategory/list", "GET", { |
|
|
|
shopId:id |
|
|
|
}, false, true).then((res) => { |
|
|
|
if (res.code == 200) { |
|
|
|
if(res.result.length >0){ |
|
|
|
for(let i = 0;i<res.result.length;i++){ |
|
|
|
res.result[i].checked = false |
|
|
|
that.menuList.push(res.result[i]) |
|
|
|
} |
|
|
|
} |
|
|
|
that.$forceUpdate() |
|
|
|
} else { |
|
|
|
that.tui.toast(res.message) |
|
|
|
return |
|
|
|
} |
|
|
|
uni.hideLoading() |
|
|
|
}).catch((res) => {}) |
|
|
|
}, |
|
|
|
checkTab(index){ |
|
|
|
for(let i=0;i<this.menuList.length;i++){ |
|
|
|
if(i == index){ |
|
|
|
@ -440,17 +506,23 @@ |
|
|
|
this.menuList[i].checked = false |
|
|
|
} |
|
|
|
} |
|
|
|
this.getProduct(this.menuList[index].id); |
|
|
|
}, |
|
|
|
openPopup(type,index){ |
|
|
|
openPopup(type,index,item){ |
|
|
|
if(type == 'car'){ |
|
|
|
this.$refs.carPopup.open('bottom') |
|
|
|
}else if(type == 'pintuan'){ |
|
|
|
if(index == 0){ |
|
|
|
}else if(type == 'xiadan'){ |
|
|
|
if(index == 'pintuan'){ |
|
|
|
this.isPintuan = true |
|
|
|
}else{ |
|
|
|
this.isPintuan = false |
|
|
|
} |
|
|
|
this.$refs.pintuanPopup.open('bottom') |
|
|
|
if(item.attributeList == '' || item.attributeList == null){ |
|
|
|
this.buyCar.has(item.id) |
|
|
|
}else{ |
|
|
|
this.$refs.pintuanPopup.open('bottom') |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
goDetail(type) { |
|
|
|
@ -460,11 +532,11 @@ |
|
|
|
}) |
|
|
|
}else if(type == 'shopDetail'){ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/package1/group/groupBuyDetail' |
|
|
|
url: '/package1/group/groupBuyDetail?item=' + JSON.stringify(this.shopItem) |
|
|
|
}) |
|
|
|
}else if(type == 'shopEvaluate'){ |
|
|
|
uni.navigateTo({ |
|
|
|
url: '/package1/group/shopEvaluate' |
|
|
|
url: '/package1/group/shopEvaluate?item=' + JSON.stringify(this.shopItem) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -589,6 +661,12 @@ |
|
|
|
line-height: 40rpx; |
|
|
|
text-align: right; |
|
|
|
} |
|
|
|
|
|
|
|
.shop-tag1 { |
|
|
|
flex: 1; |
|
|
|
line-height: 40rpx; |
|
|
|
text-align: left; |
|
|
|
} |
|
|
|
|
|
|
|
.shop-content-bottom { |
|
|
|
display: flex; |
|
|
|
|