Procházet zdrojové kódy

Merge branch 'admin_dev' of http://112.213.107.185:3000/cwg-crm/gypsy-crm-frontend-vu into admin_dev

zhb před 1 měsícem
rodič
revize
8a3638a85c

+ 11 - 0
components/cwg-detail-popup.vue

@@ -67,6 +67,14 @@ const getVisibleActions = (menuList, rowData) => {
         return item.show !== false
     })
 }
+// 格式化标签文本 详情
+const formatTagText = (value, column) => {
+  console.log()
+  if (column.tagMap && column.tagMap[value]) {
+    return column.tagMap[value]
+  }
+  return value || '-'
+}
 const formatCellValue = (value, column, row) => {
     if (column.formatter) {
         return column.formatter({ value, row })
@@ -74,6 +82,9 @@ const formatCellValue = (value, column, row) => {
     if (column.type === 'date' && value) {
         return formatDate(value, column.dateFormat || 'YYYY-MM-DD HH:mm:ss')
     }
+  if (column.type === 'tag' && value) {
+    return formatTagText(value, column)
+  }
     if (value === null || value === undefined) {
         return '-'
     }

+ 242 - 247
components/cwg-payment.vue

@@ -1,334 +1,329 @@
 <template>
-    <view class="notice-container">
-        <cwg-dropdown ref="dropdownRef" :menu-list="[]" @menuClick="handleMenuClick">
-            <view class="pc-header-btn pc-payment-btn">
-                <cwg-icon name="crm-payment" color="#141d22" @click="openNotice" />
-                <text class="balance-text">{{ formattedBalance }} USD</text>
+  <view class="notice-container">
+    <cwg-dropdown ref="dropdownRef" :menu-list="[]" @menuClick="handleMenuClick">
+      <view class="pc-header-btn pc-payment-btn">
+        <cwg-icon name="crm-payment" color="#141d22" @click="openNotice" />
+        <text class="balance-text">{{ formattedBalance }} USD</text>
+      </view>
+      <template #btn>
+        <view class="right-drawer custom-payment-drawer">
+          <view class="drawer-header">
+            <text class="drawer-title">隐藏余额</text>
+            <switch :checked="!isShow" @change="toggleShow" color="#6c8595" style="transform:scale(0.7)" />
+          </view>
+          <view class="drawer-content">
+            <view class="balance-amount">{{ formattedBalance }} USD</view>
+            <view @click="toPaymentHistory">
+              <view class="account-number">${{ formattedPendingWithdrawAmount }}</view>
+              <view class="account-type" v-t="'wallet.pendingWithdraw'"></view>
             </view>
-            <template #btn>
-                <view class="right-drawer custom-payment-drawer">
-                    <view class="drawer-header">
-                        <text class="drawer-title">隐藏余额</text>
-                        <switch :checked="!isShow" @change="toggleShow" color="#6c8595" style="transform:scale(0.7)" />
-                    </view>
-                    <view class="drawer-content">
-                        <view class="balance-amount">{{ formattedBalance }} USD</view>
-                        <view class="account-type">交易账户</view>
-                        <view class="account-number">#{{ userStore.userInfo.customInfo?.cId || '--' }}</view>
-                    </view>
-                    <view class="drawer-actions">
-                        <button class="action-btn" @click.stop="goPages(1)">转账</button>
-                        <button class="action-btn" @click.stop="goPages(2)">出金</button>
-                    </view>
-                </view>
-            </template>
-        </cwg-dropdown>
-    </view>
+
+          </view>
+          <view class="drawer-actions">
+            <button class="action-btn" @click.stop="goPages(1)" v-t="'wallet.item6'"></button>
+            <button class="action-btn" @click.stop="goPages(2)" v-t="'wallet.item7'"></button>
+          </view>
+        </view>
+      </template>
+    </cwg-dropdown>
+  </view>
 </template>
 
 <script setup lang="ts">
-import { computed, ref, onMounted } from 'vue'
-import { newsApi } from '@/service/news'
-import useRouter from "@/hooks/useRouter";
-import { drawApi } from "@/service/draw";
-import { useI18n } from 'vue-i18n'
-import useUserStore from '@/stores/use-user-store'
-const { t, locale } = useI18n()
-const userStore = useUserStore()
-import { userToken } from "@/composables/config";
-const isRed = ref(false)
-const dropdownRef = ref(null)
-const close = () => {
+  import { computed, ref, onMounted } from 'vue'
+  import { newsApi } from '@/service/news'
+  import useRouter from '@/hooks/useRouter'
+  import { drawApi } from '@/service/draw'
+  import { useI18n } from 'vue-i18n'
+  import useUserStore from '@/stores/use-user-store'
+
+  const { t, locale } = useI18n()
+  const userStore = useUserStore()
+  import { userToken } from '@/composables/config'
+
+  const isRed = ref(false)
+  const dropdownRef = ref(null)
+  const close = () => {
     dropdownRef.value.close()
-}
-const router = useRouter();
-const menuList = []
-const customMenuList = computed(() =>
-    [{
-        label: t('wallet.item6'),
-        type: 1
-    },
-    {
-        label: t('wallet.item7'),
-        type: 2
-    },
-    ])
-
-const handleMenuClick = ({ value }) => {
+  }
+  const router = useRouter()
+  const menuList = []
+
+  const handleMenuClick = ({ value }) => {
     goPages(value)
-}
-const NumberDecimal = (value) => {
+  }
+  const NumberDecimal = (value) => {
     let realVal = ''
     if (!isNaN(value) && value !== '') {
-        // 截取当前数据到小数点后两位
-        realVal = parseFloat(value).toFixed(2)
+      // 截取当前数据到小数点后两位
+      realVal = parseFloat(value).toFixed(2)
     } else {
-        realVal = '0'
+      realVal = '0'
     }
     return realVal
-};
-const NumberDesensitization = (value) => {
+  }
+  const NumberDesensitization = (value) => {
     let realVal = ''
     if (!isNaN(value) && value !== '') {
-        value = value.toString();
-        realVal = value.substr(0, 2) + '****' + value.substr(-2);
+      value = value.toString()
+      realVal = value.substr(0, 2) + '****' + value.substr(-2)
     } else {
-        realVal = '--'
+      realVal = '--'
     }
     return realVal
-};
-const isShow = ref(true)
-const walletbalance = ref(0)
-const pendingWithdrawAmount = ref(0)
-const formattedBalance = computed(() => {
-    const value = walletbalance.value || "0"
+  }
+  const isShow = ref(true)
+  const walletbalance = ref(0)
+  const pendingWithdrawAmount = ref(0)
+  const formattedBalance = computed(() => {
+    const value = walletbalance.value || '0'
     const decimalValue = NumberDecimal(value)
     return isShow.value ? decimalValue : NumberDesensitization(decimalValue)
-})
-const formattedPendingWithdrawAmount = computed(() => {
-    const value = pendingWithdrawAmount.value || "0"
+  })
+  const formattedPendingWithdrawAmount = computed(() => {
+    const value = pendingWithdrawAmount.value || '0'
     const decimalValue = NumberDecimal(value)
     return isShow.value ? decimalValue : NumberDesensitization(decimalValue)
-})
-const getWalletList = async () => {
-    let res = await drawApi.walletbalance({});
+  })
+  const getWalletList = async () => {
+    let res = await drawApi.walletbalance({})
     if (res.code == 200) {
-        if (res.data != null) {
-            walletbalance.value = res.data;
-        }
+      if (res.data != null) {
+        walletbalance.value = res.data
+      }
     } else {
 
-        uni.showToast({
-            title: res.msg,
-            icon: 'none'
-        });
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+      })
     }
-}
+  }
 
-//获取处理中出金金额
-const getPendingWithdrawAmount = async () => {
-    let res = await drawApi.pendingWithdrawAmount({});
+  //获取处理中出金金额
+  const getPendingWithdrawAmount = async () => {
+    let res = await drawApi.pendingWithdrawAmount({})
     if (res.code == 200) {
-        if (res.data != null) {
-            pendingWithdrawAmount.value = res.data;
-        }
+      if (res.data != null) {
+        pendingWithdrawAmount.value = res.data
+      }
     } else {
-        uni.showToast({
-            title: res.msg,
-            icon: 'none'
-        });
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+      })
     }
-}
-const toggleShow = (e) => {
+  }
+  const toggleShow = (e) => {
     isShow.value = !e.detail.value
-}
+  }
 
