<template>
<gracePage headerBG="#FFFFFF" :customHeader="false">
<view slot="gBody" class="grace-body">
<view class="grace-padding-top">
<text class="grace-title">热门作家</text>
</view>
<scroll-view class="grace-scroll-x grace-scroll-cards" scroll-x :show-scrollbar="false">
<view class="grace-scroll-x-items grace-columns grace-flex-vcenter" v-for="(item, index) in authors" :key="index">
<image class="grace-scroll-cards-image" :src="item.face" mode="widthFix"></image>
<view class="grace-scroll-cards-txt">{{item.txt}}</view>
<view class="grace-scroll-cards-smallTxt">{{item.smallTxt}}</view>
<view class="grace-scroll-cards-btn grace-bg-red"><text class="grace-icons icon-shoucang"></text>关注</view>
</view>
</scroll-view>
<view class="grace-padding-top">
<text class="grace-title">推荐店铺</text>
</view>
<scroll-view class="grace-scroll-x grace-scroll-cards" scroll-x :show-scrollbar="false">
<view class="grace-scroll-x-items grace-columns grace-flex-vcenter grace-scroll-x-items-shop" v-for="(item, index) in shops" :key="index">
<image class="grace-scroll-cards-image" :src="item.face" mode="widthFix"></image>
<view class="grace-scroll-cards-txt">{{item.txt}}</view>
<view class="grace-scroll-cards-btn grace-bg-red"><text class="grace-icons icon-shoucang"></text>逛一逛</view>
</view>
</scroll-view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
export default {
data() {
return {
authors : [
{
face:'http://img0.imgtn.bdimg.com/it/u=2216205495,2371369945&fm=26&gp=0.jpg',
txt:'媛媛', smallTxt:"热门作者",
authorId:1
},
{
face:'http://img1.imgtn.bdimg.com/it/u=1122241520,546124475&fm=26&gp=0.jpg',
txt:'太阳花', smallTxt:"猜你想看",
authorId:2
},
{
face:'http://img4.imgtn.bdimg.com/it/u=1524198278,3330507786&fm=26&gp=0.jpg',
txt:'南宫柯', smallTxt:"可能感兴趣",
authorId:3
},
{
face:'http://img4.imgtn.bdimg.com/it/u=1699138739,2283861371&fm=26&gp=0.jpg',
txt:'逍遥云', smallTxt:"推荐作者",
authorId:4
},
{
face:'http://img1.imgtn.bdimg.com/it/u=2287043408,9035153&fm=26&gp=0.jpg',
txt:'至尊宝', smallTxt:"近期热门",
authorId:5
},
{
face:'http://img1.imgtn.bdimg.com/it/u=2710589814,3403852097&fm=26&gp=0.jpg',
txt:'玲儿', smallTxt:"推荐作家",
authorId:6
}
],
shops : [
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828746415&di=76c55a297a1bacb7c5e76f5b9da7a61a&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20170827%2F23d81beb26d242718c35f4ab80e0ecbd.jpeg',
txt:'京东', shopId:1
},
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1558423358&di=66bcdd2231e0ba2abe4ff40dfed67c80&imgtype=jpg&er=1&src=http%3A%2F%2Fimg.25pp.com%2Fuploadfile%2Fapp%2Ficon%2F20160308%2F1457419937251374.jpg',
txt:'当当', shopId:2
},
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828872404&di=c342610b9beaa0e3b6a4e6536c6e7359&imgtype=0&src=http%3A%2F%2Fimg.25pp.com%2Fuploadfile%2Fapp%2Ficon%2F20160419%2F1461057421205649.jpg',
txt:'淘宝', shopId:3
},
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828904726&di=d0ae63d0830233aa9a55b42710d71c34&imgtype=0&src=http%3A%2F%2Fpic.90sjimg.com%2Fdesign%2F00%2F02%2F40%2F54%2Fs_1024_565ac5e4726ef.jpg',
txt:'天猫', shopId:4
}
]
};
},
methods:{},
components:{gracePage}
}
</script>
<style>
.grace-scroll-cards{background-color:#F6F7F8; padding:0;}
.grace-scroll-x-items{width:150rpx; margin:10rpx; padding:20rpx; height:300rpx; font-size:0;}
.grace-scroll-x-items-shop{height:260rpx;}
.grace-scroll-cards-image{width:150rpx; height:150rpx; border-radius:150rpx; flex-shrink:0;}
.grace-scroll-cards-txt{text-align:center; color:#333333; font-size:26rpx; margin-top:20rpx; line-height:36rpx;}
.grace-scroll-cards-smallTxt{text-align:center; font-size:22rpx; margin-top:8rpx; line-height:36rpx; color:#898989;}
.grace-scroll-cards-btn{text-align:center; font-size:22rpx; width:88rpx; border-radius:40rpx; line-height:40rpx; padding:0 15rpx; margin-top:8rpx;}
</style>
<template>
<gracePage headerBG="#FFFFFF" :customHeader="false">
<view slot="gBody" class="grace-body">
<view class="grace-padding-top">
<text class="grace-title">热门作家</text>
</view>
<scroll-view class="grace-scroll-x grace-scroll-cards" scroll-x :show-scrollbar="false">
<view class="grace-scroll-x-items grace-columns grace-flex-vcenter" v-for="(item, index) in authors" :key="index">
<image class="grace-scroll-cards-image" :src="item.face" mode="widthFix"></image>
<text class="grace-scroll-cards-txt">{{item.txt}}</text>
<text class="grace-scroll-cards-smallTxt">{{item.smallTxt}}</text>
<text class="grace-scroll-cards-btn grace-bg-red grace-icons icon-shoucang"> 关注</text>
</view>
</scroll-view>
<view class="grace-padding-top">
<text class="grace-title">推荐店铺</text>
</view>
<scroll-view class="grace-scroll-x grace-scroll-cards" scroll-x :show-scrollbar="false">
<view class="grace-scroll-x-items grace-columns grace-flex-vcenter grace-scroll-x-items-shop" v-for="(item, index) in shops" :key="index">
<image class="grace-scroll-cards-image" :src="item.face" mode="widthFix"></image>
<text class="grace-scroll-cards-txt">{{item.txt}}</text>
<text class="grace-scroll-cards-btn grace-bg-red">逛一逛</text>
</view>
</scroll-view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/weexComponents/gracePage.nvue";
export default {
data() {
return {
authors : [
{
face:'http://img0.imgtn.bdimg.com/it/u=2216205495,2371369945&fm=26&gp=0.jpg',
txt:'媛媛', smallTxt:"热门作者",
authorId:1
},
{
face:'http://img1.imgtn.bdimg.com/it/u=1122241520,546124475&fm=26&gp=0.jpg',
txt:'太阳花', smallTxt:"猜你想看",
authorId:2
},
{
face:'http://img4.imgtn.bdimg.com/it/u=1524198278,3330507786&fm=26&gp=0.jpg',
txt:'南宫柯', smallTxt:"可能感兴趣",
authorId:3
},
{
face:'http://img4.imgtn.bdimg.com/it/u=1699138739,2283861371&fm=26&gp=0.jpg',
txt:'逍遥云', smallTxt:"推荐作者",
authorId:4
},
{
face:'http://img1.imgtn.bdimg.com/it/u=2287043408,9035153&fm=26&gp=0.jpg',
txt:'至尊宝', smallTxt:"近期热门",
authorId:5
},
{
face:'http://img1.imgtn.bdimg.com/it/u=2710589814,3403852097&fm=26&gp=0.jpg',
txt:'玲儿', smallTxt:"推荐作家",
authorId:6
}
],
shops : [
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828746415&di=76c55a297a1bacb7c5e76f5b9da7a61a&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20170827%2F23d81beb26d242718c35f4ab80e0ecbd.jpeg',
txt:'京东', shopId:1
},
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1558423358&di=66bcdd2231e0ba2abe4ff40dfed67c80&imgtype=jpg&er=1&src=http%3A%2F%2Fimg.25pp.com%2Fuploadfile%2Fapp%2Ficon%2F20160308%2F1457419937251374.jpg',
txt:'当当', shopId:2
},
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828872404&di=c342610b9beaa0e3b6a4e6536c6e7359&imgtype=0&src=http%3A%2F%2Fimg.25pp.com%2Fuploadfile%2Fapp%2Ficon%2F20160419%2F1461057421205649.jpg',
txt:'淘宝', shopId:3
},
{
face:'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828904726&di=d0ae63d0830233aa9a55b42710d71c34&imgtype=0&src=http%3A%2F%2Fpic.90sjimg.com%2Fdesign%2F00%2F02%2F40%2F54%2Fs_1024_565ac5e4726ef.jpg',
txt:'天猫', shopId:4
}
]
};
},
methods:{},
components:{gracePage}
}
</script>
<style>
.grace-scroll-cards{background-color:#F6F7F8; padding:0;}
.grace-scroll-x-items{width:200rpx; margin:10rpx; padding:10rpx 20rpx; height:330rpx; font-size:0;}
.grace-scroll-x-items-shop{height:280rpx;}
.grace-scroll-cards-image{width:150rpx; height:150rpx; border-radius:150rpx;}
.grace-scroll-cards-txt{text-align:center; color:#333333; font-size:26rpx; margin-top:20rpx; line-height:36rpx;}
.grace-scroll-cards-smallTxt{text-align:center; font-size:22rpx; margin-top:8rpx; line-height:36rpx; color:#898989;}
.grace-scroll-cards-btn{text-align:center; font-size:22rpx; width:100rpx; border-radius:40rpx; line-height:40rpx; padding:0 15rpx; margin-top:8rpx;}
</style>
.wxml
<gracePage headerBG="#FFFFFF" customHeader="{{false}}">
<view slot="gBody" class="grace-body">
<view class="grace-padding-top">
<text class="grace-title">热门作家</text>
</view>
<scroll-view class="grace-scroll-x grace-scroll-cards" scroll-x show-scrollbar="{{false}}">
<view class="grace-scroll-x-items grace-columns grace-flex-vcenter" wx:for="{{authors}}" wx:key="index">
<image class="grace-scroll-cards-image" src="{{item.face}}" mode="widthFix"></image>
<view class="grace-scroll-cards-txt">{{item.txt}}</view>
<view class="grace-scroll-cards-smallTxt">{{item.smallTxt}}</view>
<view class="grace-scroll-cards-btn grace-bg-red"><text class="grace-icons icon-shoucang"></text>关注</view>
</view>
</scroll-view>
<view class="grace-padding-top">
<text class="grace-title">推荐店铺</text>
</view>
<scroll-view class="grace-scroll-x grace-scroll-cards" scroll-x show-scrollbar="{{false}}">
<view class="grace-scroll-x-items grace-columns grace-flex-vcenter grace-scroll-x-items-shop" wx:for="{{shops}}" wx:key="index">
<image class="grace-scroll-cards-image" src="{{item.face}}" mode="widthFix"></image>
<view class="grace-scroll-cards-txt">{{item.txt}}</view>
<view class="grace-scroll-cards-btn grace-bg-red"><text class="grace-icons icon-shoucang"></text>逛一逛</view>
</view>
</scroll-view>
</view>
</gracePage>.js
Page({
data: {
authors: [
{
face: 'http://img0.imgtn.bdimg.com/it/u=2216205495,2371369945&fm=26&gp=0.jpg',
txt: '媛媛', smallTxt: "热门作者",
authorId: 1
},
{
face: 'http://img1.imgtn.bdimg.com/it/u=1122241520,546124475&fm=26&gp=0.jpg',
txt: '太阳花', smallTxt: "猜你想看",
authorId: 2
},
{
face: 'http://img4.imgtn.bdimg.com/it/u=1524198278,3330507786&fm=26&gp=0.jpg',
txt: '南宫柯', smallTxt: "可能感兴趣",
authorId: 3
},
{
face: 'http://img4.imgtn.bdimg.com/it/u=1699138739,2283861371&fm=26&gp=0.jpg',
txt: '逍遥云', smallTxt: "推荐作者",
authorId: 4
},
{
face: 'http://img1.imgtn.bdimg.com/it/u=2287043408,9035153&fm=26&gp=0.jpg',
txt: '至尊宝', smallTxt: "近期热门",
authorId: 5
},
{
face: 'http://img1.imgtn.bdimg.com/it/u=2710589814,3403852097&fm=26&gp=0.jpg',
txt: '玲儿', smallTxt: "推荐作家",
authorId: 6
}
],
shops: [
{
face: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828746415&di=76c55a297a1bacb7c5e76f5b9da7a61a&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20170827%2F23d81beb26d242718c35f4ab80e0ecbd.jpeg',
txt: '京东', shopId: 1
},
{
face: 'http://img1.imgtn.bdimg.com/it/u=2710589814,3403852097&fm=26&gp=0.jpg',
txt: '当当', shopId: 2
},
{
face: 'http://img1.imgtn.bdimg.com/it/u=2710589814,3403852097&fm=26&gp=0.jpg',
txt: '淘宝', shopId: 3
},
{
face: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1557828904726&di=d0ae63d0830233aa9a55b42710d71c34&imgtype=0&src=http%3A%2F%2Fpic.90sjimg.com%2Fdesign%2F00%2F02%2F40%2F54%2Fs_1024_565ac5e4726ef.jpg',
txt: '天猫', shopId: 4
}
]
}
}).json
{
"usingComponents": {
"gracePage": "../../graceUI/components/gracePage"
}
}.wxss
.grace-scroll-cards{background-color:#F6F7F8; padding:0;}
.grace-scroll-x-items{width:150rpx; margin:10rpx; padding:20rpx; height:300rpx; font-size:0;}
.grace-scroll-x-items-shop{height:260rpx;}
.grace-scroll-cards-image{width:150rpx; height:150rpx; border-radius:150rpx; flex-shrink:0;}
.grace-scroll-cards-txt{text-align:center; color:#333333; font-size:26rpx; margin-top:20rpx; line-height:36rpx;}
.grace-scroll-cards-smallTxt{text-align:center; font-size:22rpx; margin-top:8rpx; line-height:36rpx; color:#898989;}
.grace-scroll-cards-btn{text-align:center; font-size:22rpx; width:88rpx; border-radius:40rpx; line-height:40rpx; padding:0 15rpx; margin-top:8rpx;}