Browse Source

页面刷新

main
niefei 1 month ago
parent
commit
1e8bb472cd
  1. 2
      pages/account/ledger.vue
  2. 55
      pages/account/transactionRecord.vue
  3. 218
      pages/home/index.vue
  4. 108
      pages/mine/wallet/index.vue

2
pages/account/ledger.vue

@ -57,7 +57,7 @@
<view v-for="(item, index) in recordList" :key="index" class="record-item" @tap="viewDetail(item)">
<view class="record-header">
<!-- <text class="record-id">{{ item.senderName }}</text> -->
<text class="record-id">{{ item.billCode.split("@")[0] }}</text>
<text class="record-id">{{ item.billCode }}</text>
<view class="record-amount">
<text class="amount-value" :style="{ color: getColor(item.changeBalance) }">
{{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP)

55
pages/account/transactionRecord.vue

@ -43,7 +43,7 @@
<view v-for="(item, index) in [...recordList]" :key="index" class="record-item" @tap="viewDetail(item)">
<view class="record-header">
<!-- <text class="record-id">{{ item.senderName }}</text> -->
<text class="record-id">{{ item.remark }}</text>
<text class="record-id">{{ item.billCode }}</text>
<view class="record-amount">
<text class="amount-value" :style="{ color: getColor(item.changeBalance) }">
{{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP)
@ -51,7 +51,7 @@
</view>
</view>
<view class="record-content">
<text class="record-time">{{ item.time }}</text>
<text class="record-time">{{ item.timeFormat }}</text>
<uni-tag :inverted="true" :text="item.typeStr" />
<!-- <uni-tag :inverted="true" :text="item.typeStr" :type="getStatusText(item.type)" /> -->
</view>
@ -65,19 +65,19 @@
</view>
<!-- 加载状态 -->
<view v-if="isLoading && recordList.length > 0" class="loading-more">
<!-- <view v-if="isLoading && recordList.length > 0" class="loading-more">
<text>{{this.$languageData.settings.loading}}</text>
</view>
</view> -->
</scroll-view>
<loading ref="loading" :custom="false" :shadeClick="false" :type="1" />
<!-- <loading ref="loading" :custom="false" :shadeClick="false" :type="1" /> -->
</view>
</template>
<script>
import {
getRecordList
getTransRecord
} from '@/api/account/transactionRecord.js'
import {
getCurrentDate
@ -87,14 +87,7 @@
return {
searchText: '',
selectedDate: '',
recordList: [{
remark: 'salary',
changeBalance: 4106.32,
time: "2025/05/01",
typeStr: this.$languageData.settings.reci
},
{remark: 'McDonald\'s', changeBalance: -106.32, time: "2025/05/11", typeStr: this.$languageData.settings.pay},
],
recordList: [],
isLoading: false,
isRefreshing: false,
page: 1,
@ -106,7 +99,7 @@
phonenumber: '',
key: '',
key2: getCurrentDate(), //,
type: "1"
type: ""
},
}
},
@ -126,7 +119,6 @@
console.error("解析 JSON 失败:", error);
}
}
this.selectRecordList();
},
methods: {
downloadEmptyFile() {
@ -162,19 +154,29 @@
}
},
selectRecordList() {
if (false) {
this.$nextTick(() => {
this.$refs.loading.open();
getTransRecord(this.params).then(res => {
this.recordList = res.data;
this.recordList.forEach(item => {
item.billCode = item.billCode.split("@")[0];
if (item.billCode == "BTR") {
item.billCode = this.$languageData.tmp.transferAccounts; //
} else if (item.billCode == "BPY") {
item.billCode = this.$languageData.tmp.proxyPayment; //
} else if (item.billCode == "BPT") {
item.billCode = this.$languageData.tmp.payment; //
} else if (item.billCode == "BRT") {
item.billCode = this.$languageData.tmp.receivePayment; //
} else if (item.billCode == "BWL") {
item.billCode = this.$languageData.tmp.withdrawal; //
} else if (item.billCode == "BRE") {
item.billCode = this.$languageData.tmp.recharge; //
} else {
item.billCode = this.$languageData.tmp.other; //
}
})
getRecordList(this.params).then(res => {
this.recordList = res.rows
setTimeout(() => {
this.$refs.loading.close();
}, 700)
}).catch(e => {
this.$refs.loading.close();
//this.$refs.loading.close();
})
}
},
mockrecordList() {
const statuses = ['success', 'pending', 'failed']
@ -244,6 +246,7 @@
uni.setNavigationBarTitle({
title: this.$languageData.navBar.transactionRecord
});
this.selectRecordList();
},
watch: {
languageData() {

218
pages/home/index.vue

@ -142,17 +142,17 @@
</template>
<script>
import {
import {
getAmount
} from '@/api/account/transactionRecord.js'
import scanTheCode from '@/components/scan/scanTheCode.vue'
import {
} from '@/api/account/transactionRecord.js'
import scanTheCode from '@/components/scan/scanTheCode.vue'
import {
getToken
} from '@/utils/auth'
import {
} from '@/utils/auth'
import {
showConfirm
} from '@/utils/common'
export default {
} from '@/utils/common'
export default {
components: {
scanTheCode
},
@ -187,12 +187,14 @@ export default {
},
{
icon: this.$store.state.user.userCate == '2' ? 'man-add' : 'more-dot-fill',
name: this.$store.state.user.userCate == '2' ? this.$languageData.home.proxyPayment : this.$languageData.home.tbc,
name: this.$store.state.user.userCate == '2' ? this.$languageData.home.proxyPayment : this
.$languageData.home.tbc,
url: this.$store.state.user.userCate == '2' ? '/pages/functions/proxyPayment' : undefined
},
{
icon: this.$store.state.user.userCate != '0' ? 'order' : 'more-dot-fill',
name: this.$store.state.user.userCate != '0' ? this.$languageData.home.businessData : this.$languageData.home.tbc,
name: this.$store.state.user.userCate != '0' ? this.$languageData.home.businessData : this
.$languageData.home.tbc,
url: this.$store.state.user.userCate != '0' ? '/pages/mchManage/index' : undefined
},
{
@ -266,12 +268,14 @@ export default {
},
{
icon: this.$store.state.user.userCate == '2' ? 'man-add' : 'more-dot-fill',
name: this.$store.state.user.userCate == '2' ? this.$languageData.home.proxyPayment : this.$languageData.home.tbc,
name: this.$store.state.user.userCate == '2' ? this.$languageData.home.proxyPayment : this
.$languageData.home.tbc,
url: this.$store.state.user.userCate == '2' ? '/pages/functions/proxyPayment' : undefined
},
{
icon: this.$store.state.user.userCate != '0' ? 'order' : 'more-dot-fill',
name: this.$store.state.user.userCate != '0' ? this.$languageData.home.businessData : this.$languageData.home.tbc,
name: this.$store.state.user.userCate != '0' ? this.$languageData.home.businessData : this
.$languageData.home.tbc,
url: this.$store.state.user.userCate != '0' ? '/pages/mchManage/index' : undefined
},
{
@ -303,17 +307,17 @@ export default {
this.languageData = this.$languageData;
// TabBar
this.setTabBarTabBar(this.languageData.tabbar);
},
onShow() {
this.languageData = this.$languageData;
if (getToken()) {
this.user;
this.selectAmount();
// this.delItem();
}else{
} else {
//
this.funItem.splice(1,2)
this.funItem.splice(1, 2)
}
},
onShow() {
this.languageData = this.$languageData;
this.getScan();
},
methods: {
@ -330,11 +334,15 @@ export default {
})
},
goAuth() {
if(this.$store.state.user.userCate == '1'){
uni.navigateTo({url:'/pages/mine/info/merchant/edit'})
}else if(this.$store.state.user.userCate == '2'){
uni.navigateTo({url:'/pages/mine/info/proxy/edit'})
}else{
if (this.$store.state.user.userCate == '1') {
uni.navigateTo({
url: '/pages/mine/info/merchant/edit'
})
} else if (this.$store.state.user.userCate == '2') {
uni.navigateTo({
url: '/pages/mine/info/proxy/edit'
})
} else {
this.$tab.navigateTo('/pages/mine/info/edit')
}
},
@ -349,13 +357,13 @@ export default {
let userInfo = uni.getStorageSync("storage_data");
if (userInfo.vuex_userCate === '0') {
//0
this.funItem.splice(1,2)
}else if(userInfo.vuex_userCate === '1'){
this.funItem.splice(1, 2)
} else if (userInfo.vuex_userCate === '1') {
//1
this.funItem.splice(1,1)
} else if(userInfo.vuex_userCate === '2'){
this.funItem.splice(1, 1)
} else if (userInfo.vuex_userCate === '2') {
//2
this.funItem.splice(2,1)
this.funItem.splice(2, 1)
}
@ -458,41 +466,41 @@ export default {
return rs
}
}
}
}
</script>
<style lang="scss" scoped>
page {
page {
height: 100%;
width: 100%;
background-color: #f5f5f5;
}
}
body {
body {
overflow: hidden;
}
}
.language-list {
.language-list {
padding: 40rpx;
border: 1rpx solid #ffffff;
background-color: #fafafa;
}
}
.account-title {
.account-title {
display: flex;
justify-content: center;
font-size: 36rpx;
color: white;
position: relative;
}
}
.app-container {
.app-container {
width: 100%;
height: 100vh;
overflow: hidden;
}
}
.nav-bar {
.nav-bar {
height: 88rpx;
background-color: #ffffff;
display: flex;
@ -500,29 +508,29 @@ body {
justify-content: space-between;
padding: 0 32rpx;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
}
.text-lg {
.text-lg {
font-size: 16px;
font-weight: 500;
}
}
.nav-right {
.nav-right {
display: flex;
align-items: center;
position: absolute;
right: 0;
}
}
.content-area {
.content-area {
// padding: 32rpx 32rpx 70rpx;
padding: 32rpx 0;
padding-top: 19rpx;
}
}
.account-card {
.account-card {
background-image: url('/static/svgs/lines.svg');
background-size: cover;
background-position: center;
@ -534,42 +542,42 @@ body {
min-height: 240rpx;
display: flex;
align-items: center;
}
}
.account-info {
.account-info {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
}
}
.balance-label {
.balance-label {
font-size: 14px;
color: rgba(255, 255, 255, 0.9);
}
}
.balance-amount {
.balance-amount {
font-size: 23px;
color: #ffffff;
font-weight: 700;
margin-top: 12rpx;
}
}
.button-group {
.button-group {
display: flex;
flex-direction: column;
gap: 16rpx;
}
}
.action-button {
.action-button {
background-color: rgba(255, 255, 255, 0.2) !important;
border: none !important;
color: #ffffff !important;
font-size: 14px !important;
}
}
.features-grid {
.features-grid {
background: white;
padding: 10px;
border-radius: 12px;
@ -580,15 +588,15 @@ body {
// position: relative;
// top: -70rpx;
top: 13rpx;
}
}
.feature-item {
.feature-item {
display: flex;
flex-direction: column;
align-items: center;
}
}
.feature-icon {
.feature-icon {
width: 96rpx;
height: 96rpx;
background-color: rgba(171, 146, 231, 0.1);
@ -598,9 +606,9 @@ body {
align-items: center;
justify-content: center;
margin-bottom: 16rpx;
}
}
.feature-name {
.feature-name {
font-size: 14px;
color: #333333;
text-align: center;
@ -608,9 +616,9 @@ body {
display: flex;
align-items: center;
font-weight: 500;
}
}
.promotion-banner {
.promotion-banner {
background-color: rgba(255, 125, 0, 0.05);
border: 1px solid rgba(255, 125, 0, 0.1);
border-radius: 16rpx;
@ -618,53 +626,53 @@ body {
display: flex;
align-items: center;
// margin-bottom: 48rpx;
}
}
.promotion-text {
.promotion-text {
font-size: 14px;
color: #666666;
margin-left: 24rpx;
}
}
.section-header {
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32rpx;
}
}
.section-title {
.section-title {
font-size: 16px;
font-weight: 500;
color: #333333;
}
}
.view-all {
.view-all {
font-size: 14px;
color: #999999;
}
}
.transaction-list {
.transaction-list {
display: flex;
flex-direction: column;
gap: 32rpx;
}
}
.transaction-item {
.transaction-item {
background-color: #ffffff;
border-radius: 16rpx;
padding: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.transaction-left {
.transaction-left {
display: flex;
align-items: center;
}
}
.transaction-icon {
.transaction-icon {
width: 80rpx;
height: 80rpx;
background-color: #f5f5f5;
@ -673,58 +681,58 @@ body {
align-items: center;
justify-content: center;
margin-right: 24rpx;
}
}
.transaction-info {
.transaction-info {
display: flex;
flex-direction: column;
}
}
.transaction-title {
.transaction-title {
font-size: 14px;
color: #333333;
font-weight: 500;
}
}
.transaction-time {
.transaction-time {
font-size: 12px;
color: #999999;
margin-top: 8rpx;
}
}
.transaction-amount {
.transaction-amount {
font-size: 14px;
font-weight: 500;
}
}
.income {
.income {
color: #00b578;
}
}
.expense {
.expense {
color: #ff4d4f;
}
}
.tab-text {
.tab-text {
font-size: 12px;
color: #999999;
margin-top: 8rpx;
}
}
.active-text {
.active-text {
color: #1B6EF3;
}
}
.languageIcon {
.languageIcon {
display: flex;
justify-content: center;
align-items: center;
}
}
.c {
.c {
display: flex;
justify-content: left;
align-items: center;
}
}
</style>

108
pages/mine/wallet/index.vue

@ -19,8 +19,8 @@
<view style="font-size: 29px;">{{accountId}}</view>
<view class="balance-label" style="margin-top: 20px;">
<text>{{languageData.wallet.availableBalance}} (KIP)</text>
<uni-icons :type="showDetail ? 'eye-filled' : 'eye-slash-filled'"
@click="showDetail = !showDetail" size="20" color="#333333"></uni-icons>
<uni-icons :type="showDetail ? 'eye-filled' : 'eye-slash-filled'" @click="showDetail = !showDetail"
size="20" color="#333333"></uni-icons>
</view>
<view style="">{{ showDetail ? formatNumber(userAmount) : '*****' }}</view>
</view>
@ -41,11 +41,11 @@
</view>
<scroll-view class="message-list" scroll-y :refresher-triggered="triggered" @scrolltolower="onLoadMore">
<view class="list-main" v-for="(item, index) in recordList" :key="index">
<view class="list-main" v-for="(item, index) in recordList.splice(0,2)" :key="index">
<view class="transaction-item">
<view class="transaction-info">
<text class="transaction-type">{{ item.timeStr }}</text>
<text class="transaction-remark ellipsis-200">{{ item.remark }}</text>
<text class="transaction-remark ellipsis-200">{{ item.billCode }}</text>
<text class="transaction-time">{{ item.time }}</text>
</view>
<view class="transaction-amount padding-right-xs">
@ -69,51 +69,56 @@
</template>
<script>
import { getRecordList,getAmount } from '@/api/account/transactionRecord.js'
import {
getTransRecord,
getAmount
} from '@/api/account/transactionRecord.js'
export default {
export default {
data() {
return {
accountId: '',
languageData:{},
params:{
id:this.$store.state.user.userId,
userId:this.$store.state.user.userId,
languageData: {},
params: {
id: this.$store.state.user.userId,
userId: this.$store.state.user.userId,
pageNum: 1,
pageSize: 10,
phonenumber:'',
key:'',
type:'1',
phonenumber: '',
key: '',
type: '1',
},
showDetail: false,
triggered: false,
userAmount:5322200,
userAmount: 5322200,
quota: 0,
recordList:[
{
recordList: [{
senderName: 'senderName1',
senderAccount: '22540212',
changeBalance: '250000',
time: '2025-01-22 21:05:33',
title:'',
remark:'',
currentBalance:''
title: '',
remark: '',
currentBalance: ''
},
{
senderName: 'senderName2',
senderAccount: '22540212',
changeBalance: '-250000',
time: '2025-01-24 21:05:33',
title:'',
remark:'',
currentBalance:''
title: '',
remark: '',
currentBalance: ''
}
]
}
},
created() {
this.selectRecordList();
},
onLoad() {
//TODO
if(false)
if (false)
this.loadRecordList();
this.selectAmount();
this.languageData = this.$languageData;
@ -122,24 +127,24 @@ export default {
});
},
methods: {
navigatoCashOut(){
navigatoCashOut() {
this.$tab.navigateTo('/pages/account/withdrawDeposit')
},
navigatoTopUp(){
navigatoTopUp() {
this.$tab.navigateTo('/pages/account/topUp')
},
navigatoRecord(){
navigatoRecord() {
this.$tab.navigateTo('/pages/account/transactionRecord')
},
loadRecordList(){
getRecordList(this.params).then(res=>{
loadRecordList() {
getRecordList(this.params).then(res => {
this.recordList = res.rows
})
},
selectAmount(){
getAmount(this.params.userId).then(res=>{
selectAmount() {
getAmount(this.params.userId).then(res => {
this.userAmount = res.data.accountAmount
this.accountId = res.data.accountId
this.quota = res.data.walletLimit || 0
@ -150,8 +155,41 @@ export default {
this.params.pageSize = this.params.pageSize + 10
this.loadRecordList();
},
selectRecordList() {
getTransRecord(this.params).then(res => {
this.recordList = res.data;
this.recordList.forEach(item => {
item.billCode = item.billCode.split("@")[0];
if (item.billCode == "BTR") {
item.billCode = this.$languageData.tmp.transferAccounts; //
} else if (item.billCode == "BPY") {
item.billCode = this.$languageData.tmp.proxyPayment; //
} else if (item.billCode == "BPT") {
item.billCode = this.$languageData.tmp.payment; //
} else if (item.billCode == "BRT") {
item.billCode = this.$languageData.tmp.receivePayment; //
} else if (item.billCode == "BWL") {
item.billCode = this.$languageData.tmp.withdrawal; //
} else if (item.billCode == "BRE") {
item.billCode = this.$languageData.tmp.recharge; //
} else {
item.billCode = this.$languageData.tmp.other; //
}
})
}).catch(e => {
//this.$refs.loading.close();
})
//this.$refs.loading.close();
//TODO
if (false) {
this.$nextTick(() => {
this.$refs.loading.open();
})
}
},
}
}
}
</script>
@ -159,10 +197,12 @@ export default {
page {
height: 100%;
}
.amount2{
.amount2 {
display: flex;
align-items: flex-start;
}
.wallet-page {
// min-height: 100%;
// background: linear-gradient(180deg, #FEE1A8 0%, #f9f8f8 30%);
@ -172,8 +212,8 @@ export default {
// background-position: center;
}
.list-background{
background:rgba(248, 247, 246, 0);
.list-background {
background: rgba(248, 247, 246, 0);
// min-height: 500px;
}

Loading…
Cancel
Save