feat : 添加评论部分筛选款式功能

This commit is contained in:
赵毅 2025-07-25 15:21:49 +08:00
parent 48b26483c0
commit d50dd6167e
2 changed files with 313 additions and 162 deletions

View File

@ -522,3 +522,94 @@ image {
color: #999;
text-align: right;
}
.popup-header {
display: flex;
width: 90%;
padding-left: 80rpx;
margin: 20rpx 0;
}
.popup-header-h3 {
font-weight: bold;
margin: 0 auto;
}
.popup-header-view {
font-size: 24rpx;
color: #999;
margin-right: 30rpx;
}
.temp {
display: flex;
justify-content: space-between;
align-items: center;
}
.temp1 {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 24rpx;
color: #959595;
margin: 20rpx 0 5rpx 0;
}
.temp_img {
width: 35rpx;
height: 35rpx;
margin-right: 10rpx;
}
.temp_img1 {
width: 30rpx;
height: 30rpx;
margin: 5rpx 5rpx 0 5rpx;
}
.itemSize {
width: 30%;
font-size: 26rpx;
color: #333;
background: #F6F7FB;
border-radius: 40rpx;
padding: 10rpx 15rpx;
white-space: nowrap;
margin:20rpx 30rpx;
}
.itemSize_active {
background: #FF370B;
color: #fff;
}
.itemSize-img{
width: 100rpx;
height: 100rpx;
margin-right: 30rpx;
border-radius: 20rpx;
border:1rpx solid red;
}
.itemSize_top{
display: flex;
margin-left: 30rpx;
}
.itemSize_info {
margin-top: 10rpx;
}
.itemSize_name {
font-size: 28rpx;
font-weight: 500;
font-weight: bold;
}
.itemSize_price {
font-size: 28rpx;
font-weight: 500;
margin-top: 10rpx;
color: red;
}

View File

