123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- <!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 class="bgcfff">
- <div id="app" v-cloak>
- <van-nav-bar class="camp_title user_title_normal f16" title="我的创客" left-arrow @click-left="goindex" v-if="toptitleisshow">
- <template #left>
- <van-icon name="arrow-left" color="#fff" size="20"></van-icon>
- </template>
- </van-nav-bar>
- <div class="merchant-header merchant-header-back"></div>
- <div class="creater-list ml16 mr16 bgcfff" v-cloak>
- <div class="pt16 pb16 pl16 pr16">
- <van-row>
- <van-col span="12">
- <div class="tc">
- <div class="f18 c333 b mb6">3</div>
- <div class="f12 c999">创客总数</div>
- </div>
- </van-col>
- <van-col span="12">
- <div class="tc">
- <div class="f18 c333 b mb6">0</div>
- <div class="f12 c999">当月新增</div>
- </div>
- </van-col>
- </van-row>
- <div class="creater-total mt16 pt8 pb8 pl16 pr16 bgcfff">
- <div class="df">
- <div class="flex1">
- <div class="df">
- <div class="flex1 f12 c999">已实名总数</div>
- <div class="tr">
- <div class="f12 c333">{{createrinfo.AuthCount}}</div>
- </div>
- </div>
- </div><span class="split ml16 mr16"></span>
- <div class="flex1" @click="norealauth">
- <div class="df">
- <div class="flex1 f12 c999">未实名总数</div>
- <div class="tr">
- <div class="f12 c333">3 ></div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="creater-list-wrapper mt16" v-cloak>
- <van-sticky>
- <div class="pl16 mr16 pt8 pb8 bgcfff">
- <div class="df">
- <div class="f14 c333 b">已实名创客</div>
- <div class="flex1 tr"><span class="mr16 f12 c666" @click="onShowFilter"><span class="vm">筛选</span><img class="vm pl6" src="./static/images/icon-arrow-down@3x.png" alt="" width="12" height="12"></span><span class="f12 c666 vm" @click="gosearch">搜索</span></div>
- </div>
- </div>
- <div class="bb8f7f7f7 bgcfff">
- <van-cell center is-link @click="getcreaterdetail()">
- <template #icon>
- <div class="mr12">
- <van-image :src="userInfo.HeadPhoto" fit="cover" lazy-load round v-if="userInfo.HeadPhoto">
- <template v-slot:loading><img src="./static/images/user-img@3x.png" alt="" width="100%"></template>
- </van-image>
- </div>
- </template>
- <template #title><span class="f14 c333 mr12 vb">{{userInfo.RealName}}</span><span class="f12 c999 vb">注册时间:{{userInfo.CreateDate}}</span></template>
- </van-cell>
- </div>
- </van-sticky>
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" :class="creaters.length === 0 ? 'isnodata':''" style="min-height: 50vh;">
- <van-list v-model="loading" :finished="finished" finished-text="" @load="onLoad" :immediate-check="false">
- <van-empty class="custom-image" image="./static/images/empty-img.png" description="暂无数据" v-if="isnodata"></van-empty>
- <van-cell-group :border="false">
- <van-cell v-for="item,index in creaters" center is-link @click="getcreaterdetail(item.Id)">
- <template #icon>
- <div class="mr12">
- <van-image :src="item.HeadPhoto" fit="cover" lazy-load round v-if="item.HeadPhoto">
- <template v-slot:loading><img src="./static/images/user-img@3x.png" alt="" width="100%"></template>
- </van-image>
- </div>
- </template>
- <template #title><span class="f14 c333 mr12 vb">{{item.RealName}}</span><span class="f12 c999 vb">注册时间:{{item.CreateDate}}</span></template>
- <template #label>
- <div class="f12 c999">本月交易额(元):{{Number(item.ThisMonthTrade) | tofixed2}}</div>
- </template>
- </van-cell>
- </van-cell-group>
- </van-list>
- </van-pull-refresh>
- </div>
- <van-popup class="filterPop" v-model="showFilter" position="bottom" :style="{ height: '80%' }" closeable close-icon-position="top-left" v-cloak>
- <div class="tc pt16 rel">
- <div class="f16 c333">筛选</div>
- </div>
- <div class="pt32 pl16 pr16">
- <div class="f14 c999">交易额排序</div>
- <div class="df dropdown-button mt8">
- <van-button plain v-for="item,index in option" :class="sorttype == item.Id ? 'dropdown-button__active' : ''" @click="onSelectOption(item,index,0)">{{item.text}}</van-button>
- </div>
- </div>
- <div class="pt16 pl16 pr16">
- <div class="f14 c999">注册时间排序</div>
- <div class="df dropdown-button mt8">
- <van-button plain v-for="item,index in option1" :class="sorttype == item.Id ? 'dropdown-button__active' : ''" @click="onSelectOption(item,index,0)">{{item.text}}</van-button>
- </div>
- </div>
- <div class="pt16 pl16 pr16">
- <div class="f14 c999">创客职级</div>
- <div class="df dropdown-button dropdown-button-4 mt8">
- <van-button plain v-for="item,index in option2" :class="selectedOption2 == item.Id ? 'dropdown-button__active' : ''" @click="onSelectOption(item,index,2)">{{item.Name}}</van-button>
- </div>
- </div>
- <van-goods-action class="mall-bottom">
- <van-goods-action-button color="#eee" style="color:#333" type="warning" text="重置" @click="resetbtn"></van-goods-action-button>
- <van-goods-action-button type="danger" text="确认" @click="onClickButton"></van-goods-action-button>
- </van-goods-action>
- </van-popup>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script>
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
-
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- isnodata:false,
- toptitleisshow:true,
- userInfo:{},
- showFilter: false,
- creaters: [],
- sorttype: 1,
- selectedOption2: 0,
- option: [
- { text: '由高到低(默认)', Id: 1 },
- ],
- option1: [
- { text: '由近到远(默认)', Id: 2 },
- ],
- option2: [
- { Name: '全部', Id: 0 },
- ],
- loading: false,
- finished: false,
- refreshing: false,
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- createrinfo:{
- MakerTotal:'',
- ThisMonthCount:'',
- AuthCount:'',
- NotAuthCount:'',
- },
- };
- },
- created() {
- this.getsuerinfo();
- this.getcreatelist();
- this.getranklist();
- this.getscreaterinfo();
- },
- methods: {
- //- 点击筛选
- onShowFilter(){
- this.showFilter = !this.showFilter;
- },
- onLoad() {
- if (this.refreshing) {
- this.creaters = [];
- this.refreshing = false;
- }
- this.pageinfo.PageNum++;
- this.getcreatelist();
- },
- onRefresh() {
- this.pageinfo.PageNum = 0;
- // 清空列表数据
- this.creaters = [];
- this.finished = false;
-
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- this.onLoad();
- },
- //- 条件选择函数
- onSelectOption(item,index,num) {
- switch(num){
- case 0:
- this.sorttype = item.Id;
- break;
- case 2:
- this.selectedOption2 = item.Id;
- break;
- }
- },
- //- 点击确定筛选
- onClickButton() {
- this.showFilter = false;
- this.creaters = [];
- this.getcreatelist();
- },
- //- 重置
- resetbtn(){
- this.sorttype = 1;
- this.selectedOption2 = 0;
- },
- //- 获取职级列表
- async getranklist(){
- const res = await getRequest('/api/v1/userlevelset/list',JSON.stringify({PageSize:10,PageNum:1}));
- if(res.status !== '1') return tips('获取职级列表失败,请重试!')
- this.option2.push(...res.data)
- },
- //- 获取创客列表
- async getcreatelist(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/users/mymakerlist',JSON.stringify({...this.pageinfo,UserLevel:this.selectedOption2,RealName:'',UserId,Sort:this.sorttype}));
- if(res.status !== '1') return tips('获取创客列表失败,请重试!');
- if(res.data.length<this.pageinfo.PageSize) {
- this.finished = true;
- };
- this.creaters.push(...res.data);
- this.creaters = [
- {
- Id: 2, //Id
- CreateDate: "2020-12-25", //创建时间
- HeadPhoto: " http://test.ap.shuangkebang.com/default.png", //头像
- RealName: "爽客邦0000002", //真实姓名
- ThisMonthTrade: "1520.12" //本月交易额
- },
- {
- Id: 3, //Id
- CreateDate: "2020-12-22", //创建时间
- HeadPhoto: " http://test.ap.shuangkebang.com/default.png", //头像
- RealName: "爽客邦0000003", //真实姓名
- ThisMonthTrade: "1820.12" //本月交易额
- },
- {
- Id: 4, //Id
- CreateDate: "2020-12-17", //创建时间
- HeadPhoto: " http://test.ap.shuangkebang.com/default.png", //头像
- RealName: "爽客邦0000004", //真实姓名
- ThisMonthTrade: "2520.12" //本月交易额
- },
- ]
- this.loading = false;
- if(this.creaters.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- //- 获取用户个人信息
- async getsuerinfo(){
- PublicLib.ShowLoading({Message:''});
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/users/personalinfo',JSON.stringify({Id:UserId}));
- if(res.status !== '1') return tips('获取个人信息失败,请重试!');
- PublicLib.HideLoading();
- this.userInfo = res.data;
- console.log(res)
- },
- //- 获取用户创客信息
- async getscreaterinfo(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/users/mymakerdata',JSON.stringify({UserId}));
- if(res.status !== '1') return tips('获取创客信息失败,请重试!');
- this.createrinfo = res.data;
- },
- gosearch(){
- PublicLib.Goto({Url:'creater-search'});
- },
- norealauth(){
- PublicLib.Goto({Url:'creater-norealauth'});
- PublicLib.putCookieInfo('norealauth', Number(this.createrinfo.NotAuthCount));
- },
- getcreaterdetail(id){
- id = id ? id : PublicLib.getCookieInfo('userId');
- PublicLib.putCookieInfo('querycreaterid', id );
- PublicLib.Goto({Url:'maker-details-echarts'});
- },
- goindex(){
- PublicLib.GoBack({Level:1});
- }
- }
- });
- </script>
- </body>
- </html>
|