MobileGuidePage.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  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. export default {
  93. name: 'mobileGuidePage',
  94. props: {
  95. detail: {
  96. type: Object,
  97. },
  98. postBizData: {
  99. type: Object,
  100. },
  101. postUserInfo: {
  102. type: Object,
  103. },
  104. playType: {
  105. type: Number,
  106. },
  107. },
  108. data() {
  109. return {}
  110. },
  111. computed: {
  112. gifUrl() {
  113. let url;
  114. switch(this.playType) {
  115. case 1:
  116. url = require('../static/img/icon-gif-redbag.gif');
  117. break;
  118. case 2:
  119. url = require('../static/img/icon-gif-draw.png');
  120. break;
  121. case 3:
  122. url = require('../static/img/icon-gif-treasure.png');
  123. break;
  124. }
  125. return url;
  126. }
  127. },
  128. methods: {
  129. retweet() {
  130. let redPacketType;
  131. switch(this.playType) {
  132. case 1:
  133. redPacketType = 0;
  134. break;
  135. case 2:
  136. redPacketType = 1;
  137. break;
  138. case 3:
  139. redPacketType = 4;
  140. break;
  141. }
  142. Report.reportLog({
  143. baseInfo: {
  144. mid: getMid(),
  145. pageSource: Report.pageSource.mobileLandingPage,
  146. machineCode: getMid(),
  147. },
  148. params: {
  149. eventData: {
  150. businessType: Report.businessType.buttonClick,
  151. objectType: Report.objectType.rtButton,
  152. postId: this.detail.postId,
  153. redPacketType,
  154. },
  155. },
  156. })
  157. // jump
  158. window.location.href = `https://twitter.com/intent/retweet?tweet_id=${this.detail.repostSrcContentId || this.detail.srcContentId}`;
  159. }
  160. }
  161. }
  162. </script>
  163. <style lang="scss" scoped>
  164. .guide {
  165. width: 100%;
  166. min-height: 100%;
  167. background: linear-gradient(180deg, #cceaff 0%, #ffffff 70.42%);
  168. .header {
  169. position: relative;
  170. height: 240px;
  171. .tips {
  172. display: inline-block;
  173. height: 32px;
  174. color: #FFFFFF;
  175. line-height: 30px;
  176. margin-top: 8px;
  177. font-size: 12px;
  178. padding: 0 18px 0 10px;
  179. background: #1B5277;
  180. border-radius: 0 32px 32px 0;
  181. .icon {
  182. overflow: hidden;
  183. width: 20px;
  184. height: 20px;
  185. margin-right: 6px;
  186. border-radius: 50%;
  187. vertical-align: middle;
  188. }
  189. .special {
  190. color: #FF9737;
  191. font-weight: 700;
  192. }
  193. }
  194. .gif {
  195. width: 150px;
  196. height: 150px;
  197. margin: 40px auto 0;
  198. img {
  199. width: 100%;
  200. height: 100%;
  201. }
  202. }
  203. }
  204. .welcome {
  205. padding: 14px 0;
  206. font-size: 18px;
  207. font-weight: 700;
  208. line-height: 24px;
  209. text-align: center;
  210. background: rgba($color: #FFFFFF, $alpha: .5);
  211. .icon {
  212. overflow: hidden;
  213. width: 22px;
  214. height: 22px;
  215. border-radius: 50%;
  216. vertical-align: middle;
  217. }
  218. .special {
  219. color: #FF9737;
  220. }
  221. }
  222. .footer {
  223. padding: 40px 15px 100px;
  224. color: #6D6D6D;
  225. font-size: 14px;
  226. font-weight: 400;
  227. line-height: 17px;
  228. .item {
  229. position: relative;
  230. padding-left: 38px;
  231. margin-bottom: 16px;
  232. &:last-child {
  233. margin-bottom: 0;
  234. }
  235. .icon {
  236. position: absolute;
  237. left: 0;
  238. }
  239. .special {
  240. color: #1D9BF0;
  241. }
  242. }
  243. }
  244. .retweet {
  245. position: fixed;
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. bottom: 26px;
  250. left: 16px;
  251. right: 16px;
  252. height: 52px;
  253. color: #FFFFFF;
  254. font-size: 18px;
  255. font-weight: 600;
  256. border-radius: 52px;
  257. background: #1D9BF0;
  258. img {
  259. width: 24px;
  260. margin-right: 6px;
  261. }
  262. }
  263. }
  264. </style>