<template>
|
<view class="container">
|
<!-- 渐变背景容器 -->
|
<view class="gradient-background">
|
<!-- 自定义导航栏 -->
|
<view class="custom-nav">
|
<view :style="{ height: statusbarHeight + 'px' }"></view>
|
<view class="nav-content" :style="{ height: navHeight + 'px' }">
|
<image class="nav-icon" src="/static/icon/ic_home@2x.png" @click="goToStore"></image>
|
<text class="nav-title">{{ shopInfo.shopName || '' }}</text>
|
</view>
|
</view>
|
<view :style="{ height: (statusbarHeight + navHeight) + 'px' }"></view>
|
<!-- 数据统计 -->
|
<view class="stats-section" :style="{ backgroundImage: 'url(' + bgImg + ')' }">
|
<view class="stats-tabs">
|
<view class="stats-tabs-left">
|
<view :class="'tab-item '+(active ==0?'active':'')" @click="changeActive(0)">今日</view>
|
<view :class="'tab-item '+(active ==1?'active':'')" @click="changeActive(1)">本月</view>
|
<view :class="'tab-item '+(active ==2?'active':'')" @click="changeActive(2)">上月</view>
|
</view>
|
<text class="tab-item right">在库订单: {{countData.storageCount||0}}</text>
|
</view>
|
|
<view class="stats-cards">
|
<view class="stat-card">
|
<view class="stat-label">
|
<text>销售额(元)</text>
|
<image class="stat-icon" src="/static/icon/ic_visible@2x.png"></image>
|
</view>
|
<text class="stat-value">{{countData.salesAmount}}</text>
|
</view>
|
<view class="stat-card">
|
<view class="stat-label">
|
<text>结算利润(元)</text>
|
</view>
|
<text class="stat-value">{{countData.settlementProfit}}</text>
|
</view>
|
<view class="stat-card">
|
<view class="stat-label">
|
<text>订单数</text>
|
</view>
|
<text class="stat-value">{{countData.orderCount||0}}</text>
|
</view>
|
</view>
|
</view>
|
</view>
|
|
<!-- 功能按钮 -->
|
<view class="function-buttons">
|
<view class="func-btn" @click="jumpHexiaoOrder">
|
<image class="func-icon" src="/shop/static/icon/ic_zitihexiao@2x.png"></image>
|
<text class="func-text">门店出入库</text>
|
</view>
|
<view class="func-btn" @click="jumpOrders()">
|
<image class="func-icon" src="/shop/static/icon/ic_dingdanguanli@2x.png"></image>
|
<text class="func-text">订单管理</text>
|
</view>
|
<view class="func-btn" @click="goToStoreInfo">
|
<image class="func-icon" src="/shop/static/icon/ic_zhuanshuhaibao@2x.png"></image>
|
<text class="func-text">门店信息</text>
|
</view>
|
<view class="func-btn" @click="goToQualification">
|
<image class="func-icon" src="/shop/static/icon/ic_wodezizhi@2x.png"></image>
|
<text class="func-text">门店资质</text>
|
</view>
|
</view>
|
<text class="section-title">待处理订单({{total||0}})</text>
|
<!-- 待处理订单 -->
|
<view class="orders-section">
|
<view class="order-item" v-for="(item,index) in dataList" :key="item.id">
|
<view class="order-header" @click="jumpOrderDetails(item.id)">
|
<view style="display: flex; align-items: center;">
|
<view class="order-tag">{{item.type===1?'同城配送':'就地寄存'}}</view>
|
<text class="order-user">{{item.takeUser || ''}} {{item.takePhone||''}}</text>
|
</view>
|
<view style="display: flex;flex-direction: column;">
|
<text v-if="item.status ===5 && item.overdueStatus ===1 " class="order-status" style="color: red;">超时未取件</text>
|
<text v-else-if="item.status ===5 && item.overdueStatus ===3 " class="order-status" style="color: red;">超时到店取件</text>
|
<text v-else class="order-status">{{item.statusName || ''}}</text>
|
<text v-if="item.status ===5 && item.overdueStatus ===1 " class="order-status" style="color: red;font-size: 24rpx;">逾期费用¥{{((item.overdueFee || 0)/100).toFixed(2)}}</text>
|
<text v-if="item.status ===5 && item.overdueStatus ===3 " class="order-status" style="color: red;font-size: 24rpx;">逾期费用¥{{((item.overdueFee || 0)/100).toFixed(2)}}</text>
|
</view>
|
</view>
|
<view class="order-items" @click="jumpOrderDetails(item.id)">
|
<view class="order-product" v-for="(item1,index1) in item.detailList" :key="item1.id">
|
<view class="product-info">
|
<text class="product-name">{{item1.luggageName || ''}}</text>
|
<text class="product-spec">{{item1.luggageDetail || ''}}</text>
|
</view>
|
<view class="product-price-count">
|
<text class="product-price">¥{{((item1.subtotal || 0)/100).toFixed(2) }}</text>
|
<text class="product-count">x{{ item1.num || 1}}</text>
|
</view>
|
</view>
|
</view>
|
|
<view class="order-footer">
|
<text class="total-price">
|
<text>实付款: </text>
|
<text>¥{{((item.estimatedAmount || 0)/100).toFixed(2) }}</text>
|
</text>
|
<view class="order-buttons">
|
<button class="btn secondary" @click="contactPhoneDo(item.takePhone)">联系客户</button>
|
<button class="btn secondary" @click="contactPhoneDo(item.driverPhone)" v-if="item.type ===1&&(item.status === 4 || item.status === 3)">联系骑手</button>
|
<button class="btn primary" v-if="item.status ===1 " @click="jumpHexiaoOrder(item)">收件核销</button>
|
<button class="btn primary" v-if="item.status ===5 &&(item.overdueStatus ==0 || item.overdueStatus == 1)" @click="jumpHexiaoOrder(item)">确认到店</button>
|
<button class="btn primary" v-if="item.status ===5 && (item.overdueStatus == 4 || item.overdueStatus == 2) " @click="jumpHexiaoOrder(item)">取件核销</button>
|
</view>
|
</view>
|
<view class="order-note" v-if="item.remark">订单备注: <text>{{item.remark || '-'}}</text></view>
|
</view>
|
<view v-if="isLoadingMore" class="loading-text">加载中...</view>
|
<view v-else-if="!hasNext && dataList.length" class="loading-text">没有更多了</view>
|
<view v-else-if="!hasNext && !dataList.length" class="loading-text">暂无数据</view>
|
</view>
|
<custom-tabbar></custom-tabbar>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
import CustomTabbar from '@/components/custom-tabbar/custom-tabbar.vue'
|
export default {
|
components: {
|
CustomTabbar
|
},
|
computed: {
|
...mapState(['navHeight', 'statusbarHeight', 'shopInfo'])
|
},
|
onReachBottom() {
|
console.log('store-home onReachBottom')
|
this.getDataList();
|
},
|
onShow() {
|
this.shop ={}
|
this.checkShopLogin()
|
this.active=0
|
this.shop = this.shopInfo || {}
|
this.getCountData(0)
|
this.total=0
|
this.hasNext=true
|
this.currentPage = 0
|
this.getFirstPageData()
|
},
|
methods: {
|
changeActive(index){
|
this.getCountData(index)
|
},
|
checkShopLogin(){
|
/* var that =this
|
if( this.shopInfo ==null || this.shopInfo.id==null || this.shopToken==null || this.shopToken==''){
|
this.jumpShopLogin()
|
} */
|
},
|
hexiaoOrder(item){
|
uni.navigateTo({
|
url:'/shop/pages/write-off-a/write-off-a?id='+item.id
|
})
|
},
|
jumpHexiaoOrder(){
|
uni.navigateTo({
|
url:'/shop/pages/write-off/write-off'
|
})
|
},
|
jumpOrders(){
|
uni.navigateTo({
|
url:'/shop/pages/orders/orders'
|
})
|
},
|
jumpOrderDetails(id){
|
uni.navigateTo({
|
url:'/shop/pages/order-details/order-details?id='+id
|
})
|
},
|
async getCountData(index){
|
var that =this
|
let res = await that.$u.api.shopSalesStats({ period: index, endDate: null, startDate: null, tokenType:1 })
|
if (res.code === 200) {
|
this.active = index
|
this.countData = res.data
|
this.countData.salesAmount = (this.countData.salesAmount||0.00 ).toFixed(2)
|
console.log(this.countData.salesAmount,'====================',1)
|
this.countData.settlementProfit = (this.countData.settlementProfit||0.00).toFixed(2)
|
this.countData.salesAmountNum = Math.floor(this.countData.salesAmount)
|
|
console.log(this.countData.salesAmountNum,'====================',2)
|
this.countData.settlementProfitNum = Math.floor( this.countData.settlementProfit)
|
var t1 =(this.countData.salesAmount - this.countData.salesAmountNum).toFixed(2)
|
console.log(t1,'====================',3)
|
var t2 =(this.countData.settlementProfit - this.countData.settlementProfitNum).toFixed(2)
|
this.countData.salesAmountFloat =( t1+'').slice(1, 4)
|
|
console.log(this.countData.salesAmountFloat,'====================',4)
|
this.countData.settlementProfitFloat = ( t2+'').slice(1, 4)
|
}
|
},
|
getFirstPageData(){
|
this.currentPage = 0
|
this.hasNext=true
|
this.total=0
|
this.dataList=[]
|
this.getDataList()
|
},
|
async getDataList(){
|
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:this.pageSize,
|
model: {
|
combinedStatus: 7
|
},
|
page:this.currentPage
|
});
|
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
|
},
|
contactPhoneDo(phone){
|
if( phone!=null && phonee!=''){
|
uni.makePhoneCall({
|
phoneNumber: phone
|
})
|
}
|
},
|
goToStoreInfo() {
|
uni.navigateTo({
|
url: '/shop/pages/store-info/store-info'
|
})
|
},
|
goToQualification() {
|
uni.navigateTo({
|
url: '/shop/pages/qualification/qualification'
|
})
|
},
|
goToStore() {
|
uni.switchTab({
|
url: '/pages/index/index'
|
})
|
},
|
jumpShopLogin() {
|
uni.redirectTo({
|
url: '/shop/pages/login/login'
|
})
|
}
|
},
|
data() {
|
return {
|
bgImg: require('@/static/image/bg_card@2x.png'),
|
show:false,
|
showHaibao:false,
|
showQrcode:false,
|
active:0,
|
loading:false,
|
showMoney:false,
|
showPhone:false,
|
currentPage:1,
|
total:0,
|
hasNext:true,
|
pageSize: 10,
|
isLoadingMore: false,
|
|
dataList:[],
|
shop:{},
|
linkItem:{},
|
countData:{},
|
orders: [
|
{
|
id: 1,
|
user: '李明 181****1898',
|
status: '待核验',
|
products: [
|
{ name: '大件行李箱', spec: '24-28寸', price: 35, count: 1 },
|
{ name: '中件行李箱', spec: '24-28寸', price: 35, count: 1 }
|
],
|
total: 80.00,
|
note: '13:30来寄存'
|
},
|
{
|
id: 2,
|
user: '张杰 151****7678',
|
status: '待取件',
|
products: [
|
{ name: '大件行李箱', spec: '24-28寸', price: 35, count: 1 },
|
{ name: '中件行李箱', spec: '24-28寸', price: 35, count: 1 }
|
],
|
total: 70.00,
|
note: '-'
|
}
|
]
|
};
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
$bg-color: #f5f5f5;
|
$primary-color: #1677ff;
|
$danger-color: #ff4d4f;
|
$text-color: #333;
|
$text-tertiary-color: #999;
|
|
.container {
|
background-color: $bg-color;
|
min-height: 100vh;
|
}
|
.loading-text {
|
padding: 18rpx 0 8rpx;
|
text-align: center;
|
font-size: 22rpx;
|
color: #a5aab3;
|
}
|
/* 渐变背景容器 */
|
.gradient-background {
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
width: 100%;
|
background: #C8F3FF;
|
color: #1a1a1a;
|
position: relative;
|
overflow: hidden;
|
|
&::after {
|
content: '';
|
position: absolute;
|
bottom: 0;
|
left: 0;
|
right: 0;
|
height: 50%;
|
background: linear-gradient(to bottom, transparent, #ffffff);
|
}
|
}
|
|
/* 自定义导航栏 */
|
.custom-nav {
|
width: 100%;
|
color: #1a1a1a;
|
background-color: #C8F3FF;
|
position: fixed;
|
top: 0;
|
left: 0;
|
z-index: 100;
|
}
|
|
.nav-content {
|
display: flex;
|
align-items: center;
|
padding: 0 20rpx;
|
}
|
|
.nav-icon {
|
width: 64rpx;
|
height: 64rpx;
|
margin-right: 14rpx;
|
}
|
|
.nav-title {
|
font-size: 32rpx;
|
font-weight: bold;
|
}
|
|
.stats-section {
|
height: 256rpx;
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background-repeat: no-repeat;
|
background-size: 100% 100%;
|
margin-top: 20rpx;
|
position: relative;
|
z-index: 99;
|
}
|
|
.stats-tabs {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-bottom: 20rpx;
|
position: relative;
|
z-index: 1;
|
}
|
|
.stats-tabs-left {
|
width: 43%;
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
}
|
|
.tab-item {
|
font-size: 28rpx;
|
color: rgba(255,255,255,0.8);
|
|
&.active {
|
font-size: 32rpx;
|
color: white;
|
font-weight: 600;
|
}
|
|
&.right {
|
color: white;
|
}
|
}
|
|
.stats-cards {
|
width: 100%;
|
height: 132rpx;
|
display: flex;
|
justify-content: space-between;
|
position: relative;
|
z-index: 1;
|
padding-top: 22rpx;
|
box-sizing: border-box;
|
border-top: 1rpx solid rgba(255,255,255,0.09);
|
}
|
|
.stat-card {
|
flex: 1;
|
text-align: left;
|
&:nth-child(1) {
|
flex: 2.3;
|
}
|
&:nth-child(2) {
|
flex: 2;
|
}
|
}
|
|
.stat-label {
|
display: flex;
|
height: 40rpx;
|
text {
|
font-size: 24rpx;
|
font-weight: 400;
|
color: rgba(255,255,255,0.7);
|
}
|
.stat-icon {
|
width: 40rpx;
|
height: 40rpx;
|
margin-left: 10rpx;
|
}
|
}
|
|
.stat-value {
|
font-weight: 600;
|
font-size: 44rpx;
|
color: #FFFFFF;
|
margin-top: 14rpx;
|
}
|
|
.function-buttons {
|
background-color: white;
|
margin: 30rpx 30rpx 40rpx 30rpx;
|
border-radius: 16rpx;
|
padding: 30rpx;
|
display: flex;
|
justify-content: space-between;
|
}
|
|
.func-btn {
|
display: flex;
|
flex-direction: column;
|
align-items: center;
|
width: 120rpx;
|
}
|
|
.func-icon {
|
width: 88rpx;
|
height: 88rpx;
|
margin-bottom: 16rpx;
|
}
|
|
.func-text {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
white-space: nowrap;
|
}
|
|
.orders-section {
|
margin: 30rpx;
|
}
|
|
.section-title {
|
width: 100%;
|
font-weight: 600;
|
font-size: 32rpx;
|
color: #111111;
|
padding: 0 30rpx;
|
box-sizing: border-box;
|
}
|
|
.order-item {
|
background: #FFFFFF;
|
border-radius: 16rpx;
|
padding: 30rpx;
|
box-sizing: border-box;
|
margin-bottom: 20rpx;
|
&:last-child {
|
margin-bottom: 0;
|
}
|
}
|
|
.order-header {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin-bottom: 28rpx;
|
flex-wrap: wrap;
|
}
|
|
.order-tag {
|
background-color: #10B2FA;
|
color: white;
|
width: 104rpx;
|
height: 40rpx;
|
line-height: 40rpx;
|
font-weight: 400;
|
font-size: 22rpx;
|
color: #FFFFFF;
|
text-align: center;
|
background: #10B2FA;
|
border-radius: 8rpx;
|
margin-right: 20rpx;
|
}
|
|
.order-user {
|
font-weight: 400;
|
font-size: 28rpx;
|
color: #333333;
|
}
|
|
.order-status {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #FF0020;
|
}
|
|
.order-product {
|
display: flex;
|
justify-content: space-between;
|
align-items: flex-start;
|
margin-bottom: 26rpx;
|
}
|
|
.product-info {
|
flex: 3;
|
display: flex;
|
flex-direction: column;
|
}
|
|
.product-name {
|
font-weight: 600;
|
font-size: 28rpx;
|
color: #333333;
|
}
|
|
.product-spec {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #8C939F;
|
margin-top: 12rpx;
|
}
|
|
.product-price-count {
|
flex: 1;
|
display: flex;
|
flex-direction: column;
|
align-items: flex-end;
|
}
|
|
.product-price {
|
font-weight: 400;
|
font-size: 30rpx;
|
color: #333333;
|
}
|
|
.product-count {
|
font-weight: 400;
|
font-size: 24rpx;
|
color: #8C939F;
|
margin-top: 12rpx;
|
}
|
|
.order-footer {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
margin: 30rpx 0;
|
}
|
|
.total-price {
|
display: flex;
|
align-items: center;
|
text {
|
&:nth-child(1) {
|
font-weight: 400;
|
font-size: 26rpx;
|
color: #333333;
|
}
|
&:nth-child(2) {
|
font-weight: 600;
|
font-size: 26rpx;
|
color: #222222;
|
}
|
}
|
}
|
|
.order-buttons {
|
display: flex;
|
gap: 20rpx;
|
}
|
|
.btn {
|
width: 160rpx;
|
height: 64rpx;
|
line-height: 64rpx;
|
text-align: center;
|
border-radius: 34rpx;
|
font-size: 28rpx;
|
padding: 0 !important;
|
|
&.secondary {
|
background-color: white;
|
color: #004096;
|
border: 2rpx solid #004096;
|
}
|
|
&.primary {
|
background-color: #004096;
|
color: white;
|
}
|
}
|
|
.order-note {
|
width: 100%;
|
font-size: 26rpx;
|
color: red;
|
background-color: #F8F9FB;
|
padding: 20rpx;
|
box-sizing: border-box;
|
border-radius: 8rpx;
|
margin-top: 20rpx;
|
}
|
</style>
|