资金流水完成

This commit is contained in:
itgaojian163 2025-05-19 16:31:06 +08:00
parent dca694bdb4
commit d3b680883d
5 changed files with 562 additions and 98 deletions

View File

@ -137,70 +137,146 @@ var phoneNum = function(str, startLength, endLength, replaceStr) {
return str;
}
return str.slice(0, startLength) + replaceStr + str.slice(str.length - endLength);
}
var repairStatusColor = function(status) {
var color = 'repair-status-yellow'
switch (status) {
case 'PENDING':
color = 'repair-status-yellow'
break
case 'APPROVED':
color = 'repair-status-green'
break
case 'REJECTED':
color = 'repair-status-red'
break
case 'CANCELED':
color = 'repair-status-gray'
break
}
return color
}
var repairStatus = function(status) {
var str = '待审核'
switch (status) {
case 'PENDING':
str = '待审核'
break
case 'APPROVED':
str = '已通过'
break
case 'REJECTED':
str = '未通过'
break
case 'CANCELED':
str = '已取消'
break
}
return str
}
var repairType = function(type) {
var str = '未知'
switch (type) {
case 'CORRECTION1':
str = '一次补正'
break
case 'CORRECTION2':
str = '二次补正'
break
}
return str
}
var repairKind = function(kind) {
var str = '未知'
switch (kind) {
case 'CODE':
str = '代码'
break
case 'MANUAL':
str = '操作手册'
break
case 'ALL':
str = '代码+操作手册'
break
}
return str
}
var payType = function(type) {
// 充值1|支出2|提现3|系统扣款4|订单收入5|付款6)
var typeStr = '支出'
switch (type) {
case 1:
typeStr = '充值'
break
case 2:
typeStr = '支出'
break
case 3:
typeStr = '提现'
break
case 4:
typeStr = '系统\n扣款'
break
case 5:
typeStr = '订单\n收入'
break
case 6:
typeStr = '付款'
break
}
return typeStr
}
var payTypeColor = function(type) {
var typeColr = 'type-g'
switch (type) {
case 1:
case 3:
case 5:
typeColr = 'type-g'
break
case 2:
case 4:
case 6:
typeColr = 'type-z'
break
}
return typeColr
}
var repairStatusColor = function (status) {
var color = 'repair-status-yellow'
switch (status) {
case 'PENDING':
color = 'repair-status-yellow'
break
case 'APPROVED':
color = 'repair-status-green'
break
case 'REJECTED':
color = 'repair-status-red'
break
case 'CANCELED':
color = 'repair-status-gray'
break
}
return color
}
var repairStatus = function (status) {
var str = '待审核'
switch (status) {
case 'PENDING':
str = '待审核'
break
case 'APPROVED':
str = '已通过'
break
case 'REJECTED':
str = '未通过'
break
case 'CANCELED':
str = '已取消'
break
}
return str
}
var repairType = function (type) {
var str = '未知'
// 充值1|支出2|提现3|系统扣款4|订单收入5|付款6)
var payTypeFontSize = function (type) {
var fSize = 'size-32'
switch (type) {
case 'CORRECTION1':
str = '一次补正'
case 1:
case 2:
case 3:
case 6:
fSize = 'size-32'
break
case 'CORRECTION2':
str = '二次补正'
case 4:
case 5:
fSize = 'size-24'
break
}
return str
return fSize
}
var repairKind = function (kind) {
var str = '未知'
switch (kind) {
case 'CODE':
str = '代码'
var payTypeSign = function (type) {
var typeStr = '-'
switch (type) {
case 1:
case 5:
typeStr = '+'
break
case 'MANUAL':
str = '操作手册'
break
case 'ALL':
str = '代码+操作手册'
case 2:
case 3:
case 4:
case 6:
typeStr = '-'
break
}
return str
return typeStr
}
export {
isEmpty,
@ -212,9 +288,13 @@ export {
timeSplit,
objIsEmpty,
moneyTxt,
phoneNum,
repairStatusColor,
repairKind,
repairType,
repairStatus
phoneNum,
repairStatusColor,
repairKind,
repairType,
repairStatus,
payTypeColor,
payType,
payTypeFontSize,
payTypeSign
}

View File

@ -133,6 +133,13 @@
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
},
{
"path": "pages/mine/mineAccount/minePayRecord/minePayRecord",
"style": {
"navigationBarTitleText": "",
"enablePullDownRefresh": true
}
}
],
"globalStyle": {

View File

@ -1,5 +1,5 @@
<template>
<view class="body-container">
<view class="page-container">
<view class="search-box">
<view class="search-container">
<view class="search-input-icon"></view>
@ -8,7 +8,7 @@
<view v-if="keywords !=''" @click="clearSearch" class="icon-clear" style="width: 20px;height: 20px;">
</view>
</view>
<view class="add-btn" @click="showCreateDialog">创建联系人</view>
<view class="add-btn" @click="showCreateDialog">创建</view>
</view>
<ContainerLoading :loadingVisible="loadingState" style="height: 83vh;margin-top: 30rpx;"
@doRefresh="doRefreshList">
@ -24,8 +24,11 @@
</view>
<view>{{item.phone}}</view>
<view class="options-box">
<view class="edit" @click="showEditDialog" :data-value="item">编辑</view>
<view class="del" @click="showDelDialog" :data-value="item">删除</view>
<view class="icon-edit-blue size-48 mr-10" @click="showEditDialog"
:data-value="item">
</view>
<view class="icon-del-red size-48" @click="showDelDialog" :data-value="item">
</view>
</view>
</view>
<view class="service-desc ml-10">{{item.company}}</view>
@ -45,30 +48,30 @@
</uni-popup>
<!-- 创建或编辑弹窗 :is-mask-click="false" -->
<uni-popup ref="popup" type="bottom" background-color="#fff" border-radius="15rpx 15rpx 0rpx 0rpx">
<view class="bottom-dialog-box">
<view class="bottom-title-box">
<view class="icon-close close-icon" @click="closePopup"></view>
<view class="bottom-title-txt">{{title}}</view>
<view class="bottom-dialog-container">
<view class="dialog-title-box">
<view class="icon-close size-48" @click="closePopup"></view>
<view class="dialog-title-txt has-icon">{{title}}</view>
</view>
<view class="form-box">
<view class="form-item">
<view class="form-item-title">姓名</view>
<text class="form-item-title star">&emsp;&emsp;</text>
<input adjust-position :cursor-spacing="50" type="text" confirm-type="next" :value="contactName"
placeholder="请输入姓名" class="form-item-content" @input="inputContactName" />
</view>
<view class="form-item">
<view class="form-item-title">联系电话</view>
<text class="form-item-title star">联系电话</text>
<input adjust-position :cursor-spacing="50" :value="contactPhone" placeholder="请输入联系电话"
class="form-item-content" @input="inputContactPhone" />
</view>
<view class="form-item">
<view class="form-item-title no-after" style="padding-left: 16rpx;">联系邮箱</view>
<view class="form-item-title">联系邮箱</view>
<input adjust-position :cursor-spacing="50" type="text" confirm-type="next"
:value="contactEmail" placeholder="请输入联系邮箱" class="form-item-content"
@input="inputContactEmail" />
</view>
<view class="form-item">
<view class="form-item-title no-after" style="padding-left: 16rpx;">公司</view>
<text class="form-item-title">&emsp;&emsp;</text>
<input adjust-position :cursor-spacing="50" type="text" confirm-type="next"
:value="contactCompany" placeholder="请输入公司名称" class="form-item-content"
@input="inputContactCompany" />
@ -431,8 +434,9 @@
.search-input {
box-sizing: border-box;
color: rgba(16, 16, 16, 1);
font-size: 14px;
color: $text-color;
font-size: 28rpx;
align-self: center;
text-align: center;
flex: 1;
}
@ -449,17 +453,18 @@
.add-btn {
border-radius: 4px;
background-color: rgba(50, 112, 255, 1);
color: rgba(255, 255, 255, 1);
font-size: 14px;
background-color: $btn-green-color;
color: $white-color;
font-size: 24rpx;
line-height: 28rpx;
height: 28rpx;
align-self: center;
padding: 15rpx 15rpx;
text-align: center;
text-align: center;
font-family: PingFangSC-regular;
padding: 5px 10px;
}
.add-btn:active {
background-color: rgba(50, 112, 255, .7);
background-color: $btn-green-color-active;
}
.content-container {
@ -478,8 +483,7 @@
display: flex;
flex-direction: column;
background-color: white;
border-radius: 10px;
width: 94vw;
border-radius: 15rpx;
}
.order-item:nth-of-type(n+2) {
@ -562,7 +566,6 @@
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
font-size: 14px;
margin-top: 30rpx;
}
@ -572,30 +575,25 @@
flex-direction: row;
justify-content: flex-start;
align-items: center;
width: 80vw;
padding: 10px;
}
.form-item-title {
flex: .3;
font-size: 14px;
font-size: 28rpx;
color: black;
font-weight: 500;
text-align: left;
}
.form-item-title:not(.no-after)::before {
content: "*";
color: red;
font-size: 14px;
margin-left: 1px;
text-align: center;
}
.form-item-content {
flex: 1;
flex: .7;
text-align: right;
font-size: 14px;
font-size: 28rpx;
border: 10rpx;
padding: 10rpx;
background-color: $bg-gray-input-color;
}
.confirm-btn {
@ -603,7 +601,7 @@
height: 80rpx;
line-height: 80rpx;
border-radius: 4rpx;
background-color: rgba(7, 193, 96, 1);
background-color: $btn-green-color;
color: rgba(255, 255, 255, 1);
font-size: 32rpx;
text-align: center;
@ -613,6 +611,6 @@
}
.confirm-btn:active {
background-color: rgba(7, 193, 96, 0.5);
background-color: $btn-green-color-active;
}
</style>

View File

@ -1,5 +1,5 @@
<template>
<view class="body-container">
<view class="page-container">
<view class="search-box">
<view class="search-container">
<input class="search-input" :value="keywords" @input="inputKeywords" @confirm="doSearchKeyWord"
@ -157,7 +157,7 @@
_self.isLoadMore = true
_self.loadMore = 'loading'
_self.pageData.page = ++_self.pageData.page
_self.keywords = _self.keywords
_self.pageData.keywords = _self.keywords
_self.doGetMineOrderList(false)
},
}

