index.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  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 { children } from '@/api/user.js';
  42. import { getApplyList } from '../../api/apply.js';
  43. import store from '../../store/index.js';
  44. export default {
  45. components: {
  46. baseNav,
  47. },
  48. computed: {
  49. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin']),
  50. ...mapState(['lang'])
  51. },
  52. watch: {
  53. lang(val) {
  54. this.$set(this.tabbar[0], 'text', this.$t('hea.sy'));
  55. this.$set(this.tabbar[1], 'text', this.$t('hea.shlb'));
  56. this.$set(this.tabbar[2], 'text', this.$t('hea.wd'));
  57. }
  58. },
  59. data() {
  60. return {
  61. list: [],
  62. num: 0,
  63. image: ['../../static/img/index/youhui1.png', '../../static/img/index/youhui2.png'],
  64. revenueList: [],
  65. isShow:false,
  66. tabbar: [
  67. {
  68. iconPath: '../../static/tabBar/home.png',
  69. selectedIconPath: '../../static/tabBar/home-action.png',
  70. text: this.$t('hea.sy'),
  71. pagePath: '/pages/index/index'
  72. },
  73. {
  74. iconPath: '../../static/tabBar/center.png',
  75. selectedIconPath: '../../static/tabBar/center-action.png',
  76. text: this.$t('hea.shlb'),
  77. count: 0,
  78. pagePath: '/pages/user/applyList'
  79. },
  80. {
  81. iconPath: '../../static/tabBar/user.png',
  82. selectedIconPath: '../../static/tabBar/user-action.png',
  83. text: this.$t('hea.wd'),
  84. pagePath: '/pages/user/user'
  85. }
  86. ],
  87. showList: []
  88. };
  89. },
  90. onShow() {
  91. if (this.hasLogin) {
  92. let obj = this;
  93. obj.isShow = false;
  94. obj.list = [];
  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. async loadData() {
  120. uni.showLoading({
  121. title:'数据加载中',
  122. })
  123. const obj = this;
  124. await activitys({},1).then(e =>{
  125. children({}, this.userInfo.id).then(({ data }) => {
  126. obj.num = data.length
  127. console.log(e.data.income,'11111')
  128. console.log(obj.num,'22222')
  129. if(e.data.income >= 20000 && obj.num >= 5){
  130. console.log(111111111)
  131. obj.isShow = true
  132. }
  133. activityList({}).then(({ data }) => {
  134. uni.hideLoading()
  135. this.list = data.list;
  136. if(!obj.isShow){
  137. console.log(22222222222222222)
  138. this.list.pop()
  139. }
  140. });
  141. });
  142. })
  143. article({
  144. page: 1,
  145. limit: 10000,
  146. category_id: 14
  147. }).then(({ data }) => {
  148. let arr = [];
  149. data.list.forEach(e => {
  150. arr.push(e.synopsis);
  151. });
  152. this.showList = arr;
  153. });
  154. getApplyList({
  155. page: 1,
  156. limit: 1,
  157. status: 0
  158. }).then(({ data }) => {
  159. this.tabbar[1].count = data.count
  160. });
  161. },
  162. change(index) {
  163. console.log(index);
  164. },
  165. nav(url) {
  166. uni.navigateTo({
  167. url
  168. });
  169. },
  170. goDetails() {
  171. uni.navigateTo({
  172. url: '/pages/index/list'
  173. });
  174. }
  175. }
  176. };
  177. </script>
  178. <style lang="scss" scoped>
  179. page {
  180. height: auto;
  181. }
  182. .content {
  183. .top-top {
  184. height: var(--status-bar-height);
  185. width: 100%;
  186. background: #000;
  187. }
  188. .top {
  189. position: relative;
  190. display: flex;
  191. flex-direction: column;
  192. z-index: 10;
  193. .bg {
  194. width: 100%;
  195. height: 900rpx;
  196. }
  197. .yz {
  198. width: 90%;
  199. height: 700rpx;
  200. margin: 20rpx auto 0;
  201. }
  202. }
  203. .box {
  204. .discounts {
  205. margin: 20rpx 30rpx;
  206. display: flex;
  207. justify-content: center;
  208. position: relative;
  209. width: 690rpx;
  210. height: 890rpx;
  211. z-index: 30;
  212. .discounts1 {
  213. width: 100%;
  214. height: 100%;
  215. }
  216. .money {
  217. margin: 0 auto;
  218. display: flex;
  219. justify-content: center;
  220. align-items: center;
  221. top: 0;
  222. margin-top: 250rpx;
  223. font-size: 36rpx;
  224. font-family: Source Han Sans CN;
  225. font-weight: bold;
  226. color: #c63535;
  227. line-height: 30rpx;
  228. position: absolute;
  229. text {
  230. font-size: 116rpx;
  231. font-family: Source Han Sans CN;
  232. font-weight: 800;
  233. color: #c63535;
  234. line-height: 115rpx;
  235. }
  236. }
  237. .baodan {
  238. position: absolute;
  239. top: 690rpx;
  240. width: 300rpx;
  241. height: 80rpx;
  242. text-align: center;
  243. line-height: 80rpx;
  244. color: #ffffff;
  245. background: #4e2c0e;
  246. font-size: 40rpx;
  247. border-radius: 10rpx;
  248. }
  249. }
  250. .earnings-box {
  251. z-index: 100;
  252. position: relative;
  253. margin: 40rpx 30rpx;
  254. width: 690rpx;
  255. height: 1140rpx;
  256. .earnings {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. .text-box {
  261. position: absolute;
  262. top: 184rpx;
  263. left: 110rpx;
  264. .textDetail {
  265. min-height: 134rpx;
  266. max-height: 140rpx;
  267. overflow: hidden;
  268. padding-bottom: 64rpx;
  269. .textDetail-title {
  270. font-size: 28rpx;
  271. font-family: PingFang SC;
  272. font-weight: bold;
  273. color: #4e2c0e;
  274. line-height: 30rpx;
  275. padding-bottom: 10rpx;
  276. }
  277. .textDetail-content {
  278. font-size: 30rpx;
  279. font-family: PingFang SC;
  280. font-weight: bold;
  281. color: #4e2c0e;
  282. line-height: 30rpx;
  283. }
  284. }
  285. }
  286. }
  287. }
  288. .index1 {
  289. margin-top: -200rpx;
  290. width: 100%;
  291. height: 713rpx;
  292. position: relative;
  293. image {
  294. width: 100%;
  295. height: 100%;
  296. }
  297. .bottom {
  298. height: 200rpx;
  299. width: 90%;
  300. margin: 0 auto;
  301. position: absolute;
  302. bottom: 250rpx;
  303. left: 5%;
  304. }
  305. }
  306. }
  307. .tongz {
  308. width: 690rpx;
  309. height: 70rpx;
  310. margin: 10rpx auto 0;
  311. padding: 18rpx 30rpx 18rpx 24rpx;
  312. align-items: center;
  313. position: relative;
  314. background: #1f2020;
  315. border-radius: 30rpx;
  316. .tongz-bg {
  317. position: absolute;
  318. top: 0;
  319. right: 0;
  320. left: 0;
  321. width: 690rpx;
  322. height: 70rpx;
  323. image {
  324. width: 100%;
  325. height: 100%;
  326. }
  327. }
  328. .tongz-left {
  329. width: 640rpx;
  330. .image-left {
  331. width: 40rpx;
  332. height: 34rpx;
  333. }
  334. .tongz-font {
  335. margin-left: 22rpx;
  336. font-size: 28rpx;
  337. font-family: Source Han Sans CN;
  338. font-weight: 400;
  339. color: #ffffff;
  340. }
  341. }
  342. .tongz-right {
  343. position: relative;
  344. z-index: 11;
  345. width: 12rpx;
  346. height: 26rpx;
  347. image {
  348. width: 100%;
  349. height: 100%;
  350. }
  351. }
  352. }
  353. </style>