Explorar el Código

refactor:消费记录详情

zhanghui hace 2 años
padre
commit
8eb1dbd612

+ 1 - 13
myPages/transactionRecord/index.vue

@@ -72,14 +72,11 @@
                     name: '退款'
                 }],
 
-                showDataLoading: false,
                 serviceTimeShow: false,
                 show: false,
-                mode: 'single',
                 searchTime: '2023-8-9',
                 value1: '',
                 dataTime:'',
-                tranRecordsList: [],
                 tranFlowstatistic: {}
             };
         },
@@ -116,10 +113,8 @@
             // 查询交易流水统计
             transactionFlowstatistic(){
                 let that = this;
-                that.showDataLoading = true;
                 this.$api.transactionFlowstatistic({data:this.reqParm}).then((res)=>{
                     that.tranFlowstatistic = res.data.data;
-                    that.showDataLoading = false;
                 }).catch(() =>{
                     uni.showToast({
                         title: "操作失败"
@@ -137,16 +132,9 @@
                 })
             },
             showDate(){
-                // this.show = true;
                 this.serviceTimeShow = true;
             },
-            confirm(e) {
-                this.searchTime = e[0];
-                this.show = false;
-            },
-            close() {
-                this.show = false;
-            },
+
             maxDate(selectedMonth) {
                 if (!this.$isDataEmpty(selectedMonth)) {
                     // 将选定的月份转换为Date对象

+ 6 - 3
myPages/transactionRecord/module/mescrollUni-item.vue

@@ -10,7 +10,7 @@
 		<view>
 
 			<view class="item" v-for="(item,index) in list" :key="index">
-				<view class="flex-row justify-between" >
+				<view class="flex-row justify-between" @click="goOrderDetail(item)">
 					<view class="leftText" :class="{'backColor1':item.tradeNoType == '1','backColor2':item.tradeNoType == '2','backColor3':item.tradeNoType == '3'}">
 						<text v-if="item.tradeNoType == '1'">消费</text>
 						<text v-if="item.tradeNoType == '2'">充值</text>
@@ -146,9 +146,12 @@
 				this.mescroll.resetUpScroll();
 			},
 
-			goOrderDetail(id){
+
+
+
+			goOrderDetail(item){
 				uni.navigateTo({
-					url:'/orderPages/orderDetail/index?id='+id
+					url:'/myPages/transactionRecordDetail/index?item='+JSON.stringify(item)
 				})
 			},
 		}

+ 158 - 0
myPages/transactionRecordDetail/index.vue

@@ -0,0 +1,158 @@
+<template>
+    <view class="content-wrap">
+        <view class="title-info">
+            <view v-if="tranRecords.tradeNoType == '1'" class="name skyblue">
+                <text>退款记录</text>
+            </view>
+            <view v-if="tranRecords.tradeNoType == '2'" class="name orange">
+                <text>支付</text>
+            </view>
+            <view v-if="tranRecords.tradeNoType == '3'" class="name pink">
+                <text>消费记录</text>
+            </view>
+            <view class="text">
+                <text>{{tranRecords.remark}}</text>
+            </view>
+            <view class="money">
+                <text v-if="tranRecords.tradeNoType == '2'">+</text>
+                <text v-else>-</text>{{tranRecords.amount}}
+            </view>
+        </view>
+        <view class="custom-line"></view>
+
+        <view class="transaction-detail">
+            <view class="td-v">
+                <view class="td-name">
+                    <text>当前状态</text>
+                </view>
+                <view class="td-text">
+                    <text>已完成</text>
+                </view>
+            </view>
+            <view class="td-v">
+                <view class="td-name">
+                    <text>交易时间</text>
+                </view>
+                <view class="td-text">
+                    <text>{{tranRecords.createTime}}</text>
+                </view>
+            </view>
+            <view class="td-v">
+                <view class="td-name">
+                    <text>支付方式</text>
+                </view>
+                <view class="td-text">
+                    <text v-if="tranRecords.paymentModeDesc">{{tranRecords.paymentModeDesc}}</text>
+                    <text v-else>微信支付</text>
+                </view>
+            </view>
+            <view class="td-v">
+                <view class="td-name">
+                    <text>交易单号</text>
+                </view>
+                <view class="td-text">
+                    <text>{{tranRecords.transactionNo}}</text>
+                </view>
+            </view>
+            <view class="td-v">
+                <view class="td-name">
+                    <text>储值单号</text>
+                </view>
+                <view class="td-text">
+                    <text>{{tranRecords.tradeNo}}</text>
+                </view>
+            </view>
+            <view class="td-v">
+                <view class="td-name">
+                    <text>账户余额</text>
+                </view>
+                <view class="td-text">
+                    ¥<text v-if="tranRecords.afterBalance">{{tranRecords.afterBalance}}</text>
+                    <text v-else>0</text>
+                </view>
+            </view>
+        </view>
+    </view>
+</template>
+
+<script>
+    export default {
+        data() {
+            return {
+                tranRecords: {}
+            }
+        },
+        onLoad(option) {
+            this.tranRecords = JSON.parse(option.item);
+        },
+        methods: {
+        }
+    }
+</script>
+
+<style scoped lang="scss">
+    page,body{
+    }
+    .content-wrap{
+        background: #fff;
+        .title-info{
+            text-align: center;
+            padding-top: 30px ;
+            font-family: PingFangSC-Regular, PingFang SC;
+            .name{
+                margin: 0 auto;
+                width: 70px;
+                height: 70px;
+                color: #fff;
+                border-radius: 35px;
+                display: flex;
+                justify-content: center;
+                align-items: center;
+                // background: hotpink;
+                font-size: 16px;
+            }
+            .orange{
+                background: #93D21A;
+            }
+            .skyblue{
+                background: #ED569F;
+            }
+            .pink{
+                background: #FFAF36;
+            }
+            .text{
+                font-size: 14px;
+                font-weight: 400;
+                color: #666666;
+                line-height: 22px;
+            }
+            .money{
+                line-height: 26px;
+                padding-bottom: 8px;
+                font-size: 18px;
+                font-weight: 600;
+                color: #333333;
+            }
+
+        }
+        .transaction-detail{
+            margin:16px;
+            padding-bottom: 16px;
+            font-size: 14px;
+            line-height: 26px;
+            font-weight: 500;
+            .td-v{
+                display: flex;
+                justify-content: space-between;
+                .td-name{
+                    color: #999999 ;
+                    padding-right: 14px;
+                    font-weight: 500;
+                }
+                .td-value{
+                    color: #333333;
+                }
+            }
+        }
+    }
+</style>

+ 7 - 0
pages.json

@@ -140,6 +140,13 @@
 						"enablePullDownRefresh": false
 					}
 				},
+				{
+					"path": "transactionRecordDetail/index",
+					"style": {
+						"navigationBarTitleText": "交易详情",
+						"enablePullDownRefresh": false
+					}
+				},
 				{
 					"path": "recharge/index",
 					"style": {