Browse Source

修改身份证

epass
wangyx 4 weeks ago
parent
commit
bd1704862a
  1. 3
      project.config.json
  2. 11
      project.private.config.json
  3. 55
      subpages/mine/editUser/editUser.js
  4. 8
      subpages/mine/editUser/editUser.wxml

3
project.config.json

@ -12,7 +12,8 @@
"outputPath": "" "outputPath": ""
}, },
"useCompilerPlugins": false, "useCompilerPlugins": false,
"minifyWXML": true "minifyWXML": true,
"condition": true
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},

11
project.private.config.json

@ -14,12 +14,19 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "subpages/mine/editUser/editUser",
"pathName": "subpages/mine/editUser/editUser",
"query": "",
"scene": null,
"launchMode": "default"
},
{ {
"name": "pages/noData/noData", "name": "pages/noData/noData",
"pathName": "pages/noData/noData", "pathName": "pages/noData/noData",
"query": "idCard=1", "query": "idCard=1",
"scene": null, "launchMode": "default",
"launchMode": "default" "scene": null
}, },
{ {
"name": "subpages/bsPage/bsPage/bsPage", "name": "subpages/bsPage/bsPage/bsPage",

55
subpages/mine/editUser/editUser.js

@ -1,6 +1,4 @@
import { import { getUserInfo, bindIdCard } from "../../../api/user";
getUserInfo
} from "../../../api/user";
// import { checkContentStatus } from "../../../../api/audit"; // import { checkContentStatus } from "../../../../api/audit";
// const QQMapWX = require("../../../../utils/qqmap-wx-jssdk"); // const QQMapWX = require("../../../../utils/qqmap-wx-jssdk");
// const config = require("../../../../utils/config"); // const config = require("../../../../utils/config");
@ -11,10 +9,10 @@ Page({
*/ */
data: { data: {
name: null, name: null,
nickName: '微信用户', nickName: "微信用户",
idCard: null, idCard: null,
mobile: null, mobile: null,
remainingDays:null, remainingDays: null,
fileList: [ fileList: [
// { // {
// url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240830/de2ccb0304eb4bab9513d11472fb3454.png", // url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20240830/de2ccb0304eb4bab9513d11472fb3454.png",
@ -27,15 +25,13 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getUserInfo() this.getUserInfo();
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
@ -64,12 +60,12 @@ Page({
chooseAvatar() { chooseAvatar() {
wx.chooseMedia({ wx.chooseMedia({
count: 1, // 最多选择 1 张图片 count: 1, // 最多选择 1 张图片
mediaType: ['image'], // 只选择图片 mediaType: ["image"], // 只选择图片
success: (res) => { success: (res) => {
if (res.tempFiles.length > 0) { if (res.tempFiles.length > 0) {
const tempFilePath = res.tempFiles[0].tempFilePath; const tempFilePath = res.tempFiles[0].tempFilePath;
this.setData({ this.setData({
avatarUrl: tempFilePath avatarUrl: tempFilePath,
}); });
// 如果你需要将图片上传到服务器,可以在这里添加上传逻辑 // 如果你需要将图片上传到服务器,可以在这里添加上传逻辑
// wx.uploadFile({ // wx.uploadFile({
@ -86,23 +82,36 @@ Page({
} }
}, },
fail: (err) => { fail: (err) => {
console.error('选择图片失败', err); console.error("选择图片失败", err);
} },
}); });
}, },
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() {}, onShareAppMessage() {},
getUserInfo(){ getUserInfo() {
getUserInfo().then(res=>{ getUserInfo().then((res) => {
this.setData({ this.setData({
nickName:res.data.nickName, nickName: res.data.nickName,
idCard:res.data.idCard, idCard: res.data.idCard,
name:res.data.name, name: res.data.name,
mobile:res.data.phone, mobile: res.data.phone,
remainingDays:res.data.leftQuota, 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,
});
}
});
},
}); });

8
subpages/mine/editUser/editUser.wxml

@ -13,7 +13,7 @@
<van-cell-group> <van-cell-group>
<van-field model:value="{{ nickName }}" placeholder="请输入" input-align="right" label="昵称" disabled="{{true}}"/> <van-field model:value="{{ nickName }}" placeholder="请输入" input-align="right" label="昵称" disabled="{{true}}"/>
<van-field model:value="{{ name }}" input-align="right" label="姓名" placeholder="请输入" disabled="{{true}}"/> <van-field model:value="{{ name }}" input-align="right" label="姓名" placeholder="请输入" disabled="{{true}}"/>
<van-field model:value="{{ idCard }}" label="身份证" input-align="right" type="idcard" placeholder="实名认证请输入身份证" border="{{ false }}" disabled="{{true}}"/> <van-field model:value="{{ idCard }}" label="身份证" input-align="right" type="idcard" placeholder="实名认证请输入身份证" border="{{ false }}" disabled="{{false}}"/>
<van-field model:value="{{ mobile }}" clearable input-align="right" label="手机号" placeholder="请输入" border="{{ false }} " disabled="{{true}}"> <van-field model:value="{{ mobile }}" clearable input-align="right" label="手机号" placeholder="请输入" border="{{ false }} " disabled="{{true}}">
</van-field> </van-field>
</van-cell-group> </van-cell-group>
@ -27,13 +27,13 @@
</view> </view>
<!-- <view style=" text-align: center;margin-top: 220rpx;"> <view style=" text-align: center;margin-top: 220rpx;">
<view class="bot-btn"> <view class="bot-btn">
<van-button slot="button" type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="submit"> <van-button slot="button" type="primary" round color="linear-gradient(to right, #0DC6C6 , #46DBD5)" bind:tap="onsubmit">
确定 确定
</van-button> </van-button>
</view> </view>
</view> --> </view>
<van-popup show="{{ showAgency }}" round position="bottom"> <van-popup show="{{ showAgency }}" round position="bottom">
<van-cascader wx:if="{{showAgency}}" field-names="{{ {text: 'label',value: 'value',children: 'children'} }}" value="{{ cascaderValue }}" title="请选择所在地区" options="{{ agencyList }}" bind:close="onCancelAgency" bind:change="onChangeAgency" bind:finish="onConfirmAgency" /> <van-cascader wx:if="{{showAgency}}" field-names="{{ {text: 'label',value: 'value',children: 'children'} }}" value="{{ cascaderValue }}" title="请选择所在地区" options="{{ agencyList }}" bind:close="onCancelAgency" bind:change="onChangeAgency" bind:finish="onConfirmAgency" />
</van-popup> </van-popup>

Loading…
Cancel
Save