<template>
<gracePage :customHeader="false">
<!-- 页面主体 -->
<view slot="gBody" class="grace-body">
<view class="grace-title grace-margin-top">组件演示</view>
<view class="grace-icon-classes grace-wrap grace-space-between">
<navigator :url="item.path" :open-type="item.openType"
class="grace-ic-item" :style="{background:item.bgColor}" v-for="(item, index) in classes" :key="index">
<image :src="item.icon" class="grace-ic-image" mode="widthFix"></image>
<view class="grace-ic-content">
<text class="grace-ic-title grace-white">{{item.txt}}</text>
<text class="grace-text-small grace-white">{{item.smallTxt}}</text>
</view>
<image :src="item.icon" class="grace-ic-bg-image" mode="widthFix"></image>
</navigator>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
export default {
data() {
return {
classes : [
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/font.png',
txt:'字体', smallTxt:"Font", bgColor:"#6DCD70",
path:"../index/index?test=1", openType:"switchTab"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/tmp.png',
txt:'主题', smallTxt:"Theme", bgColor:"#F596DB",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/mall.png',
txt:'商城', smallTxt:"Mall", bgColor:"#4D5CBC",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/msg.png',
txt:'消息', smallTxt:"Message", bgColor:"#DCD64E",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/card.png',
txt:'名片', smallTxt:"Card", bgColor:"#C4A6FB",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/lady.png',
txt:'女装', smallTxt:"Lady", bgColor:"#9CDDEA",
path:"./index?test=1", openType:"navigate"
}
]
}
},
methods:{
},
components:{
gracePage
}
}
</script>
<style>
.grace-icon-classes{}
.grace-ic-item{width:210rpx; height:158rpx; font-size:0; border-radius:5px; position:relative; margin:10rpx 0; overflow:hidden; display:flex; flex-direction:column; justify-content:center;}
.grace-ic-image{width:60rpx; height:56rpx; margin-left:20rpx;}
.grace-ic-bg-image{width:70rpx; height:66rpx; position:absolute; opacity:0.1; right:6px; bottom:6px;}
.grace-ic-content{padding:10rpx 20rpx;}
.grace-ic-title{line-height:40rpx; font-size:28rpx; margin-right:3px;}
</style>
<template>
<gracePage :customHeader="false">
<!-- 页面主体 -->
<view slot="gBody" class="grace-body">
<view class="grace-margin-top"><text class="grace-title">组件演示</text></view>
<view class="grace-icon-classes grace-wrap">
<view class="grace-ic-item" :style="{backgroundColor:item.bgColor}" v-for="(item, index) in classes" :key="index">
<image :src="item.icon" class="grace-ic-image" mode="widthFix"></image>
<view class="grace-ic-content">
<text class="grace-ic-title grace-white">{{item.txt}}</text>
<text class="grace-text-small grace-white">{{item.smallTxt}}</text>
</view>
<image :src="item.icon" class="grace-ic-bg-image" mode="widthFix"></image>
</view>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/weexComponents/gracePage.nvue";
export default {
data() {
return {
classes : [
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/font.png',
txt:'字体', smallTxt:"Font", bgColor:"#6DCD70",
path:"../index/index?test=1", openType:"switchTab"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/tmp.png',
txt:'主题', smallTxt:"Theme", bgColor:"#F596DB",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/mall.png',
txt:'商城', smallTxt:"Mall", bgColor:"#4D5CBC",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/msg.png',
txt:'消息', smallTxt:"Message", bgColor:"#DCD64E",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/card.png',
txt:'名片', smallTxt:"Card", bgColor:"#C4A6FB",
path:"./index?test=1", openType:"navigate"
},
{
icon:'https://graceui.oss-cn-beijing.aliyuncs.com/classes/lady.png',
txt:'女装', smallTxt:"Lady", bgColor:"#9CDDEA",
path:"./index?test=1", openType:"navigate"
}
]
}
},
methods:{},
components:{
gracePage
}
}
</script>
<style>
.grace-icon-classes{}
.grace-ic-item{width:213rpx; height:158rpx; font-size:0; border-radius:5px; margin:10rpx; flex-direction:column; justify-content:center;}
.grace-ic-image{width:60rpx; height:56rpx; margin-left:20rpx;}
.grace-ic-bg-image{width:70rpx; height:66rpx; position:absolute; opacity:0.1; right:6px; bottom:6px;}
.grace-ic-content{padding:10rpx 20rpx; flex-direction:row;}
.grace-ic-title{line-height:40rpx; font-size:28rpx; margin-right:3px;}
</style>
.wxml
<gracePage customHeader="{{false}}">
<!-- 页面主体 -->
<view slot="gBody" class="grace-body">
<view class="grace-title grace-margin-top">组件演示</view>
<view class="grace-icon-classes grace-wrap grace-space-between">
<navigator url="{{item.path}}" open-type="{{item.openType}}" class="grace-ic-item" style="background:{{item.bgColor}}"
wx:for="{{classes}}" wx:key="index">
<image src="{{item.icon}}" class="grace-ic-image" mode="widthFix"></image>
<view class="grace-ic-content">
<text class="grace-ic-title grace-white">{{item.txt}}</text>
<text class="grace-text-small grace-white">{{item.smallTxt}}</text>
</view>
<image src="{{item.icon}}" class="grace-ic-bg-image" mode="widthFix"></image>
</navigator>
</view>
</view>
</gracePage>.json
{
"usingComponents": {
"gracePage": "../../graceUI/components/gracePage"
}
}.js
Page({
data: {
classes: [
{
icon: 'https://graceui.oss-cn-beijing.aliyuncs.com/classes/font.png',
txt: '字体', smallTxt: "Font", bgColor: "#6DCD70",
path: "../index/index?test=1", openType: "switchTab"
},
{
icon: 'https://graceui.oss-cn-beijing.aliyuncs.com/classes/tmp.png',
txt: '主题', smallTxt: "Theme", bgColor: "#F596DB",
path: "./index?test=1", openType: "navigate"
},
{
icon: 'https://graceui.oss-cn-beijing.aliyuncs.com/classes/mall.png',
txt: '商城', smallTxt: "Mall", bgColor: "#4D5CBC",
path: "./index?test=1", openType: "navigate"
},
{
icon: 'https://graceui.oss-cn-beijing.aliyuncs.com/classes/msg.png',
txt: '消息', smallTxt: "Message", bgColor: "#DCD64E",
path: "./index?test=1", openType: "navigate"
},
{
icon: 'https://graceui.oss-cn-beijing.aliyuncs.com/classes/card.png',
txt: '名片', smallTxt: "Card", bgColor: "#C4A6FB",
path: "./index?test=1", openType: "navigate"
},
{
icon: 'https://graceui.oss-cn-beijing.aliyuncs.com/classes/lady.png',
txt: '女装', smallTxt: "Lady", bgColor: "#9CDDEA",
path: "./index?test=1", openType: "navigate"
}
]
}
});.wxss
.grace-icon-classes{}
.grace-ic-item{width:210rpx; height:158rpx; font-size:0; border-radius:5px; position:relative; margin:10rpx 0; overflow:hidden; display:flex; flex-direction:column; justify-content:center;}
.grace-ic-image{width:60rpx; height:56rpx; margin-left:20rpx;}
.grace-ic-bg-image{width:70rpx; height:66rpx; position:absolute; opacity:0.1; right:6px; bottom:6px;}
.grace-ic-content{padding:10rpx 20rpx;}
.grace-ic-title{line-height:40rpx; font-size:28rpx;}