@ -1,16 +1,16 @@
<template>
<view>
<div class="header">
<div
<view class="header">
<view
class="searchBox"
:style="{ height: localHeight + 'px', paddingTop: top + 'px' }"
>
<div class="searchBox_left" @click="back">
<view class="searchBox_left" @click="back">
<u-icon name="arrow-left" size="20px" color="#000"></u-icon>
</div>
</div>
</div>
<div class="swiper">
</view>
</view>
</view>
<view class="swiper">
<swiper
:indicator-dots="false"
:autoplay="true"
@ -26,24 +26,24 @@
</swiper-item>
</swiper>
<div class="NumDot">
<view class="NumDot">
{{ currentIndex }} /{{ currentGG.goods_carousel.length }}
</div>
</div>
</view>
</view>
<div class="Money">
<div class="MoneyMark"></div>
<view class="Money">
<view class="MoneyMark"></view>
{{ currentGG.sales_price }}
<div class="MoneyUnit">/{{ currentGG.goods_unit }}</div>
<view class="MoneyUnit">/{{ currentGG.goods_unit }}</view>
<div class="oldMoney">{{ currentGG.market_price }}</div>
</div>
<view class="oldMoney">{{ currentGG.market_price }}</view>
</view>
<!-- 规格 -->
<!-- @click="changeGG2(item, index)" :class="index == currentGGIndex ? 'active' : ''"> -->
<div class="GGBox">
<div class="GG_left">
<div
<view class="GGBox">
<view class="GG_left">
<view
class="GG_Item"
v-for="(item, index) in info.commodity_goods_info_list"
:key="item.id"
@ -51,130 +51,127 @@
:class="index == currentGGIndex ? 'active' : ''"
>
{{ item.goods_spec }} / {{ item.goods_unit }}
</div>
</div>
<div class="GG_rigth">
</view>
</view>
<view class="GG_rigth">
{{ info.commodity_goods_info_list.length }}<u-icon
size="26rpx"
name="arrow-right"
></u-icon>
</div>
</div>
</view>
</view>
<div class="Tit">{{ currentGG.goods_name }}</div>
<div class="Msg">{{ currentGG.commodity_brief }}</div>
<view class="Tit">{{ currentGG.goods_name }}</view>
<view class="Msg">{{ currentGG.commodity_brief }}</view>
<div class="fenge"></div>
<view class="fenge"></view>
<!-- 促销信息区域 -->
<div class="promotions-container">
<div class="promotion-item">
<div class="promotion-tag">优惠</div>
<div class="promotion-content promotion-content1">满100减10</div>
</div>
<div class="promotion-item">
<div class="promotion-tag">限购</div>
<div class="promotion-content">限购5件</div>
</div>
<div class="promotion-item">
<div class="promotion-tag">阶梯价</div>
<div class="promotion-content">1~9 9.5/;>10 8.0/</div>
</div>
<div class="promotion-item">
<div class="promotion-tag">满赠</div>
<div class="promotion-content">满5赠1满10赠3</div>
</div>
<div class="promotion-item">
<div class="promotion-tag">满减</div>
<div class="promotion-content">满100减5满200减20</div>
</div>
</div>
<view class="promotions-container">
<view class="promotion-item">
<view class="promotion-tag">优惠</view>
<view class="promotion-content promotion-content1">满100减10</view>
</view>
<view class="promotion-item">
<view class="promotion-tag">限购</view>
<view class="promotion-content">限购5件</view>
</view>
<view class="promotion-item">
<view class="promotion-tag">阶梯价</view>
<view class="promotion-content">1~9 9.5/;>10 8.0/</view>
</view>
<view class="promotion-item">
<view class="promotion-tag">满赠</view>
<view class="promotion-content">满5赠1满10赠3</view>
</view>
<view class="promotion-item">
<view class="promotion-tag">满减</view>
<view class="promotion-content">满100减5满200减20</view>
</view>
</view>
<div class="fenge"></div>
<view class="fenge"></view>
<div class="Msg_Item">
<div class="Msg_ItemTit">质检</div>
<div class="Msg_ItemCon">质检报告</div>
</div>
<div class="Msg_Item">
<div class="Msg_ItemTit">押金</div>
<div class="Msg_ItemCon">需另付押金:30.00(30天可退)</div>
</div>
<div class="Msg_Item">
<div class="Msg_ItemTit">配送</div>
<text class="Msg_ItemCon">
12:00前下单,预计8月21日送达;
12:00前下单,预计8月21日送达;
</text>
</div>
<div class="fenge"></div>
<view class="Msg_Item">
<view class="Msg_ItemTit">质检</view>
<view class="Msg_ItemCon">质检报告</view>
</view>
<view class="Msg_Item">
<view class="Msg_ItemTit">押金</view>
<view class="Msg_ItemCon">需另付押金:30.00(30天可退)</view>
</view>
<view class="Msg_Item">
<view class="Msg_ItemTit">配送</view>
<view class="Msg_ItemCon"> 12:00前下单,预计8月21日送达; </view>
</view>
<view class="fenge"></view>
<!-- 评价部分 -->
<div class="reviews-section">
<div class="reviews-header">
<view class="reviews-section">
<view class="reviews-header">
<h3>评价({{ comments.length }})</h3>
<view class="view-all" @click="showPopup">查看全部 ></view>
</div>
<div class="reviews-list" v-if="comments.length > 0">
<div
</view>
<view class="reviews-list" v-if="comments.length > 0">
<view
class="review-item"
v-for="(comment, index) in comments"
:key="index"
>
<div class="review-user">
<view class="review-user">
<image :src="comment.avatar" class="user-avatar"></image>
<div class="user-info">
<div class="user-name">{{ comment.username }}</div>
</div>
<div class="review-time">{{ comment.time }}</div>
</div>
<div class="user-purchase">已购 {{ comment.product }}</div>
<div class="review-content">{{ comment.content }}</div>
<div class="review-images" v-if="comment.images.length > 0">
<view class="user-info">
<view class="user-name">{{ comment.username }}</view>
</view>
<view class="review-time">{{ comment.time }}</view>
</view>
<view class="user-purchase">已购 {{ comment.product }}</view>
<view class="review-content">{{ comment.content }}</view>
<view class="review-images" v-if="comment.images.length > 0">
<image
:src="img"
class="review-img"
v-for="(img, idx) in comment.images"
:key="idx"
></image>
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
<div class="fenge"></div>
<view class="fenge"></view>
<h3 class="GoodsMsg">商品详情</h3>
<div class="Msg_Item">
<div class="Msg_ItemTit">商品编号</div>
<div class="Msg_ItemCon" @click="copys(currentGG.goods_no)">
<view class="Msg_Item">
<view class="Msg_ItemTit">商品编号</view>
<view class="Msg_ItemCon" @click="copys(currentGG.goods_no)">
{{ currentGG.goods_no }}
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_copy.png"
></image>
</div>
</div>
<div class="Msg_Item">
<div class="Msg_ItemTit">规格说明</div>
<div class="Msg_ItemCon">{{ currentGG.goods_spec }}</div>
</div>
<div class="Msg_Item">
<div class="Msg_ItemTit">售卖单位</div>
<div class="Msg_ItemCon">{{ currentGG.goods_unit }}</div>
</div>
</view>
</view>
<view class="Msg_Item">
<view class="Msg_ItemTit">规格说明</view>
<view class="Msg_ItemCon">{{ currentGG.goods_spec }}</view>
</view>
<view class="Msg_Item">
<view class="Msg_ItemTit">售卖单位</view>
<view class="Msg_ItemCon">{{ currentGG.goods_unit }}</view>
</view>
<div class="GoosMsg">
<view class="GoosMsg">
<image
v-for="item in currentGG.goods_detail_pic"
:src="picUrl + item"
mode="widthFix"
></image>
</div>
</view>
<div class="priceInfo">
<view class="priceInfo">
<h3 class="priceInfo-title">价格说明</h3>
<div class="priceInfo-content">
<view class="priceInfo-content">
<view>
<text class="priceInfo-content-title">划线价格</text>
指商品的厂商指导价正品零售价市面常见价或该商品曾经展示过的销售价等并非原价仅供参考
@ -183,20 +180,20 @@
<text class="priceInfo-content-title">未划线价格</text>
指商品的实时价格不因表述的差异改变性质具体成交价格根据商品参加活动或使用优惠券等发生变化最终以订单结算价格为准
</view>
</div>
</div>
</view>
</view>
<!-- 底部购物车 -->
<div class="Car">
<div class="car_left">
<div class="share" @click="share">
<view class="Car">
<view class="car_left">
<view class="share" @click="share">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share.png"
mode="widthFix"
></image>
分享
</div>
<div class="cars" @click="car">
</view>
<view class="cars" @click="car">
<u-badge
numberType="limit"
:type="type"
@ -209,10 +206,10 @@
mode="widthFix"
></image>
购物车
</div>
</div>
</view>
</view>
<div
<view
class="car_right"
v-if="
!info.commodity_goods_info_list[currentGGIndex].cart_count ||
@ -221,9 +218,9 @@
@click="addCar"
>
加入购物车
</div>
</view>
<div
<view
class="car_right"
v-if="
info.commodity_goods_info_list[currentGGIndex].cart_count.count > 0
@ -252,54 +249,54 @@
<u-icon name="plus" color="#FFFFFF" size="36" bold></u-icon>
</view>
</u-number-box>
</div>
</div>
</view>
</view>
<!-- 分享 -->
<div class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
<div class="shadowBox1">
<div class="shadowBox1Item" @click="shareFriend">
<view class="shadow" @click.stop="changeShadow" v-if="boxshadow1">
<view class="shadowBox1">
<view class="shadowBox1Item" @click="shareFriend">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_WX.png"
mode="aspectFill"
></image>
微信好友
</div>
<div class="shadowBox1Item" @click="openSave">
</view>
<view class="shadowBox1Item" @click="openSave">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_saveImg.png"
mode="aspectFill"
></image>
生成海报
</div>
</div>
</div>
</view>
</view>
</view>
<!-- 海报 -->
<div class="shadow" @click="changeShadow2" v-if="boxshadow2">
<div class="shadowBox2">
<div class="shadowBox_img">
<div class="boxshadow_tit">今日商品推荐</div>
<div class="boxshadow_img">
<view class="shadow" @click="changeShadow2" v-if="boxshadow2">
<view class="shadowBox2">
<view class="shadowBox_img">
<view class="boxshadow_tit">今日商品推荐</view>
<view class="boxshadow_img">
<image
src="https://wechat-img-file.oss-cn-beijing.aliyuncs.com/property-img-file/shop_share_img.png"
>
</image>
</div>
<div class="line"></div>
<div class="shadowBoxInfo">
<div class="shadowboxInfo_left">二维码</div>
<div class="shadowboxInfo_right">
<div class="shadowboxInfo_right_1">正鲜生</div>
<div class="shadowboxInfo_right_2">
</view>
<view class="line"></view>
<view class="shadowBoxInfo">
<view class="shadowboxInfo_left">二维码</view>
<view class="shadowboxInfo_right">
<view class="shadowboxInfo_right_1">正鲜生</view>
<view class="shadowboxInfo_right_2">
长按识别小程序 <br />
数量有限马上抢购
</div>
</div>
</div>
</div>
<div class="shadowBox_btn" @click.stop="saveImg">保存海报</div>
</div>
</div>
</view>
</view>
</view>
</view>
<view class="shadowBox_btn" @click.stop="saveImg">保存海报</view>
</view>
</view>
<!-- 评价 查看详情 -->
<u-popup
@ -308,37 +305,79 @@
mode="bottom"
@close="close"
@open="open"
:z-index="10070"
>
<div class="reviews-section">
<div class="reviews-header">
<h3>评价</h3>
</div>
<div class="reviews-list" v-if="comments.length > 0">
<div
<view class="reviews-section">
<view class="popup-header">
<h3 class="popup-header-h3">评价</h3>
<view class="popup-header-view" @click="close">取消</view>
</view>
<view class="temp">
<view class="temp1">
<img class="temp_img" src="http://localhost:8080/pingjia.png" />
为你展示真实评价
</view>
<view class="temp1" @click="showSizePopup">
款式
<img class="temp_img1" src="http://localhost:8080/kuanshi.png" />
</view>
</view>
<view class="reviews-list" v-if="comments.length > 0">
<view
class="review-item"
v-for="(comment, index) in comments"
:key="index"
>
<div class="review-user">
<view class="review-user">
<image :src="comment.avatar" class="user-avatar"></image>
<div class="user-info">
<div class="user-name">{{ comment.username }}</div>
</div>
<div class="review-time">{{ comment.time }}</div>
</div>
<div class="user-purchase">已购 {{ comment.product }}</div>
<div class="review-content">{{ comment.content }}</div>
<div class="review-images" v-if="comment.images.length > 0">
<view class="user-info">
<view class="user-name">{{ comment.username }}</view>
</view>
<view class="review-time">{{ comment.time }}</view>
</view>
<view class="user-purchase">已购 {{ comment.product }}</view>
<view class="review-content">{{ comment.content }}</view>
<view class="review-images" v-if="comment.images.length > 0">
<image
:src="img"
class="review-img"
v-for="(img, idx) in comment.images"
:key="idx"
></image>
</div>
</div>
</div>
</div>
</view>
</view>
</view>
</view>
</u-popup>
<!-- 选择款式 -->
<u-popup
:show="showSize"
round="20rpx"
mode="bottom"
@close="closeSize"
@open="open"
>
<view class="popup-header">
<h3 class="popup-header-h3">选择款式</h3>
<view class="popup-header-view" @click="closeSize">取消</view>
</view>
<view class="itemSize_top">
<image :src="changeImg" class="itemSize-img"></image>
<view class="itemSize_info">
<view class="itemSize_name">{{ changeName }}</view>
<view class="itemSize_price">{{ changePrice }}/</view>
</view>
</view>
<view
class="itemSize"
v-for="(item, index) in info.commodity_goods_info_list"
:key="item.id"
@click="changeGG(item, index)"
:class="index == currentGGIndex ? 'itemSize_active' : ''"
>
{{ item.goods_name }} {{ item.goods_spec }} / {{ item.goods_unit }}
</view>
</u-popup>
</view>
</template>
@ -393,6 +432,11 @@ export default {
},
],
show: false,
showSize: false,
changeImg: "",
changeName: "",
changePrice: "",
};
},
methods: {
@ -502,6 +546,10 @@ export default {
this.info = res;
this.currentGG = res.commodity_goods_info_list[0];
this.currentGGIndex = 0;
this.changeImg = this.currentGG.commodity_pic[0]
this.changeName = this.currentGG.goods_alias
this.changePrice = this.currentGG.sales_price
});
},
@ -520,6 +568,7 @@ export default {
//
changeGG(item, index) {
console.log("🚀 ~ changeGG ~ item:", item);
this.currentGG = item;
this.currentGGIndex = index;
if (this.currentGG.cart_count) {
@ -527,6 +576,9 @@ export default {
} else {
this.currentGG.cart_count = { count: 0 };
}
this.changeImg = item.commodity_pic[0]
this.changeName = item.goods_alias
this.changePrice = item.sales_price
},
car() {
NavgateTo("../shopCar/index");
@ -609,12 +661,20 @@ export default {
},
showPopup() {
console.log("🚀 ~ showPopup ~ showPopup:");
this.show = true;
},
showSizePopup() {
this.showSize = true;
},
close() {
this.show = false;
},
closeSize() {
this.showSize = false;
},
},
onLoad(options) {
const itemObj = JSON.parse(decodeURIComponent(options.item));