index.vue 7.2 KB

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