Authored by htoooth

Merge remote-tracking branch 'origin/master'

... ... @@ -7,7 +7,11 @@
<p class="comment-user-name">{{parentComment.userName || '&nbsp;'}}</p>
<p class="comment-time">{{parentComment.createTime | time}}</p>
</div>
<WidgetFav class="comment-fav" :num="parentComment.praiseTotal"></WidgetFav>
<WidgetFav
class="comment-fav"
:comment-id="parentComment.id"
:num="parentComment.praiseTotal"
:option="favOption"></WidgetFav>
</div>
<div class="comment-cont" @click="replyComment(parentComment.id)" :data-parent-id="parentComment.parentId" :data-root-id="parentComment.rootId">
... ... @@ -51,10 +55,15 @@ export default {
data() {
return {
isShowAllReply: false,
limitNum: 2
limitNum: 2,
};
},
computed: {
favOption() {
return {
selected: this.parentComment.isPraise === 'Y'
};
},
replayShowList() {
if (this.childrenComments.length <= this.limitNum) {
return this.childrenComments;
... ... @@ -71,8 +80,6 @@ export default {
return this.isShowAllReply ? '收起' : `查看${this.moreReplyNum}条回复`;
}
},
created() {
},
methods: {
...mapActions(['postComment']),
onShowMore() {
... ... @@ -142,6 +149,10 @@ export default {
}
}
.comment-fav {
padding-right: 20px;
}
.comment-cont {
font-size: 28px;
color: #444;
... ...
... ... @@ -41,6 +41,7 @@ export default {
bottom: 0;
display: flex;
flex-direction: column;
background-color: #fff;
&.header-fixed {
display: block;
... ...
... ... @@ -10,7 +10,7 @@
<script>
import {pxToRem} from '../../../utils/helpers.js';
import {foreach, get} from 'lodash';
import {forEach, get} from 'lodash';
import {createNamespacedHelpers} from 'vuex';
const {mapActions} = createNamespacedHelpers('user');
... ... @@ -71,7 +71,7 @@
}
},
created() {
foreach(defaultOption, (value, key) => {
forEach(defaultOption, (value, key) => {
if (!this.option.hasOwnProperty(key)) {
this.option[key] = value;
}
... ... @@ -191,6 +191,7 @@
this.syncService(syncFnName, {
articleId: this.articleId,
commentId: this.commentId,
status: this.btnSelected
}).then(backFn).catch(backFn);
}
... ...
... ... @@ -27,7 +27,7 @@ window._router = get(store, 'state.yoho.context.route');
Vue.prop('yoho', yoho);
Vue.prop('sdk', sdk);
Vue.prop('auth', function() {
if (!get(this.$store, '$context.islogin')) {
if (!get(this.$store, '$context.isLogin')) {
this.$sdk && this.$sdk.goLogin && this.$sdk.goLogin();
return false;
}
... ...
import { get, foreach, keyby, uniq, remove, clonedeep } from 'lodash';
import { get, forEach, keyBy, uniq, remove, cloneDeep } from 'lodash';
let domainList = {
'01': [
... ... @@ -89,14 +89,14 @@ export function processArticleDetail(articleContent) {
// 普通商品
if (tagList.length > 0) {
foreach(tagList, (tag, tagIndex) => {
forEach(tagList, (tag, tagIndex) => {
tagList[tagIndex].href = '//m.yohobuy.com/product/' + tag.product_skn + '.html';
});
}
// 全球购商品
if (tagListGlobal.length > 0) {
foreach(tagListGlobal, tagGlobal => {
forEach(tagListGlobal, tagGlobal => {
tagList.push(Object.assign(tagGlobal, {
href: '//m.yohobuy.com/product/global/' + tagGlobal.product_skn + '.html',
noCart: true
... ... @@ -106,7 +106,7 @@ export function processArticleDetail(articleContent) {
// 限定商品
if (tagListLimit.length > 0) {
foreach(tagListLimit, tagLimit => {
forEach(tagListLimit, tagLimit => {
tagList.push(Object.assign(tagLimit, {
href: '//m.yohobuy.com/product/' + tagLimit.product_skn + '.html',
noCart: true
... ... @@ -148,18 +148,18 @@ export function processArticleDetail(articleContent) {
let goodsDataLimit = get(value, 'goods.dataLimit', []);
// 普通商品
foreach(goodsData, (item) => {
forEach(goodsData, (item) => {
allgoods.push(item.id);
});
// 全球购商品
foreach(goodsDataGlobal, (item) => {
forEach(goodsDataGlobal, (item) => {
allgoods.push(item.id);
goodsData.push(item);
});
// 限定商品
foreach(goodsDataLimit, (item) => {
forEach(goodsDataLimit, (item) => {
allgoods.push(item.id);
goodsData.push(item);
});
... ... @@ -201,7 +201,7 @@ export function processArticleDetail(articleContent) {
function processProductList(list, favsList) {
const pruductList = [];
foreach(list, (product) => {
forEach(list, (product) => {
if (!product) {
return;
}
... ... @@ -293,7 +293,7 @@ function processProductList(list, favsList) {
}
const _goodsArrayToObj = (goodsArray) => {
return keyby(goodsArray, value => {
return keyBy(goodsArray, value => {
return value.product_skn;
});
};
... ... @@ -304,18 +304,18 @@ const _goodsArrayToObj = (goodsArray) => {
export function pushGoodsInfo(finalDetail, goodsList, favsList) {
let goodsObj = _goodsArrayToObj(processProductList(goodsList, favsList));
foreach(finalDetail, (value, key) => {
forEach(finalDetail, (value, key) => {
if (value.relatedReco) {
let goodsIds = [];
foreach(value.relatedReco.goods, relatedGoods => {
forEach(value.relatedReco.goods, relatedGoods => {
goodsIds.push(relatedGoods.id);
});
goodsIds = uniq(goodsIds);
finalDetail[key].relatedReco.goods = [];
foreach(goodsIds, (item, subKey) => {
forEach(goodsIds, (item, subKey) => {
if (goodsObj[item]) {
finalDetail[key].relatedReco.goods[subKey] = goodsObj[item];
} else {
... ... @@ -333,13 +333,13 @@ export function pushGoodsInfo(finalDetail, goodsList, favsList) {
}
if (value.collocation) {
foreach(value.collocation, (item, subKey) => {
foreach(item.goods, (thItem, thKey) => {
forEach(value.collocation, (item, subKey) => {
forEach(item.goods, (thItem, thKey) => {
if (thItem) {
finalDetail[key].collocation[subKey].goods[thKey] = goodsObj[thItem.id];
if (goodsObj[thItem.id]) {
let newGoods = clonedeep(goodsObj[thItem.id]);
let newGoods = cloneDeep(goodsObj[thItem.id]);
newGoods.default_images = thItem.src;
finalDetail[key].collocation[subKey].goods[thKey] = newGoods;
... ...
... ... @@ -26,8 +26,7 @@
"kebabCase": true
},
"lodash": {
"transform": "lodash/${member}",
"kebabCase": true
"transform": "lodash/${member}"
}
},
"dependencies": {
... ...