Authored by shuaiguo

Merge remote-tracking branch 'refs/remotes/origin/hotfix/image-report' into develop

... ... @@ -13,7 +13,9 @@ function queryString() {
const getAppPath = () => {
let params = queryString();
let openbyYohobuy = params['openby:yohobuy'] || '';
let appPath = '';
if (openbyYohobuy) {
... ...
... ... @@ -253,7 +253,9 @@ const yoho = {
type: 0,
updateflag: Date.now() + '',
url: url,
param: args
param: args,
from_page_name: args.from_page_name,
from_page_param: args.from_page_param
}
});
}
... ...
... ... @@ -35,6 +35,7 @@ export default {
const commentId = this.$attrs['dest-id'];
const articleId = this.$attrs['article-id'];
const commentType = this.$attrs.commentType;
let menu = [];
if (authorUid === uid || commentUid === uid) {
... ...
... ... @@ -402,6 +402,7 @@ export default {
*/
article = JSON.parse(JSON.stringify(article)); // 防止直接修改vuex数据,拷贝一份数据副本
let text = article.blockList[1].contentData, str = '';
let atUserInfo = article.atUserInfo;
Object.keys(atUserInfo).forEach((key) => {
... ...
... ... @@ -145,6 +145,7 @@ export default {
toArticlePage() {
if (this.isMiniapp()) {
let url = `http://m.yohobuy.com/grass/article/${this.data.articleId}`;
let h5url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.h5","params":{"h5back":"${encodeURIComponent(url)}"}}`;
/* eslint-disable-next-line */
... ...
... ... @@ -23,7 +23,7 @@
</template>
<template v-if="item.relatedReco">
<div class="products">
<ProductGroup name="articleTwoColumn" :pos-id="sceneId" :article-id="articleId" v-for="(p,index) in item.relatedReco.goods" :data="[p]" :key="index"></ProductGroup>
<ProductGroup name="ArticleDetail" :pos-id="sceneId" :article-id="articleId" v-for="(p,index) in item.relatedReco.goods" :data="[p]" :key="index"></ProductGroup>
</div>
</template>
</template>
... ...
... ... @@ -25,7 +25,7 @@
<div v-if="recomendProduct.length">
<LayoutTitle class="rec-goods-title">推荐商品</LayoutTitle>
<ProductGroup name="articleTwoColumn" :data="recomendProduct" :share="share" model="2"></ProductGroup>
<ProductGroup name="ArticleDetail" :data="recomendProduct" :share="share" model="2"></ProductGroup>
</div>
<LayoutTitle v-if="listTitle" class="rec-article-title">{{listTitle}}</LayoutTitle>
... ... @@ -55,7 +55,8 @@ import ArticleDetailFooter from './article-footer';
import ArticleItemSlideImage from '../article/article-item-slide-image';
import ArticleDetailHeader from './article-header';
import YAS from 'utils/yas-constants';
import { mapState, mapMutations, createNamespacedHelpers } from 'vuex';
import { createNamespacedHelpers, mapMutations, mapState } from 'vuex';
import qs from 'qs';
const { mapState: mapArticleState, mapActions, mapGetters } = createNamespacedHelpers('article');
... ... @@ -220,8 +221,6 @@ export default {
const vm = this;
const { childNodes = [] } = richText.childNodes[0];
console.log(childNodes[0].nodeName);
// 特殊排版兼容
if (childNodes.length === 1 && childNodes[0].nodeName === 'SECTION') {
... ... @@ -245,7 +244,37 @@ export default {
if (ele && ele.querySelector && ele.querySelector('img')) {
ele.classList.add('yoho-img-link');
ele.addEventListener('click', function() {
const defaultName = 'ArticleDetail';
const name = vm.$yoho.isiOS ? `iFP_${defaultName}` : `aFP_${defaultName}`;
ele.addEventListener('click', function(e) {
e.preventDefault();
// 对商品详情链接单独处理
let url = ele;
const searchParams = qs.parse(url.search.substring(1));
let openBy = searchParams['openby:yohobuy'];
let skn = searchParams.product_skn;
if (skn) {
if (openBy) {
openBy = JSON.parse(openBy);
if (!openBy.params.from_page_name || !openBy.params.from_page_param) {
openBy.params.from_page_name = name;
openBy.params.from_page_param = vm.data.articleId;
url = url.protocol + '//' + url.host + '?product_skn=' + skn + '&openby:yohobuy=' + JSON.stringify(openBy);
}
}
}
vm.$yoho.goNewPage({
url: url + ''
});
vm.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.articleImageClick,
... ...
... ... @@ -12,7 +12,7 @@
:width="data.width" :height="data.height"></VideoPlayer>
<ArticleItemSlide v-else :thumb="thumb" :share="share" :data="slideData" :slide-index="slideIndex" :lazy="lazy"
@on-praise="onPraise" @change="onChangeSlide"></ArticleItemSlide>
<ProductGroup name="articleTwoColumn" :article-id="data.articleId" :pos-id="0" :index="0" :thumb="thumb"
<ProductGroup name="ArticleDetail" :article-id="data.articleId" :pos-id="0" :index="0" :thumb="thumb"
v-if="productListData.length" :share="share" :data="productListData" :lazy="lazy"></ProductGroup>
<div class="context-title">{{data.articleTitle}}</div>
... ...
... ... @@ -380,6 +380,7 @@ export default {
let destIndex = numString.length - 4;
let destString = numString.substring(0, destIndex);
let subString = numString.substring(destIndex, destIndex + 1);
if (subString !== '0') {
... ...
... ... @@ -15,6 +15,7 @@ function _version2num(version) {
// eslint-disable-next-line no-unused-vars
function versionCompare(left, right) {
let leftNum = _version2num(left);
let rightNum = _version2num(right);
if (leftNum === rightNum) {
... ... @@ -50,6 +51,7 @@ const filterEmoji = text => {
// eslint-disable-next-line no-unused-vars
const getDetailShareData = (article, app_version = '6.9.11') => {
let shareImage = '';
let desc = '';
if (article.sort === 2) {
... ... @@ -81,6 +83,7 @@ const getDetailShareData = (article, app_version = '6.9.11') => {
// eslint-disable-next-line no-unused-vars
const requiredVersion = '6.9.11';
let hideType = ['7', '8', '9'];
if (versionCompare(app_version, requiredVersion) >= 0) {
... ...
... ... @@ -16,7 +16,9 @@ const config = global.yoho.config;
const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV;
let renderer;
let serverBundle;
let degradeHtml;
const hbs = fs.readFileSync(path.join(__dirname, '../views/index.hbs'), 'utf-8');
... ... @@ -123,6 +125,7 @@ const getChannel = (yoho) => {
const getCacheKey = (req, route) => {
const urlObj = url.parse(req.url);
let ck = urlObj.pathname;
if (route.query) {
... ... @@ -177,10 +180,14 @@ const render = (route) => {
return handlerError(err, req, res, next);
}
let styles = context.renderStyles();
let scripts = context.renderScripts();
let resources = context.renderResourceHints();
const states = context.renderState();
let asyncScripts;
let zk = {
asyncJs: _.get(req.app.locals.wap, 'webapp.ios-async-js', true)
};
... ...
{
"name": "yoho-community-web",
"version": "6.9.16-beta-8",
"version": "6.9.16-beta-9",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...