10.10综合交易所原始源码_移动端
admin
2026-01-06 42faef34194c466f03e29d75a63ae502e4213044
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<template>
    <div class="morePage">
        <fx-header>
            <template #title>
                {{ $t('更多') }}
            </template>
        </fx-header>
        <div class="main">
            <div class="search-container flex items-center ">
                <van-search class="search-input" v-model="searchVal" :placeholder="$t('搜索更多服务')" shape="round"
                    :background="thStore.theme == 'dark' ? '#131A2E' : '#fff'">
                </van-search>
            </div>
            <div v-if="searchList.length == 0">
                <div class="nav-list ">
                    <div class="title px-5">{{ t('推荐') }}</div>
                    <van-grid class="van-grid-main" :column-num="4" :border="false">
                        <van-grid-item v-for="(item, index) in navList.recommend" @click="openUrl(item)" :key="index"
                            :text="item.name">
                            <template #icon>
                                <img class="grid-item-img" :src="item.url" />
                            </template>
                        </van-grid-item>
                    </van-grid>
                </div>
                <div class="line-div"></div>
                <div class="nav-list ">
                    <div class="title px-5">{{ t('股票') }}</div>
                    <van-grid class="van-grid-main" :column-num="4" :border="false">
                        <van-grid-item v-for="(item, index) in navList.stock" @click="openUrl(item)" :key="index"
                            :text="item.name">
                            <template #icon>
                                <img class="grid-item-img" :src="item.url" />
                            </template>
                        </van-grid-item>
                    </van-grid>
                </div>
                <div class="line-div"></div>
                <div class="nav-list ">
                    <div class="title px-5">{{ t('ETF') }}</div>
                    <van-grid class="van-grid-main" :column-num="4" :border="false">
                        <van-grid-item v-for="(item, index) in navList.etf" @click="openUrl(item)" :key="index"
                            :text="item.name">
                            <template #icon>
                                <img class="grid-item-img" :src="item.url" />
                            </template>
                        </van-grid-item>
                    </van-grid>
                </div>
                <div class="line-div"></div>
                <div class="nav-list ">
                    <div class="title px-5">{{ t('外汇') }}</div>
                    <van-grid class="van-grid-main" :column-num="4" :border="false">
                        <van-grid-item v-for="(item, index) in navList.foreign" @click="openUrl(item)" :key="index"
                            :text="item.name">
                            <template #icon>
                                <img class="grid-item-img" :src="item.url" />
                            </template>
                        </van-grid-item>
                    </van-grid>
                </div>
            </div>
            <div class="search" v-else>
                <div class="nav-list ">
                    <van-grid class="van-grid-main" :column-num="4" :border="false">
                        <van-grid-item v-for="(item, index) in searchList" @click="openUrl(item)" :key="index"
                            :text="item.name">
                            <template #icon>
                                <img class="grid-item-img" :src="item.url" />
                            </template>
                        </van-grid-item>
                    </van-grid>
                </div>
            </div>
        </div>
 
    </div>
</template>
 
