Authored by yyq

Merge branch 'develop' of git.yoho.cn:fe/yoho-brand-shop into develop

... ... @@ -11,7 +11,7 @@ Component({
properties: {
show: {
type: Boolean,
value: false
value: true
},
showBackTop: {
type: Boolean,
... ...
<view hidden="{{!show}}" class="quick-navigation" style="bottom: {{marginBottom}}rpx">
<view hidden="{{!show}}" class="quick-navigation" style="bottom:{{marginBottom}}rpx">
<view wx:if="{{showMenu}}" class="qn-menu-group" animation="{{menuAnimation}}">
<view class="hide-menu-group">
<view class="qn-menu" animation="{{homeAnimation}}" bindtap="jumpToHome">
... ... @@ -19,7 +19,7 @@
</view>
</view>
</view>
<view class="back-menu qn-menu" animation="{{indicatorAnimation}}" bindtap="backToTop">
<view wx:if="{{showBackTop}}" class="back-menu qn-menu" animation="{{indicatorAnimation}}" bindtap="backToTop">
<text class="iconfont icon-backtop menu-text"></text>
</view>
</view>
... ...
... ... @@ -24,7 +24,8 @@ Page({
currentPage: 1,
totalPage: 0,
pullRefresh: false,
showBackTop: false
showBackTop: false,
showCopyright: false
},
onLoad: function () {
this.productList({ page: 1, limit: 20});
... ... @@ -138,6 +139,12 @@ Page({
totalPage: res.data.page_total
});
if (!this.data.showCopyright) {
this.setData({
showCopyright: true
});
}
// 浮动筛选时滚动位置
if (this.data.floatFilter && params.setScrollPos) {
wx.pageScrollTo({
... ...
... ... @@ -27,7 +27,7 @@
</view>
</view>
<view>
<copyright></copyright>
<copyright wx:if="{{showCopyright}}"></copyright>
</view>
<quick-navigation show-back-top="{{showBackTop}}" show="{{true}}"
bindbacktop="backTop"></quick-navigation>
... ...
... ... @@ -13,6 +13,7 @@ import {Actionsheet} from '../../../vendors/zanui/index';
let app = getApp();
let yas = new Yas();
let router = global.router;
let {windowHeight} = app.getSystemInfo();
Page({
...Actionsheet,
... ... @@ -81,7 +82,9 @@ Page({
},
shopRecList: [],
preferList: []
preferList: [],
showBackTop: false
},
onLoad: function (options) {
let productSkn = options.productSkn ? options.productSkn : '';
... ... @@ -97,6 +100,20 @@ Page({
this.preferList();
yas.pageOpenReport();
},
onPageScroll: function ({scrollTop}) {
const show = scrollTop > windowHeight * 2;
if (show !== this.data.showBackTop) {
this.setData({
showBackTop: show
});
}
},
backTop: function () {
wx.pageScrollTo({
scrollTop: 0
});
},
onShareAppMessage: function (res) {
let params = {
FROM: res.from,
... ...
... ... @@ -4,6 +4,7 @@
"product-banner": "/components/product/detail/banner",
"product-list": "/components/product/list",
"snapshot": "/components/product/detail/snapshot",
"view-title": "/components/layout/view-title/view-title"
"view-title": "/components/layout/view-title/view-title",
"quick-navigation": "/components/layout/quick-navigation/quick-navigation"
}
}
... ...
... ... @@ -2,8 +2,7 @@
<wxs src="../../../wxs/helper.wxs" module="helper"/>
<import src="../../../vendors/zanui/actionsheet/index.wxml"/>
<scroll-view class="detail-container" scroll-y="true" enable-back-to-top="true" scroll-top="{{scrollTop}}"
bindscroll="onScroll">
<view class="detail-container">
<view class='topContainer'>
<product-banner image-list="{{productImages}}" product-name="{{productName}}"></product-banner>
</view>
... ... @@ -113,10 +112,12 @@
<text class="bottom-tip-view-title" style="display:{{is_supplyed?'none':'flex'}}">已售罄</text>
</view>
<view class="gap"></view>
</scroll-view>
</view>
<view class="bottom-action">
<view class='buy-btn' bindtap="buyImmediate">立即购买</view>
</view>
<quick-navigation show-menu="{{true}}" show-back-top="{{showBackTop}}" show="{{true}}"
bindbacktop="backTop" margin-bottom="{{150}}"></quick-navigation>
<snapshot isShow="{{showSnapshootShare}}" sourceType="product" shareData="{{snapshootShareData}}"
bind:hiddenSheet="hideSnap"></snapshot>
... ...
... ... @@ -4,6 +4,7 @@ import listModel from '../../../models/product/list';
import {parse} from '../../../vendors/query-stringify';
const yas = new Yas();
const {windowHeight} = getApp().getSystemInfo();
Page({
data: {
... ... @@ -16,7 +17,9 @@ Page({
currentPage: 0,
totalPage: 1,
urlParams: {},
showBackTop: true
showBackTop: false,
noResult: false,
windowHeight: windowHeight + 48,
},
onLoad:function (options) {
let title = decodeURIComponent(options.title) || '默认标题';
... ... @@ -32,6 +35,18 @@ Page({
this.productList(options);
yas.pageOpenReport();
},
onPageScroll: function({scrollTop}) {
if (scrollTop > windowHeight * 2 !== this.data.showBackTop) {
this.setData({
showBackTop: scrollTop > windowHeight * 2
});
}
},
backTop: function() {
wx.pageScrollTo({
scrollTop: 0
});
},
onReachBottom: function () {
this.productList(this.data.urlParams);
},
... ... @@ -75,8 +90,16 @@ Page({
productList: this.data.productList.concat(list),
currentPage: params.page,
totalPage: res.data.page_total,
showNoMore: params.page === res.data.page_total
showNoMore: params.page === res.data.page_total,
noResult: !this.data.productList.concat(list).length
});
if (params.resetScroll) {
wx.pageScrollTo({
scrollTop: 0,
duration: 10
});
}
}
});
},
... ... @@ -89,6 +112,6 @@ Page({
this.data.totalPage = 1;
this.data.productList = [];
this.productList(this.data.urlParams);
this.productList(Object.assign({resetScroll: true}, this.data.urlParams));
}
});
\ No newline at end of file
... ...
<scroll-view class="list-container">
<view class="list-container" style="min-height:{{windowHeight}}px;">
<view class="filter-view">
<product-list-filter bind:sortchange="sortChange"></product-list-filter>
</view>
<view class="list-view">
<product-list list="{{productList}}"
show-loading="{{showLoading}}"
show-no-more="{{showNoMore}}"></product-list>
<view class="no-res" wx:if="{{noResult}}">
<image class="no-res-img" src="../../../static/images/nosearch-ic@3x.png"></image>
<view class="no-res-txt">未搜索到任何相关商品</view>
</view>
<view wx:if="{{productList.length}}">
<product-list list="{{productList}}"
show-loading="{{showLoading}}"
show-no-more="{{showNoMore}}"></product-list>
</view>
</view>
<copyright></copyright>
<quick-navigation show-menu="{{false}}" show-back-top="{{showBackTop}}" show="{{true}}"
bindbacktop="backTop"></quick-navigation>
</scroll-view>
\ No newline at end of file
<copyright class="copy-right"></copyright>
<quick-navigation show-menu="{{true}}" show-back-top="{{showBackTop}}" bindbacktop="backTop"></quick-navigation>
</view>
\ No newline at end of file
... ...
.list-container {
position: relative;
padding-bottom: 180rpx;
box-sizing: border-box;
}
.list-container .filter-view {
position: fixed;
top: 0;
... ... @@ -12,4 +18,36 @@
.list-container .list-view {
padding-top: 88rpx;
padding-bottom: 65rpx;
}
.copy-right {
position: absolute;
bottom: 0;
right: 0;
left: 0;
}
.no-res {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
padding-top: 220rpx;
text-align: center;
background-color: #fff;
z-index: -1;
}
.no-res .no-res-img {
width: 204rpx;
height: 204rpx;
margin-top: 80rpx;
}
.no-res .no-res-txt {
font-size: 24rpx;
text-align: center;
margin-top: 21rpx;
color: #444444;
}
\ No newline at end of file
... ...
... ... @@ -121,6 +121,13 @@ Page({
currentPage: params.page,
totalPage: res.data.page_total
});
if (this.data.fixedFilter && params.resetScroll) {
wx.pageScrollTo({
scrollTop: this.data.shopInfoHeight,
duration: 10
});
}
}
}).catch(() => {
this.data.isLoading = false;
... ... @@ -155,6 +162,7 @@ Page({
limit: 20
};
this.data.productList = [];
params.resetScroll = true;
this.productList(params);
},
//店铺信息
... ... @@ -252,13 +260,24 @@ Page({
});
});
},
scroll: function (e) {
const { scrollTop } = e.detail;
this.setData({
fixedFilter: scrollTop >= this.data.shopInfoHeight
onPageScroll: function({scrollTop}) {
if (scrollTop >= this.data.shopInfoHeight !== this.data.fixedFilter) {
this.setData({
fixedFilter: scrollTop >= this.data.shopInfoHeight
});
}
if (scrollTop > windowHeight * 2 !== this.data.showBackTop) {
this.setData({
showBackTop: scrollTop > windowHeight * 2
});
}
},
backTop: function() {
wx.pageScrollTo({
scrollTop: 0
});
},
loadMore: function () {
onReachBottom: function () {
if (this.data.currentPage < this.data.totalPage) {
this.setData({
showLoading: true
... ...
<wxs src="../../../wxs/helper.wxs" module="helper"></wxs>
<import src="../../../vendors/zanui/actionsheet/index.wxml"/>
<scroll-view class="shop-container" scroll-y bindscroll="scroll" scroll-top="{{scrollTop}}" bindscrolltolower="loadMore"
<view class="shop-container" scroll-y bindscroll="scroll" scroll-top="{{scrollTop}}" bindscrolltolower="loadMore"
style="height:{{windowHeight}}px;">
<view class="shop-info">
<image class="shop-info-bg" src="{{bannerUrl}}"></image>
... ... @@ -22,7 +22,6 @@
show-no-more="{{showNoMore}}"></product-list>
</view>
<copyright></copyright>
<quick-navigation show-menu="{{false}}" show-back-top="{{showBackTop}}" show="{{true}}"
bindbacktop="backTop"></quick-navigation>
</scroll-view>
<quick-navigation show-menu="{{true}}" show-back-top="{{showBackTop}}" bindbacktop="backTop"></quick-navigation>
</view>
<template is="zan-actionsheet" data="{{...actionsheet}}" />
\ No newline at end of file
... ...
... ... @@ -13,7 +13,7 @@
}
.filter-view-float-holder {
height: 96rpx;
height: 92rpx;
}
.shop-container .list-view {
... ...
... ... @@ -3,6 +3,7 @@ import Yas from '../../../common/yas'
import searchModel from '../../../models/product/search';
const yas = new Yas();
const {windowHeight} = getApp().getSystemInfo();
Page({
data: {
... ... @@ -17,7 +18,7 @@ Page({
noResult: false,
showLoading: false,
showNoMore: false,
showBackTop: true
showBackTop: false
},
onReachBottom: function () {
if (this.data.currentPage < this.data.totalPage) {
... ... @@ -40,6 +41,18 @@ Page({
onLoad: function() {
yas.pageOpenReport();
},
onPageScroll: function({scrollTop}) {
if (scrollTop > windowHeight * 2 !== this.data.showBackTop) {
this.setData({
showBackTop: scrollTop > windowHeight * 2
});
}
},
backTop: function() {
wx.pageScrollTo({
scrollTop: 0
});
},
bindQueryInput: function(e) {
this.setData({
query: e.detail.value
... ... @@ -105,10 +118,12 @@ Page({
noResult: this.data.productList.concat(list).length === 0
});
wx.pageScrollTo({
scrollTop: 0,
duration: 10
});
if (params.resetScroll) {
wx.pageScrollTo({
scrollTop: 0,
duration: 10
});
}
wx.hideLoading();
}
}).catch(() => {
... ... @@ -131,6 +146,7 @@ Page({
query: this.data.query
};
this.data.productList = [];
params.resetScroll = true;
this.productList(params);
}
});
\ No newline at end of file
... ...
... ... @@ -20,6 +20,5 @@
</product-list>
</view>
</view>
<quick-navigation show-menu="{{false}}" show-back-top="{{showBackTop}}" show="{{true}}"
bindbacktop="backTop"></quick-navigation>
<quick-navigation show-back-top="{{showBackTop}}" bindbacktop="backTop"></quick-navigation>
</view>
... ...