<template>
|
<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" @click="logoutCom()">
|
<image src="/static/icon/ic_tixing@2x.png" mode="widthFix"></image>
|
<text>登出</text>
|
</view>
|
</view>
|
</view>
|
<view class="user">
|
<view class="user-left">
|
<view class="user-left-image">
|
<image :src="shop.imgurl||'/static/logo.png'" mode="widthFix"></image>
|
</view>
|
<view class="user-left-info">
|
<view class="user-left-info-title">{{shop.name||''}}</view>
|
<view class="user-left-info-val">
|
<text>门店ID:{{shop.code}}</text>
|
<text>积分:{{(shop.integral||0).toFixed(0)}}</text>
|
</view>
|
</view>
|
</view>
|
<view class="user-qrcode">
|
<image src="/static/icon/ic_QRcode@2x.png" mode="widthFix"></image>
|
</view>
|
</view>
|
<view class="data" :style="{ backgroundImage: 'url(' + backgroundImage + ')' }">
|
<view class="data-a">
|
<view class="data-a-left">
|
<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>
|
<image src="/static/icon/ic_ar2@2x.png" mode="widthFix"></image>
|
</view>
|
</view>
|
<view class="data-b"></view>
|
<view class="data-c">
|
<view class="data-c-item">
|
<view class="data-c-item-top">
|
<text>销售额(元)</text>
|
<image :src="showMoney?'/static/icon/ic_visible@2x.png':'/static/icon/ic_invisible@2x.png'" @click="showMoney=!showMoney" mode="widthFix"></image>
|
</view>
|
<view class="data-c-item-bottom">
|
<text v-if="showMoney">{{(countData.saleTotalNum||0).toFixed(0)}}</text>
|
<text v-if="showMoney">{{countData.saleTotalFloat || '.00'}}</text>
|
<text v-if="!showMoney">****</text>
|
</view>
|
</view>
|
<view class="data-c-item">
|
<view class="data-c-item-top">
|
<text>结算利润(元)</text>
|
</view>
|
<view class="data-c-item-bottom">
|
<text v-if="showMoney">{{(countData.profitTotalNum||0).toFixed(0)}}</text>
|
<text v-if="showMoney">{{countData.profitTotalFloat || '.00'}}</text>
|
<text v-if="!showMoney">****</text>
|
</view>
|
</view>
|
<view class="data-c-item">
|
<view class="data-c-item-top">
|
<text>订单数</text>
|
</view>
|
<view class="data-c-item-bottom">
|
<text v-if="showMoney">{{countData.orderNum||0}}</text>
|
<text v-if="!showMoney">****</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
<view class="func">
|
<view class="func-item" style="margin-bottom: 30rpx;">
|
<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_dingdanguanli@2x.png" mode="widthFix"></image>
|
<text>订单管理</text>
|
</view>
|
<view class="func-item" style="margin-bottom: 30rpx;">
|
<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_zitihexiao@2x.png" mode="widthFix"></image>
|
<text>自提核销</text>
|
</view>
|
<view class="func-item">
|
<image src="/static/icon/ic_wodezizhi@2x.png" mode="widthFix"></image>
|
<text>我的资质</text>
|
</view>
|
<view class="func-item">
|
<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" v-if="!show">待处理订单 ({{total}})</view>
|
<view class="list" v-if="!show">
|
<view class="list-item" v-for="(item, index) in dataList" :key="index">
|
<view class="a">
|
<view class="a-left">
|
<view class="a-left-tips">{{item.receiveType==1?'自提':'快递配送'}}</view>
|
<text>订单号:{{item.id}}</text>
|
</view>
|
<text v-if="item.status ==0" class="a-right">待支付</text>
|
<text v-if="item.status ==1" class="a-right">{{item.receiveType==1?'待自提':'待发货'}}</text>
|
<text v-if="item.status ==2" class="a-right">待收货</text>
|
<text v-if="item.status ==3" class="a-right">交易完成</text>
|
<text v-if="item.status ==4"class="a-right">已取消</text>
|
<text v-if="item.status ==6" class="a-right">已退款</text>
|
</view>
|
<view class="b">
|
<view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])">
|
<view class="b-item-image">
|
<image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image>
|
</view>
|
<view class="b-item-title">{{item1.name||''}}</view>
|
<view class="b-item-jia">
|
<text>¥{{(item1.price||0).toFixed(2)}}</text>
|
<text>x{{item1.goodsNum||0}}</text>
|
</view>
|
</view>
|
<view class="b-item" v-for="(item1, index1) in (item.goodsorderDetailList||[])">
|
<view class="b-item-image">
|
<image :src="item1.imgurl||'/static/logo.png'" mode="widthFix"></image>
|
</view>
|
<view class="b-item-title">{{item1.name||''}}</view>
|
<view class="b-item-jia">
|
<text>¥{{(item1.price||0).toFixed(2)}}</text>
|
<text>x{{item1.goodsNum||0}}</text>
|
</view>
|
</view>
|
</view>
|
<view class="c">
|
<view class="c-label">
|
<view class="c-label-title">实付款:</view>
|
<view class="c-label-price">
|
<text>{{(item.price||0).toFixed(2)}}</text>
|
<text></text>
|
</view>
|
</view>
|
<view class="c-btns">
|
<view class="c-btns-item blue" @click="contactPhone(item)">联系客户</view>
|
<view class="c-btns-item bg">自提核销</view>
|
</view>
|
</view>
|
<view class="d" v-if="item.memberInfo">
|
订单备注:{{item.memberInfo||''}}
|
</view>
|
</view>
|
<view v-if="!hasNext" class="nomore">已加载全部</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>
|
<u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true" @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true">
|
<view class="phone">
|
<view class="phone-head">
|
<view></view>
|
<text>联系客户</text>
|
</view>
|
<!-- <view class="phone-item">
|
<view>
|
<image style="width: 36rpx;height: 36rpx" src="/static/icon/ic_kefu.png" mode="widthFix"></image>
|
<button open-type="contact" plain="true" bindcontact="handleContact">在线客服</button>
|
</view>
|
<view class="line" v-if="serverPhone && serverPhone.length"></view>
|
</view> -->
|
<view class="phone-item" >
|
<view>
|
<image src="/static/icon/ic_call@2x.png" mode="widthFix" @click="contactPhoneDo()"></image>
|
<text>{{linkItem.linkname}} </text>
|
<text style="margin-left: 10px;"> {{linkItem.linkphone}}</text>
|
</view>
|
</view>
|
<view style="width: 100%; height: 30rpx;"></view>
|
<!-- <view class="phone-botton" @click="contactPhone()" >关闭</view> -->
|
</view>
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
computed: {
|
...mapState(['navHeight', 'statusbarHeight','shopInfo', 'shopToken'])
|
},
|
data() {
|
return {
|
show:false,
|
active:0,
|
loading:false,
|
showMoney:false,
|
showPhone:false,
|
currentPage:1,
|
total:0,
|
hasNext:true,
|
dataList:[],
|
shop:{},
|
linkItem:{},
|
countData:{},
|
backgroundImage: require('@/static/images/bg_card@2x.png')
|
};
|
},
|
onShow() {
|
this.shop ={}
|
this.checkShopLogin()
|
this.active=0
|
this.shop = this.shopInfo || {}
|
this.getCountData()
|
this.currentPage = 0
|
this.getOrderList()
|
},
|
onReachBottom(){
|
this.getOrderList( );
|
},
|
methods:{
|
contactPhone(item){
|
this.showPhone = !this.showPhone
|
this.linkItem = item ||{}
|
console.log("==================================",this.showPhone)
|
},
|
contactPhoneDo(){
|
if(this.linkItem.linkphone !=null && this.linkItem.linkphone!=''){
|
uni.makePhoneCall({
|
phoneNumber: this.linkItem.linkphone
|
})
|
}
|
},
|
changeActive(index){
|
this.getCountData(index)
|
},
|
checkShopLogin(){
|
var that =this
|
if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){
|
this.jumpShopLogin()
|
}
|
},
|
async getCountData(index){
|
var that =this
|
let res = await that.$u.api.saleReport({ dateType: index, endDate: null, startDate: null, tokenType:1 })
|
if (res.code === 200) {
|
this.active = index
|
this.countData = res.data
|
this.countData.profitTotal = (this.countData.profitTotal||0.00 ).toFixed(2)
|
this.countData.saleTotal = (this.countData.saleTotal||0.00).toFixed(2)
|
this.countData.profitTotalNum = Math.floor(this.countData.profitTotal)
|
this.countData.saleTotalNum = Math.floor( this.countData.saleTotal)
|
var t1 =(this.countData.profitTotal - this.countData.profitTotalNum).toFixed(2)
|
var t2 =(this.countData.saleTotal - this.countData.saleTotalNum).toFixed(2)
|
this.countData.profitTotalFloat =( t1+'').slice(1, 4)
|
this.countData.saleTotalFloat = ( t2+'').slice(1, 4)
|
}
|
},
|
async getOrderList(){
|
if(this.loading || !this.hasNext){
|
return
|
}
|
this.loading=true
|
this.currentPage = this.currentPage+1
|
if(this.currentPage == 1){
|
this.hasNext =true
|
this.dataList=[]
|
}
|
var that =this
|
let res = await that.$u.api.shopOrderPage({
|
capacity:10,
|
model: {
|
receiveType: 1,
|
status: 1
|
},
|
page:this.currentPage
|
});
|
console.log(res)
|
if (res.code === 200 ) {
|
if ( res.data && res.data.page ===this.currentPage) {
|
res.data.records = res.data.records||[]
|
that.dataList.push(...res.data.records)
|
that.total=res.data.total
|
if( this.currentPage >= res.data.pageCount||0){
|
that.hasNext=false
|
}else{
|
that.hasNext=true
|
}
|
}
|
}
|
this.loading=false
|
},
|
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>
|
|
<style>
|
page {
|
background-color: #F9F9FB;
|
}
|
</style>
|
<style lang="scss" scoped>
|
.box {
|
width: 100%;
|
.head {
|
width: 100%;
|
height: 424rpx;
|
padding: 0 30rpx;
|
position: sticky;
|
top: 0;
|
left: 0;
|
z-index: 999;
|
box-sizing: border-box;
|
background: linear-gradient(180deg, #C8F3FF 0%, #ffffff 100%);
|
|
.head-bar {
|
width: 100%;
|
|
.head-bar-nav {
|
width: 100%;
|
|
.loginOut {
|
width: 120rpx;
|
height: 52rpx;
|
background: #C3E6F5;
|
border-radius: 26rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
image {
|
width: 24rpx;
|
height: 24rpx;
|
margin-right: 8rpx;
|
}
|
text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #004096;
|
}
|
}
|
}
|
}
|
.title {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #111111;
|
margin-top: 40rpx;
|
}
|
.list {
|
width: 100%;
|
margin-top: 30rpx;
|
padding-bottom: 60rpx;
|
.nomore{
|
width: 100%;
|
text-align: center;
|
font-size: 24rpx;
|
color: #666666;
|
}
|
.list-item {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background: #FFFFFF;
|
border-radius: 16rpx;
|
margin-bottom: 20rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.a {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.a-left {
|
display: flex;
|
align-items: center;
|
.a-left-tips {
|
padding: 0 6rpx;
|
height: 40rpx;
|
line-height: 40rpx;
|
background: #00B775;
|
border-radius: 8rpx;
|
font-weight: 400;
|
font-size: 22rpx;
|
color: #FFFFFF;
|
margin-right: 16rpx;
|
}
|
text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
.a-right {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #E4001D;
|
}
|
}
|
.b {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
margin-top: 22rpx;
|
.b-item {
|
width: 100%;
|
height: 136rpx;
|
display: flex;
|
align-items: flex-start;
|
justify-content: space-between;
|
margin-bottom: 22rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
.b-item-image {
|
flex-shrink: 0;
|
width: 136rpx;
|
height: 136rpx;
|
border-radius: 8rpx;
|
overflow: hidden;
|
border: 1rpx solid #E5E5E5;
|
margin-right: 20rpx;
|
image {
|
width: 100%;
|
}
|
}
|
.b-item-title {
|
flex: 1;
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #222222;
|
margin-right: 30rpx;
|
display: -webkit-box;
|
-webkit-line-clamp: 2; /* 限制文本为2行 */
|
-webkit-box-orient: vertical;
|
overflow: hidden;
|
}
|
.b-item-jia {
|
flex-shrink: 0;
|
display: flex;
|
flex-direction: column;
|
align-items: flex-end;
|
text {
|
&:nth-child(1) {
|
font-weight: 500;
|
font-size: 30rpx;
|
color: #222222;
|
}
|
&:nth-child(2) {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #999999;
|
margin-top: 14rpx;
|
}
|
}
|
}
|
}
|
}
|
.c {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-top: 24rpx;
|
.c-label {
|
display: flex;
|
align-items: center;
|
.c-label-title {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
.c-label-price {
|
display: flex;
|
align-items: baseline;
|
text {
|
&:nth-child(1) {
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #222222;
|
&::before {
|
content: '¥';
|
font-weight: 600;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
&:nth-child(2) {
|
font-weight: 600;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
}
|
}
|
.c-btns {
|
display: flex;
|
align-items: center;
|
.blue {
|
border: 1rpx solid #004096;
|
color: #004096 !important;
|
}
|
.bg {
|
background: #004096 !important;
|
color: #ffffff !important;
|
}
|
.c-btns-item {
|
padding: 0 24rpx;
|
box-sizing: border-box;
|
height: 64rpx;
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
border-radius: 34rpx;
|
border: 1rpx solid #B2B2B2;
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #666666;
|
margin-right: 20rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
}
|
}
|
}
|
.d {
|
width: 100%;
|
padding: 20rpx;
|
background: #F8F9FB;
|
border-radius: 8rpx;
|
box-sizing: border-box;
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #666666;
|
margin-top: 24rpx;
|
}
|
}
|
}
|
.user {
|
width: 100%;
|
height: 108rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.user-left {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
.user-left-image {
|
flex-shrink: 0;
|
width: 108rpx;
|
height: 108rpx;
|
border-radius: 50%;
|
overflow: hidden;
|
margin-right: 24rpx;
|
image {
|
width: 100%;
|
}
|
}
|
.user-left-info {
|
flex: 1;
|
height: 108rpx;
|
display: flex;
|
flex-direction: column;
|
justify-content: space-between;
|
.user-left-info-title {
|
font-weight: 600;
|
font-size: 36rpx;
|
color: #111111;
|
}
|
.user-left-info-val {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
text {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #666666;
|
&:nth-child(2) {
|
margin-left: 60rpx;
|
}
|
}
|
}
|
}
|
}
|
.user-qrcode {
|
width: 40rpx;
|
height: 40rpx;
|
image {
|
width: 100%;
|
}
|
}
|
}
|
.data {
|
width: 100%;
|
height: 250rpx;
|
background-repeat: no-repeat;
|
background-size: 100% 100%;
|
margin-top: 45rpx;
|
padding: 30rpx;
|
box-sizing: border-box;
|
.data-a {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.data-a-left {
|
flex: 1;
|
display: flex;
|
align-items: center;
|
.active {
|
font-weight: 600 !important;
|
font-size: 32rpx !important;
|
color: #FFFFFF !important;
|
}
|
.data-a-left-item {
|
font-weight: 400;
|
font-size: 28rpx;
|
color: rgba(255,255,255,0.8);
|
margin-right: 32rpx;
|
&:last-child {
|
margin: 0 !important;
|
}
|
}
|
}
|
.data-a-to {
|
flex-shrink: 0;
|
display: flex;
|
align-items: center;
|
text {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: rgba(255,255,255,0.7);
|
margin-right: 8rpx;
|
}
|
image {
|
width: 8rpx;
|
height: 18rpx;
|
}
|
}
|
}
|
.data-b {
|
width: 100%;
|
height: 1rpx;
|
background-color: rgba(255,255,255,0.09);
|
margin: 20rpx 0;
|
}
|
.data-c {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.data-c-item {
|
display: flex;
|
flex-direction: column;
|
align-items: flex-start;
|
justify-content: space-evenly;
|
.data-c-item-top {
|
display: flex;
|
align-items: center;
|
text {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: rgba(255,255,255,0.7);
|
}
|
image {
|
width: 40rpx;
|
height: 40rpx;
|
margin-left: 10rpx;
|
}
|
}
|
.data-c-item-bottom {
|
display: flex;
|
align-items: baseline;
|
justify-content: center;
|
margin-top: 10rpx;
|
text {
|
&:nth-child(1) {
|
font-weight: 600;
|
font-size: 44rpx;
|
color: #FFFFFF;
|
}
|
&:nth-child(2) {
|
font-weight: 600;
|
font-size: 26rpx;
|
color: #FFFFFF;
|
}
|
}
|
}
|
}
|
}
|
}
|
.func {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background: #FFFFFF;
|
border-radius: 16rpx;
|
margin-top: 30rpx;
|
display: flex;
|
align-items: center;
|
flex-wrap: wrap;
|
justify-content: space-between;
|
.func-item {
|
width: 25%;
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
justify-content: center;
|
image {
|
width: 88rpx;
|
height: 88rpx;
|
}
|
text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
margin-top: 16rpx;
|
}
|
}
|
}
|
}
|
.phone {
|
width: 100%;
|
padding-top: 40rpx;
|
box-sizing: border-box;
|
.phone-botton {
|
width: 100%;
|
height: 88rpx;
|
line-height: 88rpx;
|
text-align: center;
|
font-weight: 500;
|
font-size: 32rpx;
|
color: #FFFFFF;
|
background: #00BC12;
|
border-radius: 44rpx;
|
margin-top: 60rpx;
|
}
|
.phone-head {
|
width: 100%;
|
text-align: center;
|
justify-content: space-between;
|
margin-bottom: 40rpx;
|
text {
|
font-weight: 800;
|
font-size: 32rpx;
|
color: #222222;
|
}
|
}
|
|
.phone-item {
|
width: 100%;
|
text-align: center;
|
display: flex;
|
justify-content: center;
|
flex-direction: column;
|
// border-bottom: 1rpx solid #eeeeee;
|
line-height: 78rpx;
|
button{
|
border: 1rpx white solid;
|
display: inline;
|
width: 300rpx;
|
font-weight: 500;
|
font-size: 32rpx;
|
line-height: 32rpx;
|
color: #222222;
|
}
|
image{
|
width: 28rpx;
|
height: 28rpx;
|
margin-right: 30rpx;
|
}
|
.line{
|
width: 100%;
|
height: 1rpx;
|
background-color: #f2f2f2
|
}
|
text {
|
font-weight: 500;
|
font-size: 28rpx;
|
line-height: 28rpx;
|
color: #222222;
|
}
|
}
|
}
|
}
|
</style>
|