MobileGuidePage.vue 6.3 KB

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