Browse Source

页面刷新

main
niefei 1 month ago
parent
commit
1e8bb472cd
  1. 2
      pages/account/ledger.vue
  2. 55
      pages/account/transactionRecord.vue
  3. 28
      pages/home/index.vue
  4. 54
      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 v-for="(item, index) in recordList" :key="index" class="record-item" @tap="viewDetail(item)">
<view class="record-header"> <view class="record-header">
<!-- <text class="record-id">{{ item.senderName }}</text> --> <!-- <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"> <view class="record-amount">
<text class="amount-value" :style="{ color: getColor(item.changeBalance) }"> <text class="amount-value" :style="{ color: getColor(item.changeBalance) }">
{{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP) {{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 v-for="(item, index) in [...recordList]" :key="index" class="record-item" @tap="viewDetail(item)">
<view class="record-header"> <view class="record-header">
<!-- <text class="record-id">{{ item.senderName }}</text> --> <!-- <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"> <view class="record-amount">
<text class="amount-value" :style="{ color: getColor(item.changeBalance) }"> <text class="amount-value" :style="{ color: getColor(item.changeBalance) }">
{{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP) {{item.changeBalance>0?'+':''}}{{ item.changeBalance }} (KIP)
@ -51,7 +51,7 @@
</view> </view>
</view> </view>
<view class="record-content"> <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" />
<!-- <uni-tag :inverted="true" :text="item.typeStr" :type="getStatusText(item.type)" /> --> <!-- <uni-tag :inverted="true" :text="item.typeStr" :type="getStatusText(item.type)" /> -->
</view> </view>
@ -65,19 +65,19 @@
</view> </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> <text>{{this.$languageData.settings.loading}}</text>
</view> </view> -->
</scroll-view> </scroll-view>
<loading ref="loading" :custom="false" :shadeClick="false" :type="1" /> <!-- <loading ref="loading" :custom="false" :shadeClick="false" :type="1" /> -->
</view> </view>
</template> </template>
<script> <script>
import { import {
getRecordList getTransRecord
} from '@/api/account/transactionRecord.js' } from '@/api/account/transactionRecord.js'
import { import {
getCurrentDate getCurrentDate
@ -87,14 +87,7 @@
return { return {
searchText: '', searchText: '',
selectedDate: '', selectedDate: '',
recordList: [{ 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},
],
isLoading: false, isLoading: false,
isRefreshing: false, isRefreshing: false,
page: 1, page: 1,
@ -106,7 +99,7 @@
phonenumber: '', phonenumber: '',
key: '', key: '',
key2: getCurrentDate(), //, key2: getCurrentDate(), //,
type: "1" type: ""
}, },
} }
}, },
@ -126,7 +119,6 @@
console.error("解析 JSON 失败:", error); console.error("解析 JSON 失败:", error);
} }
} }
this.selectRecordList();
}, },
methods: { methods: {
downloadEmptyFile() { downloadEmptyFile() {
@ -162,19 +154,29 @@
} }
}, },
selectRecordList() { selectRecordList() {
if (false) { getTransRecord(this.params).then(res => {
this.$nextTick(() => { this.recordList = res.data;
this.$refs.loading.open(); 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 => { }).catch(e => {
this.$refs.loading.close(); //this.$refs.loading.close();
}) })
}
}, },
mockrecordList() { mockrecordList() {
const statuses = ['success', 'pending', 'failed'] const statuses = ['success', 'pending', 'failed']
@ -244,6 +246,7 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: this.$languageData.navBar.transactionRecord title: this.$languageData.navBar.transactionRecord
}); });
this.selectRecordList();
}, },
watch: { watch: {
languageData() { languageData() {

28
pages/home/index.vue

@ -187,12 +187,14 @@ export default {
}, },
{ {
icon: this.$store.state.user.userCate == '2' ? 'man-add' : 'more-dot-fill', 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 url: this.$store.state.user.userCate == '2' ? '/pages/functions/proxyPayment' : undefined
}, },
{ {
icon: this.$store.state.user.userCate != '0' ? 'order' : 'more-dot-fill', 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 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', 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 url: this.$store.state.user.userCate == '2' ? '/pages/functions/proxyPayment' : undefined
}, },
{ {
icon: this.$store.state.user.userCate != '0' ? 'order' : 'more-dot-fill', 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 url: this.$store.state.user.userCate != '0' ? '/pages/mchManage/index' : undefined
}, },
{ {
@ -303,17 +307,17 @@ export default {
this.languageData = this.$languageData; this.languageData = this.$languageData;
// TabBar // TabBar
this.setTabBarTabBar(this.languageData.tabbar); this.setTabBarTabBar(this.languageData.tabbar);
},
onShow() {
this.languageData = this.$languageData;
if (getToken()) { if (getToken()) {
this.user;
this.selectAmount(); this.selectAmount();
// this.delItem(); // this.delItem();
} else { } else {
// //
this.funItem.splice(1, 2) this.funItem.splice(1, 2)
} }
},
onShow() {
this.languageData = this.$languageData;
this.getScan(); this.getScan();
}, },
methods: { methods: {
@ -331,9 +335,13 @@ export default {
}, },
goAuth() { goAuth() {
if (this.$store.state.user.userCate == '1') { if (this.$store.state.user.userCate == '1') {
uni.navigateTo({url:'/pages/mine/info/merchant/edit'}) uni.navigateTo({
url: '/pages/mine/info/merchant/edit'
})
} else if (this.$store.state.user.userCate == '2') { } else if (this.$store.state.user.userCate == '2') {
uni.navigateTo({url:'/pages/mine/info/proxy/edit'}) uni.navigateTo({
url: '/pages/mine/info/proxy/edit'
})
} else { } else {
this.$tab.navigateTo('/pages/mine/info/edit') this.$tab.navigateTo('/pages/mine/info/edit')
} }

54
pages/mine/wallet/index.vue

@ -19,8 +19,8 @@
<view style="font-size: 29px;">{{accountId}}</view> <view style="font-size: 29px;">{{accountId}}</view>
<view class="balance-label" style="margin-top: 20px;"> <view class="balance-label" style="margin-top: 20px;">
<text>{{languageData.wallet.availableBalance}} (KIP)</text> <text>{{languageData.wallet.availableBalance}} (KIP)</text>
<uni-icons :type="showDetail ? 'eye-filled' : 'eye-slash-filled'" <uni-icons :type="showDetail ? 'eye-filled' : 'eye-slash-filled'" @click="showDetail = !showDetail"
@click="showDetail = !showDetail" size="20" color="#333333"></uni-icons> size="20" color="#333333"></uni-icons>
</view> </view>
<view style="">{{ showDetail ? formatNumber(userAmount) : '*****' }}</view> <view style="">{{ showDetail ? formatNumber(userAmount) : '*****' }}</view>
</view> </view>
@ -41,11 +41,11 @@
</view> </view>
<scroll-view class="message-list" scroll-y :refresher-triggered="triggered" @scrolltolower="onLoadMore"> <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-item">
<view class="transaction-info"> <view class="transaction-info">
<text class="transaction-type">{{ item.timeStr }}</text> <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> <text class="transaction-time">{{ item.time }}</text>
</view> </view>
<view class="transaction-amount padding-right-xs"> <view class="transaction-amount padding-right-xs">
@ -69,7 +69,10 @@
</template> </template>
<script> <script>
import { getRecordList,getAmount } from '@/api/account/transactionRecord.js' import {
getTransRecord,
getAmount
} from '@/api/account/transactionRecord.js'
export default { export default {
data() { data() {
@ -89,8 +92,7 @@ export default {
triggered: false, triggered: false,
userAmount: 5322200, userAmount: 5322200,
quota: 0, quota: 0,
recordList:[ recordList: [{
{
senderName: 'senderName1', senderName: 'senderName1',
senderAccount: '22540212', senderAccount: '22540212',
changeBalance: '250000', changeBalance: '250000',
@ -111,6 +113,9 @@ export default {
] ]
} }
}, },
created() {
this.selectRecordList();
},
onLoad() { onLoad() {
//TODO //TODO
if (false) if (false)
@ -150,6 +155,39 @@ export default {
this.params.pageSize = this.params.pageSize + 10 this.params.pageSize = this.params.pageSize + 10
this.loadRecordList(); 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> </script>
@ -159,10 +197,12 @@ export default {
page { page {
height: 100%; height: 100%;
} }
.amount2 { .amount2 {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
} }
.wallet-page { .wallet-page {
// min-height: 100%; // min-height: 100%;
// background: linear-gradient(180deg, #FEE1A8 0%, #f9f8f8 30%); // background: linear-gradient(180deg, #FEE1A8 0%, #f9f8f8 30%);

Loading…
Cancel
Save