View File

@ -0,0 +1,379 @@
<template>
<view class="page-container">
<view class="search-box">
<view class="search-container">
<input class="search-input" :value="keywords" @input="inputKeywords" @confirm="doSearchKeyWord"
type="text" confirm-type="search" placeholder="搜索" />
<view v-if="keywords !=''" @click="clearSearch" class="icon-clear icon-position"></view>
</view>
<view class="search-time-box mt-20">
<view class="search-time-item">
<uni-datetime-picker type="date" @change="selectStartDate" v-model="startDate">
<view>{{startDate==''?'请选择开始时间':startDate}}</view>
</uni-datetime-picker>
<view v-if="startDate==''" class="icon-arrow-solid size-16"></view>
<view v-else class="icon-clear size-32" @click="clearStart"></view>
</view>
<view class="search-time-item ml-20">
<uni-datetime-picker type="date" @change="selectEndDate" v-model="endDate">
<view>{{endDate==''?'请选择结束时间':endDate}}</view>
</uni-datetime-picker>
<view v-if="endDate ==''" class="icon-arrow-solid size-16"></view>
<view v-else class="icon-clear size-32" @click="clearEnd"></view>
</view>
</view>
</view>
<ContainerLoading :loadingVisible="loadingState" style="height: 79vh;margin-top: 30rpx;"
@doRefresh="doRefreshList">
<scroll-view scroll-y style="height: 79vh;" :lower-threshold="100" refresher-background="#FFFFFF00"
@scrolltolower="doLoadMore">
<view class="order-box">
<block v-for="(item,index) in recordList" :key="index">
<view class="order-item">
<view class="record-title-box">
<view class="record-title-type-box">
<text
:class="['record-title-type',payTypeColor(item.type)]">{{payType(item.type)}}</text>
<view class="record-title-order-box" v-if="item.orderId != ''">
<view class="record-title-order-type">{{appTitle}}</view>
<view class="record-title-order-num">{{item.orderId}}</view>
</view>
</view>
<view class="record-money">
<view
style="display: flex;flex-direction: row;align-items: center;justify-content: center;">
{{payTypeSign(item.type)}} {{item.accountMoney/100}}
</view>
<view class="money">{{item.accountAfterMoney/100}}</view>
</view>
</view>
<view class="record-desc">{{item.description}}</view>
<view class="record-bottom-box">
<view class="record-before">交易前余额<text
style="padding-left: 15rpx;color: black;font-weight: bold;">{{item.accountBeforeMoney/100}}</text>
</view>
<view class="record-date">{{item.gmtCreate}}</view>
</view>
</view>
</block>
<uni-load-more :status="hasMore"></uni-load-more>
</view>
</scroll-view>
</ContainerLoading>
</view>
</template>
<script>
import ContainerLoading from '@/components/container-loading.vue'
import UserApi from '@/common/js/net/UserApi.js'
import {
payTypeColor,
payType,
payTypeSign
} from '@/common/js/conver.js'
import {
inject,
isReactive
} from 'vue';
export default {
components: {
ContainerLoading
},
setup() {
const globalData = inject('globalData')
return {
globalData
}
},
data() {
return {
recordList: [], //
appTitle: this.globalData.appTitle,
pageData: {
page: 1,
rows: 10,
keywords: '',
startTime: '',
endTime: ''
}, //
loadingState: 'loading', //
listRefreshTrig: false, //list
isLoadMore: false, //
hasMore: 'more', //
keywords: '', //
startDate: '',
endDate: ''
};
},
onLoad(options) {
uni.setNavigationBarTitle({
title: "资金流水",
});
uni.setNavigationBarColor({
frontColor: "#000000",
backgroundColor: "#F0F0F0",
animation: {
duration: 500,
timingFunc: "easeIn",
},
});
this.doRefreshList()
},
methods: {
payTypeColor,
payType,
payTypeSign,
inputKeywords(e) {
this.keywords = e.detail.value
},
doSearchKeyWord() {
this.doRefreshList()
},
clearSearch() {
this.keywords = ''
this.doRefreshList()
},
selectStartDate(e) {
console.log('开始时间', e)
this.startDate = e
this.doRefreshList()
},
selectEndDate(e) {
console.log('结束时间', e)
this.endDate = e
this.doRefreshList()
},
clearStart() {
this.startDate = ''
this.doRefreshList()
},
clearEnd() {
this.endDate = ''
this.doRefreshList()
},
doRefreshList() {
console.log('正在刷新...')
const _self = this
_self.loadingState = 'loading'
_self.hasMore = 'more'
_self.pageData.page = 1
_self.pageData.keywords = _self.keywords
_self.pageData.startTime = _self.startDate
_self.pageData.endTime = _self.endDate
_self.isLoadMore = false
_self.doGetMinePayRecord(true)
},
doLoadMore() {
//
const _self = this
if (_self.isLoadMore || _self.hasMore == 'noMore') {
return
}
_self.isLoadMore = true
_self.pageData.page = ++_self.pageData.page
_self.pageData.keywords = _self.keywords
_self.pageData.startTime = _self.startDate
_self.pageData.endTime = _self.endDate
_self.doGetMinePayRecord(false)
},
//
doGetMinePayRecord(isRefresh) {
const _self = this
_self.recordList = isRefresh ? [] : _self.recordList
_self.loadingState = isRefresh ? 'loading' : ''
UserApi.doGetMinePayRecord(_self.pageData)
.then(res => {
var status = 'success'
status = res.rows && res.rows.length > 0 ? 'success' : 'empty'
_self.loadingState = isRefresh ? status : ''
_self.recordList = _self.recordList.concat(res.rows)
_self.isLoadMore = false
_self.hasMore = _self.recordList.length < res.total ? 'more' : 'noMore'
})
.catch(err => {
_self.loadingState = 'error'
_self.isLoadMore = false
_self.hasMore = 'more'
})
},
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
}
};
</script>
<style lang="scss" scoped>
.order-box {
display: flex;
flex-direction: column;
justify-content: center;
padding-bottom: 30px;
}
.order-item {
display: flex;
flex-direction: column;
flex-grow: 1;
border-radius: 15rpx;
padding: 20rpx;
background-color: $white-color;
}
.order-item:nth-of-type(n+1) {
margin-top: 15px;
padding-bottom: 34rpx;
border-bottom: 1rpx solid $divider-color;
}
.record-title-box {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.record-title-type-box {
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
}
.record-title-type {
width: 112rpx;
height: 112rpx;
display: flex;
border-radius: 56rpx;
align-items: center;
justify-content: center;
text-align: center;
font-weight: bold;
color: white;
white-space: pre-wrap;
font-size: 33rpx;
}
.type-z {
background-color: $text-blue-color;
}
.type-g {
background-color: $green-color-light;
}
.record-title-order-box {
display: flex;
flex-direction: column;
margin-left: 10rpx;
}
.record-title-order-type {
color: $text-color;
font-size: 28rpx;
text-align: left;
font-family: PingFangSC-regular;
}
.record-title-order-num {
color: $text-gray-hint-color;
font-size: 24rpx;
text-align: left;
font-family: PingFangSC-light;
}
.record-desc {
margin-top: 22rpx;
padding: 20rpx 30rpx;
font-size: 24rpx;
border-radius: 10rpx;
min-height: 60rpx;
color: $text-gray-desc-color;
border-radius: 14rpx;
background-color: rgba(242, 242, 242, 1);
}
.record-bottom-box {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: 34rpx;
}
.money {
color: $text-brown-color;
font-size: 32rpx;
text-align: center;
padding-bottom: 15rpx;
}
.record-before {
color: $text-color;
font-size: 28rpx;
text-align: left;
font-family: PingFangSC-regular;
}
.record-date {
color: $text-color;
font-size: 28rpx;
text-align: left;
font-family: PingFangSC-regular;
}
.search-box {
display: flex;
flex-direction: column;
justify-content: center;
}
.search-container {
position: relative;
align-self: center;
border-radius: 5rpx;
background-color: $white-color;
padding: 5px;
display: flex;
flex-direction: row;
width: 100%;
}
.search-input {
width: 100%;
box-sizing: border-box;
color: $text-color;
font-size: 28rpx;
text-align: center;
}
.search-input::after {
content: '';
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
width: 20px;
height: 20px;
margin-top: -1px;
background-size: cover;
background-image: url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSI2NCA2NCA4OTYgODk2IiB3aWR0aD0iMTQiIGhlaWdodD0iMTkiIHN0eWxlPSIiIGZpbHRlcj0ibm9uZSI+CiAgICAKICAgIDxnPgogICAgPHBhdGggZD0iTTkwOS42IDg1NC41TDY0OS45IDU5NC44QzY5MC4yIDU0Mi43IDcxMiA0NzkgNzEyIDQxMmMwLTgwLjItMzEuMy0xNTUuNC04Ny45LTIxMi4xLTU2LjYtNTYuNy0xMzItODcuOS0yMTIuMS04Ny45cy0xNTUuNSAzMS4zLTIxMi4xIDg3LjlDMTQzLjIgMjU2LjUgMTEyIDMzMS44IDExMiA0MTJjMCA4MC4xIDMxLjMgMTU1LjUgODcuOSAyMTIuMUMyNTYuNSA2ODAuOCAzMzEuOCA3MTIgNDEyIDcxMmM2NyAwIDEzMC42LTIxLjggMTgyLjctNjJsMjU5LjcgMjU5LjZhOC4yIDguMiAwIDAgMCAxMS42IDBsNDMuNi00My41YTguMiA4LjIgMCAwIDAgMC0xMS42ek01NzAuNCA1NzAuNEM1MjggNjEyLjcgNDcxLjggNjM2IDQxMiA2MzZzLTExNi0yMy4zLTE1OC40LTY1LjZDMjExLjMgNTI4IDE4OCA0NzEuOCAxODggNDEyczIzLjMtMTE2LjEgNjUuNi0xNTguNEMyOTYgMjExLjMgMzUyLjIgMTg4IDQxMiAxODhzMTE2LjEgMjMuMiAxNTguNCA2NS42UzYzNiAzNTIuMiA2MzYgNDEycy0yMy4zIDExNi4xLTY1LjYgMTU4LjR6IiBmaWxsPSJyZ2JhKDIwNCwyMDQsMjA0LDEpIj48L3BhdGg+CiAgICA8L2c+CiAgPC9zdmc+');
}
.search-time-box {
display: flex;
flex-direction: row;
}
.search-time-item {
flex: 1;
display: flex;
flex-direction: row;
justify-content: space-between;
font-size: 28rpx;
align-items: center;
padding: 15rpx 0rpx;
}
</style>