公寓小程序端前端代码
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.

109 lines
2.4 KiB

3 months ago
import {
getUserInfo
} from "../../../api/user";
// import { checkContentStatus } from "../../../../api/audit";
// const QQMapWX = require("../../../../utils/qqmap-wx-jssdk");
// const config = require("../../../../utils/config");
const app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
name: null,
3 months ago
nickName: '微信用户',
idCard: null,
mobile: null,
3 months ago
remainingDays:null,
fileList: [
3 months ago
// {
// url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240830/de2ccb0304eb4bab9513d11472fb3454.png",
// type: "image",
// name: "image",
// },
],
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
3 months ago
this.getUserInfo()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
3 months ago
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
3 months ago
chooseAvatar() {
wx.chooseMedia({
count: 1, // 最多选择 1 张图片
mediaType: ['image'], // 只选择图片
success: (res) => {
if (res.tempFiles.length > 0) {
const tempFilePath = res.tempFiles[0].tempFilePath;
this.setData({
3 months ago
avatarUrl: tempFilePath
});
3 months ago
// 如果你需要将图片上传到服务器,可以在这里添加上传逻辑
// wx.uploadFile({
// url: 'your_upload_url',
// filePath: tempFilePath,
// name: 'avatar',
// success: (uploadRes) => {
// console.log('上传成功', uploadRes);
// },
// fail: (err) => {
// console.error('上传失败', err);
// }
// });
}
},
3 months ago
fail: (err) => {
console.error('选择图片失败', err);
}
});
},
3 months ago
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
getUserInfo(){
getUserInfo().then(res=>{
this.setData({
3 months ago
nickName:res.data.nickName,
idCard:res.data.idCard,
name:res.data.name,
mobile:res.data.phone,
remainingDays:res.data.leftQuota,
})
3 months ago
})
}
});