This commit is contained in:
gyq 2025-05-10 09:14:15 +08:00
parent d6e1c83f88
commit 7f97467f82
2 changed files with 793 additions and 736 deletions

View File

@ -1,13 +1,11 @@
<!-- 首页 --> <!-- 首页 -->
<template> <template>
<view class="page-wrapper" style="overflow:visible;height:auto"> <view class="page-wrapper" style="overflow: visible; height: auto">
<!-- 背景图片view --> <!-- 背景图片view -->
<view class="bg-img-view" > <view class="bg-img-view">
<!-- 背景颜色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="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 class="bgbottomStyle"></view>
</view>
</view> </view>
</view> </view>
<!-- 解决定位层级问题 --> <!-- 解决定位层级问题 -->
@ -22,19 +20,17 @@
<view class="u-flex u-row-center u-relative"> <view class="u-flex u-row-center u-relative">
<view class="u-flex u-col-center"> <view class="u-flex u-col-center">
<view class="u-m-r-12">总收入</view> <view class="u-m-r-12">总收入</view>
<up-icon name="/static/indexImg/icon-help.svg" color="#fff" :size="12" <up-icon name="/static/indexImg/icon-help.svg" color="#fff" :size="12" @click="toggleTips"></up-icon>
@click="toggleTips"></up-icon>
</view> </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 class="sanjiao u-flex"><up-icon name="play-left-fill" size="12" color="#fff"></up-icon></view>
总收入为除会员余额 总收入为除会员余额 支付外所有收入
支付外所有收入
</view> </view>
</view> </view>
<view class="u-flex u-row-center"> <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>
<view>{{shopName||''}}</view> <view>{{ shopName || '' }}</view>
</view> </view>
<!-- 统计 or 快捷扫码 --> <!-- 统计 or 快捷扫码 -->
<!-- <Stats ref="statsRef" /> --> <!-- <Stats ref="statsRef" /> -->
@ -43,36 +39,35 @@
<JeepayNavigation :navList="navList" type="grid" /> <JeepayNavigation :navList="navList" type="grid" />
</view> </view>
</view> </view>
</template> </template>
<script setup> <script setup>
import { reactive, ref, onMounted, nextTick } from 'vue'; import { reactive, ref, onMounted, nextTick } from 'vue';
import { onPullDownRefresh, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'; import { onPullDownRefresh, onLoad, onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app';
import go from '@/commons/utils/go.js'; import go from '@/commons/utils/go.js';
import Stats from './components/Stats.vue'; import Stats from './components/Stats.vue';
import statistics from './components/statistics.vue' import statistics from './components/statistics.vue';
import storageManage from '@/commons/utils/storageManage.js'; import storageManage from '@/commons/utils/storageManage.js';
import { hasPermission } from '@/commons/utils/hasPermission.js' import { hasPermission } from '@/commons/utils/hasPermission.js';
uni.hideTabBar() uni.hideTabBar();
let shopName = ref() let shopName = ref();
let totalRevenuedata = ref() let totalRevenuedata = ref();
let totalRevenue = (d) => { let totalRevenue = (d) => {
totalRevenuedata.value = d totalRevenuedata.value = d;
} };
let showTips = ref(false) let showTips = ref(false);
function toggleTips() { function toggleTips() {
showTips.value = !showTips.value showTips.value = !showTips.value;
} }
function toSetting() { function toSetting() {
go.to('PAGES_SHOP_SETUP') go.to('PAGES_SHOP_SETUP');
} }
// //
const navList = [ const navList = [
{ {
title: '销售汇总', title: '销售汇总',
icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg', icon: '/static/indexImg/PAGE_SALES_SUMMARY.svg',
@ -83,11 +78,11 @@
icon: '/static/indexImg/icon-substitute-ordering.svg', icon: '/static/indexImg/icon-substitute-ordering.svg',
pageUrl: 'PAGES_CREATE_ORDER', pageUrl: 'PAGES_CREATE_ORDER',
clickFunc: () => { clickFunc: () => {
hasPermission('允许下单').then(res => { hasPermission('允许下单').then((res) => {
if (res) { if (res) {
go.to('PAGES_CREATE_ORDER') go.to('PAGES_CREATE_ORDER');
} }
}) });
} }
}, },
{ {
@ -98,23 +93,24 @@
{ {
title: '商品管理', title: '商品管理',
icon: '/static/indexImg/icon-product-control.svg', icon: '/static/indexImg/icon-product-control.svg',
pageUrl: 'PAGES_PRODUCT', pageUrl: 'PAGES_PRODUCT'
}, },
{ {
title: '分组管理', title: '分组管理',
icon: '/static/indexImg/goods-group.svg', icon: '/static/indexImg/goods-group.svg',
pageUrl: 'PAGES_GOODS_GROUP', pageUrl: 'PAGES_GOODS_GROUP'
}, },
{ {
title: '分类管理', title: '分类管理',
icon: '/static/indexImg/icon-category.svg', icon: '/static/indexImg/icon-category.svg',
pageUrl: 'PAGES_CATEGORY', pageUrl: 'PAGES_CATEGORY'
}, },
{ {
title: '会员管理', title: '会员管理',
icon: '/static/indexImg/icon-user.svg', icon: '/static/indexImg/icon-user.svg',
pageUrl: 'PAGES_USER_CONTROL', pageUrl: 'PAGES_USER_CONTROL'
}, { },
{
title: '员工管理', title: '员工管理',
icon: '/static/indexImg/icon-staff.svg', icon: '/static/indexImg/icon-staff.svg',
pageUrl: 'PAGES_STAFF' pageUrl: 'PAGES_STAFF'
@ -127,17 +123,17 @@
{ {
title: '订单管理', title: '订单管理',
icon: '/static/indexImg/icon-order.svg', icon: '/static/indexImg/icon-order.svg',
pageUrl: 'PAGES_ORDER_INDEX', pageUrl: 'PAGES_ORDER_INDEX'
}, },
{ {
title: '设备管理', title: '设备管理',
icon: '/static/indexImg/icon-printer.svg', icon: '/static/indexImg/icon-printer.svg',
pageUrl: 'PAGES_PRINTER_INDEX', pageUrl: 'PAGES_PRINTER_INDEX'
}, },
{ {
title: '交班', title: '交班',
icon: '/static/indexImg/icon-work.svg', icon: '/static/indexImg/icon-work.svg',
pageUrl: 'PAGES_WORK_INDEX', pageUrl: 'PAGES_WORK_INDEX'
}, },
{ {
title: '排队', title: '排队',
@ -152,17 +148,17 @@
{ {
title: '优惠券', title: '优惠券',
icon: '/static/coupon/icon_coupon.svg', icon: '/static/coupon/icon_coupon.svg',
pageUrl: 'PAGES_COUPON_INDEX', pageUrl: 'PAGES_COUPON_INDEX'
}, },
{ {
title: '订阅通知', title: '订阅通知',
icon: '/static/indexImg/icon-notification.svg', icon: '/static/indexImg/icon-notification.svg',
pageUrl: 'PAGES_NOTIFICATION_INDEX', pageUrl: 'PAGES_NOTIFICATION_INDEX'
}, },
{ {
title: '挂账管理', title: '挂账管理',
icon: '/static/indexImg/icon_credit.svg', icon: '/static/indexImg/icon_credit.svg',
pageUrl: 'PAGES_CREDIT_BUYER_INDEX', pageUrl: 'PAGES_CREDIT_BUYER_INDEX'
}, },
{ {
title: '核销管理', title: '核销管理',
@ -174,8 +170,8 @@
icon: '/static/indexImg/icon-login-out.svg', icon: '/static/indexImg/icon-login-out.svg',
pageUrl: 'PAGES_LOGIN', pageUrl: 'PAGES_LOGIN',
clickFunc: () => { clickFunc: () => {
storageManage.cleanByLogout() storageManage.cleanByLogout();
go.to('PAGES_LOGIN', {}, 'redirect') go.to('PAGES_LOGIN', {}, 'redirect');
} }
} }
// { // {
@ -257,83 +253,81 @@
// pageUrl: 'PAGES_AD_LIST', // pageUrl: 'PAGES_AD_LIST',
// entId: 'ENT_ADVERT_CONTROL' // entId: 'ENT_ADVERT_CONTROL'
// }, // },
];
const vdata = reactive({
];
const vdata = reactive({
noticeList: [], // noticeList: [], //
adList: [], adList: [],
shareImgUrl: '' // shareImgUrl: '' //
}); });
onLoad((options) => { onLoad((options) => {
shopName.value = uni.getStorageSync('shopInfo').shopName; shopName.value = uni.getStorageSync('shopInfo').shopName;
}); });
// //
onMounted(() => { onMounted(() => {
// refData(); // refData();
}); });
// 广 // 广
if (storageManage.userInfo().userType != 1) { if (storageManage.userInfo().userType != 1) {
const index = navList.findIndex((v) => v.entId == 'ENT_ADVERT_CONTROL'); const index = navList.findIndex((v) => v.entId == 'ENT_ADVERT_CONTROL');
if (index != -1) { if (index != -1) {
navList.splice(index, 1); navList.splice(index, 1);
} }
} }
async function refData() { async function refData() {
// , // ,
// nextTick(() => statsRef.value.refData()); // nextTick(() => statsRef.value.refData());
// //
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
} }
/** /**
* 微信分享 * 微信分享
*/ */
onShareAppMessage((res) => { onShareAppMessage((res) => {
if (res.from == 'menu') if (res.from == 'menu')
return { return {
title: uni.$appName, title: uni.$appName,
path: '/pages/index/index', path: '/pages/index/index',
imageUrl: vdata.shareImgUrl imageUrl: vdata.shareImgUrl
}; };
}); });
/** /**
* 分享到朋友圈 * 分享到朋友圈
*/ */
onShareTimeline(() => { onShareTimeline(() => {
return { return {
title: uni.$appName, title: uni.$appName,
imageUrl: vdata.shareImgUrl imageUrl: vdata.shareImgUrl
}; };
}); });
// //
onPullDownRefresh(() => { onPullDownRefresh(() => {
refData(); refData();
}); });
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.bg-main{ .bg-main {
position: relative; position: relative;
z-index: 10; z-index: 10;
} }
.bgbottomStyle{ .bgbottomStyle {
position: absolute; position: absolute;
bottom: -2rpx; bottom: -2rpx;
left: 0; left: 0;
width: 750rpx; width: 750rpx;
height: 74rpx; height: 74rpx;
background: linear-gradient( 180deg, rgba(195,215,235,0) 0%, #F9F9F9 100%); background: linear-gradient(180deg, rgba(195, 215, 235, 0) 0%, #f9f9f9 100%);
} }
.income { .income {
/* #ifdef H5 */ /* #ifdef H5 */
padding-top: calc(84rpx); padding-top: calc(84rpx);
/* #endif */ /* #endif */
@ -341,36 +335,36 @@
padding-top: calc(84rpx + 44px); padding-top: calc(84rpx + 44px);
/* #endif */ /* #endif */
>view { > view {
text-align: center; text-align: center;
color: #FFFFFF; color: #ffffff;
font-family: Source Han Sans CN, Source Han Sans CN; font-family: Source Han Sans CN, Source Han Sans CN;
} }
>view:nth-child(1) { > view:nth-child(1) {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
margin-top: 84rpx; margin-top: 84rpx;
} }
>view:nth-child(2) { > view:nth-child(2) {
margin-top: 20rpx; margin-top: 20rpx;
font-weight: 500; font-weight: 500;
font-size: 64rpx; font-size: 64rpx;
} }
>view:nth-child(3) { > view:nth-child(3) {
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
margin-top: 50rpx; margin-top: 50rpx;
} }
} }
.tips { .tips {
opacity: 0; opacity: 0;
right: 28rpx; right: 28rpx;
transition: opacity .3s; transition: opacity 0.3s;
background: #FFFFFF; background: #ffffff;
padding: 20rpx 14rpx; padding: 20rpx 14rpx;
width: 211rpx; width: 211rpx;
box-sizing: border-box; box-sizing: border-box;
@ -386,5 +380,5 @@
top: 50%; top: 50%;
transform: translateX(10rpx) translateY(-50%); transform: translateX(10rpx) translateY(-50%);
} }
} }
</style> </style>

View File

@ -3,30 +3,41 @@
<view class="page-cell"> <view class="page-cell">
<view class="label">头像</view> <view class="label">头像</view>
<view class="right"> <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 class="file" @tap="chooseAndUploadAvatar('coverImg')"></view>
</view> </view>
</view> </view>
<!-- <view class="page-cell m" @tap="updateValue('商户名称','shopName',vdata.shopInfo.shopName)"> --> <!-- <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="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>
<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="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>
<!-- <view class="page-cell m" > </view>
<!-- <view class="page-cell m" >
<view class="label">到期时间</view> <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 class="right"><view>{{ vdata.shopInfo.realname }}</view><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
</view> --> </view> -->
<view class="page-cell m"> <view class="page-cell m">
<view class="label">营业状态</view> <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>
<view class="page-cell m" @tap="showMap"> <view class="page-cell m" @tap="showMap">
<view class="label">门店详细地址</view> <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>
<!-- <view class="page-cell"> <!-- <view class="page-cell">
<view class="label">堂食功能</view> <view class="label">堂食功能</view>
@ -38,71 +49,121 @@
</view> </view>
<view class="page-cell m"> <view class="page-cell m">
<view class="label">是否开启会员余额支付</view> <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>
<view class="page-cell m"> <view class="page-cell m">
<view class="label">是否开启会员价支付</view> <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>
<view class="page-cell"> <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 class="right">
<view> <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>
</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="page-cell m">
<view class="label">付费模式</view> <view class="label">付费模式</view>
<view class="right"> <view class="right">
<up-radio-group <up-radio-group v-model="vdata.shopInfo.registerType" placement="row">
v-model="vdata.shopInfo.registerType"
placement="row"
>
<up-radio <up-radio
:customStyle="{marginRight: '10px'}" :customStyle="{ marginRight: '10px' }"
v-for="(item, index) in vdata.registerTypeList" v-for="(item, index) in vdata.registerTypeList"
:key="index" :key="index"
:label="item.name" :label="item.name"
:name="item.value" :name="item.value"
activeColor="#0FC161" activeColor="#0FC161"
@change="radioChange" @change="radioChange"
> ></up-radio>
</up-radio>
</up-radio-group> </up-radio-group>
</view> </view>
</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="label">店铺收款码</view>
<view class="right"><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view> <view class="right"><up-icon name="arrow-right" color="#999999" size="15"></up-icon></view>
</view> </view>
<view class="page-cell column" > <view class="page-cell column">
<view class="label">店铺图片</view> <view class="label">店铺图片</view>
<view class="extendList"> <view class="extendList">
<view class="extendTab"> <view class="extendTab">
<view class="extendTab_item" <view
v-for="(item,index) in vdata.extendList" :key="index" class="extendTab_item"
:class="{'active':vdata.extendIndex==index}" v-for="(item, index) in vdata.extendList"
@click="extendTabClick(item,index)" :key="index"
>{{item.name}}</view> :class="{ active: vdata.extendIndex == index }"
@click="extendTabClick(item, index)"
>
{{ item.name }}
</view>
</view> </view>
<view class="extend_content"> <view class="extend_content">
<view class="preview" v-if="vdata.extendInfo.autoKey != 'ticket_logo'"> <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="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="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="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"><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="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>
<view class="preview" v-else style="width: 359rpx;height: 232rpx"> </view>
<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="preview" v-else style="width: 359rpx; height: 232rpx">
<view class="ticket_logo img" ><up-image v-if="'ticket_logo' == vdata.extendInfo.autoKey" :src="vdata.extendInfo.value"></up-image></view> <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>
<view class="extend_img"> <view class="extend_img">
<view class="extend_title">{{vdata.extendInfo.name}}背景图片</view> <view class="extend_title">{{ vdata.extendInfo.name }}背景图片</view>
<view class="fileUp"> <view class="fileUp">
<up-image :src="vdata.extendInfo.value"></up-image> <up-image :src="vdata.extendInfo.value"></up-image>
<view class="file" @tap="chooseAndUploadAvatar('extendUp')"></view> <view class="file" @tap="chooseAndUploadAvatar('extendUp')"></view>
@ -113,41 +174,38 @@
</view> </view>
<!-- <view class="cutShop" @tap="go.to('PAGES_SHOP_LIST')">切换门店</view> --> <!-- <view class="cutShop" @tap="go.to('PAGES_SHOP_LIST')">切换门店</view> -->
</view> </view>
</template> </template>
<script setup> <script setup>
import { ref, reactive, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue';
import { onShow } from '@dcloudio/uni-app'; import { onShow } from '@dcloudio/uni-app';
import go from '@/commons/utils/go.js' import go from '@/commons/utils/go.js';
import { uploadFile } from '@/http/api/index.js' import { uploadFile } from '@/http/api/index.js';
import { getShopInfo, editShopInfo, getShopExtend, editShopExtend } from '@/http/api/shop.js' import { getShopInfo, editShopInfo, getShopExtend, editShopExtend } from '@/http/api/shop.js';
const vdata = reactive({ const vdata = reactive({
shopInfo: { shopInfo: {
status: 2, status: 2,
isAccountPay: 0, isAccountPay: 0,
isMemberPrice: 0, isMemberPrice: 0
}, },
extendList: [], extendList: [],
registerTypeList: [ registerTypeList: [
{name: "先付费", value: "before"}, { name: '先付费', value: 'before' },
{name: "后付费", value: "after"} { name: '后付费', value: 'after' }
], ],
extendIndex: 0, extendIndex: 0,
extendInfo: {}, extendInfo: {},
dineIn: false, dineIn: false,
takeout: false, takeout: false,
isTableFee: false, isTableFee: false,
label: "", label: '',
type: "", type: '',
inputValue: "", inputValue: ''
});
})
onMounted(() => { onMounted(() => {
shopExtend(); shopExtend();
}) });
onShow(() => { onShow(() => {
shopInfo(); shopInfo();
@ -155,49 +213,57 @@ onShow(() => {
// API // API
refreshData(params); refreshData(params);
}); });
}) });
/** /**
* 输入内容修改 * 输入内容修改
*/ */
let refreshData = (e) => { let refreshData = (e) => {
let params = { let params = {
id : vdata.shopInfo.id, id: vdata.shopInfo.id
} };
params[e.name] = e.value params[e.name] = e.value;
vdata.type = e.name; vdata.type = e.name;
vdata.inputValue = e.value; vdata.inputValue = e.value;
updateShopInfo(params,'input') updateShopInfo(params, 'input');
} };
/** /**
* 获取店铺信息 * 获取店铺信息
*/ */
const shopInfo = () => { const shopInfo = () => {
getShopInfo({id:uni.getStorageSync('shopInfo').id}).then((res) => { getShopInfo({ id: uni.getStorageSync('shopInfo').id }).then((res) => {
vdata.isTableFee = res.isTableFee == 1 ? true: false; vdata.isTableFee = res.isTableFee == 1 ? true : false;
if (res.eatModel.split(",").indexOf("dine-in") != -1) { if (res.eatModel.split(',').indexOf('dine-in') != -1) {
vdata.dineIn = true vdata.dineIn = true;
} }
if (res.eatModel.split(",").indexOf("take-out") != -1) { if (res.eatModel.split(',').indexOf('take-out') != -1) {
vdata.takeout = true vdata.takeout = true;
} }
vdata.shopInfo = res; vdata.shopInfo = res;
}) });
} };
/** /**
* 获取店铺图片 * 获取店铺图片
*/ */
let shopExtend = () => { let shopExtend = () => {
getShopExtend().then((res) => { getShopExtend().then((res) => {
if ( res && res.length > 0 ) { if (res && res.length > 0) {
vdata.extendList = res; vdata.extendList = res;
vdata.extendIndex = 0; vdata.extendIndex = 0;
vdata.extendInfo = res[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 radioChange = (n) => {
let params = { let params = {
id : vdata.shopInfo.id, id: vdata.shopInfo.id,
registerType : n, registerType: n
} };
updateShopInfo(params) updateShopInfo(params);
}; };
/** /**
* 修改 * 修改
*/ */
let updateShopInfo = (params,type) => { let updateShopInfo = (params, type) => {
editShopInfo(params).then((res) => { editShopInfo(params).then((res) => {
if (type && type == "input") { if (type && type == 'input') {
vdata.shopInfo[vdata.type] = vdata.inputValue; vdata.shopInfo[vdata.type] = vdata.inputValue;
} }
}) });
} };
/** /**
* 修改店铺图片 * 修改店铺图片
@ -228,16 +294,14 @@ let updateShopInfo = (params,type) => {
let updateShopExtend = () => { let updateShopExtend = () => {
editShopExtend({ editShopExtend({
autokey: vdata.extendInfo.autoKey, autokey: vdata.extendInfo.autoKey,
value: vdata.extendInfo.value, value: vdata.extendInfo.value
}).then((res) => {}) }).then((res) => {});
} };
/** /**
* 上传头像 * 上传头像
*/ */
let chooseAndUploadAvatar = ( type ) => { let chooseAndUploadAvatar = (type) => {
// //
uni.chooseImage({ uni.chooseImage({
count: 1, // 1 count: 1, // 1
@ -245,91 +309,91 @@ let chooseAndUploadAvatar = ( type ) => {
sourceType: ['album', 'camera'], // sourceType: ['album', 'camera'], //
success: (res) => { success: (res) => {
let file = res.tempFiles[0]; let file = res.tempFiles[0];
uploadFile(file).then(res => { uploadFile(file)
if ( type == "coverImg") { .then((res) => {
if (type == 'coverImg') {
vdata.shopInfo.coverImg = res; vdata.shopInfo.coverImg = res;
let params = { let params = {
id : vdata.shopInfo.id, id: vdata.shopInfo.id,
coverImg : vdata.shopInfo.coverImg, coverImg: vdata.shopInfo.coverImg
};
updateShopInfo(params);
} }
updateShopInfo(params) if (type == 'extendUp') {
}
if ( type == "extendUp") {
vdata.extendInfo.value = res; vdata.extendInfo.value = res;
updateShopExtend() updateShopExtend();
} }
})
}).catch(res=>{ .catch((res) => {
if(res.errMsg){ if (res.errMsg) {
uni.showToast({ uni.showToast({
title:'图片大小超出限制', title: '图片大小超出限制',
icon:'error' icon: 'error'
}) });
} }
});
})
}, },
fail: chooseImageError => { fail: (chooseImageError) => {
// //
console.log('choose image fail:', chooseImageError); console.log('choose image fail:', chooseImageError);
} }
}); });
} };
/** /**
* 店铺图片TAB切换 * 店铺图片TAB切换
*/ */
let extendTabClick = (item,index) => { let extendTabClick = (item, index) => {
vdata.extendInfo = item; vdata.extendInfo = item;
vdata.extendIndex = index; vdata.extendIndex = index;
} };
/** /**
* 是否免桌位费 * 是否免桌位费
*/ */
let isTableFeeChange = (e) => { let isTableFeeChange = (e) => {
if ( e ) { if (e) {
vdata.isTableFee = true; vdata.isTableFee = true;
} else { } else {
vdata.isTableFee = false; vdata.isTableFee = false;
} }
switchChange('isTableFee') switchChange('isTableFee');
} };
/** /**
* 修改 * 修改
*/ */
let switchChange = ( type ) => { let switchChange = (type) => {
let params = { let params = {
id : vdata.shopInfo.id, id: vdata.shopInfo.id
} };
switch ( type ){ switch (type) {
case "address": case 'address':
params.lng = vdata.shopInfo.lng; params.lng = vdata.shopInfo.lng;
params.lat = vdata.shopInfo.lat; params.lat = vdata.shopInfo.lat;
params.address = vdata.shopInfo.address; params.address = vdata.shopInfo.address;
break; break;
case "status": case 'status':
params.status = vdata.shopInfo.status; params.status = vdata.shopInfo.status;
break; break;
case "eatModel": case 'eatModel':
params.eatModel = []; params.eatModel = [];
if ( vdata.dineIn ) { if (vdata.dineIn) {
params.eatModel.push('dine-in'); params.eatModel.push('dine-in');
} }
if ( vdata.takeout ) { if (vdata.takeout) {
params.eatModel.push('take-out'); params.eatModel.push('take-out');
} }
params.eatModel = params.eatModel.join(',') params.eatModel = params.eatModel.join(',');
break; break;
case "isAccountPay": case 'isAccountPay':
params.isAccountPay = vdata.shopInfo.isAccountPay; params.isAccountPay = vdata.shopInfo.isAccountPay;
break; break;
case "isMemberPrice": case 'isMemberPrice':
params.isMemberPrice = vdata.shopInfo.isMemberPrice; params.isMemberPrice = vdata.shopInfo.isMemberPrice;
break; break;
case "isTableFee": case 'isTableFee':
if ( vdata.isTableFee ) { if (vdata.isTableFee) {
params.isTableFee = 1; params.isTableFee = 1;
} else { } else {
params.isTableFee = 0; params.isTableFee = 0;
@ -337,7 +401,7 @@ let switchChange = ( type ) => {
break; break;
} }
updateShopInfo(params); updateShopInfo(params);
} };
/** /**
* 选择地图 * 选择地图
@ -349,30 +413,25 @@ let showMap = () => {
uni.chooseLocation({ uni.chooseLocation({
// type: 'wgs84', // type: 'wgs84',
success: function (res) { success: function (res) {
vdata.shopInfo.lng = res.longitude.toFixed(6); // IOS 12 vdata.shopInfo.lng = res.longitude.toFixed(6); // IOS 12
vdata.shopInfo.lat = res.latitude.toFixed(6); vdata.shopInfo.lat = res.latitude.toFixed(6);
vdata.shopInfo.address = res.name; vdata.shopInfo.address = res.name;
switchChange('address') switchChange('address');
}, },
fail: function(err) { fail: function (err) {
console.log(err); console.log(err);
// uni.showToast({ // uni.showToast({
// title:err, // title:err,
// icon:'error' // icon:'error'
// }) // })
} }
}) });
};
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.page-wrapper{ .page-wrapper {
background-color: #F8F8F8; background-color: #f8f8f8;
padding-bottom: 32rpx; padding-bottom: 32rpx;
.page-cell { .page-cell {
display: flex; display: flex;
@ -397,151 +456,159 @@ let showMap = () => {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
border-radius: 8rpx 8rpx 8rpx 8rpx; border-radius: 8rpx 8rpx 8rpx 8rpx;
border: 2rpx solid #E5E5E5; border: 2rpx solid #e5e5e5;
text-align: left; text-align: left;
padding: 0 18rpx; padding: 0 18rpx;
box-sizing: border-box; box-sizing: border-box;
} }
} }
.extendList{ .extendList {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 24rpx; margin-top: 24rpx;
.extendTab{ .extendTab {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
.extendTab_item{ .extendTab_item {
font-size: 24rpx; font-size: 24rpx;
font-weight: 400; font-weight: 400;
padding: 4rpx 12rpx; padding: 4rpx 12rpx;
border-radius: 4rpx; border-radius: 4rpx;
border: 2rpx solid #E5E5E5; border: 2rpx solid #e5e5e5;
margin-right: 20rpx; margin-right: 20rpx;
} }
.active{ .active {
background: #318AFE; background: #318afe;
border: 2rpx solid #318AFE; border: 2rpx solid #318afe;
color: #fff; color: #fff;
} }
} }
.extend_content{ .extend_content {
display: flex; display: flex;
margin-top: 32rpx; margin-top: 32rpx;
.preview{ .preview {
min-width: 146rpx; min-width: 146rpx;
height: 342rpx; height: 342rpx;
position: relative; position: relative;
margin-right: 32rpx; margin-right: 32rpx;
background-color: #f7f7f7; background-color: #f7f7f7;
::v-deep .bg,::v-deep .bg .u-image,::v-deep .bg .u-image__image{ ::v-deep .bg,
width: 146rpx!important; ::v-deep .bg .u-image,
height: 342rpx!important; ::v-deep .bg .u-image__image {
width: 146rpx !important;
height: 342rpx !important;
position: absolute; position: absolute;
top: 0; top: 0;
} }
::v-deep .index_bg .u-image,::v-deep .index_bg .u-image__image{ ::v-deep .index_bg .u-image,
width: 146rpx!important; ::v-deep .index_bg .u-image__image {
height: 242rpx!important; width: 146rpx !important;
height: 242rpx !important;
position: absolute; position: absolute;
top: 0; top: 0;
} }
::v-deep .my_bg .u-image,::v-deep .my_bg .u-image__image{ ::v-deep .my_bg .u-image,
width: 146rpx!important; ::v-deep .my_bg .u-image__image {
height: 90rpx!important; width: 146rpx !important;
height: 90rpx !important;
position: absolute; position: absolute;
top: 0; top: 0;
} }
::v-deep .member_bg .u-image,::v-deep .member_bg .u-image__image{ ::v-deep .member_bg .u-image,
width: 34rpx!important; ::v-deep .member_bg .u-image__image {
height: 63rpx!important; width: 34rpx !important;
height: 63rpx !important;
position: absolute; position: absolute;
top: 22rpx; top: 22rpx;
left: 0; left: 0;
right: 0; right: 0;
margin: auto; margin: auto;
border-radius: 5rpx!important; border-radius: 5rpx !important;
} }
::v-deep .shopinfo_bg .u-image,::v-deep .shopinfo_bg .u-image__image{ ::v-deep .shopinfo_bg .u-image,
width: 146rpx!important; ::v-deep .shopinfo_bg .u-image__image {
height: 50rpx!important; width: 146rpx !important;
height: 50rpx !important;
position: absolute; position: absolute;
top: 0; top: 0;
} }
::v-deep .bg.ticket_logo,::v-deep .bg.ticket_logo .u-image,::v-deep .bg.ticket_logo .u-image__image{ ::v-deep .bg.ticket_logo,
width: 359rpx!important; ::v-deep .bg.ticket_logo .u-image,
height: 232rpx!important; ::v-deep .bg.ticket_logo .u-image__image {
width: 359rpx !important;
height: 232rpx !important;
position: absolute; position: absolute;
top: 0; top: 0;
} }
::v-deep .ticket_logo.img .u-image,::v-deep .ticket_logo.img .u-image__image{ ::v-deep .ticket_logo.img .u-image,
width: 146rpx!important; ::v-deep .ticket_logo.img .u-image__image {
height: 50rpx!important; width: 146rpx !important;
height: 50rpx !important;
position: absolute; position: absolute;
top: 0; top: 0;
left: 10rpx; left: 10rpx;
} }
.shopinfo_bg_f{ .shopinfo_bg_f {
width: 146rpx; width: 146rpx;
height: 290rpx; height: 290rpx;
position: absolute; position: absolute;
bottom: 0; bottom: 0;
background-color: #fff; background-color: #fff;
} }
} }
.extend_img{ .extend_img {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
.extend_title{ .extend_title {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
color: #333333; color: #333333;
margin-bottom: 16rpx; margin-bottom: 16rpx;
} }
.fileUp{ .fileUp {
width: 148rpx; width: 148rpx;
height: 148rpx; height: 148rpx;
position: relative; position: relative;
.file{ .file {
width: 148rpx; width: 148rpx;
height: 148rpx; height: 148rpx;
position: absolute; position: absolute;
top: 0; top: 0;
} }
} }
::v-deep .u-image,::v-deep .u-image__image{ ::v-deep .u-image,
width: 148rpx!important; ::v-deep .u-image__image {
height: 148rpx!important; width: 148rpx !important;
height: 148rpx !important;
} }
} }
} }
} }
} }
.column{ .column {
flex-direction: column; flex-direction: column;
.label{ .label {
align-self: flex-start; align-self: flex-start;
} }
} }
.m{ .m {
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.cutShop{ .cutShop {
width: 530rpx; width: 530rpx;
height: 80rpx; height: 80rpx;
line-height: 80rpx; line-height: 80rpx;
background: #318AFE; background: #318afe;
border-radius: 56rpx; border-radius: 56rpx;
font-weight: 500; font-weight: 500;
font-size: 32rpx; font-size: 32rpx;
color: #FFFFFF; color: #ffffff;
margin: 48rpx auto 0 auto; margin: 48rpx auto 0 auto;
text-align: center; text-align: center;
} }
@ -554,7 +621,7 @@ let showMap = () => {
color: #999999; color: #999999;
position: relative; position: relative;
.file{ .file {
width: 112rpx; width: 112rpx;
height: 112rpx; height: 112rpx;
line-height: 112rpx; line-height: 112rpx;
@ -565,18 +632,14 @@ let showMap = () => {
margin: auto; margin: auto;
} }
.fileImg{ .fileImg {
width: 112rpx!important; width: 112rpx !important;
height: 112rpx!important; height: 112rpx !important;
::v-deep .u-avatar__image{ ::v-deep .u-avatar__image {
width: 112rpx!important; width: 112rpx !important;
height: 112rpx!important; height: 112rpx !important;
} }
} }
} }
}
}
</style> </style>