评论列表

parent c42bd206
...@@ -57,7 +57,7 @@ export function receiveCoupon(data) { ...@@ -57,7 +57,7 @@ export function receiveCoupon(data) {
} }
// 商家评论列表 // 商家评论列表
export function receiveCoupon(data) { export function getCommentList(data) {
return request({ return request({
url: `/sgyrdd/evaluation/page`, url: `/sgyrdd/evaluation/page`,
method: 'GET', method: 'GET',
......
...@@ -255,7 +255,8 @@ ...@@ -255,7 +255,8 @@
{ {
"path": "pages/assistingAgriculture/detail/comment", "path": "pages/assistingAgriculture/detail/comment",
"style": { "style": {
"navigationBarTitleText": "评论" "navigationBarTitleText": "评论",
"enablePullDownRefresh": true
} }
} }
], ],
......
...@@ -76,6 +76,8 @@ ...@@ -76,6 +76,8 @@
</template> </template>
<script setup> <script setup>
import { getCommentList } from '@/api/packageDetail';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const searchValue = ref(''); const searchValue = ref('');
const tab = ref(0); const tab = ref(0);
...@@ -130,6 +132,46 @@ const rateList = ref([ ...@@ -130,6 +132,46 @@ const rateList = ref([
}, },
]); ]);
/**
* 获取用户优惠券列表
*/
const isEnd = ref(false);
const state = ref('loading');
const total = ref(0);
const couponData = ref([]);
const catalog = reactive({
current: 0,
size: 10,
statuMain: 0,
statuSon: 0,
});
const getCouponList = async () => {
// if (isEnd.value) return;
catalog.current++;
state.value = 'loading';
catalog.statuMain = currentTab.value;
catalog.statuSon = currenStatus.value;
console.log(catalog);
xma.showLoading({
title: '加载中...',
mask: true,
});
const res = await getCommentList(catalog);
if (res.data.records.length < catalog.size) {
isEnd.value = true;
}
if (res.data.records.length > 0) {
res.data.records.forEach((item) => {
item.showDetail = false;
});
couponData.value.push(...res.data.records);
total.value = res.data.total;
}
// state.value = 'finished';
xma.hideLoading();
};
getList();
const handleChangeTab = (e) => { const handleChangeTab = (e) => {
if (e === tab.value) return; if (e === tab.value) return;
tab.value = e; tab.value = e;
......
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