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.

767 lines
19 KiB

<template>
<view class="page">
<view class="swiper-container">
7 months ago
<view class="swiper-page" v-show="currentIndex == 0">
6 months ago
<view class="title">
<view class="title-sreach">
<view class="title-name">
商家中心
</view>
</view>
</view>
<view class="shop-title">
<view class="title1">
1 month ago
<image :src="shop?shop.shopIcon :''" alt="" />
6 months ago
</view>
<view class="title2">
5 months ago
<view class="title22" @tap="checkArea">
1 month ago
{{shop?shop.shopName:''}}
5 months ago
<uni-icons type="right"></uni-icons>
6 months ago
</view>
<view class="title33" @tap="updateStatus">
{{businessStatus == '1'?'暂停营业':'正常营业'}}
<uni-icons type="right" size="12"></uni-icons>
</view>
</view>
</view>
<view class="shop-order">
<view class="order1">
待办事项
</view>
<view class="order2">
<view class="order22">
2 months ago
<view class="order33" @tap="changeIndex(1,3)">
<view class="order44" style="color: red;">
{{daipeisongjiedan}}
</view>
<view class="order55">
待配送接单
</view>
</view>
5 months ago
<view class="order33" @tap="changeIndex(1,13)">
3 months ago
<view class="order44" style="color: red;">
5 months ago
{{daichucan}}
6 months ago
</view>
<view class="order55">
5 months ago
待出餐
6 months ago
</view>
</view>
5 months ago
<view class="order33" @tap="changeIndex(1,4)">
6 months ago
<view class="order44">
5 months ago
{{daiquhuo}}
6 months ago
</view>
<view class="order55">
待取货
</view>
</view>
5 months ago
<view class="order33" @tap="changeIndex(1,5)">
6 months ago
<view class="order44">
5 months ago
{{daisongda}}
6 months ago
</view>
<view class="order55">
待送达
</view>
</view>
</view>
<view class="order22">
5 months ago
<view class="order33" @tap="changeIndex(1,2)">
6 months ago
<view class="order44">
5 months ago
{{daixiaofei}}
6 months ago
</view>
<view class="order55">
待消费
</view>
</view>
5 months ago
<view class="order33" @tap="goDetail('tui',11)">
3 months ago
<view class="order44" style="color: red;">
5 months ago
{{shopData.refundCount == undefined?0:shopData.refundCount}}
6 months ago
</view>
<view class="order55">
5 months ago
待退款/售后
6 months ago
</view>
</view>
5 months ago
<view class="order33" @tap="goDetail('pj','cha')">
6 months ago
<view class="order44">
5 months ago
{{shopData.pendingBadReviewCount == undefined?0:shopData.pendingBadReviewCount}}
6 months ago
</view>
<view class="order55">
待回复差评
</view>
</view>
3 months ago
<view class="order33" v-if="shopConfig.supportShopDelivery == 1"
@tap="goDetail('selfDelivery')">
<view class="order44" style="color: red;">
{{shopData.shopDeliveryPendingCount == undefined?0:shopData.shopDeliveryPendingCount}}
</view>
<view class="order55">
自配送订单
</view>
</view>
<view class="order33" v-if="shopConfig.supportTransferDelivery == 1"
@tap="goDetail('transferDelivery')">
<view class="order44" style="color: red;">
{{shopData.transferDeliveryPendingCount == undefined?0:shopData.transferDeliveryPendingCount}}
</view>
<view class="order55">
中转配送
</view>
</view>
6 months ago
</view>
3 months ago
<!-- <view class="order22">
</view> -->
6 months ago
</view>
</view>
<view class="shop-order">
<view class="order1" style="display: flex;">
<view style="flex: 1;">
今日实时数据
</view>
</view>
<view class="data2">
<view class="data22">
<view class="data222">
2 months ago
{{shopData.orderRevenueAndCount ?shopData.orderRevenueAndCount.count:0}}
6 months ago
</view>
<view class="data333">
今日订单
</view>
</view>
<view class="data22">
<view class="data222">
2 months ago
{{shopData.orderRevenueAndCount?shopData.orderRevenueAndCount.amount:0}}
6 months ago
</view>
<view class="data333">
营业额
</view>
</view>
2 months ago
<view class="data22">
<view class="data222">
{{shopData.orderRevenueAndCount?shopData.orderRevenueAndCount.afterSaleCount:0}}
</view>
<view class="data333">
退/售后笔数
</view>
</view>
<view class="data22">
<view class="data222">
{{shopData.orderRevenueAndCount?shopData.orderRevenueAndCount.afterSaleAmount:0}}
</view>
<view class="data333">
退/售后金额
</view>
</view>
6 months ago
</view>
</view>
<view class="shop-order">
<view class="order1">
必备工具
</view>
<view class="menu2">
<view class="menu22" @tap="goDetail('sp')">
<view class="menu33">
<image src="../../static/image/dingdan/dd0.png" alt="" />
</view>
<view class="menu44">
商品管理
</view>
</view>
5 months ago
<!-- <view class="menu22" @tap="goDetail('dp')">
6 months ago
<view class="menu33">
<image src="../../static/image/dingdan/dd1.png" alt="" />
</view>
<view class="menu44">
店铺管理
</view>
5 months ago
</view> -->
5 months ago
<view class="menu22" @tap="changeIndex(1)">
6 months ago
<view class="menu33">
<image src="../../static/image/dingdan/dd2.png" alt="" />
</view>
<view class="menu44">
订单管理
</view>
</view>
<view class="menu22" @tap="goDetail('zd')">
<view class="menu33">
<image src="../../static/image/dingdan/dd3.png" alt="" />
</view>
<view class="menu44">
账单结算
</view>
</view>
<view class="menu22" @tap="goDetail('pj')">
<view class="menu33">
<image src="../../static/image/dingdan/dd4.png" alt="" />
</view>
<view class="menu44">
顾客评价
</view>
</view>
2 months ago
<view class="menu22" @tap="goDetail('dy')">
6 months ago
<view class="menu33" style="width: 100%;height: 56rpx;">
2 months ago
<image src="../../static/image/dingdan/dd4.png" alt="" />
6 months ago
</view>
<view class="menu44">
2 months ago
打印设置
6 months ago
</view>
</view>
2 months ago
<view class="menu22" @tap="goDetail('shjl')">
5 months ago
<view class="menu33" style="width: 100%;height: 56rpx;">
2 months ago
<image src="../../static/image/dingdan/dd0.png" alt="" />
5 months ago
</view>
<view class="menu44">
2 months ago
退款售后记录
5 months ago
</view>
</view>
2 months ago
<view class="menu22" @tap="goDetail('yyxx')">
2 months ago
<view class="menu33" style="width: 100%;height: 56rpx;">
<image src="../../static/image/dingdan/dd0.png" alt="" />
</view>
<view class="menu44">
2 months ago
营业信息
</view>
</view>
<view class="menu22" @tap="goDetail('sjxx')">
<view class="menu33" style="width: 100%;height: 56rpx;">
<image src="../../static/image/dingdan/dd1.png" alt="" />
</view>
<view class="menu44">
商家信息
</view>
</view>
<view class="menu22" @tap="goDetail('hx')">
<view class="menu33" style="width: 100%;height: 56rpx;">
<uni-icons type="scan" size="25"></uni-icons>
</view>
<view class="menu44">
扫码核销
2 months ago
</view>
</view>
6 months ago
</view>
2 months ago
<view style="width: 100%;height: 20rpx;"></view>
7 months ago
</view>
</view>
7 months ago
<view class="swiper-page" v-show="currentIndex == 1">
<de-livery ref="deLivery"></de-livery>
</view>
7 months ago
<view class="swiper-page" v-show="currentIndex == 2">
<my-center ref="myCenter"></my-center>
</view>
</view>
5 months ago
<!-- 弹出区域选择 -->
<uni-popup ref="areaPopup" background-color="#fff">
<view class="popup-area-content">
<view class="popup-area-title">
5 months ago
<text>请选择店铺</text>
5 months ago
</view>
3 months ago
<view class="popup-area-container" v-for="(item,index) in areaList" :key="index"
@tap="onClickArea(item)">
5 months ago
<text style="display: inline-block">{{item.shop.shopName}}</text>
</view>
</view>
</uni-popup>
<tab-bar :width="width" @tab-index="changeIndex" :currentIndex="currentIndex"></tab-bar>
</view>
</template>
<script>
import tabBar from "@/components/tab-bar/tab-bar.vue";
import deLivery from "@/components/tab-bar/delivery.vue";
import myCenter from "@/components/tab-bar/myCenter.vue";
export default {
data() {
return {
width: 0,
2 months ago
daipeisongjiedan:0,
currentIndex: 0,
3 months ago
businessStatus: 1,
shop: {},
shopConfig: {},
areaList: [],
5 months ago
shopList: [],
3 months ago
shopData: {},
daixiaofei: 0,
daichucan: 0,
daiquhuo: 0,
daisongda: 0
}
},
components: {
tabBar,
deLivery,
myCenter
},
onShow() {
2 months ago
if(!uni.getStorageSync('peisongyuan')){
this.indexInit()
}
},
onLoad() {
2 months ago
if(uni.getStorageSync('peisongyuan')){
uni.reLaunch({
url: '../worker/index'
})
return
}
1 month ago
if(!uni.getStorageSync('area') || !uni.getStorageSync('shopId')){
uni.reLaunch({
url: '../login/login'
})
}
},
methods: {
3 months ago
indexInit() {
5 months ago
let that = this
2 months ago
this.shopConfig = JSON.parse(uni.getStorageSync('area')) || {}
3 months ago
5 months ago
uni.getSystemInfo({
success: function(info) {
that.width = info.screenWidth * 2;
}
});
4 months ago
this.getData()
5 months ago
this.getBusinessStatus()
2 months ago
this.getShopTakeaway()
3 months ago
if (!uni.getStorageSync('area')) {
5 months ago
this.checkArea()
}
},
2 months ago
getShopTakeaway(){
this.NB.sendRequest("/app/shoptakeaway/getByShopId", {
shopId: uni.getStorageSync('shopId')
}, false, 'get', 'application/x-www-form-urlencoded').then((res) => {
if (res.code == 200) {
uni.setStorageSync('shopTakeaway',res.result)
} else {
uni.showToast({
title: res.message,
icon: 'none'
})
}
})
},
3 months ago
checkArea() {
2 months ago
this.NB.sendRequest("/auth/getShopByUser", {}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
5 months ago
if (res.code == 200) {
this.areaList = res.result
this.$refs.areaPopup.open()
} else {
5 months ago
uni.showToast({
title: res.message,
icon: 'none'
})
5 months ago
}
})
},
7 months ago
//获取营业状态
3 months ago
getBusinessStatus() {
6 months ago
this.NB.sendRequest("/app/shoptakeaway/getByShopId", {
7 months ago
shopId: uni.getStorageSync('shopId')
5 months ago
}, false, 'GET', 'application/x-www-form-urlencoded').then((res) => {
7 months ago
if (res.code == 200) {
6 months ago
this.shop = res.result
2 months ago
this.shop.shopIcon = JSON.parse(uni.getStorageSync('area')).shopIcon
this.shop.shopName = JSON.parse(uni.getStorageSync('area')).shopName
7 months ago
this.businessStatus = res.result.status
} else {
5 months ago
uni.showToast({
title: res.message,
icon: 'none'
})
7 months ago
}
6 months ago
uni.hideLoading()
}).catch((res) => {})
7 months ago
},
3 months ago
onClickArea(item) {
3 months ago
uni.setStorageSync('shopId', item.shop.id)
2 months ago
uni.setStorageSync('shopMerchantType', item.shop.merchantType)
2 months ago
uni.setStorageSync('area', JSON.stringify(item.shop))
4 months ago
this.getBusinessStatus()
this.getData()
5 months ago
this.$refs.areaPopup.close()
},
7 months ago
//更改营业状态
3 months ago
updateStatus() {
7 months ago
let that = this;
uni.showModal({
title: '提示',
content: '要更改营业状态吗?',
2 months ago
cancelText:'确定',
confirmText:'取消',
3 months ago
success: function(res1) {
2 months ago
if (res1.cancel) {
6 months ago
that.NB.sendRequest("/app/shoptakeaway/update", {
shopId: uni.getStorageSync('shopId'),
3 months ago
status: that.businessStatus == "1" ? '0' : that.businessStatus == "0" ?
'1' : '2'
5 months ago
}, false, 'post', 'application/x-www-form-urlencoded').then((res) => {
7 months ago
if (res.code == 200) {
5 months ago
uni.showToast({
title: '更改成功',
3 months ago
icon: 'none'
5 months ago
});
3 months ago
that.businessStatus = that.businessStatus == "1" ? '0' : that
.businessStatus == "0" ? '1' : '2'
7 months ago
} else {
5 months ago
uni.showToast({
title: res.message,
3 months ago
icon: 'none'
5 months ago
});
7 months ago
}
6 months ago
uni.hideLoading()
}).catch((res) => {})
7 months ago
}
}
});
3 months ago
7 months ago
},
3 months ago
goDetail(type, index) {
2 months ago
6 months ago
let url = ''
switch (type) {
case 'tj':
5 months ago
url = '/pages/shop/dataStatistics'
6 months ago
break;
3 months ago
case 'dy':
url = '/pages/myCenter/setPrint'
break;
6 months ago
case 'sp':
5 months ago
url = '/pages/shop/goodsList'
6 months ago
break;
3 months ago
case 'yy':
url = '/pages/myCenter/businessInfo'
break;
case 'sjxx':
url = '/pages/myCenter/shopDetail'
break;
case 'selfDelivery':
url = '/pages/shop/selfDeliveryOrderList'
break;
case 'transferDelivery':
url = '/pages/shop/transferDeliveryOrderList'
6 months ago
break;
3 months ago
case 'tui':
2 months ago
url = '/pages/shop/afterService?type=shop'
3 months ago
break;
6 months ago
case 'zd':
5 months ago
url = '/pages/shop/shopBill'
6 months ago
break;
2 months ago
case 'shjl':
url = '/pages/shop/afterService?type=shop&mode=record'
break;
2 months ago
case 'sjxx':
url = '/pages/myCenter/shopDetail'
break;
case 'yyxx':
url = '/pages/myCenter/businessInfo'
break;
6 months ago
case 'pj':
let item = {
3 months ago
shopScore: uni.getStorageSync('shopScore'),
id: uni.getStorageSync('shopId')
6 months ago
}
3 months ago
url = '/pages/shop/shopEvaluate?item=' + JSON.stringify(item) + '&isMerchant=1&isCha=' + (index ==
'cha' ? 1 : 0)
6 months ago
break;
case 'hx':
this.scanCodeAdd()
break;
default:
}
uni.navigateTo({
url: url
})
},
3 months ago
clearData(){
this.daisongda = 0
this.daiquhuo = 0
this.daixiaofei = 0
2 months ago
this.daipeisongjiedan = 0
3 months ago
this.daichucan = 0
},
3 months ago
getData() {
5 months ago
let that = this;
2 months ago
this.daixiaofei = 0
this.daipeisongjiedan = 0
this.daichucan = 0
this.daiquhuo = 0
this.daisongda = 0
3 months ago
that.NB.sendRequest("/mall/order/countByShop/" + uni.getStorageSync('shopId'), {}, false, 'GET',
'application/x-www-form-urlencoded').then((res) => {
5 months ago
if (res.code == 200) {
2 months ago
this.shopData = res.result || {}
this.shopData.orderStatusCount = this.shopData.orderStatusCount || []
this.shopData.orderRevenueAndCount = this.shopData.orderRevenueAndCount || {}
for(let i=0;i<this.shopData.orderStatusCount.length;i++){
if(this.shopData.orderStatusCount[i].counttype){
if(this.shopData.orderStatusCount[i].counttype == 'daipeisongjiedan'){
this.daipeisongjiedan = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daisong'){
5 months ago
this.daisongda = this.shopData.orderStatusCount[i].count
2 months ago
}else if(this.shopData.orderStatusCount[i].counttype == 'daiqu'){
5 months ago
this.daiquhuo = this.shopData.orderStatusCount[i].count
2 months ago
}else if(this.shopData.orderStatusCount[i].counttype == 'daixiaofei'){
5 months ago
this.daixiaofei = this.shopData.orderStatusCount[i].count
2 months ago
}else if(this.shopData.orderStatusCount[i].counttype == 'daichucan'){
5 months ago
this.daichucan = this.shopData.orderStatusCount[i].count
}
}
}
2 months ago
this.$forceUpdate()
5 months ago
} else {
5 months ago
uni.showToast({
title: res.message,
icon: 'none'
})
5 months ago
}
uni.hideLoading()
}).catch((res) => {})
},
6 months ago
//扫一扫功能
scanCodeAdd() {
let that = this;
uni.scanCode({
success: (res) => {
if (res.scanType == "QR_CODE") { //二维码
5 months ago
let shopId = res.result.split('@@')[1]
if (shopId == uni.getStorageSync('shopId')) {
let productId = res.result.split('@@')[0]
uni.showModal({
title: '提示',
content: '确定要核销该订单吗?',
2 months ago
confirmText: '取消',
cancelText: '确认',
3 months ago
success: function(res1) {
2 months ago
if (res1.cancel) {
5 months ago
that.NB.sendRequest("/mall/order/complete", {
3 months ago
orderId: productId
}, false, 'post',
'application/x-www-form-urlencoded').then((
res) => {
if (res.code == 200) {
uni.showToast({
title: '核销成功',
icon: 'none'
})
} else {
2 months ago
uni.showModal({
title: '提示',
content: res.message,
showCancel:false
});
3 months ago
}
uni.hideLoading()
}).catch((res) => {})
5 months ago
}
}
});
3 months ago
5 months ago
} else {
5 months ago
uni.showToast({
title: '未查询到此订单信息,请核实!',
icon: 'none'
})
5 months ago
}
6 months ago
}
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
//底部tab切换组件状态改变
3 months ago
changeIndex(index, type) {
7 months ago
let that = this;
this.lastIndex = this.currentIndex
this.currentIndex = index
7 months ago
switch (index) {
5 months ago
case 0:
this.indexInit()
break;
7 months ago
case 1:
5 months ago
that.$refs.deLivery.init(type)
7 months ago
break;
case 2:
that.$refs.myCenter.init()
break;
}
}
}
}
</script>
6 months ago
<style lang="scss">
@import url("./index.css");
3 months ago
6 months ago
.title {
background: url('https://jewel-shop.oss-cn-beijing.aliyuncs.com/8bc15960c2dc40268e295d6dd23aecce.png') no-repeat;
width: 100%;
height: 20%;
}
3 months ago
6 months ago
.title-sreach {
width: 100%;
display: flex;
height: 200rpx;
position: relative;
}
3 months ago
6 months ago
.title-name {
padding-top: 110rpx;
font-size: 36rpx;
font-weight: 700;
flex: 1;
text-align: center;
}
3 months ago
6 months ago
.shop-title {
width: 95%;
margin: 0 auto;
padding: 20rpx;
background: #fff;
border-radius: 20rpx;
display: flex;
font-size: 28rpx;
font-weight: 700;
}
3 months ago
6 months ago
.title1 {
width: 70rpx;
height: 70rpx;
3 months ago
2 months ago
image {
6 months ago
width: 100%;
height: 100%;
border-radius: 10rpx;
}
}
3 months ago
.title2 {
flex: 1;
line-height: 70rpx;
display: flex;
6 months ago
}
3 months ago
.title22 {
flex: 1;
padding-left: 20rpx;
6 months ago
}
3 months ago
.shop-order {
6 months ago
width: 95%;
margin: 20rpx auto 0;
background: #fff;
border-radius: 20rpx;
padding: 0 20rpx 0;
}
3 months ago
.order1 {
6 months ago
height: 70rpx;
line-height: 70rpx;
font-size: 28rpx;
font-weight: 700;
border-bottom: 1px solid #eee;
3 months ago
}
.order22 {
6 months ago
display: flex;
height: 100rpx;
padding-top: 20rpx;
}
3 months ago
.order33 {
6 months ago
flex: 1;
text-align: center;
}
3 months ago
.order44 {
6 months ago
font-size: 28rpx;
font-weight: 700;
}
3 months ago
.data2 {
display: flex;
height: 140rpx;
text-align: center;
padding-top: 20rpx;
6 months ago
}
3 months ago
.data22 {
2 months ago
width:25%;
6 months ago
}
3 months ago
.data222 {
font-size: 36rpx;
font-weight: 700;
padding-bottom: 20rpx;
6 months ago
}
2 months ago
.data333 {
color: #415c56;
font-size: 28rpx;
}
3 months ago
.menu2 {
6 months ago
display: flex;
flex-wrap: wrap;
text-align: center;
padding-top: 20rpx;
}
3 months ago
.menu22 {
6 months ago
width: 25%;
3 months ago
height: 120rpx;
6 months ago
}
3 months ago
.menu33 {
image {
6 months ago
width: 50rpx;
3 months ago
height: 50rpx;
6 months ago
background-size: 100%;
}
}
3 months ago
.menu44 {
6 months ago
height: 40rpx;
line-height: 40rpx;
2 months ago
font-size:28rpx;
6 months ago
}
3 months ago
5 months ago
.popup-area-content {
align-items: center;
justify-content: center;
padding: 30rpx;
width: 500rpx;
height: auto;
background-color: #fff;
}
3 months ago
5 months ago
.popup-area-title {
font-size: 36rpx;
font-weight: bold;
text-align: center;
position: relative;
}
3 months ago
5 months ago
.popup-area-container {
margin-top: 20rpx;
height: 100rpx;
border-radius: 20rpx;
background: #088FEB;
line-height: 100rpx;
text-align: center;
border-bottom: 1px solid #eee;
border-top: 1px solid #eee;
color: #fff;
}
1 month ago
.order55{
font-size: 28rpx;
}
</style>