| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <template>
- <div v-loading="loading">
- <div>
- <div class="welcome" :style="getEmpBg(myEmpLv['ICON_TYPE'])">
- <h1>Welcome,{{userName}} <!--欢迎您-->
- <b v-if="verified==='0'" class="text-danger">You do not have real name authentication, please log in the member system to complete the member information and upload ID card.</b><!--您未实名认证,请登录商城系统完善会员资料并上传身份证-->
- </h1>
- <el-row :gutter="0" class="wel-info">
- <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="12">
- <el-row :gutter="10">
- <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">Current System Time:{{nowDateTime}}</el-col> <!--当前系统时间-->
- <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="12">Rank:{{myEmpLv['LEVEL_NAME']!='No Rank'?myEmpLv['LEVEL_NAME']:''}}
- <!--<span v-if="myEmpLv['ICON_TYPE']==0">No Rank</span><img
- :src="getEmpIco(myEmpLv['ICON_TYPE'])" alt=""
- v-for="(o,key) in parseInt(myEmpLv['ICON_NUM'])"
- :key="key" v-if="myEmpLv['ICON_TYPE']>0">-->
- </el-col><!--聘级-->
- <el-col :xs="24" :sm="24" :md="24" :lg="4" :xl="12">Member Level:{{decLvName}}</el-col><!--会员级别-->
- <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">Current Pay Cycle:{{periodNum}}</el-col><!--当前业绩期-->
- <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">Remain BV:{{myRemainPv}}</el-col><!--剩余的PV-->
- <el-col :xs="24" :sm="24" :md="24" :lg="8" :xl="12">Active Deadline Date:{{activeEnd}}</el-col><!--活跃日期截止-->
- </el-row>
- </el-col>
- </el-row>
- </div>
- <div style="display: none;">
- <!-- <el-button type="primary" @click="go('/config/base')">个人设置</el-button>-->
- <el-button type="success" @click="go('/user/index')">Personal Information</el-button><!--个人资料-->
- <!-- <el-button type="danger" @click="go('/user/rec-user')">开拓会员</el-button>-->
- <el-button type="primary" @click="go('/finance/flow-bonus')">Bonus running account</el-button><!--奖金流水-->
- <el-button type="warning" @click="go('/finance/withdraw')">Withdraw record</el-button><!--提现明细-->
- <el-button type="success" @click="go('/finance/perf')">Previous performance</el-button><!--往期业绩-->
- </div>
- </div>
- <el-carousel trigger="click" :height="bannerHeight+'px'">
- <el-carousel-item v-for="(item,key) in slides" :key="key">
- <template v-if="item.TYPE==='1'">
- <router-link :to="`/shop/index`" target="_self" class="islide">
- <img ref="bannerHeight" :src="imageArticle(item.IMAGE)" alt="" @load="imgLoad">
- </router-link>
- </template>
- <template v-else>
- <router-link :to="`/article/detail/${item.CONTENT}`" target="_blank" class="islide">
- <img ref="bannerHeight" :src="imageArticle(item.IMAGE)" alt="" @load="imgLoad">
- </router-link>
- </template>
- </el-carousel-item>
- </el-carousel>
- <el-row :gutter="10" class="news-c">
- <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8" v-for="(item,key) in news" :key="key">
- <el-card class="box-card">
- <div slot="header" class="clearfix">
- <span>{{item.CATE_NAME}}</span>
- <el-button type="text" class="box-card-more">
- <router-link :to="`/article/list/${item.ID}`">more+</router-link>
- </el-button>
- </div>
- <div v-for="(o,k) in item.LISTS" :key="k" class="text item" v-if="item.LISTS.length>0">
- <router-link :to="`/article/detail/${o.ID}`" :title="o.TITLE">{{sub_str(o.TITLE)}}</router-link>
- <span>{{tool.formatDate(o.CREATED_AT,false)}}</span>
- </div>
- <div v-if="item.LISTS.length==0">No content</div><!--暂无内容-->
- </el-card>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import network from '@/utils/network'
- import tool from '@/utils/tool'
- import baseInfo from '@/utils/baseInfo'
- import userInfo from '@/utils/userInfo'
- import countUp from 'vue-countup-v2'
- export default {
- name: 'dashboard_index',
- components: {
- countUp
- },
- mounted () {
- network.getData(`dashboard/index`).then(response => {
- this.myEmpLv.ID = this.baseEmpLevels[response.empLv]['ID']
- this.myEmpLv.LEVEL_NAME = this.baseEmpLevels[response.empLv]['LEVEL_NAME']
- this.myEmpLv.ICON_TYPE = this.baseEmpLevels[response.empLv]['ICON_TYPE']
- this.myEmpLv.ICON_NUM = this.baseEmpLevels[response.empLv]['ICON_NUM']
- this.slides = response.slides
- this.news = response.news
- this.periodNum = response.periodNum
- this.decLvName = response.decLvName
- this.myRemainPv = response.myRemainPv
- this.activeEnd = response.activeEnd
- this.loading = false
- this.imgLoad()
- return network.getData(`dashboard/bonus-num`)
- })
- if (this.verified === '0') {
- // '您未实名认证,请登录商城系统完善会员资料并上传身份证', '请注意'
- this.$confirm('You do not have real name authentication, please log in the member system to complete the member information and upload ID card.', 'Please pay attention', {
- confirmButtonText: 'Confirm', // 确定
- type: 'warning'
- }).then(() => {
- }).catch(() => {
- })
- }
- this.calcTime()
- window.addEventListener('resize', () => {
- this.imgLoad()
- }, false)
- },
- data () {
- return {
- loading: true,
- tool: tool,
- nowTime: tool.getTimestamp(),
- userName: userInfo.userName(),
- verified: userInfo.baseData().VERIFIED,
- baseEmpLevels: baseInfo.empLevels(),
- myEmpLv: {'ID': 0, 'LEVEL_NAME': null, 'ICON_TYPE': 0, 'ICON_NUM': 0},
- slides: [],
- news: [],
- periodNum: '',
- decLvName: '',
- myRemainPv: '',
- activeEnd: '',
- bannerHeight: ''
- }
- },
- computed: {
- nowDateTime: function () {
- return tool.formatDate(this.nowTime)
- }
- },
- methods: {
- getEmpIco (type) {
- if (type) return require('@/assets/emp-ico-' + type + '.png')
- },
- getEmpBg (type) {
- if (type !== 0) return 'backgroundImage:url(' + require('@/assets/emp-bg-' + type + '.png') + ')'
- },
- sub_str (str, len = 15) {
- if (str) return str.slice(0, len)
- },
- calcTime () {
- let obj = this
- setInterval(function () {
- obj.nowTime += 1
- }, 1000)
- },
- go: function (url) {
- this.$router.push(url)
- },
- imgLoad () {
- let _this = this
- if (_this.$refs.bannerHeight) {
- _this.$nextTick(function () {
- _this.bannerHeight = _this.$refs.bannerHeight[0].height
- })
- }
- },
- imageArticle (imageUrl) {
- return tool.getArImage(imageUrl, '/files/')
- }
- }
- }
- </script>
- <style scoped>
- h1 {
- margin-top: 0
- }
- .welcome {
- padding-bottom: 10px;
- background-repeat: no-repeat;
- background-position: right top;
- }
- .wel-info {
- line-height: 36px;
- }
- .wel-info img {
- vertical-align: middle;
- }
- .news-c .el-col .box-card {
- margin-top: 10px;
- }
- .news-c .el-col:nth-child(3n+1) .box-card {
- border-bottom: 4px solid #f34d14;
- }
- .news-c .el-col:nth-child(3n+2) .box-card {
- border-bottom: 4px solid #27a2d3;
- }
- .news-c .el-col:nth-child(3n+3) .box-card {
- border-bottom: 4px solid #1bbc61;
- }
- .box-card-more {
- float: right;
- padding: 3px 10px;
- border: 1px solid #ddd;
- border-radius: 10px;
- }
- .box-card-more a {
- color: #666;
- }
- .box-card-more:hover {
- border-color: #409EFF;
- }
- .box-card .item {
- position: relative;
- line-height: 30px;
- padding-left: 10px;
- }
- .box-card .item:before {
- content: '';
- display: block;
- width: 4px;
- height: 4px;
- background: #f60;
- position: absolute;
- left: 0px;
- top: 14px;
- }
- .box-card .item:after {
- content: '';
- display: table;
- clear: both;
- }
- .box-card .item a {
- color: #333;
- float: left;
- }
- .box-card .item a:hover {
- color: #f60;
- }
- .box-card .item span {
- float: right;
- color: #999;
- font-size: 12px;
- }
- .islide {
- display: block;
- text-align: center;
- }
- .islide img {
- max-width: 100%;
- max-height: 330px;
- }
- </style>
|