123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>首页-创客详情-爽客邦</title>
- <meta name="keywords" content="首页-创客详情-爽客邦">
- <meta name="description" content="首页-创客详情-爽客邦">
- <meta content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,shrink-to-fit=no,user-scalable=no" name="viewport" viewport="cover">
- <meta name="apple-mobile-web-app-capable" content="yes">
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
- <meta content="telephone=no" name="format-detection">
- <meta content="email=no" name="format-detection">
- <meta name="apple-mobile-web-app-title" content="首页-创客详情-爽客邦">
- <meta http-equiv="Cache-Control" content="no-siteapp">
- <link rel="stylesheet" href="./static/css/main.css">
- </head>
- <body id="user_rank_explan">
- <div id="app" style="padding:none;" v-cloak>
- <van-sticky>
- <van-nav-bar class="user_rank_explan_title user_title_normal" title="创客详情" left-arrow @click-left="backbtn" v-if="toptitleisshow">
- <template #left> <img src="./static/images/left.png" alt=""></template>
- </van-nav-bar>
- </van-sticky>
- <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
- <div class="userpanel bordertop df borderbottom ovh">
- <div class="imgbox tc mr12"><img class="headportrait" :src="createrinfo.HeadPhoto" alt=""><img class="grade_rank" :src="gradephoto[createrinfo.UserLevel-1]" alt=""></div>
- <div class="infobox">
- <div class="userinfo df spb">
- <div class="right">
- <div class="name f16"> <span class="mr12">{{createrinfo.RealName}}</span><span>{{createrinfo.MakerCode}}</span></div>
- <div class="phonenumber f12">{{createrinfo.phoneNum}}</div>
- </div>
- <div class="leftbtn">
- <button @click="takephone(createrinfo.Mobile)">联系TA</button>
- </div>
- </div>
- <div class="time c999">注册时间 {{createrinfo.CreateDate}} | 实名时间 {{createrinfo.AuthDate}}</div>
- </div>
- </div>
- <van-tabs class="creater_main_panel creater_tab" v-model="active" sticky @click="checktab" :class="toptitleisshow ? '':'istitletab'">
- <van-tab disabled></van-tab>
- <van-tab title="近七天">
- <div v-if="active === 1">
- <div class="bordertop pl16 pr16 pt16">
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">交易分类占比</div>
- </div>
- <div class="f12 c333"> </div>
- </div>
- <div class="card" ref="transactionclassification"></div>
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">交易趋势图</div>
- </div>
- </div>
- <div class="card" ref="secend"></div>
- </div>
- <div class="ovh ovhbox">
- <div class="btnbox">
- <button v-for="item,index in ActMerchantTrenditem(echartsdata.TradeTrend)" :key="index" :class="ischeck === index ? 'productbtn':''" @click="checkbtn(index)">{{item}}</button>
- </div>
- </div>
- <div class="bordertop pl16 pr16 pt16">
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">新增活动商户分类占比</div>
- </div>
- <div class="f12 c333"> </div>
- </div>
- <div class="card" ref="addmerchantpie"></div>
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">新增活动商户趋势图</div>
- </div>
- </div>
- <div class="card" ref="addmerchantbar"></div>
- </div>
- <div class="ovh ovhbox">
- <div class="btnbox">
- <button v-for="item,index in ActMerchantTrenditem(echartsdata.ActMerchantTrend)" :key="index" :class="ischeck2 === index ? 'productbtn':''" @click="checkbtn2(index)">{{item}}</button>
- </div>
- </div>
- <div class="bordertop pl16 pr16 pt16">
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">创客新增趋势图</div>
- </div>
- </div>
- <div class="card" ref="addmakerbar"></div>
- </div>
- </div>
- </van-tab>
- <van-tab title="近半年">
- <div v-if="active === 2">
- <div class="bordertop pl16 pr16 pt16">
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">交易分类占比</div>
- </div>
- <div class="f12 c333">总交易{{echartsdata.TradeTotal}}元</div>
- </div>
- <div class="card" ref="transactionclassification"></div>
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">交易趋势图</div>
- </div>
- </div>
- <div class="card" ref="secend"></div>
- </div>
- <div class="ovh ovhbox">
- <div class="btnbox">
- <button v-for="item,index in ActMerchantTrenditem(echartsdata.TradeTrend)" :key="index" :class="ischeck === index ? 'productbtn':''" @click="checkbtn(index)">{{item}}</button>
- </div>
- </div>
- <div class="bordertop pl16 pr16 pt16">
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">新增活动商户分类占比</div>
- </div>
- <div class="f12 c333">总参与{{echartsdata.ActTotal}}户</div>
- </div>
- <div class="card" ref="addmerchantpie"></div>
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">新增活动商户趋势图</div>
- </div>
- </div>
- <div class="card" ref="addmerchantbar"></div>
- </div>
- <div class="ovh ovhbox">
- <div class="btnbox">
- <button v-for="item,index in ActMerchantTrenditem(echartsdata.ActMerchantTrend)" :key="index" :class="ischeck2 === index ? 'productbtn':''" @click="checkbtn2(index)">{{item}}</button>
- </div>
- </div>
- <div class="bordertop pl16 pr16 pt16">
- <div class="title df">
- <div class="left df">
- <div class="tips"></div>
- <div class="text c333 f14 b">创客新增趋势图</div>
- </div>
- </div>
- <div class="card" ref="addmakerbar"></div>
- </div>
- </div>
- </van-tab>
- <van-tab disabled></van-tab>
- </van-tabs>
- </van-pull-refresh>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/echarts.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/performanceechart.js"></script>
- <script>
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- isLoading:false,
- toptitleisshow:false,
- active:0,
- createrinfo:[],
- gradephoto:[
- './static/images/grade-k1.png',
- './static/images/grade-k2.png',
- './static/images/grade-k3.png',
- './static/images/grade-k4.png',
- './static/images/grade-k5.png',
- './static/images/grade-k6.png',
- './static/images/grade-k7.png',
- './static/images/grade-k8.png',
- './static/images/grade-k9.png',
- ],
- ischeck:0,
- ischeck2:0,
- echartsdata:{},
- }
- },
- created(){
- this.toptitleisshow = toptitleisshow;
- this.getcreaterinfo();
- this.getcreaterdetail();
- this.echartfn();
- },
- updated() {
- this.createrfn();
- },
- methods: {
- createrfn(){
- this.secendchart(this.ischeck);
- this.addmerchantbarchart(this.ischeck2);
- this.TradePercenttovalue(this.echartsdata.TradePercent);
- this.ActMerchantPercenttovalue(this.echartsdata.ActMerchantPercent);
- this.firstchart();
- },
- onRefresh(){
- this.getcreaterinfo();
- this.getcreaterdetail();
- this.isLoading = false;
- },
- checkbtn(index){
- this.ischeck = index;
- },
- checkbtn2(index){
- this.ischeck2 = index;
- },
- //- 分类交易占比(固定图表)
- firstchart(){
- pieechart(this.$refs.transactionclassification,this.echartsdata.TradePercent);
- pieechart(this.$refs.addmerchantpie,this.echartsdata.ActMerchantPercent);
- barechart(this.$refs.addmakerbar,this.MakerAddtovalue(this.echartsdata.MakerAdd)[0],this.MakerAddtovalue(this.echartsdata.MakerAdd)[1]);
- },
- //- 交易趋势图(随品牌切换)
- secendchart(index){
- barechart(this.$refs.secend,this.TradeTrendechart(this.echartsdata.TradeTrend,index)[0],this.TradeTrendechart(this.echartsdata.TradeTrend,index)[1])
- },
- //- 新增参与商户趋势图(随品牌切换)
- addmerchantbarchart(index){
- barechart(this.$refs.addmerchantbar,this.ActMerchantTrendechart(this.echartsdata.ActMerchantTrend,index)[0],this.ActMerchantTrendechart(this.echartsdata.ActMerchantTrend,index)[1]);
- },
- //- 数值转换为echarts所需数据
- TradePercenttovalue(arr){
- arr.forEach(item=>{item.value = item.TradeAmt;item.name = item.Name});
- },
- //- 数值转换为echarts所需数据
- ActMerchantPercenttovalue(arr){
- arr.forEach(item=>{item.value = item.ActCount;item.name = item.Name});
- },
- //- 新增创客趋势图
- MakerAddtovalue(arr){
- const newarr = [];
- const item1 = [];
- const item2 = [];
- arr.forEach(item=>{
- item1.push(item.TimeString)
- item2.push(item.AddCount)
- });
- newarr.push(item1,item2);
- return newarr;
- },
- //- 新增参与商户趋势图
- ActMerchantTrendechart(arr,index){
- const newarr = [];
- const item1 = [];
- const item2 = [];
- arr[index].Times.forEach(item=>{
- item1.push(item.TimeString);
- item2.push(item.ActCount);
- });
- newarr.push(item1,item2);
- return newarr;
- },
- //- 交易趋势图
- TradeTrendechart(arr,index){
- const newarr = [];
- const item1 = [];
- const item2 = [];
- arr[index].Times.forEach(item=>{
- item1.push(item.TimeString);
- item2.push(item.TradeAmt);
- });
- newarr.push(item1,item2);
- return newarr;
- },
- ActMerchantTrenditem(arr){
- const result = [];
- arr.forEach(item=>{
- result.push(item.Name);
- });
- return result;
- },
- backbtn(){
- PublicLib.GoBack({Level:1});
- },
- async getcreaterdetail(){
- PublicLib.ShowLoading({Message:''});
- const DateKind = this.active === 2 ? 2 : 1;
- const UserId = PublicLib.getCookieInfo('userId');
- const Id= PublicLib.getCookieInfo('querycreaterid');
- const res = await getRequest('/api/v1/users/mymakerdetail',JSON.stringify({Id,UserId,DateKind}));
- if(res.status !== '1') return tips('获取图表信息失败,请重试!');
- PublicLib.HideLoading();
- //- this.echartsdata = res.data;
- },
- echartfn(){
- if(this.active === 2){
- this.echartsdata = {
- TradePercent: [
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() - 3), //产品名称
- TradeAmt: 500.00, //交易额
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() - 2), //产品名称
- TradeAmt: 500.00 //交易额
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() - 1), //产品名称
- TradeAmt: 550.00 //交易额
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth()), //产品名称
- TradeAmt: 500.00 //交易额
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1), //产品名称
- TradeAmt: 580.00 //交易额
- },
- ],
- TradeTrend: [
- {
- Name: '全部', //产品名称
- Times: [
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 4), //交易日期/月份
- TradeAmt: 500.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 3), //交易日期/月份
- TradeAmt: 510.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 2), //交易日期/月份
- TradeAmt: 600.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 1), //交易日期/月份
- TradeAmt: 650.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth()), //交易日期/月份
- TradeAmt: 700.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1), //交易日期/月份
- TradeAmt: 710.00 //交易额
- },
- ]
- },
- ],
- ActMerchantPercent: [
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() - 1), //产品名称
- ActCount: 50 //参与数
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth()), //产品名称
- ActCount: 150 //参与数
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1), //产品名称
- ActCount: 140 //参与数
- }
- ],
- ActMerchantTrend: [
- {
- Name: '全部', //产品名称
- Times: [
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 4), //交易日期/月份
- ActCount: 50.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 3), //交易日期/月份
- ActCount: 51.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 2), //交易日期/月份
- ActCount: 58.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 1), //交易日期/月份
- ActCount: 70.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth()), //交易日期/月份
- ActCount: 90.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1), //交易日期/月份
- ActCount: 98.00 //交易额
- },
- ]
- },
- ],
- MakerAdd: [
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 4), //统计日期/月份
- AddCount: 2 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 3), //统计日期/月份
- AddCount: 6 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 2), //统计日期/月份
- AddCount: 7 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() - 1), //统计日期/月份
- AddCount: 9 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth()), //统计日期/月份
- AddCount: 12 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1), //统计日期/月份
- AddCount: 20 //新增数
- },
- ]}
- } else {
- this.echartsdata = {
- TradePercent: [
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 1), //产品名称
- TradeAmt: 500.00, //交易额
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()), //产品名称
- TradeAmt: 500.00 //交易额
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() + 1), //产品名称
- TradeAmt: 550.00 //交易额
- },
- ],
- TradeTrend: [
- {
- Name: '全部', //产品名称
- Times: [
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 5), //交易日期/月份
- TradeAmt: 500.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 4), //交易日期/月份
- TradeAmt: 510.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 3), //交易日期/月份
- TradeAmt: 600.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 2), //交易日期/月份
- TradeAmt: 650.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 1), //交易日期/月份
- TradeAmt: 700.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()), //交易日期/月份
- TradeAmt: 710.00 //交易额
- },
- ]
- },
- ],
- ActMerchantPercent: [
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 2), //产品名称
- ActCount: 50 //参与数
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() - 1), //产品名称
- ActCount: 150 //参与数
- },
- {
- Name: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()), //产品名称
- ActCount: 140 //参与数
- }
- ],
- ActMerchantTrend: [
- {
- Name: '全部', //产品名称
- Times: [
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-5), //交易日期/月份
- ActCount: 50.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-4), //交易日期/月份
- ActCount: 51.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-3), //交易日期/月份
- ActCount: 58.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-2), //交易日期/月份
- ActCount: 70.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() -1), //交易日期/月份
- ActCount: 90.00 //交易额
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()), //交易日期/月份
- ActCount: 98.00 //交易额
- },
- ]
- },
- ],
- MakerAdd: [
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-5), //统计日期/月份
- AddCount: 2 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-4), //统计日期/月份
- AddCount: 6 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-3), //统计日期/月份
- AddCount: 7 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()-2), //统计日期/月份
- AddCount: 9 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate() -1), //统计日期/月份
- AddCount: 12 //新增数
- },
- {
- TimeString: new Date().getFullYear() + '-' + (new Date().getMonth() + 1) + '-' + (new Date().getDate()), //统计日期/月份
- AddCount: 20 //新增数
- },
- ]};
- }
- },
- async getcreaterinfo(){
- const Id = PublicLib.getCookieInfo('querycreaterid');
- const res = await getRequest('/api/v1/users/personalinfo',JSON.stringify({Id}));
- if(res.status !== '1') return tips('获取创客信息失败,请重试!');
- res.data.phoneNum = hidemiddlenum(res.data.Mobile,3,4);
- //- res.data.CreateDate = res.data.CreateDate.substring(0,10);
- //- res.data.MakerCode = res.data.MakerCode.substring(0,10);
- this.createrinfo = res.data;
- },
- takephone(phonenum){
- PublicLib.PhoneCall(phonenum);
- },
- checktab(){
- this.ischeck = 0;
- this.ischeck2 = 0;
- this.getcreaterdetail();
- },
- }
- });
- </script>
- </body>
- </html>
|