123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294 |
- <!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 pb0 ovh vh100" style="box-sizing:border-box;">
- <div class="iphonetitle"></div>
- <div class="merchant_current detail-pos" id="app" v-cloak>
- <van-sticky>
- <van-nav-bar class="camp_title user_title_normal f16" title="商户信息" @click-left="goback" v-if="toptitleisshow" right-text="完善资料" left-arrow @click-right="merchantinfo" v-cloak>
- <template #left>
- <van-icon name="arrow-left" color="#333" size="20"></van-icon>
- </template>
- </van-nav-bar>
- </van-sticky>
- <div class="merchant-header merchant-header-back"></div>
- <div class="merchant-info ml16 mr16 bgcfff" v-cloak>
- <div class="pt16 pb16 pl16 pr16">
- <van-cell center :border="false">
- <template #title>
- <div class="df aic"><span class="f14 mr8">{{merchant.MerchantName}}</span></div>
- </template>
- <template #label><span class="mr16" v-if="merchant.MerRealName">{{merchant.MerRealName}}</span><span>{{merchant.MerchantMobile}}</span></template>
- <template #icon>
- <van-image src="./static/images/merchant-header.png" fit="cover" lazy-load></van-image>
- </template>
- <template #right-icon>
- <div class="merchant-phone" @click="takephone">
- <van-icon name="phone" color="#ff502a"></van-icon>
- </div>
- </template>
- </van-cell>
- <div class="merchant-info-content mt16" v-cloak>
- <div class="merchant-info-desc ovh" :class="active ? '' : 'merchant-info-close'">
- <van-cell-group class="pb8" :border="false">
- <van-cell title="商户姓名" :value="merchant.MerRealName" :border="false"></van-cell>
- <van-cell title="商户名称" :value="merchant.MerchantName" :border="false"></van-cell>
- <van-cell title="商户类型" :value="merchant.MerUserType" :border="false"></van-cell>
- <van-cell title="来源产品" :value="merchant.ProductType" :border="false"></van-cell>
- <van-cell title="激活状态" :value="merchant.ActiveStatus" :border="false"></van-cell>
- <van-cell title="激活时间" :value="merchant.MerStandardDate" :border="false"></van-cell>
- <van-cell title="注册时间" :value="merchant.CreateDate" :border="false"></van-cell>
- <van-cell title="SN号" :value="merchant.KqSnNo" :border="false"></van-cell>
- <van-cell title="商户说明" :value="!merchant.Remark ? '无' : merchant.Remark" :border="false"></van-cell>
- <van-cell title="活动状态" :value="merchant.ActStatus" :border="false"></van-cell>
- </van-cell-group>
- </div>
- <div class="merchant-info-content-title tc pt16 van-hairline--top" @click="toggleMerchantInfo()"><img class="vm pl6 pr6" src="./static/images/icon-arrow-down@3x.png" alt="" :class="active ? 'toUp' : ''"><span class="f12 c999 vm">{{active ? '收起' : '商户详情'}}</span></div>
- </div>
- </div>
- </div>
- <div class="merchant-info-statistics mt16">
- <div class="ml16 mr16 pt8 pb8 bgcfff">
- <van-cell class="merchant-info-statistics-cell mt8 mb20" title="总交易额" :value="abs(merchant.TradeTotal) + '元'" center :border="false"></van-cell>
- </div>
- <van-tabs v-model="merchantactive" color="#FFD500">
- <van-tab title="交易记录"></van-tab>
- <van-tab disabled></van-tab>
- <van-tab disabled></van-tab>
- </van-tabs>
- <div class="ml16 mr16 pt8 pb8 bgcfff">
- <van-cell class="merchant-info-cell mt8" center :border="false">
- <template #title><span class="f12 c999" @click="onShowDate">{{dateName}} ></span></template>
- <template #default><span class="f12 c333">{{abs(MonthTradeAmt)}}元</span></template>
- </van-cell>
- <div class="mt8 merchant_detail_list" ref="wrapper2">
- <van-pull-refresh v-model="refreshing" @refresh="onRefresh" style="min-height: 10vh;height:100% !important" :class="transactions.length === 0 ? 'isnodata':''">
- <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 transactions" center :title="item.TradeDate" :value="abs(item.TradeAmt) + '元'"></van-cell>
- </van-cell-group>
- </van-list>
- </van-pull-refresh>
- </div>
- </div>
- </div>
- <van-popup v-model="showDate" position="bottom" :style="{ height: '50%' }">
- <van-datetime-picker v-model="currentDate" type="year-month" title="选择年月" :min-date="minDate" :max-date="maxDate" :formatter="formatter" @confirm="onConfirmDate" @cancel="showDate = false"></van-datetime-picker>
- </van-popup>
- <van-overlay :show="nextshow" @click="closenextshow">
- <div class="unbindpop cm">
- <div class="unbindcard tc" @click.stop>
- <div class="f14 c333 title">转换规则</div>
- <div class="f12 c666 tl mt8">1.满足全部如下条件时方可转为商户型创客:</div>
- <div class="f12 c666 tl pl6 pt4">a.机具已激活且未进行过转换</div>
- <div class="f12 c666 tl pl6 pt4">b.该创客已完成实名认证</div>
- <div class="f12 c666 tl pl6 pt4">c.该创客注册手机号需要与机具绑定手机号一致</div>
- <div class="f12 c666 tl mt8">2.转商户型创客后该机具交易额将归属至该创客</div>
- <div class="f12 c666 tl mt8">3.<span style="color:red;">转换后无法撤销,请仔细核对SN号及姓名是否正确</span></div>
- <input type="text" v-model="createercode" placeholder="请输入创客编号" @focus="inputbtn" style="width:100%;">
- <div class="f12 tc c333 title" v-if="createrinfo.RealName !== ''">姓名:{{createrinfo.RealName}}</div>
- <div class="nextbutton cfff cm mt16 f14" @click="diaolignextbtn" style="color:#333;">{{createrinfo.RealName === ''? '下一步' : '确认转换'}}</div>
- </div>
- </div>
- </van-overlay>
- </div>
- <script src="./static/js/klm-vv.min.js"></script>
- <script src="./static/js/appfunc.min.js"></script>
- <script src="./static/js/klm-axios-config.js"></script>
- <script src="./static/js/publicfn.js"></script>
- <script>
- function OnStart(){
- app.getmerchantinfo();
- };
- // 通过 CDN 引入时不会自动注册 Lazyload 组件
- // 可以通过下面的方式手动注册
- Vue.use(vant.Lazyload);
- //- PublicLib.SetStatusBarStyle({type:'light', isShow:1});
- // 在 #app 标签下渲染一个按钮组件
- let app = new Vue({
- el: '#app',
- data() {
- return {
- nextshow:false,
- MonthTradeAmt:0,
- isnodata:false,
- toptitleisshow:true,
- active: false,
- merchantactive:0,
- merchant:{
- TradeTotal:0,
- },
- realMerchantMobile:'',
- showDate: false,
- minDate: new Date(2022, 0, 1),
- maxDate: new Date(),
- currentDate: new Date(),
- formatime:'',
- dateName: '本月',
- transactions: [
- ],
- pageinfo:{
- PageSize:10,
- PageNum:1
- },
- createercode:'',
- createrinfo:{
- RealName:'',
- Id:'',
- },
- loading: false,
- finished: false,
- refreshing: false,
- };
- },
- created() {
- this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
- this.getmerchantinfo();
- this.getmerchantdetail('refresh');
- },
- beforeUpdate(){
- this.$nextTick(() => {
- this.$refs.wrapper2.style.height = `${document.documentElement.clientHeight - 420}px`;
- });
- },
- methods: {
- inputbtn(){
- this.createrinfo.RealName = '';
- },
- closenextshow(){
- this.nextshow = false;
- this.createercode = '';
- this.createrinfo.RealName = '';
- },
- changebtn(snid){
- this.SnId = snid;
- this.nextshow = true;
- },
- diaolignextbtn:undebounce(async function(){
- console.log(this.result)
- if(this.createercode === '') return tips('请输入创客编号');
- if(this.createrinfo.RealName === '') {
- const res = await getRequest('api/v1/users/forcode?t='+Math.random(6),JSON.stringify({MakerCode:this.createercode}));
- if(res.status !== '1')return tips(res.info);
- this.createrinfo = res.data;
- console.log(this.createrinfo)
- } else{
- if(!this.createrinfo.RealName){
- return tips('请输入正确的创客编号!');
- };
- const res = await postRequest('api/v1/pos/posmachines/setmerchantmaker?t='+Math.random(6),JSON.stringify({SnId:this.SnId,UserId:this.createrinfo.Id}));
- if(res.status !== '1')return tips(res.info);
- tips('转换成功!');
- this.nextshow = false;
- this.createrinfo = {RealName:'',Id:''};
- this.createercode = '';
- this.onRefresh();
- }
- }),
- //- 商户补全
- merchantinfo(id){
- PublicLib.Goto({Url:'merchant-detail-pos-completion'});
- },
- toggleMerchantInfo(){
- this.active = !this.active;
- },
- onShowDate(){
- this.showDate = !this.showDate;
- },
- formatter(type, val) {
- if (type === 'year') {
- return `${val}年`;
- } else if (type === 'month') {
- return `${val}月`;
- }
- return val;
- },
- onConfirmDate() {
- //- this.transactions = [];
- this.showDate = false;
- this.dateName = this.currentDate.getFullYear() + '年' + (this.currentDate.getMonth() + 1) + '月';
- this.formatime = formatDate(this.currentDate.getFullYear(),this.currentDate.getMonth() + 1);
- this.pageinfo.PageNum = 1;
- this.getmerchantdetail('refresh');
- },
- onLoad() {
- console.log('load Event')
- if (this.refreshing) {
- this.refreshing = false;
- };
- this.pageinfo.PageNum++;
- this.getmerchantdetail();
- },
- onRefresh() {
- // 清空列表数据
- console.log('refresh event')
- this.finished = false;
- this.pageinfo.PageNum = 1;
- // 重新加载数据
- // 将 loading 设置为 true,表示处于加载状态
- this.loading = true;
- if (this.refreshing) {
- this.refreshing = false;
- };
- this.getmerchantdetail('refresh');
- },
- //- 获取商户详情
- async getmerchantinfo(){
- //- PublicLib.ShowLoading({Message:''});
- const Id = PublicLib.getCookieInfo('merchantId');
- const res = await getRequest('/api/v1/pos/merchantinfo/detail?t='+Math.random(6),JSON.stringify({Id}));
- if(res.status !== '1') return tips('获取商户信息失败,请重试!');
- //- PublicLib.HideLoading();
- res.data.TradeTotal = res.data.TradeTotal.toFixed(2);
- this.merchant = res.data;
- this.realMerchantMobile = res.data.MerchantMobile;
- //- this.merchant.MerchantMobile = hidemiddlenum(res.data.MerchantMobile,3,4);
- },
- async getmerchantdetail(type='onload'){
- const MerchantId = PublicLib.getCookieInfo('merchantId');
- const res = await getRequest('/api/v1/pos/usertradedaysummary/merchanttradelist?t='+Math.random(6),JSON.stringify({...this.pageinfo,TradeMonth:this.formatime,MerchantId}));
- if(res.status !== '1') return tips('获取交易记录失败,请重试!');
- if(res.data.length < this.pageinfo.PageSize) {
- this.finished = true;
- };
- res.data.forEach(item=>{
- item.TradeAmt = item.TradeAmt.toFixed(2)
- });
- if(this.pageinfo.PageNum === 1){
- this.MonthTradeAmt = res.other.MonthTradeAmt.toFixed(2);
- };
- if(type === 'refresh'){
- this.transactions = res.data
- this.refreshing = false;
- }
- if(type === 'onload'){
- this.transactions.push(...res.data);
- }
- this.loading = false;
- if(this.transactions.length === 0) {this.isnodata = true}else{this.isnodata = false};
- },
- goback(){
- PublicLib.GoBack({Level:1});
- },
- takephone(){
- PublicLib.PhoneCall(this.realMerchantMobile);
- }
- }
- });
- </script>
- </body>
- </html>
|