Authored by shuaiguo

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

@@ -13,7 +13,9 @@ function queryString() { @@ -13,7 +13,9 @@ function queryString() {
13 13
14 const getAppPath = () => { 14 const getAppPath = () => {
15 let params = queryString(); 15 let params = queryString();
  16 +
16 let openbyYohobuy = params['openby:yohobuy'] || ''; 17 let openbyYohobuy = params['openby:yohobuy'] || '';
  18 +
17 let appPath = ''; 19 let appPath = '';
18 20
19 if (openbyYohobuy) { 21 if (openbyYohobuy) {
@@ -253,7 +253,9 @@ const yoho = { @@ -253,7 +253,9 @@ const yoho = {
253 type: 0, 253 type: 0,
254 updateflag: Date.now() + '', 254 updateflag: Date.now() + '',
255 url: url, 255 url: url,
256 - param: args 256 + param: args,
  257 + from_page_name: args.from_page_name,
  258 + from_page_param: args.from_page_param
257 } 259 }
258 }); 260 });
259 } 261 }
@@ -35,6 +35,7 @@ export default { @@ -35,6 +35,7 @@ export default {
35 const commentId = this.$attrs['dest-id']; 35 const commentId = this.$attrs['dest-id'];
36 const articleId = this.$attrs['article-id']; 36 const articleId = this.$attrs['article-id'];
37 const commentType = this.$attrs.commentType; 37 const commentType = this.$attrs.commentType;
  38 +
38 let menu = []; 39 let menu = [];
39 40
40 if (authorUid === uid || commentUid === uid) { 41 if (authorUid === uid || commentUid === uid) {
@@ -402,6 +402,7 @@ export default { @@ -402,6 +402,7 @@ export default {
402 */ 402 */
403 article = JSON.parse(JSON.stringify(article)); // 防止直接修改vuex数据,拷贝一份数据副本 403 article = JSON.parse(JSON.stringify(article)); // 防止直接修改vuex数据,拷贝一份数据副本
404 let text = article.blockList[1].contentData, str = ''; 404 let text = article.blockList[1].contentData, str = '';
  405 +
405 let atUserInfo = article.atUserInfo; 406 let atUserInfo = article.atUserInfo;
406 407
407 Object.keys(atUserInfo).forEach((key) => { 408 Object.keys(atUserInfo).forEach((key) => {
@@ -145,6 +145,7 @@ export default { @@ -145,6 +145,7 @@ export default {
145 toArticlePage() { 145 toArticlePage() {
146 if (this.isMiniapp()) { 146 if (this.isMiniapp()) {
147 let url = `http://m.yohobuy.com/grass/article/${this.data.articleId}`; 147 let url = `http://m.yohobuy.com/grass/article/${this.data.articleId}`;
  148 +
148 let h5url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.h5","params":{"h5back":"${encodeURIComponent(url)}"}}`; 149 let h5url = `http://m.yohobuy.com?openby:yohobuy={"action":"go.h5","params":{"h5back":"${encodeURIComponent(url)}"}}`;
149 150
150 /* eslint-disable-next-line */ 151 /* eslint-disable-next-line */
@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 </template> 23 </template>
24 <template v-if="item.relatedReco"> 24 <template v-if="item.relatedReco">
25 <div class="products"> 25 <div class="products">
26 - <ProductGroup name="articleTwoColumn" :pos-id="sceneId" :article-id="articleId" v-for="(p,index) in item.relatedReco.goods" :data="[p]" :key="index"></ProductGroup> 26 + <ProductGroup name="ArticleDetail" :pos-id="sceneId" :article-id="articleId" v-for="(p,index) in item.relatedReco.goods" :data="[p]" :key="index"></ProductGroup>
27 </div> 27 </div>
28 </template> 28 </template>
29 </template> 29 </template>
@@ -25,7 +25,7 @@ @@ -25,7 +25,7 @@
25 25
26 <div v-if="recomendProduct.length"> 26 <div v-if="recomendProduct.length">
27 <LayoutTitle class="rec-goods-title">推荐商品</LayoutTitle> 27 <LayoutTitle class="rec-goods-title">推荐商品</LayoutTitle>
28 - <ProductGroup name="articleTwoColumn" :data="recomendProduct" :share="share" model="2"></ProductGroup> 28 + <ProductGroup name="ArticleDetail" :data="recomendProduct" :share="share" model="2"></ProductGroup>
29 </div> 29 </div>
30 30
31 <LayoutTitle v-if="listTitle" class="rec-article-title">{{listTitle}}</LayoutTitle> 31 <LayoutTitle v-if="listTitle" class="rec-article-title">{{listTitle}}</LayoutTitle>
@@ -55,7 +55,8 @@ import ArticleDetailFooter from './article-footer'; @@ -55,7 +55,8 @@ import ArticleDetailFooter from './article-footer';
55 import ArticleItemSlideImage from '../article/article-item-slide-image'; 55 import ArticleItemSlideImage from '../article/article-item-slide-image';
56 import ArticleDetailHeader from './article-header'; 56 import ArticleDetailHeader from './article-header';
57 import YAS from 'utils/yas-constants'; 57 import YAS from 'utils/yas-constants';
58 -import { mapState, mapMutations, createNamespacedHelpers } from 'vuex'; 58 +import { createNamespacedHelpers, mapMutations, mapState } from 'vuex';
  59 +import qs from 'qs';
59 60
60 const { mapState: mapArticleState, mapActions, mapGetters } = createNamespacedHelpers('article'); 61 const { mapState: mapArticleState, mapActions, mapGetters } = createNamespacedHelpers('article');
61 62
@@ -220,8 +221,6 @@ export default { @@ -220,8 +221,6 @@ export default {
220 const vm = this; 221 const vm = this;
221 const { childNodes = [] } = richText.childNodes[0]; 222 const { childNodes = [] } = richText.childNodes[0];
222 223
223 - console.log(childNodes[0].nodeName);  
224 -  
225 // 特殊排版兼容 224 // 特殊排版兼容
226 225
227 if (childNodes.length === 1 && childNodes[0].nodeName === 'SECTION') { 226 if (childNodes.length === 1 && childNodes[0].nodeName === 'SECTION') {
@@ -245,7 +244,37 @@ export default { @@ -245,7 +244,37 @@ export default {
245 if (ele && ele.querySelector && ele.querySelector('img')) { 244 if (ele && ele.querySelector && ele.querySelector('img')) {
246 ele.classList.add('yoho-img-link'); 245 ele.classList.add('yoho-img-link');
247 246
248 - ele.addEventListener('click', function() { 247 + const defaultName = 'ArticleDetail';
  248 + const name = vm.$yoho.isiOS ? `iFP_${defaultName}` : `aFP_${defaultName}`;
  249 +
  250 + ele.addEventListener('click', function(e) {
  251 + e.preventDefault();
  252 +
  253 + // 对商品详情链接单独处理
  254 + let url = ele;
  255 + const searchParams = qs.parse(url.search.substring(1));
  256 +
  257 + let openBy = searchParams['openby:yohobuy'];
  258 +
  259 + let skn = searchParams.product_skn;
  260 +
  261 + if (skn) {
  262 + if (openBy) {
  263 + openBy = JSON.parse(openBy);
  264 +
  265 + if (!openBy.params.from_page_name || !openBy.params.from_page_param) {
  266 + openBy.params.from_page_name = name;
  267 + openBy.params.from_page_param = vm.data.articleId;
  268 +
  269 + url = url.protocol + '//' + url.host + '?product_skn=' + skn + '&openby:yohobuy=' + JSON.stringify(openBy);
  270 + }
  271 + }
  272 + }
  273 +
  274 + vm.$yoho.goNewPage({
  275 + url: url + ''
  276 + });
  277 +
249 vm.$store.dispatch('reportYas', { 278 vm.$store.dispatch('reportYas', {
250 params: { 279 params: {
251 appop: YAS.eventName.articleImageClick, 280 appop: YAS.eventName.articleImageClick,
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 :width="data.width" :height="data.height"></VideoPlayer> 12 :width="data.width" :height="data.height"></VideoPlayer>
13 <ArticleItemSlide v-else :thumb="thumb" :share="share" :data="slideData" :slide-index="slideIndex" :lazy="lazy" 13 <ArticleItemSlide v-else :thumb="thumb" :share="share" :data="slideData" :slide-index="slideIndex" :lazy="lazy"
14 @on-praise="onPraise" @change="onChangeSlide"></ArticleItemSlide> 14 @on-praise="onPraise" @change="onChangeSlide"></ArticleItemSlide>
15 - <ProductGroup name="articleTwoColumn" :article-id="data.articleId" :pos-id="0" :index="0" :thumb="thumb" 15 + <ProductGroup name="ArticleDetail" :article-id="data.articleId" :pos-id="0" :index="0" :thumb="thumb"
16 v-if="productListData.length" :share="share" :data="productListData" :lazy="lazy"></ProductGroup> 16 v-if="productListData.length" :share="share" :data="productListData" :lazy="lazy"></ProductGroup>
17 17
18 <div class="context-title">{{data.articleTitle}}</div> 18 <div class="context-title">{{data.articleTitle}}</div>
@@ -380,6 +380,7 @@ export default { @@ -380,6 +380,7 @@ export default {
380 let destIndex = numString.length - 4; 380 let destIndex = numString.length - 4;
381 381
382 let destString = numString.substring(0, destIndex); 382 let destString = numString.substring(0, destIndex);
  383 +
383 let subString = numString.substring(destIndex, destIndex + 1); 384 let subString = numString.substring(destIndex, destIndex + 1);
384 385
385 if (subString !== '0') { 386 if (subString !== '0') {
@@ -15,6 +15,7 @@ function _version2num(version) { @@ -15,6 +15,7 @@ function _version2num(version) {
15 // eslint-disable-next-line no-unused-vars 15 // eslint-disable-next-line no-unused-vars
16 function versionCompare(left, right) { 16 function versionCompare(left, right) {
17 let leftNum = _version2num(left); 17 let leftNum = _version2num(left);
  18 +
18 let rightNum = _version2num(right); 19 let rightNum = _version2num(right);
19 20
20 if (leftNum === rightNum) { 21 if (leftNum === rightNum) {
@@ -50,6 +51,7 @@ const filterEmoji = text => { @@ -50,6 +51,7 @@ const filterEmoji = text => {
50 // eslint-disable-next-line no-unused-vars 51 // eslint-disable-next-line no-unused-vars
51 const getDetailShareData = (article, app_version = '6.9.11') => { 52 const getDetailShareData = (article, app_version = '6.9.11') => {
52 let shareImage = ''; 53 let shareImage = '';
  54 +
53 let desc = ''; 55 let desc = '';
54 56
55 if (article.sort === 2) { 57 if (article.sort === 2) {
@@ -81,6 +83,7 @@ const getDetailShareData = (article, app_version = '6.9.11') => { @@ -81,6 +83,7 @@ const getDetailShareData = (article, app_version = '6.9.11') => {
81 83
82 // eslint-disable-next-line no-unused-vars 84 // eslint-disable-next-line no-unused-vars
83 const requiredVersion = '6.9.11'; 85 const requiredVersion = '6.9.11';
  86 +
84 let hideType = ['7', '8', '9']; 87 let hideType = ['7', '8', '9'];
85 88
86 if (versionCompare(app_version, requiredVersion) >= 0) { 89 if (versionCompare(app_version, requiredVersion) >= 0) {
@@ -16,7 +16,9 @@ const config = global.yoho.config; @@ -16,7 +16,9 @@ const config = global.yoho.config;
16 const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV; 16 const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV;
17 17
18 let renderer; 18 let renderer;
  19 +
19 let serverBundle; 20 let serverBundle;
  21 +
20 let degradeHtml; 22 let degradeHtml;
21 23
22 const hbs = fs.readFileSync(path.join(__dirname, '../views/index.hbs'), 'utf-8'); 24 const hbs = fs.readFileSync(path.join(__dirname, '../views/index.hbs'), 'utf-8');
@@ -123,6 +125,7 @@ const getChannel = (yoho) => { @@ -123,6 +125,7 @@ const getChannel = (yoho) => {
123 125
124 const getCacheKey = (req, route) => { 126 const getCacheKey = (req, route) => {
125 const urlObj = url.parse(req.url); 127 const urlObj = url.parse(req.url);
  128 +
126 let ck = urlObj.pathname; 129 let ck = urlObj.pathname;
127 130
128 if (route.query) { 131 if (route.query) {
@@ -177,10 +180,14 @@ const render = (route) => { @@ -177,10 +180,14 @@ const render = (route) => {
177 return handlerError(err, req, res, next); 180 return handlerError(err, req, res, next);
178 } 181 }
179 let styles = context.renderStyles(); 182 let styles = context.renderStyles();
  183 +
180 let scripts = context.renderScripts(); 184 let scripts = context.renderScripts();
  185 +
181 let resources = context.renderResourceHints(); 186 let resources = context.renderResourceHints();
182 const states = context.renderState(); 187 const states = context.renderState();
  188 +
183 let asyncScripts; 189 let asyncScripts;
  190 +
184 let zk = { 191 let zk = {
185 asyncJs: _.get(req.app.locals.wap, 'webapp.ios-async-js', true) 192 asyncJs: _.get(req.app.locals.wap, 'webapp.ios-async-js', true)
186 }; 193 };
1 { 1 {
2 "name": "yoho-community-web", 2 "name": "yoho-community-web",
3 - "version": "6.9.16-beta-8", 3 + "version": "6.9.16-beta-9",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {