123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722 |
- <template>
- <view class="container">
- <!-- #ifdef MP-WEIXIN -->
- <view class="container-center"></view>
- <!-- #endif -->
- <view class="backShop flex-y-center" @click="back" v-if="is_shop">
- <image src="../static/images/back.png" mode=""></image>
- <view class="">
- 返回商家
- </view>
- </view>
- <view class="header">
- <image :src="info.thumb" class="logo-img" mode="aspectFill"></image>
- <view class="content">
- <view class="name">{{info.title}}</view>
- </view>
- </view>
- <view class="main-block">
- <navigator url="../statistics/index/StoreIndex" class="flex-y-center haeder-title haeder-title-color ">
- <view class="border-b box-pack-between flex-grow-1 flex-y-center" style=" height: 90rpx;">
- <view class="flex-y-center">
- <view class="haeder flex-center haeder-color">
- <view class="haeder-bg">
- </view>
- </view>
- <view class="">
- 数据统计
- </view>
- </view>
- <text class="iconfont icongengduo"></text>
- </view>
- </navigator>
- <view class="page-block">
- <view class="num-block flex box-pack-between">
- <view class="item flex flex-col flex-center">
- <view class="num">{{turnover.jryye}}</view>
- <view class="name">今日营业额(元)</view>
- </view>
- <navigator :url="`/saomaDiancan/orderList/orderList?store_id=${store_id}&day=${day}`"
- class="item flex flex-col flex-center">
- <view class="num">{{turnover.jrdd}}</view>
- <view class="name">今日订单</view>
- </navigator>
- <view class="item flex flex-col flex-center">
- <view class="num">{{turnover.zyye}}</view>
- <view class="name">总营业额(元)</view>
- </view>
- </view>
- <view class="num-block flex box-pack-between">
- <view class="item flex flex-col flex-center">
- <view class="num">{{obj.dai_peisong_order||0}}</view>
- <view class="name">待配送</view>
- </view>
- <view class="item flex flex-col flex-center">
- <view class="num">{{obj.peisong_order||0}}</view>
- <view class="name">配送中</view>
- </view>
- <view class="item flex flex-col flex-center">
- <view class="num">{{obj.picked_order||0}}</view>
- <view class="name">待自提</view>
- </view>
- </view>
- </view>
-
- <view class="page-block">
- <view class="btn-list">
- <block v-for="(item,index) in power_list" :key='index'>
- <navigator v-if="item.id!=287 && item.id!=248 && item.id!=888 "
- :url="`${item.address}?id=${item.id}`" class="item flex flex-col flex-center">
- <image :src="item.image" class="icon-img" mode="aspectFit"></image>
- <view class="name">{{item.name}}</view>
- </navigator>
- <block v-if="item.id==287 && item.name=='商品管理'">
- <block v-for="(children,idx) of item.list" :key='idx'>
- <navigator v-if="children.id==233 || children.name=='商品列表'"
- :url="`/saomaDiancan/editGoods/editGoods?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_11.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">添加商品</view>
- </navigator>
- <navigator :url="`${children.address}?id=${children.id}`"
- class="item flex flex-col flex-center">
- <image :src="children.image" class="icon-img" mode="aspectFit"></image>
- <view class="name">{{children.name}}</view>
- </navigator>
-
- </block>
- </block>
- <block v-if="item.id== 288 && item.name=='订单管理'">
- <block v-for="(children,idx) of item.list" :key='idx'>
- <navigator v-if="children.id==238" :url="`${children.address}?id=${children.id}`"
- class="item flex flex-col flex-center">
- <image :src="children.image" class="icon-img" mode="aspectFit"></image>
- <view class="name">{{children.name}}</view>
- </navigator>
- </block>
- </block>
- <block v-if="item.id== 248 && item.name=='营销管理'">
- <block v-for="(children,idx) of item.list" :key='idx'>
- <navigator v-if="children.id==249" :url="`${children.address}?id=${children.id}`"
- class="item flex flex-col flex-center">
- <image :src="children.image" class="icon-img" mode="aspectFit"></image>
- <view class="name">{{children.name}}</view>
- </navigator>
- </block>
- </block>
- <block v-if="item.id== 888 && item.name=='数据统计'">
- <block v-for="(children,idx) of item.list" :key='idx'>
- <navigator v-if="children.id== 889" :url="`${children.address}?id=${children.id}`"
- class="item flex flex-col flex-center">
- <image :src="children.image" class="icon-img" mode="aspectFit"></image>
- <view class="name">{{children.name}}</view>
- </navigator>
- </block>
- </block>
- </block>
- <!-- <navigator :url="`/storeInfoIng/storeList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_15.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">门店设置</view>
- </navigator>
-
- <navigator :url="`/saomaDiancan/orderList/orderList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_13.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">订单列表</view>
- </navigator> -->
- <!-- <navigator :url="`/saomaDiancan/printer/printer?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">打印设置</view>
- </navigator>-->
- <!-- <navigator :url="`./bannerList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_3.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">广告设置</view>
- </navigator>
-
- <navigator :url="`./staff?store_id=${store_id}&type=2`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_4.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">员工管理</view>
- </navigator>
-
- <navigator :url="`/storeInfoIng/deviceList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">设备管理</view>
- </navigator>
- -->
- <!-- <navigator :url="`/saomaDiancan/member/member?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_5.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">会员设置</view>
- </navigator>
- <navigator :url="`/saomaDiancan/couponList/couponList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_7.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">优惠券管理</view>
- </navigator> -->
- <!-- <navigator :url="`/saomaDiancan/goodsCatList/goodsCatList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_12.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">商品分类</view>
- </navigator>
- <navigator :url="`/saomaDiancan/editGoods/editGoods?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_11.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">添加商品</view>
- </navigator>
- <navigator :url="`/saomaDiancan/goodsList/goodsList?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_10.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">商品列表</view>
- </navigator> -->
- <!-- <navigator :url="`/saomaDiancan/integral/integral?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_2.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">积分商城</view>
- </navigator> -->
- <!-- <navigator :url="`/saomaDiancan/order/order?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_3.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">订单管理</view>
- </navigator>
- <navigator url="/storeInfoIng/popup/home" class="item flex flex-col flex-center">
- <image src="./static/images/icon_8.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">首页弹窗</view>
- </navigator> -->
- <navigator url="/yuyue/WriteOff/index" class="item flex flex-col flex-center">
- <image src="./static/images/icon_3.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">核销管理</view>
- </navigator>
- <!-- <navigator :url="`/saomaDiancan/activity/codeList?store_id=${store_id}`" class="item flex flex-col flex-center">
- <image src="./static/images/icon_6.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">营销码</view>
- </navigator>
-
- <navigator :url="`/saomaDiancan/ruyi/ruyi?store_id=${store_id}`" class="item flex flex-col flex-center">
- <image src="./static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">如意设备</view>
- </navigator> -->
- <!-- <navigator :url="`/saomaDiancan/ruyi/staff?store_id=${store_id}`" class="item flex flex-col flex-center">
- <image src="./static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">员工列表</view>
- </navigator>
-
- <navigator :url="`/saomaDiancan/ruyi/handover?store_id=${store_id}`" class="item flex flex-col flex-center">
- <image src="./static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">交班记录</view>
- </navigator> -->
- <!-- <navigator :url="`/statistics/goodsData/goodsData?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_14.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">商品数据统计</view>
- </navigator> -->
- <!-- <navigator :url="`./goodsWarehousing/index?store_id=${store_id}`"
- class="item flex flex-col flex-center">
- <image src="./static/images/icon_12.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">商品入库</view>
- </navigator> -->
- <navigator url="./saomaShoukuan/saomaShoukuan" class="item flex flex-col flex-center">
- <image src="/static/images/saoma.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">快速收款</view>
- </navigator>
- <!-- <navigator url="/storeInfoIng/bindingCode/index" class="item flex flex-col flex-center">
- <image src="./static/images/icon_18.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">空码管理</view>
- </navigator> -->
-
- <navigator url="/storeInfoIng/reservation/index" class="item flex flex-col flex-center">
- <image src="./static/images/yy.png" class="icon-img" mode="aspectFit"></image>
- <view class="name">预约查询</view>
- </navigator>
- </view>
- </view>
- <view class="btm-btn" @click="loginOut">退出登录</view>
- <!-- <view class="more-block">—— 更多服务 敬请期待 ——</view> -->
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- store_id: "",
- info: {},
- turnover: {},
- ad: [],
- is_shop: false,
- day: null,
- obj: {},
- // getApp().globalData.is_shop,
- qc_list: [], //待取餐列表
- power_list: []
- }
- },
- onLoad(options) {
- if (!uni.getStorageSync("admin_id")) {
- uni.reLaunch({
- url: "/pages/login/login"
- })
- }
- this.store_id = uni.getStorageSync("store_id");
- this.is_shop = uni.getStorageSync("is_shop");
- this.day = this.getNowFormatDay();
- this.power();
- // 链接websocket 播放来单提醒
- getApp().initSocket(this.store_id)
- },
- onShow() {
- this.getInfo();
- this.getTurnover();
- this.http();
- this.getQcData()
- },
- onShareAppMessage() {
- },
- onShareTimeline() {
- },
- methods: {
- power() {
- this.request({
- url: 'index/index',
- data: {
- admin_id: uni.getStorageSync("admin_id")
- },
- is_agent: 'agent',
- }).then(res => {
- console.log(res, "index/index")
- if (res.code == '200') {
- this.power_list = res.data
- this.$store.commit('SET_MANAGE', res.data)
- // this.$store.state.management_list;
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- });
- },
- http(e) {
- this.request({
- url: 'Smdcshop/store_index',
- data: {
- admin_id: uni.getStorageSync("admin_id")
- }
- }).then(res => {
- if (res.code == 200) {
- this.obj = res.data;
- }
- }).catch((res) => {
- uni.showToast({
- title: res.message,
- icon: 'none'
- })
- });
- },
- getNowFormatDay() {
- var char = "-";
- let nowDate = new Date();
- var day = nowDate.getDate();
- var month = nowDate.getMonth() + 1; //注意月份需要+1
- var year = nowDate.getFullYear();
- //补全0,并拼接
- return year + char + completeDate(month) + char + completeDate(day);
- //补全0
- function completeDate(value) {
- return value < 10 ? "0" + value : value;
- }
- },
- back() {
- uni.setStorageSync("admin_id", uni.getStorageSync("admin_shopid")); //admin_id 重复
- // getApp().globalData.is_shop=null;
- uni.removeStorageSync("is_shop");
- uni.setStorageSync("is_login", 2);
- uni.reLaunch({
- url: "/saomaDiancan/index/index"
- })
- getApp().closeSocket('返回商家 关闭接单提醒',true)
- },
- loginOut() {
- uni.removeStorageSync("is_shop");
- uni.removeStorageSync("store_id");
- uni.removeStorageSync("store_user");
- uni.removeStorageSync("admin_id");
- uni.removeStorageSync("storeinfo");
- uni.removeStorage({
- key: 'is_login',
- success: (res) => {
- uni.reLaunch({
- url: "../pages/login/login"
- })
- }
- })
- getApp().closeSocket("退出登录 关闭接单提醒",true)
- },
- //门店信息
- getInfo() {
- this.request({
- url: 'Smdcshop/storeinfo',
- data: {
- store_id: this.store_id
- }
- }).then(res => {
- console.log(res)
- if (res.code == 200) {
- let info = res.data
- info.thumb = this.$siteroot + info.thumb
- this.info = info;
- uni.setStorageSync("storeinfo", res.data);
- }
- })
- },
- //营业额
- getTurnover() {
- this.request({
- url: 'Smdcshop/turnover',
- data: {
- store_id: this.store_id
- }
- }).then(res => {
- console.log(res)
- if (res.code == 200) {
- this.turnover = res.data
- }
- })
- },
- //获取待取餐列表
- getQcData() {
- this.request({
- url: 'Smdcshop/order_index_neal',
- data: {
- page: 1,
- limit: 4,
- store_id: this.store_id,
- }
- }).then(res => {
- if (res.code == 200 && res.data.length) {
- this.qc_list = res.data
- }
- })
- },
- //取餐订单时间格式化
- getQcTime(time) {
- return this.$utils.dateFormat('mm-dd HH:MM', new Date(time))
- },
- //提醒取餐
- onQucan(index) {
- this.request({
- url: 'merchant/take_meal',
- is_agent: 'agent',
- data: {
- order_id: this.qc_list[index].id
- }
- }).then(res => {
- if (res.code == 200) {
- uni.showModal({
- content: "已提醒取单",
- showCancel: false,
- success: () => {
- this.getQcData()
- }
- })
- }
- })
- },
- }
- }
- </script>
- <style lang="scss">
- .container-center {
- height: 44px;
- background-color: #3387FF;
- }
- page {
- background-color: #F4F5F7;
- }
- .backShop {
- position: absolute;
- left: 20rpx;
- /* #ifdef MP-WEIXIN */
- top: 44px;
- /* #endif */
- /* #ifdef H5 */
- top: 10rpx;
- /* #endif */
- font-size: 26rpx;
- color: #FFFFFF;
- z-index: 999;
- border: 1rpx solid #FFFFFF;
- padding: 6rpx 10rpx;
- border-radius: 4rpx;
- }
- .backShop image {
- width: 36rpx;
- height: 36rpx;
- }
- .btm-btn {
- width: 670rpx;
- height: 98rpx;
- background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
- border-radius: 8rpx;
- box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.2);
- font-size: 32rpx;
- font-weight: 500;
- text-align: center;
- color: #fff;
- line-height: 98rpx;
- margin: 0 auto;
- margin-top: 100rpx;
- margin-bottom: 30rpx;
- }
- .header {
- width: 100%;
- height: 216rpx;
- background: url(./static/images/store_info_bg.png) no-repeat;
- background-size: 750rpx 216rpx;
- background-position: bottom center;
- position: relative;
- }
- .header .content {
- width: 700rpx;
- height: 221rpx;
- background: #fff url(./static/images/stroe_info_bg2.png) no-repeat;
- background-size: 100%;
- border-radius: 8rpx;
- position: absolute;
- left: 50%;
- top: 120rpx;
- transform: translateX(-50%);
- }
- .header .content .name {
- text-align: center;
- font-size: 36rpx;
- color: #333;
- padding-top: 96rpx;
- line-height: 125rpx;
- }
- .header .logo-img {
- display: block;
- width: 160rpx;
- height: 160rpx;
- position: absolute;
- left: 50%;
- top: 56rpx;
- transform: translateX(-50%);
- z-index: 100;
- border-radius: 200px;
- }
- .main-block {
- padding: 155rpx 25rpx 0;
- }
- .page-block {
- width: 700rpx;
- background-color: #fff;
- box-sizing: border-box;
- border-radius: 8rpx;
- margin-bottom: 30rpx;
- }
- .num-block .item {
- width: 33.33%;
- height: 162rpx;
- flex: none;
- text-align: center;
- }
- .num-block .item .num {
- color: #3387FF;
- font-size: 44rpx;
- font-weight: bold;
- font-family: DIN;
- }
- .num-block .item .name {
- font-size: 24rpx;
- color: #666;
- margin-top: 16rpx;
- }
- .btn-list {
- display: flex;
- flex-flow: row wrap;
- justify-content: flex-start;
- align-content: flex-start;
- }
- .btn-list .item {
- width: 33.33%;
- height: 145rpx;
- }
- .btn-list .item .icon-img {
- display: block;
- width: 48rpx;
- height: 48rpx;
- }
- .btn-list .item .name {
- font-size: 24rpx;
- line-height: 33rpx;
- margin-top: 16rpx;
- color: #666;
- }
- .more-block {
- font-size: 24rpx;
- color: #B2B2B2;
- text-align: center;
- line-height: 33rpx;
- padding: 60rpx 0;
- position: fixed;
- left: 50%;
- bottom: 0;
- transform: translateX(-50%);
- }
- .haeder-title {
- font-size: 32rpx;
- font-family: PingFang SC, PingFang SC-Medium;
- font-weight: 500;
- text-align: center;
- color: #333333;
- border-radius: 8rpx 8rpx 0px 0px;
- padding: 0 24rpx;
- }
- .haeder-title-color {
- background-color: #FFFFFF;
- /* border-bottom: 1rpx solid #F1F1F1; */
- /* background: linear-gradient(90deg, rgba(114, 178, 255, 0.30), rgba(114, 178, 255, 0.00)); */
- }
- .haeder-color {
- background: linear-gradient(136deg, #6397fd 4%, #3377ff 100%);
- }
- .haeder {
- width: 36rpx;
- height: 36rpx;
- border-radius: 50%;
- margin-right: 10rpx;
- }
- .haeder-bg {
- width: 16rpx;
- height: 19rpx;
- background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.60) 100%);
- border-radius: 4rpx;
- }
- /* 取餐表 */
- .qc-table-block {
- box-sizing: border-box;
- width: 100%;
- padding: 10rpx 24rpx;
- .qc-table {
- display: table;
- width: 100%;
- border-collapse: collapse;
- box-sizing: border-box;
- .tr {
- display: table-row;
- border-bottom: 1px solid #f0f0f0;
- .td {
- display: table-cell;
- font-size: 26rpx;
- color: #666;
- padding: 20rpx 6rpx;
- text-align: center;
- .qc-btn {
- background-color: #3387FF;
- color: #fff;
- border-radius: 6rpx;
- height: 48rpx;
- line-height: 48rpx;
- padding: 0 10rpx;
- }
- }
- }
- .th .td {
- font-weight: 500;
- color: #333;
- }
- }
- }
- </style>
|