fix: 新功能增加,原有bug修复。

This commit is contained in:
tianyongbao
2024-06-21 20:30:02 +08:00
parent 7ce6161b01
commit c8b5697264
36 changed files with 5178 additions and 516 deletions

View File

@@ -1,208 +0,0 @@
<template>
<view class="normal-login-container">
<view class="logo-content align-center justify-center flex">
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
</image>
<text class="title">智聪科技记账平台登录</text>
</view>
<view class="login-form-content">
<view class="input-item flex align-center">
<view class="iconfont icon-user icon"></view>
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
</view>
<view class="input-item flex align-center">
<view class="iconfont icon-password icon"></view>
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
</view>
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
<view class="iconfont icon-code icon"></view>
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
<view class="login-code">
<image :src="codeUrl" @click="getCode" class="login-code-img"></image>
</view>
</view>
<view class="action-btn">
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
</view>
</view>
<view class="xieyi text-center">
<text class="text-grey1">登录即代表同意</text>
<text @click="handleUserAgrement" class="text-blue">用户协议</text>
<text @click="handlePrivacy" class="text-blue">隐私协议</text>
</view>
</view>
</template>
<script setup>
import modal from '@/plugins/modal'
import { getCodeImg } from '@/api/login'
import { ref } from "vue";
import config from '@/config.js'
import useUserStore from '@/store/modules/user'
import { getWxCode } from '@/utils/geek';
import { wxLogin } from '@/api/oauth';
import { setToken } from '@/utils/auth';
const userStore = useUserStore()
const codeUrl = ref("");
const captchaEnabled = ref(true); // 是否开启验证码
const useWxLogin = ref(false); // 是否使用微信登录
const globalConfig = ref(config);
const loginForm = ref({
username: "admin",
password: "admin123",
code: "",
uuid: ''
});
if (useWxLogin.value) {
getWxCode().then(res => {
console.log(res);
wxLogin('miniapp',res).then(res => {
if(res.token != null){
setToken(res.token);
loginSuccess()
}
});
})
}
// 获取图形验证码
function getCode() {
getCodeImg().then(res => {
captchaEnabled.value = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (captchaEnabled.value) {
codeUrl.value = 'data:image/gif;base64,' + res.img
loginForm.value.uuid = res.uuid
}
})
};
async function handleLogin() {
if (loginForm.value.username === "") {
modal.msgError("请输入您的账号")
} else if (loginForm.value.password === "") {
modal.msgError("请输入您的密码")
} else if (loginForm.value.code === "" && captchaEnabled.value) {
modal.msgError("请输入验证码")
} else {
modal.loading("登录中,请耐心等待...")
pwdLogin()
}
};
// 密码登录
async function pwdLogin() {
userStore.login(loginForm.value).then(() => {
modal.closeLoading()
loginSuccess()
}).catch(() => {
if (captchaEnabled.value) {
modal.closeLoading()
getCode()
}
})
};
function loginSuccess(result) {
// 设置用户信息
userStore.getInfo().then(res => {
uni.switchTab({
url: '/pages/index'
});
})
}
// 隐私协议
function handlePrivacy() {
let site = globalConfig.value.appInfo.agreements[0];
uni.navigateTo({
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
});
};
// 用户协议
function handleUserAgrement() {
let site = globalConfig.value.appInfo.agreements[1]
uni.navigateTo({
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
});
};
getCode();
</script>
<style lang="scss">
page {
background-color: #ffffff;
}
.normal-login-container {
width: 100%;
.logo-content {
width: 100%;
font-size: 21px;
text-align: center;
padding-top: 15%;
image {
border-radius: 4px;
}
.title {
margin-left: 10px;
}
}
.login-form-content {
text-align: center;
margin: 20px auto;
margin-top: 15%;
width: 80%;
.input-item {
margin: 20px auto;
background-color: #f5f6f7;
height: 45px;
border-radius: 20px;
.icon {
font-size: 38rpx;
margin-left: 10px;
color: #999;
}
.input {
width: 100%;
font-size: 14px;
line-height: 20px;
text-align: left;
padding-left: 15px;
}
}
.login-btn {
margin-top: 40px;
height: 45px;
}
.xieyi {
color: #333;
margin-top: 20px;
}
.login-code {
height: 38px;
float: right;
.login-code-img {
height: 38px;
position: absolute;
margin-left: 10px;
width: 200rpx;
}
}
}
}
</style>

View File

