index.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="content">
  3. <base-nav ></base-nav>
  4. <view class="top"><image src="../../static/img/index/index.png" mode="" class="bg"></image></view>
  5. <view class="box">
  6. <view v-for="(item, index) in list" :key="index">
  7. <view class="discounts">
  8. <image src="../../static/img/index/youhui1.png" mode="" class="discounts1"></image>
  9. <view class="money">
  10. <text>{{ item.money*2 }}</text>
  11. </view>
  12. <view class="baodan" @click="baodan(item.id)">{{$t('hea.ckxq')}}</view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="index1">
  17. <image src="../../static/img/index/index1.png" mode=""></image>
  18. <!-- <view class="bottom"></view> -->
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. import baseNav from '@/pages/public/nav.vue';
  24. import { mapState, mapMutations } from 'vuex';
  25. import { activityList } from '@/api/active.js';
  26. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  27. import store from '../../store/index.js'
  28. export default {
  29. components: {
  30. baseNav,
  31. },
  32. computed: {
  33. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  34. },
  35. data() {
  36. return {
  37. list: [],
  38. revenueList: []
  39. };
  40. },
  41. onShow() {
  42. if (this.hasLogin) {
  43. this.loadData();
  44. } else {
  45. let obj = this
  46. uni.showModal({
  47. title: obj.$t('hea.login'),
  48. content: obj.$t('hea.logininfo'),
  49. success: e => {
  50. if (e.confirm) {
  51. saveUrl();
  52. interceptor();
  53. }
  54. },
  55. fail: e => {
  56. console.log(e);
  57. }
  58. });
  59. }
  60. },
  61. methods: {
  62. baodan(id) {
  63. uni.navigateTo({
  64. url: '/pages/index/infoDetail?id=' + id
  65. });
  66. },
  67. loadData() {
  68. activityList({}).then(({ data }) => {
  69. data.list.forEach(e => {
  70. let money = e.money * 1;
  71. let money1 = this.unit(e.money * 1 * 5);
  72. let money2 = this.unit(e.money * 1 * 25);
  73. let money3 = this.unit(e.money * 1 * 125);
  74. let money4 = this.unit(e.money * 1 * 625);
  75. let money5 = this.unit(e.money * 1 * 3125);
  76. let money6 = this.unit(e.money * 1 * 15625);
  77. let money7 = this.unit(e.money * 1 * 78125);
  78. e.revenueList = [];
  79. e.revenueList[0] = '5人x' + money + '元=' + money1;
  80. e.revenueList[1] = '25人x' + money + '元=' + money2;
  81. e.revenueList[2] = '125人x' + money + '元=' + money3;
  82. e.revenueList[3] = '625人x' + money + '元=' + money4;
  83. e.revenueList[4] = '3125人x' + money + '元=' + money5;
  84. e.revenueList[5] = '15625人x' + money + '元=' + money6;
  85. e.revenueList[6] = '78125人x' + money + '元=' + money7;
  86. });
  87. this.list = data.list;
  88. });
  89. },
  90. unit(num) {
  91. let i = 0;
  92. if (num / 10000 >= 1) {
  93. i = num / 10000 + '万元';
  94. if (num / 100000000 >= 1) {
  95. i = num / 100000000 + '亿元';
  96. }
  97. } else {
  98. i = num + '元';
  99. }
  100. return i;
  101. }
  102. }
  103. };
  104. </script>
  105. <style lang="scss" scoped>
  106. page {
  107. height: auto;
  108. }
  109. .content {
  110. .top {
  111. position: relative;
  112. display: flex;
  113. flex-direction: column;
  114. z-index: 10;
  115. .bg {
  116. width: 100%;
  117. height: 1480rpx;
  118. }
  119. }
  120. .box {
  121. .discounts {
  122. margin: 20rpx 30rpx;
  123. display: flex;
  124. justify-content: center;
  125. position: relative;
  126. width: 690rpx;
  127. height: 890rpx;
  128. z-index: 30;
  129. .discounts1 {
  130. width: 100%;
  131. height: 100%;
  132. }
  133. .money {
  134. margin: 0 auto;
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. top: 0;
  139. margin-top: 250rpx;
  140. font-size: 36rpx;
  141. font-family: Source Han Sans CN;
  142. font-weight: bold;
  143. color: #c63535;
  144. line-height: 30rpx;
  145. position: absolute;
  146. text {
  147. font-size: 116rpx;
  148. font-family: Source Han Sans CN;
  149. font-weight: 800;
  150. color: #c63535;
  151. line-height: 115rpx;
  152. }
  153. }
  154. .baodan {
  155. position: absolute;
  156. top: 690rpx;
  157. width: 300rpx;
  158. height: 80rpx;
  159. text-align: center;
  160. line-height: 80rpx;
  161. color: #ffffff;
  162. background: #4e2c0e;
  163. font-size: 40rpx;
  164. border-radius: 10rpx;
  165. }
  166. }
  167. .earnings-box {
  168. z-index: 100;
  169. position: relative;
  170. margin: 40rpx 30rpx;
  171. width: 690rpx;
  172. height: 1140rpx;
  173. .earnings {
  174. width: 100%;
  175. height: 100%;
  176. }
  177. .text-box {
  178. position: absolute;
  179. top: 184rpx;
  180. left: 110rpx;
  181. .textDetail {
  182. min-height: 134rpx;
  183. max-height: 140rpx;
  184. overflow: hidden;
  185. padding-bottom: 64rpx;
  186. .textDetail-title {
  187. font-size: 28rpx;
  188. font-family: PingFang SC;
  189. font-weight: bold;
  190. color: #4e2c0e;
  191. line-height: 30rpx;
  192. padding-bottom: 10rpx;
  193. }
  194. .textDetail-content {
  195. font-size: 30rpx;
  196. font-family: PingFang SC;
  197. font-weight: bold;
  198. color: #4e2c0e;
  199. line-height: 30rpx;
  200. }
  201. }
  202. }
  203. }
  204. }
  205. .index1 {
  206. margin-top: -400rpx;
  207. width: 100%;
  208. height: 713rpx;
  209. image {
  210. width: 100%;
  211. height: 100%;
  212. }
  213. .bottom {
  214. width: 100%;
  215. height: 100rpx;
  216. }
  217. }
  218. }
  219. </style>