li.shaoyi 6 月之前
父节点
当前提交
f0b48eb6d2

+ 2 - 2
oem/tss-vi/config/appconfig.json

@@ -1,8 +1,8 @@
 {
   "appId": "com.muchinfo.tssvi",
   "appName": "Tce Vietnam",
-  "version": "1.0.55",
-  "versionCode": "100055",
+  "version": "1.0.56",
+  "versionCode": "100056",
   "apiUrl": "http://192.168.31.210:8080/cfg?key=test_210",
   "tradeChannel": "ws",
   "showLoginAlert": true,

+ 196 - 0
src/packages/sbyj/views/market/detail/composables.ts

@@ -0,0 +1,196 @@
+import { shallowRef, onMounted, onUnmounted, computed, onActivated } from 'vue'
+import { FieldRule, FormInstance, showToast } from 'vant'
+import { useNavigation } from '@mobile/router/navigation'
+import { fullloading, dialog } from '@/utils/vant'
+import { EPriceMode, EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
+import { useOrder } from '@/business/trade'
+import { BuyOrSell } from '@/constants/order'
+import quoteSocket from '@/services/websocket/quote'
+import { queryMdUserSwapProtocol } from '@/services/api/swap'
+import { getUserId } from '@/services/methods/user'
+import { useRequest } from '@/hooks/request'
+import { queryUserTradeSettings } from '@/services/api/order'
+import { useGlobalStore, useFuturesStore, useUserStore, useSBYJOrderStore } from '@/stores'
+
+export function useSetup() {
+    const { getQueryString } = useNavigation()
+    const { formData, formSubmit } = useOrder()
+    const { getSBYJMyOrders, getOrderListByGoodsId } = useSBYJOrderStore()
+    const globalStore = useGlobalStore()
+    const futuresStore = useFuturesStore()
+    const userStore = useUserStore()
+
+    const riskType = globalStore.getSystemInfo('riskType') // 风控类型
+    const formRef = shallowRef<FormInstance>()
+    const goodscode = getQueryString('goodscode') ?? ''
+    const quote = futuresStore.getGoodsQuote(goodscode)
+    const goods = futuresStore.getGoods(goodscode)
+    const qtyStep = shallowRef(1) // 数量步长
+    const orderQty = shallowRef(1) // 数量
+    const subscribe = quoteSocket.createSubscribe()
+
+    /// 能否下单交易
+    const canBankSign = shallowRef(false)
+
+    const orderList = computed(() => getOrderListByGoodsId(quote.value?.goodsid))
+
+    // 合约乘数
+    const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
+
+    // 可用重量
+    const enableqty = (item: Model.SBYJMyOrderRsp) => {
+        const { tHDetailEx, agreeUnit } = item
+        return (tHDetailEx.holderQty - tHDetailEx.freezeQty) * agreeUnit
+    }
+
+    // 数量步长列表
+    const qtyStepList = computed(() => {
+        // 任务 #6640
+        const param1009 = userStore.getSystemParamValue('1009')
+
+        if (param1009) {
+            const values = param1009.split(',')
+            const { traderules = [], agreeunit = 0 } = quote.value ?? {}
+            const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
+            const min = ParamValue * agreeunit // ParamValue 是数量
+
+            return values.map((value) => (+value) * min)
+        }
+
+        return []
+    })
+
+    //  获取用户交易个性化设置
+    const { dataList: settings } = useRequest(queryUserTradeSettings, {})
+
+    // 判断是否有终止按钮
+    const canClose = computed(() => {
+        //1. 获取用户交易个性化设置(sbyj/QueryUserTradeSettings)
+        // 若有GoodsId对应配置,且goodstradetype in (1:可建可平, 3:不可建可平) 时则显示
+        const setting = settings.value.find(e => e.goodsid === goods?.goodsid)
+        if (setting) {
+            const goodstradetype = setting.goodstradetype
+            return ['1', '3'].includes(goodstradetype)
+        } else {
+            // 2. 若无GoodsId对应配置,则看商品缓存(Ermcp/GetErmcpGoods)返回对应商品的goodstradetype in (1:可建可平, 3:不可建可平) 时则显示
+            const { goodstradetype = 0 } = goods ?? {}
+            return [1, 3].includes(goodstradetype)
+        }
+    })
+
+    const commit = (buyOrSell: BuyOrSell) => {
+        /// 这里要去判断是否已经实名认证
+        if (userStore.hasAuth) {
+            if (userStore.userInfo.usertype != 2 && !canBankSign.value) {
+                showToast('请先通过“我的”-“合同签署”功能菜单签署相应的合同!')
+            } else {
+                formData.BuyOrSell = buyOrSell
+                formData.OrderPrice = buyOrSell === BuyOrSell.Buy ? quote.value?.ask : quote.value?.bid
+                formRef.value?.submit()
+            }
+        } else {
+            showToast('未实名认证,请先去实名认证,如果已提交实名认证,请耐心等待审核通过!')
+        }
+    }
+
+    // 下单
+    const onSubmit = () => {
+        // 计算提示信息
+        // const { marketid = 0, goodsid = 0, goodunitid = 0 } = quote.value ?? {}
+        // const { marginalgorithm = 0, transferdepositratio = 0.0 } = goods ?? {}
+        // const totalamount = orderQty.value*(formData.OrderPrice ?? 0)
+        // const orderPrice = `定价价格:${formData.OrderPrice ?? 0}\n`
+        // const qty = `订单数量:${orderQty.value}${getGoodsUnitName(goodunitid)}\n`
+        // const orderamount = `订单总额:${formatDecimal(totalamount)}\n`
+        // console.log(marginalgorithm, transferdepositratio)
+        // const margin = `预付定金:${formatDecimal(marginalgorithm === 1 ? totalamount*transferdepositratio : orderQty.value*transferdepositratio)}\n`
+        // const message = orderPrice + qty + orderamount + margin
+
+        const { marketid = 0, goodsid = 0 } = quote.value ?? {}
+        dialog({
+            message: '确认要提交吗?',
+            showCancelButton: true,
+        }).then(() => {
+            /// 获取对应的市场ID
+            formData.MarketID = marketid
+            formData.PriceMode = EPriceMode.PRICEMODE_MARKET
+            formData.GoodsID = goodsid
+            formData.TimevalidType = EValidType.VALIDTYPE_DR
+            formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
+            formData.BuildType = EBuildType.BUILDTYPE_OPEN
+            formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
+
+            fullloading((hideLoading) => {
+                formSubmit().then(() => {
+                    hideLoading('提交成功。', 'success')
+                    // 刷新订单列表
+                    getSBYJMyOrders()
+                }).catch((err) => {
+                    hideLoading(err, 'fail')
+                })
+            })
+        })
+    }
+
+    // 表单验证规则
+    const formRules: { [key: string]: FieldRule[] } = {
+        OrderQty: [{
+            validator: () => {
+                const qty = orderQty.value
+                if (qty) {
+                    const { traderules = [], agreeunit = 0 } = quote.value ?? {}
+                    const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
+                    const min = ParamValue * agreeunit // ParamValue 是数量
+                    if (qty % min !== 0) return '重量只能是' + min + '的整数倍'
+                    return true
+                }
+                return '请输入重量'
+            }
+        }],
+    }
+
+    const onRadioChange = (value: number) => {
+        orderQty.value = value
+    }
+
+    onActivated(() => {
+        /// 查询是否已签署合同
+        queryMdUserSwapProtocol({
+            data: {
+                userId: getUserId()
+            }
+        }).then((res) => {
+            canBankSign.value = res.data.some(e => e.protocolstatus === 4)
+        })
+    })
+
+    onMounted(() => {
+        subscribe.start(goodscode)
+        if (goods?.canautoadddeposit === 1) { formData.IsAutoAddDeposit = 1 }
+        orderQty.value = Math.min(...qtyStepList.value)
+        qtyStep.value = Math.min(...qtyStepList.value)
+        getSBYJMyOrders()
+    })
+
+    onUnmounted(() => {
+        subscribe.stop()
+    })
+
+    return {
+        formRef,
+        quote,
+        formRules,
+        riskType,
+        orderQty,
+        qtyStep,
+        qtyStepList,
+        goods,
+        formData,
+        orderList,
+        canClose,
+        onSubmit,
+        enableqty,
+        commit,
+        onRadioChange
+    }
+}

+ 104 - 354
src/packages/sbyj/views/market/detail/index.vue

@@ -1,225 +1,114 @@
 <template>
-    <app-view class="market-detail">
-        <template #header>
-            <app-navbar :title="quote?.goodsname">
-                <template #right>
-                    <Icon v-if="system_1012 != '0'" name="bars" size="20px" @click="showChart" />
-                </template>
-            </app-navbar>
+    <DetailsView @row-click="show = true">
+        <template #headerRight>
+            <Icon v-if="param1012 != '0'" name="bars" size="20px" @click="showChart" />
         </template>
-        <div class="market-detail__form" v-if="quote">
-            <div class="form-price">
-                <dl>
-                    <dt>回购价</dt>
-                    <dd :class="quote.bidColor">{{ handleNumberValue(formatDecimal(quote.bid, quote.decimalplace)) }}
-                    </dd>
-                </dl>
-                <dl>
-                    <dt>销售价</dt>
-                    <dd :class="quote.askColor">{{ handleNumberValue(formatDecimal(quote.ask, quote.decimalplace)) }}
-                    </dd>
-                </dl>
-            </div>
-            <Form ref="formRef" @submit="onSubmit">
-                <Field name="OrderQty" :rules="formRules.OrderQty">
-                    <template #input>
-                        <div class="g-qty-group">
-                            <div class="g-qty-group__stepper">
-                                <Stepper v-model="orderQty" :min="0" :step="qtyStep" integer />
-                                <span>{{ getGoodsUnitName(quote.goodunitid) }}</span>
-                            </div>
-                            <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
-                                <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">
-                                    {{ value + getGoodsUnitName(quote.goodunitid) }}
-                                </Radio>
-                            </RadioGroup>
-                        </div>
-                    </template>
-                </Field>
-                <Cell name="IsAutoAddDeposit" title="允许自动补定金" v-if="goods?.canautoadddeposit === 1">
-                    <template #right-icon>
-                        <Switch v-model="formData.IsAutoAddDeposit" :active-value="1" :inactive-value="0" :size="24" />
-                    </template>
-                </Cell>
-                <Cell name="IsAutoRefundDeposit" title="允许自动退定金" v-if="goods?.canautorefunddeposit === 1">
-                    <template #right-icon>
-                        <Switch v-model="formData.IsAutoRefundDeposit" :active-value="1" :inactive-value="0"
-                            :size="24" />
-                    </template>
-                </Cell>
-            </Form>
-            <div class="form-submit">
-                <!-- 任务 #6712 -->
-                <button class="buy" type="button" @click="commit(BuyOrSell.Buy)">买入提料</button>
-                <button class="sell" type="button" @click="commit(BuyOrSell.Sell)">卖出交料</button>
-            </div>
-        </div>
-        <div class="market-detail__list">
-            <table cellspacing="0" cellpadding="0">
-                <tr :class="item.tHDetailEx.tradeID === selectedRow?.tHDetailEx.tradeID ? 'is-active' : ''"
-                    v-for="(item, index) in orderList" :key="index" @click="showPopup(item)">
-                    <td>
-                        <span :class="item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
-                            {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料' : '卖料' }}
-                        </span>
-                    </td>
-                    <td>
-                        <span>{{ enableqty(item) + getGoodsUnitName(item.goodsUnitID) }}</span>
-                    </td>
-                    <td>
-                        <span>{{ formatDecimal(item.tHDetailEx.holderPrice, item.decimalPlace) }}</span>
-                    </td>
-                    <td v-if="riskType === 1">
-                        <span
-                            :class="{ 'g-price-up': item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate }"
-                            v-if="item.tHDetailEx.payedDeposit">
-                            {{ parsePercent(item.tHDetailEx.depositRate) }}
-                        </span>
-                        <span v-else>
-                            {{ handleNumberValue() }}
-                        </span>
-                    </td>
-                    <td v-if="riskType === 2">
-                        <span :class="handlePriceColor(item.tHDetailEx.floatPL)">
-                            {{ formatDecimal(item.tHDetailEx.floatPL) }}
-                        </span>
-                    </td>
-                </tr>
-            </table>
-        </div>
-        <ActionSheet v-model:show="show" title="订单">
-            <div class="g-order-list" style="padding-bottom: 60px;" v-if="selectedRow">
-                <div class="g-order-list__box">
-                    <div class="g-order-list__titlebar">
-                        <div class="left">
-                            <h4
-                                :class="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
-                                {{ selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') :
-                                    $t('enum.BuyOrSell.Sell') }}{{ ':' }}
-                                {{ selectedRow.goodsCode + '/' + selectedRow.goodsName }}
-                                {{ formatDecimal(selectedRow.tHDetailEx.holderPrice, selectedRow.decimalPlace) }}
-                            </h4>
-                        </div>
-                        <div class="right" v-if="riskType === 1">
-                            <span
-                                :class="{ 'g-price-up': selectedRow.tHDetailEx.depositRate <= selectedRow.tHDetailEx.promptDepositRate }"
-                                v-if="selectedRow.tHDetailEx.payedDeposit">
-                                {{ parsePercent(selectedRow.tHDetailEx.depositRate) }}
-                            </span>
-                            <span v-else>
-                                {{ handleNumberValue() }}
-                            </span>
-                        </div>
-                    </div>
-                    <div class="g-order-list__content">
-                        <ul>
-                            <li>
-                                <span>订单重量</span>
-                                <span>
-                                    {{ selectedRow.tHDetailEx.openQty * selectedRow.agreeUnit }}
-                                    {{ getGoodsUnitName(selectedRow.goodsUnitID) }}
-                                </span>
-                            </li>
-                            <li>
-                                <span>可用重量</span>
-                                <span>
-                                    {{ enableqty(selectedRow) + getGoodsUnitName(selectedRow.goodsUnitID) }}
-                                </span>
-                            </li>
-                            <li>
-                                <span>订单价格</span>
-                                <span>
+        <template #default="{ selectedRow, riskType, canClose }">
+            <ActionSheet v-model:show="show" title="订单">
+                <div class="g-order-list" style="padding-bottom: 60px;" v-if="selectedRow">
+                    <div class="g-order-list__box">
+                        <div class="g-order-list__titlebar">
+                            <div class="left">
+                                <h4
+                                    :class="selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
+                                    {{ selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') :
+                                        $t('enum.BuyOrSell.Sell') }}{{ ':' }}
+                                    {{ selectedRow.goodsCode + '/' + selectedRow.goodsName }}
                                     {{ formatDecimal(selectedRow.tHDetailEx.holderPrice, selectedRow.decimalPlace) }}
+                                </h4>
+                            </div>
+                            <div class="right" v-if="riskType === 1">
+                                <span
+                                    :class="{ 'g-price-up': selectedRow.tHDetailEx.depositRate <= selectedRow.tHDetailEx.promptDepositRate }"
+                                    v-if="selectedRow.tHDetailEx.payedDeposit">
+                                    {{ parsePercent(selectedRow.tHDetailEx.depositRate) }}
                                 </span>
-                            </li>
-                            <li>
-                                <span>已付定金</span>
-                                <span>{{ selectedRow.tHDetailEx.payedDeposit }}</span>
-                            </li>
-                            <li>
-                                <span>浮动权益</span>
-                                <span :class="handlePriceColor(selectedRow.tHDetailEx.floatPL)">
-                                    {{ formatDecimal(selectedRow.tHDetailEx.floatPL) }}
+                                <span v-else>
+                                    {{ handleNumberValue() }}
                                 </span>
-                            </li>
-                            <li v-if="riskType === 1">
-                                <span>已补定金</span>
-                                <span>{{ handleNumberValue(selectedRow.tHDetailEx.restockDeposit) }}</span>
-                            </li>
-                            <li>
-                                <span>订单天数</span>
-                                <span>{{ selectedRow.tHDetailEx.holdDays + 1 }}天</span>
-                            </li>
-                            <li>
-                                <span>{{ $t('mine.callAteFee') }}</span>
-                                <span>{{ handleNumberValue(selectedRow.tHDetailEx.callAteFee) }}</span>
-                            </li>
-                            <!-- <li>
+                            </div>
+                        </div>
+                        <div class="g-order-list__content">
+                            <ul>
+                                <li>
+                                    <span>订单重量</span>
+                                    <span>
+                                        {{ selectedRow.tHDetailEx.openQty * selectedRow.agreeUnit }}
+                                        {{ getGoodsUnitName(selectedRow.goodsUnitID) }}
+                                    </span>
+                                </li>
+                                <li>
+                                    <span>可用重量</span>
+                                    <span>
+                                        {{ enableqty(selectedRow) + getGoodsUnitName(selectedRow.goodsUnitID) }}
+                                    </span>
+                                </li>
+                                <li>
+                                    <span>订单价格</span>
+                                    <span>
+                                        {{ formatDecimal(selectedRow.tHDetailEx.holderPrice, selectedRow.decimalPlace) }}
+                                    </span>
+                                </li>
+                                <li>
+                                    <span>已付定金</span>
+                                    <span>{{ selectedRow.tHDetailEx.payedDeposit }}</span>
+                                </li>
+                                <li>
+                                    <span>浮动权益</span>
+                                    <span :class="handlePriceColor(selectedRow.tHDetailEx.floatPL)">
+                                        {{ formatDecimal(selectedRow.tHDetailEx.floatPL) }}
+                                    </span>
+                                </li>
+                                <li v-if="riskType === 1">
+                                    <span>已补定金</span>
+                                    <span>{{ handleNumberValue(selectedRow.tHDetailEx.restockDeposit) }}</span>
+                                </li>
+                                <li>
+                                    <span>订单天数</span>
+                                    <span>{{ selectedRow.tHDetailEx.holdDays + 1 }}天</span>
+                                </li>
+                                <li>
+                                    <span>{{ $t('mine.callAteFee') }}</span>
+                                    <span>{{ handleNumberValue(selectedRow.tHDetailEx.callAteFee) }}</span>
+                                </li>
+                                <!-- <li>
                                 <span>订单金额</span>
                                 <span>{{ item.tHDetailEx.holderAmount }}</span>
                             </li>
                              -->
-                        </ul>
-                    </div>
-                    <div class="g-order-list__btnbar">
-                        <Button size="small" @click="showComponent('supplement')" round
-                            v-if="riskType === 1 && selectedRow.tHDetailEx.holderQty">补充</Button>
-                        <template v-if="enableqty(selectedRow)">
-                            <Button size="small" @click="showComponent('delivery')" round>
-                                {{ selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '提料' : '交料' }}
-                            </Button>
-                            <Button v-if="canClose" size="small" @click="showComponent('closeholder')" round>终止</Button>
-                        </template>
-                        <Button size="small" @click="showComponent('detail')" round>详情</Button>
+                            </ul>
+                        </div>
+                        <div class="g-order-list__btnbar">
+                            <Button size="small" @click="showComponent('supplement')" round
+                                v-if="riskType === 1 && selectedRow.tHDetailEx.holderQty">补充</Button>
+                            <template v-if="enableqty(selectedRow)">
+                                <Button size="small" @click="showComponent('delivery')" round>
+                                    {{ selectedRow.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '提料' : '交料' }}
+                                </Button>
+                                <Button v-if="canClose" size="small" @click="showComponent('closeholder')"
+                                    round>终止</Button>
+                            </template>
+                            <Button size="small" @click="showComponent('detail')" round>详情</Button>
+                        </div>
                     </div>
                 </div>
-            </div>
-        </ActionSheet>
-        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
-            @closed="closeComponent" v-if="componentId" />
-    </app-view>
+            </ActionSheet>
+            <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+                @closed="closeComponent" v-if="componentId" />
+        </template>
+    </DetailsView>
 </template>
 
 <script lang="ts" setup>
-import { useOrder } from '@/business/trade'
-import { shallowRef, onMounted, onUnmounted, computed, onActivated, defineAsyncComponent } from 'vue'
-import { Form, Field, Stepper, Button, FieldRule, FormInstance, Radio, RadioGroup, showToast, ActionSheet, Cell, Switch, Icon } from 'vant'
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { Button, ActionSheet, Icon } from 'vant'
 import { useNavigation } from '@mobile/router/navigation'
-import { useGlobalStore, useFuturesStore, useUserStore, useSBYJOrderStore } from '@/stores'
 import { getGoodsUnitName } from '@/constants/unit'
 import { formatDecimal, parsePercent, handleNumberValue, handlePriceColor } from '@/filters'
 import { useComponent } from '@/hooks/component'
-import { fullloading, dialog } from '@/utils/vant'
-import { EPriceMode, EValidType, EOrderOperateType, EBuildType } from '@/constants/client'
 import { BuyOrSell } from '@/constants/order'
-import quoteSocket from '@/services/websocket/quote'
-import { queryMdUserSwapProtocol } from '@/services/api/swap'
-import { getUserId } from '@/services/methods/user'
-import { useRequest } from '@/hooks/request'
-import { queryUserTradeSettings } from '@/services/api/order'
-
-const { getQueryString, router } = useNavigation()
-const { formData, formSubmit } = useOrder()
-const { getSBYJMyOrders, getOrderListByGoodsId } = useSBYJOrderStore()
-const globalStore = useGlobalStore()
-const futuresStore = useFuturesStore()
-const userStore = useUserStore()
-
-const riskType = globalStore.getSystemInfo('riskType') // 风控类型
-const formRef = shallowRef<FormInstance>()
-const goodscode = getQueryString('goodscode') ?? ''
-const quote = futuresStore.getGoodsQuote(goodscode)
-const goods = futuresStore.getGoods(goodscode)
-const qtyStep = shallowRef(1) // 数量步长
-const orderQty = shallowRef(1) // 数量
-const subscribe = quoteSocket.createSubscribe()
-const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
-const show = shallowRef(false)
-/// 能否下单交易
-const canBankSign = shallowRef(false)
-
-const { getSystemParamValue } = useUserStore()
-const system_1012 = getSystemParamValue('1012') ?? '1'
+import { useSBYJOrderStore, useUserStore } from '@/stores'
+import DetailsView from './view.vue'
 
 const componentMap = new Map<string, unknown>([
     ['detail', defineAsyncComponent(() => import('../../order/detail/index.vue'))], // 详情
@@ -228,12 +117,14 @@ const componentMap = new Map<string, unknown>([
     ['closeholder', defineAsyncComponent(() => import('../../order/list/components/close-holder/index.vue'))], // 转让
 ])
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getSBYJMyOrders())
+const userStore = useUserStore()
+const param1012 = userStore.getSystemParamValue('1012') ?? '1'
+const show = shallowRef(false)
 
-const orderList = computed(() => getOrderListByGoodsId(quote.value?.goodsid))
+const { getQueryString, router } = useNavigation()
+const { getSBYJMyOrders } = useSBYJOrderStore()
 
-// 合约乘数
-const agreeunit = computed(() => quote.value?.agreeunit ?? 0)
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getSBYJMyOrders())
 
 // 可用重量
 const enableqty = (item: Model.SBYJMyOrderRsp) => {
@@ -241,158 +132,17 @@ const enableqty = (item: Model.SBYJMyOrderRsp) => {
     return (tHDetailEx.holderQty - tHDetailEx.freezeQty) * agreeUnit
 }
 
-// 数量步长列表
-const qtyStepList = computed(() => {
-    // 任务 #6640
-    const param1009 = userStore.getSystemParamValue('1009')
-
-    if (param1009) {
-        const values = param1009.split(',')
-        const { traderules = [], agreeunit = 0 } = quote.value ?? {}
-        const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
-        const min = ParamValue * agreeunit // ParamValue 是数量
-
-        return values.map((value) => (+value) * min)
-    }
-
-    return []
-})
+const showComponent = (componentName: string) => {
+    show.value = false
+    openComponent(componentName)
+}
 
 const showChart = () => {
     router.push({
         name: 'market-chart',
         query: {
-            goodscode: quote.value?.goodscode ?? ''
+            goodscode: getQueryString('goodscode')
         }
     })
 }
-
-//  获取用户交易个性化设置
-const { dataList: settings } = useRequest(queryUserTradeSettings, {})
-// 判断是否有终止按钮
-const canClose = computed(() => {
-    //1. 获取用户交易个性化设置(sbyj/QueryUserTradeSettings)
-    // 若有GoodsId对应配置,且goodstradetype in (1:可建可平, 3:不可建可平) 时则显示
-    const setting = settings.value.find(e => e.goodsid === goods?.goodsid)
-    if (setting) {
-        const goodstradetype = setting.goodstradetype
-        return ['1', '3'].includes(goodstradetype)
-    } else {
-        // 2. 若无GoodsId对应配置,则看商品缓存(Ermcp/GetErmcpGoods)返回对应商品的goodstradetype in (1:可建可平, 3:不可建可平) 时则显示
-        const { goodstradetype = 0 } = goods ?? {}
-        return [1, 3].includes(goodstradetype)
-    }
-})
-
-const commit = (buyOrSell: BuyOrSell) => {
-    /// 这里要去判断是否已经实名认证
-    if (userStore.hasAuth) {
-        if (userStore.userInfo.usertype != 2 && !canBankSign.value) {
-            showToast('请先通过“我的”-“合同签署”功能菜单签署相应的合同!')
-        } else {
-            formData.BuyOrSell = buyOrSell
-            formData.OrderPrice = buyOrSell === BuyOrSell.Buy ? quote.value?.ask : quote.value?.bid
-            formRef.value?.submit()
-        }
-    } else {
-        showToast('未实名认证,请先去实名认证,如果已提交实名认证,请耐心等待审核通过!')
-    }
-}
-
-// 下单
-const onSubmit = () => {
-    // 计算提示信息
-    // const { marketid = 0, goodsid = 0, goodunitid = 0 } = quote.value ?? {}
-    // const { marginalgorithm = 0, transferdepositratio = 0.0 } = goods ?? {}
-    // const totalamount = orderQty.value*(formData.OrderPrice ?? 0)
-    // const orderPrice = `定价价格:${formData.OrderPrice ?? 0}\n`
-    // const qty = `订单数量:${orderQty.value}${getGoodsUnitName(goodunitid)}\n`
-    // const orderamount = `订单总额:${formatDecimal(totalamount)}\n`
-    // console.log(marginalgorithm, transferdepositratio)
-    // const margin = `预付定金:${formatDecimal(marginalgorithm === 1 ? totalamount*transferdepositratio : orderQty.value*transferdepositratio)}\n`
-    // const message = orderPrice + qty + orderamount + margin
-
-    const { marketid = 0, goodsid = 0 } = quote.value ?? {}
-    dialog({
-        message: '确认要提交吗?',
-        showCancelButton: true,
-    }).then(() => {
-        /// 获取对应的市场ID
-        formData.MarketID = marketid
-        formData.PriceMode = EPriceMode.PRICEMODE_MARKET
-        formData.GoodsID = goodsid
-        formData.TimevalidType = EValidType.VALIDTYPE_DR
-        formData.OperateType = EOrderOperateType.ORDEROPERATETYPE_NORMAL
-        formData.BuildType = EBuildType.BUILDTYPE_OPEN
-        formData.OrderQty = orderQty.value / agreeunit.value // 数量÷合约乘数
-
-        fullloading((hideLoading) => {
-            formSubmit().then(() => {
-                hideLoading('提交成功。', 'success')
-                // 刷新订单列表
-                getSBYJMyOrders()
-            }).catch((err) => {
-                hideLoading(err, 'fail')
-            })
-        })
-    })
-}
-
-// 表单验证规则
-const formRules: { [key: string]: FieldRule[] } = {
-    OrderQty: [{
-        validator: () => {
-            const qty = orderQty.value
-            if (qty) {
-                const { traderules = [], agreeunit = 0 } = quote.value ?? {}
-                const { ParamValue = 1 } = traderules.find((e) => e.RuleID === 103) ?? {}
-                const min = ParamValue * agreeunit // ParamValue 是数量
-                if (qty % min !== 0) return '重量只能是' + min + '的整数倍'
-                return true
-            }
-            return '请输入重量'
-        }
-    }],
-}
-
-const onRadioChange = (value: number) => {
-    orderQty.value = value
-}
-
-const showPopup = (row: Model.SBYJMyOrderRsp) => {
-    selectedRow.value = row
-    show.value = true
-}
-
-const showComponent = (componentName: string) => {
-    show.value = false
-    openComponent(componentName)
-}
-
-onActivated(() => {
-    /// 查询是否已签署合同
-    queryMdUserSwapProtocol({
-        data: {
-            userId: getUserId()
-        }
-    }).then((res) => {
-        canBankSign.value = res.data.some(e => e.protocolstatus === 4)
-    })
-})
-
-onMounted(() => {
-    subscribe.start(goodscode)
-    if (goods?.canautoadddeposit === 1) { formData.IsAutoAddDeposit = 1 }
-    orderQty.value = Math.min(...qtyStepList.value)
-    qtyStep.value = Math.min(...qtyStepList.value)
-    getSBYJMyOrders()
-})
-
-onUnmounted(() => {
-    subscribe.stop()
-})
-</script>
-
-<style lang="less">
-@import './index.less';
-</style>
+</script>

+ 134 - 0
src/packages/sbyj/views/market/detail/view.vue

@@ -0,0 +1,134 @@
+<template>
+    <app-view class="market-detail">
+        <template #header>
+            <app-navbar :title="quote?.goodsname">
+                <template #right>
+                    <slot name="headerRight"></slot>
+                </template>
+            </app-navbar>
+        </template>
+        <div class="market-detail__form" v-if="quote">
+            <div class="form-price">
+                <dl>
+                    <dt>回购价</dt>
+                    <dd :class="quote.bidColor">{{ handleNumberValue(formatDecimal(quote.bid, quote.decimalplace)) }}
+                    </dd>
+                </dl>
+                <dl>
+                    <dt>销售价</dt>
+                    <dd :class="quote.askColor">{{ handleNumberValue(formatDecimal(quote.ask, quote.decimalplace)) }}
+                    </dd>
+                </dl>
+            </div>
+            <Form ref="formRef" @submit="onSubmit">
+                <Field name="OrderQty" :rules="formRules.OrderQty">
+                    <template #input>
+                        <div class="g-qty-group">
+                            <div class="g-qty-group__stepper">
+                                <Stepper v-model="orderQty" :min="0" :step="qtyStep" integer />
+                                <span>{{ getGoodsUnitName(quote.goodunitid) }}</span>
+                            </div>
+                            <RadioGroup v-model="qtyStep" direction="horizontal" @change="onRadioChange">
+                                <Radio v-for="(value, index) in qtyStepList" :key="index" :name="value">
+                                    {{ value + getGoodsUnitName(quote.goodunitid) }}
+                                </Radio>
+                            </RadioGroup>
+                        </div>
+                    </template>
+                </Field>
+                <Cell name="IsAutoAddDeposit" title="允许自动补定金" v-if="goods?.canautoadddeposit === 1">
+                    <template #right-icon>
+                        <Switch v-model="formData.IsAutoAddDeposit" :active-value="1" :inactive-value="0" :size="24" />
+                    </template>
+                </Cell>
+                <Cell name="IsAutoRefundDeposit" title="允许自动退定金" v-if="goods?.canautorefunddeposit === 1">
+                    <template #right-icon>
+                        <Switch v-model="formData.IsAutoRefundDeposit" :active-value="1" :inactive-value="0"
+                            :size="24" />
+                    </template>
+                </Cell>
+            </Form>
+            <div class="form-submit">
+                <!-- 任务 #6712 -->
+                <button class="buy" type="button" @click="commit(BuyOrSell.Buy)">买入提料</button>
+                <button class="sell" type="button" @click="commit(BuyOrSell.Sell)">卖出交料</button>
+            </div>
+        </div>
+        <div class="market-detail__list">
+            <table cellspacing="0" cellpadding="0">
+                <template v-for="(item, index) in orderList" :key="index">
+                    <tr :class="{ 'is-active': item.tHDetailEx.tradeID === selectedRow?.tHDetailEx.tradeID }"
+                        @click="rowClick(item)">
+                        <td>
+                            <span :class="item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
+                                {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? '买料' : '卖料' }}
+                            </span>
+                        </td>
+                        <td>
+                            <span>{{ enableqty(item) + getGoodsUnitName(item.goodsUnitID) }}</span>
+                        </td>
+                        <td>
+                            <span>{{ formatDecimal(item.tHDetailEx.holderPrice, item.decimalPlace) }}</span>
+                        </td>
+                        <td v-if="riskType === 1">
+                            <span
+                                :class="{ 'g-price-up': item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate }"
+                                v-if="item.tHDetailEx.payedDeposit">
+                                {{ parsePercent(item.tHDetailEx.depositRate) }}
+                            </span>
+                            <span v-else>
+                                {{ handleNumberValue() }}
+                            </span>
+                        </td>
+                        <td v-if="riskType === 2">
+                            <span :class="handlePriceColor(item.tHDetailEx.floatPL)">
+                                {{ formatDecimal(item.tHDetailEx.floatPL) }}
+                            </span>
+                        </td>
+                    </tr>
+                </template>
+            </table>
+        </div>
+        <slot v-bind="{ selectedRow, riskType, canClose }"></slot>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef } from 'vue'
+import { Form, Field, Stepper, Radio, RadioGroup, Cell, Switch } from 'vant'
+import { getGoodsUnitName } from '@/constants/unit'
+import { formatDecimal, parsePercent, handleNumberValue, handlePriceColor } from '@/filters'
+import { BuyOrSell } from '@/constants/order'
+import { useSetup } from './composables'
+
+const emit = defineEmits(['rowClick'])
+
+const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
+
+const rowClick = (item: Model.SBYJMyOrderRsp) => {
+    selectedRow.value = item
+    emit('rowClick', item)
+}
+
+const {
+    formRef,
+    quote,
+    formRules,
+    riskType,
+    orderQty,
+    qtyStep,
+    qtyStepList,
+    goods,
+    formData,
+    orderList,
+    canClose,
+    onSubmit,
+    enableqty,
+    commit,
+    onRadioChange
+} = useSetup()
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 134 - 0
src/packages/sbyj/views/mine/composables.ts

@@ -0,0 +1,134 @@
+import { shallowRef, onActivated, computed } from 'vue'
+import { fullloading, dialog } from '@/utils/vant'
+import { useNavigation } from '@mobile/router/navigation'
+import { AuthStatus } from '@/constants/account'
+import { useRequest } from '@/hooks/request'
+import { queryBankAccountSign } from '@/services/api/bank'
+import { useGlobalStore, useNoticeStore, useLoginStore, useAccountStore, useUserStore, useSBYJOrderStore } from '@/stores'
+import eventBus from '@/services/bus'
+import { queryTencentUsereSignRecords } from '@/services/api/account'
+
+export function useSetup() {
+    const { router, routerTo } = useNavigation()
+    const globalStore = useGlobalStore()
+    const loginStore = useLoginStore()
+    const noticeStore = useNoticeStore()
+    const userStore = useUserStore()
+    const sbyjOrderStore = useSBYJOrderStore()
+    const accountStore = useAccountStore()
+    const { currentAccount } = accountStore.$toRefs()
+
+    /// 判断是否能签约
+    const canBankSign = shallowRef(false)
+    const headerRef = shallowRef<HTMLDivElement>()
+    const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
+
+    // 任务 #6013
+    const { dataList: signRecords, run: getTencentUsereSignRecords } = useRequest(queryTencentUsereSignRecords, {
+        manual: true,
+        onSuccess: (res) => {
+            /// 判断是否能签约
+            canBankSign.value = res.data.length === 0 || res.data.some(e => e.recordstatus === 3)
+        }
+    })
+
+    // 浮动盈亏
+    const profitLoss = computed(() => {
+        // 水贝亿爵订单列表
+        const orderList = sbyjOrderStore.orderComputedList.filter((e) => e.tHDetailEx.accountID === currentAccount.value.accountid)
+        // 计算浮动盈亏
+        return orderList.reduce((pre, cur) => pre += cur.tHDetailEx.floatPL, 0)
+    })
+
+    const onReady = (el: HTMLDivElement) => {
+        // 设置背景图位置
+        headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
+    }
+
+    /// 进行出入金操作判断
+    const doInOutMoney = (tab: string) => {
+        if (authStatus.value === AuthStatus.Certified) {
+            /// 当前未签署合同
+            if (!canBankSign.value) {
+                dialog({
+                    message: '请先去签署合同条例!',
+                    showCancelButton: true,
+                    confirmButtonText: '去签署合同'
+                }).then(() => {
+                    router.push({ name: 'account-protocol' })
+                })
+                return
+            }
+            // 判断是否已签约
+            fullloading((hideLoading) => {
+                queryBankAccountSign().then((res) => {
+                    hideLoading()
+                    const { signstatus } = res.data[0] ?? {}
+                    /// 只有已签约的情况下才可以进行出入金
+                    if (signstatus === 4) {
+                        router.push({ name: 'bank-wallet', query: { tab } })
+                    } else {
+                        dialog({
+                            message: '请先添加签约账户信息!',
+                            showCancelButton: true,
+                            confirmButtonText: '去签约'
+                        }).then(() => {
+                            router.push({ name: 'bank-sign' })
+                        })
+                    }
+                }).catch(() => {
+                    hideLoading('加载失败', 'fail')
+                })
+            }, '正在加载...')
+        } else {
+            dialog({
+                message: '请先实名认证,再进行该操作!',
+                showCancelButton: true,
+                confirmButtonText: '去实名'
+            }).then(() => {
+                router.push({ name: 'account-certification' })
+            })
+        }
+    }
+
+    const userLogout = () => {
+        dialog({
+            message: '是否退出当前账号?',
+            showCancelButton: true
+        }).then(() => {
+            loginStore.clearAutoLoginData()
+            eventBus.$emit('LogoutNotify')
+        })
+    }
+
+    onActivated(() => {
+        if (authStatus.value !== AuthStatus.Certified) {
+            userStore.getUserData()
+        }
+        accountStore.getAccountList()
+
+        /// 机构不需要签合同
+        if (userStore.userInfo.usertype === 2) {
+            canBankSign.value = true
+            return
+        }
+
+        getTencentUsereSignRecords()
+    })
+
+    return {
+        globalStore,
+        noticeStore,
+        loginStore,
+        userStore,
+        authStatus,
+        currentAccount,
+        profitLoss,
+        signRecords,
+        canBankSign,
+        doInOutMoney,
+        userLogout,
+        onReady,
+        routerTo
+    }
+}

+ 16 - 120
src/packages/sbyj/views/mine/index.vue

@@ -77,9 +77,6 @@
                 <li @click="routerTo('pickup-list')">
                     <Iconfont label-direction="bottom" icon="g-icon-pickup--line">{{ $t('enum.BuyOrSell.Buy') }}订单</Iconfont>
                 </li>
-                <li @click="routerTo('inventory-list')" v-if="oem === 'sjgj'">
-                    <Iconfont label-direction="bottom" icon="g-icon-inventory">我的库存</Iconfont>
-                </li>
             </ul>
         </app-block>
         <app-block class="g-navmenu">
@@ -150,128 +147,27 @@
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, onActivated, computed } from 'vue'
 import { Cell, CellGroup, Button, Icon, Badge } from 'vant'
-import { fullloading, dialog } from '@/utils/vant'
 import { handlePriceColor, parsePercent } from '@/filters'
-import { useNavigation } from '@mobile/router/navigation'
 import { AuthStatus } from '@/constants/account'
-import { useRequest } from '@/hooks/request'
-import { queryBankAccountSign } from '@/services/api/bank'
-import { useGlobalStore, useNoticeStore, useLoginStore, useAccountStore, useUserStore, useSBYJOrderStore } from '@/stores'
-import service from '@/services'
-import eventBus from '@/services/bus'
 import Iconfont from '@/components/base/iconfont/index.vue'
-import { queryTencentUsereSignRecords } from '@/services/api/account'
-
-const oem = service.getConfig('oem')
-
-const { router, routerTo } = useNavigation()
-const globalStore = useGlobalStore()
-const loginStore = useLoginStore()
-const noticeStore = useNoticeStore()
-const userStore = useUserStore()
-const sbyjOrderStore = useSBYJOrderStore()
-const accountStore = useAccountStore()
-const { currentAccount } = accountStore.$toRefs()
-
-/// 判断是否能签约
-const canBankSign = shallowRef(false)
-const headerRef = shallowRef<HTMLDivElement>()
-const authStatus = computed(() => userStore.userAccount.hasauth) // 实名认证状态
-
-// 任务 #6013
-const { dataList: signRecords, run: getTencentUsereSignRecords } = useRequest(queryTencentUsereSignRecords, {
-    manual: true,
-    onSuccess: (res) => {
-        /// 判断是否能签约
-        canBankSign.value = res.data.length === 0 || res.data.some(e => e.recordstatus === 3)
-    }
-})
-
-// 浮动盈亏
-const profitLoss = computed(() => {
-    // 水贝亿爵订单列表
-    const orderList = sbyjOrderStore.orderComputedList.filter((e) => e.tHDetailEx.accountID === currentAccount.value.accountid)
-    // 计算浮动盈亏
-    return orderList.reduce((pre, cur) => pre += cur.tHDetailEx.floatPL, 0)
-})
-
-const onReady = (el: HTMLDivElement) => {
-    // 设置背景图位置
-    headerRef.value?.style.setProperty('background-position', `0 -${el.clientHeight}px`)
-}
-
-/// 进行出入金操作判断
-const doInOutMoney = (tab: string) => {
-    if (authStatus.value === AuthStatus.Certified) {
-        /// 当前未签署合同
-        if (!canBankSign.value) {
-            dialog({
-                message: '请先去签署合同条例!',
-                showCancelButton: true,
-                confirmButtonText: '去签署合同'
-            }).then(() => {
-                router.push({ name: 'account-protocol' })
-            })
-            return
-        }
-        // 判断是否已签约
-        fullloading((hideLoading) => {
-            queryBankAccountSign().then((res) => {
-                hideLoading()
-                const { signstatus } = res.data[0] ?? {}
-                /// 只有已签约的情况下才可以进行出入金
-                if (signstatus === 4) {
-                    router.push({ name: 'bank-wallet', query: { tab } })
-                } else {
-                    dialog({
-                        message: '请先添加签约账户信息!',
-                        showCancelButton: true,
-                        confirmButtonText: '去签约'
-                    }).then(() => {
-                        router.push({ name: 'bank-sign' })
-                    })
-                }
-            }).catch(() => {
-                hideLoading('加载失败', 'fail')
-            })
-        }, '正在加载...')
-    } else {
-        dialog({
-            message: '请先实名认证,再进行该操作!',
-            showCancelButton: true,
-            confirmButtonText: '去实名'
-        }).then(() => {
-            router.push({ name: 'account-certification' })
-        })
-    }
-}
-
-const userLogout = () => {
-    dialog({
-        message: '是否退出当前账号?',
-        showCancelButton: true
-    }).then(() => {
-        loginStore.clearAutoLoginData()
-        eventBus.$emit('LogoutNotify')
-    })
-}
-
-onActivated(() => {
-    if (authStatus.value !== AuthStatus.Certified) {
-        userStore.getUserData()
-    }
-    accountStore.getAccountList()
-
-    /// 机构不需要签合同
-    if (userStore.userInfo.usertype === 2) {
-        canBankSign.value = true
-        return
-    }
+import { useSetup } from './composables'
 
-    getTencentUsereSignRecords()
-})
+const {
+    globalStore,
+    loginStore,
+    userStore,
+    noticeStore,
+    authStatus,
+    currentAccount,
+    profitLoss,
+    signRecords,
+    canBankSign,
+    doInOutMoney,
+    userLogout,
+    onReady,
+    routerTo
+} = useSetup()
 </script>
 
 <style lang="less">

+ 1 - 1
src/packages/sbyj/views/order/detail/index.vue

@@ -86,6 +86,7 @@ const props = defineProps({
     }
 })
 
