Authored by 王水玲

Merge remote-tracking branch 'origin/master' into feature/fashion-detail

... ... @@ -4,6 +4,9 @@
:name="`route-view-${yoho.direction}`">
<router-view></router-view>
</transition>
<div class="fps" v-if="showFps">
{{fps}}
</div>
</div>
</template>
... ... @@ -12,16 +15,45 @@ import {mapState} from 'vuex';
export default {
name: 'App',
data() {
return {
showFps: false,
fpsTick: 0,
fps: 0
};
},
computed: {
...mapState(['yoho'])
},
mounted() {
if (process.env.NODE_ENV === 'development') {
this.showFps = true;
this.frameCallback();
}
if (this.yoho.context.needLogin) {
this.$yoho.ready(() => {
this.$sdk.goLogin();
});
}
},
methods: {
frameCallback() {
window.requestAnimationFrame(() => {
const now = Date.now();
if (!this.time) {
this.time = now;
}
if (now - this.time >= 1000) {
this.time = now;
this.fps = this.fpsTick;
this.fpsTick = 0;
}
this.fpsTick++;
this.frameCallback();
});
}
},
watch: {
'yoho.context.needLogin': function(newVal) {
if (newVal) {
... ... @@ -72,4 +104,15 @@ export default {
transform: translate3d(100%, 0, 0);
z-index: 2;
}
.fps {
position: absolute;
z-index: 99;
left: 0;
top: 0;
width: 20PX;
height: 20PX;
background-color: white;
color: black;
}
</style>
... ...
... ... @@ -91,14 +91,14 @@ export default {
.product-name {
font-size: 24px;
color: #9b9b9b;
letter-spacing: -0.25px;
letter-spacing: -0.25PX;
height: 104px;
}
.price {
font-size: 32px;
color: #d0021b;
letter-spacing: -0.34px;
letter-spacing: -0.34PX;
}
}
... ...
... ... @@ -45,7 +45,7 @@
type: String,
default: 'fav'
},
text: String,
text: [String, Number],
option: {
type: Object,
default() {
... ... @@ -88,12 +88,16 @@
textStyle() {
let style = `font-size: ${pxToRem(this.option.textFontSize || defaultOption.textFontSize)};`;
if (['top', 'bottom'].indexOf(this.option.textAlign) >= 0) {
style += ` vertical-align: ${this.option.textAlign};`;
let textAlign = this.option.textAlign || defaultOption.textAlign;
if (['top', 'bottom'].indexOf(textAlign) >= 0) {
style += ` vertical-align: ${textAlign};`;
}
if (Number(this.option.textZoom) !== NaN) {
style += `transform: scale(${this.option.textZoom}, ${this.option.textZoom});`
let textZoom = this.option.textZoom || defaultOption.textAlign;
if (Number(textZoom) !== NaN) {
style += `transform: scale(${textZoom}, ${textZoom});`
}
return style;
... ...
<template>
<Layout>
<Layout class="article-page">
<LayoutHeader slot='header' title="推荐" :share="shareData">
<i class="iconfont icon-share-blod" slot="opts"></i>
</LayoutHeader>
... ... @@ -71,4 +71,7 @@ export default {
</script>
<style lang="scss" scoped>
.article-page {
background-color: #f0f0f0;
}
</style>
... ...
... ... @@ -5,11 +5,11 @@
<span class="comment-content">{{comment.content}}</span>
</p>
<div class="total-comment">
<div class="total">查看{{count}}条评论</div>
<div class="last-time">1天前</div>
<div class="total hover-opacity">查看{{count}}条评论</div>
<div class="last-time">{{date}}</div>
</div>
<div class="comment">
<CubeInput placeholder='添加回复:赞美是一种美德'></CubeInput>
<div class="comment-input hover-opacity">添加回复:赞美是一种美德</div>
</div>
</div>
</template>
... ... @@ -28,6 +28,10 @@ export default {
count: {
type: Number,
default: 0
},
date: {
type: String,
default: 0
}
},
components: {CubeInput: Input}
... ... @@ -36,17 +40,47 @@ export default {
<style lang="scss" scoped>
.article-item-comment {
padding: 30px;
padding: 36px 30px;
.comment-item {
font-size: 24px;
color: #4a4a4a;
letter-spacing: 0.06px;
line-height: 40px;
letter-spacing: 0.06PX;
line-height: 36px;
}
.user-name {
font-weight: bold;
}
.total-comment {
padding-top: 30px;
display: flex;
font-size: 24px;
color: #b0b0b0;
letter-spacing: 0.06px;
.total {
width: 50%;
}
.last-time {
width: 50%;
text-align: right;
}
}
.comment {
padding-top: 30px;
.comment-input {
padding: 0 20px;
background: #f0f0f0;
height: 60px;
line-height: 60px;
color: #b0b0b0;
font-size: 24px;
}
}
}
</style>
... ...
... ... @@ -5,17 +5,14 @@
<span class="name">Oscar</span>
</div>
<div class="opts">
<Button class="btn-follow">关注</Button>
<div class="btn-follow hover-opacity">关注</div>
</div>
</div>
</template>
<script>
import {Button} from 'cube-ui';
export default {
name: 'ArticleItemHeader',
components: {Button}
};
</script>
... ... @@ -58,6 +55,11 @@ export default {
padding: 0;
font-size: 26px;
border-radius: 0;
background-color: #222;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
}
}
</style>
... ...
<template>
<div class="article-item-intro">
<div class="intro">
Nike 旗下大热鞋款 Air Max 95 一直以来在街头造型当中的能见度都算高,凭藉其舒适脚感与百搭外型 Air Max 95 也轻松成为许多鞋迷的心头好。近日,<span class="expand">…展开</span>
<div class="intro hover-opacity" :class="{'intro-expand': isExpand}" @click="onExpand">
{{intro}}<span class="expand" v-if="!isExpand">…展开</span>
<span class="expand collapse" v-else>收起</span>
</div>
<div class="widgets">
<div class="topic">
<WidgetTopic></WidgetTopic>
<WidgetTopic topic="种草"></WidgetTopic>
</div>
<div class="opts">
<WidgetLike></WidgetLike>
<WidgetFav></WidgetFav>
<WidgetShare></WidgetShare>
<WidgetLike num="91"></WidgetLike>
<WidgetFav num="99"></WidgetFav>
<WidgetShare num="1"></WidgetShare>
</div>
</div>
</div>
... ... @@ -18,7 +19,35 @@
<script>
export default {
name: 'ArticleItemIntro'
name: 'ArticleItemIntro',
props: {
data: {
type: Object,
default() {
return {};
}
}
},
data() {
return {
isExpand: false
};
},
computed: {
intro() {
if (this.isExpand) {
return this.data.intro;
}
if (this.data.intro.length > 66) {
return this.data.intro.substring(0, 66);
}
}
},
methods: {
onExpand() {
this.isExpand = !this.isExpand;
}
}
};
</script>
... ... @@ -30,20 +59,56 @@ export default {
.intro {
font-size: 28px;
color: #4a4a4a;
letter-spacing: 0.06px;
letter-spacing: 0.06PX;
overflow: hidden;
display: -webkit-box;
text-overflow: ellipsis;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
position: relative;
line-height: 40px;
&.intro-expand {
padding-bottom: 40px;
overflow: initial;
display: block;
}
}
.expand {
font-size: 28px;
color: #000;
letter-spacing: 0.06PX;
line-height: 20px;
font-weight: bold;
&.collapse {
position: absolute;
right: 14px;
bottom: 0;
height: 28px;
}
}
}
.widgets {
width: 100%;
display: flex;
margin-top: 40px;
.topic {
text-align: left;
width: 200px;
}
.opts {
text-align: right;
flex: 1;
& /deep/ .icon-btn {
margin-left: 48px;
text-align: right;
}
}
}
</style>
... ...
... ... @@ -4,7 +4,7 @@
<ArticleItemSlide :data="slideData"></ArticleItemSlide>
<ProductGroup :data="productListData"></ProductGroup>
<ArticleItemIntro :data="introData"></ArticleItemIntro>
<ArticleItemComment :comments="commentData"></ArticleItemComment>
<ArticleItemComment :comments="commentData" :count="12" :date="'1天前'"></ArticleItemComment>
</div>
</template>
... ... @@ -32,12 +32,14 @@ export default {
},
introData() {
return {
intro: '旗下大热鞋款旗下大热鞋款旗下大热鞋款一直以来在街头造型当中的能见度都算高,凭藉其舒适脚感与百搭外型旗下大热鞋款也轻松成为许多鞋迷的心头好。近日,旗下大热鞋款旗下大热鞋款 Air Max 95 一直以来在街头造型当中的能见度都算高,凭藉其舒适脚感与百搭外型 Air Max 95 也轻松成为许多鞋迷的心头好。近日'
};
},
commentData() {
return [{
name: 'NIKE后援团',
content: '好期待,一定要抢一双👟!'
content: '好期待,一定要抢一双👟!',
}, {
name: 'NIKE后援团',
content: '表情表情!!!这双仔细看好好看!!哈哈哈哈哈哈😄✌️'
... ... @@ -69,6 +71,7 @@ export default {
<style lang="scss" scoped>
.article-item {
width: 100%;
margin-bottom: 20px;
background-color: #fff;
}
</style>
... ...
<template>
<YohoActionSheet ref="actionSheet" :full="true">
<div class="content">
<!--<template v-if="list.length === 0">-->
<!--<Loading class="loading" :size="50"></Loading>-->
<!--</template>-->
<CommentScrollView ref="commentList"></CommentScrollView>
</div>
</YohoActionSheet>
</template>
<script>
import {Loading} from 'cube-ui';
import CommentScrollView from './comment-scroll-view';
export default {
name: 'CommentActionSheetPage',
components: {
Loading,
CommentScrollView
},
data() {
return {
};
},
methods: {
click() {
this.$refs.actionSheet.show();
this.$refs.commentList.click();
}
}
};
</script>
<style>
.content {
width: 100%;
height: 80vh;
background-color: white;
}
.loading {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
</style>
... ...
<template>
<div class="comment-scroll-view">
<div class="header">{{ count }}评论
</div>
<Scroll class="scroll-wrapper" ref="scroll" :options="scrollOptions">
<div v-for="i in list" class="item">huangtao {{i}}</div>
</Scroll>
<div class="footer">
<div class="input">评论</div>
</div>
</div>
</template>
<script>
import {Scroll} from 'cube-ui';
export default {
name: 'CommentScrollView',
components: {
Scroll
},
data() {
return {
list: [],
scrollOptions: {
bounce: false
}
};
},
computed: {
count() {
return this.list.length > 0 ? this.list.length + '条' : '';
}
},
methods: {
click() {
this.$nextTick(() => {
this.initData();
this.forceUpdate();
}, 1000);
},
forceUpdate() {
this.$refs.scroll.forceUpdate();
},
initData() {
console.log('click')
for (let i = 0; i < 100; i++) {
this.list.push(i);
}
}
}
};
</script>
<style lang="scss" scoped>
.comment-scroll-view {
display: flex;
flex-direction: column;
width: 100%;
height: 100%;
}
.header {
width: 100%;
height: 88px;
border-bottom: 2px solid #e0e0e0;
text-align: center;
line-height: 88px;
font-size: 32px;
}
.scroll-wrapper {
flex: 1;
}
.item {
background-color: white;
}
.footer {
width: 100%;
height: 100px;
border-top: 2px solid #e0e0e0;
display: flex;
justify-content: center;
align-items: center;
}
.input {
width: 690px;
height: 72px;
background-color: #f0f0f0;
border: 1px solid #e0e0e0;
border-radius: 8px;
font-size: 24px;
color: #b0b0b0;
padding: 18px 0 18px 22px;
}
</style>
... ...
... ... @@ -10,8 +10,8 @@
<Products></Products>
</div>
<div class="share">
<WidgetIconBtn type="msg"></WidgetIconBtn>
<WidgetIconBtn type="zan"></WidgetIconBtn>
<WidgetIconBtn class="item" type="msg" text="100" :option="option" @click="onCommentClick"></WidgetIconBtn>
<WidgetIconBtn class="item" type="fav" text="100" :option="option" @click="onFavClick"></WidgetIconBtn>
</div>
</div>
</div>
... ... @@ -29,13 +29,23 @@ export default {
data() {
return {
text: '很好,能抢到真的不容易!整体感觉很舒服,庆幸下手一定要快准狠!如果能够再抢到一双就更好了,下次加买很多双,很好,能抢到真的不容易!整体感觉很舒服,庆幸下手一定要快准狠!如果能够再抢到一双就更好了,下次加买很多双',
isLimitHeight: true
isLimitHeight: true,
option: {
emitName: 'click',
color: 'white'
}
};
},
methods: {
onClick() {
console.log('展开');
this.isLimitHeight = false;
},
onCommentClick() {
this.$emit('on-comment-click', {});
},
onFavClick() {
this.$emit('on-favorite-click', {});
}
},
};
... ... @@ -53,11 +63,13 @@ export default {
min-height: 134px;
font-size: 26px;
color: white;
letter-spacing: 0.01px;
letter-spacing: 0.01PX;
padding: 30px 28px 0 28px;
}
.product-wrapper {
display: flex;
justify-content: space-between;
height: 166px;
padding: 0 28px;
}
... ... @@ -72,4 +84,13 @@ export default {
.link {
color: #4a90e2;
}
.share {
height: 100px;
margin-top: 86px;
}
.item {
margin-left: 50px;
}
</style>
... ...
<template>
<div class="order-wrapper">
<!-- <Test class="test"></Test> -->
<Slide :data="list"
:loop="false"
:autoPlay="false"
... ... @@ -24,7 +23,7 @@
<AvatarHeader class="avatar-wrapper"></AvatarHeader>
<DescFooter class="footer-wrapper"></DescFooter>
<DescFooter class="footer-wrapper" @on-comment-click="onCommentClick"></DescFooter>
</div>
</template>
... ... @@ -34,15 +33,13 @@ import {Slide} from 'cube-ui';
import AvatarHeader from './avatar-header';
import DescFooter from './desc-footer';
// const img = require('statics/image/showorder/test.png')
export default {
name: 'ShowOrderItem',
components: {
AvatarHeader,
DescFooter,
Slide,
SlideItem: Slide.Item
SlideItem: Slide.Item,
},
data() {
return {
... ... @@ -70,6 +67,9 @@ export default {
},
slideChangeHandler(currentPageIndex) {
this.currentPageIndex = currentPageIndex;
},
onCommentClick() {
this.$emit('on-comment-click', {});
}
}
};
... ...
export default [{
path: '/order/:id',
name: 'order',
path: '/mapp/showorder/:id',
name: 'showorder',
component: () => import(/* webpackChunkName: "order" */ './order')
}];
... ...
... ... @@ -13,9 +13,11 @@
:options="scrollOpts"
>
<SlideItem v-for="i in list">
<OrderSlideItem></OrderSlideItem>
<OrderSlideItem @on-comment-click="onComment"></OrderSlideItem>
</SlideItem>
</Slide>
<CommentActionSheet ref="actionsheet"></CommentActionSheet>
</Layout>
</template>
... ... @@ -23,6 +25,7 @@
import {Slide} from 'cube-ui';
import OrderSlideItem from './components/order-slide-item';
import CommentActionSheet from './components/comment-action-sheet';
export default {
name: 'ShowOrderPage',
... ... @@ -30,6 +33,7 @@ export default {
Slide,
SlideItem: Slide.Item,
OrderSlideItem,
CommentActionSheet
},
data() {
return {
... ... @@ -71,6 +75,10 @@ export default {
},
clickHandler(e) {
console.log(e);
},
onComment() {
console.log('ok');
this.$refs.actionsheet.click();
}
}
};
... ...
... ... @@ -679,3 +679,9 @@ img[lazy=loaded] {
display: flex;
align-items: center;
}
.hover-opacity {
&:active {
opacity: 0.8;
}
}
\ No newline at end of file
... ...