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.
 
 
 

181 lines
5.8 KiB

"use strict";
const common_vendor = require("../../common/vendor.js");
const config_host = require("../../config/host.js");
const config_UserCache = require("../../config/UserCache.js");
const utils_log = require("../../utils/log.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: "汪汪行天下",
is_show: true
},
{
image: config_host.imghost + "/static/image/foot-nav-button-two",
name: "order",
title: "订单",
is_show: config_UserCache.UserCache.get("store_id", 0) > 0
},
{
image: config_host.imghost + "/static/image/foot-nav-button-three",
name: "chat",
title: "在线沟通",
is_show: true
},
{
image: config_host.imghost + "/static/image/foot-nav-button-four",
name: "user",
title: "",
is_show: true
}
],
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.
},
onReachBottom() {
utils_log.log(this.footCheck);
if (this.footCheck === "order") {
this.$refs.orderList.getOrderList();
}
},
onPageScroll(res) {
if (res.scrollTop <= 20) {
common_vendor.index.$emit("isTop", true);
} else {
common_vendor.index.$emit("isTop", false);
}
},
created() {
this.footGroup = this.footGroup.filter((v) => v.is_show);
},
mounted() {
this.title = this.$store.state.title;
let token = common_vendor.index.getStorageSync("token");
if (!token) {
this.show = true;
} else {
let user = config_UserCache.UserCache.get();
this.$store.commit("userInfo", user);
let userExtends = config_UserCache.UserCache.extGet();
this.$store.commit("userExtends", userExtends);
}
},
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: _ctx.$store.state.userInfo.store_id > 0
}, _ctx.$store.state.userInfo.store_id > 0 ? common_vendor.e({
e: $data.footCheck === "order"
}, $data.footCheck === "order" ? {
f: common_vendor.sr("orderList", "758d4d69-2")
} : {}, {
g: $data.footCheck === "order" ? 1 : ""
}) : {}, {
h: $data.footCheck === "chat"
}, $data.footCheck === "chat" ? {} : {}, {
i: $data.footCheck === "chat" ? 1 : "",
j: $data.footCheck === "user"
}, $data.footCheck === "user" ? {
k: common_vendor.o($options.footSelect)
} : {}, {
l: $data.footCheck === "user" ? 1 : "",
m: $data.rightShow
}, $data.rightShow ? {} : {}, {
n: common_vendor.o($options.footSelect),
o: common_vendor.p({
["foot-group"]: $data.footGroup,
footCheck: $data.current
}),
p: common_vendor.o($options.userLogin),
q: common_vendor.o(($event) => {
this.show = false;
}),
r: 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", "E:/Project/pet_uni/pages/Index/index.vue"]]);
_sfc_main.__runtimeHooks = 1;
wx.createPage(MiniProgramPage);