Browse Source

账单详情

chenjj 3 months ago
parent
commit
08a6606199

+ 7 - 0
api/mine.js

@@ -79,3 +79,10 @@ export function getWithdrawStatus() {
     })
 }
 
+//账单详情
+export function getIncomeDetails(volunteerTakeRecordId) {
+    return request({
+        url: `/core/volunteer/take/${volunteerTakeRecordId}`,
+        method: 'get',
+    })
+}

+ 12 - 0
pages.json

@@ -11,6 +11,12 @@
 		}
 	},
 	"pages": [
+		// {
+		// 	"path": "pages/test/index",
+		// 	"style": {
+		// 		"navigationBarTitleText": "测试"
+		// 	}
+		// },
 		{
 			"path": "pages/index",
 			"style": {
@@ -200,6 +206,12 @@
 						"navigationBarTitleText": "收入明细"
 					}
 				},
+				{
+					"path": "pages/income/details",
+					"style": {
+						"navigationBarTitleText": "账单详情"
+					}
+				},
 				{
 					"path": "pages/addBankCard/index",
 					"style": {

+ 16 - 19
pages/index.vue

@@ -224,7 +224,7 @@ const getBanners = async () => {
     if (value_res.code === 200 && value_res.data.picture) {
       ValueZone.value = value_res.data.picture.split(',')
     }
-    
+
     const hot_node = await slideshow(30)
     if (hot_node.code === 200 && hot_node.data.picture) {
       ValueZoneSwiper.value = hot_node.data.picture.split(',')
@@ -254,7 +254,7 @@ const settingAddress = async () => {
       latitude,
       longitude,
     }
-    const res = await settingHomeAddress(parmas)
+    await settingHomeAddress(parmas)
     leftList.value = [];
     rightList.value = [];
     userType === 1 && getList()
@@ -294,26 +294,22 @@ onPageScroll(e => {
 onMounted(async () => {
 
   console.log("TCL:  uni.$u",)
-  getNotice()
-  const token = getToken();
-
+  try {
+    getNotice()
+    const token = getToken();
     const res_dara = await regionAddresstree()
     addresstree.value = res_dara.data
-
     if (token) {
-      locateTheCurrentAddress(res_dara.data)
-        .then((res) => {
-          data.address = res
-          console.log("TCL: settingAddress0 -> data", data)
-          settingAddress()
-        })
-        .catch((error) => {
-          console.log('获取地址失败!', error)
-          getList()
-        })
-    } else {
-      getList();
+      const res = await locateTheCurrentAddress(res_dara.data);
+      data.address = res
+      console.log("TCL: settingAddress0 -> data", data)
+      await settingAddress()
+      return;
     }
+    getList();
+  } catch (error) {
+    console.log("TCL:  error", error)
+  }
 })
 
 </script>
@@ -396,7 +392,8 @@ onMounted(async () => {
       transform: rotate(90deg);
       border: 2rpx solid #D8D8D8;
     }
-    .search-group{
+
+    .search-group {
       display: flex;
       align-items: center;
       margin-left: 10rpx;

+ 69 - 0
pages/test/index.scss

@@ -0,0 +1,69 @@
+.details-main {
+    padding: 20rpx;
+
+    position: fixed;
+    left: 0px;
+    top: 0px;
+    right: 0px;
+    bottom: 0;
+    background: #fff;
+
+    overflow: hidden;
+    overflow-y: auto;
+
+}
+
+.header-box {
+    margin-top: 48rpx;
+    padding: 24rpx 0;
+
+    .price-img {
+        width: 140rpx;
+        height: 140rpx;
+        background-color: #000000;
+        margin-bottom: 12rpx;
+    }
+
+    .header-title {
+        font-family: PingFang SC;
+        font-size: 32rpx;
+        font-weight: normal;
+        line-height: 32rpx;
+        letter-spacing: normal;
+        color: #000000;
+        padding: 20rpx 0 30rpx;
+    }
+
+    .header-price {
+        font-family: PingFang SC;
+        font-size: 34rpx;
+        font-weight: bold;
+        line-height: 48rpx;
+        letter-spacing: normal;
+        color: #3D3D3D;
+       
+    }
+}
+
+.stauts-box {
+    padding: 23rpx 0;
+    display: flex;
+
+    .stauts-text {
+        margin-right: 44rpx;
+    }
+}
+
+.list-box {
+    padding: 23rpx 0;
+
+    .list-item {
+        display: flex;
+
+        .list-name {
+            width: 150rpx;
+        }
+    }
+
+
+}

+ 76 - 0
pages/test/index.vue

@@ -0,0 +1,76 @@
+<template>
+    <scroll-view refresher-enabled :refresher-triggered="isRefreshing" @refresherrefresh="onCustomRefresh"
+        class="details-main" @scrolltolower="scrolltolower" scroll-y>
+        <view class="header-box flex_c_c_f hr-solid">
+            <view class="price-img"></view>
+            <view class="header-title">余额提现-到支付宝(1942)</view>
+            <view class="header-price">1.10</view>
+        </view>
+        <view class="stauts-box  hr-solid">
+            <view class="font-30-333 stauts-text ">当前状态</view>
+            <view>
+                <up-steps current="2" direction="column" dot>
+                    <up-steps-item title="发起提现" desc="2025年6月9日 12:23">
+                    </up-steps-item>
+                    <up-steps-item title="银行处理中" desc=" ">
+                    </up-steps-item>
+                    <up-steps-item title="到账" desc="2025年6月9日 13:23"></up-steps-item>
+                </up-steps>
+            </view>
+        </view>
+        <view class="list-box">
+            <view v-for="item in list" :key="item.key" class="list-item">
+                <view class="font-30-333 list-name">{{ item.name }}</view>
+                <view class="font-30-333">{{ item.key }}</view>
+            </view>
+        </view>
+    </scroll-view>
+
+</template>
+
+<script setup>
+import { ref } from 'vue';
+
+const isRefreshing = ref(false)
+
+const list = [
+    {
+        name: '提现金额',
+        key: '1'
+    },
+    {
+        name: '服务费',
+        key: '1'
+    },
+    {
+        name: '申请时间',
+        key: '1'
+    },
+    {
+        name: '到账时间',
+        key: '1'
+    },
+    {
+        name: '提现银行',
+        key: '1'
+    },
+    {
+        name: '提现单号',
+        key: '1'
+    },
+]
+
+const onCustomRefresh = () => {
+    isRefreshing.value = true;
+
+    setTimeout(() => {
+        isRefreshing.value = false;
+    }, 1000);
+};
+const scrolltolower = () => {
+
+};
+</script>
+<style lang="scss" scoped>
+@import "./index.scss";
+</style>

+ 121 - 0
pages_mine/pages/income/details.vue

@@ -0,0 +1,121 @@
+<template>
+    <scroll-view refresher-enabled :refresher-triggered="isRefreshing" @refresherrefresh="onCustomRefresh"
+        class="details-main" @scrolltolower="scrolltolower" scroll-y>
+        <view class="header-box flex_c_c_f hr-solid">
+            <view class="price-img"></view>
+            <view class="header-title">余额提现-到支付宝({{ data.alipayName }})</view>
+            <view class="header-price">{{ data.takeAmount }}</view>
+        </view>
+        <view class="stauts-box  hr-solid">
+            <view class="font-30-333 stauts-text ">当前状态</view>
+            <view>
+                <up-steps :current="current" direction="column" dot>
+                    <up-steps-item title="发起提现" :desc="data.createTime">
+                    </up-steps-item>
+                    <up-steps-item title="已驳回" :desc="data.rejectReason" v-if="data.appStatus === '3'" error></up-steps-item>
+                    <up-steps-item title="后台处理中" :desc="data.updateTime" v-else></up-steps-item>
+                    <up-steps-item title="打款失败"  v-if="data.isPay === '2'" error></up-steps-item>
+                    <up-steps-item title="到账" :desc="data.lastTime"  v-if="[ '1','0'].includes(data.isPay)"></up-steps-item>
+                </up-steps>
+            </view>
+        </view>
+        <view class="list-box">
+            <view v-for="item in list" :key="item.key" class="list-item">
+                <view class="font-30-333 list-name">{{ item.name }}</view>
+                <view class="font-30-333" v-if="item.type === 'value'">
+                   支付宝
+                </view>
+                <view class="font-30-333" v-else>{{ data[item.key] ||'-'}}</view>
+            </view>
+        </view>
+    </scroll-view>
+
+</template>
+
+<script setup>
+import { computed, ref } from 'vue';
+import { onLoad } from '@dcloudio/uni-app';
+import { getIncomeDetails } from "@/api/mine";
+import DictTag from '@/components/DictTag/index.vue'
+import {
+    useDict
+} from '@/utils/dict.js';
+const isRefreshing = ref(false)
+const list = [
+    {
+        name: '提现金额',
+        key: 'shoudAmount'
+    },
+    {
+        name: '税额',
+        key: 'taxAmount'
+    },
+    {
+        name: '申请时间',
+        key: 'createTime'
+    },
+    {
+        name: '到账时间',
+        key: 'lastTime'
+    },
+    {
+        name: '打款方式',
+        key: 'payType',
+        type: 'value',
+    },
+    {
+        name: '提现单号',
+        key: 'volunteerTakeRecordId'
+    },
+]
+const id = ref(null);
+const data = ref({
+    alipayName: '**',
+    createTime: '',
+    takeAmount: 0.0,
+});
+
+const current = computed(()=>{
+    if(['3','1'].includes(data.value.appStatus) || ['0'].includes(data.value.isPay)){
+        return 1
+    }   
+    return 2
+})
+const onCustomRefresh = () => {
+
+    getDetails();
+};
+const scrolltolower = () => {
+    console.log('scrolltolower');
+
+};
+
+const getDetails = async () => {
+    try {
+        isRefreshing.value = true;
+        const res = await getIncomeDetails(id.value);
+        if (res.code !== 200) {
+            throw res.msg || '账单详情获取失败!'
+        }
+        data.value = res.data;
+    } catch (error) {
+        console.log("TCL: getDetails -> error", error)
+        uni.showToast({
+            title: error.message || error,
+            icon: 'none'
+        });
+    } finally {
+        isRefreshing.value = false;
+    }
+};
+
+
+onLoad((options) => {
+    console.log("TCL: options", options)
+    id.value = options.sourceId;
+    getDetails();
+})
+</script>
+<style lang="scss" scoped>
+@import "./index.scss";
+</style>

File diff suppressed because it is too large
+ 72 - 0
pages_mine/pages/income/index.scss


+ 10 - 2
pages_mine/pages/income/index.vue

@@ -38,8 +38,9 @@
                         <view :style="{ color: item.changeType === '1' ? 'rgba(76, 175, 80, 1)' : 'rgba(244, 67, 54, 1)' }">{{ item.changeType === '1' ? '+' : '-' }}{{ item.changeMoney }}</view>
 
                         <view class="is_pay_class" v-if="item.isPay !== '99'">
-                                    <dict-tag :options="is_pay" :value="item.isPay" />
-                                </view>
+                            {{item.afterBalance}}
+                                    <!-- <dict-tag :options="is_pay" :value="item.isPay" /> -->
+                        </view>
                     </view>
                 </view>
                 <up-loadmore style="margin-top: 40rpx;" :status="loadmoreInfo.status"
@@ -120,6 +121,13 @@ const cancel = () => {
     show.value = false;
 };
 const onClick = (record) => {
+	console.log("TCL: onClick -> record", record);
+    if(['10','11'].includes(record.sourceType)){
+        uni.navigateTo({
+            url: `/pages_mine/pages/income/details?sourceId=${record.sourceId}`
+        })
+        return;
+    }
     record.mainOrderId && uni.navigateTo({
         url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${record.mainOrderId}`
     });