Kaynağa Gözat

fix: merge the destruction record to the recharge record

wangyuan 2 yıl önce
ebeveyn
işleme
0ccdea5822

+ 2 - 2
app.json

@@ -16,10 +16,10 @@
     "pages/addressAdd/addressAdd",
     "pages/set/set",
     "pages/openArea/openArea",
-    "pages/rechargeRecord/rechargeRecord",
     "pages/myAppointment/myAppointment",
     "pages/myFile/myFile",
-    "pages/reportDetail/reportDetail"
+    "pages/reportDetail/reportDetail",
+    "pages/myRecord/myRecord"
   ],
   "usingComponents": {
     "van-icon": "@vant/weapp/icon/index",

+ 2 - 2
pages/my/my.js

@@ -46,9 +46,9 @@ Page({
   /**
    * 点击充值记录
    */
-  handleRechargerecord() {
+  handleMyRecord() {
     wx.navigateTo({
-      url: '/pages/rechargeRecord/rechargeRecord',
+      url: '/pages/myRecord/myRecord',
     })
   },
 

+ 1 - 1
pages/my/my.wxml

@@ -38,7 +38,7 @@
       </view>
     </view>
     <view class="act-item-col ittflex-jca">
-      <view class="act-item chongzhi" data-index="3" bindtap="handleRechargerecord">
+      <view class="act-item chongzhi" data-index="3" bindtap="handleMyRecord">
         <view class="icon">
           <image class="image-icon" src="./../../imaes/jilu@2x.png"></image>
         </view>

+ 10 - 5
pages/rechargeRecord/rechargeRecord.js → pages/myRecord/myRecord.js

@@ -1,11 +1,13 @@
-// pages/rechargeRecord/rechargeRecord.js
+// pages/myRecord/myRecord.js
 Page({
 
   /**
    * 页面的初始数据
    */
   data: {
-    recordList: [1,1,1,1,1,1,1,1,1,1]
+    navItemActive: 0,
+    chargeRecordList: [1,1,1,1,1,1],
+    destoryRecordList: [1]
   },
 
   /**
@@ -30,10 +32,13 @@ Page({
   },
 
   /**
-   * 生命周期函数--监听页面隐藏
+   * 切换nav
    */
-  onHide() {
-
+  handleChangeNav(e) {
+    var navItemActive = e.currentTarget.dataset.index
+    this.setData({
+      navItemActive: navItemActive
+    })
   },
 
   /**

+ 3 - 0
pages/myRecord/myRecord.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 63 - 0
pages/myRecord/myRecord.wxml

@@ -0,0 +1,63 @@
+<!--pages/myRecord/myRecord.wxml-->
+<view class="myrecord-content">
+  <block>
+    <view class="nav-header ittflex">
+      <view class="nav-item nav-all ittflex {{navItemActive == '0' ? 'nav-item-active' : ''}}" bindtap="handleChangeNav" data-index="0">充值记录</view>
+      <view class="nav-item nav-wait ittflex {{navItemActive == '1' ? 'nav-item-active' : ''}}" bindtap="handleChangeNav" data-index="1">核销记录</view>
+    </view>
+  </block>
+  <block wx:if="{{navItemActive == '0'}}">
+    <view class="charge-record record-main">
+      <block wx:if="{{chargeRecordList.length == 0}}">
+        <view class="nodate" >
+          <van-empty description="暂无数据" />
+        </view>
+      </block>
+      <block wx:if="{{chargeRecordList.length !== 0}}">
+        <view class="record-item ittflex-jcs" wx:for="{{chargeRecordList}}" wx:key="index">
+          <view class="left icon">
+          <!--  <image class="image" src="../../imaes/shiti@2x.png"></image> -->
+            <image class="image" src="../../imaes/dianzi@2x.png"></image>
+          </view>
+          <view class="center info">
+            <view class="title info-item">一次体验卡</view>
+            <view class="carno info-item">
+              <text>卡编号:</text>
+              <text>2000202020202020</text>
+            </view>
+            <view class="time info-item">
+              <text>激活时间:</text>
+              <text>2022-10-10 22:22</text>
+            </view>
+          </view>
+          <view class="right count">+199</view>
+        </view>
+      </block>
+    </view>
+  </block>
+  <block wx:if="{{navItemActive == '1'}}">
+    <view class="destory-record record-main">
+      <block wx:if="{{destoryRecordList.length == 0}}">
+        <view class="nodate" >
+          <van-empty description="暂无数据" />
+        </view>
+      </block>
+      <block wx:if="{{destoryRecordList.length !== 0}}">
+        <view class="record-item ittflex-jcs" wx:for="{{destoryRecordList}}" wx:key="index">
+          <view class="left icon">
+          <!--  <image class="image" src="../../imaes/shiti@2x.png"></image> -->
+            <image class="image" src="../../imaes/baogao_sel@2x.png"></image>
+          </view>
+          <view class="center info">
+            <view class="title info-item">体验核销成功</view>
+            <view class="time info-item">
+              <text>核销时间:</text>
+              <text>2022-10-10 22:22</text>
+            </view>
+          </view>
+          <view class="right count">+199</view>
+        </view>
+      </block>
+    </view>
+  </block>
+</view>

+ 25 - 10
pages/rechargeRecord/rechargeRecord.wxss → pages/myRecord/myRecord.wxss

@@ -1,21 +1,36 @@
-/* pages/rechargeRecord/rechargeRecord.wxss */
-.record-content {
+/* pages/myRecord/myRecord.wxss */
+.myrecord-content {
   width: 100%;
   height: 100%;
   background-color: #f7f7f7;
-  padding-top: 1rpx;
 }
-.main-content {
-  width: 690rpx;
-  min-height: 100%;
-  margin: 20rpx auto 0;
+.nav-header {
+  width: 100%;
+  height: 88rpx;
+  background-color: #fff;
 }
-.record-item {
+.nav-item {
+  width: 345rpx;
+  height: 100%;
+  font-size: 30rpx;
+  font-weight: 400;
+  color: #999999;
+}
+.nav-item-active {
+  font-weight: bold;
+  color: var(--maincolor);
+}
+.record-main {
   width: 100%;
+  height: calc(100% - 88rpx);
+  overflow-y: auto;
+}
+.record-item {
+  width: 690rpx;
   height: 188rpx;
   background: #FFFFFF;
   border-radius: 20rpx;
-  margin-bottom: 20rpx;
+  margin: 20rpx auto 0;
 }
 .icon {
   width: 80rpx;
@@ -52,4 +67,4 @@
   font-weight: 400;
   color: var(--maincolor);
   margin-right: 20rpx;
-}
+}

+ 0 - 3
pages/rechargeRecord/rechargeRecord.json

@@ -1,3 +0,0 @@
-{
-  "navigationBarTitleText": "充值记录"
-}

+ 0 - 23
pages/rechargeRecord/rechargeRecord.wxml

@@ -1,23 +0,0 @@
-<!--pages/rechargeRecord/rechargeRecord.wxml-->
-<view class="record-content">
-  <view class="main-content">
-    <view class="record-item ittflex-jcs" wx:for="{{recordList}}" wx:key="index">
-      <view class="left icon">
-       <!--  <image class="image" src="../../imaes/shiti@2x.png"></image> -->
-        <image class="image" src="../../imaes/dianzi@2x.png"></image>
-      </view>
-      <view class="center info">
-        <view class="title info-item">一次体验卡</view>
-        <view class="carno info-item">
-          <text>卡编号:</text>
-          <text>2000202020202020</text>
-        </view>
-        <view class="time info-item">
-          <text>激活时间:</text>
-          <text>2022-10-10 22:22</text>
-        </view>
-      </view>
-      <view class="right count">+199</view>
-    </view>
-  </view>
-</view>