代码提交
This commit is contained in:
@ -6,83 +6,39 @@
|
||||
@update: 2023-10-27 14:42
|
||||
-->
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { usePage } from "@/hooks";
|
||||
import { getProductList } from "@/api/product";
|
||||
import Empty from "@/components/Empty/index.vue"
|
||||
import ListLoadOver from "@/components/ListLoadOver/index.vue"
|
||||
import ListLoadLoading from "@/components/ListLoadLoading/index.vue"
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
|
||||
const {refresh, dataList, loadend, loading, listEmpty} = usePage(getProductList)
|
||||
const {push} = useRouter()
|
||||
onLoad(() => {
|
||||
refresh()
|
||||
})
|
||||
|
||||
|
||||
import Recommend from "@/components/Recommend/index.vue";
|
||||
import UvIcon from "@/uni_modules/uv-icon/components/uv-icon/uv-icon.vue";
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<blank size="15"></blank>
|
||||
|
||||
<activity
|
||||
title="商品推荐"
|
||||
more="查看更多"
|
||||
@moreClick="push({ url: '/pages/goodsList/goodsList' })"
|
||||
>
|
||||
<view class="card goods-row">
|
||||
<template v-if="!listEmpty">
|
||||
<uv-grid
|
||||
:border="false"
|
||||
:col="2"
|
||||
:gutter="10"
|
||||
>
|
||||
<uv-grid-item
|
||||
v-for="(item, index) in dataList"
|
||||
:key="index"
|
||||
>
|
||||
<goods
|
||||
class="item"
|
||||
link
|
||||
card
|
||||
:data="item"
|
||||
:storeName="item.storeName"
|
||||
:price="item.price"
|
||||
:stock="true"
|
||||
>
|
||||
</goods>
|
||||
</uv-grid-item>
|
||||
</uv-grid>
|
||||
</template>
|
||||
<Empty
|
||||
v-else
|
||||
:iconSrc="emptyIcon"
|
||||
>
|
||||
这里空空如也~
|
||||
</Empty>
|
||||
<!-- 加载中 -->
|
||||
<ListLoadLoading v-if="loading" />
|
||||
<!-- 加载完毕-->
|
||||
<ListLoadOver v-if="loadend" />
|
||||
</view>
|
||||
|
||||
</activity>
|
||||
<Recommend ref="recommendRef" :more="false">
|
||||
<template #head>
|
||||
<view class="head flex flex-ai__center flex-jc__sb">
|
||||
<view class="left">
|
||||
商品推荐
|
||||
</view>
|
||||
<view class="right flex flex-ai__center flex-jc__end">
|
||||
查看更多
|
||||
<uv-icon name="arrow-right" color="#999" size="14" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</Recommend>
|
||||
</template>
|
||||
|
||||
<style
|
||||
scoped
|
||||
lang="scss"
|
||||
>
|
||||
@import "@/style/main.scss";
|
||||
|
||||
.goods-row {
|
||||
@include usePadding(20, 20);
|
||||
border-radius: 15rpx;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
margin: 0 10rpx;
|
||||
.head{
|
||||
margin-top: 20rpx;
|
||||
.left{
|
||||
font-size: 32rpx;
|
||||
color: #333333;
|
||||
}
|
||||
.right{
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user