评论列表

parent 9fc608eb
......@@ -35,37 +35,33 @@
</view>
<view class="comment-list">
<view class="comment-item" v-for="item in 3" :key="item">
<view class="comment-item" v-for="(item, index) in commentData" :key="index">
<view class="top">
<view class="row">
<image
class="headPortrait"
mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png"
></image>
<image class="headPortrait" mode="aspectFill" :src="fileDomain + item.avatar"></image>
<view class="right">
<text class="name">略略略</text>
<text class="name">{{ item.nickName }}</text>
<view class="ratebox">
<image
class="rate-img"
src="@/static/assistingAgriculture/detail/fiveStars.png"
src="../static/assistingAgriculture/index/fiveStars.png"
></image>
<text>5.0分</text>
<text>好评</text>
<text>{{ item.merchantServices }}.0分</text>
<text>{{ rateList[item.merchantServices].text }}</text>
</view>
</view>
</view>
<text class="detail">2024-08-03 筑农散养虫子土鸡(未下蛋小母鸡)x2</text>
<text class="detail">{{ item.createTime.slice(0, 10) }} {{ item.prodName }}x2</text>
</view>
<view class="info">
<text class="text">味道鲜美,煲出来的汤非常好喝,值得购买!</text>
<view class="imgbox">
<text class="text">{{ item.evaluation }}</text>
<view class="imgbox" v-if="item.images.length > 0">
<image
class="img"
mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png"
v-for="item in 6"
:key="item"
:src="fileDomain + img"
v-for="img in item.images"
:key="img"
></image>
</view>
</view>
......@@ -104,54 +100,44 @@ const tabs = ref([
},
]);
const rateList = ref([
{
value: 1,
url: '@/static/assistingAgriculture/index/oneStar.png',
const rateList = ref({
1: {
url: '../../static/assistingAgriculture/index/oneStar.png',
text: '很糟',
},
{
value: 2,
url: '@/static/assistingAgriculture/index/twoStars.png',
2: {
url: '../../static/assistingAgriculture/index/twoStars.png',
text: '较差',
},
{
value: 3,
url: '@/static/assistingAgriculture/index/threeStars.png',
3: {
url: '../../static/assistingAgriculture/index/threeStars.png',
text: '一般',
},
{
value: 4,
url: '@/static/assistingAgriculture/index/fourStars.png',
4: {
url: '../../static/assistingAgriculture/index/fourStars.png',
text: '还行',
},
{
value: 5,
url: '@/static/assistingAgriculture/index/fiveStars.png',
5: {
url: '../../static/assistingAgriculture/index/fiveStars.png',
text: '超赞',
},
]);
});
/**
* 获取用户优惠券列表
*/
const isEnd = ref(false);
const state = ref('loading');
const total = ref(0);
const couponData = ref([]);
const commentData = ref([]);
const catalog = reactive({
current: 0,
size: 10,
statuMain: 0,
statuSon: 0,
shopId: '1818876196597334017',
evaluation: '', // 关键字搜索
type: '', // img-图片,append-追评,diff-中差评,good-好评
});
const getCouponList = async () => {
// if (isEnd.value) return;
const getList = async () => {
catalog.current++;
state.value = 'loading';
catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value;
console.log(catalog);
xma.showLoading({
title: '加载中...',
mask: true,
......@@ -162,12 +148,16 @@ const getCouponList = async () => {
}
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
item.showDetail = false;
if (item.images === '') {
item.images = [];
} else {
item.images = item.images.split(',');
}
});
couponData.value.push(...res.data.records);
commentData.value.push(...res.data.records);
total.value = res.data.total;
console.log(commentData.value);
}
// state.value = 'finished';
xma.hideLoading();
};
getList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment