main
wwl 2023-12-20 09:22:54 +08:00
parent bc9febdb00
commit 04ae0ac5fb
5 changed files with 96 additions and 72 deletions

View File

@ -94,20 +94,19 @@ import Order from '../order/index.vue'
const { $Router, $api, $store } = getCurrentInstance().proxy
const userRole = computed(() => $store.user.userInfo.roleName ?? 'simple')
const searchVal = ref('')
const swiperList = ref([
{
images: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
title: '昨夜西风凋碧树'
},
{
images: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
title: '行色匆匆'
},
{
images: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
title: '更上一层楼'
}
])
const swiperList = ref([])
// {
// images: 'https://cdn.uviewui.com/uview/swiper/1.jpg',
// title: '西'
// },
// {
// images: 'https://cdn.uviewui.com/uview/swiper/2.jpg',
// title: ''
// },
// {
// images: 'https://cdn.uviewui.com/uview/swiper/3.jpg',
// title: ''
// }
// 线
const gridList = ref([
{

View File

@ -298,7 +298,10 @@ onShow(() => {
confirmColor: '#FF8CA6'
})
.then(() => {
$Router.push('/personal')
// $Router.push('/personal')
$store.user.login().then((user) => {
$store.user.setUserInfo(user)
})
})
.catch(() => '')
return

View File

@ -94,21 +94,22 @@
<view
v-for="item in cashItemList"
:key="item.key"
class="bg-#f2f2f2 rounded-15rpx h-80rpx border-b"
class="bg-#f2f2f2 rounded-15rpx h-80rpx overflow-hidden"
>
<u-input
:customStyle="{ height: '80rpx' }"
v-model="cashModel[item.key]"
:type="item.key === 'price' ? 'number' : 'text'"
:placeholder="`请输入${item.text}`"
:border="item.key !== 'price' ? 'bottom' : 'none'"
:placeholder="`请输入${item.key ==='wxNumber' ? '收款账户' : item.text}`"
fontSize="28rpx"
border="bottom"
:focus="false"
>
<!-- :border="item.key !== 'price' ? 'bottom' : 'none'" -->
<template #prefix>
<u-text
:text="item.text"
margin="0 5px 0 0"
:margin="item.key ==='price' ? '0 5px':'0 5px 0 0'"
type="tips"
color="#000000"
></u-text>
@ -200,15 +201,15 @@ const cashItemList = [
val: ''
},
{
text: '微信号',
text: '收款账户',
key: 'wxNumber',
val: ''
},
{
text: '支付宝号',
key: 'aliNumber',
val: ''
},
// {
// text: '',
// key: 'aliNumber',
// val: ''
// },
{
text: '金额',
key: 'price',
@ -267,21 +268,22 @@ const handleWithdraw = async () => {
if (!cashModel.value.name.trim()) {
return $toast('请输入姓名!')
}
if (!cashModel.value.aliNumber?.trim() || !cashModel.value.wxNumber?.trim()) {
return $toast('请输入收款账号!')
}
if (cashModel.value.price > orderTodayIncome.value.cashPrice) {
return $toast('提现金额不能大于可提现余额!', { type: 'error' })
}
const res = await $api.cashSubmit(cashModel.value)
if (res.success) {
$toast('申请提现成功!', {
icon: 'success',
duration: 2000
}).then(() => {
showWithdraw.value = false
getOrderTodayIncome()
})
if (cashModel.value.aliNumber?.trim() || cashModel.value.wxNumber?.trim()) {
const res = await $api.cashSubmit(cashModel.value)
if (res.success) {
$toast('申请提现成功!', {
icon: 'success',
duration: 2000
}).then(() => {
showWithdraw.value = false
getOrderTodayIncome()
})
}
} else {
return $toast('请输入收款账号!')
}
}

View File

@ -1,32 +1,33 @@
<template>
<view>
<view
class="bg-#fff z-10 fixed top-0 left-0 right-0 flex items-center justify-between px-50rpx pt-20rpx pb-40rpx"
>
<z-paging
:ref="paging"
v-model="recordList"
@query="queryList"
:min-delay="300"
use-page-scroll
>
<template #top>
<view
@click="handleAll"
class="flex justify-center items-center w-150rpx h-64rpx rounded-36rpx"
:class="!isSelect ? 'bg-primary text-white' : 'bg-#f2f2f2 text-#000'"
class="flex items-center justify-between px-50rpx pt-20rpx pb-40rpx"
>
全部
<view
@click="handleAll"
class="flex justify-center items-center w-150rpx h-64rpx rounded-36rpx"
:class="!isSelect ? 'bg-primary text-white' : 'bg-#f2f2f2 text-#000'"
>
全部
</view>
<view
@click="datetimeShow = true"
class="flex justify-center items-center w-250rpx h-64rpx rounded-36rpx"
:class="isSelect ? 'bg-primary text-white' : 'bg-#f2f2f2 text-#000'"
>
{{ $u.timeFormat(datetime, 'yyyy-mm') }}
</view>
</view>
<view
@click="datetimeShow = true"
class="flex justify-center items-center w-250rpx h-64rpx rounded-36rpx"
:class="isSelect ? 'bg-primary text-white' : 'bg-#f2f2f2 text-#000'"
>
{{ $u.timeFormat(datetime, 'yyyy-mm') }}
</view>
</view>
</template>
<view class="px-34rpx relative mt-150rpx">
<!-- <z-paging
:ref="paging"
v-model="recordList"
@query="queryList"
:min-delay="300"
use-page-scroll
> -->
<view class="px-34rpx relative">
<view
class="flex justify-between pb-20rpx border-b-#E5E5E5 border-b-1px mb-20rpx"
v-for="item in recordList"
@ -47,7 +48,6 @@
color="#FF3939"
></u-text> -->
</view>
<!-- </z-paging> -->
</view>
<u-datetime-picker
@ -62,7 +62,7 @@
@close="datetimeShow = false"
closeOnClickOverlay
></u-datetime-picker>
</view>
</z-paging>
</template>
<script setup>

View File

@ -127,10 +127,12 @@
<script setup>
import { chooseImage } from '@uni-helper/uni-promises'
import { onShow } from '@dcloudio/uni-app'
const instance = getCurrentInstance()
const { $api, $toast, $store, $u, $dialog, $Router, $loading } = instance.proxy
const userInfo = computed(() => $store.user.userInfo)
const isLogin = computed(() => !!$store.user.token)
const agreed = ref(false)
const formRef = ref(null)
const formList = ref([])
@ -196,15 +198,15 @@ const formItems = [
trigger: 'blur'
}
},
{
label: '微信号',
placeholder: '请输入微信号',
key: 'wxNumber',
required: true,
type: 'string',
trigger: ['blur', 'change'],
message: '请输入微信号'
},
// {
// label: '',
// placeholder: '',
// key: 'wxNumber',
// required: true,
// type: 'string',
// trigger: ['blur', 'change'],
// message: ''
// },
{
label: '常驻地点',
placeholder: '请输入常驻地点',
@ -325,6 +327,24 @@ const handleSubmit = async () => {
})
}
onShow(() => {
if (!isLogin.value) {
$dialog('请先登录', {
showCancelButton: true,
confirmButtonText: '去登录',
cancelButtonText: '取消',
confirmColor: '#FF8CA6'
})
.then(() => {
$Router.push('/personal')
})
.catch(() => '')
return
} else {
init()
}
})
init()
</script>