Files
FirstUI-vue/pages/component/layout/horizontal-scroll/horizontal-scroll.vue
2023-08-17 21:28:49 +08:00

80 lines
2.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--本文件由FirstUI授权予新疆天衡创新研究院有限公司手机号18 6140 7 2 549身份证尾号5A07X5专用请尊重知识产权勿私下传播违者追究法律责任-->
<template>
<view class="fui-wrap">
<view class="fui-page__hd">
<view class="fui-page__title fui-align__center" @tap="vip">HorizontalScroll <image
src="/static/images/index/light/icon_member_3x.png"></image>
</view>
<view class="fui-page__desc">HorizontalScroll 横向滚动的视图容器主要用于菜单导航热门商品区等场景</view>
</view>
<view class="fui-page__bd fui-page__spacing">
<view class="fui-section__title">商品展示</view>
<fui-horizontal-scroll background="rgba(255, 43, 43, .08)" scrollBarColor="#FF2B2B">
<view class="fui-list">
<view class="fui-list--item" v-for="(item,index) in goodsList" :key="index">
<fui-lazyload radius="16" marginBottom="20" :width="128" :height="128" :src="item.src"
mode="aspectFill">
</fui-lazyload>
<fui-text :text="`¥${item.price}`" color="#FF2B2B" size="24"></fui-text>
</view>
</view>
</fui-horizontal-scroll>
<view class="fui-section__title">菜单展示</view>
<fui-horizontal-scroll>
<view>
<view class="fui-list" :class="{'fui-mtop':index!==0}" v-for="(list,index) in menuList" :key="index">
<view class="fui-list--item fui-mr--52" v-for="(item,idx) in list" :key="item.text">
<fui-lazyload background="transparent" marginBottom="12" :width="96" :height="96" :src="item.icon"
mode="aspectFill">
</fui-lazyload>
<fui-text un-shrink :text="item.text" color="#888" size="24"></fui-text>
</view>
</view>
</view>
</fui-horizontal-scroll>
</view>
</view>
</template>
<script>
import data from './index.js'
export default {
data() {
return {
goodsList: data.goodsList,
menuList: data.menuList
}
},
methods: {
vip() {
this.fui.href("/pages/my/qa/qa?index=2&title=VIP专属内容")
}
}
}
</script>
<style>
.fui-list {
display: flex;
flex-direction: row;
align-items: center;
}
.fui-list--item {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
margin-right: 24rpx;
}
.fui-mr--52{
margin-right: 52rpx;
}
.fui-list--item:last-child {
margin-right: 0;
}
.fui-mtop{
margin-top: 24rpx;
}
</style>