This commit is contained in:
parent
d6e1c83f88
commit
7f97467f82
|
|
@ -1,13 +1,11 @@
|
|||
<!-- 首页 -->
|
||||
<template>
|
||||
<view class="page-wrapper" style="overflow:visible;height:auto">
|
||||
<view class="page-wrapper" style="overflow: visible; height: auto">
|
||||
<!-- 背景图片view -->
|
||||
<view class="bg-img-view" >
|
||||
|
||||
<view class="bg-img-view">
|
||||
<!-- 背景颜色view -->
|
||||
<view class="bg-color-view" style="position: absolute;top: 0;left: 0;right: 0;height: 550rpx;border-radius:0 0 32rpx 32rpx;background-color: #318AFE!important;">
|
||||
<view class="bgbottomStyle">
|
||||
</view>
|
||||
<view class="bg-color-view" style="position: absolute; top: 0; left: 0; right: 0; height: 550rpx; border-radius: 0 0 32rpx 32rpx; background-color: #318afe !important">
|
||||
<view class="bgbottomStyle"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 解决定位层级问题 -->
|
||||
|
|
@ -22,19 +20,17 @@
|
|||
<view class="u-flex u-row-center u-relative">
|
||||
<view class="u-flex u-col-center">
|
||||
<view class="u-m-r-12">总收入</view>
|
||||
<up-icon name="/static/indexImg/icon-help.svg" color="#fff" :size="12"
|
||||
@click="toggleTips"></up-icon>
|
||||
<up-icon name="/static/indexImg/icon-help.svg" color="#fff" :size="12" @click="toggleTips"></up-icon>
|
||||
</view>
|
||||
<view class="tips u-absolute color-666 u-font-20 u-text-left " :class="{'showTips':showTips}">
|
||||
<view class="tips u-absolute color-666 u-font-20 u-text-left" :class="{ showTips: showTips }">
|
||||
<view class="sanjiao u-flex"><up-icon name="play-left-fill" size="12" color="#fff"></up-icon></view>
|
||||
总收入为除会员余额
|
||||
支付外所有收入
|
||||
总收入为除会员余额 支付外所有收入
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-flex u-row-center">
|
||||
<view class="">¥{{((totalRevenuedata||0)*1).toFixed(2)}}</view>
|
||||
<view class="">¥{{ ((totalRevenuedata || 0) * 1).toFixed(2) }}</view>
|
||||
</view>
|
||||
<view>{{shopName||''}}</view>
|
||||
<view>{{ shopName || '' }}</view>
|
||||
</view>
|
||||
<!-- 统计 or 快捷扫码 -->
|
||||
<!-- <Stats ref="statsRef" /> -->
|
||||
|
|
@ -43,36 +39,35 @@
|
|||
<JeepayNavigation :navList="navList" type="grid" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||
import { onPullDownRefresh, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
|
||||
import { reactive, ref, onMounted, nextTick } from 'vue';
|
||||
import { onPullDownRefresh, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
|
||||
|
||||
import go from '@/commons/utils/go.js';
|
||||
import Stats from './components/Stats.vue';
|
||||
import statistics from './components/statistics.vue'
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import Stats from './components/Stats.vue';
|
||||
import statistics from './components/statistics.vue';
|
||||
import storageManage from '@/commons/utils/storageManage.js';
|
||||
import { hasPermission } from '@/commons/utils/hasPermission.js';
|
||||
|
||||
uni.hideTabBar()
|
||||
let shopName = ref()
|
||||
let totalRevenuedata = ref()
|
||||
let totalRevenue = (d) => {
|
||||
totalRevenuedata.value = d
|
||||
}
|
||||
uni.hideTabBar();
|
||||
let shopName = ref();
|
||||
let totalRevenuedata = ref();
|
||||
let totalRevenue = (d) => {
|
||||
totalRevenuedata.value = d;
|
||||
};
|
||||
|
||||
let showTips = ref(false)
|
||||
function toggleTips() {
|
||||
showTips.value = !showTips.value
|
||||
}
|
||||
let showTips = ref(false);
|
||||
function toggleTips() {
|
||||
showTips.value = !showTips.value;
|
||||
}
|
||||
|
||||
function toSetting() {
|
||||
go.to('PAGES_SHOP_SETUP')
|
||||
}
|
||||
// 导航列表
|
||||
const navList = [
|
||||
function toSetting() {
|
||||
go.to('PAGES_SHOP_SETUP');
|
||||
}
|
||||
// 导航列表
|
||||
const navList = [
|
||||
{
|
||||
title: '销售汇总',
|
||||
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
|
||||
|
|
@ -83,11 +78,11 @@
|
|||
icon: '/static/indexImg/icon-substitute-ordering.svg',
|
||||
pageUrl: 'PAGES_CREATE_ORDER',
|
||||
clickFunc: () => {
|
||||
hasPermission('允许下单').then(res => {
|
||||
hasPermission('允许下单').then((res) => {
|
||||
if (res) {
|
||||
go.to('PAGES_CREATE_ORDER')
|
||||
go.to('PAGES_CREATE_ORDER');
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -98,23 +93,24 @@
|
|||
{
|
||||
title: '商品管理',
|
||||
icon: '/static/indexImg/icon-product-control.svg',
|
||||
pageUrl: 'PAGES_PRODUCT',
|
||||
pageUrl: 'PAGES_PRODUCT'
|
||||
},
|
||||
{
|
||||
title: '分组管理',
|
||||
icon: '/static/indexImg/goods-group.svg',
|
||||
pageUrl: 'PAGES_GOODS_GROUP',
|
||||
pageUrl: 'PAGES_GOODS_GROUP'
|
||||
},
|
||||
{
|
||||
title: '分类管理',
|
||||
icon: '/static/indexImg/icon-category.svg',
|
||||
pageUrl: 'PAGES_CATEGORY',
|
||||
pageUrl: 'PAGES_CATEGORY'
|
||||
},
|
||||
{
|
||||
title: '会员管理',
|
||||
icon: '/static/indexImg/icon-user.svg',
|
||||
pageUrl: 'PAGES_USER_CONTROL',
|
||||
}, {
|
||||
pageUrl: 'PAGES_USER_CONTROL'
|
||||
},
|
||||
{
|
||||
title: '员工管理',
|
||||
icon: '/static/indexImg/icon-staff.svg',
|
||||
pageUrl: 'PAGES_STAFF'
|
||||
|
|
@ -127,17 +123,17 @@
|
|||
{
|
||||
title: '订单管理',
|
||||
icon: '/static/indexImg/icon-order.svg',
|
||||
pageUrl: 'PAGES_ORDER_INDEX',
|
||||
pageUrl: 'PAGES_ORDER_INDEX'
|
||||
},
|
||||
{
|
||||
title: '设备管理',
|
||||
icon: '/static/indexImg/icon-printer.svg',
|
||||
pageUrl: 'PAGES_PRINTER_INDEX',
|
||||
pageUrl: 'PAGES_PRINTER_INDEX'
|
||||
},
|
||||
{
|
||||
title: '交班',
|
||||
icon: '/static/indexImg/icon-work.svg',
|
||||
pageUrl: 'PAGES_WORK_INDEX',
|
||||
pageUrl: 'PAGES_WORK_INDEX'
|
||||
},
|
||||
{
|
||||
title: '排队',
|
||||
|
|
@ -152,17 +148,17 @@
|
|||
{
|
||||
title: '优惠券',
|
||||
icon: '/static/coupon/icon_coupon.svg',
|
||||
pageUrl: 'PAGES_COUPON_INDEX',
|
||||
pageUrl: 'PAGES_COUPON_INDEX'
|
||||
},
|
||||
{
|
||||
title: '订阅通知',
|
||||
icon: '/static/indexImg/icon-notification.svg',
|
||||
pageUrl: 'PAGES_NOTIFICATION_INDEX',
|
||||
pageUrl: 'PAGES_NOTIFICATION_INDEX'
|
||||
},
|
||||
{
|
||||
title: '挂账管理',
|
||||
icon: '/static/indexImg/icon_credit.svg',
|
||||
pageUrl: 'PAGES_CREDIT_BUYER_INDEX',
|
||||
pageUrl: 'PAGES_CREDIT_BUYER_INDEX'
|
||||
},
|
||||
{
|
||||
title: '核销管理',
|
||||
|
|
@ -174,8 +170,8 @@
|
|||
icon: '/static/indexImg/icon-login-out.svg',
|
||||
pageUrl: 'PAGES_LOGIN',
|
||||
clickFunc: () => {
|
||||
storageManage.cleanByLogout()
|
||||
go.to('PAGES_LOGIN', {}, 'redirect')
|
||||
storageManage.cleanByLogout();
|
||||
go.to('PAGES_LOGIN', {}, 'redirect');
|
||||
}
|
||||
}
|
||||
// {
|
||||
|
|
@ -257,83 +253,81 @@
|
|||
// pageUrl: 'PAGES_AD_LIST',
|
||||
// entId: 'ENT_ADVERT_CONTROL'
|
||||
// },
|
||||
];
|
||||
|
||||
|
||||
];
|
||||
|
||||
const vdata = reactive({
|
||||
const vdata = reactive({
|
||||
noticeList: [], // 公告列表
|
||||
adList: [],
|
||||
shareImgUrl: '' //分享图片
|
||||
});
|
||||
});
|
||||
|
||||
onLoad((options) => {
|
||||
onLoad((options) => {
|
||||
shopName.value = uni.getStorageSync('shopInfo').shopName;
|
||||
});
|
||||
});
|
||||
|
||||
// 启动加载
|
||||
onMounted(() => {
|
||||
// 启动加载
|
||||
onMounted(() => {
|
||||
// refData();
|
||||
});
|
||||
});
|
||||
|
||||
// 如果不是超管 删除 刷脸广告菜单
|
||||
if (storageManage.userInfo().userType != 1) {
|
||||
// 如果不是超管 删除 刷脸广告菜单
|
||||
if (storageManage.userInfo().userType != 1) {
|
||||
const index = navList.findIndex((v) => v.entId == 'ENT_ADVERT_CONTROL');
|
||||
if (index != -1) {
|
||||
navList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function refData() {
|
||||
async function refData() {
|
||||
// 调用子组件方法 , 避免组件没有加载完成。
|
||||
|
||||
// nextTick(() => statsRef.value.refData());
|
||||
// 停止刷新
|
||||
uni.stopPullDownRefresh();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 微信分享
|
||||
*/
|
||||
onShareAppMessage((res) => {
|
||||
onShareAppMessage((res) => {
|
||||
if (res.from == 'menu')
|
||||
return {
|
||||
title: uni.$appName,
|
||||
path: '/pages/index/index',
|
||||
imageUrl: vdata.shareImgUrl
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
/**
|
||||
* 分享到朋友圈
|
||||
*/
|
||||
onShareTimeline(() => {
|
||||
onShareTimeline(() => {
|
||||
return {
|
||||
title: uni.$appName,
|
||||
imageUrl: vdata.shareImgUrl
|
||||
};
|
||||
});
|
||||
// 下拉刷新
|
||||
onPullDownRefresh(() => {
|
||||
});
|
||||
// 下拉刷新
|
||||
onPullDownRefresh(() => {
|
||||
refData();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.bg-main{
|
||||
.bg-main {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
.bgbottomStyle{
|
||||
}
|
||||
.bgbottomStyle {
|
||||
position: absolute;
|
||||
bottom: -2rpx;
|
||||
left: 0;
|
||||
|
||||
width: 750rpx;
|
||||
height: 74rpx;
|
||||
background: linear-gradient( 180deg, rgba(195,215,235,0) 0%, #F9F9F9 100%);
|
||||
}
|
||||
.income {
|
||||
background: linear-gradient(180deg, rgba(195, 215, 235, 0) 0%, #f9f9f9 100%);
|
||||
}
|
||||
.income {
|
||||
/* #ifdef H5 */
|
||||
padding-top: calc(84rpx);
|
||||
/* #endif */
|
||||
|
|
@ -341,36 +335,36 @@
|
|||
padding-top: calc(84rpx + 44px);
|
||||
|
||||
/* #endif */
|
||||
>view {
|
||||
> view {
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
}
|
||||
|
||||
>view:nth-child(1) {
|
||||
> view:nth-child(1) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
margin-top: 84rpx;
|
||||
}
|
||||
|
||||
>view:nth-child(2) {
|
||||
> view:nth-child(2) {
|
||||
margin-top: 20rpx;
|
||||
font-weight: 500;
|
||||
font-size: 64rpx;
|
||||
}
|
||||
|
||||
>view:nth-child(3) {
|
||||
> view:nth-child(3) {
|
||||
font-weight: 400;
|
||||
font-size: 28rpx;
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
.tips {
|
||||
opacity: 0;
|
||||
right: 28rpx;
|
||||
transition: opacity .3s;
|
||||
background: #FFFFFF;
|
||||
transition: opacity 0.3s;
|
||||
background: #ffffff;
|
||||
padding: 20rpx 14rpx;
|
||||
width: 211rpx;
|
||||
box-sizing: border-box;
|
||||
|
|
@ -386,5 +380,5 @@
|
|||
top: 50%;
|
||||
transform: translateX(10rpx) translateY(-50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,30 +3,41 @@
|
|||
<view class="page-cell">
|
||||
<view class="label">头像</view>
|
||||
<view class="right">
|
||||
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg?vdata.shopInfo.coverImg:''" mode="aspectFill"></up-avatar>
|
||||
<up-avatar class="fileImg" :src="vdata.shopInfo.coverImg ? vdata.shopInfo.coverImg : ''" mode="aspectFill"></up-avatar>
|
||||
<view class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="page-cell m" @tap="updateValue('商户名称','shopName',vdata.shopInfo.shopName)"> -->
|
||||
<view class="page-cell m" @tap="go.to('PAGES_SHOP_EDITVAL',{name:'shopName',value: vdata.shopInfo.shopName})">
|
||||
<view class="page-cell m" @tap="go.to('PAGES_SHOP_EDITVAL', { name: 'shopName', value: vdata.shopInfo.shopName })">
|
||||
<view class="label">商户名称</view>
|
||||
<view class="right"><view>{{ vdata.shopInfo.shopName }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
|
||||
<view class="right">
|
||||
<view>{{ vdata.shopInfo.shopName }}</view>
|
||||
<up-icon name="arrow-right" color="#999999" size="15"></up-icon>
|
||||
</view>
|
||||
<view class="page-cell m" @tap="go.to('PAGES_SHOP_EDITVAL',{name:'phone',value: vdata.shopInfo.phone})">
|
||||
</view>
|
||||
<view class="page-cell m" @tap="go.to('PAGES_SHOP_EDITVAL', { name: 'phone', value: vdata.shopInfo.phone })">
|
||||
<view class="label">商户电话</view>
|
||||
<view class="right"><view>{{ vdata.shopInfo.phone }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
|
||||
<view class="right">
|
||||
<view>{{ vdata.shopInfo.phone }}</view>
|
||||
<up-icon name="arrow-right" color="#999999" size="15"></up-icon>
|
||||
</view>
|
||||
<!-- <view class="page-cell m" >
|
||||
</view>
|
||||
<!-- <view class="page-cell m" >
|
||||
<view class="label">到期时间</view>
|
||||
<view class="right"><view>{{ vdata.shopInfo.realname }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
|
||||
</view> -->
|
||||
<view class="page-cell m">
|
||||
<view class="label">营业状态</view>
|
||||
<view class="right"><up-switch v-model="vdata.shopInfo.status" size="20" :inactiveValue="2" :activeValue="1" activeColor="#0FC161" @change="switchChange('status')"></up-switch></view>
|
||||
<view class="right">
|
||||
<up-switch v-model="vdata.shopInfo.status" size="20" :inactiveValue="2" :activeValue="1" activeColor="#0FC161" @change="switchChange('status')"></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-cell m" @tap="showMap">
|
||||
<view class="label">门店详细地址</view>
|
||||
<view class="right"><view>{{ vdata.shopInfo.address }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
|
||||
<view class="right">
|
||||
<view>{{ vdata.shopInfo.address }}</view>
|
||||
<up-icon name="arrow-right" color="#999999" size="15"></up-icon>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="page-cell">
|
||||
<view class="label">堂食功能</view>
|
||||
|
|
@ -38,71 +49,121 @@
|
|||
</view>
|
||||
<view class="page-cell m">
|
||||
<view class="label">是否开启会员余额支付</view>
|
||||
<view class="right"><up-switch v-model="vdata.shopInfo.isAccountPay" size="20" :inactiveValue="0" :activeValue="1" activeColor="#0FC161" @change="switchChange('isAccountPay')"></up-switch></view>
|
||||
<view class="right">
|
||||
<up-switch
|
||||
v-model="vdata.shopInfo.isAccountPay"
|
||||
size="20"
|
||||
:inactiveValue="0"
|
||||
:activeValue="1"
|
||||
activeColor="#0FC161"
|
||||
@change="switchChange('isAccountPay')"
|
||||
></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-cell m">
|
||||
<view class="label">是否开启会员价支付</view>
|
||||
<view class="right"><up-switch v-model="vdata.shopInfo.isMemberPrice" size="20" :inactiveValue="0" :activeValue="1" activeColor="#0FC161" @change="switchChange('isMemberPrice')"></up-switch></view>
|
||||
<view class="right">
|
||||
<up-switch
|
||||
v-model="vdata.shopInfo.isMemberPrice"
|
||||
size="20"
|
||||
:inactiveValue="0"
|
||||
:activeValue="1"
|
||||
activeColor="#0FC161"
|
||||
@change="switchChange('isMemberPrice')"
|
||||
></up-switch>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-cell">
|
||||
<view class="label">桌位费<view v-if="!vdata.isTableFee" class="tableFee" @tap="go.to('PAGES_SHOP_EDITVAL',{name:'tableFee',value: vdata.shopInfo.tableFee})">{{vdata.shopInfo.tableFee}}</view></view>
|
||||
<view class="label">
|
||||
桌位费
|
||||
<view v-if="!vdata.isTableFee" class="tableFee" @tap="go.to('PAGES_SHOP_EDITVAL', { name: 'tableFee', value: vdata.shopInfo.tableFee })">
|
||||
{{ vdata.shopInfo.tableFee }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>
|
||||
<up-checkbox-group><up-checkbox label="免桌位费" v-model:checked="vdata.isTableFee" activeColor="#0FC161" shape="circle" @change="isTableFeeChange"> </up-checkbox></up-checkbox-group>
|
||||
<up-checkbox-group>
|
||||
<up-checkbox label="免桌位费" v-model:checked="vdata.isTableFee" activeColor="#0FC161" shape="circle" @change="isTableFeeChange"></up-checkbox>
|
||||
</up-checkbox-group>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class="page-cell">
|
||||
<view class="label">台桌清理类型</view>
|
||||
<view class="right">
|
||||
<up-radio-group v-model="vdata.shopInfo.tableClearType" placement="row" @change="tableClearChange">
|
||||
<up-radio label="自动" name="auto" :customStyle="{ marginRight: '10px' }" activeColor="#0FC161"></up-radio>
|
||||
<up-radio label="手动" name="hand" :customStyle="{ marginRight: '10px' }" activeColor="#0FC161"></up-radio>
|
||||
</up-radio-group>
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-cell">
|
||||
<view class="label">
|
||||
自动清台时间
|
||||
</view>
|
||||
<view class="right">
|
||||
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="page-cell m">
|
||||
<view class="label">付费模式</view>
|
||||
<view class="right">
|
||||
<up-radio-group
|
||||
v-model="vdata.shopInfo.registerType"
|
||||
placement="row"
|
||||
>
|
||||
<up-radio-group v-model="vdata.shopInfo.registerType" placement="row">
|
||||
<up-radio
|
||||
:customStyle="{marginRight: '10px'}"
|
||||
:customStyle="{ marginRight: '10px' }"
|
||||
v-for="(item, index) in vdata.registerTypeList"
|
||||
:key="index"
|
||||
:label="item.name"
|
||||
:name="item.value"
|
||||
activeColor="#0FC161"
|
||||
@change="radioChange"
|
||||
>
|
||||
</up-radio>
|
||||
></up-radio>
|
||||
</up-radio-group>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="page-cell" @tap="go.to('PAGES_SHOP_QRCODE',{paymentQrcode: vdata.shopInfo.paymentQrcode})">
|
||||
<view class="page-cell" @tap="go.to('PAGES_SHOP_QRCODE', { paymentQrcode: vdata.shopInfo.paymentQrcode })">
|
||||
<view class="label">店铺收款码</view>
|
||||
<view class="right"><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
|
||||
</view>
|
||||
<view class="page-cell column" >
|
||||
<view class="page-cell column">
|
||||
<view class="label">店铺图片</view>
|
||||
<view class="extendList">
|
||||
<view class="extendTab">
|
||||
<view class="extendTab_item"
|
||||
v-for="(item,index) in vdata.extendList" :key="index"
|
||||
:class="{'active':vdata.extendIndex==index}"
|
||||
@click="extendTabClick(item,index)"
|
||||
>{{item.name}}</view>
|
||||
<view
|
||||
class="extendTab_item"
|
||||
v-for="(item, index) in vdata.extendList"
|
||||
:key="index"
|
||||
:class="{ active: vdata.extendIndex == index }"
|
||||
@click="extendTabClick(item, index)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="extend_content">
|
||||
<view class="preview" v-if="vdata.extendInfo.autoKey != 'ticket_logo'">
|
||||
<view class="index_bg"><up-image v-if="'index_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="my_bg"><up-image v-if="'my_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||
<view class="bg">
|
||||
<up-image
|
||||
v-if="'member_bg' == vdata.extendInfo.autoKey"
|
||||
:src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/' + vdata.extendInfo.autoKey + '.png'"
|
||||
></up-image>
|
||||
</view>
|
||||
<view class="member_bg"><up-image v-if="'member_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="shopinfo_bg"><up-image v-if="'shopinfo_bg' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
<view class="shopinfo_bg_f" v-if="'shopinfo_bg' == vdata.extendInfo.autoKey"></view>
|
||||
<view class="bg" v-if="vdata.extendInfo.autoKey" ><up-image :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||
<view class="bg" v-if="vdata.extendInfo.autoKey">
|
||||
<up-image :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/' + vdata.extendInfo.autoKey + '.png'"></up-image>
|
||||
</view>
|
||||
<view class="preview" v-else style="width: 359rpx;height: 232rpx">
|
||||
<view class="bg ticket_logo" v-if="vdata.extendInfo.autoKey == 'ticket_logo'" ><up-image :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/'+vdata.extendInfo.autoKey+'.png'" ></up-image></view>
|
||||
<view class="ticket_logo img" ><up-image v-if="'ticket_logo' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
</view>
|
||||
<view class="preview" v-else style="width: 359rpx; height: 232rpx">
|
||||
<view class="bg ticket_logo" v-if="vdata.extendInfo.autoKey == 'ticket_logo'">
|
||||
<up-image :src="'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/cashier_admin_app_shopSet/' + vdata.extendInfo.autoKey + '.png'"></up-image>
|
||||
</view>
|
||||
<view class="ticket_logo img"><up-image v-if="'ticket_logo' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view>
|
||||
</view>
|
||||
<view class="extend_img">
|
||||
<view class="extend_title">{{vdata.extendInfo.name}}背景图片</view>
|
||||
<view class="extend_title">{{ vdata.extendInfo.name }}背景图片</view>
|
||||
<view class="fileUp">
|
||||
<up-image :src="vdata.extendInfo.value"></up-image>
|
||||
<view class="file" @tap="chooseAndUploadAvatar('extendUp')"></view>
|
||||
|
|
@ -113,41 +174,38 @@
|
|||
</view>
|
||||
<!-- <view class="cutShop" @tap="go.to('PAGES_SHOP_LIST')">切换门店</view> -->
|
||||
</view>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue'
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { onShow } from '@dcloudio/uni-app';
|
||||
import go from '@/commons/utils/go.js'
|
||||
import { uploadFile } from '@/http/api/index.js'
|
||||
import { getShopInfo, editShopInfo, getShopExtend, editShopExtend } from '@/http/api/shop.js'
|
||||
import go from '@/commons/utils/go.js';
|
||||
import { uploadFile } from '@/http/api/index.js';
|
||||
import { getShopInfo, editShopInfo, getShopExtend, editShopExtend } from '@/http/api/shop.js';
|
||||
|
||||
const vdata = reactive({
|
||||
shopInfo: {
|
||||
status: 2,
|
||||
isAccountPay: 0,
|
||||
isMemberPrice: 0,
|
||||
isMemberPrice: 0
|
||||
},
|
||||
extendList: [],
|
||||
registerTypeList: [
|
||||
{name: "先付费", value: "before"},
|
||||
{name: "后付费", value: "after"}
|
||||
{ name: '先付费', value: 'before' },
|
||||
{ name: '后付费', value: 'after' }
|
||||
],
|
||||
extendIndex: 0,
|
||||
extendInfo: {},
|
||||
dineIn: false,
|
||||
takeout: false,
|
||||
isTableFee: false,
|
||||
label: "",
|
||||
type: "",
|
||||
inputValue: "",
|
||||
|
||||
})
|
||||
label: '',
|
||||
type: '',
|
||||
inputValue: ''
|
||||
});
|
||||
onMounted(() => {
|
||||
shopExtend();
|
||||
})
|
||||
});
|
||||
|
||||
onShow(() => {
|
||||
shopInfo();
|
||||
|
|
@ -155,49 +213,57 @@ onShow(() => {
|
|||
// 这里执行刷新数据的操作,例如重新调用API获取数据
|
||||
refreshData(params);
|
||||
});
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 输入内容修改
|
||||
*/
|
||||
let refreshData = (e) => {
|
||||
let params = {
|
||||
id : vdata.shopInfo.id,
|
||||
}
|
||||
params[e.name] = e.value
|
||||
id: vdata.shopInfo.id
|
||||
};
|
||||
params[e.name] = e.value;
|
||||
vdata.type = e.name;
|
||||
vdata.inputValue = e.value;
|
||||
updateShopInfo(params,'input')
|
||||
}
|
||||
updateShopInfo(params, 'input');
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取店铺信息
|
||||
*/
|
||||
const shopInfo = () => {
|
||||
getShopInfo({id:uni.getStorageSync('shopInfo').id}).then((res) => {
|
||||
vdata.isTableFee = res.isTableFee == 1 ? true: false;
|
||||
if (res.eatModel.split(",").indexOf("dine-in") != -1) {
|
||||
vdata.dineIn = true
|
||||
getShopInfo({ id: uni.getStorageSync('shopInfo').id }).then((res) => {
|
||||
vdata.isTableFee = res.isTableFee == 1 ? true : false;
|
||||
if (res.eatModel.split(',').indexOf('dine-in') != -1) {
|
||||
vdata.dineIn = true;
|
||||
}
|
||||
if (res.eatModel.split(",").indexOf("take-out") != -1) {
|
||||
vdata.takeout = true
|
||||
if (res.eatModel.split(',').indexOf('take-out') != -1) {
|
||||
vdata.takeout = true;
|
||||
}
|
||||
vdata.shopInfo = res;
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取店铺图片
|
||||
*/
|
||||
let shopExtend = () => {
|
||||
getShopExtend().then((res) => {
|
||||
if ( res && res.length > 0 ) {
|
||||
if (res && res.length > 0) {
|
||||
vdata.extendList = res;
|
||||
vdata.extendIndex = 0;
|
||||
vdata.extendInfo = res[0];
|
||||
}
|
||||
})
|
||||
});
|
||||
};
|
||||
|
||||
// 台桌清理模式修改
|
||||
function tableClearChange(n) {
|
||||
let params = {
|
||||
id: vdata.shopInfo.id,
|
||||
tableClearType: n
|
||||
};
|
||||
updateShopInfo(params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -205,22 +271,22 @@ let shopExtend = () => {
|
|||
*/
|
||||
let radioChange = (n) => {
|
||||
let params = {
|
||||
id : vdata.shopInfo.id,
|
||||
registerType : n,
|
||||
}
|
||||
updateShopInfo(params)
|
||||
id: vdata.shopInfo.id,
|
||||
registerType: n
|
||||
};
|
||||
updateShopInfo(params);
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
let updateShopInfo = (params,type) => {
|
||||
let updateShopInfo = (params, type) => {
|
||||
editShopInfo(params).then((res) => {
|
||||
if (type && type == "input") {
|
||||
if (type && type == 'input') {
|
||||
vdata.shopInfo[vdata.type] = vdata.inputValue;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改店铺图片
|
||||
|
|
@ -228,16 +294,14 @@ let updateShopInfo = (params,type) => {
|
|||
let updateShopExtend = () => {
|
||||
editShopExtend({
|
||||
autokey: vdata.extendInfo.autoKey,
|
||||
value: vdata.extendInfo.value,
|
||||
}).then((res) => {})
|
||||
}
|
||||
|
||||
|
||||
value: vdata.extendInfo.value
|
||||
}).then((res) => {});
|
||||
};
|
||||
|
||||
/**
|
||||
* 上传头像
|
||||
*/
|
||||
let chooseAndUploadAvatar = ( type ) => {
|
||||
let chooseAndUploadAvatar = (type) => {
|
||||
// 选择图片
|
||||
uni.chooseImage({
|
||||
count: 1, // 默认为1,只选择一张图片
|
||||
|
|
@ -245,91 +309,91 @@ let chooseAndUploadAvatar = ( type ) => {
|
|||
sourceType: ['album', 'camera'], // 图片来源,相册或相机
|
||||
success: (res) => {
|
||||
let file = res.tempFiles[0];
|
||||
uploadFile(file).then(res => {
|
||||
if ( type == "coverImg") {
|
||||
uploadFile(file)
|
||||
.then((res) => {
|
||||
if (type == 'coverImg') {
|
||||
vdata.shopInfo.coverImg = res;
|
||||
let params = {
|
||||
id : vdata.shopInfo.id,
|
||||
coverImg : vdata.shopInfo.coverImg,
|
||||
id: vdata.shopInfo.id,
|
||||
coverImg: vdata.shopInfo.coverImg
|
||||
};
|
||||
updateShopInfo(params);
|
||||
}
|
||||
updateShopInfo(params)
|
||||
}
|
||||
if ( type == "extendUp") {
|
||||
if (type == 'extendUp') {
|
||||
vdata.extendInfo.value = res;
|
||||
updateShopExtend()
|
||||
updateShopExtend();
|
||||
}
|
||||
|
||||
}).catch(res=>{
|
||||
if(res.errMsg){
|
||||
})
|
||||
.catch((res) => {
|
||||
if (res.errMsg) {
|
||||
uni.showToast({
|
||||
title:'图片大小超出限制',
|
||||
icon:'error'
|
||||
})
|
||||
title: '图片大小超出限制',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
});
|
||||
},
|
||||
fail: chooseImageError => {
|
||||
fail: (chooseImageError) => {
|
||||
// 选择图片失败处理逻辑
|
||||
console.log('choose image fail:', chooseImageError);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 店铺图片TAB切换
|
||||
*/
|
||||
let extendTabClick = (item,index) => {
|
||||
let extendTabClick = (item, index) => {
|
||||
vdata.extendInfo = item;
|
||||
vdata.extendIndex = index;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 是否免桌位费
|
||||
*/
|
||||
let isTableFeeChange = (e) => {
|
||||
if ( e ) {
|
||||
if (e) {
|
||||
vdata.isTableFee = true;
|
||||
} else {
|
||||
vdata.isTableFee = false;
|
||||
}
|
||||
switchChange('isTableFee')
|
||||
}
|
||||
switchChange('isTableFee');
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
let switchChange = ( type ) => {
|
||||
let switchChange = (type) => {
|
||||
let params = {
|
||||
id : vdata.shopInfo.id,
|
||||
}
|
||||
switch ( type ){
|
||||
case "address":
|
||||
id: vdata.shopInfo.id
|
||||
};
|
||||
switch (type) {
|
||||
case 'address':
|
||||
params.lng = vdata.shopInfo.lng;
|
||||
params.lat = vdata.shopInfo.lat;
|
||||
params.address = vdata.shopInfo.address;
|
||||
break;
|
||||
case "status":
|
||||
case 'status':
|
||||
params.status = vdata.shopInfo.status;
|
||||
break;
|
||||
case "eatModel":
|
||||
case 'eatModel':
|
||||
params.eatModel = [];
|
||||
if ( vdata.dineIn ) {
|
||||
if (vdata.dineIn) {
|
||||
params.eatModel.push('dine-in');
|
||||
}
|
||||
if ( vdata.takeout ) {
|
||||
if (vdata.takeout) {
|
||||
params.eatModel.push('take-out');
|
||||
}
|
||||
params.eatModel = params.eatModel.join(',')
|
||||
params.eatModel = params.eatModel.join(',');
|
||||
break;
|
||||
case "isAccountPay":
|
||||
case 'isAccountPay':
|
||||
params.isAccountPay = vdata.shopInfo.isAccountPay;
|
||||
break;
|
||||
case "isMemberPrice":
|
||||
case 'isMemberPrice':
|
||||
params.isMemberPrice = vdata.shopInfo.isMemberPrice;
|
||||
break;
|
||||
case "isTableFee":
|
||||
if ( vdata.isTableFee ) {
|
||||
case 'isTableFee':
|
||||
if (vdata.isTableFee) {
|
||||
params.isTableFee = 1;
|
||||
} else {
|
||||
params.isTableFee = 0;
|
||||
|
|
@ -337,7 +401,7 @@ let switchChange = ( type ) => {
|
|||
break;
|
||||
}
|
||||
updateShopInfo(params);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 选择地图
|
||||
|
|
@ -349,30 +413,25 @@ let showMap = () => {
|
|||
uni.chooseLocation({
|
||||
// type: 'wgs84',
|
||||
success: function (res) {
|
||||
|
||||
vdata.shopInfo.lng = res.longitude.toFixed(6); // IOS 小程序中: 经纬度12位。
|
||||
vdata.shopInfo.lat = res.latitude.toFixed(6);
|
||||
vdata.shopInfo.address = res.name;
|
||||
switchChange('address')
|
||||
switchChange('address');
|
||||
},
|
||||
fail: function(err) {
|
||||
fail: function (err) {
|
||||
console.log(err);
|
||||
// uni.showToast({
|
||||
// title:err,
|
||||
// icon:'error'
|
||||
// })
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-wrapper{
|
||||
background-color: #F8F8F8;
|
||||
.page-wrapper {
|
||||
background-color: #f8f8f8;
|
||||
padding-bottom: 32rpx;
|
||||
.page-cell {
|
||||
display: flex;
|
||||
|
|
@ -397,151 +456,159 @@ let showMap = () => {
|
|||
font-size: 28rpx;
|
||||
color: #333;
|
||||
border-radius: 8rpx 8rpx 8rpx 8rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
text-align: left;
|
||||
padding: 0 18rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
.extendList{
|
||||
.extendList {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 24rpx;
|
||||
.extendTab{
|
||||
.extendTab {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
.extendTab_item{
|
||||
.extendTab_item {
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
padding: 4rpx 12rpx;
|
||||
border-radius: 4rpx;
|
||||
border: 2rpx solid #E5E5E5;
|
||||
border: 2rpx solid #e5e5e5;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.active{
|
||||
background: #318AFE;
|
||||
border: 2rpx solid #318AFE;
|
||||
.active {
|
||||
background: #318afe;
|
||||
border: 2rpx solid #318afe;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.extend_content{
|
||||
.extend_content {
|
||||
display: flex;
|
||||
margin-top: 32rpx;
|
||||
.preview{
|
||||
.preview {
|
||||
min-width: 146rpx;
|
||||
height: 342rpx;
|
||||
position: relative;
|
||||
margin-right: 32rpx;
|
||||
background-color: #f7f7f7;
|
||||
::v-deep .bg,::v-deep .bg .u-image,::v-deep .bg .u-image__image{
|
||||
width: 146rpx!important;
|
||||
height: 342rpx!important;
|
||||
::v-deep .bg,
|
||||
::v-deep .bg .u-image,
|
||||
::v-deep .bg .u-image__image {
|
||||
width: 146rpx !important;
|
||||
height: 342rpx !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .index_bg .u-image,::v-deep .index_bg .u-image__image{
|
||||
width: 146rpx!important;
|
||||
height: 242rpx!important;
|
||||
::v-deep .index_bg .u-image,
|
||||
::v-deep .index_bg .u-image__image {
|
||||
width: 146rpx !important;
|
||||
height: 242rpx !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .my_bg .u-image,::v-deep .my_bg .u-image__image{
|
||||
width: 146rpx!important;
|
||||
height: 90rpx!important;
|
||||
::v-deep .my_bg .u-image,
|
||||
::v-deep .my_bg .u-image__image {
|
||||
width: 146rpx !important;
|
||||
height: 90rpx !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .member_bg .u-image,::v-deep .member_bg .u-image__image{
|
||||
width: 34rpx!important;
|
||||
height: 63rpx!important;
|
||||
::v-deep .member_bg .u-image,
|
||||
::v-deep .member_bg .u-image__image {
|
||||
width: 34rpx !important;
|
||||
height: 63rpx !important;
|
||||
position: absolute;
|
||||
top: 22rpx;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: auto;
|
||||
border-radius: 5rpx!important;
|
||||
border-radius: 5rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .shopinfo_bg .u-image,::v-deep .shopinfo_bg .u-image__image{
|
||||
width: 146rpx!important;
|
||||
height: 50rpx!important;
|
||||
::v-deep .shopinfo_bg .u-image,
|
||||
::v-deep .shopinfo_bg .u-image__image {
|
||||
width: 146rpx !important;
|
||||
height: 50rpx !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
::v-deep .bg.ticket_logo,::v-deep .bg.ticket_logo .u-image,::v-deep .bg.ticket_logo .u-image__image{
|
||||
width: 359rpx!important;
|
||||
height: 232rpx!important;
|
||||
::v-deep .bg.ticket_logo,
|
||||
::v-deep .bg.ticket_logo .u-image,
|
||||
::v-deep .bg.ticket_logo .u-image__image {
|
||||
width: 359rpx !important;
|
||||
height: 232rpx !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
::v-deep .ticket_logo.img .u-image,::v-deep .ticket_logo.img .u-image__image{
|
||||
width: 146rpx!important;
|
||||
height: 50rpx!important;
|
||||
::v-deep .ticket_logo.img .u-image,
|
||||
::v-deep .ticket_logo.img .u-image__image {
|
||||
width: 146rpx !important;
|
||||
height: 50rpx !important;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 10rpx;
|
||||
}
|
||||
|
||||
.shopinfo_bg_f{
|
||||
.shopinfo_bg_f {
|
||||
width: 146rpx;
|
||||
height: 290rpx;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
}
|
||||
.extend_img{
|
||||
.extend_img {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
.extend_title{
|
||||
.extend_title {
|
||||
font-weight: 400;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
.fileUp{
|
||||
.fileUp {
|
||||
width: 148rpx;
|
||||
height: 148rpx;
|
||||
position: relative;
|
||||
.file{
|
||||
.file {
|
||||
width: 148rpx;
|
||||
height: 148rpx;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
::v-deep .u-image,::v-deep .u-image__image{
|
||||
width: 148rpx!important;
|
||||
height: 148rpx!important;
|
||||
::v-deep .u-image,
|
||||
::v-deep .u-image__image {
|
||||
width: 148rpx !important;
|
||||
height: 148rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.column{
|
||||
.column {
|
||||
flex-direction: column;
|
||||
.label{
|
||||
.label {
|
||||
align-self: flex-start;
|
||||
}
|
||||
}
|
||||
.m{
|
||||
.m {
|
||||
margin-bottom: 12rpx;
|
||||
}
|
||||
.cutShop{
|
||||
.cutShop {
|
||||
width: 530rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
background: #318AFE;
|
||||
background: #318afe;
|
||||
border-radius: 56rpx;
|
||||
font-weight: 500;
|
||||
font-size: 32rpx;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
margin: 48rpx auto 0 auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
|
@ -554,7 +621,7 @@ let showMap = () => {
|
|||
color: #999999;
|
||||
position: relative;
|
||||
|
||||
.file{
|
||||
.file {
|
||||
width: 112rpx;
|
||||
height: 112rpx;
|
||||
line-height: 112rpx;
|
||||
|
|
@ -565,18 +632,14 @@ let showMap = () => {
|
|||
margin: auto;
|
||||
}
|
||||
|
||||
.fileImg{
|
||||
width: 112rpx!important;
|
||||
height: 112rpx!important;
|
||||
::v-deep .u-avatar__image{
|
||||
width: 112rpx!important;
|
||||
height: 112rpx!important;
|
||||
.fileImg {
|
||||
width: 112rpx !important;
|
||||
height: 112rpx !important;
|
||||
::v-deep .u-avatar__image {
|
||||
width: 112rpx !important;
|
||||
height: 112rpx !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue