MobileGuidePage.vue 8.6 KB

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