<script setup>
import { onMounted, ref, watch } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { showToast } from "vant";
import { useI18n } from "vue-i18n";
import { useUserStore } from '@/store/user';
import { themeStore } from '@/store/theme';
const thStore = themeStore()
const useStore = useUserStore();
const { t } = useI18n()
const route = useRoute()
const router = useRouter()
const searchVal = ref('')
const navList = ref({
    recommend: [
        { name: t('公告中心'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/announcement.png`, import.meta.url), path: '/cryptos/announce', isLogin: false },
        { name: t('充值'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/recharge.png`, import.meta.url), path: '/cryptos/recharge/rechargeList', isLogin: true },
        { name: t('提现'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/withdraw.png`, import.meta.url), path: '/cryptos/withdraw/withdrawPage', isLogin: true },
        { name: t('账变记录'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/record.png`, import.meta.url), path: '/cryptos/accountChange?type=cryptos', isLogin: true },
        { name: t('质押借币'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/PledgeLoan.png`, import.meta.url), path: '/cryptos/pledgeLoan', isLogin: false },
        { name: t('助力贷'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/Helpoan.png`, import.meta.url), path: '/cryptos/loan', isLogin: true },
        { name: t('news'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/Information.png`, import.meta.url), path: '/news', isLogin: false },
        { name: t('理财'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/financialmanagement.png`, import.meta.url), path: '/cryptos/fm-home', isLogin: false },
    ],
    stock: [
        { name: t('美股指数'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/trade.png`, import.meta.url), path: '/quotes/openTrade?tabActive=0&symbol=AAPL&type=US-stocks', isLogin: false },
        { name: t('美股合约'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/contract.png`, import.meta.url), path: '/cryptos/perpetualContract/AAPL?type=US-stocks', isLogin: false },
        { name: t('美股交割'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/delivery1.png`, import.meta.url), path: '/cryptos/perpetualContract/AAPL?type=US-stocks&selectIndex=2', isLogin: false },
        { name: t('港股指数'), url: new URL(`../../assets/theme/${thStore.theme}/image/hkNav/icon01.png`, import.meta.url), path: '/quotes/openTrade?tabActive=0&symbol=00139&type=HK-stocks', isLogin: false },
        { name: t('港股合约'), url: new URL(`../../assets/theme/${thStore.theme}/image/hkNav/icon02.png`, import.meta.url), path: '/cryptos/perpetualContract/00139?type=HK-stocks', isLogin: false },
        { name: t('港股交割'), url: new URL(`../../assets/theme/${thStore.theme}/image/hkNav/icon03.png`, import.meta.url), path: '/cryptos/perpetualContract/00139?type=HK-stocks&selectIndex=2', isLogin: false },
        { name: t('台股指数'), url: new URL(`../../assets/theme/${thStore.theme}/image/twNav/icon01.png`, import.meta.url), path: '/quotes/openTrade?tabActive=0&symbol=2002&type=TW-stocks', isLogin: false },
        { name: t('台股合约'), url: new URL(`../../assets/theme/${thStore.theme}/image/twNav/icon02.png`, import.meta.url), path: '/cryptos/perpetualContract/2002?type=TW-stocks', isLogin: false },
        { name: t('台股交割'), url: new URL(`../../assets/theme/${thStore.theme}/image/twNav/icon03.png`, import.meta.url), path: '/cryptos/perpetualContract/2002?type=TW-stocks&selectIndex=2', isLogin: false },
        // { name: t('A股指数'), url: new URL(`../../assets/theme/${thStore.theme}/image/aNav/icon01.png`, import.meta.url), path: '/quotes/openTrade?tabActive=0&symbol=SH688981&type=A-stocks', isLogin: false },
        // { name: t('A股合约'), url: new URL(`../../assets/theme/${thStore.theme}/image/aNav/icon02.png`, import.meta.url), path: '/cryptos/perpetualContract/SH688981?type=A-stocks', isLogin: false },
        // { name: t('A股交割'), url: new URL(`../../assets/theme/${thStore.theme}/image/aNav/icon03.png`, import.meta.url), path: '/cryptos/perpetualContract/SH688981?type=A-stocks&selectIndex=2', isLogin: false },
    ],
    etf: [
        { name: t('ETF交易'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/trade.png`, import.meta.url), path: '/quotes/openTrade?tabActive=0&symbol=GlobalETF500&type=indices', isLogin: false },
        { name: t('ETF合约'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/contract.png`, import.meta.url), path: '/cryptos/perpetualContract/GlobalETF500?type=indices', isLogin: false },
        { name: t('ETF交割'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/delivery1.png`, import.meta.url), path: '/cryptos/perpetualContract/GlobalETF500?type=indices&selectIndex=2', isLogin: false },
    ],
    foreign: [
        // { name: t('外汇交易'), url: new URL('@/assets/theme/dark/image/nav/trade.png', import.meta.url), path: '/foreign/coinChart?symbol=USDSGD', isLogin: false },
        { name: t('外汇合约'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/contract.png`, import.meta.url), path: '/foreign/coinChart?symbol=USDSGD', isLogin: false },
        { name: t('外汇交割'), url: new URL(`../../assets/theme/${thStore.theme}/image/nav/delivery1.png`, import.meta.url), path: '/foreign/deliveryContract/USDSGD', isLogin: false },
    ]
})
const searchList = ref([])
const allList = ref([]) //全部数据
onMounted(async () => {
    allList.value = [].concat(navList.value.recommend, navList.value.stock, navList.value.etf, navList.value.foreign)
})
const onClickButton = () => {
    if (searchVal.value) {
        searchList.value = allList.value.filter((item) => {
            console.log(item.name.indexOf(searchVal.value))
            return item.name.indexOf(searchVal.value) != -1
        })
        console.log(searchList.value)
    } else {
        searchList.value = []
    }
}
const openUrl = (item) => {
    if (item.isLogin) {
        if (!useStore.userInfo.token) {
            router.push('/login')
            return
        } else {
            router.push(item.path)
        }
    } else {
        router.push(item.path)
    }
}
watch(searchVal, (val, oldVal) => {
    if (val) {
        searchList.value = allList.value.filter((item) => {
            console.log(item.name.indexOf(val))
            return item.name.indexOf(searchVal.value) != -1
        })
        console.log(searchList.value)
    } else {
        searchList.value = []
    }
})
 
 
</script>
<style lang="scss" scoped>
.morePage {
    padding-bottom: 30px;
    font-size: 14px;
 
    .search-container {
 
        .search-input {
            height: 42px;
            display: flex;
            align-items: center;
            width: 100%;
        }
 
        :deep(.van-search__field) {
            background: $search_background !important;
        }
 
        :deep(.van-search__content) {
            overflow: hidden;
            background: $search_background;
        }
 
        :deep(.van-field__control) {
            background: transparent !important;
            height: 100% !important;
            color: $text_color;
        }
    }
 
    .nav-list {
        .title {
            font-size: 16px;
            padding: 20px 15px 10px 15px;
        }
 
        .grid-item-img {
            width: 48px;
            height: 48px;
            margin-bottom: 5px;
        }
 
        :deep(.van-grid-item__content) {
            background: $more-bg;
            padding: 10px 10px;
        }
 
        :deep(.van-grid-item__text) {
            color: $text_color;
            font-size: 12px;
            height: 30px;
            display: flex;
 
        }
    }
 
    .line-div {
        background: $divi_line;
        height: 10px;
    }
 
}
</style>