fix: add back button and nav bar to wallet page

- Add van-nav-bar with back arrow to qianbao.wxml
- Fix JSON title from "我的收藏" to "我的钱包"
- Simplify JS: remove unused navHeight/menuButtonInfo, use getNavBarHeight()
- Add navigationStyle:custom for consistent custom nav bar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
renjianbo
2026-06-07 12:15:27 +08:00
parent 7c9cfff3cc
commit d8eb826469
3 changed files with 35 additions and 28 deletions

View File

@@ -5,11 +5,7 @@ Page({
data: {
order_list: [],
navHeight: '',
menuButtonInfo: {},
searchMarginTop: 0,
searchWidth: 0,
searchHeight: 0,
height: '',
page: 1,
firstLoad: true
},
@@ -18,8 +14,8 @@ Page({
wx.navigateBack()
},
onLoad: function (options) {
wx.setNavigationBarTitle({ title: '我的钱包' })
onLoad: function () {
this.setData(getApp().getNavBarHeight());
},
onShow: function () {

View File

@@ -1,4 +1,7 @@
{
"usingComponents": {},
"navigationBarTitleText": "我的收藏"
}
"usingComponents": {
"van-nav-bar": "@vant/weapp/nav-bar/index"
},
"navigationBarTitleText": "我的钱包",
"navigationStyle": "custom"
}

View File

@@ -1,20 +1,28 @@
<view>
<view class="order-list" wx:if="{{order_list.length}}">
<view wx:for="{{order_list}}" wx:key="{{index}}" wx:for-item="item">
<view class="Group" bindtap="activity" data-id="{{item.id}}">
<view style="margin-left: 34rpx;">
<view wx:if="{{item.type==1}}" class="title1">退款到账</view>
<view wx:if="{{item.type==-1}}" class="title1">提现</view>
<view class="title2">{{item.time}}</view>
</view>
<view style="position: absolute;right: 24rpx;">
<view class="Price1">¥{{item.money}}</view>
</view>
</view>
<van-nav-bar
title="我的钱包"
left-text=""
left-arrow
bind:click-left="back"
style="position:fixed;left:0;top:0;width:100%;z-index:2;"
/>
<view style="margin-top:{{height}}px;">
<view class="order-list" wx:if="{{order_list.length}}">
<view wx:for="{{order_list}}" wx:key="{{index}}" wx:for-item="item">
<view class="Group" bindtap="activity" data-id="{{item.id}}">
<view style="margin-left: 34rpx;">
<view wx:if="{{item.type==1}}" class="title1">退款到账</view>
<view wx:if="{{item.type==-1}}" class="title1">提现</view>
<view class="title2">{{item.time}}</view>
</view>
<view style="position: absolute;right: 24rpx;">
<view class="Price1">¥{{item.money}}</view>
</view>
</view>
</view>
<view wx:else class="no-order" style="display:flex;flex-direction:column;align-items:center;padding-top:200rpx;">
<image style="width:200rpx;height:200rpx;" src="/pages/image/empty.png"></image>
<view style="color:#999;font-size:28rpx;margin-top:20rpx;">暂无交易记录</view>
</view>
</view>
</view>
<view wx:else class="no-order" style="display:flex;flex-direction:column;align-items:center;padding-top:200rpx;">
<image style="width:200rpx;height:200rpx;" src="/pages/image/empty.png"></image>
<view style="color:#999;font-size:28rpx;margin-top:20rpx;">暂无交易记录</view>
</view>
</view>