gengx
This commit is contained in:
+1
-88
@@ -1,89 +1,2 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
||||
__name: "index",
|
||||
props: {
|
||||
bottom: { default: 200 },
|
||||
inline: { type: Boolean, default: false },
|
||||
tone: { default: "default" }
|
||||
},
|
||||
setup(__props) {
|
||||
const trainingItems = [
|
||||
{ url: "/training/pages/dumbbell", title: "哑铃", sub: "力量塑形", icon: "dumbbell", iconClass: "menu-icon--dumbbell" },
|
||||
{ url: "/training/pages/foot-pedal", title: "脚蹬器", sub: "下肢有氧", icon: "pedal", iconClass: "menu-icon--pedal" },
|
||||
{ url: "/training/pages/pilates-ring", title: "瑜伽环", sub: "核心塑形", icon: "pilates", iconClass: "menu-icon--pilates" },
|
||||
{ url: "/training/pages/grip-ring", title: "握力环", sub: "握力训练", icon: "grip", iconClass: "menu-icon--grip" },
|
||||
{ url: "/training/pages/metronome", title: "耗糖节拍器", sub: "健走配速", icon: "metro", iconClass: "menu-icon--metro", featured: true }
|
||||
];
|
||||
const props = __props;
|
||||
const inlineItems = common_vendor.computed(() => {
|
||||
if (props.tone !== "weekly")
|
||||
return trainingItems;
|
||||
const metro = trainingItems.find((i) => i.icon === "metro");
|
||||
const rest = trainingItems.filter((i) => i.icon !== "metro");
|
||||
return metro ? [metro, ...rest] : trainingItems;
|
||||
});
|
||||
const visible = common_vendor.ref(true);
|
||||
const expanded = common_vendor.ref(false);
|
||||
const toggle = () => {
|
||||
expanded.value = !expanded.value;
|
||||
};
|
||||
const goto = (url) => {
|
||||
expanded.value = false;
|
||||
common_vendor.index.navigateTo({ url });
|
||||
};
|
||||
return (_ctx, _cache) => {
|
||||
return common_vendor.e({
|
||||
a: visible.value && props.inline
|
||||
}, visible.value && props.inline ? common_vendor.e({
|
||||
b: props.tone === "weekly"
|
||||
}, props.tone === "weekly" ? {} : {}, {
|
||||
c: common_vendor.f(inlineItems.value, (item, k0, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.featured
|
||||
}, item.featured ? {} : {}, {
|
||||
b: item.icon === "dumbbell"
|
||||
}, item.icon === "dumbbell" ? {} : item.icon === "pedal" ? {} : item.icon === "pilates" ? {} : item.icon === "grip" ? {} : item.icon === "metro" ? {} : {}, {
|
||||
c: item.icon === "pedal",
|
||||
d: item.icon === "pilates",
|
||||
e: item.icon === "grip",
|
||||
f: item.icon === "metro",
|
||||
g: common_vendor.n(item.iconClass),
|
||||
h: common_vendor.t(item.title),
|
||||
i: common_vendor.t(item.sub),
|
||||
j: item.url,
|
||||
k: common_vendor.o(($event) => goto(item.url), item.url)
|
||||
});
|
||||
}),
|
||||
d: props.tone === "weekly"
|
||||
}, props.tone === "weekly" ? {} : {}, {
|
||||
e: props.tone === "weekly" ? 1 : ""
|
||||
}) : visible.value ? common_vendor.e({
|
||||
g: expanded.value
|
||||
}, expanded.value ? {
|
||||
h: common_vendor.o(($event) => goto("/training/pages/dumbbell"), "fd"),
|
||||
i: common_vendor.o(($event) => goto("/training/pages/foot-pedal"), "a5"),
|
||||
j: common_vendor.o(($event) => goto("/training/pages/pilates-ring"), "3f"),
|
||||
k: common_vendor.o(($event) => goto("/training/pages/grip-ring"), "23"),
|
||||
l: common_vendor.o(($event) => goto("/training/pages/metronome"), "ca"),
|
||||
m: common_vendor.o(() => {
|
||||
}, "26")
|
||||
} : {}, {
|
||||
n: !expanded.value
|
||||
}, !expanded.value ? {} : {}, {
|
||||
o: !expanded.value
|
||||
}, !expanded.value ? {} : {}, {
|
||||
p: expanded.value
|
||||
}, expanded.value ? {} : {}, {
|
||||
q: expanded.value ? 1 : "",
|
||||
r: common_vendor.o(toggle, "98"),
|
||||
s: props.bottom + "rpx"
|
||||
}) : {}, {
|
||||
f: visible.value
|
||||
});
|
||||
};
|
||||
}
|
||||
});
|
||||
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-17534d15"]]);
|
||||
wx.createComponent(Component);
|
||||
"use strict";const n=require("../../common/vendor.js"),g=n.defineComponent({__name:"index",props:{bottom:{default:200},inline:{type:Boolean,default:!1},tone:{default:"default"}},setup(u){const i=[{url:"/training/pages/dumbbell",title:"哑铃",sub:"力量塑形",icon:"dumbbell",iconClass:"menu-icon--dumbbell"},{url:"/training/pages/foot-pedal",title:"脚蹬器",sub:"下肢有氧",icon:"pedal",iconClass:"menu-icon--pedal"},{url:"/training/pages/pilates-ring",title:"瑜伽环",sub:"核心塑形",icon:"pilates",iconClass:"menu-icon--pilates"},{url:"/training/pages/grip-ring",title:"握力环",sub:"握力训练",icon:"grip",iconClass:"menu-icon--grip"},{url:"/training/pages/metronome",title:"耗糖节拍器",sub:"健走配速",icon:"metro",iconClass:"menu-icon--metro",featured:!0}],t=u,c=n.computed(()=>{if(t.tone!=="weekly")return i;const a=i.find(e=>e.icon==="metro"),s=i.filter(e=>e.icon!=="metro");return a?[a,...s]:i}),r=n.ref(!0),o=n.ref(!1),p=()=>{o.value=!o.value},l=a=>{o.value=!1,n.index.navigateTo({url:a})};return(a,s)=>n.e({a:r.value&&t.inline},r.value&&t.inline?n.e({b:t.tone==="weekly"},t.tone==="weekly"?{}:{},{c:n.f(c.value,(e,v,f)=>n.e({a:e.featured},e.featured?{}:{},{b:e.icon==="dumbbell"},e.icon==="dumbbell"?{}:e.icon==="pedal"?{}:e.icon==="pilates"?{}:e.icon==="grip"?{}:e.icon==="metro"?{}:{},{c:e.icon==="pedal",d:e.icon==="pilates",e:e.icon==="grip",f:e.icon==="metro",g:n.n(e.iconClass),h:n.t(e.title),i:n.t(e.sub),j:e.url,k:n.o(b=>l(e.url),e.url)})),d:t.tone==="weekly"},t.tone==="weekly"?{}:{},{e:t.tone==="weekly"?1:""}):r.value?n.e({g:o.value},o.value?{h:n.o(e=>l("/training/pages/dumbbell"),"fd"),i:n.o(e=>l("/training/pages/foot-pedal"),"a5"),j:n.o(e=>l("/training/pages/pilates-ring"),"3f"),k:n.o(e=>l("/training/pages/grip-ring"),"23"),l:n.o(e=>l("/training/pages/metronome"),"ca"),m:n.o(()=>{},"26")}:{},{n:!o.value},o.value?{}:{},{o:!o.value},o.value?{}:{},{p:o.value},o.value?{}:{},{q:o.value?1:"",r:n.o(p,"98"),s:t.bottom+"rpx"}):{},{f:r.value})}}),d=n._export_sfc(g,[["__scopeId","data-v-17534d15"]]);wx.createComponent(d);
|
||||
//# sourceMappingURL=../../../.sourcemap/mp-weixin/components/dev-training-entry/index.js.map
|
||||
|
||||
+1
-489
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user