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.

789 lines
19 KiB

4 months ago
<template>
<!-- 商家中心 -->
<view class="page1">
<view class="title">
<view class="title-sreach">
<view class="back-btn" @tap="back" :style="{'top': menuButtonInfo.top +'px'}">
<uni-icons type="left" size="28"></uni-icons>
</view>
<view class="title-name" :style="{'padding-top': menuButtonInfo.top +'px'}">
商家中心
</view>
</view>
</view>
<view class="shop-title">
<view class="title1">
<img :src="shop.shopIcon" alt="" />
</view>
<view class="title2">
<view class="title22">
3 months ago
{{shop.shopName == undefined ?"":shop.shopName}}
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">
1 month ago
<view class="order33" @tap="goDetail('db',3)">
<view class="order44" style="color: red;">
{{daipeisongjiedan}}
</view>
<view class="order55">
待配送接单
</view>
</view>
3 months ago
<view class="order33" @tap="goDetail('db',13)">
1 month ago
<view class="order44" style="color: red;">
3 months ago
{{daichucan}}
4 months ago
</view>
<view class="order55">
4 months ago
待出餐
4 months ago
</view>
</view>
<view class="order33" @tap="goDetail('db',4)">
<view class="order44">
3 months ago
{{daiquhuo}}
4 months ago
</view>
<view class="order55">
待取货
</view>
</view>
<view class="order33" @tap="goDetail('db',5)">
<view class="order44">
3 months ago
{{daisongda}}
4 months ago
</view>
<view class="order55">
待送达
</view>
</view>
</view>
<view class="order22">
<view class="order33" @tap="goDetail('db',2)">
<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">
4 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')">
1 month ago
<view class="order44" style="color: red;">
{{shopData.shopDeliveryPendingCount == undefined?0:shopData.shopDeliveryPendingCount}}
</view>
<view class="order55">
自配送订单
</view>
</view>
1 month ago
<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>
1 month ago
<!-- <view @tap="goDetail('tj')">
4 months ago
更多
<uni-icons type="right" size="12"></uni-icons>
1 month ago
</view> -->
4 months ago
</view>
<view class="data2">
<view class="data22">
<view class="data222">
3 months ago
{{shopData.orderRevenueAndCount.count == undefined?0:shopData.orderRevenueAndCount.count}}
4 months ago
</view>
<view class="data333">
今日订单
</view>
</view>
<view class="data22">
<view class="data222">
3 months ago
{{shopData.orderRevenueAndCount.amount == undefined?0:shopData.orderRevenueAndCount.amount}}
4 months ago
</view>
<view class="data333">
营业额
</view>
</view>
1 month ago
<view class="data22">
<view class="data222">
{{shopData.orderRevenueAndCount.afterSaleCount == undefined?0:shopData.orderRevenueAndCount.afterSaleCount}}
</view>
<view class="data333">
3 weeks ago
退/售后笔数
1 month ago
</view>
</view>
<view class="data22">
<view class="data222">
{{shopData.orderRevenueAndCount.afterSaleAmount == undefined?0:shopData.orderRevenueAndCount.afterSaleAmount}}
</view>
<view class="data333">
3 weeks ago
退/售后金额
1 month ago
</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">
<img src="/static/images/dingdan/dd0.png" alt="" />
</view>
<view class="menu44">
商品管理
</view>
</view>
3 months ago
<view class="menu22" @tap="goDetail('yy')">
4 months ago
<view class="menu33">
<img src="/static/images/dingdan/dd1.png" alt="" />
</view>
<view class="menu44">
3 months ago
营业信息
4 months ago
</view>
3 months ago
</view>
4 months ago
<view class="menu22" @tap="goDetail('dd')">
<view class="menu33">
<img src="/static/images/dingdan/dd2.png" alt="" />
</view>
<view class="menu44">
订单管理
</view>
</view>
<view class="menu22" @tap="goDetail('zd')">
<view class="menu33">
<img src="/static/images/dingdan/dd3.png" alt="" />
</view>
<view class="menu44">
账单结算
</view>
</view>
3 months ago
<view class="menu22" @tap="goDetail('pj','pj')">
4 months ago
<view class="menu33">
<img src="/static/images/dingdan/dd4.png" alt="" />
</view>
<view class="menu44">
顾客评价
</view>
</view>
3 months ago
<view class="menu22" @tap="goDetail('sjxx')">
<view class="menu33">
<img src="/static/images/dingdan/dd2.png" alt="" />
</view>
<view class="menu44">
商家信息
</view>
</view>
4 months ago
<view class="menu22" @tap="goDetail('hx')">
4 weeks ago
<view class="menu33">
4 months ago
<uni-icons type="scan" size="25"></uni-icons>
</view>
<view class="menu44">
扫码核销
</view>
</view>
3 weeks ago
<view class="menu22" @tap="goDetail('tuiRecord')">
<view class="menu33">
<img src="/static/images/dingdan/dd1.png" alt="" />
</view>
<view class="menu44">
退款/售后记录
</view>
</view>
4 months ago
</view>
</view>
</view>
</template>
<script>
import base from '@/utils/ossUploadFile/base64.js';
export default {
data() {
return {
menuButtonInfo: {},
businessStatus:1,
3 months ago
shop:{},
1 month ago
shopConfig:{},
1 month ago
shopData:{
orderStatusCount:[],
orderRevenueAndCount:{}
},
3 months ago
daixiaofei:0,
1 month ago
daipeisongjiedan:0,
3 months ago
daichucan:0,
daiquhuo:0,
daisongda:0
4 months ago
}
},
onShow() {
1 month ago
this.refreshPage()
3 months ago
},
onLoad(option) {
1 month ago
},
onPullDownRefresh() {
this.refreshPage(true)
4 months ago
},
methods: {
1 month ago
refreshPage(isPullDown){
1 month ago
this.menuButtonInfo = uni.getMenuButtonBoundingClientRect()
1 month ago
const tasks = [
this.getBusinessStatus(),
this.getData()
]
if (isPullDown) {
Promise.all(tasks).finally(() => {
uni.stopPullDownRefresh()
})
}
1 month ago
},
3 months ago
getData(){
1 month ago
this.refreshShopConfig()
1 month ago
this.daixiaofei = 0
1 month ago
this.daipeisongjiedan = 0
1 month ago
this.daichucan = 0
this.daiquhuo = 0
this.daisongda = 0
1 month ago
return this.tui.request("/mall/order/countByShop/"+uni.getStorageSync('shopId'), "GET", {}, false, true).then((res) => {
3 months ago
if (res.code == 200) {
1 month ago
this.shopData = res.result || {}
this.shopData.orderStatusCount = this.shopData.orderStatusCount || []
this.shopData.orderRevenueAndCount = this.shopData.orderRevenueAndCount || {}
3 months ago
for(let i=0;i<this.shopData.orderStatusCount.length;i++){
if(this.shopData.orderStatusCount[i].counttype){
1 month ago
if(this.shopData.orderStatusCount[i].counttype == 'daipeisongjiedan'){
this.daipeisongjiedan = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daisong'){
3 months ago
this.daisongda = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daiqu'){
this.daiquhuo = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daixiaofei'){
this.daixiaofei = this.shopData.orderStatusCount[i].count
}else if(this.shopData.orderStatusCount[i].counttype == 'daichucan'){
this.daichucan = this.shopData.orderStatusCount[i].count
}
}
}
1 month ago
this.$forceUpdate()
3 months ago
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
},
1 month ago
refreshShopConfig(){
const shopList = uni.getStorageSync('schoolShop') || []
if(Array.isArray(shopList)){
this.shopConfig = shopList.find(item => item.id == uni.getStorageSync('shopId')) || {}
}
},
4 months ago
//获取营业状态
getBusinessStatus(){
1 month ago
return this.tui.request("/app/shoptakeaway/getByShopId", "GET", {
4 months ago
shopId: uni.getStorageSync('shopId')
}, false, true).then((res) => {
if (res.code == 200) {
this.shop = res.result
2 weeks ago
uni.setStorageSync('shopTakeaway',res.result)
4 months ago
this.shop.shopIcon = uni.getStorageSync('shopIcon')
this.businessStatus = res.result.status
} else {
this.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
},
//更改营业状态
updateStatus(){
let that = this;
uni.showModal({
title: '提示',
content: '要更改营业状态吗?',
success: function (res1) {
if (res1.confirm) {
that.tui.request("/app/shoptakeaway/update", "post", {
shopId: uni.getStorageSync('shopId'),
status:that.businessStatus == "1"?'0':that.businessStatus == "0"?'1':'2'
}, false, true).then((res) => {
if (res.code == 200) {
uni.showToast("更改成功")
that.businessStatus = that.businessStatus == "1"?'0':that.businessStatus == "0"?'1':'2'
} else {
that.tui.toast(res.message)
}
uni.hideLoading()
}).catch((res) => {})
}
}
});
},
goDetail(type,index) {
let url = ''
switch (type) {
case 'tj':
3 months ago
url = '/package2/myCenter/dataStatistics'
4 months ago
break;
case 'db':
4 months ago
url = '/package2/shop/shopOrderList?index=' + index
4 months ago
break;
case 'sp':
3 months ago
url = '/package2/myCenter/goodsList'
4 months ago
break;
3 months ago
case 'yy':
url = '/package2/shop/businessInfo'
break;
case 'sjxx':
url = '/package2/shop/shopInfo'
4 months ago
break;
1 month ago
case 'selfDelivery':
url = '/package2/shop/selfDeliveryOrderList'
break;
1 month ago
case 'transferDelivery':
url = '/package2/shop/transferDeliveryOrderList'
break;
4 months ago
case 'dd':
4 months ago
url = '/package2/shop/shopOrderList'
4 months ago
break;
3 months ago
case 'tui':
3 weeks ago
url = '/package2/shop/afterService?type=shop'
break;
case 'tuiRecord':
url = '/package2/shop/afterService?type=shop&mode=record'
3 months ago
break;
4 months ago
case 'zd':
url = '/package2/shop/shopBill'
break;
case 'pj':
let item = {
shopScore:uni.getStorageSync('shopScore'),
3 months ago
id:uni.getStorageSync('shopId')
4 months ago
}
3 months ago
url = '/package2/group/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
})
},
//扫一扫功能
scanCodeAdd() {
let that = this;
uni.scanCode({
success: (res) => {
if (res.scanType == "QR_CODE") { //二维码
4 months ago
let shopId = res.result.split('@@')[1]
if (shopId == uni.getStorageSync('shopId')) {
let productId = res.result.split('@@')[0]
uni.showModal({
title: '提示',
content: '确定要核销该订单吗?',
success: function (res1) {
if (res1.confirm) {
that.tui.request("/mall/order/complete", "post", {
orderId: productId
}, false, true).then((res) => {
1 month ago
uni.hideLoading()
4 months ago
if (res.code == 200) {
1 month ago
that.tui.toast("核销成功",1500)
4 months ago
} else {
1 week ago
uni.showModal({
title: '提示',
content: res.message,
showCancel:false
});
4 months ago
}
}).catch((res) => {})
}
}
});
4 months ago
4 months ago
} else {
that.tui.toast('未查询到此订单信息,请核实!')
}
4 months ago
}
},
fail: (res) => {
uni.showToast({
title: '扫描失败',
icon: 'none'
})
}
})
},
back() {
uni.navigateBack()
},
}
}
</script>
<style lang="scss">
page {
width: 100%;
4 weeks ago
min-height: 100%;
4 months ago
font-size: 24rpx;
4 weeks ago
background: #F6FBF8;
4 months ago
color: #00231C;
}
.page1 {
width: 100%;
4 weeks ago
min-height: 100vh;
padding-bottom: 60rpx;
box-sizing: border-box;
4 months ago
position: relative;
4 weeks ago
overflow: hidden;
background:
radial-gradient(circle at 18% 210rpx, rgba(227, 255, 150, 0.58), rgba(227, 255, 150, 0) 260rpx),
radial-gradient(circle at 90% 160rpx, rgba(166, 255, 234, 0.68), rgba(166, 255, 234, 0) 280rpx),
linear-gradient(180deg, #f1ffe7 0%, #f4fff9 360rpx, #f6fbf8 100%);
4 months ago
}
.title {
width: 100%;
4 weeks ago
height: 252rpx;
background: linear-gradient(135deg, rgba(227, 255, 150, 0.92), rgba(166, 255, 234, 0.86));
position: relative;
}
.title::after {
content: '';
position: absolute;
left: -90rpx;
right: -90rpx;
bottom: -70rpx;
height: 150rpx;
border-radius: 0 0 50% 50%;
background: rgba(255, 255, 255, 0.28);
4 months ago
}
.title-sreach {
width: 100%;
display: flex;
4 weeks ago
height: 188rpx;
4 months ago
position: relative;
4 weeks ago
z-index: 1;
4 months ago
}
.back-btn {
position: absolute;
4 weeks ago
left: 20rpx;
width: 68rpx;
height: 68rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
background: rgba(255, 255, 255, 0.34);
4 months ago
}
.title-name {
padding-top: 110rpx;
4 weeks ago
font-size: 38rpx;
font-weight: 900;
4 months ago
flex: 1;
text-align: center;
4 weeks ago
color: #153b35;
letter-spacing: 2rpx;
4 months ago
}
.shop-title {
4 weeks ago
width: 92%;
2 weeks ago
margin: -70rpx auto 0;
4 weeks ago
padding: 26rpx;
background:
radial-gradient(circle at 92% 14%, rgba(166, 255, 234, 0.5), rgba(166, 255, 234, 0) 150rpx),
linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(250, 255, 248, 0.94));
border: 1px solid rgba(255, 255, 255, 0.78);
border-radius: 34rpx;
4 months ago
display: flex;
4 weeks ago
align-items: center;
4 months ago
font-size: 28rpx;
4 weeks ago
font-weight: 800;
box-shadow: 0 18rpx 42rpx rgba(0, 55, 44, 0.1);
position: relative;
z-index: 2;
box-sizing: border-box;
4 months ago
}
.title1 {
4 weeks ago
width: 92rpx;
height: 92rpx;
padding: 8rpx;
border-radius: 28rpx;
background: linear-gradient(135deg, #e3ff96, #a6ffea);
box-sizing: border-box;
box-shadow: 0 10rpx 24rpx rgba(32, 190, 154, 0.16);
4 months ago
img {
width: 100%;
height: 100%;
4 weeks ago
border-radius: 22rpx;
display: block;
object-fit: cover;
4 months ago
}
}
4 weeks ago
.title2 {
flex: 1;
min-width: 0;
display: flex;
align-items: center;
margin-left: 18rpx;
}
.title22 {
flex: 1;
min-width: 0;
color: #153b35;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.title33 {
flex-shrink: 0;
height: 58rpx;
line-height: 58rpx;
padding: 0 18rpx;
border-radius: 999rpx;
background: rgba(255, 255, 255, 0.72);
color: #08735d;
font-size: 24rpx;
font-weight: 800;
box-shadow: inset 0 0 0 1px rgba(88, 220, 190, 0.32);
}
.shop-order {
width: 92%;
margin: 22rpx auto 0;
background: rgba(255, 255, 255, 0.94);
border-radius: 30rpx;
padding: 0 24rpx 24rpx;
box-shadow: 0 14rpx 34rpx rgba(0, 35, 28, 0.07);
box-sizing: border-box;
}
.shop-title + .shop-order {
background:
radial-gradient(circle at 94% 12%, rgba(255, 220, 140, 0.32), rgba(255, 220, 140, 0) 150rpx),
linear-gradient(160deg, #ffffff 0%, #fffdf7 54%, #f2fff7 100%);
border: 1px solid rgba(255, 219, 145, 0.34);
}
.shop-title + .shop-order + .shop-order {
background:
radial-gradient(circle at 8% 16%, rgba(166, 255, 234, 0.38), rgba(166, 255, 234, 0) 170rpx),
linear-gradient(145deg, #ffffff 0%, #f4fffb 52%, #eef8ff 100%);
border: 1px solid rgba(132, 232, 205, 0.28);
}
.shop-title + .shop-order {
background:
radial-gradient(circle at 94% 12%, rgba(255, 220, 140, 0.32), rgba(255, 220, 140, 0) 150rpx),
linear-gradient(160deg, #ffffff 0%, #fffdf7 54%, #f2fff7 100%);
border: 1px solid rgba(255, 219, 145, 0.34);
}
.shop-title + .shop-order + .shop-order {
background:
radial-gradient(circle at 8% 16%, rgba(166, 255, 234, 0.38), rgba(166, 255, 234, 0) 170rpx),
linear-gradient(145deg, #ffffff 0%, #f4fffb 52%, #eef8ff 100%);
border: 1px solid rgba(132, 232, 205, 0.28);
}
.order1 {
height: 78rpx;
line-height: 78rpx;
font-size: 30rpx;
font-weight: 900;
color: #153b35;
border-bottom: 1px solid rgba(0, 35, 28, 0.06);
display: flex;
align-items: center;
}
.order1::before {
content: '';
width: 10rpx;
height: 30rpx;
margin-right: 12rpx;
border-radius: 999rpx;
background: linear-gradient(180deg, #e3ff96, #35d6a6);
}
.order22 {
4 months ago
display: flex;
4 weeks ago
min-height: 112rpx;
padding-top: 22rpx;
gap: 12rpx;
4 months ago
}
4 weeks ago
.order33 {
4 months ago
flex: 1;
text-align: center;
4 weeks ago
padding: 12rpx 4rpx;
border-radius: 24rpx;
box-sizing: border-box;
background: rgba(255, 255, 255, 0.6);
box-shadow: inset 0 0 0 1px rgba(0, 35, 28, 0.04);
4 months ago
}
4 weeks ago
.order33:active,
.menu22:active {
transform: scale(0.96);
}
.order44 {
display: inline-flex;
min-width: 52rpx;
height: 46rpx;
align-items: center;
justify-content: center;
padding: 0 8rpx;
border-radius: 999rpx;
background: linear-gradient(135deg, rgba(227, 255, 150, 0.82), rgba(166, 255, 234, 0.82));
font-size: 32rpx;
line-height: 46rpx;
font-weight: 900;
color: #08735d;
box-shadow: 0 8rpx 18rpx rgba(56, 196, 160, 0.12);
}
.shop-title + .shop-order .order44 {
background: linear-gradient(135deg, #fff1bf, #ffd6a2);
color: #9a5412;
box-shadow: 0 8rpx 18rpx rgba(255, 163, 79, 0.14);
4 months ago
}
4 weeks ago
.shop-title + .shop-order + .shop-order .order1::before {
background: linear-gradient(180deg, #a6ffea, #60b8ff);
4 months ago
}
4 weeks ago
.order55,
.data333,
.menu44 {
color: #415c56;
font-size: 22rpx;
}
.data2 {
display: flex;
min-height: 150rpx;
text-align: center;
padding-top: 26rpx;
gap: 12rpx;
}
.data22 {
4 months ago
flex: 1;
4 weeks ago
position: relative;
padding: 18rpx 6rpx;
border-radius: 26rpx;
background: rgba(255, 255, 255, 0.66);
box-shadow: inset 0 0 0 1px rgba(68, 202, 185, 0.08);
4 months ago
}
4 weeks ago
.data22 + .data22::before {
display: none;
4 months ago
}
4 weeks ago
.data222 {
font-size: 38rpx;
line-height: 52rpx;
font-weight: 900;
color: #0b6b5a;
padding-bottom: 12rpx;
}
.menu2 {
4 months ago
display: flex;
flex-wrap: wrap;
text-align: center;
4 weeks ago
padding-top: 24rpx;
4 months ago
}
4 weeks ago
.menu22 {
4 months ago
width: 25%;
4 weeks ago
height: 142rpx;
4 months ago
}
4 weeks ago
.menu33 {
width: 72rpx;
height: 72rpx;
margin: 0 auto 10rpx;
border-radius: 24rpx;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #fff3d7, #ffd7b0);
box-shadow: 0 10rpx 22rpx rgba(255, 151, 97, 0.14);
img {
width: 46rpx;
height: 46rpx;
4 months ago
background-size: 100%;
4 weeks ago
display: block;
4 months ago
}
}
4 weeks ago
.menu22:nth-child(2n) .menu33 {
background: linear-gradient(135deg, #e4f4ff, #b9ddff);
}
.menu22:nth-child(3n) .menu33 {
background: linear-gradient(135deg, #e3ff96, #a6ffea);
}
.menu22:nth-child(4n) .menu33 {
background: linear-gradient(135deg, #fff2b8, #ffd98b);
}
.menu44 {
4 months ago
height: 40rpx;
line-height: 40rpx;
4 weeks ago
font-weight: 700;
4 months ago
}
3 weeks ago
</style>
4 months ago
</style>