secondReward.vue 3.4 KB

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