You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

161 lines
5.0 KiB

"use strict";
const common_vendor = require("../../common/vendor.js");
const config_host = require("../../config/host.js");
const FooterNav = () => "../../components/FooterNav/Index.js";
const RightNav = () => "../../components/RightNav/Index.js";
const HeaderNav = () => "../../components/HeaderNav/Index.js";
const HomePage = () => "./components/HomePage/Index.js";
const OrderPage = () => "./components/OrderPage/Index.js";
const ChatPage = () => "./components/ChatPage/Index.js";
const UserPage = () => "./components/UserPage/Index.js";
const _sfc_main = {
components: {
FooterNav,
RightNav,
HeaderNav,
HomePage,
OrderPage,
ChatPage,
UserPage
},
data() {
return {
current: 0,
footCheck: "home",
show: false,
title: "标题",
content: "uview-plus的目标是成为uni-app生态最优秀的UI框架",
footGroup: [
{
image: config_host.imghost + "/static/image/foot-nav-button-one",
name: "home",
title: "汪汪行天下"
},
{
image: config_host.imghost + "/static/image/foot-nav-button-two",
name: "order",
title: "订单"
},
{
image: config_host.imghost + "/static/image/foot-nav-button-three",
name: "chat",
title: "在线沟通"
},
{
image: config_host.imghost + "/static/image/foot-nav-button-four",
name: "user",
title: ""
}
],
rightShow: false
};
},
onLoad(option) {
if (option == null ? void 0 : option.foot_check) {
this.footSelect(option.foot_check);
}
},
methods: {
footSelect(index) {
this.current = index;
this.footCheck = this.footGroup[index].name;
this.title = this.footGroup[index].title;
this.rightShow = this.footCheck === "home" || this.footCheck === "user";
},
userLogin() {
common_vendor.index.navigateTo({
url: "/pages/Login/index"
});
this.show = false;
}
// store.
},
onPageScroll(res) {
if (res.scrollTop <= 20) {
common_vendor.index.$emit("isTop", true);
} else {
common_vendor.index.$emit("isTop", false);
}
},
created() {
},
mounted() {
this.title = this.$store.state.title;
let token = common_vendor.index.getStorageSync("token");
if (!token) {
this.show = true;
} else {
let user = common_vendor.index.getStorageSync("user");
this.$store.commit("userInfo", user);
}
},
watch: {
"$store.state.footCheck": {
handler(newVal, oldVal) {
this.footCheck = newVal;
}
},
"$store.state.title": {
handler(newVal, oldVal) {
this.title = newVal;
}
}
}
};
if (!Array) {
const _component_HeaderNav = common_vendor.resolveComponent("HeaderNav");
const _component_HomePage = common_vendor.resolveComponent("HomePage");
const _component_OrderPage = common_vendor.resolveComponent("OrderPage");
const _component_ChatPage = common_vendor.resolveComponent("ChatPage");
const _component_UserPage = common_vendor.resolveComponent("UserPage");
const _component_RightNav = common_vendor.resolveComponent("RightNav");
const _component_FooterNav = common_vendor.resolveComponent("FooterNav");
const _easycom_u_modal2 = common_vendor.resolveComponent("u-modal");
(_component_HeaderNav + _component_HomePage + _component_OrderPage + _component_ChatPage + _component_UserPage + _component_RightNav + _component_FooterNav + _easycom_u_modal2)();
}
const _easycom_u_modal = () => "../../uni_modules/uview-plus/components/u-modal/u-modal.js";
if (!Math) {
_easycom_u_modal();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return common_vendor.e({
a: common_vendor.p({
title: $data.title
}),
b: $data.footCheck === "home"
}, $data.footCheck === "home" ? {} : {}, {
c: $data.footCheck === "home" ? 1 : "",
d: $data.footCheck === "order"
}, $data.footCheck === "order" ? {} : {}, {
e: $data.footCheck === "order" ? 1 : "",
f: $data.footCheck === "chat"
}, $data.footCheck === "chat" ? {} : {}, {
g: $data.footCheck === "chat" ? 1 : "",
h: $data.footCheck === "user"
}, $data.footCheck === "user" ? {
i: common_vendor.o($options.footSelect)
} : {}, {
j: $data.footCheck === "user" ? 1 : "",
k: $data.rightShow
}, $data.rightShow ? {} : {}, {
l: common_vendor.o($options.footSelect),
m: common_vendor.p({
["foot-group"]: $data.footGroup,
footCheck: $data.current
}),
n: common_vendor.o($options.userLogin),
o: common_vendor.o(($event) => {
this.show = false;
}),
p: common_vendor.p({
show: $data.show,
title: "登录",
content: "当前未登录是否前往登录",
closeOnClickOverlay: true,
showCancelButton: true
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:/phpstudy_pro/WEB/pet_uni/pages/Index/index.vue"]]);
_sfc_main.__runtimeHooks = 1;
wx.createPage(MiniProgramPage);