+const t = i18n.global.t
 const { formData, formSubmit } = useModifyOrder()
 
 const globalStore = useGlobalStore()
@@ -96,7 +97,6 @@ const refresh = shallowRef(false) // 是否刷新父组件数据
 
 const goods = futuresStore.getGoods(props.selectedRow.goodsCode)
 const detail = computed(() => props.selectedRow.tHDetailEx)
-const { global: { t } } = i18n
 
 const IsAutoAddDeposit = shallowRef(detail.value.canautoadddeposit === 1)
 const IsAutoRefundDeposit = shallowRef(detail.value.canautorefunddeposit === 1)

+ 5 - 5
src/packages/sjgj/router/index.ts

@@ -65,7 +65,7 @@ const routes: Array<RouteRecordRaw> = [
           {
             path: 'mine',
             name: 'home-mine',
-            component: () => import('../../sbyj/views/mine/index.vue'),
+            component: () => import('../views/mine/index.vue'),
           }
         ]
       },
@@ -170,7 +170,7 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: '',
         name: 'market-list',
-        component: () => import('../../sbyj/views/market/list/index.vue'),
+        component: () => import('../views/market/list/index.vue'),
         meta: {
           ignoreAuth: true,
         },
@@ -178,7 +178,7 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: 'detail',
         name: 'market-detail',
