Merge branch 'hotfix/guangShare' into 'master'
逛分享图片以及位置 See merge request !57
Showing
1 changed file
with
22 additions
and
11 deletions
@@ -232,14 +232,34 @@ const packageData = (id, isApp, isWeixin, channel, isShare) => { | @@ -232,14 +232,34 @@ const packageData = (id, isApp, isWeixin, channel, isShare) => { | ||
232 | }); | 232 | }); |
233 | } | 233 | } |
234 | 234 | ||
235 | - if (isShare) { | 235 | + if (isShare && datas[5]) { |
236 | + | ||
237 | + if (datas[5].wechatShareImgUrl) { | ||
238 | + datas[5].wechatShareImgUrl = datas[5].wechatShareImgUrl.substring(datas[5].wechatShareImgUrl.indexOf('//')); | ||
239 | + | ||
240 | + if (datas[5].wechatShareImgUrl.indexOf('?') === -1) { | ||
241 | + datas[5].wechatShareImgUrl = datas[5].wechatShareImgUrl + '?imageView2/2/interlace/1/q/75'; | ||
242 | + } | ||
243 | + } else if (datas[5].qqShareImgUrl) { | ||
244 | + datas[5].qqShareImgUrl = datas[5].qqShareImgUrl.substring(datas[5].qqShareImgUrl.indexOf('//')); | ||
245 | + | ||
246 | + if (datas[5].qqShareImgUrl.indexOf('?') === -1) { | ||
247 | + datas[5].qqShareImgUrl = datas[5].wechatShareImgUrl + '?imageView2/2/interlace/1/q/75'; | ||
248 | + } | ||
249 | + } else if (datas[5].showShareImgUrl) { | ||
250 | + datas[5].showShareImgUrl = datas[5].showShareImgUrl.substring(datas[5].showShareImgUrl.indexOf('//')); | ||
251 | + | ||
252 | + if (datas[5].showShareImgUrl.indexOf('?') === -1) { | ||
253 | + datas[5].showShareImgUrl = datas[5].showShareImgUrl + '?imageView2/2/interlace/1/q/75'; | ||
254 | + } | ||
255 | + } | ||
236 | 256 | ||
237 | let preCount = 0; | 257 | let preCount = 0; |
238 | let i; | 258 | let i; |
239 | 259 | ||
240 | for (i = 0; i < getArticleContent.length; i++) { | 260 | for (i = 0; i < getArticleContent.length; i++) { |
241 | if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) { | 261 | if (getArticleContent[i].singleImage || getArticleContent[i].text || getArticleContent[i].smallPic) { |
242 | - preCount++; | 262 | + preCount = i + 1; |
243 | } | 263 | } |
244 | } | 264 | } |
245 | 265 | ||
@@ -247,15 +267,6 @@ const packageData = (id, isApp, isWeixin, channel, isShare) => { | @@ -247,15 +267,6 @@ const packageData = (id, isApp, isWeixin, channel, isShare) => { | ||
247 | shareCode: datas[5] | 267 | shareCode: datas[5] |
248 | }); | 268 | }); |
249 | 269 | ||
250 | - // if (isWeixin && datas[5]) { | ||
251 | - // getArticleContent.splice(preCount, 0, { | ||
252 | - // shareCode: datas[5] | ||
253 | - // }); | ||
254 | - // } else if (!isWeixin && datas[4]) { | ||
255 | - // getArticleContent.splice(preCount, 0, { | ||
256 | - // shareCode: datas[4] | ||
257 | - // }); | ||
258 | - // } | ||
259 | } | 270 | } |
260 | 271 | ||
261 | if (datas[0]) { | 272 | if (datas[0]) { |
-
Please register or login to post a comment