1 line
8.7 KiB
JSON
1 line
8.7 KiB
JSON
{"ast":null,"code":"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createBlock as _createBlock, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\";\nconst _withScopeId = n => (_pushScopeId(\"data-v-7b7e5f8e\"), n = n(), _popScopeId(), n);\nconst _hoisted_1 = {\n class: \"tabbar\"\n};\nconst _hoisted_2 = [\"src\"];\nexport function render(_ctx, _cache, $props, $setup, $data, $options) {\n const _component_van_tabbar_item = _resolveComponent(\"van-tabbar-item\");\n const _component_van_tabbar = _resolveComponent(\"van-tabbar\");\n return _openBlock(), _createElementBlock(\"div\", _hoisted_1, [_createVNode(_component_van_tabbar, {\n modelValue: $setup.active,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = $event => $setup.active = $event)\n }, {\n default: _withCtx(() => [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList($setup.tabbar, (item, index) => {\n return _openBlock(), _createBlock(_component_van_tabbar_item, {\n onClick: $event => $setup.changeEvnt(item),\n name: $setup.tabbar.name,\n key: index,\n to: item.to\n }, {\n icon: _withCtx(props => [_createElementVNode(\"img\", {\n src: props.active ? $setup.tabbar[index].icon.active : $setup.tabbar[index].icon.inactive\n }, null, 8 /* PROPS */, _hoisted_2)]),\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"onClick\", \"name\", \"to\"]);\n }), 128 /* KEYED_FRAGMENT */))]),\n\n _: 1 /* STABLE */\n }, 8 /* PROPS */, [\"modelValue\"])]);\n}","map":{"version":3,"names":["class","_createElementBlock","_hoisted_1","_createVNode","_component_van_tabbar","$setup","active","$event","_Fragment","_renderList","tabbar","item","index","_createBlock","_component_van_tabbar_item","onClick","changeEvnt","name","key","to","icon","_withCtx","props","_createElementVNode","src","inactive"],"sources":["/Users/li/Desktop/work/work2/OG/GamePortrait/src/components/Tabbar.vue"],"sourcesContent":["<template>\n\t<div class=\"tabbar\">\n\t\t<van-tabbar v-model=\"active\">\n\t\t\t<van-tabbar-item @click=\"changeEvnt(item)\" :name=\"tabbar.name\" v-for=\"(item, index) in tabbar\" :key=\"index\"\n\t\t\t\t:to=\"item.to\">\n\t\t\t\t<template #icon=\"props\">\n\t\t\t\t\t<img :src=\"\n props.active\n ? tabbar[index].icon.active\n : tabbar[index].icon.inactive\n \" />\n\t\t\t\t</template>\n\t\t\t</van-tabbar-item>\n\t\t</van-tabbar>\n\t</div>\n</template>\n\n<script>\n\timport {\n\t\tref,\n\t\tonMounted,\n\t\tcomputed,\n\t\twatch\n\t} from \"vue\"\n\timport {\n\t\tuseRouter\n\t} from \"vue-router\"\n\timport {\n\t\tuseStore\n\t} from \"vuex\"\n\timport {\n\t\tTabbar,\n\t\tTabbarItem,\n\t\tshowDialog\n\t} from \"vant\"\n\texport default {\n\t\tname: \"TabBar\",\n\t\tcomponents: {\n\t\t\t\"van-tabbar\": Tabbar,\n\t\t\t\"van-tabbar-item\": TabbarItem\n\t\t},\n\t\tsetup() {\n\t\t\tconst router = useRouter()\n\t\t\tconst store = useStore()\n\t\t\tconst Type = computed(() => store.state.config.$Type)\n\t\t\tconst Lang = computed(() => store.state.config.$lang)\n\t\t\tconst active = ref(0)\n\t\t\tconst tabbar = ref([])\n\t\t\twatch(\n\t\t\t\t() => [Type.value],\n\t\t\t\t([language]) => {\n\t\t\t\t\tconst prefix =\n\t\t\t\t\t\tlanguage == \"kr\" ||\n\t\t\t\t\t\tlanguage == \"yn\" ||\n\t\t\t\t\t\tlanguage == \"tl\" ||\n\t\t\t\t\t\tlanguage == \"in\" ?\n\t\t\t\t\t\t\"en\" :\n\t\t\t\t\t\tlanguage\n\t\t\t\t\ttabbar.value = [{\n\t\t\t\t\t\t\t// text: \"百家乐\",\n\t\t\t\t\t\t\tname: \"hall\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_classics_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_classics.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tto: \"/baccarat\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"龙虎\",\n\t\t\t\t\t\t\tname: \"lh\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_lh_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_lh.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tto: \"/longhu\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"牛牛\",\n\t\t\t\t\t\t\tname: \"nn\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_nn_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_nn.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tto: \"/nn\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"色碟\",\n\t\t\t\t\t\t\tname: \"toning\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_sd_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_sd.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tto: \"/toning\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"骰宝\",\n\t\t\t\t\t\t\tname: \"dice\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_sb_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_sb.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tto: \"/dice\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"炸金花\",\n\t\t\t\t\t\t\tname: \"threecard\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_sbnn_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_sbnn.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tto: \"/threecard\"\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"轮盘\",\n\t\t\t\t\t\t\tname: \"lp\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_lp_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_lp.png`)\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t//to: \"/lp\"\n\t\t\t\t\t\t},\n\n\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// text: \"多台\",\n\t\t\t\t\t\t\tname: \"multiple\",\n\t\t\t\t\t\t\ticon: {\n\t\t\t\t\t\t\t\tactive: require(`../assets/images/tabbar/${prefix}_multiple_active.png`),\n\t\t\t\t\t\t\t\tinactive: require(`../assets/images/tabbar/${prefix}_multiple.png`)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// to: \"/multiple\"\n\t\t\t\t\t\t}\n\t\t\t\t\t]\n\t\t\t\t}, {\n\t\t\t\t\timmediate: true,\n\t\t\t\t\tdeep: true\n\t\t\t\t}\n\t\t\t)\n\n\t\t\tconst changeEvnt = (data) => {\n\t\t\t\t//if (![\"hall\", \"lh\", \"nn\", \"toning\", \"dice\", \"lp\"].includes(data.name)) {\n\t\t\t\t//if (![\"hall\", \"lh\", \"nn\", \"toning\", \"dice\"].includes(data.name)) {\n\t\t\t\tif (![\"hall\", \"lh\", \"nn\", \"toning\", \"dice\", \"threecard\"].includes(data.name)) {\n\t\t\t\t\tshowDialog({\n\t\t\t\t\t\ttitle: Lang.value[Type.value].tips,\n\t\t\t\t\t\tmessage: Lang.value[Type.value].msg_waiting_development,\n\t\t\t\t\t\tconfirmButtonText: Lang.value[Type.value].Confirm\n\t\t\t\t\t}).then(() => {\n\t\t\t\t\t\tactive.value = 0\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tonMounted(() => {\n\t\t\t\tconst routerName = router.currentRoute.value.name\n\t\t\t\tactive.value =\n\t\t\t\t\trouterName == \"nn\" ?\n\t\t\t\t\t2 :\n\t\t\t\t\trouterName == \"longhu\" ?\n\t\t\t\t\t1 :\n\t\t\t\t\trouterName == \"toning\" ?\n\t\t\t\t\t3 :\n\t\t\t\t\trouterName == \"dice\" ?\n\t\t\t\t\t4 :\n\t\t\t\t\trouterName == \"threecard\" ?\n\t\t\t\t\t5 :\n\t\t\t\t\trouterName == \"lp\" ?\n\t\t\t\t\t6 :\n\t\t\t\t\t0\n\t\t\t})\n\t\t\treturn {\n\t\t\t\ttabbar,\n\t\t\t\tactive,\n\t\t\t\tchangeEvnt\n\t\t\t}\n\t\t}\n\t}\n</script>\n<style lang=\"scss\" scoped>\n\t.tabbar {\n\t\t// position: fixed;\n\t\tposition: absolute;\n\t\twidth: 100%;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\tz-index: 25;\n\t\ttransform: rotateX(0deg);\n\t}\n\n\t.van-tabbar--fixed {\n\t\tposition: static;\n\t\twidth: 100%;\n\t\theight: 50px;\n\t\toverflow-y: auto;\n\t}\n\n\t.van-tabbar {\n\t\tbackground: rgba($color: #fff, $alpha: 0.95);\n\t}\n\n\t.van-tabbar-item__icon img {\n\t\theight: 26px;\n\t}\n\n\t.van-tabbar-item--active {\n\t\tbackground: none;\n\t}\n</style>"],"mappings":";;;EACMA,KAAK,EAAC;AAAQ;;;;;uBAAnBC,mBAAA,CAaM,OAbNC,UAaM,GAZLC,YAAA,CAWaC,qBAAA;gBAXQC,MAAA,CAAAC,MAAM;+DAAND,MAAA,CAAAC,MAAM,GAAAC,MAAA;;sBACqC,MAA+B,E,kBAA9FN,mBAAA,CASkBO,SAAA,QAAAC,WAAA,CATqEJ,MAAA,CAAAK,MAAM,GAAtBC,IAAI,EAAEC,KAAK;2BAAlFC,YAAA,CASkBC,0BAAA;QATAC,OAAK,EAAAR,MAAA,IAAEF,MAAA,CAAAW,UAAU,CAACL,IAAI;QAAIM,IAAI,EAAEZ,MAAA,CAAAK,MAAM,CAACO,IAAI;QAAmCC,GAAG,EAAEN,KAAK;QACxGO,EAAE,EAAER,IAAI,CAACQ;;QACCC,IAAI,EAAAC,QAAA,CAAEC,KAAK,KACrBC,mBAAA,CAIW;UAJLC,GAAG,EAAiBF,KAAK,CAAChB,MAAM,GAAmBD,MAAA,CAAAK,MAAM,CAACE,KAAK,EAAEQ,IAAI,CAACd,MAAM,GAAmBD,MAAA,CAAAK,MAAM,CAACE,KAAK,EAAEQ,IAAI,CAACK"},"metadata":{},"sourceType":"module","externalDependencies":[]} |