Authored by 陈峰

Merge branch 'feature/grassV2' into 'release/6.8.7'

Feature/grass v2



See merge request !13
... ... @@ -10,9 +10,7 @@
:name="`route-view-${yoho.direction}`">
<router-view v-if="!$route.meta.keepAlive"></router-view>
</transition>
<div class="fps" v-if="showFps">
{{fps}}
</div>
<div id="fps" class="fps" v-if="showFps"></div>
</div>
</template>
... ... @@ -52,7 +50,7 @@ export default {
}
if (now - this.time >= 1000) {
this.time = now;
this.fps = this.fpsTick;
document.getElementById('fps').innerText = this.fpsTick;
this.fpsTick = 0;
}
this.fpsTick++;
... ...
<template>
<div v-transfer-dom :data-transfer="transfer">
<div v-transfer-dom :data-transfer="transfer" :class="actionCls">
<transition name="action-sheet-mask">
<div class="yoho-popup-mask" @click="maskClick" v-if="mask && isVisible"></div>
</transition>
<transition name="action-sheet-move">
<div class="yoho-popup" :class="actionCls" v-show="isVisible" :style="{'z-index': zIndex}">
<div class="yoho-popup-container">
<div class="yoho-popup-content">
<div class="detail">
<slot></slot>
</div>
</div>
<div class="yoho-popup" v-show="isVisible" :style="{'z-index': zIndex}">
<div class="yoho-popup-container" :style="{'max-height': maxHeight + 'px', 'height': contentHeight}">
<slot></slot>
</div>
</div>
</transition>
... ... @@ -46,9 +42,11 @@ export default {
data() {
return {
isVisible: false,
maxHeight: 0
};
},
mounted() {
this.maxHeight = document.body.offsetHeight;
this.$watch('visible', (newVal) => {
if (newVal) {
this.show();
... ... @@ -62,6 +60,9 @@ export default {
computed: {
actionCls() {
return [{ 'yoho-action-sheet': this.full }];
},
contentHeight() {
return this.full ? `${this.maxHeight - 20}px` : 'auto';
}
},
methods: {
... ... @@ -98,7 +99,7 @@ export default {
}
.action-sheet-move-enter-active {
transition: all 0.3s cubic-bezier(.43,.35,0,1.14);
transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.action-sheet-move-leave-active {
... ... @@ -111,54 +112,56 @@ export default {
}
.action-sheet-mask-enter-active {
transition: opacity .3s linear;
transition: opacity 0.3s linear;
}
.action-sheet-mask-leave-active {
transition: opacity .1s linear;
transition: opacity 0.1s linear;
}
.yoho-popup-mask {
display: block;
background: #ccc;
position: absolute;
z-index: 99;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.5);
}
.yoho-popup {
width: 100%;
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
.yoho-popup-container {
border-radius: 8PX 8PX 0 0;
z-index: 2;
background-color: #fff;
position: relative;
opacity: 1;
}
&:after {
content: "";
width: 100%;
height: 200px;
position: absolute;
top: 20PX;
left: 0;
right: 0;
bottom: 0;
background-color: #fff;
overflow: hidden;
bottom: -200px;
z-index: -1;
background: #fff;
}
}
.yoho-action-sheet {
.yoho-popup-content {
height: 100%;
.yoho-popup-mask {
background-color: #f5f5f5;
}
}
.detail {
position: relative;
width: 100%;
height: 100%;
.yoho-popup-container {
border-radius: 15PX 15PX 0 0;
overflow: hidden;
}
}
</style>
... ...
... ... @@ -150,6 +150,7 @@ export default {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #fff;
display: flex;
flex-direction: column;
... ...
... ... @@ -21,6 +21,11 @@ export default {
posId: Number,
articleId: Number
},
data() {
return {
posting: false
};
},
methods: {
...mapActions(['postComment']),
...articleMapActions(['fetchArticleUpdate']),
... ... @@ -56,6 +61,10 @@ export default {
}
},
async comment(content) {
if (this.posting) {
return;
}
this.posting = true;
const result = await this.postComment({
content: content,
destId: this.addType === 0 ? this.destId : void 0,
... ... @@ -64,6 +73,7 @@ export default {
columnType: this.columnType
});
this.posting = false;
if (result.code === 200) {
const waitData = this.addType === 0 ? this.fetchArticleUpdate({articleId: this.destId}) : Promise.resolve();
... ...
<template>
<Layout>
<Layout style="background: none;">
<LayoutHeader :back="!popup" theme="white" slot='header'>
{{headerText}}
<template v-slot:opts v-if="popup">
... ...
... ... @@ -18,6 +18,12 @@ export default {
resize(index) {
this.$refs.scroll.resize(index);
},
unlockHight(params) {
this.$refs.scroll.unlockHight(params);
},
delete(params) {
this.$refs.scroll.delete(params);
},
init() {
this.$refs.scroll.init();
}
... ...
<template>
<div class="cube-recycle-list">
<div class="cube-recycle-list-main">
<div class="cube-recycle-list-items" :style="{height: heights + 'px'}">
<div ref="items" class="cube-recycle-list-items">
<div
v-for="(item, index) in visibleItems"
:key="index"
v-for="item in visibleItems"
:key="item.index"
class="cube-recycle-list-item"
:class="thumbClass"
:ref="'loads'+index"
:style="getItemStyle(item, index)"
>
<div
v-if="infinite"
:class="{'cube-recycle-list-transition': infinite}"
:style="{opacity: +!item.loaded}"
>
<slot name="tombstone"></slot>
</div>
<div
v-if="!item.placeholder"
:class="{'cube-recycle-list-transition': infinite}"
:style="{opacity: item.loaded}"
>
<slot name="item" :data="{data: item.data, index}"></slot>
:ref="'loads'+item.index"
:style="getItemStyle(item)">
<div v-if="!item.placeholder || !item.height">
<slot name="item" :data="item"></slot>
</div>
</div>
</div>
<div
v-if="!infinite"
class="cube-recycle-list-loading">
<div class="cube-recycle-list-loading">
<slot name="spinner">
<div class="cube-recycle-list-loading-content" v-show="!noMore" :style="{visibility: loadings.length ? 'visible' : 'hidden'}">
<cube-loading class="spinner"></cube-loading>
... ... @@ -54,7 +40,6 @@ export default {
data() {
return {
items: [],
list: [],
heights: this.thumbs.length ? 1000 : 0,
startIndex: 0,
currentIndex: 0,
... ... @@ -91,14 +76,19 @@ export default {
computed: {
visibleItems() {
if (this.thumbsList.length) {
return this.thumbsList.map(item => {
return {
data: item
};
}).concat(this.items.slice(this.thumbsList.length, this.items.length));
return this.thumbItems.concat(this.items.slice(this.thumbsList.length, this.items.length));
}
return this.items;
},
thumbItems() {
return this.thumbsList.map((item, index) => {
return {
data: item,
isThumb: true,
index
};
});
},
tombHeight() {
return this.infinite ? this.$refs.tomb && this.$refs.tomb.offsetHeight : 0;
},
... ... @@ -114,21 +104,6 @@ export default {
};
}
},
watch: {
list(newV) {
if (newV.length) {
this.loadings.pop();
if (!this.loadings.length) {
this.loadItems();
}
}
},
items(newV) {
if (newV.length > this.list.length) {
this.getItems();
}
}
},
mounted() {
this.scrollEvent = throttle(this._onScroll.bind(this), 100);
let supportsPassive = false;
... ... @@ -153,71 +128,68 @@ export default {
init() {
this.load(true);
},
getItemStyle(item, index) {
getItemStyle(item) {
const style = {};
if (!this.isThumb) {
style.transform = `translate3d(0, ${item.top}px, 0)`;
}
if (item.placeholder) {
if (item.height) {
if (!item.unlockHight) {
style.height = `${item.height}px`;
}
} else if (item.willchange) {
style.transition = 'height 300ms cubic-bezier(0.165, 0.84, 0.44, 1)';
style['will-change'] = 'height';
style.height = `${item.height}px`;
} else {
style['z-index'] = this.visibleItems.length - index;
}
if (!item.height && !this.isThumb) {
style.opacity = 0;
} else if (!item.isThumb) {
style.position = 'absolute';
style.top = `${-1000}px`;
style.visibility = 'hidden';
}
return style;
},
load(reload) {
if (this.infinite) {
// increase capacity of items to display tombstone
this.items.length += this.size;
this.loadItems();
} else if ((!this.loadings.length && !this.noMore) || reload) {
if ((!this.loadings.length && !this.noMore) || reload) {
this.getItems(reload);
}
},
getItems(reload) {
if (reload) {
this.noMore = false;
this.list = [];
this.items = [];
}
this.loadings.push('pending');
this.onFetch().then((res) => {
/* istanbul ignore if */
if (!res) {
this.noMore = true;
this.loadings.pop();
} else {
this.list = this.list.concat(res);
this.loadItems(res);
}
});
},
async loadItems() {
let end = this.infinite ? this.items.length : this.list.length;
let item;
async loadItems(list) {
const lastItem = this.items[this.items.length - 1];
const start = lastItem ? lastItem.index + 1 : 0;
for (let i = this.items.length; i < end; i++) {
item = this.items[i];
/* istanbul ignore if */
if (item && item.loaded) {
continue;
}
await this.loadItem(i);
for (let i = 0; i < list.length; i++) {
await this.loadItem(i + start, list[i]);
}
if (this.loadings.length) {
this.loadings.pop();
}
if (this.thumbsList.length) {
this.thumbsList = [];
}
},
loadItem(i) {
loadItem(i, item) {
return new Promise(r => {
this.setItem(i, this.list[i]);
const insertIndex = this.setItem(i, item);
this.$nextTick(() => {
this.updateItemHeight(i);
r();
setTimeout(() => {
this.updateItemHeight(insertIndex);
r();
}, 100);
});
});
},
... ... @@ -226,14 +198,18 @@ export default {
this.thumbsList[index] = data;
this.thumbsList = this.thumbsList.map(item => item);
}
this.$set(this.items, index, {
const insertIndex = this.items.length;
this.$set(this.items, insertIndex, {
data: data || {},
height: 0,
top: -1000,
isTombstone: !data,
loaded: data ? 1 : 0,
placeholder: false
placeholder: false,
unlockHight: false,
willchange: false,
index
});
return insertIndex;
},
updateItemHeight(index, resize) {
if (index === 0 && !resize) {
... ... @@ -243,7 +219,7 @@ export default {
// update item height
let increHeight = 0;
let cur = this.items[index];
let dom = this.$refs[`loads${index}`];
let dom = this.$refs[`loads${cur.index}`];
try {
if (dom && dom[0]) {
... ... @@ -266,18 +242,8 @@ export default {
return increHeight;
},
updateItemTop(startIndex, increHeight) {
// loop all items to update item top and list height
for (let i = startIndex; i < this.items.length; i++) {
let pre = this.items[i - 1];
this.items[i].top = pre ? pre.top + pre.height : 0;
}
this.heights += increHeight;
},
updateIndex() {
// update visible items start index
let top = this.$el.scrollTop;
updateIndex(scrollTop) {
let top = scrollTop;
let hasTopItem = false;
for (let i = 0; i < this.items.length; i++) {
... ... @@ -292,26 +258,65 @@ export default {
}
}
if (hasTopItem) {
this.currentIndex = this.startIndex;
this.currentIndex = this.items[this.startIndex].index;
} else {
this.currentIndex = this.items.length - 1;
this.currentIndex = this.items[this.items.length - 1].index;
}
},
_onScroll() {
const scrollTop = this.$el.scrollTop;
const heights = this.$refs.items.offsetHeight;
// trigger load
if (scrollTop + this.$el.offsetHeight > this.heights - this.offset) {
if (scrollTop + this.$el.offsetHeight > heights - this.offset) {
this.load();
}
this.updateIndex();
this.updateIndex(scrollTop);
this.$emit('scroll', {scrollTop, startIndex: this.currentIndex, item: this.items[this.currentIndex]});
},
resize(index) {
const increHeight = this.updateItemHeight(index, true);
findItemIndex(itemIndex) {
return this.items.findIndex(item => item.index === itemIndex);
},
resize(itemIndex) {
const findItemIndex = this.findItemIndex(itemIndex);
if (findItemIndex >= 0) {
this.updateItemHeight(findItemIndex, true);
}
},
delete(itemIndex) {
const findItemIndex = this.findItemIndex(itemIndex);
if (findItemIndex >= 0) {
this.items[findItemIndex].willchange = true;
let dom = this.$refs[`loads${itemIndex}`];
dom && dom[0].addEventListener('transitionend', () => {
this.items.splice(findItemIndex, 1);
this._onScroll();
}, {
once: true
});
this.$nextTick(() => {
this.items[findItemIndex].height = 0;
});
}
},
unlockHight({index, promise}) {
const findItemIndex = this.findItemIndex(index);
this.updateItemTop(index, increHeight);
if (findItemIndex >= 0) {
const cur = this.items[findItemIndex];
if (cur) {
cur.unlockHight = true;
promise.then(() => {
this.updateItemHeight(findItemIndex, true);
cur.unlockHight = false;
});
}
}
}
},
components: {
... ... @@ -336,7 +341,6 @@ export default {
visibility: hidden
.cube-recycle-list-item
width: 100%
position: absolute
box-sizing: border-box
&.thumb
position relative
... ...
... ... @@ -6,13 +6,15 @@
<ImageFormat :lazy="lazy" class="product-image" :src="product.productImage" :width="136" :height="180"></ImageFormat>
<div class="product-info">
<p class="product-name">{{product.productName}}</p>
<p class="price">¥{{product.salesPrice}}</p>
<div class="price">
¥{{product.salesPrice}}
<AuthComponent
class="btn-fav hover-opacity"
@click="onFav"
:class="favClass">{{favText}}</AuthComponent>
</div>
</div>
</div>
<AuthComponent
class="btn-fav hover-opacity"
@click="onFav"
:class="favClass">{{favText}}</AuthComponent>
</div>
</template>
... ... @@ -163,7 +165,6 @@ export default {
<style lang="scss" scoped>
.product-item {
position: relative;
margin-top: 20px;
margin-right: 20px;
margin-left: 30px;
... ... @@ -217,9 +218,8 @@ export default {
}
.btn-fav {
position: absolute;
bottom: 20px;
right: -20px;
float: right;
margin-right: -40px;
width: 120px;
height: 50px;
padding: 0;
... ...
... ... @@ -2,6 +2,7 @@
<Article
ref="article"
type="article"
:no-header="true"
:thumbs="articleThumbList"
share
:on-fetch="onFetch">
... ...
... ... @@ -25,7 +25,7 @@
:pos-id="posId"
:column-type="1001"
@on-comment="onComment">
添加回复:赞美是一种美德
添加评论
</CommentPlaceholder>
</div>
<div class="total-comment">
... ... @@ -61,7 +61,7 @@ export default {
},
invisibleClass() {
return {
invisible: this.thumb
invisible: this.thumb || (this.articleState.commentCount < 2)
};
},
},
... ...
... ... @@ -41,18 +41,7 @@ export default {
},
methods: {
onMore() {
this.$createActionSheet({
data: [{
content: '投诉'
}],
onSelect: () => {
this.$createToast({
txt: '投诉成功',
type: 'correct',
time: 1000
}).show();
}
}).show();
this.$emit('on-show-more');
},
toUserPage() {
if (this.share) {
... ...
... ... @@ -119,7 +119,7 @@ export default {
methods: {
...mapMutations(['CHANGE_ARTICLE_LIST_INTRO_HEIGHT', 'CHANGE_ARTICLE_LIST_INTRO']),
init() {
if (this.data.introHeight === 0) {
if (this.data.introHeight === 0 && this.isEllipsis) {
this.CHANGE_ARTICLE_LIST_INTRO_HEIGHT({
articleId: this.data.articleId,
introHeight: get(this.$refs, 'introPool.scrollHeight', 0) + 20,
... ... @@ -148,10 +148,12 @@ export default {
this.reportLabel(labelId);
},
onShare() {
let title = `@${this.data.authorName} 在有货逛上发了一篇笔记,快点开看看!`;
this.$yoho.share({
title: '逛',
title,
imgUrl: this.data.shareImage,
link: `${location.origin}/grass/article/share/${this.data.articleId}`,
link: `${location.origin}/grass/article/share/${this.data.articleId}?share_title=${encodeURIComponent(title)}`,
desc: this.data.intro,
hideType: ['7', '8', '9']
});
... ... @@ -205,7 +207,6 @@ export default {
margin-top: 20px;
.intro {
touch-action: none;
font-size: 28px;
color: #4a4a4a;
letter-spacing: 0.06PX;
... ...
... ... @@ -13,8 +13,8 @@
</span>
</template>
</Slide>
<div class="pages">
{{slideIndex}}<span class="small">/{{data.blockList.length}}</span>
<div class="pages" v-if="data.blockList.length > 1">
{{slideIndex}}<span>/</span>{{data.blockList.length}}
</div>
</div>
</template>
... ... @@ -168,16 +168,13 @@ export default {
height: 54px;
background: rgba($color: #000, $alpha: 0.5);
border-radius: 0 0 0 30px;
padding-left: 6px;
color: #fff;
font-size: 28px;
font-size: 24px;
box-sizing: border-box;
display: flex;
line-height: 24px;
justify-content: center;
align-items: center;
.small {
transform: scale(0.7);
padding-top: 3PX;
}
}
</style>
... ...
<template>
<div class="article-item">
<ArticleItemHeader :pos-id="posId" :type="type" :thumb="thumb" :share="share" :data="headerData" :lazy="lazy" @on-follow="onFollow"></ArticleItemHeader>
<ArticleItemHeader :pos-id="posId" :type="type" :thumb="thumb" :share="share" :data="headerData" :lazy="lazy" @on-follow="onFollow" @on-show-more="onShowMore"></ArticleItemHeader>
<ArticleItemSlide :type="type" :thumb="thumb" :share="share" :data="slideData" :slide-index="data.blockIndex" :lazy="lazy"></ArticleItemSlide>
<ProductGroup :article-id="data.articleId" :pos-id="posId" :index="index" :thumb="thumb" v-if="productListData.length" :share="share" :data="productListData" :lazy="lazy"></ProductGroup>
<ArticleItemIntro :thumb="thumb" :type="type" :share="share" :data="introData" @on-expand="onExpand" @on-expanding="onExpanding" @on-show-guang="onShowGuang" @on-show-comment="onShowComment"
... ... @@ -12,7 +12,7 @@
</template>
<script>
import {get, first, debounce} from 'lodash';
import {get, first} from 'lodash';
import ArticleItemHeader from './article-item-header';
import ArticleItemSlide from './article-item-slide';
import ArticleItemIntro from './article-item-intro';
... ... @@ -36,9 +36,6 @@ export default {
posId: Number,
articleId: Number
},
mounted() {
this.expandEvent = debounce(this.onExpandEvent.bind(this), 200);
},
computed: {
articleState() {
return this.articleStates[this.data.articleId] || this.data;
... ... @@ -60,6 +57,7 @@ export default {
},
introData() {
return {
authorName: this.data.authorName,
intro: get(get(this.data, 'blockList', []).filter(block => block.templateKey === 'text'), '[0].contentData', ''),
isExpand: this.data.isExpand,
introHeight: this.data.introHeight,
... ... @@ -93,34 +91,21 @@ export default {
},
methods: {
onExpand() {
this.expandEvent();
},
onExpandEvent() {
const $phItem = document.getElementById(`ph${this.index}`);
$phItem.innerHTML = '';
$phItem.status = 0;
this.$nextTick(() => {
this.onResize();
});
this.changeResolve && this.changeResolve();
},
onResize() {
this.$emit('on-resize', this.index);
this.$emit('on-unlock-height', {
index: this.index,
promise: Promise.resolve()
});
},
onExpanding() {
const $phItem = document.getElementById(`ph${this.index}`);
if ($phItem.status === 1) {
return;
}
const $nextItem = document.getElementById(`item${this.index + 1}`);
if ($nextItem) {
$phItem.innerHTML = $nextItem.outerHTML;
}
$phItem.style.zIndex = 999;
$phItem.status = 1;
this.$emit('on-unlock-height', {
index: this.index,
promise: new Promise(r => {
this.changeResolve = r;
})
});
this.reportClickArticle();
},
onFollow(follow) {
... ... @@ -133,6 +118,9 @@ export default {
onShowComment() {
this.$emit('on-show-comment', {articleId: this.data.articleId, index: this.index});
},
onShowMore() {
this.$emit('on-show-more', {article: this.data, index: this.index});
},
reportOpenGuang() {
this.$store.dispatch('reportYas', {
params: {
... ...
<template>
<div>
<Layout class="article">
<LayoutHeader theme="white" slot='header' :title="title">
<LayoutHeader v-if="!noHeader" theme="white" slot='header' :title="title">
<template v-if="showHeader">
<div class="avatar-wrapper" @click="toUserPage">
<WidgetAvatar class="widget-avatar" :src="currentAuthor.authorHeadIco" :width="70" :height="70"></WidgetAvatar>
... ... @@ -13,21 +13,20 @@
</template>
</LayoutHeader>
<LayoutRecycleList :size="10" :thumbs="thumbs" ref="scroll" @scroll="onScroll" :offset="2000" :on-fetch="onFetch">
<template class="article-item" #item="{ data: {data, index} }">
<template class="article-item" #item="{ data }">
<ArticleItem
:id="`item${index}`"
:type="type"
:index="index"
:data="data"
:data-id="data.articleId"
:index="data.index"
:data="data.data"
:share="share"
:article-id="data.articleId"
:pos-id="posId"
@on-follow="follow => onFollow(data, follow)"
@on-follow="follow => onFollow(data.data, follow)"
@on-resize="onResize"
@on-unlock-height="onUnlockHeight"
@on-show-guang="onShowGuang"
@on-show-comment="onShowComment"></ArticleItem>
<div :id="`ph${index}`"></div>
@on-show-comment="onShowComment"
@on-show-more="onShowMore"></ArticleItem>
</template>
</LayoutRecycleList>
</Layout>
... ... @@ -42,15 +41,17 @@
@on-comment="onActionComment"
@on-page-ready="onPageReady"></Comment>
</YohoActionSheet>
<MoreActionSheet transfer ref="moreAction" @on-follow="onFollow" @on-delete="onDelete"></MoreActionSheet>
</div>
</template>
<script>
import {throttle} from 'lodash';
import YAS from 'utils/yas-constants';
import ArticleItem from './article-item';
import ArticleActionSheet from '../detail/article-action-sheet';
import YAS from 'utils/yas-constants';
import {createNamespacedHelpers} from 'vuex';
import MoreActionSheet from '../detail/more-action-sheet';
import {mapState, createNamespacedHelpers} from 'vuex';
const {mapMutations} = createNamespacedHelpers('article');
export default {
... ... @@ -63,6 +64,7 @@ export default {
share: Boolean,
type: String,
onFetch: Function,
noHeader: Boolean,
thumbs: {
type: Array,
default() {
... ... @@ -82,6 +84,7 @@ export default {
showCommentAction: false,
showCommentActioning: false,
showArticleDetailAction: false,
showMoreAction: true,
inx: 0,
scrollTop: 0,
showHeader: false,
... ... @@ -93,7 +96,7 @@ export default {
hasAttention: 'N',
isShare: false,
authorType: 1
}
},
};
},
activated() {
... ... @@ -101,6 +104,9 @@ export default {
this.$refs.scroll.$el.scrollTop = this.scrollTop;
}
},
computed: {
...mapState(['yoho'])
},
methods: {
...mapMutations(['ASYNC_ARTICLE_COMMENT', 'CHANGE_AUTHOR_FOLLOW']),
toUserPage() {
... ... @@ -130,6 +136,18 @@ export default {
this.$refs.comment.init();
});
},
async onShowMore({article, index}) {
if (this.yoho && this.yoho.context.isLogin && !this._uid) {
let user = await this.$sdk.getUser();
this._uid = user.uid;
}
this.$refs.moreAction.show(article, this._uid, index);
},
onDelete(index) {
this.$refs.scroll.delete(index);
},
onPageReady({success}) {
if (success && this.showCommentAction) {
this.$refs.commentAction.show();
... ... @@ -140,6 +158,9 @@ export default {
this.showCommentActioning = false;
}
},
onUnlockHeight(params) {
this.$refs.scroll.unlockHight(params);
},
onClose() {
this.$refs.commentAction.hide();
},
... ... @@ -230,7 +251,8 @@ export default {
},
components: {
ArticleItem,
ArticleActionSheet
ArticleActionSheet,
MoreActionSheet
}
};
</script>
... ...
<template>
<YohoActionSheet :transfer="transfer" class="more-action-sheet" ref="actionSheet">
<div class="action-wrap">
<div class="action-list">
<div class="action-item" v-for="(i, index) in list" :key="index" v-show="!i.hide" @click="onClick(i.fnName)">
<p class="icon">
<span class="iconfont" :class="i.icon"></span>
</p>
<p class="name">{{i.name}}</p>
</div>
</div>
<div class="cancel" @click="hide">取消</div>
</div>
</YohoActionSheet>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
const articleStore = createNamespacedHelpers('article');
const userStore = createNamespacedHelpers('user');
export default {
name: 'MoreActionSheetPage',
props: {
transfer: Boolean
},
data() {
return {
list: [
{
icon: 'icon-fav-cancel',
name: '取消关注',
fnName: 'actionCancelFav'
},
{
icon: 'icon-warn',
name: '举报',
fnName: 'actionrReport'
},
{
icon: 'icon-delete',
name: '删除',
fnName: 'actionDelete'
}
]
};
},
methods: {
...articleStore.mapActions(['reportArticle', 'deleteArticle']),
...userStore.mapActions(['followUser']),
show(params, uid, index) {
this.index = index;
params = params || {};
this.list[0].hide = params.hasAttention !== 'Y';
this.list[2].hide = params.authorUid !== uid || params.authorUid !== 1;
this.list = [...this.list];
this._params = params;
this.$refs.actionSheet.show();
},
hide() {
this.$refs.actionSheet.hide();
},
actionrReport() {
this.$createToast({
txt: '举报成功',
type: 'correct',
time: 1000
}).show();
this.reportArticle(this._params);
},
actionCancelFav() {
let {authorUid, authorType} = this._params;
return this.$emit('on-follow', this._params);
this.followUser({
followUid: authorUid,
status: false,
authorType
}).then(res => {
if (res.code === 200) {
this.$emit('on-follow', this._params);
}
});
},
actionDelete() {
this.$createDialog({
type: 'confirm',
title: '确认删除该文章?',
confirmBtn: {
text: '确定',
active: true,
disabled: false,
href: 'javascript:;'
},
cancelBtn: {
text: '取消',
active: false,
disabled: false,
href: 'javascript:;'
},
onConfirm: () => {
this.deleteArticle(this._params.articleId).then(res => {
if (res.code === 200) {
this.$emit('on-delete', this._params.articleId);
} else {
this.$createToast({
type: 'warn',
time: 1000,
txt: '删除失败了'
}).show();
}
});
}
}).show()
},
onClick(name) {
this[name] && this[name]();
this.hide();
}
}
};
</script>
<style scoped lang="scss">
/deep/ .yoho-popup {
&:after,
> .yoho-popup-container {
background-color: rgba(255, 255, 255, 0.9);
}
}
.action-wrap {
color: #444;
.action-list {
width: 100%;
padding: 20px 40px;
border-bottom: 1PX solid #d7d7d7;
display: flex;
justify-content: space-around;
}
.action-item {
width: 128px;
padding: 12px 0;
.icon {
width: 88px;
height: 88px;
line-height: 92px;
border-radius: 50%;
margin: 0 auto 16px;
background-color: #fff;
text-align: center;
overflow: hidden;
}
.iconfont {
font-size: 48px;
color: #b0b0b0;
}
.name {
font-size: 24px;
text-align: center;
transform: scale(0.9, 0.9);
opacity: 0.65;
}
}
.cancel {
line-height: 88px;
font-size: 32px;
letter-spacing: 0.05px;
text-align: center;
}
}
</style>
... ...
... ... @@ -85,12 +85,12 @@ export default {
<style lang="css">
.wf-item {
width: 100%;
padding: 10px;
padding: 6px;
font-size: 24px;
.wf-item-mid {
border-radius: 8px;
box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.3);
border-radius: 2PX;
box-shadow: 0 2px 16px 0 rgba(0, 0, 0, 0.2);
overflow: hidden;
}
... ...
... ... @@ -193,7 +193,7 @@ export default {
<style lang="css">
.sr-list {
padding: 0 20px;
padding: 0 8px;
display: flex;
align-items: flex-start;
... ...
@font-face {font-family: "iconfont";
src: url('iconfont.eot?t=1551098188585'); /* IE9 */
src: url('iconfont.eot?t=1551098188585#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAuoAAsAAAAAFSwAAAtYAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFQAqZRJRBATYCJANYCy4ABCAFhG0HgVkbsBEjA8HGAQhIj5D9ZYKpw61RqP8i6djdMUFu9hjToJ5+pM/aJSU+qPMv7nQHRS1bz8aLQfGKkBT1niijQngcQuNQCIdQFAqZjKXQyci/nKrtZNMAouPZMLRjosk1Xr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rkGBgIgykEkRwEbq11iRMzOXAeWMeuuAg4k+inKAGPCUDZM4UGGhld/DhpRhHa2EoaRwzYoisEUvCurWz3yeenCUJ3CRxSDJ7Ho7P9UiPVgrs+lZEGj/EqHwSq/HLwGD/R7zJPwmaLMncNDtjbrPb6Q2BZDBCXYTXmK2bxNO44Ru4Q5SU10ayL6Dii8RmuS5XPEAGOsQ+5ei2zFZYwiTu1fUgRhQd4R40L1vmbrda2aZ9lxpTNXWKAImDiIagXNQ9DWV2djatfPwb4BxEEnX0uFL/AkjhVy5sLK0trB/EbNXjpTQvjpwtllRLeO0JSoR7SQXRsSCha95sD2hsqd1B6uysZCRrKy5Pb0zfgsjb16t5PVNGVk5eQVGJUmXKVahUpVpNbV19Q2NTs8FDgk3/Lh5KP4LlAXnXcu8q89jbdGF9jIPSSoJpsOlCRTQDR7KUqeI7vfqFDRNfyHOH23egIxbog/HcS8WNPX7LQ3pJ5sEJE+QeS3eEGgqjqSoAAAA=') format('woff2'),
url('iconfont.woff?t=1551098188585') format('woff'),
url('iconfont.ttf?t=1551098188585') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1551098188585#iconfont') format('svg'); /* iOS 4.1- */
src: url('iconfont.eot?t=1551944025614'); /* IE9 */
src: url('iconfont.eot?t=1551944025614#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAA1EAAsAAAAAGBAAAAz2AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCFYgqeWJhVATYCJANkCzQABCAFhG0HgXYbDxQjEXaUsxJC9pcJNpTh99AqFRGjWAxRw6iN1slyG504oxNPi/aapuE99x6Lhw9Pv48JIsyls5YMlBSB8dneAZ52aaZSw6+Dkhlu3917oN5WJ3NmUqAg7bKhgPzqIdvxMr6OyPpK9wxQ2SFnCcAw9yvkAADW/qZ9xzYqwnSdPPuXn55CoNxj9IXcLICAAPD/fy21QKDwh1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MrUIjoqmoFBqTA53JxR75VJj1j9EQiO+pEUkP7MWXxg8C8GByFLbjyP0NAGi0zUIo/Etpf4ZNCqrCSx2Xp2IsQvMd0TpHWaGqSdsrroSEGz1JOsg4ifyE63cEZStppW4TO3aPawal1jpKihrdEQIzEjeEh2mMKia4zx2isZrvyYOgAWDwfWAH9CFgSZdvO3YKn0KIqPY2qqfQIlCgmX5MchpuQOdrkbiEQCrZha0hJBCv8k8VWczJnXYPLtMq3BpYnFwfBIRA1Qx5H7gMhX/6EUmTOMq1K9Iwxqifcgk94j56Qx1DHnND+q6N9mDapW9jBBcSQSzzi/GHrMfWcZAMToQzhOp6pC+AB9WlTgOboqFd2cA647H9vT8lB1ctYiqg451S4jtYj3LOKgyDXvnD9gHTU+C11btcvsG30kVLoNl1OiHf86+Ef+pQfxT3F+V6Q6p3IxR+FggLb6/V0fBzauelhl1CfU/Wtn33GcutvkyqsrzEtIe0imAaHSvuB7vT0WzzbLFVdb+xvhihsLA5ukQuGQJlCHZhEmPnmEhUNx4ZGZ8rP7xKYXKKJdIBNjhRBisF0YRHFcKGJwNVCHPhUm8fgqLGIIKjzqCXuBPulk5I7DG6FgVLA9wcoYtNXIQ3DsN5qrE5Ss8rP/kZLtg3Vasvu+MCAtYpJ0MydmDZqih0+xOnQuwkHxgpKnnfk4z7Mum3SS0WdD5kEo2C2uwPasaGUM+vE85Lb/G83VCaq55KDiP1Ky7w5Wk0Uj8MsIWpfclJPTzZywNDXYZ1P04FOa6Ex/BEf5cBeUPNlnsI+zWd5K6xrT6l3+unBxJl7G+NwSNkSJFlMsscURVzzxJZBQoiRaYow51tjjjDve+BNMOJHaR8K16uGuqXKouSZrdi5fInT2sKO2ztVpF4SDO+y4uahqQyKlQai1CVVivXe0pLK4SWvpYsIKleXSJ9PZ6pTTlF6E+h49hpKFWcIBW3SqurO0MGhxG6UIEl2j0CFjlgEA') format('woff2'),
url('iconfont.woff?t=1551944025614') format('woff'),
url('iconfont.ttf?t=1551944025614') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1551944025614#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
... ... @@ -99,3 +99,15 @@
content: "\e7b4";
}
.icon-warn:before {
content: "\e7b6";
}
.icon-fav-cancel:before {
content: "\e7b8";
}
.icon-delete:before {
content: "\e7ba";
}
... ...
... ... @@ -83,6 +83,15 @@ Created by iconfont
<glyph glyph-name="zan-bold" unicode="&#59316;" d="M881.732267 578.082133c69.290667 0 108.1344-52.974933 108.066133-136.942933l-0.2048-2.798933-44.6464-372.736c-0.341333-73.864533-58.504533-134.3488-130.730667-134.3488H136.533333a34.133333 34.133333 0 0 0-34.133333 34.133333V496.8448a34.133333 34.133333 0 0 0 34.133333 34.133333h182.818134c35.771733 107.1104 62.805333 184.866133 75.776 215.722667 29.354667 70.314667 59.938133 101.102933 116.804266 113.4592C517.256533 861.320533 522.922667 861.866667 528.5888 861.866667c42.666667 0 95.095467-28.808533 127.7952-72.567467 36.4544-48.810667 50.7904-114.2784 31.3344-195.106133l-3.8912-16.110934h197.973333z m0-68.266666H640.546133a34.133333 34.133333 0 0 0-33.1776 42.052266l9.0112 37.751467 4.983467 20.48c14.609067 60.8256 4.778667 105.540267-19.6608 138.376533-20.343467 27.2384-52.974933 45.124267-73.1136 45.124267a13.038933 13.038933 0 0 1-2.2528-0.136533c-32.290133-7.031467-46.6944-21.572267-68.266667-73.181867-12.834133-30.72-42.871467-117.486933-81.851733-234.427733a34.133333 34.133333 0 0 0-36.317867-23.210667L170.666667 462.779733v-463.189333h643.549866c33.9968 0 62.2592 29.4912 62.6688 70.314667l44.714667 374.442666c-0.2048 47.172267-13.858133 65.536-39.867733 65.536zM296.413867 504.354133h68.266666v-538.965333h-68.266666z" horiz-adv-x="1024" />
<glyph glyph-name="warn" unicode="&#59318;" d="M549.290667 743.552a42.666667 42.666667 0 0 1-74.581334 0l-354.133333-637.482667A42.666667 42.666667 0 0 1 157.866667 42.66666699999996h708.266666a42.666667 42.666667 0 0 1 37.333334 63.402666l-354.133334 637.44z m74.581333 41.386667l354.176-637.44A128 128 0 0 0 866.133333-42.66666699999996H157.866667a128 128 0 0 0-111.914667 190.165334l354.133333 637.44a128 128 0 0 0 223.786667 0zM512 597.333333a42.666667 42.666667 0 0 0 42.666667-42.666666v-256a42.666667 42.666667 0 1 0-85.333334 0V554.666667a42.666667 42.666667 0 0 0 42.666667 42.666666zM512 170.66666699999996m-42.666667 0a42.666667 42.666667 0 1 1 85.333334 0 42.666667 42.666667 0 1 1-85.333334 0Z" horiz-adv-x="1024" />
<glyph glyph-name="fav-cancel" unicode="&#59320;" d="M706.688 810.666667c138.410667 0 249.770667-116.906667 249.770667-260.096 0-61.781333-20.906667-120.362667-59.306667-167.978667l-89.301333-103.936a42.666667 42.666667 0 1 0-64.725334 55.594667l88.448 102.912c25.386667 31.488 39.552 71.253333 39.552 113.408C871.125333 647.552 797.013333 725.333333 706.688 725.333333c-54.314667 0-112.085333-60.586667-167.893333-191.488-14.762667-34.56-63.744-34.56-78.506667 0C404.48 664.704 346.794667 725.333333 292.48 725.333333 202.112 725.333333 128 647.552 128 550.570667c0-42.197333 14.165333-81.92 38.656-112.384l365.226667-425.045334a42.666667 42.666667 0 1 0-64.682667-55.594666L101.034667 383.57333300000005A265.557333 265.557333 0 0 0 42.666667 550.570667C42.666667 693.76 154.026667 810.666667 292.48 810.666667c79.872 0 147.968-55.850667 207.061333-162.304C558.677333 754.773333 626.773333 810.666667 706.688 810.666667zM640 170.66666699999996h213.333333a42.666667 42.666667 0 0 0 0-85.333334h-213.333333a42.666667 42.666667 0 0 0 0 85.333334z" horiz-adv-x="1024" />
<glyph glyph-name="delete" unicode="&#59322;" d="M128 640h768a42.666667 42.666667 0 0 0 0-85.333333H128a42.666667 42.666667 0 1 0 0 85.333333zM725.333333 624.2133329999999h-85.333333c0 57.514667-56.149333 106.666667-128 106.666667s-128-49.152-128-106.666667H298.666667c0 107.392 96.682667 192 213.333333 192s213.333333-84.608 213.333333-192zM256 554.666667v-512h512V554.666667H256z m0 85.333333h512a85.333333 85.333333 0 0 0 85.333333-85.333333v-512a85.333333 85.333333 0 0 0-85.333333-85.333334H256a85.333333 85.333333 0 0 0-85.333333 85.333334V554.666667a85.333333 85.333333 0 0 0 85.333333 85.333333zM341.333333 426.666667m42.666667 0l0 0q42.666667 0 42.666667-42.666667l0-170.666667q0-42.666667-42.666667-42.666666l0 0q-42.666667 0-42.666667 42.666666l0 170.666667q0 42.666667 42.666667 42.666667ZM469.333333 426.666667m42.666667 0l0 0q42.666667 0 42.666667-42.666667l0-170.666667q0-42.666667-42.666667-42.666666l0 0q-42.666667 0-42.666667 42.666666l0 170.666667q0 42.666667 42.666667 42.666667ZM597.333333 426.666667m42.666667 0l0 0q42.666667 0 42.666667-42.666667l0-170.666667q0-42.666667-42.666667-42.666666l0 0q-42.666667 0-42.666667 42.666666l0 170.666667q0 42.666667 42.666667 42.666667Z" horiz-adv-x="1024" />
</font>
... ...
... ... @@ -219,12 +219,10 @@ export default {
// 等待动画完成后,提交数据
commit(Types.FETCH_GUANG_SUCCESS, result);
},
async fetchProductFav({ commit, state }) {
if (!state.articleProductList.id.length) {
return;
}
const favsList = await this.$api.post('/api/favorite/batchCheckIsFavorite', {
favIds: state.articleProductList.id.join(','),
type: 'product'
... ... @@ -233,5 +231,15 @@ export default {
});
commit(Types.GUANG_CHANGE_PRODUCT_FAV, favsList);
},
async reportArticle(actions, {articleId}) {
const result = await this.$api.post('/api/grass/reportIllegalArticle', {articleId});
return result;
},
async deleteArticle(actions, {articleId}) {
const result = await this.$api.post('/api/grass/deleteGrassArticle', {articleId});
return result;
}
};
... ...
... ... @@ -230,4 +230,18 @@ module.exports = {
authorType: {type: Number},
}
},
'/api/grass/reportIllegalArticle': {
api: 'app.grass.reportIllegalArticle',
auth: true,
params: {
articleId: {type: Number}
}
},
'/api/grass/deleteGrassArticle': {
api: 'app.grass.deleteGrassArticle',
auth: true,
params: {
articleId: {type: Number}
}
}
};
... ...
... ... @@ -36,7 +36,7 @@ if (!isDev) {
const getContext = (req) => {
return {
url: req.url,
title: '',
title: req.query.share_title || '',
user: req.user,
env: {
isApp: req.yoho.isApp,
... ...