陶杰
2024-10-16 ef240131386f3f37cd3d0b232b4d237fb73d1132
pages/home/supplier-home.vue
@@ -7,17 +7,35 @@
         我的
      </view> -->
      <!-- 背景图 -->
      <view class="top-bg" :style="{'padding-top':(StatusBar)+'px','line-height':CustomBar+'rpx' }">
         <view class="title" style="position: relative;">
            首页
         </view>
         <view class="flex user-info" v-if="currentInfo&&(currentInfo.id)">
            <image class="user-icon" v-if="
               (currentInfo.customerDTO&&currentInfo.customerDTO.cover)
               ||(currentInfo.supplierDTO&&currentInfo.supplierDTO.cover)
               ||(currentInfo.partnerDTO&&currentInfo.partnerDTO.cover)
               || currentInfo.picture
               " :src="
               (currentInfo.customerDTO&&currentInfo.customerDTO.cover)
               ||(currentInfo.supplierDTO&&currentInfo.supplierDTO.cover)
               ||(currentInfo.partnerDTO&&currentInfo.partnerDTO.cover)
               || currentInfo.picture
               " mode="scaleToFill"></image>
            <image class="user-icon" v-else
               src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png'
               mode="scaleToFill"></image>
            <!-- 头像 -->
            <image class="user-icon" v-if="!currentInfo.picture"
         <!--    <image class="user-icon" v-if="!currentInfo.picture"
               src='https://youzhen123.oss-cn-huhehaote.aliyuncs.com/WechatOwnerProperty/images/mrtx.png'
               mode="aspectFit"></image>
            <image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image>
            <image class="user-icon" v-if="currentInfo.picture" :src="currentInfo.picture" mode="aspectFit"></image> -->
            <view class="name">
               <view class="t1">
@@ -29,6 +47,10 @@
                  <span v-if="!currentInfo.partnerDTO&&currentInfo.type==='partner'">(信息待完善)</span>
               </view>
               <view class="t2">{{currentInfo.tel || '暂无电话'}}</view>
               <view class="t2" v-if="currentInfo.partnerDTO && currentInfo.partnerDTO.id">
                 ID: {{ currentInfo.partnerDTO.id }}
               </view>
            </view>
         </view>
@@ -36,7 +58,7 @@
      </view>
      <view class="item-container" :class="[selftype?selftype:'']">
         <view class="title">我的收益</view>
         <view class="flex tj-container" v-if="selftype==='partner'">.
         <view class="flex tj-container" v-if="selftype==='partner'">
            <view class="tj-each">
               <view class="num total">
                  ¥{{tj.income||'0.00'}}
@@ -51,25 +73,25 @@
         <view class="line"></view>
         <view class="flex tj-container" v-if="selftype==='supplier'">
            <view class="tj-each">
            <view class="tj-each"  @click="goto('/sub_pages/supplier/data-statis/data-statis',true)">
               <view class="num">
                  0扎
                  {{tj.dealCountLastMonth||0}}扎
               </view>
               <view class="name">
                  上月成交
               </view>
            </view>
            <view class="tj-each">
            <view class="tj-each"  @click="goto('/sub_pages/supplier/data-statis/data-statis',true)">
               <view class="num">
                  0扎
                  {{tj.dealCountToday||0}}扎
               </view>
               <view class="name">
                  今日成交
               </view>
            </view>
            <view class="tj-each">
            <view class="tj-each"  @click="goto('/sub_pages/supplier/data-statis/data-statis',true)">
               <view class="num">
                  0扎
                  {{tj.dealCountDay30||0}}扎
               </view>
               <view class="name">
                  近30天成交
