Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
b3f52ed2
Commit
b3f52ed2
authored
Aug 30, 2021
by
wanghuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md文档添加
parent
6ea21b4f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
6 deletions
+34
-6
RotateWheel.jsx
...ient/src/components/_tb_comps/RotateWheel/RotateWheel.jsx
+6
-1
rotatewheel.md
c_client/src/components/_tb_comps/RotateWheel/rotatewheel.md
+6
-1
SwiperView.jsx
c_client/src/components/_tb_comps/SwiperView/SwiperView.jsx
+1
-1
SwiperView.md
c_client/src/components/_tb_comps/SwiperView/SwiperView.md
+2
-1
useAudio.md
c_client/src/hooks/useAudio.md
+17
-0
index.jsx
c_client/src/pages/index/index.jsx
+2
-2
No files found.
c_client/src/components/_tb_comps/RotateWheel/RotateWheel.jsx
View file @
b3f52ed2
...
@@ -20,7 +20,8 @@ const RotateWheel = (props) => {
...
@@ -20,7 +20,8 @@ const RotateWheel = (props) => {
timeFunction
,
timeFunction
,
nodeInfo
,
nodeInfo
,
showWay
,
showWay
,
isShowPrizeName
isShowPrizeName
,
callback
}
=
props
;
}
=
props
;
/* 奖品列表 */
/* 奖品列表 */
const
[
prizelist
,
setPrizelist
]
=
useState
(
prizeList
)
const
[
prizelist
,
setPrizelist
]
=
useState
(
prizeList
)
...
@@ -93,6 +94,10 @@ const RotateWheel = (props) => {
...
@@ -93,6 +94,10 @@ const RotateWheel = (props) => {
let
prizeId
=
Math
.
floor
(
Math
.
random
()
*
prizelist
.
length
)
+
100
;
let
prizeId
=
Math
.
floor
(
Math
.
random
()
*
prizelist
.
length
)
+
100
;
startRotation
(
prizeId
)
startRotation
(
prizeId
)
setTimeout
(()
=>
{
// 弹出弹窗
callback
&&
callback
()
//prizeInfo
},
duration
+
1000
);
},
duration
)
},
duration
)
...
...
c_client/src/components/_tb_comps/RotateWheel/rotatewheel.md
View file @
b3f52ed2
**记事本打开**
**记事本打开**
#### 大转盘配置项入参
####
#
大转盘配置项入参
| 配置项 | 类型 | 描述 | 默认值 | 备注 |
| 配置项 | 类型 | 描述 | 默认值 | 备注 |
| :-------- | :-----: | :--------: | :-----: | :---:|
| :-------- | :-----: | :--------: | :-----: | :---:|
...
@@ -15,3 +15,8 @@
...
@@ -15,3 +15,8 @@
| showWay | String | 奖品排列方式 | 'negative' |negative逆时针排列 positive顺时针排列|
| showWay | String | 奖品排列方式 | 'negative' |negative逆时针排列 positive顺时针排列|
| isShowPrizeName | Boolean | 是否展示奖品名称 | true | true展示 false不展示 |
| isShowPrizeName | Boolean | 是否展示奖品名称 | true | true展示 false不展示 |
<!-- | showNameMaxLength | Number | 奖品名称长度展示限制 | 8 | / | -->
<!-- | showNameMaxLength | Number | 奖品名称长度展示限制 | 8 | / | -->
##### 出参
| 配置项 | 类型 | 描述 | 默认值 | 备注 |
| :-------- | :-----: | :--------: | :-----: | :---:|
| callback | Function | 回调函数 | / |抽中奖品后的回调方法,后续的弹窗处理|
\ No newline at end of file
c_client/src/components/_tb_comps/SwiperView/SwiperView.jsx
View file @
b3f52ed2
import
React
,
{
useState
,
useEffect
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
{
View
,
Image
,
Text
,
Swiper
,
SwiperItem
}
from
"@tarojs/components"
;
import
{
View
,
Image
,
Text
,
Swiper
,
SwiperItem
}
from
"@tarojs/components"
;
import
'./SwiperView.less'
import
'./SwiperView.less'
...
...
c_client/src/components/_tb_comps/SwiperView/SwiperView.md
View file @
b3f52ed2
...
@@ -12,13 +12,14 @@
...
@@ -12,13 +12,14 @@
| easingFunction|String | 缓动动画类型| linear |'default','linear' 'easeInCubic' 'easeOutCubic' 'easeInOutCubic'|
| easingFunction|String | 缓动动画类型| linear |'default','linear' 'easeInCubic' 'easeOutCubic' 'easeInOutCubic'|
#### swiperList
#### swiperList
数据
```
json
```
json
[
[
{
{
"image"
:
""
,
//图片链接
,
图片宽高需要在less中修改
"image"
:
""
,
//图片链接
,
图片宽高需要在less中修改
"content"
:
""
,
//图片描述
"content"
:
""
,
//图片描述
"hasBtn"
:
""
,
//注入数据(是否有按钮)
"hasBtn"
:
""
,
//注入数据(是否有按钮)
//...
},
},
//
...
//
...
]
]
...
...
c_client/src/hooks/useAudio.md
0 → 100644
View file @
b3f52ed2
##### useAudio
```
jsx
const
{
playAudio
,
openStatus
,
setOpenStatus
,
musicUrl
}
=
useAudio
(
url
,
isBgMusic
)
```
##### 入参
| 入参 | 类型 | 描述 | 默认值 | 备注 |
| :--- | :---: | :---: |:---: | :---: |
| url | String | cloud开头的链接 | 'cloud:xxxx.mp3' | 当前应用云存储上的链s接才有效 |
| isBgMusic | Boolean | 是否自动加载背景音乐/音效 | false | / |
##### 出参
| 出参 | 类型 | 描述 | 默认值 | 备注 |
| :--- | :---: | :---: |:---: | :---: |
| playAudio | Function | 播放音乐/音效 | selfStatus,默认值为false | 是否单独处理 |
| openStatus | Boolean | 默认开启播放 | true | / |
| setOpenStatus | Function | 改变开始/暂停状态 | / | true/false都会调用playMusic1方法|
| musicUrl | String | cloud文件得到的音频url链接 | 'https:xxxx.mp3' | 音频文件url链接|
\ No newline at end of file
c_client/src/pages/index/index.jsx
View file @
b3f52ed2
...
@@ -189,7 +189,7 @@ function Index() {
...
@@ -189,7 +189,7 @@ function Index() {
{
/* <ScrollXView prizeList={prizeList} /> */
}
{
/* <ScrollXView prizeList={prizeList} /> */
}
{
/* swiper左右滑动 */
}
{
/* swiper左右滑动 */
}
{
/* <SwiperView swiperList={prizeList} vertical={false} /> */
}
<
SwiperView
swiperList=
{
prizeList
}
vertical=
{
false
}
/>
{
/* 大转盘 */
}
{
/* 大转盘 */
}
{
/* <View className={styles['rotate']}
{
/* <View className={styles['rotate']}
...
@@ -201,7 +201,7 @@ function Index() {
...
@@ -201,7 +201,7 @@ function Index() {
justifyContent:'center',
justifyContent:'center',
alignItems:'center'
alignItems:'center'
}} >
}} >
<RotateWheel {...rotateConfig} />
<RotateWheel {...rotateConfig}
callback={()=>{}}
/>
</View> */
}
</View> */
}
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment