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.
447 lines
11 KiB
447 lines
11 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-dianpu">
|
|
<img src="../../static/images/dianpu.png" class="dianpu-img" alt="">
|
|
<text class="dianpu-text">幸福服饰</text>
|
|
</view> -->
|
|
<view class="title-btn-d">
|
|
<view class="title-btn-sbtn" @tap="goSonPage('/pages/index/returnList')">
|
|
<text>待退货</text>
|
|
</view>
|
|
<view class="title-btn-sbtn">
|
|
<text>待配货</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/shareStyle')">
|
|
<text>待入库</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!-- <u-notice-bar :text="list"></u-notice-bar> -->
|
|
<!-- <u-notice-bar mode="horizontal" :list="list" :is-circular="false"></u-notice-bar> -->
|
|
<view class="contentPadding">
|
|
<view class="title">
|
|
<i class="iconfont icon-xiaoshouyuce"> 今日营收详情
|
|
<!-- <view class="btn">
|
|
待配货 >
|
|
</view> -->
|
|
</i>
|
|
<!-- <image src="../../static/images/tabbar/inve1.png" mode="widthFix"></image> -->
|
|
|
|
|
|
</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="shopInfo.totalProfit" :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">
|
|
<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"> 近期订单列表
|
|
<view class="btn" @tap="gotoOrder">
|
|
历史订单 >
|
|
</view>
|
|
</i>
|
|
</view>
|
|
<ul class="inventoryList" v-if="inventoryList.length > 0">
|
|
<li v-for="item in inventoryList" :key="item.id">
|
|
<uni-card :title="item.id" :sub-title="'¥'+item.totalAmount" :thumbnail="item.img"
|
|
@tap="gotoDetail(item.id)">
|
|
<view class="uni-body">{{ item.createByName }} - {{ item.createTime }}</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>
|
|
<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" title="上游供货商欠款" clickable isLink
|
|
arrow-direction="left"></u-cell>
|
|
<u-cell icon="integral-fill" url="/pages/index/downstream" title="下游客户欠款" clickable isLink
|
|
arrow-direction="left"></u-cell>
|
|
<u-cell icon="integral-fill" url="/pages/index/returnList" 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 {
|
|
list: [
|
|
'1',
|
|
'22222',
|
|
'33333',
|
|
'34567'
|
|
],
|
|
src: 'http://pic2.sc.chinaz.com/Files/pic/pic9/202002/hpic2119_s.jpg',
|
|
inventoryList: [],
|
|
settingShow: false,
|
|
chartData: {},
|
|
shopName:'',
|
|
//您可以通过修改 config-ucharts.js 文件中下标为 ['line'] 的节点来配置全局默认参数,如都是默认参数,此处可以不传 opts 。实际应用过程中 opts 只需传入与全局默认参数中不一致的【某一个属性】即可实现同类型的图表显示不同的样式,达到页面简洁的需求。
|
|
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: {
|
|
|
|
}
|
|
}
|
|
},
|
|
components: {
|
|
cmdNavBar
|
|
},
|
|
onLoad() {
|
|
this.getSaleInfo()
|
|
this.getServerData();
|
|
this.getOrderInfoList();
|
|
this.shopName = uni.getStorageSync('shopName')
|
|
},
|
|
methods: {
|
|
// changeMall(e) {
|
|
// this.tui.request("/app/mall/get/"+e.value, "GET", null, true, true).then((res) => {
|
|
// if (res.code == 200 && res.result != null && res.result != undefined) {
|
|
// this.$store.commit('setShopIndex', {
|
|
// shopIndex: res.result.id,
|
|
// shopName: res.result.shopName,
|
|
// region: res.result.region
|
|
// })
|
|
// }
|
|
// }).catch((res) => {})
|
|
// },
|
|
getSaleInfo() {
|
|
this.tui.request("/app/sale/getShopAll", "POST", {
|
|
shopId: this.shopIndex
|
|
}, false, false).then((res) => {
|
|
if(res.code == 200){
|
|
this.shopInfo = res.result
|
|
console.log(res)
|
|
}else{
|
|
this.tui.toast(res.message)
|
|
}
|
|
|
|
})
|
|
},
|
|
goToInfo() {
|
|
this.settingShow = true
|
|
// uni.navigateTo({
|
|
// url: '/pages/info/index'
|
|
// })
|
|
},
|
|
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() {
|
|
//模拟从服务器获取数据时的延时
|
|
setTimeout(() => {
|
|
//模拟服务器返回数据,如果数据格式和标准格式不同,需自行按下面的格式拼接
|
|
let res = {
|
|
categories: ["周一", "周二", "周三", "周四", "周五", "周六", "周天"],
|
|
series: [{
|
|
name: "周销售额",
|
|
linearColor: [
|
|
[
|
|
0,
|
|
"#1890FF"
|
|
],
|
|
[
|
|
0.33,
|
|
"#00B5FF"
|
|
],
|
|
[
|
|
0.66,
|
|
"#00D1ED"
|
|
],
|
|
[
|
|
1,
|
|
"#00E6BB"
|
|
],
|
|
[
|
|
1,
|
|
"#90F489"
|
|
]
|
|
],
|
|
setShadow: [
|
|
3,
|
|
8,
|
|
10,
|
|
"#00E6BB"
|
|
],
|
|
data: [100, 125, 66, 190, 22, 138, 690]
|
|
}]
|
|
};
|
|
this.chartData = JSON.parse(JSON.stringify(res));
|
|
console.log(this.chartData, 'this.chartData');
|
|
}, 500);
|
|
},
|
|
//跳转订单详情
|
|
gotoDetail(id) {
|
|
uni.navigateTo({
|
|
url: '/pages/index/orderDetail?id=' + id
|
|
})
|
|
},
|
|
//首页头部四个按钮的菜单
|
|
goSonPage(url){
|
|
uni.navigateTo({
|
|
url: url
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.IndexContent {
|
|
/*距离顶部范围应该在88-95范围内*/
|
|
padding-top: 160upx;
|
|
top: var(--status-bar-height);
|
|
|
|
.contentPadding {
|
|
// margin: 24upx;
|
|
padding: 28upx 20upx;
|
|
// text-align: center;
|
|
background-color: #fff;
|
|
// border-radius: 14rpx;
|
|
// box-shadow: 0px 1px 10px 2px #e2e2e2;
|
|
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;
|
|
}
|
|
.title-btn-sbtn:hover{
|
|
color: #B22222;
|
|
}
|
|
.title-btn-sbtn:nth-child(1),.title-btn-sbtn:nth-child(2){
|
|
border-right: 1px solid #fff;
|
|
}
|
|
|
|
</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>
|