平板端快衣店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

448 lines
12 KiB

<template>
<view>
<cmd-nav-bar iconOne="menu" @iconOne="goToInfo" :title="shopName" background-color="#fff"></cmd-nav-bar>
<view class="IndexContent">
<view class="contentPadding" style="color:#000;background: #FBFBFF !important;padding: 28rpx 20rpx 0 !important;">
<view class="title-btn-d">
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
<text>待退货</text>
<text v-if="waitCount.waitReturnCount > 0" class="red-circle">{{waitCount.waitReturnCount > 99 ? '99+' :waitCount.waitReturnCount}}</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/order?listStatus=6')">
<text>待配货</text>
<text v-if="waitCount.waitAddProductCount > 0" class="red-circle">{{waitCount.waitAddProductCount > 99 ? '99+' :waitCount.waitAddProductCount}}</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/addHangOrder')">
<text>挂单</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/shareStyle')">
<text>推款</text>
</view>
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/waitStorage?inStorageStatus=0')">
<text>待入库</text>
<text v-if="waitCount.waitPurchaseCount > 0" class="red-circle">{{waitCount.waitPurchaseCount > 99 ? '99+' :waitCount.waitPurchaseCount}}</text>
</view>
</view>
</view>
<view class="contentPadding">
<view class="title">
<i class="iconfont icon-xiaoshouyuce"> 今日营收详情</i>
</view>
<u-grid :col="2">
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalAmount" :decimals="2"></u-count-to>
<text class="grid-text">销售总金额</text>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalCount"></u-count-to>
<view class="grid-text">销售笔数</view>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="type==0?shopInfo.totalProfit:0" :decimals="2"></u-count-to>
<view class="grid-text">今日利润</view>
</u-grid-item>
<u-grid-item>
<u-count-to :start-val="0" :end-val="shopInfo.totalCCount"></u-count-to>
<view class="grid-text">下单客户数</view>
</u-grid-item>
</u-grid>
</view>
<view class="contentPadding" v-if="type == 0">
<view class="title">
<i class="iconfont icon-huaban"> 本周营收统计
<view class="btn" @tap="gotoSearchData">
数据统计 >
</view>
</i>
</view>
<qiun-data-charts type="column" :opts="opts" :chartData="chartData" canvas2d="true"
canvasId="canvsaId1" />
</view>
<view class="contentPadding">
<view class="title">
<i class="iconfont icon-wenjianliebiao"> 近期订单列表</i>
</view>
<ul class="inventoryList" v-if="inventoryList.length > 0">
<li v-for="item in inventoryList" :key="item.id">
<uni-card :title="item.userName == null ?'暂无':item.userName" :sub-title="'¥'+(item.totalAmount == null ?'暂无':item.totalAmount)" :thumbnail="item.img"
@tap="gotoDetail(item.id)">
<view class="uni-body">{{ item.createByName == null ?'暂无':item.createByName}} - {{ item.createTime }}</view>
<view class="uni-body"> <text class="cardText">
订单状态:</text>{{item.status == 0 ?'待抢单' :item.status == 1 ?'待取货' :item.status == 3 ?'待送达' :item.status == 4 ?'已完成' :item.status == 5 ?'下游客户待退货' :item.status == 00 ?'退货待抢单' :item.status == 01 ?'退货待取货' :item.status == 03 ?'退货待送达' :item.status == 04 ?'待确认退货' :item.status == 6 ?'待配货' :'挂单'}}
</view>
</uni-card>
</li>
</ul>
<u-empty v-else mode="order" text="暂无订单,快去开单吧!"></u-empty>
</view>
</view>
<view>
<u-popup :show="settingShow" @close="settingShow = false" closeOnClickOverlay mode="left" safeAreaInsetTop
safeAreaInsetTop>
<view class="popup-content">
<view class="content-avatar">
<u-avatar :src="avatar"></u-avatar>
<view class="shop-name">{{ shopName }}</view>
</view>
<view style="z-index:999">
<u-cell-group>
<u-cell icon="setting-fill" url="/pages/index/checkShop" title="切换当前店铺" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="setting-fill" url="/pages/index/shopInfo" title="修改个人信息" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/upstream" v-if="type==0" title="供货商欠款" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/downstream" v-if="type==0" title="客户欠款" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/waitStorage" title="采购单历史" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="/pages/index/order?type=dingdan" title="销售单历史" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="" title="物业费缴纳" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="" title="电费缴纳" clickable isLink
arrow-direction="left"></u-cell>
<u-cell icon="integral-fill" url="" title="租金缴纳(已过期)" clickable isLink
arrow-direction="left"></u-cell>
</u-cell-group>
</view>
</view>
</u-popup>
</view>
</view>
</template>
<!-- cmd-nav-bar.vue index.vue pages.json -->
<script>
import cmdNavBar from "@/components/cmd-nav-bar/cmd-nav-bar.vue";
import {
mapState
} from 'vuex';
export default {
computed: mapState(['shopName', 'userId', 'shopIndex', 'avatar']),
data() {
return {
type:'',
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
inventoryList: [],
settingShow: false,
chartData: {},
shopName:'',
opts: {
// color: ["#1890FF", "#73C0DE"],
padding: [15, 10, 0, 15],
dataLabel: true,
dataPointShape: false,
enableScroll: false,
legend: {},
xAxis: {
disableGrid: true
},
yAxis: {
gridType: "dash",
dashLength: 2,
data: [{
min: 0
}]
},
extra: {
column: {
type: "group",
width: 30,
customColor: ["#44fd6d", "#91CB74"],
activeBgColor: "#000000",
activeBgOpacity: 0.08,
seriesGap: 10,
barBorderCircle: true,
barBorderRadius: [
20,
20,
0,
0
],
linearType: "custom"
}
},
},
shopInfo: {},
waitCount:{}
}
},
components: {
cmdNavBar
},
filters: {
spliceMsg(val) {
val == null || undefined ? '暂无' : val
return val;
}
},
onShow(){
this.shopName = uni.getStorageSync('shopName')
this.type = uni.getStorageSync('type')
},
onLoad() {
this.getSaleInfo()
this.getServerData();
this.getOrderInfoList();
this.getWaitCount()
},
methods: {
getWaitCount(){
this.tui.request("/app/sale/getWaitCount", "POST", {}, false, false).then((res) => {
if(res.code == 200){
this.waitCount = res.result
}else{
this.tui.toast(res.message)
}
})
},
getSaleInfo() {
this.tui.request("/app/sale/getShopAll", "POST", {
shopId: this.shopIndex
}, false, false).then((res) => {
if(res.code == 200){
this.shopInfo = res.result
}else{
this.tui.toast(res.message)
}
})
},
goToInfo() {
this.settingShow = true
},
gotoSearchData() {
uni.navigateTo({
url: '/pages/index/searchData'
})
},
gotoOrder() {
uni.navigateTo({
url: '/pages/index/order?userId=' + this.userId
})
},
// 订单查询 主页显示5条
getOrderInfoList() {
this.tui.request("/app/sale/listPages", "POST", {
pageVo: {
pageSize: 5,
pageNumber: 1
},
}, false, false).then((res) => {
this.status = 'nomore';
if (res.code == 200) {
for (var i=0;i<= res.result.records.length;i++) {
res.result.records[i].img='/static/images/dingdan/dd'+i+'.png'
this.inventoryList = res.result.records
}
this.totalPages = res.result.pages
} else {
this.tui.toast(res.message)
}
}).catch((res) => {})
},
getServerData() {
this.tui.request("/app/sale/getShopWeek", "POST", {}, false, false).then((res) => {
if(res.code == 200){
let dataList = {
categories: this.getWeek(),
series: [{
name: "七天营收统计",
linearColor: [
[0,"#1890FF"],
[0.33,"#00B5FF"],
[0.66,"#00D1ED"],
[1,"#00E6BB"],
[1,"#90F489"]
],
setShadow: [3,8,10,"#00E6BB"],
data: res.result
}]
};
this.chartData = JSON.parse(JSON.stringify(dataList));
}else{
this.tui.toast(res.message)
}
})
},
getWeek() {
let days = 7
let week = ["周日","周一","周二","周三","周四","周五","周六"];
let dateList = Array.from({length:days},(v,i)=> i).map(day =>{
let date = new Date();
date.setDate(date.getDate() - day);
return week[date.getDay()]
})
return dateList.reverse()
},
//跳转订单详情
gotoDetail(id) {
uni.navigateTo({
url: '/pages/index/orderDetail?id=' + id
})
},
//首页头部四个按钮的菜单
goSonPage(url){
if(url=='/pages/index/waitStorage?inStorageStatus=0'){
if(this.type!= 0){
this.tui.toast('暂无查看权限!')
return;
}
}
uni.navigateTo({
url: url
})
}
}
}
</script>
<style lang="scss" scoped>
.IndexContent {
/*距离顶部范围应该在88-95范围内*/
padding-top: 160upx;
top: var(--status-bar-height);
.contentPadding {
padding: 28upx 20upx;
background-color: #fff;
color: #909399;
.title {
padding-left: 20rpx;
font-size: 32rpx;
color: #303133;
margin-bottom: 26rpx;
line-height: 66rpx;
image {
display: inline-block;
width: 40rpx;
vertical-align: middle;
}
.btn {
text-align: right;
width: 24%;
float: right;
font-size: 26rpx;
color: $u-primary;
}
}
.grid-text {
font-size: 28rpx;
margin-bottom: 26rpx;
}
}
}
.popup-content {
width: 450upx;
padding: 12upx;
}
.content-avatar {
display: flex;
align-items: center;
margin: 25upx 0;
}
.shop-name {
margin-left: 15upx;
}
.title-dianpu {
margin-top: 14upx;
border-bottom: 1px solid #fff;
padding-bottom: 20upx;
}
.title-btn-d {
height: 40px;
display: flex;
}
.dianpu-img {
width: 60upx;
height: 60upx;
float: left;
margin-left:20upx;
}
.dianpu-text {
font-size: 40upx;
height: 60upx;
line-height: 65upx;
padding-left: 20upx;
}
.title-btn-sbtn{
flex: 1;
line-height: 80upx;
text-align: center;
position: relative;
}
.title-btn-sbtn:hover{
color: #B22222;
}
.title-btn-sbtn:nth-child(1),.title-btn-sbtn:nth-child(2){
border-right: 1px solid #fff;
}
.red-circle{
position: absolute;
top: 0;
right: 0;
width: 40rpx;
height: 40rpx;
line-height: 40rpx;
font-size: 22rpx;
border-radius: 50%;
background: red;
color: #fff;
text-align: center;
}
</style>
<style>
.u-cell__body {
padding-left: 0 !important;
}
.u-grid-item.data-v-5b3a01af {
width: 44% !important;
height: 160rpx;
background: linear-gradient(#84C1FF, #C4E1FF) !important;
margin-left: 4%;
border-radius: 30rpx;
margin-top: 20rpx !important;
color: #fff;
}
.u-grid-item.data-v-5b3a01af:nth-child(2) {
background: linear-gradient(#FFBB77, #FFDCB9) !important;
}
.u-grid-item.data-v-5b3a01af:nth-child(3) {
background: linear-gradient(#1AFD9C, #7AFEC6) !important;
}
.u-grid-item.data-v-5b3a01af:nth-child(4) {
background: linear-gradient(#79FF79, #BBFFBB) !important;
}
.u-count-num {
color: #FFF !important
}
.status-bar {
height: 42px !important;
}
.cmd-nav-bar {
height: 90rpx !important;
}
</style>