123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- <!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="pb0 bgcf5f5f5 ovh">
- <div class="index" id="app" v-cloak>
- <div class="iphonetitle rel">
- <div class="loginbgc abs" style="top:0;"></div>
- </div>
- <van-pull-refresh class="indexy iphonetitle" v-model="isLoading" @refresh="onRefresh" success="刷新完成">
- <div class="pl16 pr16" style="padding-bottom:10px;">
- <div class="index_title df">
- <div class="title_mame mb f14 c333">{{merchantname}}</div>
- <div @click="gofeedback"><img src="./static/images/index-btn1.png" alt=""></div>
- </div>
- <div class="audit_status bgcfff dib mt6" v-if="status === 2">
- <div class="roll fin dib"></div><span class="f12 more">审核通过</span>
- </div>
- <div class="audit_status bgcfff dib" @click="auditfaileddialogisshow = true" v-if="status === -1">
- <div class="roll un dib"></div><span class="f12 more">审核未通过</span>
- <van-icon name="arrow"> </van-icon>
- </div>
- <div class="audit_status bgcfff dib" @click="auditdialogisshow = true" v-if="status === 1">
- <div class="roll ing dib"></div><span class="f12 more">待签约</span>
- <van-icon name="arrow"></van-icon>
- </div>
- <div class="audit_status bgcfff dib" @click="examinedialogisshow = true" v-if="status === 0">
- <div class="roll ing dib"></div><span class="f12 more">审核中</span>
- <van-icon name="arrow"></van-icon>
- </div>
- <van-grid class="index_grid">
- <van-grid-item icon="./static/images/index-bind.png" text="绑定设备" @click="bindequipment"></van-grid-item>
- <van-grid-item icon="./static/images/index-bind-detail.png" text="已绑详情" @click="binddetail"></van-grid-item>
- <van-grid-item icon="./static/images/index-active.png" text="活动配置" @click="activeconfig"></van-grid-item>
- <van-grid-item icon="./static/images/index-vip.png" text="会员管理" @click="vipadministration"></van-grid-item>
- </van-grid>
- <div class="index_panel bgcfff">
- <div class="index_panel_title df">
- <div class="date_item df c333 f14">
- <div class="date" :class="chosedate === 1 ? 'chose':''" @click="chosedatefn(1)">今天</div>
- <div class="date" :class="chosedate === 2 ? 'chose':''" @click="chosedatefn(2)">近七天</div>
- <div class="date" :class="chosedate === 3 ? 'chose':''" @click="chosedatefn(3)">本月</div>
- </div>
- <div class="date_data c999 f12 df">
- <div v-if="chosedate !== 1"><span>{{oldmonth}}</span><span class="separate">/</span><span>{{oldday}}</span><span> ~ </span></div>
- <div><span>{{nowmounth}}</span><span class="separate">/</span><span>{{nowday}}</span></div>
- </div>
- </div>
- <div class="money_count_icon df"><img class="left" src="./static/images/index-getmoney.png" alt="">
- <div class="f12 c333">实收金额</div>
- </div>
- <div class="money_count_icon df mb money_count">
- <div class="f16 c333 mb6 mb">¥</div>
- <div class="count c333">{{moneycount | tofixed2}}</div>
- </div>
- <div class="money_count_detail df">
- <div class="data tc">
- <div class="c999 f12">订单总数</div>
- <div class="mb f16 mt6">{{ordercount}}</div>
- </div>
- <div class="line"></div>
- <div class="data tc">
- <div class="c999 f12">营收总额</div>
- <div class="mb f16 mt6">¥{{totalcount | tofixed2}}</div>
- </div>
- <div class="line"></div>
- <div class="data tc">
- <div class="c999 f12">新增会员</div>
- <div class="mb f16 mt6">{{vipcount}}</div>
- </div>
- </div>
- </div>
- <div class="index_panel bgcfff mt10 index_bottom_panel">
- <div class="title df" @click.stop="tips = true">
- <div class="mb c333 f16">当前活动参数</div><img src="./static/images/detail-btn.png" alt="">
- </div>
- <div class="indexcell" v-if="activeIsAll">
- <van-cell :title="item.title" :icon="item.icon" :value="item.data" v-for="item,index in listdata" :key="index">
- <template #default><span class="f18 mb" v-if="item.data.data !== '¥'">{{item.data.data}}</span><span class="f12 mb" v-if="item.data.data !== '¥'">{{item.data.icon}}</span><span class="f12 mb" v-if="item.data.data === '¥'">{{item.data.data}}</span><span class="f18 mb" v-if="item.data.data === '¥'">{{item.data.icon}}</span></template>
- </van-cell>
- </div>
- <div class="f14 tc mt16 c999" v-else>暂未开启活动</div>
- </div>
- </div>
- </van-pull-refresh>
- <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="examinedialogisshow" title="审核中" message="您的门店信息正在审核中" @confirm="examinedialogisshow = false"> </van-dialog>
- <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="auditfaileddialogisshow" title="审核进度" message="您的门店信息审核失败!请联系您的业务管家修改后重新提交" @confirm="auditfaileddialogisshow = false"> </van-dialog>
- <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="auditdialogisshow" title="审核进度" message="您的门店审核进度如下:
- 微信-已通过-待签约
- 支付宝-已通过-待签约
- 请联系您的业务管家前往签约!" @confirm="auditdialogisshow = false"> </van-dialog>
- <van-dialog class="textl" style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="tips" title="名词解释" message="实收金额:消费金额-退款金额-手续费
- 订单总数:当日订单总笔数
- 新增会员:当日消费者会员卡领取数量
- 营收金额:用户消费后应该付的原价金额,未扣除优惠和退款" @confirm="tips = false"> </van-dialog>
- <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="bindqrcode" message="绑定成功!" @confirm="bindqrcode = false"> </van-dialog>
- <van-dialog class="option" style="border-radius:4px;" width="300px" v-model="binddialogisshow" message="绑定成功,收款码暂未关联音响" cancel-button-text="暂时不要" confirm-button-text="去关联" show-cancel-button @confirm="gobind" @cancel="binddialogisshow = false"> </van-dialog>
- <van-dialog style="border-radius:10px;" confirm-button-color="#FD824D" width="300px" theme="round-button" confirm-button-text="确定" v-model="failbind" :message="failinfo" @confirm="failbind = false"> </van-dialog>
- <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="home-o" @click="management">经营数据
- <template #icon="props"><img :src="props.active ? icon2.active : icon2.inactive"></template>
- </van-tabbar-item>
- <van-tabbar-item icon="friends-o" @click="notice">消息
- <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>
- function OnStart(){
- let scanContent = PublicLib.getCookieInfo("ScanContent");
- //- 拿到扫描结果进行赋值传输
- if(scanContent !== undefined){
- if(scanContent !== '' && !verificationHost(scanContent)){
- PublicLib.putCookieInfo('ScanContent', '');
- PublicLib.ShowMsg({Title:'提示', Message:'请扫描创业帮收款码或音响码'});
- };
- if(scanContent !== '' && verificationHost(scanContent)){
- PublicLib.putCookieInfo('indexscandata', PublicLib.getCookieInfo("ScanContent"));
- PublicLib.putCookieInfo('ScanContent', '');
- PublicLib.ShowDialog({
- Title:'绑定设备',
- Message:'是否绑定该设备?',
- ConfirmText:'绑定设备',
- CancelText:'暂不绑定',
- ConfirmAction:'app.getcodeinfo()',
- CanelAction:''
- });
- };
- //- app.getcodeinfo(scanContent);
- };
- app.getmangementdetail();
- app.getmerchantdetail();
- app.getmangementdata();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- str:'',
- tips:false,
- isLoading:false,
- topisshow:false,
- bindqrcode:false,
- failbind:false,
- failinfo:'',
- binddialogisshow:false,
- examinedialogisshow:false,
- auditdialogisshow:false,
- auditfaileddialogisshow:false,
- chosedate:1,
- active: 0,
- moneycount:0,
- totalcount:0,
- ordercount:0,
- vipcount:0,
- activeIsAll:false,
- //- 扫描数据
- merchantname:'',
- 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',
- },
- tabsisshow:false,
- listdata:[
- {icon:'./static/images/index-list-icon4.png',title:'实收比例',data:{data:'0',icon:'%'}},
- {icon:'./static/images/index-list-icon4.png',title:'活动成本比例',data:{data:'0',icon:'%'}},
- {icon:'./static/images/index-list-icon2.png',title:'让利人数',data:{data:'0',icon:''}},
- {icon:'./static/images/index-list-icon3.png',title:'让利天数上限',data:{data:'0',icon:''}},
- {icon:'./static/images/index-list-icon1.png',title:'活动门槛',data:{data:'0',icon:''}},
- {icon:'./static/images/index-list-icon4.png',title:'订单最高返比',data:{data:'0',icon:'%'}},
- ],
- oldmonth:'',
- oldday:'',
- nowmounth:new Date().getMonth()+1,
- nowday:new Date().getDate(),
- status:'',
- };
- },
- created() {
- this.tabsisshow = bottomtabisshow;
- this.getmerchantdetail();
- this.getmangementdata();
- this.getmangementdetail();
- },
- methods: {
- // 解析获取到的信息,将解析数据发送到后台
- getcodeinfo(){
- const info = PublicLib.getCookieInfo("indexscandata");
- const data = info.split('?');
- const dataarr = data[1].split('&');
- let sn = '';
- let machine = '';
- dataarr.forEach(element => {
- if(element.split('=')[0] === 'sn'){
- sn = element.split('=')[1]
- }else if (element.split('=')[0] === 'machine'){
- machine = element.split('=')[1]
- }
- });
- this.scandealfn(sn,machine);
- },
- //- 获取商户详情
- async getmerchantdetail(){
- let Id = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips(res.info);
- //- console.log(res);
- this.merchantname = res.data.Name;
- this.status = res.data.Status;
- },
- //- 获取统计数据
- async getmangementdata(){
- let Id = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/merchantinfo/indexstat?t='+Math.random(6),JSON.stringify({Id,TimeType:this.chosedate}));
- if(res.status !== '1') return tips(res.info);
- this.moneycount = res.data.TotalAmount;
- this.ordercount = res.data.TotalOrder;
- this.vipcount = res.data.TotalUser;
- this.totalcount = res.data.TotalActual;
- },
- //- 商户活动参数
- async getmangementdetail(){
- let Id = PublicLib.getCookieInfo('userId')
- const res = await getRequest('/api/v1/merchantparamset/detail?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips(res.info);
- //- console.log(res,11);
- this.listdata[0].data.data = res.data.GetPercent;
- this.listdata[0].data.icon = ' %';
- this.listdata[1].data.data = (100 - Number(res.data.GetPercent));
- this.listdata[1].data.icon = ' %';
- this.listdata[2].data.data = res.data.DiviPersons;
- this.listdata[3].data.data = res.data.ProfitDays;
- this.listdata[4].data.data = '¥';
- this.listdata[4].data.icon =Number(res.data.MinPayMoney).toFixed(2);
- this.listdata[5].data.data = Number(res.data.DiviPercent).toFixed(0);
- this.listdata[5].data.icon = ' %';
- this.activeIsAll = res.data.IsAll === 0 ? true:false;
- },
- //- 扫描二维码处理逻辑
- async scandealfn(SnNo,Machine){
- let MerchantId = PublicLib.getCookieInfo('userId');
- const res = await postRequest('/api/v1/merchantqrcode/bind?t='+Math.random(6),JSON.stringify({MerchantId,SnNo,Machine}));
- //- 失败
- if(res.status === '-1'){
- this.failinfo = res.info;
- this.failbind = true;
- }else if(res.status === '1') {
- //- 成功绑定,但无音响
- this.binddialogisshow = true;
- }else if(res.status === '2') {
- //- 成功
- this.bindqrcode = true;
- };
- },
- gobind(){
- //- 跳转绑定音响
- PublicLib.Goto({Url:'bind-detail-collection'});
- },
- //- 选择天数
- chosedatefn(num){
- if(num === this.chosedate) return;
- this.chosedate = num;
- this.getmangementdata();
- if(num === 2){
- const time = new Date();
- this.oldday = new Date(time - 518400000).getDate();
- this.oldmonth = new Date(time - 518400000).getMonth() + 1;
- }else if(num === 3){
- this.oldmonth = new Date().getMonth()+1;
- this.oldday = '1';
- }
- },
- //- 下拉刷新
- async onRefresh(){
- await this.getmerchantdetail();
- await this.getmangementdata();
- await this.getmangementdetail();
- this.isLoading = false;
- },
- //- 活动配置
- activeconfig(){
- PublicLib.Goto({Url:'active-config'});
- },
- //- 已绑详情
- binddetail(){
- PublicLib.Goto({Url:'bind-detail'});
- },
- //- 会员管理
- vipadministration(){
- PublicLib.Goto({Url:'vip-administration'});
- },
- //- 消息中心
- notice(){
- PublicLib.Goto({Url:'notice-center'});
- },
- //- 个人中心
- user(){
- PublicLib.Goto({Url:'user-center'});
- },
- //- 经营数据
- management(){
- PublicLib.Goto({Url:'management'});
- },
- //- 绑定设备
- bindequipment(){
- if(this.status !== 2){
- return tips('门店审核未通过,请等待审核通过之后进行绑定设备')
- };
- PublicLib.ScanQRCode();
- },
- //- 去反馈
- gofeedback(){
- PublicLib.Goto({Url:'user-feedback'});
- },
- }
- });
- </script>
- </body>
- </html>
|