-        component: () => import('../../sbyj/views/market/detail/index.vue'),
+        component: () => import('../views/market/detail/index.vue'),
       },
       {
         path: 'chart',
@@ -215,12 +215,12 @@ const routes: Array<RouteRecordRaw> = [
       {
         path: '',
         name: 'order-list',
-        component: () => import('../../sbyj/views/order/list/index.vue'),
+        component: () => import('../views/order/list/index.vue'),
       },
       {
         path: 'history',
         name: 'history-list',
-        component: () => import('../../sbyj/views/order/history/index.vue'),
+        component: () => import('../views/order/history/index.vue'),
       },
       {
         path: 'close',

+ 3 - 12
src/packages/sjgj/views/home/main/index.vue

@@ -15,17 +15,9 @@
             <img src="../../../assets/images/icons/order.svg" />
             <span>持有订单</span>
           </li>
-          <li @click="routerTo('delivery-list')">
+          <li @click="routerTo('history-list')">
             <img src="../../../assets/images/icons/delivery.svg" />
-            <span>卖料订单</span>
-          </li>
-          <li @click="routerTo('pickup-list')">
-            <img src="../../../assets/images/icons/pickup.svg" />
-            <span>买料订单</span>
-          </li>
-          <li @click="routerTo('inventory-list')">
-            <img src="../../../assets/images/icons/inventory.svg" />
-            <span>我的库存</span>
+            <span>历史持有订单</span>
           </li>
         </ul>
       </app-block>
@@ -57,13 +49,12 @@ import { Cell, CellGroup, PullRefresh, Badge } from 'vant'
 import { formatDate } from '@/filters'
 import { useNavigation } from '@mobile/router/navigation'
 import { queryImageConfigs } from '@/services/api/common'
-import { useNoticeStore, useGlobalStore } from '@/stores'
+import { useNoticeStore } from '@/stores'
 import Banner from '@mobile/components/base/banner/index.vue'
 import { queryNewTitles } from '@/services/api/news'
 
 const { routerTo } = useNavigation()
 const noticeStore = useNoticeStore()
-const globalStore = useGlobalStore()
 const refreshing = shallowRef(false) // 是否处于加载中状态
 const topBanners = shallowRef<string[]>([]) // 轮播图列表
 const newsList = shallowRef<Model.NewTitlesRsp[]>([]) // 资讯列表

+ 27 - 0
src/packages/sjgj/views/market/detail/index.vue

@@ -0,0 +1,27 @@
+<template>
+    <DetailsView @row-click="showComponent">
+        <template #default="{ selectedRow }">
+            <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+                @closed="closeComponent" v-if="componentId" />
+        </template>
+    </DetailsView>
+</template>
+
+<script lang="ts" setup>
+import { defineAsyncComponent } from 'vue'
+import { useComponent } from '@/hooks/component'
+import { useSBYJOrderStore } from '@/stores'
+import DetailsView from '../../../../sbyj/views/market/detail/view.vue'
+
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('../../order/detail/index.vue'))], // 详情
+])
+
+const { getSBYJMyOrders } = useSBYJOrderStore()
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getSBYJMyOrders())
+
+const showComponent = () => {
+    openComponent('detail')
+}
+</script>

