123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- <template>
- <view class='member-center'>
- <view class='header'>
- <swiper class="swiper" :current="swiperIndex" previous-margin="55rpx" next-margin="55rpx"
- @change="swiperChange" :indicator-dots="true">
- <block v-for="(item, index) in distributionLevel" :key="index">
- <swiper-item>
- <view class="swiper-item" v-if="item.image" :class="{on: swiperIndex == index}"
- :style="{'background-image': 'url('+item.image+')'}">
- <view class="acea-row row-middle user-wrap">
- <image class="image" :src="item.icon"></image>
- <view class="user-msg">
- <view class="text">
- <view class="name">{{item.name}}</view>
- <view class="level">
- {{item.explain }}
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="swiper-item" v-else :class="{on: swiperIndex == index}"
- style="background: #333333;">
- <view class="acea-row row-middle user-wrap">
- <image class="image" :src="item.icon"></image>
- <view class="user-msg">
- <view class="text">
- <view class="name">{{item.name}}</view>
- <view class="level">
- {{item.explain }}
- </view>
- </view>
- </view>
- </view>
- </view>
- </swiper-item>
- </block>
- </swiper>
- </view>
- <view class="info" v-if="task.length != 0">
- <view class="info-title">
- 任务说明:
- </view>
- <view class="info-main">
- <view class="info-item flex" v-for="(item,index) in task">
- <view class="info-name">
- {{item.name}}
- </view>
- <view class="info-success" v-if="item.finish == 1">
- 已完成
- </view>
- <view class="info-success" v-if="item.finish != 1">
- {{item.task_type_title}}
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- agentLevelList,
- agentLevelTaskList
- } from '@/api/user.js';
- import {
- toLogin
- } from '@/libs/login.js';
- import {
- mapGetters
- } from "vuex";
- export default {
- data() {
- return {
- distributionLevel: [],
- swiperIndex: 0,
- task: [], //任务列表
- level_id: 0, //任务id,
- grade: 0,
- };
- },
- watch: {
- distributionLevel: function() {
- let that = this;
- if (that.distributionLevel.length > 0) {
- that.distributionLevel.forEach(function(item, index) {
- if (item.is_clear === false) {
- // that.swiper.slideTo(index);
- that.activeIndex = index;
- that.grade = item.grade;
- }
- });
- }
- },
- },
- onLoad() {
- this.agentLevelList();
- },
- methods: {
- agentLevelList: function() {
- agentLevelList().then(({
- data
- }) => {
- this.distributionLevel = data.list;
- this.level_id = this.distributionLevel[this.swiperIndex].id
- this.getTask();
- });
- },
- /**
- * 会员切换
- *
- */
- swiperChange(e) {
- let index = e.detail.current;
- this.swiperIndex = index;
- this.level_id = this.distributionLevel[index].id || 0;
- this.getTask();
- },
- /**
- * 获取任务要求
- */
- getTask: function() {
- let that = this;
- that.taskNum = 0
- agentLevelTaskList({}, this.level_id).then(res => {
- that.task = res.data.task
- });
- }
- },
- }
- </script>
- <style lang="scss" scoped>
- page {
- background: #f5f5f5;
- }
- .swiper {
- width: 700rpx;
- margin: 0 auto;
- height: 285rpx;
- .swiper-item {
- height: 100%;
- border-radius: 6rpx;
- background-color: #333333;
- background: center/100% 100% no-repeat;
- transform: scale(0.9);
- transition: all 0.2s ease-in 0s;
- line-height: 1.1;
- &.on {
- transform: none;
- }
- }
- .user-wrap {
- padding-top: 20rpx;
- padding-left: 22rpx;
- line-height: 1.1;
- .image {
- width: 90rpx;
- height: 90rpx;
- border-radius: 50%;
- }
- .user-msg {
- margin-left: 14rpx;
- .text {
- flex: 1;
- display: flex;
- align-items: center;
- min-width: 0;
- font-size: 22rpx;
- color: #666666;
- .num {
- margin-right: 10rpx;
- margin-left: 10rpx;
- font-size: 30rpx;
- font-style: italic;
- }
- }
- }
- .name {
- flex: 1;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- font-weight: bold;
- font-size: 28rpx;
- color: #fff;
- margin-right: 8rpx;
- }
- .state {
- position: absolute;
- top: 0rpx;
- right: 0;
- width: 70rpx;
- height: 70rpx;
- .lock {
- width: 100%;
- height: 100%;
- }
- }
- }
- .grow-wrap {
- padding-left: 34rpx;
- margin-top: 70rpx;
- font-size: 20rpx;
- color: #474747;
- display: flex;
- .num {
- margin-right: 8rpx;
- margin-left: 8rpx;
- font-size: 26rpx;
- }
- }
- .level {
- font-size: 24rpx;
- color: #fff;
- border-radius: 4rpx;
- border: 1px solid #fff;
- padding: 3rpx 8rpx;
- }
- }
- .member-center .header {
- // height: 470rpx;
- padding-top: 37rpx;
- }
- .member-center .header swiper {
- position: relative;
- // height: 330rpx;
- }
- .member-center .growthValue {
- background-color: #fff;
- border-radius: 16rpx;
- position: fixed;
- top: 266rpx;
- left: 50%;
- width: 560rpx;
- min-height: 440rpx;
- margin-left: -280rpx;
- z-index: 99;
- transform: translate3d(0, -200%, 0);
- transition: all .3s cubic-bezier(.25, .5, .5, .9);
- }
- .member-center .growthValue.on {
- transform: translate3d(0, 0, 0);
- }
- .member-center .growthValue .pictrue {
- width: 100%;
- height: 257rpx;
- position: relative;
- }
- .member-center .growthValue .pictrue image {
- width: 100%;
- height: 100%;
- border-radius: 16rpx 16rpx 0 0;
- }
- .member-center .growthValue .conter {
- padding: 0 35rpx;
- font-size: 30rpx;
- color: #333;
- margin-top: 58rpx;
- line-height: 1.5;
- height: 350rpx;
- overflow: auto;
- }
- .member-center .growthValue .iconfont {
- position: absolute;
- font-size: 65rpx;
- color: #fff;
- bottom: -90rpx;
- left: 50%;
- transform: translateX(-50%);
- }
- .swiper .level-sty {
- opacity: 0.7;
- }
- .info {
- margin-top: 40rpx;
- padding: 0 20rpx;
- .info-title {
- font-size: 34rpx;
- }
- .info-main {
- margin-top: 40rpx;
- .info-item {
- width: 100%;
- padding: 10px 25rpx;
- border-radius: 10rpx;
- margin-top: 20rpx;
- background-color: #ffffff;
- box-shadow: 0 5rpx 10rpx 0 #F8F8F8;
- .info-name {
- font-size: 28rpx;
- }
- .info-success {
- font-size: 24rpx;
- color: red;
- }
- }
- }
- }
- </style>
|