评论列表

parent 9fc608eb
...@@ -35,37 +35,33 @@ ...@@ -35,37 +35,33 @@
</view> </view>
<view class="comment-list"> <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="top">
<view class="row"> <view class="row">
<image <image class="headPortrait" mode="aspectFill" :src="fileDomain + item.avatar"></image>
class="headPortrait"
mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png"
></image>
<view class="right"> <view class="right">
<text class="name">略略略</text> <text class="name">{{ item.nickName }}</text>
<view class="ratebox"> <view class="ratebox">
<image <image
class="rate-img" class="rate-img"
src="@/static/assistingAgriculture/detail/fiveStars.png" src="../static/assistingAgriculture/index/fiveStars.png"
></image> ></image>
<text>5.0分</text> <text>{{ item.merchantServices }}.0分</text>
<text>好评</text> <text>{{ rateList[item.merchantServices].text }}</text>
</view> </view>
</view> </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>
<view class="info"> <view class="info">
<text class="text">味道鲜美,煲出来的汤非常好喝,值得购买!</text> <text class="text">{{ item.evaluation }}</text>
<view class="imgbox"> <view class="imgbox" v-if="item.images.length > 0">
<image <image
class="img" class="img"
mode="aspectFill" mode="aspectFill"
src="@/static/assistingAgriculture/detail/detail-img.png" :src="fileDomain + img"
v-for="item in 6" v-for="img in item.images"
:key="item" :key="img"
></image> ></image>
</view> </view>
</view> </view>
...@@ -104,54 +100,44 @@ const tabs = ref([ ...@@ -104,54 +100,44 @@ const tabs = ref([
}, },
]); ]);
const rateList = ref([ const rateList = ref({
{ 1: {
value: 1, url: '../../static/assistingAgriculture/index/oneStar.png',
url: '@/static/assistingAgriculture/index/oneStar.png',
text: '很糟', text: '很糟',
}, },
{ 2: {
value: 2, url: '../../static/assistingAgriculture/index/twoStars.png',
url: '@/static/assistingAgriculture/index/twoStars.png',
text: '较差', text: '较差',
}, },
{ 3: {
value: 3, url: '../../static/assistingAgriculture/index/threeStars.png',
url: '@/static/assistingAgriculture/index/threeStars.png',
text: '一般', text: '一般',
}, },
{ 4: {
value: 4, url: '../../static/assistingAgriculture/index/fourStars.png',
url: '@/static/assistingAgriculture/index/fourStars.png',
text: '还行', text: '还行',
}, },
{ 5: {
value: 5, url: '../../static/assistingAgriculture/index/fiveStars.png',
url: '@/static/assistingAgriculture/index/fiveStars.png',
text: '超赞', text: '超赞',
}, },
]); });
/** /**
* 获取用户优惠券列表 * 获取用户优惠券列表
*/ */
const isEnd = ref(false); const isEnd = ref(false);
const state = ref('loading');
const total = ref(0); const total = ref(0);
const couponData = ref([]); const commentData = ref([]);
const catalog = reactive({ const catalog = reactive({
current: 0, current: 0,
size: 10, size: 10,
statuMain: 0, shopId: '1818876196597334017',
statuSon: 0, evaluation: '', // 关键字搜索
type: '', // img-图片,append-追评,diff-中差评,good-好评
}); });
const getCouponList = async () => { const getList = async () => {
// if (isEnd.value) return;
catalog.current++; catalog.current++;
state.value = 'loading';
catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value;
console.log(catalog);
xma.showLoading({ xma.showLoading({
title: '加载中...', title: '加载中...',
mask: true, mask: true,
...@@ -162,12 +148,16 @@ const getCouponList = async () => { ...@@ -162,12 +148,16 @@ const getCouponList = async () => {
} }
if (res.data.records.length > 0) { if (res.data.records.length > 0) {
res.data.records.forEach((item) => { 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; total.value = res.data.total;
console.log(commentData.value);
} }
// state.value = 'finished';
xma.hideLoading(); xma.hideLoading();
}; };
getList(); 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