+ 0 - 61
src/packages/sjgj/views/market/list/index.less

@@ -1,61 +0,0 @@
-.market {
-    &-header {
-        .app-statusbar {
-            height: 147px;
-            background-image: var(--header-bg);
-            background-repeat: no-repeat;
-            background-position: center top;
-            background-size: 100% auto;
-        }
-    }
-
-    &-title {
-        color: #999;
-        padding: 12px;
-    }
-
-    &-table {
-        width: 100%;
-        text-align: center;
-        background-color: #fff;
-
-        th {
-            color: #999;
-            font-weight: normal;
-            padding: 8px 5px;
-
-            &.title {
-                color: #999;
-                background-color: #f6f6f6;
-                padding: 12px;
-
-                div {
-                    display: flex;
-                    justify-content: space-between;
-                }
-            }
-        }
-
-        tr {
-            &:last-child {
-                td {
-                    border-bottom: 1px solid #eee;
-                }
-            }
-
-            td {
-                border-top: 1px solid #eee;
-                border-right: 1px solid #eee;
-                padding: 6px;
-
-                &:last-child {
-                    border-right: 0;
-                }
-
-                span {
-                    display: block;
-                }
-            }
-        }
-    }
-}

+ 1 - 25
src/packages/sjgj/views/market/list/index.vue

