doum
7 小时以前 5c3c04b9705db216d199053afc278324ed766f14
mini-program/pages/distributor/distributor.vue
@@ -1,10 +1,10 @@
<template>
   <view class="box">
   <view class="box" :style="">
      <view class="head" :style="{ height: 'calc(' + (navHeight + statusbarHeight + 'px + 400rpx)') }">
         <view class="head-bar" :style="{ height: navHeight + statusbarHeight + 'px' }">
            <view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
            <view class="head-bar-nav" :style="{ height: navHeight + 'px' }">
               <view class="loginOut">
               <view class="loginOut" @click="logoutCom()">
                  <image src="/static/icon/ic_tixing@2x.png" mode="widthFix"></image>
                  <text>登出</text>
               </view>
@@ -13,13 +13,13 @@
         <view class="user">
            <view class="user-left">
               <view class="user-left-image">
                  <image src="/static/logo.png" mode="widthFix"></image>
                  <image :src="shop.imgurl||'/static/logo.png'" mode="widthFix"></image>
               </view>
               <view class="user-left-info">
                  <view class="user-left-info-title">鼎元农机一号经销商</view>
                  <view class="user-left-info-title">{{shop.name||''}}</view>
                  <view class="user-left-info-val">
                     <text>门店ID:S001</text>
                     <text>积分:3000</text>
                     <text>门店ID:{{shop.code}}</text>
                     <text>积分:{{(shop.integral||0).toFixed(0)}}</text>
                  </view>
               </view>
            </view>
@@ -30,9 +30,9 @@
         <view class="data" :style="{ backgroundImage: 'url(' + backgroundImage + ')' }">
            <view class="data-a">
               <view class="data-a-left">
                  <view class="data-a-left-item active">今日</view>
                  <view class="data-a-left-item">本月</view>
                  <view class="data-a-left-item">上月</view>
                  <view :class="'data-a-left-item '+(active ==0?'active':'')" @click="changeActive(0)">今日</view>
                  <view :class="'data-a-left-item '+(active ==1?'active':'')" @click="changeActive(1)">本月</view>
                  <view :class="'data-a-left-item '+(active ==2?'active':'')" @click="changeActive(2)">上月</view>
               </view>
               <view class="data-a-to">
                  <text>销售明细</text>
@@ -47,8 +47,8 @@
                     <image src="/static/icon/ic_visible@2x.png" mode="widthFix"></image>
                  </view>
                  <view class="data-c-item-bottom">
                     <text>12,000</text>
                     <text>.00</text>
                     <text>{{(countData.saleTotal||0).toFixed(0)}}</text>
                     <text>.{{countData.saleTotalFloat || '00'}}</text>
                  </view>
               </view>
               <view class="data-c-item">
@@ -56,8 +56,8 @@
                     <text>结算利润(元)</text>
                  </view>
                  <view class="data-c-item-bottom">
                     <text>12,00</text>
                     <text>.00</text>
                     <text>{{(countData.profitTotal||0).toFixed(0)}}</text>
                     <text>.{{countData.profitTotalFloat || '00'}}</text>
                  </view>
               </view>
               <view class="data-c-item">
@@ -65,41 +65,45 @@
                     <text>订单数</text>
                  </view>
                  <view class="data-c-item-bottom">
                     <text>13</text>
                     <text>{{countData.orderNum||0}}</text>
                  </view>
               </view>
            </view>
         </view>
         <view class="func">
            <view class="func-item" style="margin-bottom: 30rpx;">
               <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
               <image src="/static/icon/ic_shangpingl@2x.png" mode="widthFix"></image>
               <text>商品管理</text>
            </view>
            <view class="func-item" style="margin-bottom: 30rpx;">
               <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
               <text>商品管理</text>
               <image src="/static/icon/ic_dingdanguanli@2x.png" mode="widthFix"></image>
               <text>订单管理</text>
            </view>
            <view class="func-item" style="margin-bottom: 30rpx;">
               <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
               <text>商品管理</text>
               <image src="/static/icon/ic_xunizhanghu@2x.png" mode="widthFix"></image>
               <text>虚拟账号</text>
            </view>
            <view class="func-item" style="margin-bottom: 30rpx;">
               <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
               <text>商品管理</text>
               <image src="/static/icon/ic_zitihexiao@2x.png" mode="widthFix"></image>
               <text>自提核销</text>
            </view>
            <view class="func-item">
               <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
               <text>商品管理</text>
               <image src="/static/icon/ic_wodezizhi@2x.png" mode="widthFix"></image>
               <text>我的资质</text>
            </view>
            <view class="func-item">
               <image src="/static/icon/ic_shangpinguanli@2x.png" mode="widthFix"></image>
               <text>商品管理</text>
               <image src="/static/icon/ic_wodehuiyuan@2x.png" mode="widthFix"></image>
               <text>我的会员</text>
            </view>
            <view class="func-item">
               <image src="/static/icon/ic_zhuanshuhaibao@2x.png" mode="widthFix"></image>
               <text>专属海报</text>
            </view>
            <view style="width: 25%; height: 0;"></view>
            <view style="width: 25%; height: 0;"></view>
         </view>
         <view class="title">待处理订单 (2)</view>
         <view class="list">
         <view class="title"  v-if="!show">待处理订单 (2)</view>
         <view class="list"  v-if="!show">
            <view class="list-item" v-for="(item, index) in 5" :key="index">
               <view class="a">
                  <view class="a-left">
@@ -139,6 +143,21 @@
            </view>
         </view>
      </view>
      <!-- 确认退出登陆 -->
      <u-popup :show="show" round="15" :safeAreaInsetBottom="false" mode="center"  >
         <view class="tc">
            <view class="tc-contemt">
               <view class="tc-contemt-title">确认退出登陆</view>
               <view class="tc-contemt-nr">
                  您确认退出登陆吗?
               </view>
            </view>
            <view class="tc-btn">
               <view class="tc-btn-item" @click="logoutCom">取消</view>
               <view class="tc-btn-item" @click="logout" style="color: red;">确认退出</view>
            </view>
         </view>
      </u-popup>
   </view>
</template>
@@ -146,12 +165,57 @@
   import { mapState } from 'vuex'
   export default {
      computed: {
         ...mapState(['navHeight', 'statusbarHeight'])
         ...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
      },
      data() {
         return {
         return {
            show:false,
            active:0,
            shop:{},
            countData:{},
            backgroundImage: require('@/static/images/bg_card@2x.png')
         };
      },
      onShow() {
          this.shop  ={}
          this.checkShopLogin()
          this.shop = this.shopInfo || {}
      },
      onReachBottom(){
      },
      methods:{
         changeActive(index){
            this.active = index
         },
          checkShopLogin(){
            var that =this
            if( this.shopInfo ==null || this.shopInfo.id==null ||  this.shopToken==null || this.shopToken==''){
                this.jumpShopLogin()
            }
         },
         logoutCom(){
            this.show=!this.show
            if(this.show){
            }else{
            }
         },
         async  logout(){
            var that =this
            let res = await that.$u.api.shopLogout({tokenType:1  })
            if (res.code === 200) {
               await that.$store.commit('setShopInfo',null)
               await that.$store.commit('setShopToken',null)
               that.jumpShopLogin()
            }
         },
         jumpShopLogin() {
            uni.navigateTo({
               url: '/pages/login/login'
            })
         }
      }
   }
</script>