123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451 |
- <template>
- <view class="center">
- <view class="top">
- <view class="vheigh"></view>
- <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image>
- <view class="top-main flex">
- <view class="search-box flex" @click="clickSearch()">
- <image class="search" src="../../static/img/search.png" mode=""></image>
- <view class="search-font">输入关键词搜索</view>
- </view>
- </view>
- </view>
- <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
- <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
- @click="bannerNavToUrl(item)">
- <image :src="item.pic" />
- </swiper-item>
- </swiper>
- <view class="tongz flex">
- <view>
- <view class="tongz-bg">
- <image src="../../static/img/tongz-bg.png" mode=""></image>
- </view>
- <view class="tongz-left flex">
- <image class="image-left" src="../../static/img/ling.png" mode=""></image>
- <u-notice-bar style="width: 100%;" mode="vertical" type="none" :volume-icon="false"
- :more-icon="false" :list="text"></u-notice-bar>
- </view>
- </view>
- </view>
- <view class="navbar-box">
- <view class="navbar-title">
- <image class="navbar-icon" src="../../static/icon/title-icon.png" mode=""></image>
- <view class="navbar-font">
- 分红数据
- </view>
- </view>
- <view class="navbar-main">
- <view class="navbar-item">
- <view class="item-num">{{now_jjfh}}</view>
- <view class="item-font">当前分红基金</view>
- </view>
- <view class="xian"></view>
- <view class="navbar-item">
- <view class="item-num">{{now_num}}</view>
- <view class="item-font">当前每股股价</view>
- </view>
- <view class="xian"></view>
- <view class="navbar-item">
- <view class="item-num">{{my_num}}</view>
- <view class="item-font">我的当前股数</view>
- </view>
- <view class="xian"></view>
- <view class="navbar-item">
- <view class="item-num">{{my_money}}</view>
- <view class="item-font">我的当前分红</view>
- </view>
- </view>
- </view>
- <view class="main-box">
- <view class="main-item" @click="nav('/pages/navigation/bdjj?money='+bd_money)">
- <image class="main-image" src="../../static/icon/n1.png" mode="widthFix"></image>
- <view class="main-num">¥{{bd_money}}</view>
- <view class="main-font">报单奖金</view>
- </view>
- <view class="main-item" @click="nav('/pages/navigation/tdjj?money='+team_money)">
- <image class="main-image" src="../../static/icon/n2.png" mode="widthFix"></image>
- <view class="main-num">¥{{team_money}}</view>
- <view class="main-font">团队奖金</view>
- </view>
- <view class="main-item" @click="nav('/pages/navigation/fhsy?money='+fh_money)">
- <image class="main-image" src="../../static/icon/n3.png" mode="widthFix"></image>
- <view class="main-num">¥{{fh_money}}</view>
- <view class="main-font">分红收益</view>
- </view>
- <view class="main-item" @click="nav('/pages/navigation/team')">
- <image class="main-image" src="../../static/icon/n4.png" mode="widthFix"></image>
- <view class="main-num">{{team}}</view>
- <view class="main-font">我的团队</view>
- </view>
- <view class="main-item" @click="nav('/pages/user/shareQrCode')">
- <image class="main-image" src="../../static/icon/n5.png" mode="widthFix"></image>
- <view class="main-font">邀请好友</view>
- </view>
- <view class="main-item" @click="nav('/pages/set/userinfo')">
- <image class="main-image" src="../../static/icon/n6.png" mode="widthFix"></image>
- <view class="main-font">个人资料</view>
- </view>
- <view class="main-item" @click="nav('/pages/money/withdrawal?way=brokerage_price')">
- <image class="main-image" src="../../static/icon/n7.png" mode="widthFix"></image>
- <view class="main-font">发起提现</view>
- </view>
- <view class="main-item" @click="nav('/pages/navigation/productlist')">
- <image class="main-image" src="../../static/icon/n8.png" mode="widthFix"></image>
- <view class="main-font">产品咨讯</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- loadIndexs,
- order_info
- } from '@/api/index.js';
- import {
- link
- } from '@/api/user.js';
- import {
- mapState,
- mapMutations
- } from 'vuex';
- export default {
- data() {
- return {
- current: 0,
- titleNViewBackground: '',
- swiperCurrent: 0,
- swiperLength: 0,
- carouselList: [], //轮播图列表
- text: ['双模式 双系统 开创第三代新零售'],
- now_jjfh: 0,
- now_num: 0,
- my_num: 0,
- my_money: 0,
- bd_money: 0,
- team_money: 0,
- fh_money: 0,
- team: 0,
- timers: '',
- };
- },
- onShow() {
- this.loadData();
- },
- onHide() {
- clearTimeout(this.timers);
- console.log(this.timers, 'onhide');
- },
- // 监听页面卸载
- onUnload() {
- // 关闭倒计时
- clearTimeout(this.timers);
- console.log(this.timers, 'unload');
- },
- // 监听页面后退
- onBackPress() {
- // 关闭倒计时
- clearTimeout(this.timers);
- console.log(this.timers, 'back');
- },
- methods: {
- ...mapMutations(['setLat', 'setLon', 'setChoose']),
- loadData() {
- this.getorder()
- loadIndexs({})
- .then(({
- data
- }) => {
- let goods = data.info;
- this.dataList = goods.bastList; //精品推荐
- this.carouselList = data.banner;
- })
- .catch(e => {});
- link({
- page: 1,
- limit: 1,
- })
- .then(({
- data
- }) => {
- this.team = data.total + data.totalLevel
- })
- .catch(e => {
- console.log(e);
- });
- },
- getorder() {
- order_info({}).then(({
- data
- }) => {
- this.timers = setTimeout(this.getorder, 1000);
- this.now_jjfh = data.sum;
- this.now_num = data.every_piece;
- this.my_num = data.user_piece;
- this.my_money = data.award;
- this.bd_money = data.recommend_award;
- this.team_money = data.group_award;
- this.fh_money = data.day_award;
- console.log(this.timers);
- })
- },
- nav(url) {
- uni.navigateTo({
- url,
- fail() {
- uni.switchTab({
- url
- });
- }
- });
- },
- //轮播图切换修改背景色
- swiperChange(e) {
- const index = e.detail.current;
- this.swiperCurrent = index;
- this.titleNViewBackground = this.carouselList[index].background;
- },
- // 點擊搜索框
- clickSearch() {
- uni.navigateTo({
- url: '/pages/product/search'
- });
- },
- }
- };
- </script>
- <style lang="scss">
- page,
- .center {
- min-height: 100%;
- height: auto;
- background: #ffffff;
- }
- .vheigh {
- height: var(--status-bar-height);
- background-color: $base-color;
- }
- .top {
- position: relative;
- width: 100%;
- height: 360rpx;
- .top-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 100%;
- height: 100%;
- }
- .top-main {
- position: relative;
- z-index: 2;
- padding: 30rpx;
- .search-box {
- justify-content: center;
- width: 698rpx;
- height: 60rpx;
- background: rgba(255, 240, 245, 0.4);
- box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
- border-radius: 30rpx;
- .search {
- width: 34rpx;
- height: 34rpx;
- }
- .search-font {
- margin-left: 14rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #ffffff;
- }
- }
- }
- }
- .carousel {
- width: 700rpx;
- height: 276rpx;
- /* #ifndef APP-PLUS */
- margin: -240rpx auto 0;
- /* #endif */
- /* #ifdef APP-PLUS */
- margin: -180rpx auto 0;
- /* #endif */
- border-radius: 40rpx;
- image {
- border-radius: 40rpx;
- width: 700rpx;
- height: 276rpx;
- }
- }
- .tongz {
- width: 690rpx;
- height: 70rpx;
- margin: 32rpx auto 0;
- padding: 18rpx 30rpx 18rpx 24rpx;
- align-items: center;
- position: relative;
- .tongz-bg {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- width: 690rpx;
- height: 70rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .tongz-left {
- width: 640rpx;
- .image-left {
- width: 28rpx;
- height: 34rpx;
- }
- .tongz-font {
- margin-left: 22rpx;
- font-size: 28rpx;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #0f253a;
- }
- }
- .tongz-right {
- position: relative;
- z-index: 11;
- width: 12rpx;
- height: 26rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .navbar-box {
- width: 700rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- padding: 30rpx 0;
- margin: 40rpx auto 0;
- }
- .navbar-title {
- display: flex;
- align-items: center;
- padding: 0 26rpx 20rpx;
- border-bottom: 1px solid #f5f5f5;
- .navbar-icon {
- width: 30rpx;
- height: 26rpx;
- }
- .navbar-font {
- margin-left: 10rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- }
- .navbar-main {
- padding-top: 45rpx;
- display: flex;
- align-items: center;
- justify-content: space-around;
- line-height: 1;
- .xian {
- width: 1rpx;
- height: 31rpx;
- background: #333333;
- }
- .navbar-item {
- flex: 1;
- display: flex;
- flex-direction: column;
- align-items: center;
- .item-num {
- font-size: 39rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .item-font {
- margin-top: 20rpx;
- font-size: 21rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- }
- }
- }
- .main-box {
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- padding: 10rpx 24rpx;
- }
- .main-item {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- width: 342rpx;
- height: 200rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
- border-radius: 20rpx;
- margin-top: 20rpx;
- line-height: 1;
- .main-image {
- width: 68rpx;
- }
- .main-num {
- margin-top: 20rpx;
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- }
- .main-font {
- margin-top: 20rpx;
- font-size: 26rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #4D4D4D;
- line-height: 21rpx;
- }
- }
- </style>
|