Forráskód Böngészése

fix:冲突修改

jiayubo 1 hete%!(EXTRA string=óta)
szülő
commit
da66a11256
2 módosított fájl, 100 hozzáadás és 86 törlés
  1. 2 1
      api/mine.js
  2. 98 85
      pages_mine/pages/income/index.vue

+ 2 - 1
api/mine.js

@@ -28,9 +28,10 @@ export function getAccountInfo() {
 
 
 //查询用户自己的账户变更记录
-export function getAccountChangeList() {
+export function getAccountChangeList(params) {
     return request({
         url: `/core/client/account-change`,
         method: 'get',
+        params
     })
 }

+ 98 - 85
pages_mine/pages/income/index.vue

@@ -2,117 +2,124 @@
     <view class="income-main">
         <view class="income-header card-box">
             <text class="income-title" @click="onShows">
-                2025年4月
+                {{ dataYMD }}
             </text>
             <view class="income-header-right">
-                <text>收入:{{ data.totalEarning }}</text>
-                <text>支出:{{ data.totalExpend }}</text>
+                <text>收入: ¥{{ data.totalEarning }}</text>
+                <text class="income-header-right-right">支出: ¥{{ data.totalExpend }}</text>
             </view>
         </view>
 
-        <view class="card-box icome-item" v-for="item in data.clientAccountChangeVOlist" :key="item.code">
-            <view class="card-left">
-                <!-- <img :src="baseUrl" alt="" class="income-img"> -->
-                <!-- <view class="plus-box"><up-icon name="plus" color="rgba(244, 67, 54, 1)" size="25" ></up-icon></view>
-                <view class="minus-box"> <up-icon name="minus" color="rgba(76, 175, 80, 1)" size="25" ></up-icon>></view> -->
-                <view class="card-left-text">
-                    <view class="card-left-name">
-                      <text>  {{ item.businessTierName }}</text>
-                      (<dict-tag :options="jlzj_money_change_type"
-                      :value="item.sourceType" />)
+        <view v-if="data.clientAccountChangeVOlist && data.clientAccountChangeVOlist.length > 0">
+            <view class="card-box icome-item" v-for="item in data.clientAccountChangeVOlist" :key="item.code" @click="onClick(item)">
+                <view class="card-left">
+                    <!-- <img :src="baseUrl" alt="" class="income-img"> -->
+                    <view class="card-left-text">
+                        <view class="card-left-name">
+                            <dict-tag :options="jlzj_client_source_type" :value="item.sourceType" />
+                            ({{ item.businessTierName }})
+                        </view>
+                        <view class="card-left-date">{{ item.createTime }}</view>
                     </view>
-                    <view class="card-left-date" :style="`color: ${item.color};`">{{ item.createTime }}</view>
                 </view>
-            </view>
-            <view class="card-rigth">
-                {{ item.changeMoney }}
-            </view>
 
+                <view class="card-rigth"
+                    :style="{ color: item.changeType === '1' ? 'rgba(76, 175, 80, 1)' : 'rgba(244, 67, 54, 1)' }">
+                    {{ item.changeType === '1' ? '+' : '-' }}{{ item.changeMoney }}
+                </view>
+
+            </view>
+        </view>
+        <view v-else>
+            <NoneView value="您还没有相关账单" />
         </view>
 
 
-        <up-picker :show="show" ref="uPickerRef" :columns="columns" @confirm="confirm"
-            @change="changeHandler"></up-picker>
+        <up-datetime-picker :show="show" v-model="datetime" mode="date" ref="uPickerRef" @confirm="confirm"
+            @cancel="cancel"></up-datetime-picker>
     </view>
 </template>
 
 <script setup>
-import { ref, reactive } from 'vue';
+import { ref, computed } from 'vue'
 import { getAccountChangeList } from "@/api/mine";
 import {
-	onShow
+    onShow
 } from '@dcloudio/uni-app';
 import config from '@/config'
 import DictTag from '@/components/DictTag/index.vue'
 import {
-		useDict
-	} from '@/utils/dict.js';
-    const {
-        jlzj_money_change_type
-	} = useDict('jlzj_money_change_type');
+    useDict
+} from '@/utils/dict.js';
+import dayjs from 'dayjs/esm/index'
+import NoneView from '@/components/NoneView/index.vue'
+const {
+    jlzj_money_change_type,
+    jlzj_client_source_type
+} = useDict('jlzj_money_change_type', 'jlzj_client_source_type');
 const baseUrl = config.baseUrl
 const userType = uni.getStorageSync('userType') //读取本地存储
-const data = ref({})
+const data = ref({
+    totalEarning: 0,
+    totalExpend: 0,
+    clientAccountChangeVOlist: []
+})
 
 const show = ref(false);
-const columns = reactive([
-    ['中国', '美国'],
-    ['深圳', '厦门', '上海', '拉萨']
-]);
-const columnData = reactive([
-    ['深圳', '厦门', '上海', '拉萨'],
-    ['得州', '华盛顿', '纽约', '阿拉斯加']
-]);
+const datetime = ref(Date.now());
 
-const uPickerRef = ref(null)
-const changeHandler = (e) => {
-    const {
-        columnIndex,
-        value,
-        values,
-        index,
-    } = e;
-
-    if (columnIndex === 0) {
-        uPickerRef.value.setColumnValues(1, columnData[index]);
-    }
-};
+const dataYMD = computed(() => {
+    return dayjs(datetime.value).format("YYYY年MM月DD日")
+})
 
+const uPickerRef = ref(null)
 const onShows = () => {
     show.value = true;
 };
 
-const confirm = (e) => {
-    console.log('confirm', e);
+const confirm = () => {
+    console.log('confirm', datetime.value);
+    show.value = false;
+    init();
+};
+
+const cancel = () => {
     show.value = false;
 };
+const onClick = (record) =>{
+    record.mainOrderId && uni.navigateTo({
+        url: `/pages_classify/pages/orderItem/orderdetails?mainOrderId=${record.mainOrderId}`
+    });
+}
 
-const init = async() => {
-	try {
-		uni.showLoading({
-			title: '数据加载中...'
-		});
-
-		if(userType === 2){
-			// const res = await getVolunteerAccountInfo();
-			// data.value =res.data;			
-		}
-        if(userType === 1){
-            const res = await getAccountChangeList();
-            console.log(1,res);
-            data.value = res.data;	
+const init = async () => {
+    try {
+        uni.showLoading({
+            title: '数据加载中...'
+        });
+
+        if (userType === 2) {
+            // const res = await getVolunteerAccountInfo();
+            // data.value =res.data;			
+        }
+        if (userType === 1) {
+            const res = await getAccountChangeList({
+                createTime: dayjs(datetime.value).format('YYYY-MM-DD')
+            });
+            console.log(1, res);
+            data.value = res.data;
         }
-	} catch (error) {
-		console.log('error', error);
-		uni.showToast({
-			title: error.msg,
-			icon: 'error',
-		});
-	} finally {
-		uni.hideLoading();
-	}
+    } catch (error) {
+        console.log('error', error);
+        uni.showToast({
+            title: error.msg,
+            icon: 'error',
+        });
+    } finally {
+        uni.hideLoading();
+    }
 }
-onShow(()=>{
+onShow(() => {
     init();
 })
 </script>
@@ -156,9 +163,11 @@ onShow(()=>{
             color: rgba(0, 0, 0, 1);
             display: flex;
             align-items: flex-start;
-            flex-direction: column;
             justify-content: center;
 
+            .income-header-right-right {
+                margin-left: 8rpx;
+            }
         }
 
     }
@@ -169,33 +178,39 @@ onShow(()=>{
     display: flex;
     align-items: center;
     justify-content: space-between;
+
     .card-left {
         display: flex;
         align-items: center;
+
         .income-img {
             width: 40px;
             height: 40px;
         }
+
         .card-left-text {
             margin-left: 12px;
+
             .card-left-name {
                 font-size: 16px;
-            font-weight: 700;
-            line-height: 23.17px;
-            color: rgba(0, 0, 0, 1);
-            margin-bottom: 6px;
+                font-weight: 700;
+                line-height: 23.17px;
+                color: rgba(0, 0, 0, 1);
+                margin-bottom: 6px;
 
-            display: flex;
-            align-items: center;
+                display: flex;
+                align-items: center;
             }
+
             .card-left-date {
                 font-size: 14px;
                 font-weight: 500;
                 line-height: 16.41px;
                 color: rgba(153, 153, 153, 1);
             }
-            
+
         }
+
         .card-rigth {
             font-size: 20px;
             font-weight: 700;
@@ -205,6 +220,4 @@ onShow(()=>{
     }
 
 }
-
-
 </style>