123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- <!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>
- <div class="index_current" id="app" v-cloak>
- <van-pull-refresh v-model="isLoading" @refresh="onRefresh" style="min-height:90vh;">
- <van-sticky @change="sticky">
- <div class="fleximg df cm bgcfff" v-if="topisshow"><img src="./static/images/logo-text.png" alt=""></div>
- </van-sticky>
- <van-cell>
- <template #title>
- <div class="df index_userinfo" @click="userinfobtn" v-cloak><img class="userimg" :src="PublicLib.CachePicture({picUrl:userphoto,domid:'indexuserheadimg'})" id="indexuserheadimg"><span class="f16">{{username}}</span><img class="grade" v-for="item,index in grade" v-if="index+1 === rankgrade" :src="item" alt=""></div>
- </template>
- <template #default>
- <div class="df index_userinfo defaultimg" @click="server"><img class="servce" src="./static/images/index-btn1.png" alt=""></div>
- </template>
- </van-cell>
- <van-swipe class="my-swipe" :autoplay="2000" indicator-color="rgba(255,255,255,.8)" v-cloak>
- <van-swipe-item v-for="item,index in banner" :key="index"><img width="100%" :src="PublicLib.CachePicture({picUrl:item.PicPath,domid:'banner' + index})" :id="'banner' + index" fit="cover" lazy-load></van-swipe-item>
- </van-swipe>
- <van-row class="block-padding bb8f7f7f7" v-cloak>
- <van-col span="6"><img class="toutiao-t fl" src="./static/images/logo-text.png" alt="" width="100%"></van-col>
- <van-col span="18">
- <van-swipe :autoplay="5000" style="height:.533333rem" vertical :show-indicators="false" :touchable="false">
- <van-swipe-item v-for="item,index in toutiao" :key="index">
- <div class="toutiao-txt c333 line1">创客{{item.RealName}}又收到{{item.Amount}}奖励</div>
- </van-swipe-item>
- </van-swipe>
- </van-col>
- </van-row>
- <van-grid class="main-btn bb8f7f7f7" :border="false" :icon-size="40" v-cloak>
- <van-grid-item class="gridicon" v-for="item,index in entrancelist" :text="item.Title" @click="entrance(item.Url)">
- <template v-slot:icon><img :src="PublicLib.CachePicture({picUrl:item.Icon,domid:'indexIcon' + index})" :id="'indexIcon' + index"></template>
- </van-grid-item>
- </van-grid>
- <div class="block-padding" v-cloak @click="achievement">
- <div class="df"><strong class="db f16 flex1">本月团队业绩</strong></div>
- <div class="index-card bgcfff bgimg">
- <div class="title df">
- <button class="view_detail f12 bgcfff rel"> 查看详情
- <van-icon class="abs" name="arrow"></van-icon>
- </button>
- </div>
- <div class="tc detail rel">
- <div class="index-num-b f18 b">{{(515421.38 + 945421.02).toFixed(2)}}</div>
- <div class="f12 c333">团队交易额(元)</div>
- <van-row class="pt16 pb8">
- <van-col span="12">
- <div class="index-num-b f16 b">12</div>
- <div class="f12 c333">新增创客</div>
- </van-col>
- <van-col span="12">
- <div class="index-num-b f16 b">85</div>
- <div class="f12 c333">活动商户</div>
- </van-col>
- </van-row><img class="abs people_bgimg" src="./static/images/index-bgimgpeople.png" alt="">
- </div>
- </div>
- </div>
- <div class="block-padding" v-cloak v-if="warehouse.length !== 0"><strong class="db f16">仓库管理</strong>
- <div class="warehouse">
- <div class="col df">
- <div class="posbox df rel" v-for="item in warehouse" :key="item.Id" @click="gowarehouse(item.Id,item.ProductName)"><img class="abs bgimg" src="./static/images/index-warehouse.png" alt="">
- <div>
- <div class="title f14 b">{{item.ProductName}}</div>
- <div class="tips mt8 f12">仓库剩余<span class="number">{{item.LaveNum}}</span><span>台</span></div>
- </div>
- <div class="roundpanel abs bgcfff cm"><img :src="item.Icon" alt=""></div>
- </div>
- </div>
- </div>
- </div>
- </van-pull-refresh>
- <van-tabbar v-model="active" active-color="#FF502A" v-cloak v-if="tabsisshow">
- <van-tabbar-item icon="home-o">首页
- <template #icon="props"><img :src="props.active ? icon1.active : icon1.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="friends-o" @click="notice" :dot="isnotice">消息
- <template #icon="props"><img :src="props.active ? icon3.active : icon3.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="setting-o" @click="user">我的
- <template #icon="props"><img :src="props.active ? icon4.active : icon4.inactive"></template>
- </van-tabbar-item>
- </van-tabbar>
- </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 {
- isLoading:false,
- topisshow:false,
- active: 0,
- username:'',
- rankgrade:1,
- userphoto:'',
- banner: [
- ],
- toutiao: [
- ],
- icon1: {
- active: './static/images/tab-icon1-active.png',
- inactive: './static/images/tab-icon1-no.png',
- },
- icon2: {
- active: './static/images/tab-icon2-active.png',
- inactive: './static/images/tab-icon2-no.png',
- },
- icon3: {
- active: './static/images/tab-icon3-active.png',
- inactive: './static/images/tab-icon3-no.png',
- },
- icon4: {
- active: './static/images/tab-icon4-active.png',
- inactive: './static/images/tab-icon4-no.png',
- },
- teamperformance: '0',
- addcustomer:'0',
- merchant:'0',
- grade:[
- './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-k8.png',
- './static/images/grade-k9.png',
- ],
- entrancelist:[
- ],
- tabsisshow:false,
- warehouse:[],
- };
- },
- created() {
- this.tabsisshow = bottomtabisshow;
- this.getsuerinfo();
- this.getteamachievement();
- this.getquickentrance();
- this.gettopbanner();
- this.getheadline();
- this.getwarehouselist();
- },
- computed:{
- isnotice:function(){
- return PublicLib.getCookieInfo('noticeiscount') !== "";
- }
- },
- methods: {
- async onRefresh(){
- await this.getsuerinfo();
- await this.getteamachievement();
- await this.getquickentrance();
- await this.gettopbanner();
- await this.getheadline();
- await this.getwarehouselist();
- this.isLoading = false;
- },
- //- 吸顶状态
- sticky(status){
- this.topisshow = status
- },
- //- 获取用户个人信息
- async getsuerinfo(){
- const Id = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/users/myinfo',JSON.stringify({Id}));
- if(res.status === '1') {
- this.username = res.data.RealName;
- this.rankgrade = res.data.UserLevel;
- this.userphoto = res.data.HeadPhoto;
- };
- },
- //- 获取团队业绩
- async getteamachievement(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/usertradedaysummary/thismonth',JSON.stringify({UserId}));
- if(res.status === '1') {
- this.teamperformance = res.data.DirectTradeAmt;
- this.merchant = res.data.DirectDebitCapNum;
- this.addcustomer = res.data.AddCount;
- };
- },
- //- 获取快捷入口列表
- async getquickentrance(){
- PublicLib.ShowLoading({Message:''});
- const res = await getRequest('/api/v1/indexiconlist/list',JSON.stringify({PageSize:8,PageNum:1}));
- if(res.status === '1') {
- //- TODO:动态生成入口
- this.entrancelist = res.data;
- this.entrancelist = [
- {Icon:'./static/images/main-btn2@3x.png',Title:'特训营',Url:'trainingCamp'},
- {Icon:'./static/images/main-btn5@3x.png',Title:'我的创客',Url:'creater-list'},
- {Icon:'./static/images/main-btn6@3x.png',Title:'我的商户',Url:'merchant-list'},
- {Icon:'./static/images/main-btn8@3x.png',Title:'意见反馈',Url:'user-feedback'},
- ];
- PublicLib.HideLoading();
- }
- },
- //- 获取顶部banner
- async gettopbanner(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/advertisment/indextop',JSON.stringify({UserId,PageSize:8,PageNum:1}));
- if(res.status === '1') {
- this.banner = res.data
- }
- },
- //- 获取爽客邦头条信息
- async getheadline(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/sysrechargerecord/headline',JSON.stringify({UserId,PageSize:8,PageNum:1}));
- if(res.status === '1') {
- this.toutiao = res.data;
- };
- },
- //- 跳转特训营
- trainingCamp(){
- PublicLib.Goto({Url:'trainingCamp'});
- },
- //- 跳转商城
- mall(){
- PublicLib.Goto({Url:'mall'});
- },
- //- 跳转消息
- notice(){
- PublicLib.Goto({Url:'notice-center'});
- },
- //- 跳转我的
- user(){
- PublicLib.Goto({Url:'user-center'});
- },
- entrance(Url){
- //- 跳转对应的快捷入口页面
- PublicLib.Goto({Url});
- },
-
- bannerbtn(url){
- PublicLib.Goto({Url:url});
- },
- //- 跳转业绩
- achievement(){
- PublicLib.Goto({Url:'product-myperformance'});
- },
- //- 服务中心
- server(){
- PublicLib.Goto({Url:'user-service-list'});
- },
- //- 点击头部个人信息
- userinfobtn(){
- PublicLib.Goto({Url:'user-info'});
- },
- //- 获取仓库入口
- async getwarehouselist(){
- const UserId = PublicLib.getCookieInfo('userId');
- const res = await getRequest('/api/v1/storehouse/indexlist',JSON.stringify({UserId,PageSize:8,PageNum:1}));
- if(res.status === '1') {
- this.warehouse = res.data;
- }
- },
- //- 跳转对应仓库
- gowarehouse(id,name){
- PublicLib.putCookieInfo('warehouseId', id);
- PublicLib.putCookieInfo('warehouseName', name);
- PublicLib.Goto({Url:'warehouse-management'});
- }
- }
- });
- </script>
- </body>
- </html>
|