@@ -48,28 +48,6 @@
                     </tr>
                 </tbody>
             </template>
-            <thead>
-                <tr>
-                    <th class="title" colspan="4">
-                        <div>参考商品</div>
-                    </th>
-                </tr>
-            </thead>
-            <tbody>
-                <tr v-for="(item, index) in touristRefGoodsList" :key="index" @click="touristRowClick(item)">
-                    <td>{{ item.goodsname }}</td>
-                    <td :class="item.bidColor">{{ handleNumberValue(formatDecimal(item.bid, item.decimalplace)) }}</td>
-                    <td :class="item.askColor">{{ handleNumberValue(formatDecimal(item.ask, item.decimalplace)) }}</td>
-                    <td>
-                        <span :class="item.highestColor">
-                            {{ handleNumberValue(formatDecimal(item.highest, item.decimalplace)) }}
-                        </span>
-                        <span :class="item.lowestColor">
-                            {{ handleNumberValue(formatDecimal(item.lowest, item.decimalplace)) }}
-                        </span>
-                    </td>
-                </tr>
-            </tbody>
         </table>
     </app-view>
 </template>
@@ -84,10 +62,8 @@ const {
     banners,
     serverTime,
     touristTradeGoodsList,
-    touristRefGoodsList,
     getMarketStatus,
     rowClick,
-    touristRowClick
 } = useSetup()
 
 // 任务 #6668
