index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  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,activitys } 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. isShow:false,
  64. tabbar: [
  65. {
  66. iconPath: '../../static/tabBar/home.png',
  67. selectedIconPath: '../../static/tabBar/home-action.png',
  68. text: this.$t('hea.sy'),
  69. pagePath: '/pages/index/index'
  70. },
  71. {
  72. iconPath: '../../static/tabBar/center.png',
  73. selectedIconPath: '../../static/tabBar/center-action.png',
  74. text: this.$t('hea.shlb'),
  75. count: 0,
  76. pagePath: '/pages/user/applyList'
  77. },
  78. {
  79. iconPath: '../../static/tabBar/user.png',
  80. selectedIconPath: '../../static/tabBar/user-action.png',
  81. text: this.$t('hea.wd'),
  82. pagePath: '/pages/user/user'
  83. }
  84. ],
  85. showList: []
  86. };
  87. },
  88. onShow() {
  89. if (this.hasLogin) {
  90. activitys({},1).then(e =>{
  91. console.log(e.data.income,'11111')
  92. if(e.data.income >= 10000){
  93. obj.isShow = true
  94. }
  95. })
  96. this.loadData();
  97. } else {
  98. let obj = this;
  99. uni.showModal({
  100. title: obj.$t('hea.login'),
  101. content: obj.$t('hea.logininfo'),
  102. success: e => {
  103. if (e.confirm) {
  104. saveUrl();
  105. interceptor();
  106. }
  107. },
  108. fail: e => {
  109. console.log(e);
  110. }
  111. });
  112. }
  113. },
  114. methods: {
  115. baodan(id) {
  116. uni.navigateTo({
  117. url: '/pages/index/infoDetail?id=' + id
  118. });
  119. },
  120. loadData() {
  121. const obj = this;
  122. activityList({}).then(({ data }) => {
  123. this.list = data.list;
  124. if(!obj.isShow){
  125. this.list.pop()
  126. }
  127. });
  128. article({
  129. page: 1,
  130. limit: 10000,
  131. category_id: 14
  132. }).then(({ data }) => {
  133. let arr = [];
  134. data.list.forEach(e => {
  135. arr.push(e.synopsis);
  136. });
  137. this.showList = arr;
  138. });
  139. getApplyList({
  140. page: 1,
  141. limit: 1,
  142. status: 0
  143. }).then(({ data }) => {
  144. this.tabbar[1].count = data.count
  145. });
  146. },
  147. change(index) {
  148. console.log(index);
  149. },
  150. nav(url) {
  151. uni.navigateTo({
  152. url
  153. });
  154. },
  155. goDetails() {
  156. uni.navigateTo({
  157. url: '/pages/index/list'
  158. });
  159. }
  160. }
  161. };
  162. </script>
  163. <style lang="scss" scoped>
  164. page {
  165. height: auto;
  166. }
  167. .content {
  168. .top-top {
  169. height: var(--status-bar-height);
  170. width: 100%;
  171. background: #000;
  172. }
  173. .top {
  174. position: relative;
  175. display: flex;
  176. flex-direction: column;
  177. z-index: 10;
  178. .bg {
  179. width: 100%;
  180. height: 900rpx;
  181. }
  182. .yz {
  183. width: 90%;
  184. height: 700rpx;
  185. margin: 20rpx auto 0;
  186. }
  187. }
  188. .box {
  189. .discounts {
  190. margin: 20rpx 30rpx;
  191. display: flex;
  192. justify-content: center;
  193. position: relative;
  194. width: 690rpx;
  195. height: 890rpx;
  196. z-index: 30;
  197. .discounts1 {
  198. width: 100%;
  199. height: 100%;
  200. }
  201. .money {
  202. margin: 0 auto;
  203. display: flex;
  204. justify-content: center;
  205. align-items: center;
  206. top: 0;
  207. margin-top: 250rpx;
  208. font-size: 36rpx;
  209. font-family: Source Han Sans CN;
  210. font-weight: bold;
  211. color: #c63535;
  212. line-height: 30rpx;
  213. position: absolute;
  214. text {
  215. font-size: 116rpx;
  216. font-family: Source Han Sans CN;
  217. font-weight: 800;
  218. color: #c63535;
  219. line-height: 115rpx;
  220. }
  221. }
  222. .baodan {
  223. position: absolute;
  224. top: 690rpx;
  225. width: 300rpx;
  226. height: 80rpx;
  227. text-align: center;
  228. line-height: 80rpx;
  229. color: #ffffff;
  230. background: #4e2c0e;
  231. font-size: 40rpx;
  232. border-radius: 10rpx;
  233. }
  234. }
  235. .earnings-box {
  236. z-index: 100;
  237. position: relative;
  238. margin: 40rpx 30rpx;
  239. width: 690rpx;
  240. height: 1140rpx;
  241. .earnings {
  242. width: 100%;
  243. height: 100%;
  244. }
  245. .text-box {
  246. position: absolute;
  247. top: 184rpx;
  248. left: 110rpx;
  249. .textDetail {
  250. min-height: 134rpx;
  251. max-height: 140rpx;
  252. overflow: hidden;
  253. padding-bottom: 64rpx;
  254. .textDetail-title {
  255. font-size: 28rpx;
  256. font-family: PingFang SC;
  257. font-weight: bold;
  258. color: #4e2c0e;
  259. line-height: 30rpx;
  260. padding-bottom: 10rpx;
  261. }
  262. .textDetail-content {
  263. font-size: 30rpx;
  264. font-family: PingFang SC;
  265. font-weight: bold;
  266. color: #4e2c0e;
  267. line-height: 30rpx;
  268. }
  269. }
  270. }
  271. }
  272. }
  273. .index1 {
  274. margin-top: -200rpx;
  275. width: 100%;
  276. height: 713rpx;
  277. position: relative;
  278. image {
  279. width: 100%;
  280. height: 100%;
  281. }
  282. .bottom {
  283. height: 200rpx;
  284. width: 90%;
  285. margin: 0 auto;
  286. position: absolute;
  287. bottom: 250rpx;
  288. left: 5%;
  289. }
  290. }
  291. }
  292. .tongz {
  293. width: 690rpx;
  294. height: 70rpx;
  295. margin: 10rpx auto 0;
  296. padding: 18rpx 30rpx 18rpx 24rpx;
  297. align-items: center;
  298. position: relative;
  299. background: #1f2020;
  300. border-radius: 30rpx;
  301. .tongz-bg {
  302. position: absolute;
  303. top: 0;
  304. right: 0;
  305. left: 0;
  306. width: 690rpx;
  307. height: 70rpx;
  308. image {
  309. width: 100%;
  310. height: 100%;
  311. }
  312. }
  313. .tongz-left {
  314. width: 640rpx;
  315. .image-left {
  316. width: 40rpx;
  317. height: 34rpx;
  318. }
  319. .tongz-font {
  320. margin-left: 22rpx;
  321. font-size: 28rpx;
  322. font-family: Source Han Sans CN;
  323. font-weight: 400;
  324. color: #ffffff;
  325. }
  326. }
  327. .tongz-right {
  328. position: relative;
  329. z-index: 11;
  330. width: 12rpx;
  331. height: 26rpx;
  332. image {
  333. width: 100%;
  334. height: 100%;
  335. }
  336. }
  337. }
  338. </style>