-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HeJason
committed
Jul 15, 2018
1 parent
3066193
commit 45e41c7
Showing
10 changed files
with
116 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
#app{ | ||
background-color: #f8f8f8; | ||
#app { | ||
background-color: #f8f8f8; | ||
} | ||
|
||
// 实例模板 | ||
.example { | ||
padding: 20px; | ||
margin-bottom: 50px; | ||
&:not(:first-child) { | ||
border-top: 40px solid #f5f5f5; | ||
} | ||
&__header { | ||
padding-bottom: 10px; | ||
border-bottom: 1px solid rgba($color: #E5E5E5, $alpha: 1); | ||
&-title { | ||
color: #999; | ||
font-size: 28px; | ||
} | ||
} | ||
&__body{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,54 @@ | ||
import Taro from '@tarojs/taro' | ||
import { View, Text } from '@tarojs/components' | ||
import Taro from '@tarojs/taro'; | ||
import { View } from '@tarojs/components'; | ||
|
||
import './index.scss' | ||
import './index.scss'; | ||
|
||
export default class ActivityIndicator extends Taro.Component { | ||
constructor() { | ||
super(...arguments) | ||
super(...arguments); | ||
this.state = { | ||
views: new Array(12).fill() | ||
} | ||
}; | ||
} | ||
|
||
render() { | ||
const { views } = this.state | ||
const { color, size = 100, mode, text } = this.props | ||
const realSize = size / 2 | ||
const scaleSize = size / 200 | ||
const { views } = this.state; | ||
const { color, size , mode , content } = this.props; | ||
const realSize = size / 2; | ||
const scaleSize = size / 200; | ||
|
||
const rootStyle = { | ||
const indicatorStyle = { | ||
width: +size, | ||
height: +size, | ||
transform: `translate(-${realSize}px, -${realSize}px) scale(${scaleSize}) translate(${realSize}px,${realSize}px)` | ||
} | ||
}; | ||
|
||
const style = { | ||
background: color | ||
} | ||
}; | ||
|
||
const rootClassName = { | ||
'at-activity-indicator': true, | ||
'at-activity-indicator--center': mode == 'center' | ||
}; | ||
|
||
const rootClassName = ['at-activity-indicator__body', `at-activity-indicator__body--${mode}`] | ||
|
||
return ( | ||
<View className='at-activity-indicator'> | ||
<View className={rootClassName} style={rootStyle}> | ||
<View className={rootClassName} > | ||
<View className='at-activity-indicator__body' style={indicatorStyle}> | ||
{views.map((item, index) => { | ||
return ( | ||
<View | ||
key={index} | ||
className='at-activity-indicator__body-item' | ||
style={style} /> | ||
) | ||
); | ||
})} | ||
</View> | ||
<View>{text}</View> | ||
{content && ( | ||
<View className='at-activity-indicator__content'>{content}</View> | ||
)} | ||
</View> | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import Taro from '@tarojs/taro' | ||
import { View } from '@tarojs/components' | ||
|
||
import './index.scss' | ||
|
||
export default class Progress extends Taro.Component { | ||
constructor() { | ||
super(...arguments) | ||
} | ||
|
||
render() { | ||
return <View>11</View> | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,12 @@ | ||
@import "../../../style/variables"; | ||
|
||
.activity-indicator__page { | ||
.example { | ||
padding: 20px; | ||
margin-bottom: 50px; | ||
&:not(:first-child) { | ||
border-top: 20PX solid #f5f5f5; | ||
.example__body { | ||
&--list {} | ||
&--center { | ||
height: 375px; | ||
position: relative; | ||
background-color: #f8f8f8; | ||
margin-bottom: 20px; | ||
} | ||
} | ||
&__header { | ||
padding-bottom: 10px; | ||
margin-bottom: 30px; | ||
border-bottom: 1PX solid rgba($color: #E5E5E5, $alpha: 1); | ||
&-title { | ||
color: #999; | ||
font-size: 14PX; | ||
} | ||
} | ||
&__body { | ||
&--list { | ||
} | ||
&--center { | ||
height: 375px; | ||
position: relative; | ||
background-color: #f8f8f8; | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
@mixin fontSize($num) { | ||
font-size: $num; | ||
} | ||
@mixin absolute-center { | ||
top: 50%; | ||
left: 50%; | ||
position: absolute; | ||
transform: translate(-50%,-50%); | ||
} |