secondReward.vue 3.4 KB

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