@@ -95,5 +71,5 @@ const topBanners = computed(() => banners.value.map((e) => e.imagepath))
 </script>
 
 <style lang="less">
-@import './index.less';
+@import '../../../../sbyj/views/market/list/index.less';
 </style>

+ 160 - 0
src/packages/sjgj/views/mine/index.less

@@ -0,0 +1,160 @@
+@import '@mobile/assets/themes/base/mixin.less';
+
+.mine {
+    @backgroundImage: linear-gradient(var(--navbar-background), var(--navbar-background) 150px, transparent 150px);
+
+    .app-navbar {
+        background-image: @backgroundImage;
+
+        &__wrapper {
+            color: #fff;
+            background-color: transparent;
+        }
+    }
+
+    &-header {
+        color: #000;
+        background-color: #fff;
+        background-image: @backgroundImage;
+        padding: 0 18px;
+
+        &__wrapper {
+            background-color: #fff;
+            border-top-left-radius: 10px;
+            border-top-right-radius: 10px;
+            padding: 12px;
+            padding-bottom: 0;
+        }
+
+        .profile {
+            display: flex;
+
+            &-user {
+                flex: 1;
+                display: flex;
+                align-items: center;
+
+                .g-image--avatar {
+                    width: 40px;
+                    height: 40px;
+                    border-radius: 50%;
+                    font-size: 0;
+                    margin-right: 8px;
+                }
+
+                &__info {
+                    flex: 1;
+                    padding-right: 16px;
+
+                    .top {
+                        display: flex;
+                        align-items: center;
+                        font-size: 12px;
+                        color: #A1B1C5;
+
+                        span {
+                            .mixin-text-overflow()
+                        }
+
+                        .van-icon {
+                            line-height: normal;
+                            margin-left: 2px;
+                        }
+                    }
+
+                    .bottom {
+                        line-height: 20px;
+                        font-size: 15px;
+                        font-weight: bold;
+                    }
+                }
+            }
+
+            &-account {
+                display: flex;
+                flex-direction: column;
+                justify-content: center;
+
+                span {
+                    &:first-child {
+                        font-size: 12px;
+                        color: #A1B1C5;
+                    }
+
+                    &:last-child {
+                        font-size: 15px;
+                        font-weight: bold;
+                    }
+                }
+            }
+        }
+
+        .bank {
+            display: flex;
+            justify-content: space-around;
+            padding: 18px 0;
+
+            ul {
+                li {
+                    display: flex;
+                    flex-direction: column;
+                    padding-bottom: 5px;
+
+                    span {
+                        line-height: 20px;
+
+                        &:first-child {
+                            font-size: 12px;
+                            color: #A1B1C5;
+                        }
+
+                        &:last-child {
+                            font-size: 15px;
+                            font-weight: bold;
+                        }
+                    }
+                }
+            }
+        }
+
+        .button {
+            display: flex;
+            justify-content: space-around;
+
+            .van-button {
+                width: 140px;
+                box-shadow: 0 3px 7px 0 #e0e2e8;
+            }
+        }
+    }
+
+    &-iconbar {
+        ul {
+            display: flex;
+            background-color: #fff;
+            padding: 12px;
+
+            li {
+                flex: 1;
+                display: flex;
+                flex-direction: column;
+                align-items: center;
+
+                .g-icon {
+                    font-size: 28px;
+                    margin-bottom: 2px;
+                }
+            }
+        }
+    }
+
+    &-footer {
+        text-align: center;
+        padding: 10px 0;
+
+        .button-logout {
+            width: 50%;
+            border: 0;
+        }
+    }
+}