@@ -77,25 +99,25 @@
            </view>
         </view>
         <view class="flex tj-container">
            <view class="tj-each">
            <view class="tj-each" @click="selftype=='supplier'&&goto('/pages/order/order-delivery?range=today',true)">
               <view class="num">
                  {{dto.orderCountToday||0}}扎
                  {{tj.orderCountToday||0}}单
               </view>
               <view class="name">
                  今日订单数
               </view>
            </view>
            <view class="tj-each">
            <view class="tj-each" @click="selftype=='supplier'&&goto('/pages/order/order-delivery?range=yesterday',true)">
               <view class="num">
                  {{dto.orderCountYesterday||0}}扎
                  {{tj.orderCountYesterday||0}}单
               </view>
               <view class="name">
                  昨日订单数
               </view>
            </view>
            <view class="tj-each">
            <view class="tj-each" @click="selftype=='supplier'&&goto('/pages/order/order-delivery?range=month',true)">
               <view class="num">
                  {{dto.orderCountMonth||0}}扎
                  {{tj.orderCountMonth||0}}单
               </view>
               <view class="name">
                  本月订单数
@@ -106,13 +128,15 @@
      <view class="item-container flex m-t-12" style="padding: 34rpx 44rpx;" v-if="selftype=='supplier'">
         <view class="rate-view flex1" style="max-width: 140rpx;">
            <view class="title">售后率</view>
            <view class="title" style="color: red;">{{tj.salesRate||0}}%</view>
            <view class="title" style="color: red;">{{((tj.salesRate||0)*100).toFixed(2)}}%</view>
         </view>
         <view class="tj-panel  pink flex1" @click="goto('/pages/order/order-delivery?status=ARRIVED',true)">
         <view class="tj-panel  pink flex1"
            @click="goto('/pages/order/order-delivery?status=PENDING&range=today',true)">
            <view class="name">今日待配送</view>
            <view class="title">{{tj.deliverCount||0}}扎</view>
         </view>
         <view class="tj-panel green flex1" @click="goto('/pages/order/order-delivery?status=',true)">
         <view class="tj-panel green flex1"
            @click="goto('/pages/order/order-delivery?status=ARRIVED&range=today',true)">
            <view class="name green">今日配送汇总</view>
            <view class="title">{{tj.deliverTotal||0}}扎</view>
         </view>
@@ -129,23 +153,31 @@
               @click="goto('/sub_pages/partner/order-manage/order-manage',true)">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon ddgl"
                     src="/static/images/partner/user/user-icon-ddgl.png" mode="scaleToFill" />
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/23/23a7ad86e00c4ba28cd962dc4910433cuser-icon-ddgl.png" mode="scaleToFill" />
               </view>
               <view class="order-desc tg">订单管理</view>
            </view>
            <view class="nav row margin-tb" v-if="selftype==='supplier'"
               @click="goto('/sub_pages/supplier/order-manage/order-manage',true)">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon ddgl"
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/23/23a7ad86e00c4ba28cd962dc4910433cuser-icon-ddgl.png" mode="scaleToFill" />
               </view>
               <view class="order-desc tg">订单统计</view>
            </view>
            <view class="nav row margin-tb"
               @click="goto('/sub_pages/supplier/order-settlement/order-settlement',true)">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon zdjs"
                     src="/static/images/supplier/user/user-icon-zdjs.png" mode="scaleToFill" />
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/7b/7b7ed1488fd64f6fa9bc6b557f141f37user-icon-zdjs.png" mode="scaleToFill" />
               </view>
               <view class="order-desc tg">账单结算</view>
            </view>
            <view class="nav row margin-tb" @click="toFlowManage" v-if="selftype==='supplier'">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon spgl"
                     src="/static/images/supplier/user/user-icon-spgl.png" mode="scaleToFill" />
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/478e007ad07a43ea9f40a962d83cedb4user-icon-spgl.png" mode="scaleToFill" />
               </view>
               <view class="order-desc cqw">商品管理</view>
            </view>
