From bd1704862aa86314f6bfcb18b4aa64a12a10fb3f Mon Sep 17 00:00:00 2001 From: wangyx <2838268875@qq.com> Date: Fri, 25 Jul 2025 17:41:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BA=AB=E4=BB=BD=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project.config.json | 3 +- project.private.config.json | 11 +++++- subpages/mine/editUser/editUser.js | 55 ++++++++++++++++------------ subpages/mine/editUser/editUser.wxml | 8 ++-- 4 files changed, 47 insertions(+), 30 deletions(-) diff --git a/project.config.json b/project.config.json index a1914da..1978414 100644 --- a/project.config.json +++ b/project.config.json @@ -12,7 +12,8 @@ "outputPath": "" }, "useCompilerPlugins": false, - "minifyWXML": true + "minifyWXML": true, + "condition": true }, "compileType": "miniprogram", "simulatorPluginLibVersion": {}, diff --git a/project.private.config.json b/project.private.config.json index 6574666..2ba5663 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -14,12 +14,19 @@ "condition": { "miniprogram": { "list": [ + { + "name": "subpages/mine/editUser/editUser", + "pathName": "subpages/mine/editUser/editUser", + "query": "", + "scene": null, + "launchMode": "default" + }, { "name": "pages/noData/noData", "pathName": "pages/noData/noData", "query": "idCard=1", - "scene": null, - "launchMode": "default" + "launchMode": "default", + "scene": null }, { "name": "subpages/bsPage/bsPage/bsPage", diff --git a/subpages/mine/editUser/editUser.js b/subpages/mine/editUser/editUser.js index c321cf2..124e122 100644 --- a/subpages/mine/editUser/editUser.js +++ b/subpages/mine/editUser/editUser.js @@ -1,6 +1,4 @@ -import { - getUserInfo -} from "../../../api/user"; +import { getUserInfo, bindIdCard } from "../../../api/user"; // import { checkContentStatus } from "../../../../api/audit"; // const QQMapWX = require("../../../../utils/qqmap-wx-jssdk"); // const config = require("../../../../utils/config"); @@ -11,10 +9,10 @@ Page({ */ data: { name: null, - nickName: '微信用户', + nickName: "微信用户", idCard: null, mobile: null, - remainingDays:null, + remainingDays: null, fileList: [ // { // url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240830/de2ccb0304eb4bab9513d11472fb3454.png", @@ -27,15 +25,13 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad(options) { - this.getUserInfo() + this.getUserInfo(); }, /** * 生命周期函数--监听页面初次渲染完成 */ - onReady() { - - }, + onReady() {}, /** * 生命周期函数--监听页面显示 @@ -64,12 +60,12 @@ Page({ chooseAvatar() { wx.chooseMedia({ count: 1, // 最多选择 1 张图片 - mediaType: ['image'], // 只选择图片 + mediaType: ["image"], // 只选择图片 success: (res) => { if (res.tempFiles.length > 0) { const tempFilePath = res.tempFiles[0].tempFilePath; this.setData({ - avatarUrl: tempFilePath + avatarUrl: tempFilePath, }); // 如果你需要将图片上传到服务器,可以在这里添加上传逻辑 // wx.uploadFile({ @@ -86,23 +82,36 @@ Page({ } }, fail: (err) => { - console.error('选择图片失败', err); - } + console.error("选择图片失败", err); + }, }); }, /** * 用户点击右上角分享 */ onShareAppMessage() {}, - getUserInfo(){ - getUserInfo().then(res=>{ + getUserInfo() { + getUserInfo().then((res) => { this.setData({ - nickName:res.data.nickName, - idCard:res.data.idCard, - name:res.data.name, - mobile:res.data.phone, - remainingDays:res.data.leftQuota, - }) - }) - } + nickName: res.data.nickName, + idCard: res.data.idCard, + name: res.data.name, + mobile: res.data.phone, + remainingDays: res.data.leftQuota, + }); + }); + }, + onsubmit() { + bindIdCard({ + idCard: this.data.idCard, + name: this.data.name, + phone: this.data.mobile, + }).then((res) => { + if (res.code == 200) { + wx.showToast({ + title: res.msg, + }); + } + }); + }, }); diff --git a/subpages/mine/editUser/editUser.wxml b/subpages/mine/editUser/editUser.wxml index f6f4f7a..5e68002 100644 --- a/subpages/mine/editUser/editUser.wxml +++ b/subpages/mine/editUser/editUser.wxml @@ -13,7 +13,7 @@ - + @@ -27,13 +27,13 @@ - +