+ 138 - 0
src/packages/sjgj/views/mine/index.vue

@@ -0,0 +1,138 @@
+<template>
+    <app-view class="mine">
+        <template #header>
+            <app-navbar title="我的" :show-back-button="false" @ready="onReady" />
+        </template>
+        <div ref="headerRef" class="mine-header">
+            <div class="mine-header__wrapper">
+                <div class="profile">
+                    <div class="profile-user">
+                        <div class="profile-user__avatar" @click="routerTo('user-avatar')">
+                            <img class="g-image--avatar" :src="userStore.userAvatar" />
+                        </div>
+                        <div class="profile-user__info">
+                            <div class="top">
+                                <span>{{ userStore.customerName }}</span>
+                                <Icon name="checked" color="var(--van-tag-success-color)"
+                                    v-if="authStatus === AuthStatus.Certified" />
+                                <Icon name="warning" color="var(--van-tag-warning-color)" v-else />
+                            </div>
+                            <div class="bottom">{{ loginStore.loginId }}</div>
+                        </div>
+                    </div>
+                </div>
+                <div class="bank">
+                    <ul>
+                        <li>
+                            <span>余额</span>
+                            <span>{{ currentAccount.currentbalance?.toFixed(2) }}</span>
+                        </li>
+                        <li>
+                            <span>占用定金</span>
+                            <span>{{ currentAccount.usedmargin?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                    <ul>
+                        <li>
+                            <span>可用权益</span>
+                            <span>{{ currentAccount.avaiableMoney?.toFixed(2) }}</span>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+        </div>
+        <app-block class="mine-iconbar">
+            <ul>
+                <li @click="routerTo('order-list')">
+                    <Iconfont label-direction="bottom" icon="g-icon-order--line">持有订单</Iconfont>
+                </li>
+                <li @click="routerTo('history-list')">
+                    <Iconfont label-direction="bottom" icon="g-icon-presale--line">历史持有订单</Iconfont>
+                </li>
+            </ul>
+        </app-block>
+        <app-block class="g-navmenu">
+            <CellGroup>
+                <Cell is-link :to="{ name: 'account-authresult' }" v-if="authStatus === AuthStatus.Submitted">
+                    <template #title>
+                        <Iconfont icon="g-icon-certification">实名认证</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'account-certification' }" v-else-if="authStatus !== AuthStatus.Certified">
+                    <template #title>
+                        <Iconfont icon="g-icon-certification">实名认证</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'bank-sign' }" v-if="authStatus === AuthStatus.Certified && canBankSign">
+                    <template #title>
+                        <Iconfont icon="g-icon-sign">签约账户</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'account-protocol' }"
+                    v-if="signRecords.length && userStore.userType != 2 && authStatus === AuthStatus.Certified">
+                    <template #title>
+                        <Iconfont icon="g-icon-order--line">合同签署</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'mine-profile' }">
+                    <template #title>
+                        <Iconfont icon="g-icon-profile">个人信息</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'rules-zcxy' }">
+                    <template #title>
+                        <Iconfont icon="g-icon-zcxy">用户注册协议</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'rules-yszc' }">
+                    <template #title>
+                        <Iconfont icon="g-icon-yszc">关于隐私</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'notice-list' }">
+                    <template #title>
+                        <Iconfont icon="g-icon-caution">公告通知</Iconfont>
+                        <Badge :dot="noticeStore.unreadList.length > 0" />
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'mine-setting' }">
+                    <template #title>
+                        <Iconfont icon="g-icon-setting">设置</Iconfont>
+                    </template>
+                </Cell>
+                <Cell is-link :to="{ name: 'rules-gywm' }">
+                    <template #title>
+                        <Iconfont icon="g-icon-gywm">关于我们</Iconfont>
+                    </template>
+                </Cell>
+            </CellGroup>
+        </app-block>
+        <div class="mine-footer">
+            <Button class="button-logout" type="primary" size="small" round @click="userLogout">退出登录</Button>
+        </div>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { Cell, CellGroup, Button, Icon, Badge } from 'vant'
+import { AuthStatus } from '@/constants/account'
+import Iconfont from '@/components/base/iconfont/index.vue'
+import { useSetup } from '../../../sbyj/views/mine/composables'
+
+const {
+    loginStore,
+    userStore,
+    noticeStore,
+    authStatus,
+    currentAccount,
+    signRecords,
+    canBankSign,
+    userLogout,
+    onReady,
+    routerTo
+} = useSetup()
+</script>
+
+<style lang="less">
+@import './index.less';
+</style>

+ 57 - 0
src/packages/sjgj/views/order/detail/index.vue

@@ -0,0 +1,57 @@
+<!-- 深金国际-我的订单-详情 -->
+<template>
+    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="订单详情" @back="closed" />
+            </template>
+            <div class="order-detail__container g-form__container">
+                <CellGroup inset>
+                    <Cell class="nowrap"
+                        :title="(detail.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') : $t('enum.BuyOrSell.Sell')) + '订单'"
+                        :value="detail.tradeID" />
+                    <Cell title="商品代码/名称" :value="selectedRow.goodsCode + '/' + selectedRow.goodsName" />
+                    <Cell title="订单重量"
+                        :value="(detail.openQty * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Cell title="可用量"
+                        :value="((detail.holderQty - detail.freezeQty) * selectedRow.agreeUnit) + getGoodsUnitName(selectedRow.goodsUnitID)" />
+                    <Cell title="订单价格" :value="detail.holderPrice" />
+                    <Cell title="订单金额" :value="detail.holderAmount" />
+                    <Cell title="已付定金" :value="detail.payedDeposit" />
+                    <Cell title="订单天数" :value="detail.holdDays + 1" />
+                    <Cell :title="$t('mine.callAteFee')" :value="detail.callAteFee" />
+                    <Cell title="订单时间" :value="detail.tradeTime" />
+                </CellGroup>
+            </div>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType, computed } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import { BuyOrSell } from '@/constants/order'
+import { getGoodsUnitName } from '@/constants/unit'
+import AppModal from '@/components/base/modal/index.vue'
+
+const props = defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.SBYJMyOrderRsp>,
+        required: true,
+    }
+})
+
+const showModal = shallowRef(true)
+
+const detail = computed(() => props.selectedRow.tHDetailEx)
+
+// 关闭弹窗
+const closed = () => {
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 58 - 0
src/packages/sjgj/views/order/history/components/detail/index.vue

@@ -0,0 +1,58 @@
+<!-- 深金国际-全部订单-详情 -->
+<template>
+    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal">
+        <app-view class="g-form">
+            <template #header>
+                <app-navbar title="订单详情" @back="closed" />
+            </template>
+            <div class="order-detail__container g-form__container">
+                <CellGroup inset>
+                    <Cell class="nowrap" :title="(selectedRow.buyorsell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') : $t('enum.BuyOrSell.Sell'))+'订单'"
+                        :value="selectedRow.tradeid" />
+                    <Cell title="商品代码/名称" :value="selectedRow.goodscode + '/' + selectedRow.goodsname" />
+                    <Cell title="订单重量"
+                        :value="(selectedRow.openqty * selectedRow.agreeunit) + getGoodsUnitName(selectedRow.goodunitid)" />
+                    <Cell title="可用量" :value="enableqty(selectedRow) + getGoodsUnitName(selectedRow.goodunitid)" />
+                    <Cell title="订单价格" :value="formatDecimal(selectedRow.openprice, selectedRow.decimalplace)" />
+                    <Cell title="已付定金" :value="selectedRow.payeddeposit" />
+                    <Cell title="订单天数" :value="selectedRow.holddays + 1" />
+                    <Cell :title="$t('mine.callAteFee')" :value="selectedRow.callatefee" />
+                    <Cell title="交易时间" :value="selectedRow.tradetime" />
+                </CellGroup>
+            </div>
+        </app-view>
+    </app-modal>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, PropType } from 'vue'
+import { CellGroup, Cell } from 'vant'
+import { formatDecimal } from '@/filters'
+import { BuyOrSell } from '@/constants/order'
+import AppModal from '@/components/base/modal/index.vue'
+import { getGoodsUnitName } from '@/constants/unit'
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.TradeHolderDetailExRsp>,
+        required: true,
+    }
+})
+
+const showModal = shallowRef(true)
+
+// 可用重量
+const enableqty = (item: Model.TradeHolderDetailExRsp) => {
+    return (item.holderqty - item.freezeqty) * item.agreeunit
+}
+
+// 关闭弹窗
+const closed = () => {
+    showModal.value = false
+}
+
+// 暴露组件属性给父组件调用
+defineExpose({
+    closed,
+})
+</script>

