index.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. <template>
  2. <view class="container">
  3. <view class="top flex">
  4. <view class="icon1 flex">
  5. <image class="img margin-r-10" src="../../static/shouye/shouye1.png" mode="scaleToFill"></image>
  6. <text class="tet">{{$t('login.a0')}}</text>
  7. </view>
  8. <view class="flex">
  9. <view class="icon2 text clamp margin-r-10" >
  10. {{userInfo.account||'链接钱包'}}
  11. </view>
  12. <view class="icon1 margin-r-10">
  13. <image class="langTip" src="../../static/shouye/shouye2.png" mode="scaleToFill"></image>
  14. </view>
  15. <view class="text1 margin-r-10">
  16. <picker :range="langList" range-key='label' @change="selectLang">
  17. <view>{{label}}</view>
  18. </picker>
  19. </view>
  20. <view class="icon1">
  21. <image class="langTipDom" src="../../static/shouye/shouye3.png" mode="scaleToFill"></image>
  22. </view>
  23. </view>
  24. </view>
  25. <view class="flex item">
  26. <navigator v-for="(item,ind) in gameList" :url="`entertainment?title=${item.name}&id=${item.id}`">
  27. <view class="item-style flex">
  28. <image class="item-tip" :src="`../../static/shouye/index_item_${ind+1}.png`" mode="scaleToFill">
  29. </image>
  30. <view class="name">
  31. {{item.name}}
  32. </view>
  33. <view class="item-next flex-center">
  34. <image src="../../static/img/zhiya1.png" mode="widthFix" class="next-img"></image>
  35. </view>
  36. </view>
  37. </navigator>
  38. </view>
  39. <view class="flex shop-detail-data">
  40. <view class="data-list">
  41. <view class="num-box">
  42. <text>{{active_user}}</text><text class="num-tip">+</text>
  43. </view>
  44. <view class="name">
  45. {{$t('homepledge.活跃用户')}}
  46. </view>
  47. </view>
  48. <view class="data-list">
  49. <view class="num-box">
  50. <text>1000000</text><text class="num-tip">+</text>
  51. </view>
  52. <view class="name">
  53. {{$t('homepledge.累计返奖')}}
  54. </view>
  55. </view>
  56. <view class="data-list">
  57. <view class="num-box">
  58. <text>10000</text><text class="num-tip">+</text>
  59. </view>
  60. <view class="name">
  61. {{$t('homepledge.总用户')}}
  62. </view>
  63. </view>
  64. </view>
  65. <view class="title">
  66. {{$t('homepledge.游戏流程')}}
  67. </view>
  68. <image class="conetnt-img" src="../../static/shouye/index-content.png" mode="widthFix"></image>
  69. <view class="title">
  70. {{$t('homepledge.合作伙伴')}}
  71. </view>
  72. <image class="conetnt-img" src="../../static/shouye/index-bottom.png" mode="widthFix"></image>
  73. <taber tab='index'></taber>
  74. </view>
  75. </template>
  76. <script>
  77. import {
  78. getIndex
  79. } from '@/api/index.js';
  80. import {
  81. getGameList,
  82. } from "@/api/game.js";
  83. import {
  84. mapState,
  85. mapActions,
  86. mapMutations
  87. } from "vuex";
  88. import taber from "@/components/footer/footer.vue";
  89. export default {
  90. components: {
  91. taber
  92. },
  93. data() {
  94. return {
  95. gameList: [],
  96. active_user: '0'
  97. }
  98. },
  99. computed: {
  100. ...mapState({
  101. langList: "langList",
  102. lang: "lang",
  103. }),
  104. ...mapState('user', ['userInfo']),
  105. label() {
  106. const label = this.langList.find((item) => {
  107. console.log(this.lang, item.value);
  108. return item.value == this.lang
  109. }).label;
  110. return label
  111. }
  112. },
  113. onLoad(option) {
  114. // #ifndef MP
  115. if (option.spread) {
  116. // 存储其他邀请人
  117. uni.setStorageSync('spread', option.spread);
  118. }
  119. // #endif
  120. // #ifdef MP
  121. if (option.scene) {
  122. // 存储小程序邀请人
  123. uni.setStorage({
  124. key: 'spread_code',
  125. data: option.scene
  126. });
  127. }
  128. // #endif
  129. },
  130. onShow() {
  131. this.getGameList();
  132. this.loadData();
  133. },
  134. methods: {
  135. ...mapMutations('user', ['setUserInfo', 'login']),
  136. ...mapActions({
  137. setLang: "setLang",
  138. }),
  139. // 请求载入数据
  140. async loadData() {
  141. getIndex({})
  142. .then(({
  143. data
  144. }) => {
  145. this.active_user = data.active_user
  146. console.log(data);
  147. })
  148. .catch(e => {});
  149. },
  150. selectLang(value) {
  151. this.setLang(this.langList[value.detail.value].value);
  152. },
  153. getGameList() {
  154. getGameList().then((res) => {
  155. this.gameList = res.data.list;
  156. if (this.gameList.length > 2) {
  157. this.gameList = this.gameList.slice(0, 2)
  158. }
  159. })
  160. },
  161. },
  162. }
  163. </script>
  164. <style lang="scss">
  165. .container {
  166. width: 100%;
  167. background-color: #000000;
  168. padding-top: var(--status-bar-height);
  169. }
  170. .title {
  171. color: $base-color;
  172. text-align: center;
  173. font-size: 58rpx;
  174. }
  175. .item {
  176. padding: 30rpx;
  177. .item-style {
  178. border-radius: 20rpx;
  179. width: 320rpx;
  180. padding: 30rpx 0;
  181. background-color: #191A1F;
  182. flex-direction: column;
  183. color: #FFFFFF;
  184. font-size: 38rpx;
  185. .item-tip {
  186. width: 209rpx;
  187. height: 209rpx;
  188. }
  189. .name {
  190. font-weight: bold;
  191. }
  192. .item-next {
  193. margin-top: 20rpx;
  194. width: 34rpx;
  195. height: 34rpx;
  196. border-radius: 20rpx;
  197. background-color: $color-yellow;
  198. font-size: 0;
  199. .next-img {
  200. width: 10rpx;
  201. }
  202. }
  203. }
  204. }
  205. .shop-detail-data {
  206. padding: 50rpx 30rpx;
  207. .data-list {
  208. text-align: center;
  209. .num-box {
  210. color: #FFF;
  211. font-size: 40rpx;
  212. font-weight: bold;
  213. .num-tip {
  214. font-size: $font-lg;
  215. color: $color-yellow;
  216. }
  217. }
  218. .name {
  219. font-size: $font-sm;
  220. color: $font-color-disabled;
  221. }
  222. }
  223. }
  224. .conetnt-img {
  225. width: 690rpx;
  226. margin: 30rpx;
  227. margin-top: 50rpx;
  228. }
  229. .top {
  230. font-weight: 500;
  231. padding: 40rpx 30rpx 24rpx 30rpx;
  232. line-height: 1;
  233. .icon1 {
  234. line-height: 0;
  235. .img {
  236. width: 47rpx;
  237. height: 47rpx;
  238. }
  239. .tet {
  240. font-size: 28rpx;
  241. color: #C3A76C;
  242. }
  243. }
  244. .icon2 {
  245. background: #292C3D;
  246. border: 2px solid #414243;
  247. border-radius: 21rpx;
  248. }
  249. .langTip {
  250. width: 34rpx;
  251. height: 34rpx;
  252. }
  253. .langTipDom {
  254. width: 23rpx;
  255. height: 15rpx;
  256. }
  257. .text {
  258. font-size: 24rpx;
  259. color: #FFFFFF;
  260. padding: 10rpx 20rpx;
  261. max-width: 200rpx;
  262. }
  263. .text1 {
  264. font-size: 24rpx;
  265. color: #FFFFFF;
  266. }
  267. }
  268. </style>