|
@@ -1,18 +1,14 @@
|
|
|
<template>
|
|
|
<mobile-frame :frameStyle="frameStyle" @toPath="toPath">
|
|
|
- <scroll-view scroll-y="true" class="scroll-view" scroll-with-animation :scroll-top="scrollTop" @scroll="scroll"
|
|
|
- @scrolltolower="toPage">
|
|
|
+ <scroll-view scroll-y="true" class="scroll-view" scroll-with-animation :scroll-top="scrollTop" @scroll="scroll" @scrolltolower="toPage">
|
|
|
<view class="list-scroll-view">
|
|
|
<view class="main">
|
|
|
<view class="zero one">
|
|
|
- <input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')"
|
|
|
- placeholder-class="placss">
|
|
|
+ <input type="text" placeholder="搜索商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
|
|
|
</view>
|
|
|
<view class="zero two">
|
|
|
- <swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff"
|
|
|
- indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
|
|
|
- <swiper-item class="list" v-for="(item,index) in bannerList" :key="index"
|
|
|
- @tap="toBanner(item)">
|
|
|
+ <swiper class="swiper" circular :indicator-dots="true" indicator-color="#ffffff" indicator-active-color="#FB1438" :autoplay="true" :interval="3000" :duration="1000">
|
|
|
+ <swiper-item class="list" v-for="(item,index) in bannerList" :key="index" @tap="toBanner(item)">
|
|
|
<image class="image" :src="item.url&&item.url.length>0?item.url[0].url:''" mode="">
|
|
|
</image>
|
|
|
</swiper-item>
|
|
@@ -27,8 +23,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="zero four" v-if="recomList&&recomList.length>0">
|
|
|
- <view class="recomList" v-for="(item,index) in recomList" :key="index"
|
|
|
- v-if="item.list&&item.list.length>0">
|
|
|
+ <view class="recomList" v-for="(item,index) in recomList" :key="index" v-if="item.list&&item.list.length>0">
|
|
|
<view class="list" v-for="(tag,indexs) in item.list" :key="indexs" @tap="toBuy(tag)">
|
|
|
<view class="list_1">
|
|
|
<view class="txt">
|
|
@@ -51,8 +46,7 @@
|
|
|
<view class="zero act">
|
|
|
<view class="list" v-for="(item,index) in platformactList" :key="index" @tap="toAct(item)">
|
|
|
<view class="img">
|
|
|
- <image class="image" :src="item.cover&&item.cover.length>0?item.cover[0].url:''"
|
|
|
- mode="">
|
|
|
+ <image class="image" :src="item.cover&&item.cover.length>0?item.cover[0].url:''" mode="">
|
|
|
</image>
|
|
|
</view>
|
|
|
<view class="title" v-if="item.act_time.is_use=='0'">
|
|
@@ -87,7 +81,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
- <view class="backTop" v-if="old.scrollTop>500">
|
|
|
+ <view class="backTop" v-if="old_scrollTop>500">
|
|
|
<text @tap="goTop" class="iconfont icon-fanhuidingbu"></text>
|
|
|
</view>
|
|
|
</mobile-frame>
|
|
@@ -116,15 +110,18 @@
|
|
|
page: 0,
|
|
|
// 返回顶部
|
|
|
scrollTop: 0,
|
|
|
- old: {
|
|
|
- scrollTop: 0
|
|
|
- },
|
|
|
+ old_scrollTop: 0
|
|
|
};
|
|
|
},
|
|
|
onLoad: function() {
|
|
|
const that = this;
|
|
|
that.search();
|
|
|
-
|
|
|
+ },
|
|
|
+ onPullDownRefresh: async function() {
|
|
|
+ const that = this;
|
|
|
+ that.clearPage();
|
|
|
+ await that.search();
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
},
|
|
|
methods: {
|
|
|
async search() {
|
|
@@ -205,7 +202,6 @@
|
|
|
// 推荐好物更多
|
|
|
toMore(e) {
|
|
|
const that = this;
|
|
|
-
|
|
|
uni.navigateTo({
|
|
|
url: `/pagesRest/recom/index?act_tags=${e.value}`
|
|
|
})
|
|
@@ -256,28 +252,28 @@
|
|
|
},
|
|
|
// 计算高度
|
|
|
scroll: function(e) {
|
|
|
- this.old.scrollTop = e.detail.scrollTop
|
|
|
+ const that = this;
|
|
|
+ that.old_scrollTop = e.detail.scrollTop
|
|
|
},
|
|
|
// 返回顶部
|
|
|
goTop: function(e) {
|
|
|
- this.scrollTop = this.old.scrollTop
|
|
|
- this.$nextTick(function() {
|
|
|
- this.scrollTop = 0
|
|
|
+ const that = this;
|
|
|
+ that.scrollTop = that.old_scrollTop;
|
|
|
+ that.$nextTick(function() {
|
|
|
+ that.scrollTop = 0
|
|
|
});
|
|
|
+ },
|
|
|
+ clearPage() {
|
|
|
+ const that = this;
|
|
|
+ that.$set(that, `bannerList`, [])
|
|
|
+ that.$set(that, `btnList`, [])
|
|
|
+ that.$set(that, `recomList`, [])
|
|
|
+ that.$set(that, `platformactList`, [])
|
|
|
+ that.$set(that, `marketList`, [])
|
|
|
+ that.$set(that, `skip`, 0)
|
|
|
+ that.$set(that, `limit`, 6)
|
|
|
+ that.$set(that, `page`, 0)
|
|
|
}
|
|
|
- },
|
|
|
- onPullDownRefresh: async function() {
|
|
|
- const that = this;
|
|
|
- that.$set(that, `bannerList`, [])
|
|
|
- that.$set(that, `btnList`, [])
|
|
|
- that.$set(that, `recomList`, [])
|
|
|
- that.$set(that, `platformactList`, [])
|
|
|
- that.$set(that, `marketList`, [])
|
|
|
- that.$set(that, `skip`, 0)
|
|
|
- that.$set(that, `limit`, 6)
|
|
|
- that.$set(that, `page`, 0)
|
|
|
- await that.search();
|
|
|
- uni.stopPullDownRefresh();
|
|
|
}
|
|
|
}
|
|
|
</script>
|