1 line
9.0 KiB
JSON
1 line
9.0 KiB
JSON
{"ast":null,"code":"import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, 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};\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 key: index,\n name: item.name,\n onClick: $event => _ctx.handleClick(item)\n }, {\n icon: _withCtx(props => [_createElementVNode(\"span\", {\n class: _normalizeClass([\"tab-icon\", {\n active: props.active\n }])\n }, _toDisplayString(item.icon), 3 /* TEXT, CLASS */)]),\n\n default: _withCtx(() => [_createElementVNode(\"span\", {\n class: _normalizeClass([\"tab-text\", {\n active: $setup.active === item.name\n }])\n }, _toDisplayString(item.text), 3 /* TEXT, CLASS */)]),\n\n _: 2 /* DYNAMIC */\n }, 1032 /* PROPS, DYNAMIC_SLOTS */, [\"name\", \"onClick\"]);\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","key","name","onClick","_ctx","handleClick","icon","_withCtx","props","_createElementVNode","_normalizeClass","text"],"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 v-for=\"(item, index) in tabbar\" :key=\"index\" :name=\"item.name\" @click=\"handleClick(item)\">\n\t\t\t\t<template #icon=\"props\">\n\t\t\t\t\t<span class=\"tab-icon\" :class=\"{ active: props.active }\">{{ item.icon }}</span>\n\t\t\t\t</template>\n\t\t\t\t<span class=\"tab-text\" :class=\"{ active: active === item.name }\">{{ item.text }}</span>\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,CASM,OATNC,UASM,GARLC,YAAA,CAOaC,qBAAA;gBAPQC,MAAA,CAAAC,MAAM;+DAAND,MAAA,CAAAC,MAAM,GAAAC,MAAA;;sBACT,MAA+B,E,kBAAhDN,mBAAA,CAKkBO,SAAA,QAAAC,WAAA,CALuBJ,MAAA,CAAAK,MAAM,GAAtBC,IAAI,EAAEC,KAAK;2BAApCC,YAAA,CAKkBC,0BAAA;QALgCC,GAAG,EAAEH,KAAK;QAAGI,IAAI,EAAEL,IAAI,CAACK,IAAI;QAAGC,OAAK,EAAAV,MAAA,IAAEW,IAAA,CAAAC,WAAW,CAACR,IAAI;;QAC5FS,IAAI,EAAAC,QAAA,CAAEC,KAAK,KACrBC,mBAAA,CAA+E;UAAzEvB,KAAK,EAAAwB,eAAA,EAAC,UAAU;YAAAlB,MAAA,EAAmBgB,KAAK,CAAChB;UAAM;4BAAOK,IAAI,CAACS,IAAI,wB;;0BAEtE,MAAuF,CAAvFG,mBAAA,CAAuF;UAAjFvB,KAAK,EAAAwB,eAAA,EAAC,UAAU;YAAAlB,MAAA,EAAmBD,MAAA,CAAAC,MAAM,KAAKK,IAAI,CAACK;UAAI;4BAAOL,IAAI,CAACc,IAAI,wB"},"metadata":{},"sourceType":"module","externalDependencies":[]} |