<view class="container"> <view class="classname"> <form bindsubmit="edituser"> <view class="xing" wx:if="{{userinfo.shopname}}">所属店铺:{{userinfo.shopname}} </view> <view class="xing">手机号码: <input placeholder-class='placeholder' placeholder='请输入手机号码' class="in" name='tel' value="{{userinfo.tel}}" /> </view> <view class="xing">邮箱: <input placeholder-class='placeholder' placeholder='请输入邮箱' class="in" name='email' value="{{userinfo.email}}" /> </view> <view class="xing">昵称: <input placeholder-class='placeholder' placeholder='请输入你的昵称' type='number' class="in" name='uname' value="{{userinfo.uname}}" /> </view> <button type="" form-type="submit" hover-class='button-hover' class='su'>保存</button> </form> </view> </view> |
.tit { height: 300rpx; width: 100%; } .container { padding: 0px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; box-sizing: border-box; font-family: '微软雅黑'; } .classname { background: #f4f4f4; width: 100%; text-align: center; padding-bottom: 150rpx; } .jj { font-size: 24rpx; padding-top: 20rpx; font-family: "微软雅黑", "黑体"; margin: 0 auto; color: #ccc; padding-bottom: 20rpx; } .xing { font-family: "微软雅黑", "黑体"; height: 54rpx; width: 579rpx; border-radius: 10rpx; background: #fff; margin: 0 auto; text-align: left; line-height: 54rpx; font-size: 28rpx; padding: 10rpx; margin-top: 38rpx; padding-left: 30rpx; } .xi { font-family: "微软雅黑", "黑体"; height: 200rpx; width: 579rpx; border-radius: 10rpx; background: #fff; margin: 0 auto; text-align: left; line-height: 54rpx; font-size: 28rpx; padding: 10rpx; margin-top: 38rpx; padding-left: 30rpx; } .placeholder { color: #ccc; font-size: 26rpx; } .in { float: right; width: 75%; padding-top: 0rpx; font-size: 28rpx; color: #000; } .i { float: right; width: 72%; height: 100%; padding-top: 12rpx; font-size: 28rpx; color: #000; } textarea { height: 100px; } .t { font-family: "微软雅黑", "黑体"; width: 20%; height: 60rpx; /*background: #fff;*/ margin-left: 57rpx; padding: 5rpx; line-height: 60rpx; margin-top: 40rpx; font-size: 28rpx; display: inline-block; border: 1px solid #ccc; float: left; } .su { width: 84%; color: #fff; height: 69rpx; line-height: 69rpx; font-size: 30rpx; font-family: "微软雅黑", "黑体"; top: 103rpx; background: red; } button[type="primary"] { color: #000; background-color: #fff; } .shuoming{ height: 50rpx; font-size: 30rpx; } .label-1, .label-2{ margin-bottom: 15px; } .label-1__text, .label-2__text { display: inline-block; vertical-align: middle; } .label-1__icon { position: relative; margin-right: 10px; display: inline-block; vertical-align: middle; width: 18px; height: 18px; background: #fcfff4; border: 1px solid #ccc } .label-1__icon-checked { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: #d9002f; } |
var app = getApp(); var common = require("../../utils/common.js"); Page({ data: { checkboxItems: [ { name: 'USA', value: '我已了解并阅读了' }, ], content:'', }, modalTap: function () { var that=this; wx.showModal({ title: '免责声明', content:that.data.content, success: function (res) { if (res.confirm) { console.log('用户点击确定') } else if (res.cancel) { console.log('用户点击取消') } } }) }, // 表单 edituser: function (e) { console.log(e.detail.value); var that=this; var formdata=e.detail.value; wx.request({ url: app.d.ceshiUrl + '/Api/User/edituser', method: 'post', data: { uid: app.globalData.userInfo.id, tel: formdata.tel, email: formdata.email, uname: formdata.uname, }, header: { 'Content-Type': 'application/x-www-form-urlencoded' }, success: function (res) { //--init data var status = res.data.status; if (status == 1) { wx.showToast({ title: '提交成功!', }) } else { wx.showToast({ title: res.data.message, }) } }, fail: function () { // fail wx.showToast({ title: '网络异常!', duration: 30000 }); } }) }, checkboxChange: function (e) { var checked = e.detail.value var changed = {} console.log(this.data.checkboxItems[0].name) if (checked.indexOf(this.data.checkboxItems[0].name) !== -1) { changed['checkboxItems[0].checked'] = true } else { changed['checkboxItems[0].checked'] = false } this.setData(changed) console.log(changed) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var that=this; that.loadinfo(); }, loadinfo: function(){ var that = this; wx.request({ url: app.d.ceshiUrl + '/Api/User/userinfo', method: 'post', data: {uid:app.globalData.userInfo.id}, header: { 'Content-Type': 'application/x-www-form-urlencoded' }, success: function (res) { //--init data var status = res.data.status; if (status == 1) { that.setData({ userinfo:res.data.userinfo }) } else { wx.showToast({ title: res.data.message, }) } }, fail: function () { // fail wx.showToast({ title: '网络异常!', duration: 30000 }); } }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { } }) |
模板简介:该模板名称为【微信小程序红色用户个人信息保存填写样式设计制作开发教程】,大小是,文档格式为.,推荐使用打开,作品中的图片,文字等数据均可修改,图片请在作品中选中图片替换即可,文字修改直接点击文字修改即可,您也可以新增或修改作品中的内容,该模板来自用户分享,如有侵权行为请联系网站客服处理。欢迎来懒人模板【小程序教程】栏目查找您需要的精美模板。