7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接
This commit is contained in:
58
unpackage/dist/dev/mp-weixin/pages/mine/mine.js
vendored
58
unpackage/dist/dev/mp-weixin/pages/mine/mine.js
vendored
@@ -1,5 +1,6 @@
|
||||
"use strict";
|
||||
const common_vendor = require("../../common/vendor.js");
|
||||
const request_api = require("../../request/api.js");
|
||||
const common_assets = require("../../common/assets.js");
|
||||
const _sfc_main = {
|
||||
data() {
|
||||
@@ -7,6 +8,7 @@ const _sfc_main = {
|
||||
menuTop: common_vendor.inject("menuTop"),
|
||||
menuH: common_vendor.inject("menuHeight"),
|
||||
infoTop: "",
|
||||
userInfo: null,
|
||||
menuList: [
|
||||
{
|
||||
icon: "/static/icon/mine/aboutUs.png",
|
||||
@@ -39,6 +41,9 @@ const _sfc_main = {
|
||||
onLoad() {
|
||||
this.infoTop = common_vendor.inject("navHeight") + 32 / 750 * common_vendor.inject("windowWidth");
|
||||
},
|
||||
onShow() {
|
||||
this.getUserInfoData();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 点击查看个人信息
|
||||
@@ -65,7 +70,14 @@ const _sfc_main = {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine/commentReply/commentReply"
|
||||
});
|
||||
}
|
||||
} else if (index == 1) {
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine/followCollect/followCollect"
|
||||
});
|
||||
} else
|
||||
common_vendor.index.navigateTo({
|
||||
url: "/pages/mine/myLike/myLike"
|
||||
});
|
||||
},
|
||||
clickMenuItem(url) {
|
||||
if (url) {
|
||||
@@ -73,22 +85,42 @@ const _sfc_main = {
|
||||
url
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取用户信息数据
|
||||
*/
|
||||
getUserInfoData() {
|
||||
request_api.userInfo().then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.userInfo = res.data;
|
||||
} else
|
||||
common_vendor.wx$1.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}).catch((error) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
return {
|
||||
return common_vendor.e({
|
||||
a: common_assets._imports_0,
|
||||
b: common_vendor.s("top:" + $data.menuTop + "px;line-height:" + $data.menuH + "px;"),
|
||||
c: common_assets._imports_1$2,
|
||||
d: common_vendor.s("margin-top:" + $data.infoTop + "px;"),
|
||||
e: common_vendor.o(($event) => $options.clickPersonalInfo()),
|
||||
f: common_vendor.o(($event) => $options.clickNumItem(0)),
|
||||
g: common_vendor.o(($event) => $options.clickNumItem(1)),
|
||||
h: common_vendor.o(($event) => $options.clickNumItem(2)),
|
||||
i: common_assets._imports_2$4,
|
||||
j: common_vendor.o(($event) => $options.clickVip()),
|
||||
k: common_vendor.f($data.menuList, (item, index, i0) => {
|
||||
c: $data.userInfo
|
||||
}, $data.userInfo ? {
|
||||
d: $data.userInfo.basic_info.avatar_url,
|
||||
e: common_vendor.t($data.userInfo.basic_info.username),
|
||||
f: common_vendor.t($data.userInfo.basic_info.phone),
|
||||
g: common_assets._imports_1$2,
|
||||
h: common_vendor.s("margin-top:" + $data.infoTop + "px;"),
|
||||
i: common_vendor.o(($event) => $options.clickPersonalInfo())
|
||||
} : {}, {
|
||||
j: common_vendor.o(($event) => $options.clickNumItem(0)),
|
||||
k: common_vendor.o(($event) => $options.clickNumItem(1)),
|
||||
l: common_vendor.o(($event) => $options.clickNumItem(2)),
|
||||
m: common_assets._imports_2$4,
|
||||
n: common_vendor.o(($event) => $options.clickVip()),
|
||||
o: common_vendor.f($data.menuList, (item, index, i0) => {
|
||||
return common_vendor.e({
|
||||
a: item.icon,
|
||||
b: common_vendor.t(item.title),
|
||||
@@ -98,8 +130,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
e: common_vendor.o(($event) => $options.clickMenuItem(item.url), index)
|
||||
});
|
||||
}),
|
||||
l: common_assets._imports_3$3
|
||||
};
|
||||
p: common_assets._imports_3$3
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
wx.createPage(MiniProgramPage);
|
||||
|
||||
Reference in New Issue
Block a user