main
parent
943b92878a
commit
f6d37b8486
|
|
@ -1,17 +1,80 @@
|
|||
<template>
|
||||
<view class="content"></view>
|
||||
<view class="content">
|
||||
<template v-if="list.length">
|
||||
<uv-swiper
|
||||
height="100vh"
|
||||
:list="list"
|
||||
:autoplay="false"
|
||||
:border-radius="0"
|
||||
:circular="false"
|
||||
circular
|
||||
></uv-swiper>
|
||||
|
||||
<div class="" id="timer">
|
||||
<div id="info" @click="launchApp">跳过</div>
|
||||
<div class="circleProgress_wrapper">
|
||||
<div class="wrapper right">
|
||||
<div class="circleProgress rightcircle"></div>
|
||||
</div>
|
||||
<div class="wrapper left">
|
||||
<div class="circleProgress leftcircle"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
import { onLoad, onReady, onUnload } from '@dcloudio/uni-app'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
import { http } from '@/utils/request'
|
||||
import { ref } from 'vue'
|
||||
|
||||
const userStore = useUserStore()
|
||||
const list = ref([])
|
||||
const timer = ref(null)
|
||||
|
||||
onLoad(() => {
|
||||
checkLogin()
|
||||
getInit()
|
||||
})
|
||||
|
||||
onReady(() => {
|
||||
setTimer()
|
||||
})
|
||||
|
||||
onUnload(() => {
|
||||
if (timer.value) clearInterval(timer.value)
|
||||
timer.value = null
|
||||
})
|
||||
|
||||
function setTimer() {
|
||||
let count = 6
|
||||
timer.value = setInterval(() => {
|
||||
count--
|
||||
if (count == 0) {
|
||||
clearInterval(timer.value)
|
||||
launchApp()
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
function launchApp() {
|
||||
checkLogin()
|
||||
}
|
||||
|
||||
async function getInit() {
|
||||
try {
|
||||
const resData = await http.get('/configurations')
|
||||
list.value = resData.launch_images
|
||||
} catch (error) {
|
||||
} finally {
|
||||
if (list.value.length === 0) {
|
||||
checkLogin()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const checkLogin = () => {
|
||||
if (!userStore.isLogin) {
|
||||
uni.redirectTo({
|
||||
|
|
@ -24,3 +87,128 @@ const checkLogin = () => {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
#timer {
|
||||
display: inline-block;
|
||||
position: fixed;
|
||||
top: 40px;
|
||||
right: 10px;
|
||||
box-sizing: inherit;
|
||||
}
|
||||
|
||||
#info {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
line-height: 36px;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.circleProgress_wrapper {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
width: 18px;
|
||||
height: 36px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.circleProgress {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border: 2px solid #ffffff;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
box-sizing: border-box;
|
||||
-webkit-transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.rightcircle {
|
||||
border-top: 2px solid #03a9f4;
|
||||
border-right: 2px solid #03a9f4;
|
||||
right: 0;
|
||||
-webkit-animation: circleProgressLoad_right 6s linear;
|
||||
/*动画停留在最后一帧*/
|
||||
animation-fill-mode: forwards;
|
||||
-moz-animation-fill-mode: forwards;
|
||||
-webkit-animation-fill-mode: forwards;
|
||||
-o-animation-fill-mode: forwards;
|
||||
}
|
||||
|
||||
.leftcircle {
|
||||
border-bottom: 2px solid #03a9f4;
|
||||
border-left: 2px solid #03a9f4;
|
||||
left: 0;
|
||||
-webkit-animation: circleProgressLoad_left 6s linear;
|
||||
/*动画停留在最后一帧*/
|
||||
animation-fill-mode: forwards;
|
||||
-moz-animation-fill-mode: forwards;
|
||||
-webkit-animation-fill-mode: forwards;
|
||||
-o-animation-fill-mode: forwards;
|
||||
}
|
||||
|
||||
@keyframes circleProgressLoad_right {
|
||||
0% {
|
||||
border-top: 2px solid #03a9f4;
|
||||
border-right: 2px solid #03a9f4;
|
||||
-webkit-transform: rotate(45deg);
|
||||
}
|
||||
|
||||
50% {
|
||||
border-top: 2px solid #03a9f4;
|
||||
border-right: 2px solid #03a9f4;
|
||||
border-left: 2px solid #ffffff;
|
||||
border-bottom: 2px solid #ffffff;
|
||||
-webkit-transform: rotate(225deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
border-left: 2px solid #ffffff;
|
||||
border-bottom: 2px solid #ffffff;
|
||||
-webkit-transform: rotate(225deg);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes circleProgressLoad_left {
|
||||
0% {
|
||||
border-bottom: 2px solid #03a9f4;
|
||||
border-left: 2px solid #03a9f4;
|
||||
-webkit-transform: rotate(45deg);
|
||||
}
|
||||
|
||||
50% {
|
||||
border-bottom: 2px solid #03a9f4;
|
||||
border-left: 2px solid #03a9f4;
|
||||
border-top: 2px solid #ffffff;
|
||||
border-right: 2px solid #ffffff;
|
||||
-webkit-transform: rotate(45deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
border-top: 2px solid #ffffff;
|
||||
border-right: 2px solid #ffffff;
|
||||
-webkit-transform: rotate(225deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,225 @@
|
|||
<template>
|
||||
<view>
|
||||
<CuNavbar :isBack="isBack || false" title="数据上报"></CuNavbar>
|
||||
<uv-sticky
|
||||
customNavHeight="44px"
|
||||
:offset-top="offsetTop"
|
||||
bgColor="#fff"
|
||||
v-if="checkPermission(['admin'])"
|
||||
>
|
||||
<StoreDown color="#333333" @change="storeChange"></StoreDown>
|
||||
</uv-sticky>
|
||||
|
||||
<uv-form
|
||||
class="mt-30rpx"
|
||||
labelPosition="left"
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
errorType="toast"
|
||||
labelWidth="130rpx"
|
||||
>
|
||||
<view class="px-base space-y-20rpx">
|
||||
<view class="card">
|
||||
<view class="pl-20rpx">
|
||||
<uv-form-item label="日期" prop="form.date" @click="showDateSelect">
|
||||
<uv-input
|
||||
disabled
|
||||
v-model="form.date"
|
||||
disabledColor="#ffffff"
|
||||
placeholder="请选择日期"
|
||||
:border="`none`"
|
||||
>
|
||||
</uv-input>
|
||||
<template v-slot:right>
|
||||
<uv-icon name="arrow-right"></uv-icon>
|
||||
</template>
|
||||
</uv-form-item>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pointer-events-none">
|
||||
<view class="card" v-for="(item, i) in form.items" :key="i">
|
||||
<TitleComp :title="item.name"></TitleComp>
|
||||
<view class="mt-20rpx">
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
</view>
|
||||
<view class="pl-20rpx">
|
||||
<uv-form-item label="销售" :prop="`items.${i}.sales`">
|
||||
<uv-input
|
||||
@input="salesChange"
|
||||
v-model="item.sales"
|
||||
:border="`none`"
|
||||
type="digit"
|
||||
:placeholder="``"
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
<uv-form-item label="兑奖" :prop="`items.${i}.expenditure`">
|
||||
<uv-input
|
||||
@input="expenditureChange"
|
||||
v-model="item.expenditure"
|
||||
:border="`none`"
|
||||
type="digit"
|
||||
:placeholder="``"
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<TitleComp title="汇总情况"></TitleComp>
|
||||
<view class="mt-20rpx">
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
</view>
|
||||
<view class="pl-20rpx">
|
||||
<uv-form-item label="销售合计" prop="sales">
|
||||
<uv-input
|
||||
:border="`none`"
|
||||
type="digit"
|
||||
v-model="form.sales"
|
||||
placeholder=""
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
<uv-form-item
|
||||
:label="`${store?.is_lottery_store ? '兑奖' : '支出'}合计`"
|
||||
prop="expenditure"
|
||||
>
|
||||
<uv-input
|
||||
type="digit"
|
||||
:border="`none`"
|
||||
v-model="form.expenditure"
|
||||
:placeholder="``"
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
<uv-form-item label="新增客户" prop="new_customers">
|
||||
<uv-input
|
||||
:border="`none`"
|
||||
v-model="form.new_customers"
|
||||
type="number"
|
||||
placeholder=""
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
<uv-line color="#f5f5f5"></uv-line>
|
||||
<uv-form-item label="交账金额" prop="handover_amount">
|
||||
<uv-input
|
||||
:border="`none`"
|
||||
type="digit"
|
||||
v-model="form.handover_amount"
|
||||
placeholder=""
|
||||
></uv-input>
|
||||
</uv-form-item>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card">
|
||||
<TitleComp title="时段报表照片">
|
||||
<template #right>
|
||||
<view class="text-24rpx text-gray-400"></view>
|
||||
</template>
|
||||
</TitleComp>
|
||||
<uv-form-item label="" prop="photos">
|
||||
<view>
|
||||
<uv-album
|
||||
multipleSize="200rpx"
|
||||
:urls="form.photos"
|
||||
keyName="url"
|
||||
></uv-album>
|
||||
</view>
|
||||
<!-- <view class="flex-center w-full" v-if="form.photos.length === 0">
|
||||
<uv-empty></uv-empty>
|
||||
</view> -->
|
||||
</uv-form-item>
|
||||
</view>
|
||||
</view>
|
||||
</uv-form>
|
||||
|
||||
<uv-calendars
|
||||
color="#ee2c37"
|
||||
confirmColor="#ee2c37"
|
||||
ref="calendars"
|
||||
@confirm="calendarsConfirm"
|
||||
:endDate="endDate"
|
||||
:date="form.date"
|
||||
/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { http } from '@/utils/request'
|
||||
import CuNavbar from '@/components/cu-navbar/index'
|
||||
import TitleComp from '@/components/title-comp/index'
|
||||
import { sys } from '@climblee/uv-ui/libs/function/index'
|
||||
import StoreDown from '@/pages/home/components/store-down.vue'
|
||||
import { ref, computed, reactive } from 'vue'
|
||||
import checkPermission from '@/utils/permission'
|
||||
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
const props = defineProps({
|
||||
isBack: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
dete: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
})
|
||||
const endDate = timeFormat(
|
||||
props.dete ? new Date(props.dete) : new Date(),
|
||||
'yyyy-mm-dd'
|
||||
)
|
||||
const calendars = ref(null)
|
||||
const shoreInfo = ref({})
|
||||
const userStore = useUserStore()
|
||||
|
||||
const userInfo = computed(() => userStore.userInfo || {})
|
||||
const store = computed(() => userInfo.value.store)
|
||||
|
||||
const form = reactive({
|
||||
date: endDate,
|
||||
items: [],
|
||||
new_customers: '',
|
||||
sales: '',
|
||||
expenditure: '',
|
||||
handover_amount: '',
|
||||
photos: [],
|
||||
})
|
||||
|
||||
const offsetTop = computed(() => {
|
||||
return sys().statusBarHeight
|
||||
})
|
||||
|
||||
const showDateSelect = () => {
|
||||
calendars.value.open()
|
||||
hideKeyboard()
|
||||
}
|
||||
|
||||
const calendarsConfirm = (e) => {
|
||||
form.date = e.fulldate
|
||||
getData()
|
||||
}
|
||||
const storeChange = (e) => {
|
||||
shoreInfo.value = e
|
||||
getData()
|
||||
}
|
||||
|
||||
const hideKeyboard = () => {
|
||||
uni.hideKeyboard()
|
||||
}
|
||||
|
||||
const getData = async () => {
|
||||
const resData = await http.get(`/ledgers/${form.date}`, {
|
||||
params: {
|
||||
...shoreInfo.value,
|
||||
},
|
||||
})
|
||||
|
||||
Object.assign(form, resData, {
|
||||
photos:
|
||||
resData?.photos?.map((item) => {
|
||||
return { url: item }
|
||||
}) || [],
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
|
@ -366,7 +366,11 @@ const onSubmit = async () => {
|
|||
}
|
||||
|
||||
const getData = async () => {
|
||||
const resData = await http.get(`/ledgers/${form.date}`)
|
||||
const resData = await http.get(`/ledgers/${form.date}`, {
|
||||
params: {
|
||||
store_id: store.value?.id,
|
||||
},
|
||||
})
|
||||
|
||||
Object.assign(form, resData, {
|
||||
photos:
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
<template>
|
||||
<view>
|
||||
<Base/>
|
||||
<Admin v-if="checkPermission(['admin'])"></Admin>
|
||||
<Base v-else/>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import checkPermission from '@/utils/permission'
|
||||
import Base from './base.vue'
|
||||
import Admin from './admin.vue'
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -26,12 +26,12 @@
|
|||
</view>
|
||||
|
||||
<view class="grid grid-cols-2 my-20rpx table1">
|
||||
<view class="text-center flex-1 tr" @click="openLogPopup(0)">
|
||||
<view class="text-center flex-1 tr" @click="openLogPopup('sales')">
|
||||
<view class="flex-center h-60rpx text-28rpx">销售金额</view>
|
||||
<view class="font-600 flex-center h-60rpx">{{ ledger.sales }}</view>
|
||||
</view>
|
||||
|
||||
<view class="text-center flex-1 tr" @click="openLogPopup(0)">
|
||||
<view class="text-center flex-1 tr" @click="openLogPopup('expenditure')">
|
||||
<view
|
||||
class="flex-center h-60rpx"
|
||||
v-if="isLotteryStore || checkPermission(['admin'])"
|
||||
|
|
@ -96,10 +96,10 @@
|
|||
<view class="text-center">明细</view>
|
||||
<view class="text-center">金额</view>
|
||||
</view>
|
||||
<scroll-view scroll-y class="min-h-200rpx max-h-800rpx">
|
||||
<view v-for="item in 13" :key="item" class="grid grid-cols-2 py-16rpx text-28rpx">
|
||||
<view class="text-center">体彩</view>
|
||||
<view class="text-center">{{item}}</view>
|
||||
<scroll-view scroll-y class="min-h-200rpx max-h-1100rpx">
|
||||
<view v-for="(item,i) in lottery_types" :key="i" class="grid grid-cols-2 py-16rpx text-28rpx">
|
||||
<view class="text-center">{{item.name}}</view>
|
||||
<view class="text-center">{{item[activeName]}}</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
|
@ -190,9 +190,11 @@ const ledger = ref({
|
|||
expenditure: '0',
|
||||
sales: '0',
|
||||
sales_growth_rate: '0',
|
||||
lottery_types:[]
|
||||
})
|
||||
|
||||
const activeName = ref('area')
|
||||
const activeName = ref('lottery_types')
|
||||
const lottery_types = computed(()=> ledger.value?.lottery_types || [])
|
||||
|
||||
onShow(() => {
|
||||
getCount()
|
||||
|
|
@ -204,7 +206,9 @@ onReady(() => {
|
|||
})
|
||||
|
||||
const openLogPopup = (type) => {
|
||||
logPopup.value.open()
|
||||
activeName.value = type
|
||||
if(checkPermission(['admin']) || isLotteryStore.value) logPopup.value.open()
|
||||
|
||||
}
|
||||
const confirm = ({ range }) => {
|
||||
isCalendar.value = true
|
||||
|
|
|
|||
Loading…
Reference in New Issue