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.

729 lines
18 KiB

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