+ 119 - 0
src/packages/sjgj/views/order/history/index.vue

@@ -0,0 +1,119 @@
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="全部订单" />
+        </template>
+        <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error"
+            v-model:pageIndex="pageIndex" :page-count="pageCount" @refresh="run">
+            <div class="g-order-list">
+                <div class="g-order-list__box" v-for="(item, index) in dataList" :key="index">
+                    <div class="g-order-list__titlebar">
+                        <div class="left">
+                            <h4 :class="item.buyorsell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
+                                {{ item.buyorsell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') :
+                                $t('enum.BuyOrSell.Sell') }}{{
+                                ':' }}
+                                {{ item.goodscode + '/' + item.goodsname }}
+                                {{ formatDecimal(item.openprice, item.decimalplace) }}
+                            </h4>
+                        </div>
+                    </div>
+                    <div class="g-order-list__content">
+                        <ul>
+                            <li>
+                                <span>订单重量</span>
+                                <span>
+                                    {{ item.openqty * item.agreeunit }}
+                                    {{ getGoodsUnitName(item.goodunitid) }}
+                                </span>
+                            </li>
+                            <li>
+                                <span>交收重量</span>
+                                <span>{{ (item.deliveryqty * item.agreeunit) + getGoodsUnitName(item.goodunitid)
+                                }}</span>
+                            </li>
+                            <li>
+                                <span>可用重量</span>
+                                <span>
+                                    {{ enableqty(item) + getGoodsUnitName(item.goodunitid) }}
+                                </span>
+                            </li>
+                            <!-- <li>
+                                <span>订单金额</span>
+                                <span>{{ item.tradeamount }}</span>
+                            </li> -->
+                            <li>
+                                <span>订单价格</span>
+                                <span>{{ formatDecimal(item.openprice, item.decimalplace) }}</span>
+                            </li>
+                            <li>
+                                <span>已付定金</span>
+                                <span>{{ item.payeddeposit }}</span>
+                            </li>
+                            <li>
+                                <span>订单天数</span>
+                                <span>{{ item.holddays + 1 }}天</span>
+                            </li>
+                            <li>
+                                <span>{{ $t('mine.callAteFee') }}</span>
+                                <span>{{ item.callatefee }}</span>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="g-order-list__btnbar">
+                        <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
+                    </div>
+                </div>
+            </div>
+        </app-pull-refresh>
+        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+            @closed="closeComponent" v-if="componentId" />
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, defineAsyncComponent } from 'vue'
+import { Button } from 'vant'
+import { formatDecimal } from '@/filters'
+import { BuyOrSell } from '@/constants/order'
+import { getGoodsUnitName } from '@/constants/unit'
+import { useComponent } from '@/hooks/component'
+import { useRequest } from '@/hooks/request'
+import { queryTradeHolderDetailEx } from '@/services/api/order'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('./components/detail/index.vue'))], // 详情
+])
+
+const error = shallowRef(false)
+const dataList = shallowRef<Model.TradeHolderDetailExRsp[]>([])
+const selectedRow = shallowRef<Model.TradeHolderDetailExRsp>()
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+
+const { loading, pageIndex, pageCount, run } = useRequest(queryTradeHolderDetailEx, {
+    params: {
+        pagesize: 20
+    },
+    onSuccess: (res) => {
+        if (pageIndex.value === 1) {
+            dataList.value = []
+        }
+        dataList.value.push(...res.data)
+    },
+    onError: () => {
+        error.value = true
+    }
+})
+
+// 可用重量
+const enableqty = (item: Model.TradeHolderDetailExRsp) => {
+    return (item.holderqty - item.freezeqty) * item.agreeunit
+}
+
+const showComponent = (componentName: string, row: Model.TradeHolderDetailExRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
+</script>

+ 133 - 0
src/packages/sjgj/views/order/list/index.vue

@@ -0,0 +1,133 @@
+<template>
+    <app-view flex>
+        <template #header>
+            <app-navbar title="我的订单">
+                <template #right>
+                    <div class="button-more" @click="$router.push({ name: 'history-list' })">
+                        <span>更多</span>
+                    </div>
+                </template>
+            </app-navbar>
+        </template>
+        <Tabs v-model:active="active" :swipe-threshold="4" @change="getSBYJMyOrders">
+            <Tab title="全部" />
+            <Tab title="买料" />
+            <Tab title="卖料" />
+        </Tabs>
+        <app-pull-refresh ref="pullRefreshRef" v-model:loading="loading" v-model:error="error"
+            @refresh="getSBYJMyOrders">
+            <div class="g-order-list">
+                <div class="g-order-list__box" v-for="(item, index) in getDataList" :key="index">
+                    <div class="g-order-list__titlebar">
+                        <div class="left">
+                            <h4 :class="item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? 'g-price-up' : 'g-price-down'">
+                                {{ item.tHDetailEx.buyOrSell === BuyOrSell.Buy ? $t('enum.BuyOrSell.Buy') :
+                                    $t('enum.BuyOrSell.Sell') }}{{ ':' }}
+                                {{ item.goodsCode + '/' + item.goodsName }}
+                                {{ formatDecimal(item.tHDetailEx.holderPrice, item.decimalPlace) }}
+                            </h4>
+                        </div>
+                        <div class="right" v-if="riskType === 1">
+                            <span
+                                :class="{ 'g-price-up': item.tHDetailEx.depositRate <= item.tHDetailEx.promptDepositRate }"
+                                v-if="item.tHDetailEx.payedDeposit">
+                                {{ parsePercent(item.tHDetailEx.depositRate) }}
+                            </span>
+                            <span v-else>
+                                {{ handleNumberValue() }}
+                            </span>
+                        </div>
+                    </div>
+                    <div class="g-order-list__content">
+                        <ul>
+                            <li>
+                                <span>订单重量</span>
+                                <span>
+                                    {{ item.tHDetailEx.openQty * item.agreeUnit }}
+                                    {{ getGoodsUnitName(item.goodsUnitID) }}
+                                </span>
+                            </li>
+                            <li>
+                                <span>可用重量</span>
+                                <span>
+                                    {{ enableqty(item) + getGoodsUnitName(item.goodsUnitID) }}
+                                </span>
+                            </li>
+                            <li>
+                                <span>订单价格</span>
+                                <span>{{ formatDecimal(item.tHDetailEx.holderPrice, item.decimalPlace) }}</span>
+                            </li>
+                            <li>
+                                <span>已付定金</span>
+                                <span>{{ item.tHDetailEx.payedDeposit }}</span>
+                            </li>
+                            <li>
+                                <span>订单天数</span>
+                                <span>{{ item.tHDetailEx.holdDays + 1 }}天</span>
+                            </li>
+                            <li>
+                                <span>{{ $t('mine.callAteFee') }}</span>
+                                <span>{{ item.tHDetailEx.callAteFee }}</span>
+                            </li>
+                        </ul>
+                    </div>
+                    <div class="g-order-list__btnbar">
+                        <Button size="small" @click="showComponent('detail', item)" round>详情</Button>
+                    </div>
+                </div>
+            </div>
+        </app-pull-refresh>
+        <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+            @closed="closeComponent" v-if="componentId" />
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+import { onMounted, shallowRef, defineAsyncComponent, computed } from 'vue'
+import { BuyOrSell } from '@/constants/order'
+import { formatDecimal, parsePercent, handleNumberValue } from '@/filters'
+import { getGoodsUnitName } from '@/constants/unit'
+import { useComponent } from '@/hooks/component'
+import { Button, Tabs, Tab } from 'vant'
+import { useGlobalStore, useSBYJOrderStore } from '@/stores'
+import AppPullRefresh from '@mobile/components/base/pull-refresh/index.vue'
+
+const componentMap = new Map<string, unknown>([
+    ['detail', defineAsyncComponent(() => import('../detail/index.vue'))], // 详情
+])
+
+const active = shallowRef(0)
+
+const globalStore = useGlobalStore()
+const riskType = globalStore.getSystemInfo('riskType') // 风控类型
+
+const { getSBYJMyOrders, $toRefs } = useSBYJOrderStore()
+
+const { orderComputedList, loading, error } = $toRefs()
+const selectedRow = shallowRef<Model.SBYJMyOrderRsp>()
+
+const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => getSBYJMyOrders())
+
+const getDataList = computed(() => {
+    if (active.value === 0) {
+        return orderComputedList.value
+    } else if (active.value === 1) {
+        return orderComputedList.value.filter(obj => obj.tHDetailEx.buyOrSell === 0)
+    } else {
+        return orderComputedList.value.filter(obj => obj.tHDetailEx.buyOrSell === 1)
+    }
+})
+
+// 可用重量
+const enableqty = (item: Model.SBYJMyOrderRsp) => {
+    const { tHDetailEx, agreeUnit } = item
+    return (tHDetailEx.holderQty - tHDetailEx.freezeQty) * agreeUnit
+}
+
+const showComponent = (componentName: string, row: Model.SBYJMyOrderRsp) => {
+    selectedRow.value = row
+    openComponent(componentName)
+}
+
+onMounted(() => getSBYJMyOrders())
+</script>