Merge branch 'feature/0430' into 'release/6.9.2'
Feature/0430 See merge request !64
Showing
3 changed files
with
29 additions
and
4 deletions
@@ -31,6 +31,7 @@ export default { | @@ -31,6 +31,7 @@ export default { | ||
31 | }, | 31 | }, |
32 | created() { | 32 | created() { |
33 | this.id = +this.$route.params.id; | 33 | this.id = +this.$route.params.id; |
34 | + this.columnType = +this.$route.query.columnType || 1001; | ||
34 | }, | 35 | }, |
35 | activated() { | 36 | activated() { |
36 | let {columnType} = this.$route.query; | 37 | let {columnType} = this.$route.query; |
@@ -52,7 +53,8 @@ export default { | @@ -52,7 +53,8 @@ export default { | ||
52 | return this.fetchArticleList({ | 53 | return this.fetchArticleList({ |
53 | articleId, | 54 | articleId, |
54 | limit: 2, | 55 | limit: 2, |
55 | - thumb: true | 56 | + thumb: true, |
57 | + columnType: this.columnType | ||
56 | }); | 58 | }); |
57 | }, | 59 | }, |
58 | computed: { | 60 | computed: { |
@@ -18,6 +18,7 @@ | @@ -18,6 +18,7 @@ | ||
18 | </template> | 18 | </template> |
19 | 19 | ||
20 | <script> | 20 | <script> |
21 | +import {get} from 'lodash'; | ||
21 | export default { | 22 | export default { |
22 | data() { | 23 | data() { |
23 | return { | 24 | return { |
@@ -42,10 +43,14 @@ export default { | @@ -42,10 +43,14 @@ export default { | ||
42 | let style = {}; | 43 | let style = {}; |
43 | let stepPercent = this.stepPercent; | 44 | let stepPercent = this.stepPercent; |
44 | 45 | ||
45 | - if (this.offsetLeft) { | 46 | + if (!this.offsetLeft) { |
47 | + this.updateTitleOffset(); | ||
48 | + } | ||
49 | + | ||
50 | + if (get(this, '$yoho.isiOS')) { | ||
46 | style.transform = `translate3d(${-stepPercent * this.offsetLeft}px, 0, 0)`; | 51 | style.transform = `translate3d(${-stepPercent * this.offsetLeft}px, 0, 0)`; |
47 | } else { | 52 | } else { |
48 | - this.updateTitleOffset(); | 53 | + style.transform = `translate3d(${this.stepPercent > 0.86 ? -this.offsetLeft : 0}px, 0, 0)`; |
49 | } | 54 | } |
50 | 55 | ||
51 | return style; | 56 | return style; |
@@ -14,6 +14,14 @@ let jsApiList = [ | @@ -14,6 +14,14 @@ let jsApiList = [ | ||
14 | 'onMenuShareQZone' | 14 | 'onMenuShareQZone' |
15 | ]; | 15 | ]; |
16 | 16 | ||
17 | +const setWxShareData = function() { | ||
18 | + window.wx.onMenuShareTimeline(shareData); | ||
19 | + window.wx.onMenuShareAppMessage(shareData); | ||
20 | + window.wx.onMenuShareQQ(shareData); | ||
21 | + window.wx.onMenuShareQZone(shareData); | ||
22 | + window.wx.onMenuShareWeibo(shareData); | ||
23 | +}; | ||
24 | + | ||
17 | function loadScript(url, success) { | 25 | function loadScript(url, success) { |
18 | const head = document.getElementsByTagName('head')[0]; | 26 | const head = document.getElementsByTagName('head')[0]; |
19 | let script = document.createElement('script'); | 27 | let script = document.createElement('script'); |
@@ -80,6 +88,10 @@ function init(qs) { | @@ -80,6 +88,10 @@ function init(qs) { | ||
80 | signature: res.signature, | 88 | signature: res.signature, |
81 | jsApiList: jsApiList | 89 | jsApiList: jsApiList |
82 | }); | 90 | }); |
91 | + | ||
92 | + window.wx.ready(function() { | ||
93 | + setWxShareData(); | ||
94 | + }); | ||
83 | } | 95 | } |
84 | }) | 96 | }) |
85 | }); | 97 | }); |
@@ -103,12 +115,18 @@ export default { | @@ -103,12 +115,18 @@ export default { | ||
103 | setShareInfo(data) { | 115 | setShareInfo(data) { |
104 | Object.assign(shareData, data); | 116 | Object.assign(shareData, data); |
105 | 117 | ||
118 | + shareData.link = shareData.link || location.href; | ||
119 | + | ||
120 | + if (window.wx) { | ||
121 | + setWxShareData(); | ||
122 | + } | ||
123 | + | ||
106 | setTimeout(function() { | 124 | setTimeout(function() { |
107 | window.setShareInfo({ | 125 | window.setShareInfo({ |
108 | title: shareData.title, | 126 | title: shareData.title, |
109 | summary: shareData.desc, | 127 | summary: shareData.desc, |
110 | pic: shareData.imgUrl, | 128 | pic: shareData.imgUrl, |
111 | - url: shareData.link || location.href | 129 | + url: shareData.link |
112 | }); | 130 | }); |
113 | }, window.setShareInfo ? 0 : 300); | 131 | }, window.setShareInfo ? 0 : 300); |
114 | } | 132 | } |
-
Please register or login to post a comment