Authored by baoss

Merge branch 'develop' of git.yoho.cn:fe/xianyu-ufo-app-web into develop

... ... @@ -100,7 +100,8 @@ export default {
.layout-context {
flex: 1;
overflow: hidden;
overflow-x: hidden;
overflow-y: auto;
position: relative;
}
... ...
<template>
<div class="layout-scroll">
<div class="layout-scroll-main" ref="scroll">
<slot></slot>
<div class="scroll-body" :style="{'minHeight': wrapHeight + 'px'}">
<slot></slot>
</div>
<div v-if="loading && !loading.hide" class="loading">
<p v-if="loading.noMore" class="load-text">没有更多了</p>
<p v-if="loading.noMore" class="load-text">{{loading.noMoreText || '没有更多了'}}</p>
<Loading v-else :size="20"></Loading>
</div>
</div>
... ... @@ -20,13 +22,16 @@ export default {
name: 'LayoutScroll',
data() {
return {
noMore: false
noMore: false,
wrapHeight: 0,
};
},
props: {
loading: Object
},
mounted() {
this.wrapHeight = this.$el.offsetHeight;
this._forceUpdate = throttle(this.forceUpdate.bind(this), 500);
this._onPullingUp = throttle(this.onPullingUp.bind(this), 1000);
... ...
... ... @@ -18,10 +18,9 @@
</Scroll>
</div>
<div class="right-content">
<Scroll ref="subScroll"
:scroll-events="scrollEvents"
@scroll-end="onScrollEndHandler"
>
<layoutScroll ref="subScroll"
@scroll-end="onScrollEndHandler"
>
<div v-for="(itemSub, index) in categorySubList" :key="index">
<CategoryTitle>{{itemSub.name}}</CategoryTitle>
<div class="category-sub-root" :class="'sub-type-' + itemSub.type">
... ... @@ -44,14 +43,13 @@
</div>
</div>
</div>
</Scroll>
</layoutScroll>
</div>
</div>
</LayoutApp>
</template>
<script>
import { Scroll } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import Vue from 'vue';
... ... @@ -63,7 +61,6 @@ export default {
name: 'category',
props: ['hideHeader'],
components: {
Scroll,
ImgSize,
CategoryTitle
},
... ...
<template>
<LayoutApp :show-back="true">
<div class="scroll-list-wrap">
<Scroll
<LayoutScroll
ref="scroll"
:options="options"
@pulling-up="onPullingUp"
:data="newsList.list">
:loading="loadingOptions"
@pulling-up="onPullingUp">
<div class="news-content">
<Title :title="title"></Title>
<List v-if="newsList.list && newsList.list.length > 0" :list="newsList.list || []"></List>
<UfoNoItem v-else :tip="`暂无数据`" style="margin-top: 60px"></UfoNoItem>
</div>
</Scroll>
</LayoutScroll>
</div>
</LayoutApp>
</template>
... ... @@ -49,6 +48,12 @@ export default {
return {
pullUpLoad: this.newsList.list.length > 0 ? true : false,
}
},
loadingOptions() {
return {
hide: !this.newsList.list || !this.newsList.list.length,
noMore: !this.newsList.isMoreData
};
}
// options: {
// // pullUpLoad: {
... ... @@ -89,7 +94,7 @@ export default {
async onPullingUp() {
if (!this.newsList.isMoreData) {
this.$refs.scroll.forceUpdate()
this.$refs.scroll.forceUpdate()
return;
}
this.fetchList(this.params);
... ...
... ... @@ -20,9 +20,6 @@
</div>
<LayoutScroll ref="scroll" class="product-list" v-show="!productList.isEmpty"
:loading="loadingOption"
:scroll-events="['scroll', 'scroll-end']"
:options="scrollOptions"
:data="productList.list"
@scroll="scrollHandler"
@scroll-end="scrollEndHandler"
@pulling-up="onPullingUp">
... ... @@ -124,6 +121,7 @@ export default {
...mapState(['yoho']),
loadingOption() {
return {
hide: !this.productList.list || !this.productList.list.length,
noMore: this.productList && this.productList.endReached
};
},
... ... @@ -316,8 +314,9 @@ export default {
<style scoped>
.filter {
display: flex;
width: 100%;
height: 120px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
... ... @@ -325,7 +324,8 @@ export default {
padding-right: 38px;
z-index: 999;
background: #fff;
position: relative;
position: absolute;
z-index: 1;
}
.filter-tab {
... ... @@ -387,8 +387,14 @@ export default {
}
.product-list {
width: 100%;
background: #f5f5f5;
height: calc(100% - 120px);
padding-top: 120px;
box-sizing: border-box;
position: absolute;
z-index: 0;
top: 0;
bottom: 0;
}
.search-img {
... ...
<template>
<div class="product-wrapper">
<ImageFormat :src="data.goodImg" width="90" height="90"></ImageFormat>
<div class="good-image">
<ImageFormat :src="data.goodImg" :width="180" :height="180"></ImageFormat>
</div>
<div class="product-price">
<div class="red">¥{{data.goodPrice}}</div>
<div class="product-name">{{data.productName}}</div>
... ... @@ -30,6 +31,16 @@ export default {
height: 180px;
}
.good-image {
width: 180px;
height: 180px;
overflow: hidden;
img {
width: 100%;
display: block;
}
}
.product-price {
display: inline-block;
vertical-align: top;
... ...
<template>
<div class="product-wrapper">
<ImageFormat :src="data.goodImg" width="120" height="120"></ImageFormat>
<div class="good-image">
<ImageFormat :src="data.goodImg" :width="240" :height="240"></ImageFormat>
</div>
<div class="product-price">
<div class="product-price-wrapper">
<div class="price">{{data.colorName}},{{data.sizeName}}</div>
... ... @@ -33,6 +34,16 @@ export default {
overflow: hidden;
}
.good-image {
width: 240px;
height: 240px;
overflow: hidden;
img {
width: 100%;
display: block;
}
}
.product-price {
display: flex;
height: 100%;
... ...
... ... @@ -3,13 +3,13 @@
:title="$route.params.owner === 'sell' ? '我的出售' : '我的购买订单'"
class="list-page"
>
<status-nav :status="status" :owner="owner" @select="onStatusChange"/>
<status-nav class="order-status-nav" :status="status" :owner="owner" @select="onStatusChange"/>
<div class="content-wrapper">
<scroll
<LayoutScroll
@scroll="scrollHandler"
@pulling-up="fetchData"
@pulling-down="onRefresh"
:options="options"
:data="viewOrderList"
:loading="loadingOptions"
class="order-list-scroll-wrap"
ref="scroll"
>
... ... @@ -48,13 +48,12 @@
tip="这里什么都没有..."
v-show="orderStatus.isShowEmpty"
/>
</scroll>
</LayoutScroll>
</div>
</layout-app>
</template>
<script>
import { Scroll } from 'cube-ui';
import { createNamespacedHelpers } from 'vuex';
import OrderItem from './components/order-item';
... ... @@ -81,7 +80,6 @@ export default {
// 订单操作
mixins: [orderActionMixin, orderInSaleActionMixin],
components: {
Scroll,
OrderItem,
StatusNav,
OrderItemHeader,
... ... @@ -90,6 +88,11 @@ export default {
CountDown,
VideoPlayer
},
data() {
return {
scrollY: 0
}
},
props: {
owner: String,
status: Number
... ... @@ -102,18 +105,16 @@ export default {
viewOrderList() {
return this.orderStatus.orderList;
},
options() {
const options = {
pullUpLoad: this.orderStatus.pullUpLoad,
bounce: !this.orderStatus.isShowEmpty
loadingOptions() {
return {
hide: !this.viewOrderList || !this.viewOrderList.length,
noMore: this.orderStatus.page >= this.orderStatus.pagetotal
};
// if (this.$refs.scroll && this.$refs.scroll.scroll) {
options.pullDownRefresh = this.orderStatus.isShowEmpty
? false
: { txt: '更新成功' };
// }
return options;
}
},
activated() {
if (this.yoho.direction === 'back') {
this.scrollY && this.$refs.scroll.scrollTo(this.scrollY);
}
},
... ... @@ -129,6 +130,9 @@ export default {
methods: {
...mapActions(['fetchOrderList', 'confirmReceipt']),
...mapMutations(['resetData']),
scrollHandler({y}) {
this.scrollY = -y;
},
fetchData() {
this.fetchOrderList({
owner: this.owner,
... ... @@ -170,9 +174,15 @@ export default {
flex-direction: column;
}
.order-status-nav {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.content-wrapper {
flex: 1 0 0;
overflow: hidden;
.footer-wrapper {
display: flex;
... ... @@ -188,6 +198,13 @@ export default {
}
.order-list-scroll-wrap {
width: 100%;
padding-top: 100px;
box-sizing: border-box;
position: absolute;
top: 0;
bottom: 0;
.list-wrapper {
li {
padding: 40px 40px 0;
... ...
... ... @@ -61,10 +61,7 @@ export default {
title: '订单',
classes: {},
scrollOption: {
pullDownRefresh: {
threshold: 70,
stop: 90
},
pullDownRefresh: false,
observeDOM: false,
pullUpLoad: false // 关闭了上拉加载
},
... ... @@ -84,8 +81,6 @@ export default {
...mapState(['productInfo', 'skcs']),
},
beforeRouteLeave(from, to, next) {
console.log('from', from);
console.log('to', to);
this.$refs.modalPrice.hide();
next();
},
... ...
<template>
<div class="size-list">
<cube-scroll ref="sizeselectScroll" :data="viewList">
<cube-scroll ref="sizeselectScroll" class="size-scroll" :data="viewList">
<ul>
<li v-for="(info, idx) in viewList"
:key="idx"
... ... @@ -203,6 +203,7 @@ export default {
.size-list {
overflow: auto;
position: relative;
ul {
padding-bottom: 1px;
... ... @@ -221,6 +222,13 @@ export default {
}
}
.size-scroll {
width: 100%;
position: absolute;
top: 0;
bottom: 0;
}
li {
box-sizing: border-box;
width: 25%; // 当前固定为4列
... ...
... ... @@ -124,20 +124,20 @@
function isWeiXinAndIos() {
// window.navigator.userAgent属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息,这个属性可以用来判断浏览器类型
let ua = '' + window.navigator.userAgent.toLowerCase()
var ua = '' + window.navigator.userAgent.toLowerCase()
// 通过正则表达式匹配ua中是否含有MicroMessenger字符串且是IOS系统
let isIos = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua) // 是IOS系统
var isIos = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(ua) // 是IOS系统
return isIos
}
(function() {
let myFunction
let isWXAndIos = isWeiXinAndIos()
var myFunction
var isWXAndIos = isWeiXinAndIos()
if (isWXAndIos) { // 既是微信浏览器 又是ios============(因为查到只有在微信环境下,ios手机上才会出现input失去焦点的时候页面被顶起)
document.body.addEventListener('focusin', () => { // 软键盘弹起事件
clearTimeout(myFunction);
document.body.addEventListener('focusin', function() { // 软键盘弹起事件
clearTimeout(myFunction);
});
document.body.addEventListener('focusout', () => { // 软键盘关闭事件
document.body.addEventListener('focusout', function() { // 软键盘关闭事件
clearTimeout(myFunction)
myFunction = setTimeout(function() {
window.scrollTo({top: 0, left: 0, behavior: 'smooth'})// 重点 =======当键盘收起的时候让页面回到原始位置
... ... @@ -145,6 +145,8 @@
});
}
})();
window.appBaseLogs = {events: [{}]};
}, 500);
</script>
... ...