Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
H
h5-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
new-sing
h5-base
Commits
f8d57970
Commit
f8d57970
authored
Jun 27, 2019
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
liwei
parent
09aa55d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
128 additions
and
127 deletions
+128
-127
scroll.vue
src/base/scroll/scroll.vue
+119
-120
starRank.vue
src/components/star/starRank.vue
+9
-7
No files found.
src/base/scroll/scroll.vue
View file @
f8d57970
...
...
@@ -5,134 +5,133 @@
</
template
>
<
script
type=
"text/ecmascript-6"
>
import
BScroll
from
'better-scroll'
export
default
{
props
:
{
probeType
:
{
type
:
Number
,
default
:
1
},
click
:
{
type
:
Boolean
,
default
:
true
},
listenScroll
:
{
type
:
Boolean
,
default
:
false
},
data
:
{
type
:
Array
,
default
:
null
},
pullup
:
{
type
:
Boolean
,
default
:
false
},
pulldown
:
{
type
:
Boolean
,
default
:
false
},
beforeScroll
:
{
type
:
Boolean
,
default
:
false
},
refreshDelay
:
{
type
:
Number
,
default
:
100
},
bounce
:
{
type
:
Boolean
,
default
:
true
},
scrollX
:
{
type
:
Boolean
,
default
:
false
},
scrollY
:
{
type
:
Boolean
,
default
:
true
}
import
BScroll
from
"better-scroll"
;
export
default
{
props
:
{
probeType
:
{
type
:
Number
,
default
:
1
},
mounted
()
{
setTimeout
(()
=>
{
this
.
_initScroll
()
},
20
)
},
methods
:
{
_initScroll
()
{
if
(
!
this
.
$refs
.
wrapper
)
{
return
}
this
.
scroll
=
new
BScroll
(
this
.
$refs
.
wrapper
,
{
probeType
:
this
.
probeType
,
click
:
this
.
click
,
bounce
:
this
.
bounce
,
scrollX
:
this
.
scrollX
,
scrollY
:
this
.
scrollY
})
click
:
{
type
:
Boolean
,
default
:
true
},
listenScroll
:
{
type
:
Boolean
,
default
:
false
},
data
:
{
type
:
Array
,
default
:
null
},
pullup
:
{
type
:
Boolean
,
default
:
false
},
pulldown
:
{
type
:
Boolean
,
default
:
false
},
beforeScroll
:
{
type
:
Boolean
,
default
:
false
},
refreshDelay
:
{
type
:
Number
,
default
:
100
},
bounce
:
{
type
:
Boolean
,
default
:
true
},
scrollX
:
{
type
:
Boolean
,
default
:
false
},
scrollY
:
{
type
:
Boolean
,
default
:
true
}
},
mounted
()
{
setTimeout
(()
=>
{
this
.
_initScroll
();
},
20
);
},
methods
:
{
_initScroll
()
{
if
(
!
this
.
$refs
.
wrapper
)
{
return
;
}
this
.
scroll
=
new
BScroll
(
this
.
$refs
.
wrapper
,
{
probeType
:
this
.
probeType
,
click
:
this
.
click
,
bounce
:
this
.
bounce
,
scrollX
:
this
.
scrollX
,
scrollY
:
this
.
scrollY
});
if
(
this
.
listenScroll
)
{
let
me
=
this
this
.
scroll
.
on
(
'scroll'
,
(
pos
)
=>
{
me
.
$emit
(
'scroll'
,
pos
)
})
}
if
(
this
.
listenScroll
)
{
let
me
=
this
;
this
.
scroll
.
on
(
"scroll"
,
pos
=>
{
me
.
$emit
(
"scroll"
,
pos
);
});
}
if
(
this
.
pullup
)
{
this
.
scroll
.
on
(
'scrollEnd'
,
()
=>
{
if
(
this
.
scroll
.
y
<=
(
this
.
scroll
.
maxScrollY
+
10
))
{
// 滚动到底部
this
.
$emit
(
'pullup'
)
}
})
}
if
(
this
.
pulldown
)
{
this
.
scroll
.
on
(
'touchend'
,
(
pos
)
=>
{
// 下拉动作
if
(
pos
.
y
>
50
)
{
this
.
$emit
(
'pulldown'
)
}
})
}
if
(
this
.
beforeScroll
)
{
this
.
scroll
.
on
(
'beforeScrollStart'
,
()
=>
{
this
.
$emit
(
'beforeScroll'
)
})
}
// if (this.pos) {
// // this.$emit('beforeScroll')
// this.scroll.scrollTo(this.pos.x,this.pos.y)
// }
},
disable
()
{
this
.
scroll
&&
this
.
scroll
.
disable
()
},
enable
()
{
this
.
scroll
&&
this
.
scroll
.
enable
()
},
refresh
()
{
this
.
scroll
&&
this
.
scroll
.
refresh
()
},
scrollTo
(
x
,
y
,
time
)
{
this
.
scroll
&&
this
.
scroll
.
scrollTo
(
x
,
y
,
time
)
},
scrollToElement
(
el
,
time
){
this
.
scroll
&&
this
.
scroll
.
scrollToElement
(
el
,
time
)
},
scrollToElement
()
{
this
.
scroll
&&
this
.
scroll
.
scrollToElement
.
apply
(
this
.
scroll
,
arguments
)
if
(
this
.
pullup
)
{
this
.
scroll
.
on
(
"scrollEnd"
,
()
=>
{
if
(
this
.
scroll
.
y
<=
this
.
scroll
.
maxScrollY
+
10
)
{
// 滚动到底部
this
.
$emit
(
"pullup"
);
}
});
}
},
watch
:
{
data
()
{
setTimeout
(()
=>
{
this
.
refresh
()
},
this
.
refreshDelay
)
if
(
this
.
pulldown
)
{
this
.
scroll
.
on
(
"touchend"
,
pos
=>
{
// 下拉动作
if
(
pos
.
y
>
50
)
{
this
.
$emit
(
"pulldown"
);
}
});
}
if
(
this
.
beforeScroll
)
{
this
.
scroll
.
on
(
"beforeScrollStart"
,
()
=>
{
this
.
$emit
(
"beforeScroll"
);
});
}
// if (this.pos) {
// // this.$emit('beforeScroll')
// this.scroll.scrollTo(this.pos.x,this.pos.y)
// }
},
disable
()
{
this
.
scroll
&&
this
.
scroll
.
disable
();
},
enable
()
{
this
.
scroll
&&
this
.
scroll
.
enable
();
},
refresh
()
{
this
.
scroll
&&
this
.
scroll
.
refresh
();
},
scrollTo
(
x
,
y
,
time
)
{
this
.
scroll
&&
this
.
scroll
.
scrollTo
(
x
,
y
,
time
);
},
scrollToElement
(
el
,
time
)
{
this
.
scroll
&&
this
.
scroll
.
scrollToElement
(
el
,
time
);
},
scrollToElement
()
{
this
.
scroll
&&
this
.
scroll
.
scrollToElement
.
apply
(
this
.
scroll
,
arguments
);
}
},
watch
:
{
data
()
{
setTimeout
(()
=>
{
this
.
refresh
();
},
this
.
refreshDelay
);
}
}
};
</
script
>
<
style
scoped
>
</
style
>
src/components/star/starRank.vue
View file @
f8d57970
...
...
@@ -18,7 +18,7 @@
<span
class=
"line"
></span>
还没有星星记录哦~
<span
class=
"line"
></span>
</div>
<div
class=
"secTitle"
v-if=
"starNum!=0&&starInfo.code!=500"
>
<div
class=
"secTitle"
v-if=
"starNum!=0&&starInfo.code!=500"
>
<div
:class=
"
{item:true}" @click="tabChange(1)">
<span
v-if=
"tabIndex==1"
class=
"activity"
>
<img
:src=
"starPage.star_img_title"
alt
>
星星活动
...
...
@@ -40,16 +40,18 @@
<swiper
class=
"scroll"
:options=
"swiperOption"
ref=
"mySwiper"
>
<swiperSlide>
<scroll
:style=
"
{
maxH
eight: height +'px'}"
:style=
"
{
h
eight: height +'px'}"
v-if="starNum!=0"
ref="scrollItem"
:data="starList"
:bounce="false">
:bounce="false"
>
<div
class=
"container"
>
<div
class=
"stageBox"
v-if=
"starInfo.code!=2001"
>
<div
class=
"result"
v-if=
"starInfo.code!=2003&&starInfo.code!=2004&&starInfo.activity_result&&starInfo.activity_result.result!=15&&starInfo.activity_result.result!=16"
>
v-if=
"starInfo.code!=2003&&starInfo.code!=2004&&starInfo.activity_result&&starInfo.activity_result.result!=15&&starInfo.activity_result.result!=16"
>
<div
class=
"float"
>
结果公示
</div>
<div
v-if=
"starInfo.activity_result.result==11"
>
<h2>
恭喜两个阶段全勤挑战成功
</h2>
...
...
@@ -93,7 +95,8 @@
</div>
<div
v-if=
"starInfo.code!=2003&&starInfo.activity_result&&(starInfo.activity_result.result==15||starInfo.activity_result.result==16)"
class=
"result fal"
>
class=
"result fal"
>
<div
class=
"float"
>
结果公示
</div>
<div
v-if=
"starInfo.activity_result.result==15"
>
<div
class=
"fal_title"
>
很抱歉第一阶段全勤挑战失败
</div>
...
...
@@ -156,7 +159,7 @@
</swiperSlide>
<swiperSlide>
<scroll
:style=
"
{
maxH
eight: height +'px'}"
:style=
"
{
h
eight: height +'px'}"
v-if="starNum!=0"
ref="scrollItem"
:data="starList"
...
...
@@ -338,7 +341,6 @@ export default {
top
+
"px"
;
}
console
.
log
(
top
);
},
200
);
// if(this.$refs.unStart){
// floatBox
...
...
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