7.10 增加登录页面,事件详情接口对接,我的点赞,关注收藏页面搭建,接口对接

This commit is contained in:
尚政杰
2025-07-10 18:08:16 +08:00
parent c4267a0e27
commit 58b3414bdd
356 changed files with 7710 additions and 978 deletions

View File

@@ -1,22 +1,47 @@
"use strict";
const common_vendor = require("../../../common/vendor.js");
const request_api = require("../../../request/api.js");
require("../../../request/http.js");
const common_assets = require("../../../common/assets.js");
const _sfc_main = {
data() {
return {
avatarTop: "",
contentTop: "",
avatar: "",
//选择头像临时地址
avatarUrl: "",
//已上传的链接
nickname: "",
//昵称
mobile: "",
//手机号
sexList: ["男", "女"],
sex: ""
sex: "",
profile: ""
//个人简介
};
},
onLoad() {
this.avatarTop = common_vendor.inject("navHeight") + 60 / 750 * common_vendor.inject("windowWidth");
this.contentTop = this.avatarTop + 75 / 750 * common_vendor.inject("windowWidth");
this.getUserInfoData();
},
methods: {
/**
* 点击选择头像
* @param {Object} e
*/
chooseAvatar(e) {
common_vendor.index.__f__("log", "at pages/mine/basicInfo/basicInfo.vue:65", e);
this.avatar = e.detail.avatarUrl;
},
/**
* 点击选择性别
* @param {Object} e
*/
sexChange(e) {
common_vendor.index.__f__("log", "at pages/mine/basicInfo/basicInfo.vue:54", e);
common_vendor.index.__f__("log", "at pages/mine/basicInfo/basicInfo.vue:74", e);
let value = e.detail.value;
this.sex = this.sexList[value];
},
@@ -24,8 +49,79 @@ const _sfc_main = {
* 点击下一步
*/
clickNext() {
common_vendor.index.navigateTo({
url: "/pages/mine/investPreference/investPreference"
if (!this.avatar && !this.avatarUrl) {
common_vendor.index.showToast({
title: "请选择头像",
icon: "none"
});
return;
}
if (!this.nickname) {
common_vendor.index.showToast({
title: "请输入昵称",
icon: "none"
});
return;
}
if (!this.sex) {
common_vendor.index.showToast({
title: "请选择性别",
icon: "none"
});
return;
}
if (!this.profile) {
common_vendor.index.showToast({
title: "请输入个人简介",
icon: "none"
});
return;
}
if (this.avatar) {
let param = {
avatar: this.avatar,
nickname: this.nickname,
gender: this.sex == "男" ? "male" : "female",
bio: this.profile,
isFile: 1
};
request_api.updateBasicInfo(param).then((res) => {
common_vendor.index.navigateTo({
url: "/pages/mine/investPreference/investPreference"
});
}).catch((error) => {
});
} else {
let param = {
nickname: this.nickname,
gender: this.sex == "男" ? "male" : "female",
bio: this.profile
};
request_api.updateBasicInfo(param).then((res) => {
common_vendor.index.navigateTo({
url: "/pages/mine/investPreference/investPreference"
});
}).catch((error) => {
});
}
},
/**
* 获取用户信息数据
*/
getUserInfoData() {
request_api.userInfo().then((res) => {
if (res.code == 200) {
this.avatarUrl = res.data.basic_info.avatar_url;
this.nickname = res.data.basic_info.nickname;
this.mobile = res.data.basic_info.phone;
this.sex = res.data.basic_info.gender == "male" ? "男" : "女";
this.profile = res.data.basic_info.bio;
} else
common_vendor.wx$1.showToast({
title: res.message,
icon: "none"
});
}).catch((error) => {
});
}
}
@@ -44,14 +140,21 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
leftText: "信息完善"
}),
b: common_assets._imports_0,
c: common_assets._imports_1$3,
d: common_vendor.s("top:" + $data.avatarTop + "px;"),
e: common_vendor.t($data.sex),
f: common_assets._imports_2$5,
g: $data.sexList,
h: common_vendor.o((...args) => $options.sexChange && $options.sexChange(...args)),
i: common_vendor.s("top:" + $data.contentTop + "px;"),
j: common_vendor.o(($event) => $options.clickNext())
c: $data.avatar ? $data.avatar : $data.avatarUrl,
d: common_assets._imports_1$3,
e: common_vendor.o((...args) => $options.chooseAvatar && $options.chooseAvatar(...args)),
f: common_vendor.s("top:" + $data.avatarTop + "px;"),
g: $data.nickname,
h: common_vendor.o(($event) => $data.nickname = $event.detail.value),
i: common_vendor.t($data.mobile),
j: common_vendor.t($data.sex),
k: common_assets._imports_2$5,
l: $data.sexList,
m: common_vendor.o((...args) => $options.sexChange && $options.sexChange(...args)),
n: $data.profile,
o: common_vendor.o(($event) => $data.profile = $event.detail.value),
p: common_vendor.s("top:" + $data.contentTop + "px;"),
q: common_vendor.o(($event) => $options.clickNext())
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1 +1 @@
<view><nav-bar wx:if="{{a}}" u-i="8b6eb184-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="avatarC fixed" style="{{d}}"><image class="avatar" src="{{''}}" mode="aspectFill"></image><image class="icon absolute" src="{{c}}" mode="widthFix"></image></view><view class="basicInfoC fixed" style="{{i}}"><view class="title">基本信息</view><view class="section">昵称</view><view class="inputC"><input type="text"/></view><view class="section">手机号</view><view class="inputC"><input type="text"/></view><view class="section">性别</view><picker mode="selector" range="{{g}}" bindchange="{{h}}"><view class="selectC flex"><view class="flex1">{{e}}</view><image class="arrow" src="{{f}}" mode="widthFix"></image></view></picker><view class="section">个人简介</view><view class="textareaC"><textarea placeholder="简单介绍一下自己吧" placeholder-style="color:#AAA"></textarea></view></view><view class="next fixed" bindtap="{{j}}">下一步</view></view>
<view><nav-bar wx:if="{{a}}" u-i="8b6eb184-0" bind:__l="__l" u-p="{{a}}"></nav-bar><image class="topBg absolute" src="{{b}}" mode="widthFix"></image><view class="avatarC fixed" style="{{f}}"><image class="avatar" src="{{c}}" mode="aspectFill"></image><image class="icon absolute" src="{{d}}" mode="widthFix"></image><button class="absolute" open-type="chooseAvatar" bindchooseavatar="{{e}}"></button></view><view class="basicInfoC fixed" style="{{p}}"><view class="title">基本信息</view><view class="section">昵称</view><view class="inputC"><input type="nickname" value="{{g}}" bindinput="{{h}}"/></view><view class="section">手机号</view><view class="inputC">{{i}}</view><view class="section">性别</view><picker mode="selector" range="{{l}}" bindchange="{{m}}"><view class="selectC flex"><view class="flex1">{{j}}</view><image class="arrow" src="{{k}}" mode="widthFix"></image></view></picker><view class="section">个人简介</view><view class="textareaC"><block wx:if="{{r0}}"><textarea placeholder="简单介绍一下自己吧" placeholder-style="color:#AAA" value="{{n}}" bindinput="{{o}}"></textarea></block></view></view><view class="next fixed" bindtap="{{q}}">下一步</view></view>

View File

@@ -11,7 +11,6 @@
z-index: 10;
}
.avatarC .avatar {
background-color: red;
width: 100%;
height: 150rpx;
border-radius: 50%;
@@ -23,6 +22,12 @@
width: 40rpx;
height: auto;
}
.avatarC button {
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.basicInfoC {
background-color: white;
left: 0;