<template>
<gracePage :customHeader="false">
<view slot="gBody" class="grace-body">
<!-- 默认模式 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">默认属性</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper :swiperItems="swiperItems" :width="700" :height="315"></graceSwiper>
</view>
<!-- 进度圆点修饰为激活进度点略宽的示例 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">圆点设置</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper :swiperItems="swiperItems" :width="700" :height="315" :indicatorActiveWidth="38" @swiperchange="swiperchange"></graceSwiper>
</view>
<!-- 进度圆点修饰为长方形示例 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">矩形圆点</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper :swiperItems="swiperItems" indicatorPosition="relative" indicatorColor="#999999"
:width="700" :indicatorWidth="38" :indicatorHeight="10" :indicatorActiveWidth="38" :indicatorRadius="0" :height="315"></graceSwiper>
</view>
<!-- 数字进度演示 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">数字进度</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper borderRadius="0rpx" :width="700" :currentIndex="2" :spacing="0" :padding="0" :swiperItems="swiperItems" :height="315" indicatorType="number" indicatorBarBgColor="rgba(0,0,0, 0.2)"></graceSwiper>
</view>
<!-- 点击事件演示 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">点击事件</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view style="padding-bottom:50rpx;">
<graceSwiper :swiperItems="swiperItems2" :width="700" :height="315" @taped="taped"></graceSwiper>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
import graceSwiper from "../../graceUI/components/graceSwiper.vue";
export default{
data() {
return {
swiperItems : [
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/1.png',
url : '',
title:"测试标题 001",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/2.png',
url : '',
title:"测试标题 02",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/3.png',
url : '',
title:"测试标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/4.png',
url : '',
title:"测试标题04",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/5.png',
url : '',
title:"测试标题05",
opentype : 'navigate'
}
],
swiperItems2 : [
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/3.png',
url : '',
title:"测试标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长",
opentype : 'click'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/4.png',
url : '',
title:"测试标题04",
opentype : 'click'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/5.png',
url : '',
title:"测试标题05",
opentype : 'click'
}
]
}
},
methods:{
swiperchange : function(e){
console.log(e);
},
taped : function(e){
uni.showToast({
title:"您点击了第 "+e+" 个项目", icon:"none"
});
}
},
components: {
gracePage, graceSwiper
}
}
</script>
<style>
</style>
<template>
<gracePage :customHeader="false">
<view slot="gBody" class="grace-body">
<!-- 默认模式 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">默认属性</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper :swiperItems="swiperItems" :width="700" :height="315"></graceSwiper>
</view>
<!-- 进度圆点修饰为激活进度点略宽的示例 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">圆点修饰</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper :swiperItems="swiperItems" :width="700" :height="315" :indicatorActiveWidth="38" @swiperchange="swiperchange"></graceSwiper>
</view>
<!-- 进度圆点修饰为长方形示例 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">矩形进度</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper :swiperItems="swiperItems"
indicatorPosition="relative" indicatorColor="#999999"
:width="700" :indicatorWidth="38" :indicatorHeight="10" :indicatorActiveWidth="38" :indicatorRadius="0" :height="315"></graceSwiper>
</view>
<!-- 数字进度演示 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">数字进度</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper borderRadius="0rpx" :width="700" :currentIndex="2" :spacing="0" :padding="0" :swiperItems="swiperItems" :height="315" indicatorType="number" indicatorBarBgColor="rgba(0,0,0, 0.2)"></graceSwiper>
</view>
<!-- 点击事件演示 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">点击事件</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view style="padding-bottom:50rpx;">
<graceSwiper :swiperItems="swiperItems2" :width="700" :height="315" @taped="taped"></graceSwiper>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/weexComponents/gracePage.nvue";
import graceSwiper from "../../graceUI/weexComponents/graceSwiper.nvue";
export default{
data() {
return {
swiperItems : [
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/1.png',
url : '',
title:"测试标题 001",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/2.png',
url : '',
title:"测试标题 02",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/3.png',
url : '',
title:"测试标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/4.png',
url : '',
title:"测试标题04",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/5.png',
url : '',
title:"测试标题05",
opentype : 'navigate'
}
],
swiperItems2 : [
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/3.png',
url : '',
title:"测试标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长",
opentype : 'click'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/4.png',
url : '',
title:"测试标题04",
opentype : 'click'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/5.png',
url : '',
title:"测试标题05",
opentype : 'click'
}
]
}
},
methods:{
swiperchange : function(e){
console.log(e);
},
taped : function(e){
uni.showToast({
title:"您点击了第 "+e+" 个项目", icon:"none"
});
}
},
components: {
gracePage, graceSwiper
}
}
</script>
<style>
</style>
.wxml
<gracePage customHeader="{{false}}">
<view slot="gBody">
<!-- 默认模式 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">默认属性</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper swiperItems="{{swiperItems}}" indicatorActiveColor="#FF0036" height="{{330}}"></graceSwiper>
</view>
<!-- 进度圆点修饰为激活进度点略宽的示例 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">圆点设置</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper swiperItems="{{swiperItems}}" height="{{330}}" indicatorActiveWidth="{{38}}" bind:swiperchange="swiperchange"></graceSwiper>
</view>
<!-- 进度圆点修饰为长方形示例 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">矩形圆点</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view>
<graceSwiper swiperItems="{{swiperItems}}" indicatorWidth="{{38}}"
indicatorPosition="relative" indicatorColor="#999999"
indicatorHeight="{{10}}" indicatorActiveWidth="{{38}}" indicatorRadius="{{0}}" height="{{330}}"></graceSwiper>
</view>
<!-- 数字进度演示 注意外层变成 700 rpx 组件宽高 为 700 315 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">数字进度</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view class="grace-body">
<graceSwiper borderRadius="0rpx" currentIndex="{{2}}" spacing="{{0}}" padding="{{0}}" swiperItems="{{swiperItems}}" height="{{315}}" width="700" indicatorType="number" indicatorBarBgColor="rgba(0,0,0, 0.2)"></graceSwiper>
</view>
<!-- 点击事件演示 -->
<view class="grace-title grace-margin-top">
<view class="grace-title-border"></view>
<text class="grace-title-text grace-blue">点击事件</text>
<text class="grace-text-small grace-gray">grace.hcoder.net</text>
</view>
<view style="padding-bottom:50rpx;">
<graceSwiper swiperItems="{{swiperItems2}}" bind:taped="taped"></graceSwiper>
</view>
</view>
</gracePage>.js
Page({
data:{
swiperItems : [
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/1.png',
url : '',
title:"测试标题 001",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/2.png',
url : '',
title:"测试标题 02",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/3.png',
url : '',
title:"测试标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/4.png',
url : '',
title:"测试标题04",
opentype : 'navigate'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/5.png',
url : '',
title:"测试标题05",
opentype : 'navigate'
}
],
swiperItems2 : [
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/3.png',
url : '',
title:"测试标题很长很长很长很长很长很长很长很长很长很长很长很长很长很长",
opentype : 'click'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/4.png',
url : '',
title:"测试标题04",
opentype : 'click'
},
{
img : 'https://graceui.oss-cn-beijing.aliyuncs.com/swiperimgs/5.png',
url : '',
title:"测试标题05",
opentype : 'click'
}
]
},
taped : function(e){
wx.showToast({
title:"您点击了第 "+e.detail+" 个项目", icon:"none"
});
}
}).json
{
"usingComponents": {
"gracePage" : "../../graceUI/components/gracePage",
"graceSwiper": "../../graceUI/components/graceSwiper"
}
}