index.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. <template>
  2. <view class="content">
  3. <view class="top-top"></view>
  4. <view class="lange"><base-nav></base-nav></view>
  5. <view class="top">
  6. <image src="../../static/img/index/index.png" mode="" class="bg"></image>
  7. <view class="tongz flex">
  8. <view>
  9. <view class="tongz-left flex" @click="goDetails">
  10. <image class="image-left" src="../../static/img/ling.png" mode=""></image>
  11. <u-notice-bar
  12. style="width: 100%;"
  13. mode="vertical"
  14. type="none"
  15. color="#ffffff"
  16. :volume-icon="false"
  17. :more-icon="true"
  18. :list="showList"
  19. ></u-notice-bar>
  20. </view>
  21. </view>
  22. </view>
  23. <image src="../../static/img/index/yyxx.png" mode="" class="yz"></image>
  24. </view>
  25. <view class="box">
  26. <view v-for="(item, index) in list" :key="index">
  27. <view class="discounts">
  28. <image :src="image[index]" mode="" class="discounts1"></image>
  29. <view class="money">
  30. <text>{{ item.money * 2 }}</text>
  31. </view>
  32. <view class="baodan" @click="baodan(item.id)">{{ $t('hea.ckxq') }}</view>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="index1">
  37. <image src="../../static/img/index/index1.png" mode=""></image>
  38. <view class="bottom" @click="nav('/pages/profit/fund')"><image src="../../static/img/index/bottom.png" mode=""></image></view>
  39. </view>
  40. <u-tabbar :list="tabbar" bg-color="#000" active-color="#FAD6B0" inactive-color="#71614f" change="change"></u-tabbar>
  41. </view>
  42. </template>
  43. <script>
  44. import baseNav from '@/pages/public/nav.vue';
  45. import { mapState, mapMutations } from 'vuex';
  46. import { activityList } from '@/api/active.js';
  47. import { article } from '@/api/index.js';
  48. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  49. import store from '../../store/index.js';
  50. export default {
  51. components: {
  52. baseNav
  53. },
  54. computed: {
  55. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  56. ...mapState(['lang'])
  57. },
  58. watch: {
  59. lang(val) {
  60. this.$set(this.tabbar[0], 'text', this.$t('hea.sy'));
  61. this.$set(this.tabbar[1], 'text', this.$t('hea.shlb'));
  62. this.$set(this.tabbar[2], 'text', this.$t('hea.wd'));
  63. }
  64. },
  65. data() {
  66. return {
  67. list: [],
  68. image: ['../../static/img/index/youhui1.png', '../../static/img/index/youhui2.png'],
  69. revenueList: [],
  70. tabbar: [
  71. {
  72. iconPath: '../../static/tabBar/home.png',
  73. selectedIconPath: '../../static/tabBar/home-action.png',
  74. text: this.$t('hea.sy'),
  75. pagePath: '/pages/index/index'
  76. },
  77. {
  78. iconPath: '../../static/tabBar/center.png',
  79. selectedIconPath: '../../static/tabBar/center-action.png',
  80. text: this.$t('hea.shlb'),
  81. pagePath: '/pages/user/applyList'
  82. },
  83. {
  84. iconPath: '../../static/tabBar/user.png',
  85. selectedIconPath: '../../static/tabBar/user-action.png',
  86. text: this.$t('hea.wd'),
  87. pagePath: '/pages/user/user'
  88. }
  89. ],
  90. showList: []
  91. };
  92. },
  93. onShow() {
  94. if (this.hasLogin) {
  95. this.loadData();
  96. } else {
  97. let obj = this;
  98. uni.showModal({
  99. title: obj.$t('hea.login'),
  100. content: obj.$t('hea.logininfo'),
  101. success: e => {
  102. if (e.confirm) {
  103. saveUrl();
  104. interceptor();
  105. }
  106. },
  107. fail: e => {
  108. console.log(e);
  109. }
  110. });
  111. }
  112. },
  113. methods: {
  114. baodan(id) {
  115. uni.navigateTo({
  116. url: '/pages/index/infoDetail?id=' + id
  117. });
  118. },
  119. loadData() {
  120. activityList({}).then(({ data }) => {
  121. this.list = data.list;
  122. });
  123. article({
  124. page: 1,
  125. limit: 10000,
  126. category_id: 14
  127. }).then(({ data }) => {
  128. let arr = [];
  129. data.list.forEach(e => {
  130. arr.push(e.synopsis);
  131. });
  132. this.showList = arr;
  133. console.log(this.showList);
  134. });
  135. },
  136. change(index) {
  137. console.log(index);
  138. },
  139. nav(url) {
  140. uni.navigateTo({
  141. url
  142. });
  143. },
  144. goDetails() {
  145. uni.navigateTo({
  146. url: '/pages/index/list'
  147. });
  148. }
  149. }
  150. };
  151. </script>
  152. <style lang="scss" scoped>
  153. page {
  154. height: auto;
  155. }
  156. .content {
  157. .top-top {
  158. height: var(--status-bar-height);
  159. width: 100%;
  160. background: #000;
  161. }
  162. .top {
  163. position: relative;
  164. display: flex;
  165. flex-direction: column;
  166. z-index: 10;
  167. .bg {
  168. width: 100%;
  169. height: 900rpx;
  170. }
  171. .yz {
  172. width: 90%;
  173. height: 700rpx;
  174. margin: 20rpx auto 0;
  175. }
  176. }
  177. .box {
  178. .discounts {
  179. margin: 20rpx 30rpx;
  180. display: flex;
  181. justify-content: center;
  182. position: relative;
  183. width: 690rpx;
  184. height: 890rpx;
  185. z-index: 30;
  186. .discounts1 {
  187. width: 100%;
  188. height: 100%;
  189. }
  190. .money {
  191. margin: 0 auto;
  192. display: flex;
  193. justify-content: center;
  194. align-items: center;
  195. top: 0;
  196. margin-top: 250rpx;
  197. font-size: 36rpx;
  198. font-family: Source Han Sans CN;
  199. font-weight: bold;
  200. color: #c63535;
  201. line-height: 30rpx;
  202. position: absolute;
  203. text {
  204. font-size: 116rpx;
  205. font-family: Source Han Sans CN;
  206. font-weight: 800;
  207. color: #c63535;
  208. line-height: 115rpx;
  209. }
  210. }
  211. .baodan {
  212. position: absolute;
  213. top: 690rpx;
  214. width: 300rpx;
  215. height: 80rpx;
  216. text-align: center;
  217. line-height: 80rpx;
  218. color: #ffffff;
  219. background: #4e2c0e;
  220. font-size: 40rpx;
  221. border-radius: 10rpx;
  222. }
  223. }
  224. .earnings-box {
  225. z-index: 100;
  226. position: relative;
  227. margin: 40rpx 30rpx;
  228. width: 690rpx;
  229. height: 1140rpx;
  230. .earnings {
  231. width: 100%;
  232. height: 100%;
  233. }
  234. .text-box {
  235. position: absolute;
  236. top: 184rpx;
  237. left: 110rpx;
  238. .textDetail {
  239. min-height: 134rpx;
  240. max-height: 140rpx;
  241. overflow: hidden;
  242. padding-bottom: 64rpx;
  243. .textDetail-title {
  244. font-size: 28rpx;
  245. font-family: PingFang SC;
  246. font-weight: bold;
  247. color: #4e2c0e;
  248. line-height: 30rpx;
  249. padding-bottom: 10rpx;
  250. }
  251. .textDetail-content {
  252. font-size: 30rpx;
  253. font-family: PingFang SC;
  254. font-weight: bold;
  255. color: #4e2c0e;
  256. line-height: 30rpx;
  257. }
  258. }
  259. }
  260. }
  261. }
  262. .index1 {
  263. margin-top: -200rpx;
  264. width: 100%;
  265. height: 713rpx;
  266. position: relative;
  267. image {
  268. width: 100%;
  269. height: 100%;
  270. }
  271. .bottom {
  272. height: 200rpx;
  273. width: 90%;
  274. margin: 0 auto;
  275. position: absolute;
  276. bottom: 250rpx;
  277. left: 5%;
  278. }
  279. }
  280. }
  281. .tongz {
  282. width: 690rpx;
  283. height: 70rpx;
  284. margin: 10rpx auto 0;
  285. padding: 18rpx 30rpx 18rpx 24rpx;
  286. align-items: center;
  287. position: relative;
  288. background: #1f2020;
  289. border-radius: 30rpx;
  290. .tongz-bg {
  291. position: absolute;
  292. top: 0;
  293. right: 0;
  294. left: 0;
  295. width: 690rpx;
  296. height: 70rpx;
  297. image {
  298. width: 100%;
  299. height: 100%;
  300. }
  301. }
  302. .tongz-left {
  303. width: 640rpx;
  304. .image-left {
  305. width: 40rpx;
  306. height: 34rpx;
  307. }
  308. .tongz-font {
  309. margin-left: 22rpx;
  310. font-size: 28rpx;
  311. font-family: Source Han Sans CN;
  312. font-weight: 400;
  313. color: #ffffff;
  314. }
  315. }
  316. .tongz-right {
  317. position: relative;
  318. z-index: 11;
  319. width: 12rpx;
  320. height: 26rpx;
  321. image {
  322. width: 100%;
  323. height: 100%;
  324. }
  325. }
  326. }
  327. </style>