From 3253a76a15c8d30e24156ed809d9740a3a3cfada Mon Sep 17 00:00:00 2001 From: zx <604444282@qq.com> Date: Fri, 9 Dec 2022 17:25:48 +0800 Subject: [PATCH] zx --- app.json | 2 +- pages/mine/index.wxml | 5 +- pages/mine/pages/profile/profile.js | 301 ++++++++++++++++++++++++++ pages/mine/pages/profile/profile.json | 7 + pages/mine/pages/profile/profile.wxml | 44 ++++ pages/mine/pages/profile/profile.wxss | 187 ++++++++++++++++ 6 files changed, 544 insertions(+), 2 deletions(-) create mode 100644 pages/mine/pages/profile/profile.js create mode 100644 pages/mine/pages/profile/profile.json create mode 100644 pages/mine/pages/profile/profile.wxml create mode 100644 pages/mine/pages/profile/profile.wxss diff --git a/app.json b/app.json index 742763a..eabe328 100644 --- a/app.json +++ b/app.json @@ -29,6 +29,7 @@ "pages/mine/pages/myReport/index", "pages/mine/pages/helpCenter/index", "pages/mine/pages/register/register", + "pages/mine/pages/profile/profile", "pages/varComm/pages/theme/index", "pages/brandCrisis/index", "pages/brandCrisis/crisiSet/index", @@ -40,7 +41,6 @@ "name": "分包A", "pages": [ "pages/detail/index", - "pages/profile/profile", "logs/PushSettings/index" ] }, diff --git a/pages/mine/index.wxml b/pages/mine/index.wxml index 0401c30..f7d8e2c 100644 --- a/pages/mine/index.wxml +++ b/pages/mine/index.wxml @@ -12,6 +12,9 @@ + @@ -21,7 +24,7 @@ - diff --git a/pages/mine/pages/profile/profile.js b/pages/mine/pages/profile/profile.js new file mode 100644 index 0000000..56d0c53 --- /dev/null +++ b/pages/mine/pages/profile/profile.js @@ -0,0 +1,301 @@ +// pages/mine/pages/register/register.js +const app = getApp() +import timer from '../../../../utils/timer' +Page({ + + /** + * 页面的初始数据 + */ + data: { + sUserName: '', + sPhone: '', + sEmail: '', + companyName: '', + brandName: '', + sVerifycode: '', + expDate: '', + captchaLabel: '获取验证码', + captchaDisabled: false, + imageUrl: getApp().globalData.imageUrl, + status: 0 // 0查看 1编辑 + }, + //用户输入 + usernameInput(e) { + this.setData({ + sUserName: e.detail.value + }) + }, + //手机号输入 + sPhoneInput(e) { + this.setData({ + sPhone: e.detail.value + }) + }, + //邮箱输入 + sEmailInput(e) { + this.setData({ + sEmail: e.detail.value + }) + }, + //名称输入 + companyInput(e) { + this.setData({ + companyName: e.detail.value + }) + }, + //验证码输入 + codeInput(e) { + this.setData({ + sVerifycode: e.detail.value + }) + }, + + //获取验证码 + captcha() { + let b = this.validPhone(); + if (!b) return; + let obj = { + action: 'getVERCode', + sPhone: this.data.sPhone, + } + return new Promise((resolve, reject) => { + app.globalData.request(obj, (res) => { + // 定时60s + timer(this) + resolve(true) + }).catch(err => { + wx.showModal({ + title: '提示', + content: err.Msg, + }) + reject(false) + }) + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + //提交审核 + toEdit() { + this.setData({status: 1}); + }, + Submit() { + let a = this.validfrom(); + if (!a) return; + let obj = { + action: 'getUserDataVERCode', + token: wx.getStorageSync('token'), + UserName: this.data.sUserName, + Phone: this.data.sPhone, + Email: this.data.sEmail, + UnitName: this.data.companyName, + Code: this.data.sVerifycode, + } + return new Promise((resolve, reject) => { + app.globalData.request(obj, (res) => { + if (res.Code == 1) { + wx.showModal({ + title: '提示', + content: res.Msg, + success(res) { + if (res.confirm) { + this.setData({status: 0}); + this.getdata(); + } else { + + } + } + }) + } + resolve(true) + }).catch(err => { + wx.showModal({ + title: '提示', + content: err.Msg, + }) + reject(false) + }) + }) + }, + getlist() { + let that = this + let obj = { + action: 'getUserDataVERCode', + UserName: this.data.sUserName, + Phone: this.data.sPhone, + Email: this.data.sEmail, + token: wx.getStorageSync('token') + } + return new Promise((resolve, reject) => { + app.globalData.request(obj, (res) => { + if (res.Code == 1) { + wx.showModal({ + title: '提示', + content: res.Msg, + success(res) { + if (res.confirm) { + that.captcha() + } else { + + } + } + }) + } + resolve(true) + }).catch(err => { + wx.showModal({ + title: '提示', + content: err.Msg, + }) + reject(false) + }) + }) + + }, + validPhone() { + let b = true; + let sPhone = this.data.sPhone; + //验证手机号 + if (!this.data.sPhone) { + wx.showModal({ + title: '提示', + content: "手机号不能为空", + }) + b = false; + return b; + } + //验证手机格式 + if (!(/^1[345678]\d{9}$/.test(sPhone))) { + wx.showModal({ + title: '提示', + content: "手机格式错误", + }) + b = false + return b; + } + return b; + }, + validfrom() { + let a = true; + //验证用户名 + if (!this.data.sUserName) { + wx.showModal({ + title: '提示', + content: "账号不能为空", + }) + a = false; + return a; + } + //验证手机号 + if (!this.data.sPhone) { + wx.showModal({ + title: '提示', + content: "手机号不能为空", + }) + a = false; + return a; + } + //验证邮箱 + if (!this.data.sEmail) { + wx.showModal({ + title: '提示', + content: "邮箱不能为空", + }) + a = false; + return a; + } + //验证公司名称 + if (!this.data.companyName) { + wx.showModal({ + title: '提示', + content: "公司名称不能为空", + }) + a = false; + return a; + } + //验证验证码 + if (!this.data.sVerifycode) { + wx.showModal({ + title: '提示', + content: "验证码不能为空", + }) + a = false; + return a; + } + return a; + }, + handlerBack() { + if(this.data.status == 0) { + wx.navigateBack({ delta: 1 }); + } else { + this.setData({status: 0}); + } + }, + onLoad(options) { + this.getdata() + }, + getdata() { + app.globalData.request({ + action: 'getUserData', + token: wx.getStorageSync('token') + }).then(res => { + this.setData({ + sUserName: res.UserName, + sPhone: res.Phone, + sEmail: res.Email, + companyName: res.UnitName, + brandName: res.MainBrand, + expDate: res.ValidTime + }); + }) + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/pages/mine/pages/profile/profile.json b/pages/mine/pages/profile/profile.json new file mode 100644 index 0000000..1069cec --- /dev/null +++ b/pages/mine/pages/profile/profile.json @@ -0,0 +1,7 @@ +{ + "usingComponents": {}, + "navigationStyle": "custom", + "navigationBarTitleText":"个人信息", + "navigationBarBackgroundColor":"#ffffff", + "navigationBarTextStyle":"black" +} \ No newline at end of file diff --git a/pages/mine/pages/profile/profile.wxml b/pages/mine/pages/profile/profile.wxml new file mode 100644 index 0000000..4e903cb --- /dev/null +++ b/pages/mine/pages/profile/profile.wxml @@ -0,0 +1,44 @@ + + + + 硕为思账号 + + 手机号 + + 邮箱 + + 公司名称 + + + 公司品牌 + + + + + + 到期日期 + + + + + + 验证码 + + + + + + + + + \ No newline at end of file diff --git a/pages/mine/pages/profile/profile.wxss b/pages/mine/pages/profile/profile.wxss new file mode 100644 index 0000000..5ee9557 --- /dev/null +++ b/pages/mine/pages/profile/profile.wxss @@ -0,0 +1,187 @@ +/* pages/mine/pages/register/register.wxss */ +.bind_box{ + margin-top: 34rpx; + width: 686rpx; + /* height: 528rpx; */ + background: white; + margin-left:32rpx; + padding: 32rpx 0; + +} +.bind_box input{ + height: 96rpx; + width: 590rpx; + background-color: #f9f9f9; + margin-top: 24rpx; + margin-left: 32rpx; + padding-left: 32rpx; + font-size: 28rpx; + color: #333333; +} +page{ + background: #f9f9f9; +} +.placeholder-style{ + font-size: 28rpx; + /* margin-left: 32rpx; */ +} +.bts{ + margin-top: 48rpx; + width: 622rpx; + margin-left:32rpx ; + color: white; + background: #66b6ff; + font-size: 28rpx; + height: 88rpx; + line-height: 88rpx; +} +.bs-top-title { + position: relative; + display: flex; + justify-content: center; + align-items: center; + color: #fff; + font-size: 26rpx; + height: 40px; +} +.bs-top-title-ic { + position: absolute; + left: 16px; + font-size: 19px; +} +.captcha{ + width: 40%; + height: 96rpx; + line-height: 96rpx; + /* margin: auto 0; */ + margin-top: 24rpx; + color: #f9f9f9; + font-size: 25rpx; + margin-right: 25rpx; + border-radius: 0px; +} +button[plain] { + background-color: #f9f9f9; + border:0; + color: #66b6ff; +} +.add1{ + width:686rpx; + overflow-x:scroll; + white-space: nowrap; +} +.add_box1 { + display: inline-block; + height: 208rpx; + width: 200rpx; + margin-left: 32rpx; + background-color: #339cff; + border-radius: 8rpx; + border: 2rpx solid #85c3ff; + overflow: hidden; +} + + +.heng1 { + height: 8rpx; + width: 72rpx; + background: white; + border-radius: 6rpx; + position: relative; + left: 66rpx; + top: 82rpx +} + +.shu1 { + width: 8rpx; + height: 72rpx; + background: white; + border-radius: 6rpx; + position: relative; + left: 98rpx; + top: 45rpx +} + +.event1 { + display: inline-block; + color: white; + font-size: 28rpx; + margin-left: 32rpx; + margin-top: 60rpx; +} + +.btns { + margin-top: 32rpx; + width: 686rpx; + height: 88rpx; + font-weight: bold; + line-height: 88rpx; + color: rgba(0, 132, 255, 1); + font-size: 28rpx; +} +.event_recom1 { + margin-top: 32rpx; + min-height: 1000rpx; + background-color: #f9f9f9; + border-top-left-radius: 24rpx; + border-top-right-radius: 24rpx; +} + +.van-index-bar .van-index-bar__sidebar{ + top:480rpx; + transform:none; +} +.van-index-anchor text{ + font-size: 24rpx; + color: rgba(153, 153, 153, 1); +} +.event_recom1 .van-cell .van-cell__title{ + font-size: 28rpx; +} +.my_cell{ + width: 686rpx; + height: 96rpx; + background: white; + display: flex; + align-items: center; + padding: 0 32rpx; +} +.van-checkbox{ + display: inline-block !important; +} +.my_cell .van-checkbox__icon { + margin-left: 32rpx ; + font-size: 32rpx !important; +} +.my_cell .van-image{ + margin-left: 48rpx; + margin-top: 4rpx; +} +.my_cell text{ + font-size: 28rpx; + margin-left: 24rpx; +} +.event_box{ + height: 36rpx; + background:white; + border-top-left-radius: 24rpx; + border-top-right-radius: 24rpx; +} +.bs-item-image { + display: inline-block; + width: 84rpx; + height: 84rpx; + padding: 12rpx; + margin-right: 24rpx; +} +.all{ + background: #027AFF; + width: 72rpx; + height: 72rpx; + line-height: 72rpx; + color: #ffffff; + font-size: 24rpx; + text-align: center; + border-radius: 50rpx; +} +