Authored by yyq

Merge branch 'master' of git.yoho.cn:fe/yoho-community-web

... ... @@ -574,6 +574,28 @@ const yoho = {
// tip(tipInfo);
}
},
// 跳商品详情页
goProductDetail(skn) {
var url = window.location.protocol + '//m.yohobuy.com/';
console.log(url);
if (this.isYohoBuy && window.yohoInterface) {
url = url + '?openby:yohobuy=' + JSON.stringify({
action: 'go.productDetail',
params: {product_skn: skn}
});
if ($appLink) {
$appLink.href = url;
$appLink.click();
}
} else {
url = url + 'product/' + skn + '.html';
window.open(url);
}
}
};
... ...
... ... @@ -4,7 +4,7 @@ import Layouts from './layouts';
import Products from './products';
import Comments from './comments';
import YohoActionSheet from './action-sheet';
import TextEllipsis from './textellipsis'
import TextEllipsis from './textellipsis';
export default [
...Widgets,
... ...
... ... @@ -13,7 +13,7 @@
</div>
<div
class="btn-fav hover-opacity"
@click="onFav"
@click.stop="onFav"
:class="favClass">{{favText}}</div>
</div>
</template>
... ... @@ -76,7 +76,7 @@ export default {
}
},
onClick() {
console.log('click');
this.product.product_skn && this.$yoho.goProductDetail(this.product.product_skn);
}
}
};
... ...
<template>
<div v-if="topic" class="topic-wrap">
<div v-if="topic" class="topic-wrap" @click="onClick">
<div class="topic-icon">
<span class="iconfont icon-tag"></span>
</div>
... ... @@ -12,6 +12,11 @@ export default {
name: 'WidgetTopic',
props: {
topic: String,
},
methods: {
onClick() {
this.$emit('click');
}
}
};
</script>
... ...
... ... @@ -123,7 +123,18 @@ export default {
}
},
onExpand(params) {
this.$refs.actionSheet.show(params);
const toast = this.$createToast({
time: 0,
txt: '加载中',
mask: true,
type: 'loading'
});
toast.show();
this.$refs.actionSheet.show(params).then(() => {
toast.hide();
});
}
},
components: {
... ...
<template>
<Scroll ref="scroll" class="scroll-wrapper" :options="scrollOpts" :scrollEvents="['scroll']" @scroll="onScroll">
<div class="scroll-wrapper">
<Author v-if="articleDetail" :data="articleDetail.getAuthor"></Author>
<div class="post-content" v-if="articleDetail">
... ... @@ -40,7 +41,7 @@
<Recommend v-if="articleDetail && articleDetail.getRecommendProducts.length > 0">
<RecommendProductList :list="articleDetail.getRecommendProducts"></RecommendProductList>
</Recommend>
</Scroll>
</div>
</template>
<script>
... ...
... ... @@ -84,6 +84,8 @@ export default {
.body {
flex: 1;
overflow: auto;
-webkit-overflow-scrolling: touch
}
.footer {
... ...
<template>
<div class="article-footer-wrapper">
<div class="tool-bar">
<WidgetIconBtn class="item" type="fav" :text="praiseCount" :option="option" @click="onZanClick"></WidgetIconBtn>
<WidgetIconBtn class="item" type="star" :text="favoriteCount" :option="option" @click="onFavClick"></WidgetIconBtn>
<WidgetIconBtn class="item" type="msg" :text="commentCount" :option="option" @click="onComment"></WidgetIconBtn>
<WidgetIconBtn class="item" type="fav" :text="praiseCount" :option="optionPraise" @click="onZanClick"></WidgetIconBtn>
<WidgetIconBtn class="item" type="star" :text="favoriteCount" :option="optionFav" @click="onFavClick"></WidgetIconBtn>
<WidgetIconBtn class="item" type="msg" :text="commentCount" :option="optionComment" @click="onComment"></WidgetIconBtn>
</div>
<div class="close ml20" @click="onClose">收起</div>
</div>
... ... @@ -16,9 +16,17 @@ export default {
props: ['favoriteCount', 'praiseCount', 'commentCount', 'hasFavor', 'hasPraise'],
data() {
return {
option: {
emitName: 'click'
}
optionPraise: {
emitName: 'click',
selected: this.hasPraise === 'Y'
},
optionFav: {
emitName: 'click',
selected: this.hasFavor === 'Y'
},
optionComment: {
emitName: 'click',
},
};
},
computed: {
... ...
<template>
<div>
<WidgetTopic v-for="(i, index) in list" :topic="i.name" :key="index"></WidgetTopic>
<WidgetTopic v-for="(i, index) in list" :topic="i.name" :key="index" @click="onClick"></WidgetTopic>
</div>
</template>
<script>
export default {
name: 'TagBar',
props: ['list']
props: ['list'],
methods: {
onClick() {
console.log('click');
}
}
};
</script>
<style scoped>
<style :lang="scss" scoped>
</style>
... ...
... ... @@ -256,7 +256,7 @@ function processProductList(list, favsList) {
// fav
const fav = favsList.find(i => i.id === product.product_id);
product.productId = product.product_id;
product.id = product.product_id;
product.productType = 1;
product.favorite = fav || false;
... ...