@@ -0,0 +1,288 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="信用卡管理"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="信用卡名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写信用卡名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="信用卡卡号" prop="code" required >
<u--input v-model="form.code" placeholder="请填写信用卡卡号"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="信用卡额度" required prop="creditLimit" >
<u--input v-model="form.creditLimit" placeholder="请填写信用卡额度"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="账单日" required prop="billDate" >
<u--input v-model="form.billDate" placeholder="请填写账单日"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="还款日" required prop="payDate" >
<u--input v-model="form.payDate" placeholder="请填写还款日"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="信用卡安全码" prop="cvv" >
<u--input v-model="form.cvv" placeholder="请填写信用卡安全码"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户行" prop="openingBank" >
<u--input v-model="form.openingBank" placeholder="请填写开户行"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户日期" prop="activationDate" @click="selectDate(1)">
<u--input v-model="form.activationDate" disabled disabledColor="#ffffff" placeholder="请选择开户日期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="宽限期" prop="delayPeriod" >
<u--input v-model="form.delayPeriod" placeholder="请填写宽限期"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="有效期" prop="effectiveDate" @click="selectDate(2)">
<u--input v-model="form.effectiveDate" disabled disabledColor="#ffffff" placeholder="请选择有效期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="账单日消费" prop="isNextBillDateName" @click="handleShowIsNextBillDate">
<u--input v-model="form.isNextBillDateName" disabled disabledColor="#ffffff" placeholder="请选择账单日消费"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="账单日时间" prop="nextBillDateTime" >
<u--input v-model="form.nextBillDateTime" placeholder="请填写账单日时间"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="0账单操作" prop="isZeroBillName" @click="handleShowIsZeroBill">
<u--input v-model="form.isZeroBillName" disabled disabledColor="#ffffff" placeholder="请选择0账单操作"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showIsNextBillDate" :columns="isNextBillDateList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-picker itemHeight="88" :show="showIsZeroBill" :columns="isZeroBillList" keyName="dictLabel" @cancel="handleIsZeroBillCancel"
@confirm="handleIsZeroBillConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
</view>
</template>
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showIsNextBillDate = ref(false)
const showIsZeroBill = ref(false)
const title = ref("信用卡管理")
const isNextBillDateList = ref([])
const isZeroBillList = ref([])
const dateType = ref(1)
const data = reactive({
form: {
id: null,
name: null,
type: '2',
code: null,
openingBank: null,
activationDate: null,
billDate: null,
payDate: null,
delayPeriod: null,
creditLimit: null,
effectiveDate: null,
cvv: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
debitType: null,
isNextBillDate: null,
nextBillDateTime: null,
isZeroBill: null
},
// dateType:'1',
rules: {
name: [{ type: 'string', required: true, message: '信用卡名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '信用卡卡号不能为空', trigger: ['change', 'blur'] }],
billDate: [{ type: 'int', required: true, message: '账单日不能为空', trigger: ['change', 'blur'] }],
payDate: [{ type: 'int', required: true, message: '还款日不能为空', trigger: ['change', 'blur'] }],
creditLimit: [{ type: 'int', required: true, message: '信用卡额度不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="信用卡管理-修改"
}else{
title.value="信用卡管理-新增"
}
getDict()
})
onReady(() => {
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 类型
getDicts('is_next_bill_date').then(res => {
isNextBillDateList.value =[res.data]
})
// 类型
getDicts('is_zero_bill').then(res => {
isZeroBillList.value =[res.data]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
// 类型
getDicts('is_next_bill_date').then(result => {
form.value.isNextBillDateName=dictStr(form.value.isNextBillDate, result.data)
})
// 类型
getDicts('is_zero_bill').then(result => {
form.value.isZeroBillName=dictStr(form.value.isZeroBill, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowIsNextBillDate() {
if (isNextBillDateList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '账单日消费为空 ', type: 'warning'
})
} else {
showIsNextBillDate.value = true
}
}
function handleConfirm(e) {
form.value.isNextBillDateName = e.value[0].dictLabel
form.value.isNextBillDate = e.value[0].dictValue
showIsNextBillDate.value = false
}
function handleCancel() {
showIsNextBillDate.value = false
}
function handleShowIsZeroBill() {
if (isZeroBillList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '0账单操作为空 ', type: 'warning'
})
} else {
showIsZeroBill.value = true
}
}
function handleIsZeroBillConfirm(e) {
form.value.isZeroBillName = e.value[0].dictLabel
form.value.isZeroBill = e.value[0].dictValue
showIsZeroBill.value = false
}
function handleIsZeroBillCancel() {
showIsZeroBill.value = false
}
function selectDate(type) {
dateType.value=type
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
if(dateType.value===1){
form.value.activationDate = dayjs(e.value).format("YYYY-MM-DD")
}
if(dateType.value===2){
form.value.effectiveDate = dayjs(e.value).format("YYYY-MM-DD")
}
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/base/creditCard/list` })
}
})
})
}else {
addBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/base/creditCard/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,104 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="信用卡详情"
>
</u-navbar>
<view class="section">
<u-cell-group>
<u-cell title="信用卡名称:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
<u-cell title="信用卡卡号:" titleStyle="font-weight:bolder" :value="detailInfo.code"></u-cell>
<u-cell title="信用卡额度:" titleStyle="font-weight:bolder" :value="detailInfo.creditLimit"></u-cell>
<u-cell title="开户日期:" titleStyle="font-weight:bolder" center :value="detailInfo.activationDate"> </u-cell>
<u-cell title="开户行:" titleStyle="font-weight:bolder" :value="detailInfo.openingBank"></u-cell>
<u-cell title="有效期:" titleStyle="font-weight:bolder" :value="detailInfo.effectiveDate"></u-cell>
<u-cell title="账单日:" titleStyle="font-weight:bolder" :value="detailInfo.billDateName"></u-cell>
<u-cell title="还款日:" titleStyle="font-weight:bolder" :value="detailInfo.payDateName"></u-cell>
<u-cell title="账单日消费:" titleStyle="font-weight:bolder" :value="detailInfo.isNextBillDate"></u-cell>
<u-cell title="0账单操作:" titleStyle="font-weight:bolder" :value="detailInfo.isZeroBill"></u-cell>
<u-cell title="延缓期限:" titleStyle="font-weight:bolder" :value="detailInfo.delayPeriod"></u-cell>
<u-cell title="备注:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
</u-cell-group>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script setup>
import { getBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref,computed }from "vue";
const id = ref('')
const data = reactive({
detailInfo: {}
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
id.value = option.id
getInfo()
})
function getInfo() {
getBankcardLend(id.value).then(res => {
detailInfo.value = res.data
// 类型
getDicts('is_next_bill_date').then(result => {
detailInfo.value.isNextBillDate=dictStr(detailInfo.value.isNextBillDate, result.data)
})
// 类型
getDicts('is_zero_bill').then(result => {
detailInfo.value.isZeroBill=dictStr(detailInfo.value.isZeroBill, result.data)
})
})
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 280rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.content {
width: 647rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: left;
}
.img-con {
display: flex;
flex-wrap: wrap;
gap: 20rpx
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,363 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入信用卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.name+'-'+item.code " size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">信用卡额度</text>
<text class="row-value">{{ item.creditLimit }}</text>
</view>
<view class="item-row">
<text class="row-label">账单日</text>
<text class="row-value">{{ item.billDateName }}</text>
</view>
<view class="item-row">
<text class="row-label">还款日</text>
<text class="row-value">{{ item.payDateName }}</text>
</view>
<view class="item-row">
<text class="row-label">延缓期限</text>
<text class="row-value">{{ item.delayPeriod }}</text>
</view>
<view class="item-row">
<text class="row-label">开户日期</text>
<text class="row-value">{{ item.activationDate }}</text>
</view>
<view class="item-row">
<text class="row-label">有效期</text>
<text class="row-value">{{ item.effectiveDate }}</text>
</view>
<view class="item-row">
<text class="row-label">账单日消费</text>
<text class="row-value">{{ dictStr(item.isNextBillDate, isNextBillDateList) }}</text>
</view>
<view class="item-row">
<text class="row-label">0账单操作</text>
<text class="row-value">{{ dictStr(item.isZeroBill, isZeroBillList) }}</text>
</view>
<view class="operate" >
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import { listBankcardLend,delBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const isNextBillDateList = ref([])
const isZeroBillList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: '2'
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listBankcardLend({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
// 类型
getDicts('is_next_bill_date').then(res => {
isNextBillDateList.value = res.data
})
// 类型
getDicts('is_zero_bill').then(res => {
isZeroBillList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.type = '2'
isNextBillDateList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/base/creditCard/details?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/base/creditCard/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/base/creditCard/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delBankcardLend(item.id)
uni.navigateTo({ url: `/pages/work/base/creditCard/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,224 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="储蓄卡管理"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="储蓄卡名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写储蓄卡名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="储蓄卡卡号" prop="code" required >
<u--input v-model="form.code" placeholder="请填写储蓄卡卡号"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="储蓄卡类型" prop="debitTypeName" required @click="handleShowTeam">
<u--input v-model="form.debitTypeName" disabled disabledColor="#ffffff" placeholder="请选择储蓄卡类型"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="开户行" prop="openingBank" >
<u--input v-model="form.openingBank" placeholder="请填写开户行"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="开户日期" prop="activationDate" @click="selectDate(1)">
<u--input v-model="form.activationDate" disabled disabledColor="#ffffff" placeholder="请选择开户日期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="有效期" prop="effectiveDate" @click="selectDate(2)">
<u--input v-model="form.effectiveDate" disabled disabledColor="#ffffff" placeholder="请选择有效期" inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-right"></u-icon>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="debitTypeList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
</view>
</template>
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const title = ref("储蓄卡管理")
const debitTypeList = ref([])
const dateType = ref(1)
const data = reactive({
form: {
id: null,
name: null,
type: '1',
code: null,
openingBank: null,
activationDate: null,
billDate: null,
payDate: null,
delayPeriod: null,
creditLimit: null,
effectiveDate: null,
cvv: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
debitType: null
},
// dateType:'1',
rules: {
name: [{ type: 'string', required: true, message: '储蓄卡名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '储蓄卡卡号不能为空', trigger: ['change', 'blur'] }],
debitTypeName: [{ type: 'string', required: true, message: '储蓄卡类型不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="储蓄卡管理-修改"
}else{
title.value="储蓄卡管理-新增"
}
getDict()
})
onReady(() => {
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 类型
getDicts('debit_type').then(res => {
debitTypeList.value =[res.data]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
// 类型
getDicts('debit_type').then(result => {
form.value.debitTypeName=dictStr(form.value.debitType, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowTeam() {
if (debitTypeList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '类型为空 ', type: 'warning'
})
} else {
showTeam.value = true
}
}
function handleConfirm(e) {
form.value.debitTypeName = e.value[0].dictLabel
form.value.debitType = e.value[0].dictValue
showTeam.value = false
}
function handleCancel() {
showTeam.value = false
}
function selectDate(type) {
dateType.value=type
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
if(dateType.value===1){
form.value.activationDate = dayjs(e.value).format("YYYY-MM-DD")
}
if(dateType.value===2){
form.value.effectiveDate = dayjs(e.value).format("YYYY-MM-DD")
}
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/base/debitCard/list` })
}
})
})
}else {
addBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/base/debitCard/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,94 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="储蓄卡详情"
>
</u-navbar>
<view class="section">
<u-cell-group>
<u-cell title="储蓄卡名称:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
<u-cell title="储蓄卡卡号:" titleStyle="font-weight:bolder" :value="detailInfo.code"></u-cell>
<u-cell title="储蓄卡类型:" titleStyle="font-weight:bolder" :value="detailInfo.debitType"></u-cell>
<u-cell title="开户行:" titleStyle="font-weight:bolder" :value="detailInfo.openingBank"></u-cell>
<u-cell title="开户日期:" titleStyle="font-weight:bolder" center :value="detailInfo.activationDate"> </u-cell>
<u-cell title="备注:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
</u-cell-group>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script setup>
import { getBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref,computed }from "vue";
const id = ref('')
const data = reactive({
detailInfo: {}
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
id.value = option.id
getInfo()
})
function getInfo() {
getBankcardLend(id.value).then(res => {
detailInfo.value = res.data
// 类型
getDicts('debit_type').then(result => {
detailInfo.value.debitType=dictStr(detailInfo.value.debitType, result.data)
})
})
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 280rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.content {
width: 647rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: left;
}
.img-con {
display: flex;
flex-wrap: wrap;
gap: 20rpx
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,381 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入储蓄卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">储蓄卡类型</view>
<view class="state-list">
<view v-for="item in debitTypeList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.name+'-'+item.code " size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">储蓄卡类型</text>
<text class="row-value">{{ dictStr(item.debitType, debitTypeList) }}</text>
</view>
<!-- <view class="item-row">
<text class="row-label">储蓄卡卡号</text>
<text class="row-value">{{ item.code }}</text>
</view> -->
<view class="item-row">
<text class="row-label">开户行</text>
<text class="row-value">{{ item.openingBank }}</text>
</view>
<view class="item-row">
<text class="row-label">开户日期</text>
<text class="row-value">{{ item.activationDate }}</text>
</view>
<view class="item-row">
<text class="row-label">有效期</text>
<text class="row-value">{{ item.effectiveDate }}</text>
</view>
<view class="operate" >
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import { listBankcardLend,delBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const debitTypeList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: '1',
debitType: ''
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listBankcardLend({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
// 类型
getDicts('debit_type').then(res => {
debitTypeList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.debitType = item.dictValue
debitTypeList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.debitType = '',
queryParams.value.type = '1'
debitTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/base/debitCard/details?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/base/debitCard/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/base/debitCard/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delBankcardLend(item.id)
uni.navigateTo({ url: `/pages/work/base/debitCard/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -0,0 +1,213 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="借贷账户管理"
>
</u-navbar>
<view class="section">
<view class="section-title">{{ title}}</view>
<view class="form-view">
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm" label-width="auto"
:labelStyle="{ color: '#333333', fontSize: '30rpx' }">
<u-form-item label="借贷名称" prop="name" required >
<u--input v-model="form.name" placeholder="请填写借贷名称"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="账号" prop="code" required >
<u--input v-model="form.code" placeholder="请填写账号"
inputAlign="right" border="none"></u--input>
</u-form-item>
<u-form-item label="类型" prop="lendTypeName" required @click="handleShowTeam">
<u--input v-model="form.lendTypeName" disabled disabledColor="#ffffff" placeholder="请选择类型"
inputAlign="right" border="none"></u--input>
<u-icon slot="right" name="arrow-down"></u-icon>
</u-form-item>
<u-form-item label="备注" prop="remark" labelPosition="top">
<u--textarea v-model="form.remark" placeholder="请填写备注" border="none" autoHeight inputAlign="right" count
maxlength="20000" style="padding:18rpx 0;"></u--textarea>
</u-form-item>
</u--form>
<view class="form-btn">
<u-button type="primary" text="提交" @click="submit"></u-button>
</view>
</view>
</view>
<u-toast ref="uToast"></u-toast>
<u-picker itemHeight="88" :show="showTeam" :columns="lendTypeList" keyName="dictLabel" @cancel="handleCancel"
@confirm="handleConfirm"></u-picker>
<u-datetime-picker
:show="datePickShow"
mode="date"
ref="createTimeRef"
@cancel="datePickShow=false"
@confirm="datePickConfirm"
itemHeight="88"
></u-datetime-picker>
</view>
</template>
<script setup>
import { getBankcardLend, addBankcardLend, updateBankcardLend } from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
const { proxy } = getCurrentInstance()
import dayjs from 'dayjs'
import {onLoad,onReady} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed ,getCurrentInstance }from "vue";
const datePickShow = ref(false)
const showTeam = ref(false)
const title = ref("借贷账户管理")
const lendTypeList = ref([])
const dateType = ref(1)
const data = reactive({
form: {
id: null,
name: null,
type: '3',
code: null,
openingBank: null,
activationDate: null,
billDate: null,
payDate: null,
delayPeriod: null,
creditLimit: null,
effectiveDate: null,
cvv: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
delFlag: null,
remark: null,
debitType: null
},
// dateType:'1',
rules: {
name: [{ type: 'string', required: true, message: '借贷名称不能为空', trigger: ['change', 'blur'] }],
code: [{ type: 'string', required: true, message: '账号不能为空', trigger: ['change', 'blur'] }],
lendTypeName: [{ type: 'string', required: true, message: '类型不能为空', trigger: ['change', 'blur'] }],
}
})
const { form, rules} = toRefs(data)
onLoad((option) => {
form.value.id = option.id
if(form.value.id!=null){
title.value="借贷账户管理-修改"
}else{
title.value="借贷账户管理-新增"
}
getDict()
})
onReady(() => {
form.value.activationDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
form.value.effectiveDate = dayjs(new Date().getTime()).format("YYYY-MM-DD")
})
function getDict() {
// 类型
getDicts('lend_type').then(res => {
lendTypeList.value =[res.data]
})
if(form.value.id!=null){
getBankcardLend(form.value.id).then(res => {
form.value = res.data
// 类型
getDicts('lend_type').then(result => {
form.value.lendTypeName=dictStr(form.value.lendType, result.data)
})
})
}
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function handleShowTeam() {
if (lendTypeList.value[0].length === 0) {
proxy.$refs['uToast'].show({
message: '类型为空 ', type: 'warning'
})
} else {
showTeam.value = true
}
}
function handleConfirm(e) {
form.value.lendTypeName = e.value[0].dictLabel
form.value.lendType = e.value[0].dictValue
showTeam.value = false
}
function handleCancel() {
showTeam.value = false
}
function selectDate(type) {
dateType.value=type
datePickShow.value = true
proxy.$refs['createTimeRef'].innerValue = new Date().getTime()
}
function datePickConfirm(e) {
if(dateType.value===1){
form.value.activationDate = dayjs(e.value).format("YYYY-MM-DD")
}
if(dateType.value===2){
form.value.effectiveDate = dayjs(e.value).format("YYYY-MM-DD")
}
datePickShow.value = false
}
function submit() {
proxy.$refs['uForm'].validate().then(() => {
if (form.value.id != null) {
updateBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '修改成功', complete() {
uni.navigateTo({ url: `/pages/work/base/lend/list` })
}
})
})
}else {
addBankcardLend(form.value).then(res => {
proxy.$refs['uToast'].show({
message: '新增成功', complete() {
uni.navigateTo({ url: `/pages/work/base/lend/list` })
}
})
})
}
})
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 360rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<view class="container" style="paddingBottom:1rpx;">
<u-navbar
leftIconSize="40rpx"
leftIconColor="#333333"
title="借贷账户详情"
>
</u-navbar>
<view class="section">
<u-cell-group>
<u-cell title="借贷名称:" titleStyle="font-weight:bolder" :value="detailInfo.name"></u-cell>
<u-cell title="账号:" titleStyle="font-weight:bolder" :value="detailInfo.code"></u-cell>
<u-cell title="类型:" titleStyle="font-weight:bolder" :value="detailInfo.lendType"></u-cell>
<u-cell title="备注:" titleStyle="font-weight:bolder" center :value="detailInfo.remark"> </u-cell>
</u-cell-group>
</view>
<u-toast ref="uToast"></u-toast>
</view>
</template>
<script setup>
import { getBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad} from "@dcloudio/uni-app";
import {reactive ,toRefs,ref,computed }from "vue";
const id = ref('')
const data = reactive({
detailInfo: {}
})
const {detailInfo} = toRefs(data)
onLoad((option) => {
id.value = option.id
getInfo()
})
function getInfo() {
getBankcardLend(id.value).then(res => {
detailInfo.value = res.data
// 类型
getDicts('lend_type').then(result => {
detailInfo.value.lendType=dictStr(detailInfo.value.lendType, result.data)
})
})
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
</script>
<style lang="scss" scoped>
.section {
margin: 24rpx;
padding: 16rpx 24rpx;
background-color: #fff;
border-radius: 8rpx;
.section-title {
width: 280rpx;
color: #333333;
line-height: 44rpx;
font-size: 30rpx;
border-left: 6rpx solid #2681FF;
padding-left: 26rpx;
}
.content {
width: 647rpx;
font-size: 28rpx;
color: #333333;
line-height: 40rpx;
text-align: left;
}
.img-con {
display: flex;
flex-wrap: wrap;
gap: 20rpx
}
.form-view {
padding: 20rpx 0rpx 0 10rpx;
.form-btn {
padding-top: 20rpx;
}
}
}
</style>

View File

@@ -0,0 +1,367 @@
<template>
<view class="container">
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
<view class="search-view">
<u--input v-model="queryParams.name" border="false" placeholder="请输入储蓄卡名称" class="search-input"
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
</u--input>
<u-icon :name="filterPanel ? 'arrow-up-fill' : 'arrow-down-fill'" color="#666666" size="28" label="筛选"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="filterPanel = !filterPanel"></u-icon>
<u-icon name="plus-circle-fill" color="#666666" size="28" style="margin-left:10px" label="新增"
labelPos="left" labelSize="32rpx" labelColor="#666666" @click="handleAdd()"></u-icon>
<u-transition :show="filterPanel" mode="fade">
<view class="filter-panel" :style="{ height: `${windowHeight - 42}px` }">
<view class="filter-panel-content">
<view class="filter-title">类型</view>
<view class="state-list">
<view v-for="item in lendTypeList" :key="item.id" class="state-item"
:class="item.selected ? 'active' : ''" @click="selectStatus(item)">{{ item.dictLabel }}</view>
</view>
</view>
<view class="btn-box">
<u-button text="重置" style="margin-right:20rpx" @click="resetQuery()"></u-button>
<u-button type="primary" text="确定" @click="searchSubmit()"></u-button>
</view>
</view>
</u-transition>
</view>
</u-sticky>
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
<u-list-item v-for="(item, index) in listData" :key="index">
<view class="list-item">
<view class="item-header" @click="enterDetails(item)">
<u--text suffixIcon="arrow-right" lines="1" iconStyle="font-size: 18px; color: #333333; font-weight:bold"
:text="item.name+'-'+item.code " size="30rpx" color="#333333" :bold="true"></u--text>
</view>
<view class="item-row">
<text class="row-label">类型</text>
<text class="row-value">{{ dictStr(item.lendType, lendTypeList) }}</text>
</view>
<view class="item-row">
<text class="row-label">备注</text>
<text class="row-value">{{ item.remark }}</text>
</view>
<view class="operate" >
<!-- <view class="btn filling" @click="enterDetails(item)">查看</view > -->
<view class="btn filling" @click="handleEdit(item)">修改</view>
<view class="btn filling" @click="handleDelete(item)">删除</view>
</view>
</view>
</u-list-item>
<view>
</view>
<u-loadmore :status="status" loadingIcon="semicircle" height="88" fontSize="32rpx" @loadmore="loadmore" />
</u-list>
<u-picker itemHeight="88" :show="settingPickShow" :columns="settingColumns" keyName="settingName"
@confirm="settingConfirm" @cancel="settingCancel"></u-picker>
</view>
</template>
<script setup>
import { listBankcardLend,delBankcardLend} from '@/api/invest/bankcardlend'
import { getDicts } from '@/api/system/dict/data.js'
import {onLoad,onShow} from "@dcloudio/uni-app";
// 计算属性与监听属性是在vue中而非uniap中 需要注意!!!
import {reactive ,toRefs,ref,computed }from "vue";
const pageNum = ref(1)
const listData = ref([])
const isShow = ref(false)
const status = ref('loadmore')
const lendTypeList = ref([])
const settingPickShow = ref(false)
const settingColumns = ref([])
const data = reactive({
filterPanel: false,
queryParams: {
name: null,
type: '3'
}
})
const { filterPanel, queryParams} = toRefs(data)
const windowHeight = computed(() => {
uni.getSystemInfoSync().windowHeight - 50
})
onLoad(() => {
getDict()
getList()
});
onShow(() => {
if (isShow.value) {
getList()
isShow.value = false
}
});
function loadmore() {
pageNum.value += 1
if (status.value == 'loadmore') {
getList()
}
}
function getList() {
status.value = 'loading'
listBankcardLend({ pageSize: 10, pageNum: pageNum.value, ...queryParams.value }).then(res => {
listData.value = listData.value.concat(res.rows)
if (listData.value.length < res.total) {
status.value = 'loadmore'
} else {
status.value = 'nomore'
}
}).catch(() => {
status.value = 'nomore'
})
}
function getDict() {
// 类型
getDicts('lend_type').then(res => {
lendTypeList.value = res.data
})
}
function settingConfirm(e) {
queryParams.value.settingId = e.value[0].settingId
queryParams.value.settingName = e.value[0].settingName
settingPickShow.value = false
}
function settingCancel() {
settingPickShow.value = false
}
function dictStr(val, arr) {
let str = ''
arr.map(item => {
if (item.dictValue === val) {
str = item.dictLabel
}
})
return str
}
function selectStatus(item) {
queryParams.value.debitType = item.dictValue
lendTypeList.value.map(ele => {
if (ele.dictValue == item.dictValue) {
ele.selected = true
Reflect.set(ele, 'selected', true)
} else {
Reflect.set(ele, 'selected', false)
}
})
}
function searchSubmit() {
pageNum.value = 1
listData.value = []
getList()
filterPanel.value = false
}
function searchBlur() {
pageNum.value = 1
listData.value = []
getList()
}
function resetQuery() {
queryParams.value.name = '',
queryParams.value.type = '3'
lendTypeList.value.map(ele => {
Reflect.set(ele, 'selected', false)
})
}
function enterDetails(item) {
uni.navigateTo({ url: `/pages/work/base/lend/details?id=${item.id}` })
}
function handleEdit(item) {
uni.navigateTo({ url: `/pages/work/base/lend/addEdit?id=${item.id}` })
isShow.value = true
}
function handleAdd() {
uni.navigateTo({ url: `/pages/work/base/lend/addEdit` })
isShow.value = true
}
function handleDelete(item) {
uni.showModal({
title: '提示',
content: '你确定要删除吗',
success: function (res) {
if (res.confirm) {
delBankcardLend(item.id)
uni.navigateTo({ url: `/pages/work/base/lend/list` })
} else if (res.cancel) {
console.log('取消');
}
}
});
}
</script>
<style lang="scss" scoped>
.btnAdd {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
display:float;
text-align: center;
}
.search-view {
padding: 12rpx 32rpx;
background-color: #ffffff;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
margin-bottom: 24rpx;
.search-input {
background: #F5F5F5;
color: #333333;
margin-right: 36rpx;
}
.filter-panel {
width: 100%;
position: absolute;
left: 0;
top: 96rpx;
background-color: rgba(0, 0, 0, 0.5);
.filter-panel-content {
background-color: #ffff;
padding: 0 30rpx 30rpx;
.filter-title {
color: #000000;
font-size: 30rpx;
font-weight: 500;
padding: 30rpx 0;
}
.state-list {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
.state-item {
width: 210rpx;
height: 72rpx;
border: 1rpx solid rgba(0, 0, 0, 0.25);
border-radius: 72rpx;
text-align: center;
line-height: 72rpx;
margin: 0 20rpx 20rpx 0;
font-size: 28rpx;
color: #000000;
}
.active {
background-color: rgba(222, 241, 255, 1);
border: 1rpx solid rgba(22, 119, 255, 1);
}
}
}
.btn-box {
display: flex;
padding: 24rpx 30rpx;
background-color: #fff;
box-shadow: 0rpx -10rpx 20rpx #EEEEEE;
}
}
}
.list-item {
margin: 0 24rpx 24rpx;
padding: 32rpx;
background-color: #fff;
.item-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16rpx;
.status {
.status-item {
width: 120rpx;
height: 44rpx;
text-align: center;
line-height: 44rpx;
border-radius: 4rpx;
font-size: 24rpx;
}
.status1 {
background: #F0F0F0;
color: #8C8C8C;
}
.status2 {
background: rgba(38, 129, 255, 0.2);
color: #2681FF;
}
.status3 {
background: #F7F7F7;
color: #2681FF;
}
.status4 {
background: rgba(255, 85, 51, 0.2);
color: #FF5533;
}
.status5 {
background: #F7F7F7;
color: rgba(0, 0, 0, 0.85);
}
.status7 {
background: rgba(255, 129, 51, 0.2);
color: #FF8133;
}
.status8 {
background: rgba(65, 217, 165, 0.2);
color: #41D9A5;
}
}
}
.item-row {
padding: 16rpx 0;
.row-label {
color: rgba(0, 0, 0, 0.55);
}
.row-value {
color: rgba(0, 0, 0, 0.85)
}
}
.operate {
display: flex;
justify-content: flex-end;
.btn {
width: 146rpx;
height: 56rpx;
line-height: 56rpx;
border-radius: 8rpx;
margin-left: 5rpx;
text-align: center;
}
.circulation {
background: rgba(0, 0, 0, 0.04);
margin-right: 24rpx;
color: rgba(0, 0, 0, 0.85);
}
.filling {
background: #2681FF;
border-radius: 8rpx;
color: #FFFFFF;
}
}
}
</style>

View File

@@ -1,237 +0,0 @@
<template>
<view class="mine-container" :style="{ height: `${windowHeight}px` }">
<!--顶部个人信息栏-->
<view class="header-section">
<view class="flex padding justify-between">
<view class="flex align-center">
<view v-if="!avatar" class="cu-avatar xl round bg-white">
<view class="iconfont icon-people text-gray icon"></view>
</view>
<image v-if="avatar" @click="handleToAvatar" :src="avatar" class="cu-avatar xl round" mode="widthFix">
</image>
<view v-if="!name" @click="handleToLogin" class="login-tip">
点击登录
</view>
<view v-if="name" @click="handleToInfo" class="user-info">
<view class="u_title">
用户名{{ name }}
</view>
</view>
</view>
<view @click="handleToInfo" class="flex align-center">
<text>个人信息</text>
<view class="iconfont icon-right"></view>
</view>
</view>
</view>
<view class="content-section">
<view class="mine-actions grid col-4 text-center">
<view class="action-item" @click="handleJiaoLiuQun">
<view class="iconfont icon-friendfill text-pink icon"></view>
<text class="text">交流群</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-service text-blue icon"></view>
<text class="text">在线客服</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-community text-mauve icon"></view>
<text class="text">反馈社区</text>
</view>
<view class="action-item" @click="handleBuilding">
<view class="iconfont icon-dianzan text-green icon"></view>
<text class="text">点赞我们</text>
</view>
</view>
<view class="menu-list">
<view class="list-cell list-cell-arrow" @click="handleToEditInfo">
<view class="menu-item-box">
<view class="iconfont icon-user menu-icon"></view>
<view>编辑资料</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleHelp">
<view class="menu-item-box">
<view class="iconfont icon-help menu-icon"></view>
<view>常见问题</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleAbout">
<view class="menu-item-box">
<view class="iconfont icon-aixin menu-icon"></view>
<view>关于我们</view>
</view>
</view>
<view class="list-cell list-cell-arrow" @click="handleToSetting">
<view class="menu-item-box">
<view class="iconfont icon-setting menu-icon"></view>
<view>应用设置</view>
</view>
</view>
</view>
</view>
</view>
<!-- <view>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog type="info" cancelText="关闭" confirmText="退出"
title="通知" content="确定注销并退出系统吗"
@confirm="dialogConfirm"
@close="dialogClose">
</uni-popup-dialog>
</uni-popup>
</view> -->
</template>
<script setup>
import { ref } from "vue";
import config from '@/config.js'
import useUserStore from '@/store/modules/user'
const userStore = useUserStore()
const name = userStore.name;
const version = config.appInfo.version;
const avatar = ref(userStore.avatar);
const windowHeight = ref(uni.getSystemInfoSync().windowHeight - 50);
const popup = ref(null);
uni.$on('refresh', () => {
avatar.value = userStore.avatar;
})
console.log(avatar.value)
function handleToInfo() {
uni.navigateTo({
url: '/pages_mine/pages/info/index'
});
};
function handleToEditInfo() {
uni.navigateTo({
url: '/pages_mine/pages/info/edit'
});
};
function handleToSetting() {
uni.navigateTo({
url: '/pages_mine/pages/setting/index'
});
};
function handleToLogin() {
uni.reLaunch({
url: '/pages/login'
});
};
function handleToAvatar() {
uni.navigateTo({
url: '/pages_mine/pages/avatar/index'
});
};
function handleLogout() {
popup.value.open();
};
function dialogConfirm() {
//console.log('----------------点击确认------------')
userStore.logOut().then(() => {
uni.reLaunch({
url: '/pages/login'
});
})
};
function dialogClose() {
//console.log('点击关闭')
};
function handleHelp() {
uni.navigateTo({
url: '/pages_mine/pages/help/index'
});
};
function handleAbout() {
uni.navigateTo({
url: '/pages_mine/pages/about/index'
});
};
function handleJiaoLiuQun() {
uni.showToast({
title: 'QQ群133713780',
mask: false,
icon: "none",
duration: 1000
});
};
function handleBuilding() {
uni.showToast({
title: '模块建设中~',
mask: false,
icon: "none",
duration: 1000
});
}
</script>
<style lang="scss">
page {
background-color: #f5f6f7;
}
.mine-container {
width: 100%;
height: 100%;
.header-section {
padding: 15px 15px 45px 15px;
background-color: #3c96f3;
color: white;
.login-tip {
font-size: 18px;
margin-left: 10px;
}
.cu-avatar {
border: 2px solid #eaeaea;
.icon {
font-size: 40px;
}
}
.user-info {
margin-left: 15px;
.u_title {
font-size: 18px;
line-height: 30px;
}
}
}
.content-section {
position: relative;
top: -50px;
.mine-actions {
margin: 15px 15px;
padding: 20px 0px;
border-radius: 8px;
background-color: white;
.action-item {
.icon {
font-size: 28px;
}
.text {
display: block;
font-size: 13px;
margin: 8px 0px;
}
}
}
}
}
</style>