MobileGuidePage.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <div class="guide" v-if="detail">
  3. <div class="header">
  4. <div class="tips">
  5. <img class="icon" :src="postUserInfo.avatarUrl" />
  6. <span>@{{postUserInfo.nickName}}</span>
  7. <span class="special">{{ playType === 3 ? 'Invite You to Hunt the Treasure' : 'Send You Giveaway!' }}</span>
  8. </div>
  9. <div class="gif">
  10. <img :src="gifUrl" />
  11. </div>
  12. </div>
  13. <div class="welcome">
  14. <!-- 普通红包 -->
  15. <template v-if="playType === 1">
  16. <template v-if="postBizData.rewardType === 1">
  17. <div>
  18. <span>You Won</span>
  19. <img class="icon" :src="postBizData.currencyIconPath" />
  20. <span class="special">{{postBizData.amountValue}} {{postBizData.currencySymbol}}</span>
  21. <span class="special">(${{postBizData.usdAmountValue}})</span>
  22. </div>
  23. <div>
  24. <span>in the Giveaway!</span>
  25. </div>
  26. </template>
  27. <template v-else>
  28. <div>
  29. <span>You Won</span>
  30. <span class="special">{{postBizData.customizedReward}}</span>
  31. </div>
  32. <div>
  33. <span>in the Giveaway!</span>
  34. </div>
  35. </template>
  36. </template>
  37. <!-- 抽奖红包 -->
  38. <template v-if="playType === 2">
  39. <div>
  40. <span>You are gifted an entries to earn</span>
  41. </div>
  42. <template v-if="postBizData.rewardType === 1">
  43. <div>
  44. <img class="icon" :src="postBizData.currencyIconPath" />
  45. <span class="special">{{postBizData.amountValue}} {{postBizData.currencySymbol}}</span>
  46. <span class="special">(${{postBizData.usdAmountValue}})</span>
  47. </div>
  48. </template>
  49. <template v-else>
  50. <div>
  51. <span class="special">{{postBizData.customizedReward}}</span>
  52. </div>
  53. </template>
  54. </template>
  55. <!-- 夺宝红包 -->
  56. <template v-if="playType === 3">
  57. <div>
  58. <span>Complete the quest to win up to</span>
  59. </div>
  60. <div>
  61. <span class="special">${{detail.upGainAmountValue}} for you two!</span>
  62. </div>
  63. </template>
  64. </div>
  65. <div class="footer">
  66. <div class="item">
  67. <img class="icon" src="../static/img/icon-item1.svg" />
  68. <span>First, <span class="special">Retweet</span> this tweet.</span>
  69. </div>
  70. <div class="item">
  71. <img class="icon" src="../static/img/icon-item2.svg" />
  72. <span>When you have access to your <span class="special">laptop</span>, open <span class="special">Chrome</span> and go to <span class="special">twitter.com.</span></span>
  73. </div>
  74. <div class="item">
  75. <img class="icon" src="../static/img/icon-item3.svg" />
  76. <span>Go to your profile page by clicking <span class="special">"Profile"</span> on the left column.</span>
  77. </div>
  78. <div class="item">
  79. <img class="icon" src="../static/img/icon-item4.svg" />
  80. <span>Find the tweet you retweeted, and click the giveaway, you can then install the <span class="special">DeNet Chrome Extension</span> to Get Giveaway.</span>
  81. </div>
  82. </div>
  83. <div class="retweet" @click="retweet">
  84. <img src="../static/img/icon-retweet.svg" />
  85. <span>Retweet</span>
  86. </div>
  87. </div>
  88. </template>
  89. <script>
  90. import Report from '../log-center/log';
  91. import { getMid } from '../utils/help';
  92. import FontZoom from './FontZoom';
  93. export default {
  94. name: 'mobileGuidePage',
  95. props: {
  96. detail: {
  97. type: Object,
  98. },
  99. postBizData: {
  100. type: Object,
  101. },
  102. postUserInfo: {
  103. type: Object,
  104. },
  105. playType: {
  106. type: Number,
  107. },
  108. },
  109. components: {
  110. FontZoom,
  111. },
  112. data() {
  113. return {}
  114. },
  115. computed: {
  116. gifUrl() {
  117. let url;
  118. switch(this.playType) {
  119. case 1:
  120. url = require('../static/img/icon-gif-redbag.gif');
  121. break;
  122. case 2:
  123. url = require('../static/img/icon-gif-draw.png');
  124. break;
  125. case 3:
  126. url = require('../static/img/icon-gif-treasure.png');
  127. break;
  128. }
  129. return url;
  130. }
  131. },
  132. methods: {
  133. retweet() {
  134. let redPacketType;
  135. switch(this.playType) {
  136. case 1:
  137. redPacketType = 0;
  138. break;
  139. case 2:
  140. redPacketType = 1;
  141. break;
  142. case 3:
  143. redPacketType = 4;
  144. break;
  145. }
  146. Report.reportLog({
  147. baseInfo: {
  148. mid: getMid(),
  149. pageSource: Report.pageSource.mobileLandingPage,
  150. machineCode: getMid(),
  151. },
  152. params: {
  153. eventData: {
  154. businessType: Report.businessType.buttonClick,
  155. objectType: Report.objectType.rtButton,
  156. postId: this.detail.postId,
  157. redPacketType,
  158. },
  159. },
  160. })
  161. // jump
  162. window.location.href = `https://twitter.com/intent/retweet?tweet_id=${this.detail.repostSrcContentId || this.detail.srcContentId}`;
  163. }
  164. }
  165. }
  166. </script>
  167. <style lang="scss" scoped>
  168. .guide {
  169. width: 100%;
  170. min-height: 100%;
  171. background: linear-gradient(180deg, #cceaff 0%, #ffffff 70.42%);
  172. .header {
  173. position: relative;
  174. height: 240px;
  175. .tips {
  176. display: inline-block;
  177. height: 32px;
  178. color: #FFFFFF;
  179. line-height: 30px;
  180. margin-top: 8px;
  181. font-size: 12px;
  182. padding: 0 18px 0 10px;
  183. background: #1B5277;
  184. border-radius: 0 32px 32px 0;
  185. .icon {
  186. overflow: hidden;
  187. width: 20px;
  188. height: 20px;
  189. margin-right: 6px;
  190. border-radius: 50%;
  191. vertical-align: middle;
  192. }
  193. .special {
  194. color: #FF9737;
  195. font-weight: 700;
  196. }
  197. }
  198. .gif {
  199. width: 150px;
  200. height: 150px;
  201. margin: 40px auto 0;
  202. img {
  203. width: 100%;
  204. height: 100%;
  205. }
  206. }
  207. }
  208. .welcome {
  209. padding: 14px 0;
  210. font-size: 18px;
  211. font-weight: 700;
  212. line-height: 24px;
  213. text-align: center;
  214. background: rgba($color: #FFFFFF, $alpha: .5);
  215. .icon {
  216. overflow: hidden;
  217. width: 22px;
  218. height: 22px;
  219. border-radius: 50%;
  220. vertical-align: middle;
  221. }
  222. .special {
  223. color: #FF9737;
  224. }
  225. }
  226. .footer {
  227. padding: 40px 15px 100px;
  228. color: #6D6D6D;
  229. font-size: 14px;
  230. font-weight: 400;
  231. line-height: 17px;
  232. .item {
  233. position: relative;
  234. padding-left: 38px;
  235. margin-bottom: 16px;
  236. &:last-child {
  237. margin-bottom: 0;
  238. }
  239. .icon {
  240. position: absolute;
  241. left: 0;
  242. }
  243. .special {
  244. color: #1D9BF0;
  245. }
  246. }
  247. }
  248. .retweet {
  249. position: fixed;
  250. display: flex;
  251. align-items: center;
  252. justify-content: center;
  253. bottom: 26px;
  254. left: 16px;
  255. right: 16px;
  256. height: 52px;
  257. color: #FFFFFF;
  258. font-size: 18px;
  259. font-weight: 600;
  260. border-radius: 52px;
  261. background: #1D9BF0;
  262. img {
  263. width: 24px;
  264. margin-right: 6px;
  265. }
  266. }
  267. }
  268. </style>