更新记录

1.0.0(2023-04-08)

简单的通用商城列表页面模板


平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
× × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × ×

建议

按照使用方法,各个dom元素都加上100%

组件属性

属性名 属性内容 示例
menuList 侧边栏列表 查看使用方法中的案例
goodsList 商品列表 查看使用方法中的案例
more 商品列表触底文字 查看使用方法中的案例

组件事件

事件名 事件内容 示例
@menuChange 侧边栏改变事件 查看使用方法中的案例
@add 商品加入事件 查看使用方法中的案例
@getMore 触底加载更多事件 查看使用方法中的案例

使用方法

<template>
    <view class="home">
        <yhdslShopList style="height: 100%;" :menuList="menuList" :goodsList="goodsList" :more="more" @add="add" @menuChange="menuChange" @getMore="getMore"></yhdslShopList>
    </view>
</template>
<script>
import yhdslShopList from '@/components/yhdsl-shopList/yhdsl-shopList.vue';
export default {
    data() {
        return {
            more: '加载中...',
            menuList: [
                {
                    id: 1,
                    name: '漫画书'
                },
                {
                    id: 2,
                    name: '科幻小说'
                },
                {
                    id: 3,
                    name: '名人传'
                }
            ],
            goodsList: [
                {
                    id: 1,
                    name: '西游记',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 100,
                    unit: '本'
                },
                {
                    id: 2,
                    name: '三体',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 100,
                    unit: '本'
                },
                {
                    id: 3,
                    name: '好好好好',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 1000,
                    unit: '堆'
                },
                {
                    id: 1,
                    name: '西游记',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 100,
                    unit: '本'
                },
                {
                    id: 2,
                    name: '三体',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 100,
                    unit: '本'
                },
                {
                    id: 3,
                    name: '好好好好',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 1000,
                    unit: '堆'
                },
                {
                    id: 1,
                    name: '西游记',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 100,
                    unit: '本'
                },
                {
                    id: 2,
                    name: '三体',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 100,
                    unit: '本'
                },
                {
                    id: 3,
                    name: '好好好好',
                    cover: 'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
                    type: '玄幻',
                    time: '24小时发售',
                    new: 50,
                    old: 1000,
                    unit: '堆'
                }
            ]
        };
    },
    components: {
        yhdslShopList
    },
    methods: {
        menuChange(item) {
            console.log(item);
        },
        add(item) {
            console.log(item);
        },
        getMore() {
            console.log('触发加载更多事件');
        }
    }
};
</script>

<style>
page {
    height: 100%;
}
</style>

<style scoped lang="scss">
.home {
    height: 100%;
}
</style>

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问