-const goPages = (type) => {
+  const goPages = (type) => {
     let path
     if (type == 1) {
-        path = '/pages/customer/wallet-transfer'
+      path = '/pages/customer/wallet-transfer'
     } else if (type == 2) {
-        path = '/pages/customer/wallet-history' // 此处根据实际“出金”路由修改
+      path = '/pages/customer/wallet-history' // 此处根据实际“出金”路由修改
     }
     router.push(path)
     close()
-}
-const goMore = () => {
+  }
+  const toPaymentHistory = () => {
+    router.push({ path: '/pages/customer/payment-history',query:{fromPending: "true"} })
+  }
+  const goMore = () => {
     router.push({
-        path: '/pages/common/notice'
+      path: '/pages/common/notice',
     })
     close()
-}
-onMounted(() => {
+  }
+  onMounted(() => {
     if (!userToken.value) return
     getWalletList()
     getPendingWithdrawAmount()
-})
+  })
 </script>
 
 <style scoped lang="scss">
-@import "@/uni.scss";
+  @import "@/uni.scss";
 
-.notice-container {
+  .notice-container {
     :deep(.cwg-dropdown-menu-container) {
-        //left: px2rpx(-280) !important;
-        //right: px2rpx(0) !important;
+      //left: px2rpx(-280) !important;
+      //right: px2rpx(0) !important;
     }
 
     @media screen and (max-width: 991px) {
-        :deep(.cwg-dropdown-menu-container) {
-            left: px2rpx(-270) !important;
-            //max-width: px2rpx(400);
-        }
+      :deep(.cwg-dropdown-menu-container) {
+        left: px2rpx(-270) !important;
+        //max-width: px2rpx(400);
+      }
     }
 
     .pc-header-btn {
-        position: relative;
-        width: fit-content;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        padding: 0 px2rpx(12);
-
+      position: relative;
+      width: fit-content;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      padding: 0 px2rpx(12);
 
 
-        &.has-dot::after {
-            content: '';
-            position: absolute;
-            top: px2rpx(4);
-            right: px2rpx(4);
-            width: px2rpx(8);
-            height: px2rpx(8);
-            background-color: #f56c6c;
-            border-radius: 50%;
-        }
+      &.has-dot::after {
+        content: '';
+        position: absolute;
+        top: px2rpx(4);
+        right: px2rpx(4);
+        width: px2rpx(8);
+        height: px2rpx(8);
+        background-color: #f56c6c;
+        border-radius: 50%;
+      }
     }
 
     .pc-payment-btn {
-        background-color: #e4e9ec;
-        border: 1px solid #141d22;
-        border-radius: px2rpx(4);
-        padding: px2rpx(4) px2rpx(12);
-        height: px2rpx(36);
-        cursor: pointer;
-        
-        .balance-text {
-            margin-left: px2rpx(6);
-            font-size: px2rpx(14);
-            font-weight: 500;
-            color: #141d22;
-        }
+      border-radius: px2rpx(4);
+      padding: px2rpx(4) px2rpx(12);
+      height: px2rpx(36);
+      cursor: pointer;
+
+      .balance-text {
+        margin-left: px2rpx(6);
+        font-size: px2rpx(14);
+        font-weight: 500;
+        color: #141d22;
+      }
     }
 
     .custom-payment-drawer {
-        width: px2rpx(260);
-        background-color: var(--color-white);
-        padding: 0;
-        border-radius: px2rpx(8);
-        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
-        
-        .drawer-header {
-            display: flex;
-            justify-content: space-between;
-            align-items: center;
-            padding: px2rpx(12) px2rpx(16);
-            border-bottom: 1px solid #f0f0f0;
-            
-            .drawer-title {
-                font-size: px2rpx(14);
-                color: #333;
-            }
+      width: px2rpx(260);
+      background-color: var(--color-white);
+      padding: 0;
+      border-radius: px2rpx(8);
+      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
+
+      .drawer-header {
+        display: flex;
+        justify-content: space-between;
+        align-items: center;
+        padding: px2rpx(12) px2rpx(16);
+        border-bottom: 1px solid #f0f0f0;
+
+        .drawer-title {
+          font-size: px2rpx(14);
+          color: #333;
         }
-        
-        .drawer-content {
-            padding: px2rpx(20) px2rpx(16);
-            
-            .balance-amount {
-                font-size: px2rpx(18);
-                font-weight: bold;
-                color: #141d22;
-                margin-bottom: px2rpx(8);
-            }
-            
-            .account-type {
-                font-size: px2rpx(13);
-                color: #666;
-                margin-bottom: px2rpx(4);
-            }
-            
-            .account-number {
-                font-size: px2rpx(13);
-                color: #999;
-            }
+      }
+
+      .drawer-content {
+        padding: px2rpx(20) px2rpx(16);
+
+        .balance-amount {
+          font-size: px2rpx(18);
+          font-weight: bold;
+          color: #141d22;
+          margin-bottom: px2rpx(8);
+        }
+
+        .account-type {
+          font-size: px2rpx(13);
+          color: #666;
+          margin-bottom: px2rpx(4);
+        }
+
+        .account-number {
+          font-size: px2rpx(13);
+          color: #999;
         }
-        
-        .drawer-actions {
-            display: flex;
-            gap: px2rpx(12);
-            padding: 0 px2rpx(16) px2rpx(20);
-            
-            .action-btn {
-                flex: 1;
-                height: px2rpx(36);
-                line-height: px2rpx(36);
-                background-color: #f5f7fa;
-                color: #333;
-                font-size: px2rpx(13);
-                border-radius: px2rpx(4);
-                margin: 0;
-                
-                &::after {
-                    border: none;
-                }
-                
-                &:active {
-                    background-color: #e4e7ed;
-                }
-            }
+      }
+
+      .drawer-actions {
+        display: flex;
+        gap: px2rpx(12);
+        padding: 0 px2rpx(16) px2rpx(20);
+
+        .action-btn {
+          flex: 1;
+          height: px2rpx(36);
+          line-height: px2rpx(36);
+          background-color: #f5f7fa;
+          color: #333;
+          font-size: px2rpx(13);
+          border-radius: px2rpx(4);
+          margin: 0;
+
+          &::after {
+            border: none;
+          }
+
+          &:active {
+            background-color: #e4e7ed;
+          }
         }
+      }
     }
 
     .notification-list {
-        width: 100%;
+      width: 100%;
     }
 
     .notification-item {
-        display: flex;
-        align-items: center;
-        justify-content: space-between;
-        padding: px2rpx(12) px2rpx(16);
-        border-bottom: 1px solid #f0f0f0;
-        cursor: pointer;
-        transition: all 0.3s;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      padding: px2rpx(12) px2rpx(16);
+      border-bottom: 1px solid #f0f0f0;
+      cursor: pointer;
+      transition: all 0.3s;
 
-        &:hover {
-            background-color: rgba(0, 0, 0, 0.05);
-        }
+      &:hover {
+        background-color: rgba(0, 0, 0, 0.05);
+      }
 
-        .item-content {
-            flex: 1;
+      .item-content {
+        flex: 1;
 
-            .item-title {
-                font-size: px2rpx(14);
-                color: #333;
-                line-height: 1.4;
-                margin-bottom: px2rpx(4);
-            }
+        .item-title {
+          font-size: px2rpx(14);
+          color: #333;
+          line-height: 1.4;
+          margin-bottom: px2rpx(4);
+        }
 
-            .item-time {
-                font-size: px2rpx(12);
-                color: #999;
-            }
+        .item-time {
+          font-size: px2rpx(12);
+          color: #999;
         }
+      }
 
-        .item-badge {
-            margin-left: px2rpx(12);
+      .item-badge {
+        margin-left: px2rpx(12);
 
-            .dot {
-                width: px2rpx(8);
-                height: px2rpx(8);
-                background-color: #f56c6c;
-                border-radius: 50%;
-            }
+        .dot {
+          width: px2rpx(8);
+          height: px2rpx(8);
+          background-color: #f56c6c;
+          border-radius: 50%;
         }
+      }
     }
 
     .logout-wrap {
-        margin-top: auto;
-        padding: 20px 16px;
-        margin-bottom: 20px;
+      margin-top: auto;
+      padding: 20px 16px;
+      margin-bottom: 20px;
     }
 
     .logout-btn {
-        height: 44px;
-        background: #f4eadf;
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        gap: 8px;
-        color: #ff9800;
-        font-weight: 600;
-        cursor: pointer;
+      height: 44px;
+      background: #f4eadf;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      gap: 8px;
+      color: #ff9800;
+      font-weight: 600;
+      cursor: pointer;
     }
-}
+  }
 </style>

+ 3 - 0
components/cwg-tabel.vue

@@ -439,6 +439,9 @@ const formatCellValue = (value, column, row) => {
     if (column.type === 'date' && value) {
         return formatDate(value, column.dateFormat || 'YYYY-MM-DD HH:mm:ss')
     }
+    if (column.type === 'tag' && value) {
+        return formatTagText(value, row)
+    }
     if (value === null || value === undefined) {
         return '-'
     }

+ 2 - 2
config/index.ts

@@ -14,11 +14,11 @@ const config = {
   Host80: ht + "//secure." + ho + ".com",
   // Host00: ht + "//ucard." + ho + ".com",
   // Host85: ht + "//ucard." + ho + ".com",
-  // Host04: ht + "//pay." + ho + ".com",
+  Host04: ht + "//pay." + ho + ".com",
   // Host80: 'http://192.168.0.21:8000',
   Host00: 'http://192.168.0.21:8000',
   Host85: 'http://192.168.0.21:8000',
-  Host04: 'http://192.168.0.21:8004',
+  // Host04: 'http://192.168.0.21:8004',
   Host90: ht + "//data." + ho + ".com",
   HostShop: ht + "//shopcustom." + ho + ".com",
   HostShopImg: ht + "//shopmanager." + ho + ".com",

+ 50 - 214
pages/customer/wallet-history.vue

@@ -1,25 +1,20 @@
 <template>
     <cwg-page-wrapper class="create-page" :isHeaderFixed="true">
-        <cwg-header :title="t('Ib.Report.Tit4')" />
+        <cwg-header :title="t('wallet.item57')" />
         <view class="info-card">
             <cwg-complex-search :fields="filterFields" v-model="searchParams" @search="handleSearch"
                 @reset="handleReset" />
             <cwg-tabel ref="tableRef" :columns="columns" :immediate="false" :mobilePrimaryFields="mobilePrimaryFields"
                 :queryParams="search" :api="listApi" :show-operation="false">
-                <template #symbol="{ row }">
-                    <view class="symbol-cell">
-                        <view class="pair">{{ getSymbolParts(row.symbol)[0] }}/{{ getSymbolParts(row.symbol)[1]
-                        }}</view>
-                        <view class="desc">{{ row.openPrice }}
-                            <text :class="getCmdColorClass(row.cmdName)">{{ formatCmdName(row.cmdName) }}{{ row.volume
-                            }}{{ t('Label.Lot') }}</text>
-                        </view>
-                    </view>
+                <template #source="{ row }">
+                    <text v-if="row.source == 'RAFFLE'" v-t="'wallet.item49_5'"></text>
+                    <text v-if="row.source == 'TRANSFER'" v-t="'wallet.item49_4'"></text>
+                    <text v-if="row.source == 'MANAGER'" v-t="'wallet.item49_1'"></text>
+                    <text v-if="row.source == 'INTERESTRATE'" v-t="'news_add_field1.NewYear24.itemW1'"></text>
+                    <text v-if="row.source == 'CASHBACK'" v-t="'news_add_field1.NewYear24.itemW2'"></text>
                 </template>
-                <template #profit="{ row }">
-                    <view class="symbol-cell">
-                        <text :class="getProfitColorClass(row.profit)">{{ row.profit || 0 }}</text>
-                    </view>
+                <template #amount="{ row }">
+                    <text>{{ numberFormat(row.amount || 0) }}</text>
                 </template>
             </cwg-tabel>
         </view>
@@ -32,117 +27,75 @@ import { useI18n } from 'vue-i18n';
 const { t, locale } = useI18n();
 import { onLoad } from '@dcloudio/uni-app'
 import { customApi } from '@/service/custom';
-import { useAccountOptions } from '@/composables/useAccountOptions'
-const { loginOptions, isLoaded, isSuccess } = useAccountOptions()
+import { useFilters } from '@/composables/useFilters'
+const { numberFormat, numberDecimal } = useFilters()
+
 const search = reactive({
-    login: null
+    startDate: '',
+    endDate: ''
 })
-const typeMap = computed(() => ([
-    { value: null, text: t('Custom.PaymentHistory.All') },
-    { value: 1, text: t('Custom.PaymentHistory.Deposit') },
-    { value: 2, text: t('Custom.PaymentHistory.Withdrawals') }
-]));
-const orderStatusMap = computed(() => ([
-    { value: null, text: t('Custom.PaymentHistory.All') },
-    { value: 1, text: t('State.ToBeProcessed') },
-    { value: 2, text: t('State.Completed') },
-    { value: 3, text: t('State.InTheProcessing') },
-    { value: 4, text: t('State.Refused') },
-    { value: 5, text: t('State.expireTime') },
-    { value: 6, text: t('State.Cancelled') },
-]));
 
 // 表格列配置
 const columns = computed(() => [
     {
-        prop: 'symbol',
-        label: t('Label.Varieties'),      // 交易品种
+        prop: 'serial',
+        label: t('wallet.item58'),
         align: 'left'
     },
     {
-        prop: 'cmdName',
-        label: t('Label.Type'),           // 类型
+        prop: 'addTime',
+        label: t('wallet.item59'),
         align: 'left'
     },
     {
-        prop: 'openTime',
-        label: t('Label.OpenTime'),       // 开仓时间(协调世界时)
+        prop: 'source',
+        label: t('wallet.item60'),
+        slot: 'source',
         align: 'left'
     },
     {
-        prop: 'volume',
-        label: t('Label.Volume'),         // 手
-        formatter: ({ row }) => `${row.volume || 0} ${t('Label.Lot')}`,
-        align: 'right'
-    },
-    {
-        prop: 'openPrice',
-        label: t('Label.OpenPrice'),      // 开仓价
-        align: 'right'
-    },
-    {
-        prop: 'tp',
-        label: t('Label.EP'), // 止盈
-        align: 'right'
-    },
-    {
-        prop: 'sl',
-        label: t('Label.EL'), // 止损
-        align: 'right'
-    },
-    {
-        prop: 'profit',
-        label: t('Label.ProfitLoss') + '(USD)',     // 利润, USD
-        slot: 'profit',
-        align: 'right'
-    },
-    {
-        prop: 'comment',
-        label: t('Label.Note'),
-        align: 'right',
-        isTabel: false
-    },
-    {
-        prop: 'more',
-        type: 'more',
-        width: 20,
-        align: 'right'
-    },
+        prop: 'amount',
+        label: t('wallet.item61'),
+        slot: 'amount',
+        align: 'center'
+    }
 ])
 
 const mobilePrimaryFields = computed(() => [
     {
-        prop: 'symbol',
-        label: t('Label.Varieties'),      // 交易品种
-        align: 'left',
-        slot: 'symbol'
+        prop: 'serial',
+        label: t('wallet.item58'),
+        align: 'left'
     },
     {
-        prop: 'profit',
-        label: t('Label.ProfitLoss') + '(USD)',     // 利润, USD
-        slot: 'profit',
-        align: 'right'
+        prop: 'source',
+        label: t('wallet.item60'),
+        slot: 'source',
+        align: 'left'
     },
     {
-        prop: 'more',
-        type: 'more',
-        width: 20,
+        prop: 'amount',
+        label: t('wallet.item61'),
+        slot: 'amount',
         align: 'right'
-    },
+    }
 ])
 
 // 动态传入筛选字段配置
 const filterFields = computed(() => [
-    isLoaded.value && isSuccess.value && { key: 'login', type: 'select', label: t('Custom.PaymentHistory.TradingAccount'), placeholder: t('placeholder.login'), options: loginOptions || [], defaultValue: search.login || undefined },
     { key: 'date', label: t('placeholder.Start') + ' - ' + t('placeholder.End'), type: 'daterange' }
 ])
 const searchParams = ref({})
 const tableRef = ref(null)
 const handleSearch = (params) => {
     Object.assign(search, params)
-    search.login = Number(params.login)
-    search.platform = loginOptions.find(item => item.value === params.login)?.platform || ''
-    if(!search.platform) return
+    if (params.date && params.date.length === 2) {
+        search.startDate = params.date[0]
+        search.endDate = params.date[1]
+    } else {
+        search.startDate = ''
+        search.endDate = ''
+    }
     nextTick(() => {
         tableRef.value.refreshTable()
     })
@@ -150,143 +103,26 @@ const handleSearch = (params) => {
 
 const handleReset = (params) => {
     Object.assign(search, params)
-    search.platform = loginOptions.find(item => item.value === params.login)?.platform || ''
-    if(!search.platform) return
+    search.startDate = ''
+    search.endDate = ''
     nextTick(() => {
         tableRef.value.refreshTable()
     })
 }
 
 const listApi = ref(null)
-listApi.value = customApi.tradePosition
-
-const getSymbolParts = (sym: string) => {
-    if (!sym) return ['', '']
-    const s = String(sym).toUpperCase()
-    if (s.includes('/')) {
-        const [base, quote] = s.split('/')
-        return [base, quote]
-    }
-    const base = s.slice(0, 3)
-    const quote = s.slice(3)
-    return [base, quote]
-}
-const formatCmdName = (cmd: string) => {
-    const v = String(cmd || '').toLowerCase()
-    if (v.includes('sell')) return '卖出'
-    if (v.includes('buy')) return '买入'
-    return cmd || ''
-}
-const getCmdColorClass = (cmd: string) => {
-    const v = String(cmd || '').toLowerCase()
-    if (v.includes('sell')) return 'is-sell'
-    if (v.includes('buy')) return 'is-buy'
-    return ''
-}
-const getProfitColorClass = (profit: any) => {
-    const n = Number(profit)
-    if (!Number.isFinite(n) || n === 0) return ''
-    return n > 0 ? 'is-profit' : 'is-loss'
-}
+listApi.value = customApi.walletHistoryList
 
 onLoad((e) => {
-    if (e.login) {
-        search.login = Number(e.login)
-    }
+    nextTick(() => {
+        tableRef.value.refreshTable()
+    })
 })
 </script>
 
 <style scoped lang="scss">
 @import "@/uni.scss";
 
-.avatar {
-    width: px2rpx(60);
-    height: px2rpx(60);
-    border-radius: 4px;
-}
-
-.content-title {
-    display: flex;
-    justify-content: space-between;
-    align-items: center;
-    font-size: px2rpx(20);
-    font-weight: 500;
-
-    .content-title-btns {
-        margin: px2rpx(8) 0;
-
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        gap: px2rpx(12);
-
-        .btn-primary {
-            min-width: px2rpx(120);
-            background-color: var(--color-error);
-            color: white;
-            padding: 0 px2rpx(12);
-            border: none;
-            font-size: px2rpx(14);
-            text-align: center;
-            cursor: pointer;
-            display: flex;
-            align-items: center;
-            justify-content: center;
-            gap: px2rpx(8);
-        }
-
-        .btn-primary:active {
-            background-color: var(--color-navy-700);
-        }
-    }
-}
-
-.operation-btn {
-    :deep(span) {
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        gap: px2rpx(4);
-        cursor: pointer;
-        background-color: var(--color-slate-150);
-        padding: px2rpx(8) 0;
-    }
-}
-
-.operation-btn.disabled {
-    cursor: not-allowed;
-    opacity: 0.5;
-}
-
-.symbol-cell {
-    display: inline-flex;
-    align-items: flex-start;
-    gap: 0.25rem;
-    flex-direction: column;
-
-    .pair {
-        font-weight: 600;
-        color: var(--color-slate-900);
-    }
-
-    .desc {
-        color: var(--color-slate-600);
-    }
-}
-
-.is-sell,
-.is-loss {
-    color: #eb483f;
-}
-
-.is-buy,
-.is-profit {
-    color: #46cd7c;
-}
-
-
-
-
 .search-bar {
     display: flex;
     align-items: center;

+ 38 - 13
pages/ib/recording.vue

@@ -5,7 +5,8 @@
     <view class="account-content">
       <view class="search-content">
         <view class="search-bar">
-          <cwg-complex-search :fields="filterFields" v-model="searchParams" @search="handleSearch" @reset="handleReset" />
+          <cwg-complex-search :fields="filterFields" v-model="searchParams" @search="handleSearch"
+                              @reset="handleReset" />
         </view>
         <view />
       </view>
@@ -109,7 +110,7 @@
 
   const searchParams = ref({
     types: 1,
-    date: defaultDateRange
+    date: defaultDateRange,
   })
 
   const search = ref({
@@ -119,8 +120,22 @@
   })
 
   const filterFields = computed(() => [
-    { key: 'types', type: 'select', label: t('placeholder.choose'), placeholder: t('placeholder.choose'), options: typeList.value, defaultValue: 1, isSelect: true, clearable: false },
-    { key: 'date', label: t('placeholder.Start') + ' - ' + t('placeholder.End'), type: 'daterange', defaultValue: defaultDateRange },
+    {
+      key: 'types',
+      type: 'select',
+      label: t('placeholder.choose'),
+      placeholder: t('placeholder.choose'),
+      options: typeList.value,
+      defaultValue: 1,
+      isSelect: true,
+      clearable: false,
+    },
+    {
+      key: 'date',
+      label: t('placeholder.Start') + ' - ' + t('placeholder.End'),
+      type: 'daterange',
+      defaultValue: defaultDateRange,
+    },
   ])
 
   const tableRef = ref<any>(null)
@@ -136,7 +151,7 @@
   const handleReset = () => {
     searchParams.value = {
       types: 1,
-      date: defaultDateRange
+      date: defaultDateRange,
     }
     search.value = {
       types: 1,
@@ -171,15 +186,25 @@
   // 接口 根据types 切换
   const listApi = computed(() => {
     let other = {}
-    if (search.value.types == 4) {
-      other = {
-        type: 4,
-      }
-    } else if (search.value.types == 1) {
-      other = {
-        mamType: 0,
-      }
+    switch (search.value.types) {
+      case 1:
+        other = {
+          mamType: 0,
+        }
+        break
+      case 4:
+        other = {
+          type: 4,
+        }
+        break
+      case 11:
+      case 12:
+        other = {
+          mamType: 3,
+        }
+        break
     }
+
     return (params) => ibApi[apiList.value[search.value.types]]({ ...params, ...other })
   })