|
|
@@ -38,7 +38,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import { computed, onUnmounted } from 'vue'
|
|
|
+import { computed, onUnmounted, onActivated } from 'vue'
|
|
|
import { parsePercent, handleNumberValue, formatDecimal } from '@/filters'
|
|
|
import { useRequest } from '@/hooks/request'
|
|
|
import { useNavigation } from '@mobile/router/navigation'
|
|
|
@@ -73,11 +73,12 @@ const { dataList, run } = useRequest(queryQuoteGoodsList, {
|
|
|
})
|
|
|
|
|
|
const tableList = computed(() => {
|
|
|
- return dataList.value.map(({ refgoodsid, goodscode, goodsname }) => {
|
|
|
+ return dataList.value.map(({ refgoodsid,refgoodscode, goodscode, goodsname }) => {
|
|
|
const quote = futuresStore.getGoodsQuote(refgoodsid)
|
|
|
const { lastColor, openedColor, lowestColor, highestColor, last = 0, presettle = 0, rise = 0, change, amplitude, highest = 0, lowest = 0, opened = 0, decimalplace } = quote.value ?? {}
|
|
|
return {
|
|
|
refgoodsid,
|
|
|
+ refgoodscode,
|
|
|
goodscode,
|
|
|
goodsname,
|
|
|
lastColor,
|
|
|
@@ -97,7 +98,8 @@ const tableList = computed(() => {
|
|
|
})
|
|
|
|
|
|
const columns: Model.TableColumn[] = [
|
|
|
- { prop: 'goodsname', label: '商品/标的' },
|
|
|
+ { prop: 'goodsname', label: '商品/合约' },
|
|
|
+ { prop: 'refgoodscode', label: '标的' },
|
|
|
{ prop: 'last', label: '当前价' },
|
|
|
{ prop: 'rise', label: '涨跌' },
|
|
|
{ prop: 'change', label: '幅度' },
|
|
|
@@ -109,18 +111,23 @@ const columns: Model.TableColumn[] = [
|
|
|
]
|
|
|
|
|
|
const rowClick = (row: Model.QuoteGoodsListRsp) => {
|
|
|
-
|
|
|
- const { hasauth } = userStore.userAccount
|
|
|
/// 这里要去判断是否已经实名认证
|
|
|
- if (hasauth === 1) {
|
|
|
+ if (userStore.hasAuth) {
|
|
|
setGlobalUrlParams(row)
|
|
|
router.push({ name: 'swap-detail' })
|
|
|
} else {
|
|
|
showToast('未实名认证,请先去实名认证,如果已提交实名认证,请耐心等待审核通过!')
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-futuresStore.onResponse(() => run())
|
|
|
+onActivated(() => {
|
|
|
+ const goodsCodes = dataList.value.map((e) => e.refgoodscode)
|
|
|
+ if (goodsCodes.length) {
|
|
|
+ subscribe.start(...goodsCodes)
|
|
|
+ } else {
|
|
|
+ run()
|
|
|
+ }
|
|
|
+})
|
|
|
|
|
|
onUnmounted(() => subscribe.stop())
|
|
|
</script>
|