secondReward.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <layout bgImgName="second-reward-img" bgColor="#f64d5d" bgHeight="219">
  3. <div class="second-reward">
  4. <div class="second-reward-title">
  5. <img
  6. src="@/assets/image/claimCloudPhone/second-reward-title.png"
  7. alt=""
  8. />
  9. </div>
  10. <div>
  11. <div class="application">
  12. <div
  13. v-for="item in applicationList"
  14. :key="item"
  15. :class="{ active: item === imgName }"
  16. @click="selectApplication(item)"
  17. >
  18. <img
  19. src="@/assets/image/claimCloudPhone/active-checked.png"
  20. alt=""
  21. v-if="item === imgName"
  22. />
  23. {{ item }}
  24. </div>
  25. </div>
  26. </div>
  27. <img
  28. :src="
  29. require(`@/assets/image/claimCloudPhone/${
  30. this.imgIndex
  31. ? `installApps_${this.imgIndex}`
  32. : 'second-reward-empty'
  33. }.png`)
  34. "
  35. alt=""
  36. class="install-apps-img"
  37. />
  38. <img
  39. :src="
  40. require(`@/assets/image/claimCloudPhone/${
  41. imgName
  42. ? 'claim-mobile-phone-btn'
  43. : 'claim-mobile-phone-btn-prohibit'
  44. }.png`)
  45. "
  46. alt=""
  47. class="btn"
  48. @click="toPurchase"
  49. />
  50. </div>
  51. </layout>
  52. </template>
  53. <script>
  54. import layout from './components/layout';
  55. export default {
  56. auth: false,
  57. name: 'secondReward',
  58. head: {
  59. title: '0元购机,尽情享受',
  60. },
  61. data() {
  62. return {
  63. applicationList: [
  64. '飞书',
  65. '钉钉',
  66. '企业微信',
  67. '梦幻西游',
  68. '闲鱼之王',
  69. '寻道大千',
  70. '部落冲突',
  71. '传奇',
  72. '倩女幽魂',
  73. ], // 应用数组
  74. imgIndex: '',
  75. imgName: '',
  76. };
  77. },
  78. components: { layout },
  79. methods: {
  80. selectApplication(name) {
  81. this.imgIndex = this.applicationList.indexOf(name) + 1;
  82. this.imgName = name;
  83. },
  84. toPurchase() {
  85. if (!this.imgName) return;
  86. // 埋点
  87. this.$axios
  88. .$post('public/v5/User/selects/addApplication', {
  89. applicationName: this.imgName,
  90. })
  91. .then((res) => {});
  92. localStorage.removeItem('activityPurchaseVisible');
  93. this.$router.push('/claimCloudPhone/purchase');
  94. },
  95. },
  96. };
  97. </script>
  98. <style lang="less" scoped>
  99. .second-reward {
  100. height: 100%;
  101. box-sizing: border-box;
  102. padding-top: 210px;
  103. .second-reward-title {
  104. &>img{
  105. height: 15px;
  106. width: 100%;
  107. }
  108. }
  109. .application {
  110. padding: 0 16px;
  111. margin-top: 24px;
  112. display: grid;
  113. grid-gap: 16px;
  114. grid-template-columns: repeat(3, 1fr);
  115. & > div {
  116. font-family: PingFangSC, PingFang SC;
  117. font-weight: 400;
  118. font-size: 14px;
  119. color: #742428;
  120. line-height: 20px;
  121. text-align: center;
  122. font-style: normal;
  123. background: #fff1e1;
  124. border-radius: 14px;
  125. opacity: 0.8;
  126. padding: 11px 0;
  127. &.active {
  128. opacity: 1;
  129. position: relative;
  130. & > img {
  131. position: absolute;
  132. top: -5px;
  133. right: 0px;
  134. width: 16px;
  135. height: 16px;
  136. z-index: 1;
  137. }
  138. }
  139. }
  140. }
  141. .btn {
  142. display: block;
  143. margin: 0 auto;
  144. height: 56px;
  145. }
  146. .install-apps-img {
  147. height: 130px;
  148. width: 95%;
  149. display: block;
  150. margin: 24px auto 20px;
  151. }
  152. }
  153. </style>