@@ -153,21 +185,21 @@
               @click="goto('/sub_pages/partner/markup-config/markup-config',true)">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon jjpz"
                     src="/static/images/partner/user/user-icon-jjpz.png" mode="scaleToFill" />
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/93/93356ec339074b49b04c1a3a37146f22user-icon-jjpz.png" mode="scaleToFill" />
               </view>
               <view class="order-desc tg">加价配置</view>
            </view>
            <view class="nav row margin-tb" @click="goto('/sub_pages/supplier/order-sale/order-sale',true)">
            <view class="nav row margin-tb" @click="goto('/pages/order/order-sale/order-sale',true)">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon shlp"
                     src="/static/images/supplier/user/user-icon-shlp.png" mode="scaleToFill" />
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/47b54c52e4c2430c8f9e91645fbf9ebduser-icon-shlp.png" mode="scaleToFill" />
               </view>
               <view class="order-desc syst">售后理赔</view>
            </view>
            <!-- <view class="nav row margin-tb" @click="printDeliveryOrder">
               <view class="img-c">
                  <image class="icon margin-bottom order-icon kkjl"
                     src="/static/images/supplier/user/user-icon-kkjl.png" mode="scaleToFill" />
                     src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/22/22db478554ec436a8c7e6e89c346767duser-icon-kkjl.png" mode="scaleToFill" />
               </view>
               <view class="order-desc wbsp">测试蓝牙</view>
            </view> -->
@@ -204,8 +236,31 @@
         };
      },
      onShareAppMessage() {
         let that = this;
         var name = that.currentInfo.customerDTO && that.currentInfo.customerDTO.name || that.currentInfo.supplierDTO &&
            that.currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && that.currentInfo.partnerDTO.name || ''
         var url =
            `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
         return {
            title: "花满芫",
            path: url,
         }
      },
      onShareTimeline() {
         let that = this;
         var name = that.currentInfo.customerDTO && that.currentInfo.customerDTO.name || that.currentInfo.supplierDTO &&
            that.currentInfo.supplierDTO.name || that.currentInfo.partnerDTO && that.currentInfo.partnerDTO.name || ''
         var url =
            `/pages/login/supplier-login?shareId=${this.currentInfo&&this.currentInfo.id||''}&shareName=${name||''}`; //你的转发页面路径拼接参数
         return {
            title: "花满芫",
            path: url,
         }
      },
      async onPullDownRefresh() {
         await this.$store.dispatch('getCurrentInfo')
         await getTj(true)
         uni.stopPullDownRefresh()
      },
      onLoad(options) {
@@ -213,18 +268,29 @@
         const urlcode = options.url && decodeURIComponent(options.url) || ''
      },
      onShow() {
         this.getTj()
         this.getTj(true)
      },
      created() {
         //公告
         this.$http.request('get', '/api/pub/announcement/list', {
         var type = ''
         // #ifdef PUB_CUSTOMER
         type = 'customer'
         // #endif
         // #ifdef PUB_SUPPLIER
         type = 'supplier'
         // #endif
         // #ifdef PUB_PARTNER
         type = 'partner'
         // #endif
         this.$http.request('get', '/api/pub/announcement/list/'+type, {
            params: {
               size: 5,
               status: 'A'
            }
         }).then(res => {
            if (res.code == 0) {
               this.noticeList = (res.data && res.data.records || [])
               this.noticeList = (res.data && res.data || [])
               console.log('this.noticeList', this.noticeList)
               if (this.noticeList.length > 0) {
                  this.currentNotice = this.noticeList[0]
@@ -289,7 +355,7 @@
                  }
               },
               fail: (res) => {
                  console.log("蓝牙状态",res)
                  console.log("蓝牙状态", res)
                  that.$message.showToast('获取蓝牙状态失败')
               }
@@ -350,7 +416,7 @@
                        },
                        fail: function(res) {
                           console.log('createBLEConnection fail',res)
                           console.log('createBLEConnection fail', res)
                           that.$message.showToast('连接打印机失败')
                        },
                        complete() {
@@ -387,10 +453,10 @@
               },
            })
         },
         getTj() {
         getTj(refresh=false) {
            // /api/supplier/delivery   
            if (this.currentInfo.id && this.currentInfo.id !== this.cacheUserId) {
            if (this.currentInfo.id && (this.currentInfo.id !== this.cacheUserId || refresh)) {
               this.cacheUserId = this.currentInfo.id
               let that = this
               setTimeout(() => {