Commit 0644cf0f authored by liwei's avatar liwei

liwei

parent 2b2ff2e5
...@@ -37,19 +37,11 @@ ...@@ -37,19 +37,11 @@
<span class="line"></span> <span class="line"></span>
</div> </div>
</div> </div>
<van-swipe <swiper class="scroll" :options="swiperOption" ref="mySwiper">
:loop="false" <swiperSlide>
:show-indicators="false"
:touchable="true"
:initial-swipe="tabIndex-1"
:duration="1000"
class="scroll"
@change="swipeChange"
>
<van-swipe-item @click="swipeItemClick">
<scroll <scroll
:style="{maxHeight: height +'px'}" :style="{maxHeight: height +'px'}"
v-if="starNum!=0&&tabIndex==1" v-if="starNum!=0"
ref="scrollItem" ref="scrollItem"
:data="starList" :data="starList"
:bounce="false" :bounce="false"
...@@ -86,7 +78,7 @@ ...@@ -86,7 +78,7 @@
<img :src="starPage.star_prize2" alt> <img :src="starPage.star_prize2" alt>
</div> </div>
</div> </div>
<div class="addr" @click="goAddr($event)" v-if="!addressObj"> <div class="addr" @click="goAddr()" v-if="!addressObj">
点击这里,快去填写收货地址吧 点击这里,快去填写收货地址吧
<i class="iconfont icon-youjiantou"></i> <i class="iconfont icon-youjiantou"></i>
</div> </div>
...@@ -164,11 +156,11 @@ ...@@ -164,11 +156,11 @@
</div> </div>
</div> </div>
</scroll> </scroll>
</van-swipe-item> </swiperSlide>
<van-swipe-item> <swiperSlide>
<scroll <scroll
:style="{maxHeight: height +'px'}" :style="{maxHeight: height +'px'}"
v-if="starNum!=0&&tabIndex==2" v-if="starNum!=0"
ref="scrollItem" ref="scrollItem"
:data="starList" :data="starList"
:pullup="pullup" :pullup="pullup"
...@@ -190,12 +182,14 @@ ...@@ -190,12 +182,14 @@
<div v-if="finished" class="none">没有更多了~</div> <div v-if="finished" class="none">没有更多了~</div>
</div> </div>
</scroll> </scroll>
</van-swipe-item> </swiperSlide>
</van-swipe> </swiper>
</div> </div>
</template> </template>
<script> <script>
import "swiper/dist/css/swiper.css";
import { swiper, swiperSlide } from "vue-awesome-swiper";
import rankBg from "../../assets/rankBg.png"; import rankBg from "../../assets/rankBg.png";
import { starPage } from "../../util/imgUrl"; import { starPage } from "../../util/imgUrl";
import { import {
...@@ -210,8 +204,8 @@ Vue.use(Swipe).use(SwipeItem); ...@@ -210,8 +204,8 @@ Vue.use(Swipe).use(SwipeItem);
export default { export default {
name: "starRank", name: "starRank",
data() { data() {
let that = this;
return { return {
isClick: true,
height: 0, height: 0,
pullup: true, pullup: true,
rankBg: rankBg, rankBg: rankBg,
...@@ -227,19 +221,24 @@ export default { ...@@ -227,19 +221,24 @@ export default {
addressObj: false, addressObj: false,
starInfo: { starInfo: {
code: "" code: ""
},
swiperOption: {
on: {
slideChangeTransitionEnd: function() {
console.log(this.activeIndex);
that.tabIndex = this.activeIndex + 1;
}
}
} }
}; };
}, },
components: {}, components: { swiper, swiperSlide },
computed: {
swiper() {
return this.$refs.mySwiper.swiper;
}
},
methods: { methods: {
swipeItemClick(e) {
console.log("swipeItemClick", e);
this.isClick = true;
},
swipeChange(index) {
this.tabIndex = index + 1;
this.isClick = false;
},
goResult() { goResult() {
this.$router.push({ this.$router.push({
name: "starResult", name: "starResult",
...@@ -247,38 +246,33 @@ export default { ...@@ -247,38 +246,33 @@ export default {
}); });
}, },
goAddr(e) { goAddr(e) {
if (this.isClick) { if (this.addressObj) {
if (this.addressObj) {
this.$router.push({
name: "activityAddr"
});
} else {
this.$router.push({
name: "addressEdit"
});
}
}
},
goDetail(index, e) {
console.log("goDetail", e);
if (this.isClick) {
let obj = {};
obj.index = index;
if (index == 1) {
obj.start_at = this.starInfo.start_at;
obj.first_over_at = this.starInfo.first_over_at;
obj.user_category_integral_last_ten = this.starInfo.user_category_integral_last_ten;
} else {
obj.start_at = this.starInfo.start_at;
obj.second_over_at = this.starInfo.second_over_at;
obj.user_category_integral_last_twenty = this.starInfo.user_category_integral_last_twenty;
}
this.$router.push({ this.$router.push({
name: "starDetail", name: "activityAddr"
query: { starInfo: obj } });
} else {
this.$router.push({
name: "addressEdit"
}); });
} }
}, },
goDetail(index) {
let obj = {};
obj.index = index;
if (index == 1) {
obj.start_at = this.starInfo.start_at;
obj.first_over_at = this.starInfo.first_over_at;
obj.user_category_integral_last_ten = this.starInfo.user_category_integral_last_ten;
} else {
obj.start_at = this.starInfo.start_at;
obj.second_over_at = this.starInfo.second_over_at;
obj.user_category_integral_last_twenty = this.starInfo.user_category_integral_last_twenty;
}
this.$router.push({
name: "starDetail",
query: { starInfo: obj }
});
},
onReachBottom() { onReachBottom() {
if (!this.finished && this.loading) { if (!this.finished && this.loading) {
this.loading = false; this.loading = false;
...@@ -335,7 +329,6 @@ export default { ...@@ -335,7 +329,6 @@ export default {
getComputedStyle(this.$refs.floatBox).height.replace("px", "") getComputedStyle(this.$refs.floatBox).height.replace("px", "")
) )
); );
console.log(document.documentElement.clientHeight);
let top = let top =
(document.documentElement.clientHeight - (document.documentElement.clientHeight -
Number( Number(
...@@ -364,8 +357,13 @@ export default { ...@@ -364,8 +357,13 @@ export default {
}); });
}, },
tabChange(index) { tabChange(index) {
console.log(index);
this.tabIndex = index; this.tabIndex = index;
if (index == 1) {
this.swiper.slidePrev();
} else if (index == 2) {
this.swiper.slideNext();
}
// if(index==2){ // if(index==2){
// setTimeout(() => { // setTimeout(() => {
// this.$refs.scrollItem._initScroll() // this.$refs.scrollItem._initScroll()
...@@ -380,7 +378,6 @@ export default { ...@@ -380,7 +378,6 @@ export default {
this.height = this.height =
screen.height - screen.height -
Number(getComputedStyle(this.$refs.floatBox).height.replace("px", "")); Number(getComputedStyle(this.$refs.floatBox).height.replace("px", ""));
this.initPage(); this.initPage();
} }
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment