li.shaoyi před 3 roky
rodič
revize
60f5586f97

+ 1 - 1
src/business/order/index.ts

@@ -256,7 +256,7 @@ export function useQueryTHJPromotionIncomeDetail() {
         await queryTHJPromotionIncomeDetail({
             data: {
                 userid: getUserId(),
-                mouth: formatDate(new Date().toDateString(), 'YYYYMM'),
+                mouth: formatDate(new Date().toISOString(), 'YYYYMM'),
                 page: pageIndex.value,
                 pagesize: pageSize.value,
             },

+ 29 - 2
src/constants/market.ts

@@ -1,11 +1,38 @@
+import { useEnumStore } from '@/stores'
+
+const { getEnumTypeName } = useEnumStore()
+
 /**
  * 交易市场
  */
 export enum Market {
     /** 广钻 */
     GZ = 67201,
-    /** 铁合金 */
+    /** 铁合金采购 */
     THJ = 64201,
-    /** 铁合金挂牌 */
+    /** 铁合金供求 */
     THJ_Listing = 65201,
+    /** 铁合金转让 */
+    THJ_Transfer = 64202,
+}
+
+/**
+ * 获取交易市场列表
+ * @returns 
+ */
+export function getMarketList() {
+    return [
+        { label: '采购', value: Market.THJ },
+        { label: '转让', value: Market.THJ_Transfer },
+        { label: '供求', value: Market.THJ_Listing },
+    ]
+}
+
+/**
+ * 获取交易市场名称
+ * @returns 
+ */
+export function getMarketName(value?: number) {
+    const enums = getMarketList()
+    return getEnumTypeName(enums, value)
 }

+ 5 - 1
src/packages/mobile/components/base/list/index.less

@@ -29,7 +29,11 @@
     }
 
     &__column {
-        padding: .08rem;
+        padding: .12rem .08rem;
+    }
+
+    &__header &__column {
+        padding: 0 .08rem;
     }
 
     &__column:first-child &__cell {

+ 2 - 2
src/packages/mobile/components/base/list/index.vue

@@ -4,14 +4,14 @@
             <!-- <colgroup>
                 <col :width="colWidth" v-for="i in columns.length" :key="i" />
             </colgroup> -->
-            <thead>
+            <thead class="app-list__header">
                 <tr class="app-list__row">
                     <th class="app-list__column" v-for="(column, i) in columns" :key="i">
                         <div class="app-list__cell">{{ column.label }}</div>
                     </th>
                 </tr>
             </thead>
-            <tbody>
+            <tbody class="app-list__body">
                 <template v-for="(row, i) in dataList" :key="i">
                     <tr class="app-list__row" @click="onClick(row, i)">
                         <td class="app-list__column" :class="column.className" v-for="(column, n) in columns"

+ 7 - 47
src/packages/mobile/views/mine/generalize/components/promotion/index.vue

@@ -1,14 +1,14 @@
 <template>
     <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-        @refresh="onRefresh" disabled>
+        @refresh="onRefresh" disabled style="height:auto">
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length" @click="onClick">
             <!-- 日期 -->
-            <template #profitmonth="{ value}">
+            <template #profitmonth="{ value }">
                 {{ formatDate(value, 'YYYY-MM') }}
             </template>
             <!-- 操作 -->
-            <template #operate="{row}">
-                <Button type="primary" size="mini" @click="submit(row)">申请支取</Button>
+            <template #operate="{ row }">
+                <Button type="primary" size="mini" @click.stop="submit(row)">申请支取</Button>
             </template>
         </app-list>
         <Empty v-if="!dataList.length"></Empty>
@@ -43,7 +43,7 @@ const error = shallowRef(false)
 const pullRefreshRef = shallowRef()
 
 const columns = computed<Model.TableColumn[]>(() => {
-    const result=[
+    const result = [
         { prop: 'profitmonth', label: '时间' },
         { prop: 'sumamount', label: '金额' },
     ]
@@ -81,7 +81,7 @@ const submit = (item: Model.THJPromotionIncomeRsp) => {
             onSubmit(item.profitmonth, item.sumamount).then(() => {
                 hideLoading()
                 dialog('请求成功,请耐心等待审核。').then(() => {
-                    router.back()
+                    pullRefreshRef.value?.refresh()
                 })
             }).catch((err) => {
                 Toast.fail(err)
@@ -93,44 +93,4 @@ const submit = (item: Model.THJPromotionIncomeRsp) => {
 watch(() => props.status, () => {
     pullRefreshRef.value?.refresh()
 })
-</script>
-
-<style lang="less">
-.promotion {
-    &__container {
-        height: 100%;
-        overflow-y: auto;
-
-        .list {
-            display: flex;
-            align-items: center;
-
-            &-row {
-                font-size: .32rem;
-                border-bottom: 1px solid #eee;
-                padding: .12rem .32rem;
-            }
-
-            &-column {
-                flex: 1;
-                display: flex;
-                flex-direction: column;
-                text-align: center;
-
-                &:first-child {
-                    text-align: left;
-                }
-
-                &:last-child {
-                    text-align: right;
-                }
-
-                span:last-child {
-                    color: #999;
-                    font-size: .24rem;
-                }
-            }
-        }
-    }
-}
-</style>
+</script>

+ 5 - 45
src/packages/mobile/views/mine/generalize/components/tradedata/index.vue

@@ -1,14 +1,14 @@
 <template>
     <app-pull-refresh ref="pullRefreshRef" v-model:error="error" v-model:pageIndex="pageIndex" :page-count="pageCount"
-        @refresh="onRefresh" disabled>
+        @refresh="onRefresh" disabled style="height:auto">
         <app-list :columns="columns" :data-list="dataList" v-if="dataList.length">
             <!-- 日期 -->
             <template #reckondate="{ value }">
                 {{ formatDate(value, 'YYYY-MM-DD') }}
             </template>
             <!-- 市场 -->
-            <template #marketid>
-                {{ marketid === Market.THJ ? '采购' : '供求' }}
+            <template #marketid="{ value }">
+                {{ getMarketName(value) }}
             </template>
             <!-- 吨数 -->
             <template #tradeqty="{ row }">
@@ -23,7 +23,7 @@
 import { shallowRef, watch } from 'vue'
 import { formatDate } from '@/filters'
 import { useQueryTHJTradeDataList } from '@/business/goods'
-import { Market } from '@/constants/market'
+import { Market, getMarketName } from '@/constants/market'
 import { Empty } from 'vant'
 import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
 import AppList from '@mobile/components/base/list/index.vue'
@@ -68,44 +68,4 @@ const onRefresh = (finish: () => void) => {
 watch(() => props.marketid, () => {
     pullRefreshRef.value?.refresh()
 })
-</script>
-
-<style lang="less">
-.tradedata {
-    &__container {
-        height: 100%;
-        overflow-y: auto;
-
-        .list {
-            display: flex;
-            align-items: center;
-
-            &-row {
-                font-size: .32rem;
-                border-bottom: 1px solid #eee;
-                padding: .12rem .32rem;
-            }
-
-            &-column {
-                flex: 1;
-                display: flex;
-                flex-direction: column;
-                text-align: center;
-
-                &:first-child {
-                    text-align: left;
-                }
-
-                &:last-child {
-                    text-align: right;
-                }
-
-                span:last-child {
-                    color: #999;
-                    font-size: .24rem;
-                }
-            }
-        }
-    }
-}
-</style>
+</script>

+ 4 - 44
src/packages/mobile/views/mine/generalize/detail/index.vue

@@ -7,9 +7,9 @@
             :page-count="pageCount" @refresh="onRefresh">
             <app-list :columns="columns" :data-list="dataList" v-if="dataList.length">
                 <!-- 时间 -->
-                <template #profitmonth="{ value }">
-                    <li>{{ formatDate(value, 'YYYY-MM-DD') }}</li>
-                    <li>{{ formatDate(value, 'HH:mm:ss') }}</li>
+                <template #tradetime="{ value }">
+                    <span>{{ formatDate(value, 'YYYY-MM-DD') }}</span>
+                    <span>{{ formatDate(value, 'HH:mm:ss') }}</span>
                 </template>
             </app-list>
             <Empty v-if="!dataList.length"></Empty>
@@ -51,44 +51,4 @@ const onRefresh = (finish: () => void) => {
         finish()
     })
 }
-</script>
-
-<style lang="less">
-.promotion-detail {
-    &__container {
-        height: 100%;
-        overflow-y: auto;
-
-        .list {
-            display: flex;
-            align-items: center;
-
-            &-row {
-                font-size: .32rem;
-                border-bottom: 1px solid #eee;
-                padding: .12rem .32rem;
-            }
-
-            &-column {
-                flex: 1;
-                display: flex;
-                flex-direction: column;
-                text-align: center;
-
-                &:first-child {
-                    text-align: left;
-                }
-
-                &:last-child {
-                    text-align: right;
-                }
-
-                span:last-child {
-                    color: #999;
-                    font-size: .24rem;
-                }
-            }
-        }
-    }
-}
-</style>
+</script>

+ 8 - 9
src/packages/mobile/views/mine/generalize/index.vue

@@ -10,7 +10,7 @@
                         <h1>{{ userLevelInfo.levelgroup }}</h1>
                         <span>{{ userLevelInfo.checkday }}到期</span>
                     </div>
-                    <div class="rank-container__next">
+                    <div class="rank-container__next" v-if="userLevelInfo.notyet">
                         <div class="upgrade">
                             <div class="upgrade-left">
                                 <span>{{ userLevelInfo.appup }}</span>
@@ -64,7 +64,7 @@ import AppQrcode from '@mobile/components/base/qrcode/index.vue'
 import TradeData from './components/tradedata/index.vue'
 import Promotion from './components/promotion/index.vue'
 import { getServiceUrl } from '@/services/http'
-import { Market } from '@/constants/market'
+import { Market, getMarketList } from '@/constants/market'
 
 const { getUserId } = useLoginStore()
 const showQRCode = shallowRef(false)
@@ -85,17 +85,16 @@ const dropdownMenus = [
 const dropdownTypes = computed(() => {
     switch (selectedMenu.value) {
         case 0: {
-            return [
-                { text: '采购', value: Market.THJ },
-                { text: '转让', value: 64202 },
-                { text: '供求', value: Market.THJ_Listing },
-            ]
+            return getMarketList().map((e) => ({
+                text: e.label,
+                value: e.value,
+            }))
         }
         case 1: {
             return [
                 { text: '未支付', value: 1 },
-                { text: '支取中', value: 2 },
-                { text: '已支付', value: 3 }
+                { text: '支取中', value: 3 },
+                { text: '已支付', value: 2 }
             ]
         }
     }

+ 10 - 2
src/packages/mobile/views/mine/order/detail/wrtrade/index.vue

@@ -14,7 +14,8 @@
                 <Cell title="成交金额" :value="(detail.tradeprice * detail.tradeqty).toFixed(2)" />
                 <Cell title="成交时间" :value="formatDate(detail.tradetime)" />
                 <Cell title="对手方" :value="detail.matchusername" />
-                <Cell title="成交单号:" :value="detail.wrtradedetailid" />
+                <Cell title="成交单号:" :value="detail.wrtradedetailid" :is-link="!!detail.contractaddr"
+                    @click="openPDF(detail?.contractaddr)" />
             </CellGroup>
         </div>
         <div v-else>
@@ -27,7 +28,7 @@
 import { shallowRef } from 'vue'
 import { useNavigation } from '@/hooks/navigation'
 import { CellGroup, Cell, Empty } from 'vant'
-import { formatDate } from '@/filters'
+import { formatDate, getUrl } from '@/filters'
 import { getBuyOrSellName } from '@/constants/order'
 
 const { route } = useNavigation()
@@ -37,4 +38,11 @@ const detail = shallowRef<Model.WrTradeDetailRsp>()
 if (item) {
     detail.value = JSON.parse(item.toString())
 }
+
+// 打开pdf文件
+const openPDF = (file?: string) => {
+    if (file) {
+        window.open(getUrl(file).href)
+    }
+}
 </script>

+ 2 - 2
src/services/api/trade/index.ts

@@ -89,6 +89,6 @@ export function spotPresaleTransferDesting(params: TradeParams<Proto.SpotPresale
 /**
  * 铁合金收益支取申请接口请求
  */
- export function thjProfitDrawApply(params: TradeParams<Proto.THJProfitDrawApplyReq, Proto.THJProfitDrawApplyRsp>) {
-    return tradeServerRequest('THJProfitDrawApplyReq', 'THJProfitDrawApplyRsp', params, Market.THJ);
+export function thjProfitDrawApply(params: TradeParams<Proto.THJProfitDrawApplyReq, Proto.THJProfitDrawApplyRsp>) {
+    return tradeServerRequest('THJProfitDrawApplyReq', 'THJProfitDrawApplyRsp', params, Market.THJ_Listing);
 }

+ 1 - 0
src/types/model/order.d.ts

@@ -167,6 +167,7 @@ declare namespace Model {
         buyorsell: number
         /// 手续费
         chargevalue: number
+        contractaddr: string; // 合同地址
         /// 品种代码
         deliverygoodscode: string
         /// 品种ID