{"ast":null,"code":"import \"vant/es/popup/style\";\nimport _Popup from \"vant/es/popup\"; //\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\nimport \"core-js/modules/es.array.push.js\";\nimport { mapGetters } from \"vuex\";\nimport { _getHomeList } from \"@/API/home.api\";\nimport { setStorage } from \"@/utils/utis\";\nexport default {\n name: \"contractHeader\",\n props: {\n backFunc: {\n type: Function,\n default: null\n },\n balance: {\n // 余额\n type: [String, Number],\n default: 0.0\n },\n // title:{\n // type:String,\n // default:''\n // },\n symbol: {\n type: String,\n default: \"\"\n },\n range: {\n type: String,\n defalult: \"\"\n },\n selectIndex: {\n type: [String, Number],\n defalult: \"\"\n }\n },\n components: {\n [_Popup.name]: _Popup\n },\n computed: {\n ...mapGetters({\n coinList: \"home/coinList\",\n theme: \"home/theme\"\n }),\n title() {\n return [this.$t(\"永续\"), this.$t(\"交割\")][this.selectIndex - 1];\n }\n },\n data() {\n return {\n // selectIndex2:this.selectIndex,\n show: false,\n timeout: null,\n // title: '',\n list: [\n // { name:\"BTC/USDT\",close:\"22042.28\",change_ratio:\"2.21\"},\n // { name:\"XTZ/USDT\",close:\"1.568\",change_ratio:\"-7.1\"},\n // { name:\"ADA/USDT\",close:\"0.493085\",change_ratio:\"-4.08\"},\n ]\n };\n },\n created() {\n // this.coins = this.coinList.map(item => item.symbol)\n // console.log('this.coins', this.coins)\n },\n methods: {\n onRoute(item) {\n if (this.$route.params.symbol !== item.symbol) {\n this.$router.push(`/perpetualContract/${item.symbol}`);\n this.$emit(\"update-coin\", item.symbol);\n setStorage(\"symbol\", item.symbol);\n this.onClose();\n this.$forceUpdate();\n }\n this.show = false;\n },\n onSidebar() {\n // 侧边栏打开\n console.log(this.userInfo);\n this.coins = this.coinList.map(item => item.symbol);\n this.show = true;\n this.fetchList();\n },\n fetchList() {\n // 获取行情\n _getHomeList(this.coins.join(\",\")).then(list => {\n // console.log(list)\n this.list = list;\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.timeout = setTimeout(() => {\n this.fetchList();\n }, 1000);\n });\n },\n onClose() {\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n },\n jump() {\n this.$router.push(`/trendDetails/${this.symbol}`);\n },\n changeTab(index) {\n this.$emit(\"tab\", index);\n // this.selectIndex2 = index;\n }\n }\n};","map":{"version":3,"names":["mapGetters","_getHomeList","setStorage","name","props","backFunc","type","Function","default","balance","String","Number","symbol","range","defalult","selectIndex","components","_Popup","computed","coinList","theme","title","$t","data","show","timeout","list","created","methods","onRoute","item","$route","params","$router","push","$emit","onClose","$forceUpdate","onSidebar","console","log","userInfo","coins","map","fetchList","join","then","clearTimeout","setTimeout","jump","changeTab","index"],"sources":["src/components/contract-header/index.vue"],"sourcesContent":["\n\n\n\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8GA,SAAAA,UAAA;AACA,SAAAC,YAAA;AACA,SAAAC,UAAA;AACA;EACAC,IAAA;EACAC,KAAA;IACAC,QAAA;MACAC,IAAA,EAAAC,QAAA;MACAC,OAAA;IACA;IACAC,OAAA;MACA;MACAH,IAAA,GAAAI,MAAA,EAAAC,MAAA;MACAH,OAAA;IACA;IACA;IACA;IACA;IACA;IACAI,MAAA;MACAN,IA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IACAR,QAAA;MACA,SAAAX,OAAA;QACAsB,YAAA,MAAAtB,OAAA;QACA,KAAAA,OAAA;MACA;IACA;IACAwB,KAAA;MACA,KAAAhB,OAAA,CAAAC,IAAA,uBAAAtB,MAAA;IACA;IACAsC,UAAAC,KAAA;MACA,KAAAhB,KAAA,QAAAgB,KAAA;MACA;IACA;EACA;AACA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}