From b4f1156449c936f441fd6f081829f13423c8dc7f Mon Sep 17 00:00:00 2001 From: XiaoXinPro 14 IAH5R <568170040@qq.com> Date: Wed, 9 Nov 2022 18:03:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E6=8E=88?= =?UTF-8?q?=E6=9D=83=E9=A1=B5=E9=9D=A2=E6=95=B4=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/next.png | Bin 0 -> 2532 bytes ext.json | 23 +++---- pages/edit/edit.js | 12 ++-- pages/edit/edit.wxml | 10 +-- pages/edit/edit.wxss | 41 +++++++---- pages/setUserInfo/index.js | 129 +++++++++++++++++++++++++++-------- pages/setUserInfo/index.wxml | 97 ++++++++++++++++++++++++-- pages/setUserInfo/index.wxss | 32 ++++++--- 8 files changed, 263 insertions(+), 81 deletions(-) create mode 100644 assets/images/next.png diff --git a/assets/images/next.png b/assets/images/next.png new file mode 100644 index 0000000000000000000000000000000000000000..698de03624fb968defa86e3704f67ab62434a297 GIT binary patch literal 2532 zcmZ8jdpuO>8=v9O8M(|1xej|~=Aa@mWiz^%GlQAaMJl_JB@?+6va=G}GEOd|7{{S? zjbgU_St6yjqN0sPicAVwYWFv?O1XB`*6;j&fByb>-{<{&p7(j)_xXOG_kErme?PI2 zfwcjJLNP)m-rGs3{_g`ZNw|FAXjVka@-qlYHUz<4 zQG>4lped(QNDROu(u>AB>Pd2!pyg?anQ&4{$z~zlH1}}!&L4?Zmx-j|OC>*Tq#)b7 zR!oVQhtJ-3;7F|I&52g_#AV(~H+K?;4B~jBh)9kcIS5IHB+hWk4$Zl}0}&s2I^g!t zaS)o)+2JR^_e7gm#X!ys>9qb*v6Z z+|#PmKovF~#mgbNE+3@-U!g`SxgbR|^sEe8E03P>3yFLU4KkU?eqnA`331hjo_JmoF31Xnz;7T5`6%GlK4*aPU;D2(04@u!= zMO@5GXE>}r6Rz5L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etcpAppId": "wx192b7d2e8dcbefd0", - "etcpVersion": "release", - "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback" - } - }, - "mchId": "1604439800", + "mchId": "1602801645", "imgProxy": [ { "newUrl": "https://ctest.malls.iformall.com/img", @@ -24,12 +17,16 @@ } ], "configUrl": "https://ctest.malls.iformall.com/C/api", + "etcpAppId": "wx219a81b9c87aa4f7", + "etcpVersion": "release", "businessSwitch": "1", + "businessVersion": "1", + "etcpCallbackUrl": "https://admintest.malls.iformall.com/api/carCallback/etcpPaidCallback", "ifHaveWebSocket": "0", "ifHaveCarModular": "1" }, - "name": "金泸商务", - "weappId": "wx649b3be73c1afe47", + "name": "富茂光谷测试版", + "weappId": "wx219a81b9c87aa4f7", "appVersion": "C.test.5.2.0" }, "debug": false, @@ -77,15 +74,15 @@ }, "plugins": { "auto-points-plugin": { - "version": "1.3.0", + "version": "2.4.0", "provider": "wxfab2bf944bfc4da6" }, "live-player-plugin": { - "version": "1.3.4", + "version": "1.2.5", "provider": "wx2b03c6e691cd7370" } }, - "extAppid": "wx649b3be73c1afe47", + "extAppid": "wx219a81b9c87aa4f7", "extEnable": true, "permission": { "scope.userLocation": { diff --git a/pages/edit/edit.js b/pages/edit/edit.js index 0a9bcf1..082ce71 100644 --- a/pages/edit/edit.js +++ b/pages/edit/edit.js @@ -3,8 +3,8 @@ const util = require("../../utils/util.js"); const Http = require("../../utils/HttpBasics"); const config = require("../../config/config"); const imgurl = require("../../utils/imgurl"); -Page({ +Page({ /** * 页面的初始数据 */ @@ -107,7 +107,7 @@ Page({ var birthdate = null; } // if (username == null || address == null || sex == 0 || birthdate == null) { - // wx.showToast({ + // wx.showToast({chidName // title: '请输入完整的用户信息', // icon: "none" // }) @@ -118,7 +118,7 @@ Page({ tmeparr.map(item => { item.birthdate = new Date(item.birthdate).getTime() }) - console.log(that.data.childArr) + return Http.post({ url: config.api.updateInfo, data: { @@ -177,10 +177,10 @@ Page({ }, chidName(e) { let index = e.currentTarget.dataset.index - let tmpeObj = this.data.childArr - tmpeObj[index].name = e.detail.value + let tempObj = this.data.childArr + tempObj[index].name = e.detail.value this.setData({ - childArr: tmpeObj + childArr: tempObj }) }, childDel(e) { diff --git a/pages/edit/edit.wxml b/pages/edit/edit.wxml index cc583cd..8be1bef 100644 --- a/pages/edit/edit.wxml +++ b/pages/edit/edit.wxml @@ -13,16 +13,16 @@ {{date}} - + 身高 - + 体重 - + @@ -38,7 +38,7 @@ 住址 {{address}} 请选择地址 - + @@ -50,7 +50,7 @@ 姓名 - + diff --git a/pages/edit/edit.wxss b/pages/edit/edit.wxss index 4b9dec9..23bbc3f 100644 --- a/pages/edit/edit.wxss +++ b/pages/edit/edit.wxss @@ -8,7 +8,7 @@ } input { - /* width:500rpx; */ + width: 120rpx; display: inline-block; font-size: 32rpx; vertical-align: middle; @@ -20,29 +20,38 @@ input { } .section { + display: flex; + justify-content: space-between; + align-items: center; + width: 710rpx; height: 100rpx; line-height: 100rpx; - width: 710rpx; - margin: 0 auto; - border-bottom: 1px solid #eee; + text-align: right; + margin: 0; } .address { + display: flex; + justify-content: space-between; width: 710rpx; - margin: 0 auto; - border-bottom: 1px solid #eee; + height: 100rpx; + text-align: right; + margin-top: 25rpx; + /* border-bottom: 1px solid #eee; */ padding-bottom: 10rpx; } -.radio { +/* .radio { margin-right: 30rpx; -} +} */ -.section__title, .picker, picker { +.section__title, +.picker, +picker { display: inline-block; font-size: 32rpx; color: #999; - width: 500rpx; + width: 200rpx; } radio { @@ -53,13 +62,13 @@ radio { color: #999; } -.section > text:nth-of-type(1) { +.section>text:nth-of-type(1) { font-size: 32rpx; display: inline-block; padding: 0 20rpx; } -.address > text:nth-of-type(1) { +.address>text:nth-of-type(1) { font-size: 32rpx; display: inline-block; /* margin-right: 20rpx; */ @@ -115,12 +124,14 @@ radio { .child_box { margin: 20rpx; overflow: hidden; + border-radius: 30rpx; } .contBox { float: left; width: 80%; background-color: #fff; + border-radius: 30rpx; } .contBox_section { @@ -131,6 +142,10 @@ radio { border-bottom: 1px solid #eee; } +.contBox_section input { + width: 200rpx; +} + .contBox_section text { margin: 0 20rpx; } @@ -152,4 +167,4 @@ radio { text-align: center; margin-top: 100rpx; margin-left: 2%; -} +} \ No newline at end of file diff --git a/pages/setUserInfo/index.js b/pages/setUserInfo/index.js index e5113ad..edaee0a 100644 --- a/pages/setUserInfo/index.js +++ b/pages/setUserInfo/index.js @@ -1,5 +1,6 @@ let app = getApp(); const Http = require("../../utils/HttpBasics"); +const util = require("../../utils/util.js"); const bgColor = require("../../utils/bgColor.js") const config = require("../../config/config"); const navigationBarHeight = (getApp().statusBarHeight + 44) + 'px' @@ -13,8 +14,17 @@ Page({ navigationBarHeight, avatarUrl: defaultAvatarUrl, nickName: '', + username: '', theme: wx.getSystemInfoSync().theme, typeLsit: {}, + date: '1988-03-12', + dateEnd: '', + dateFlag: 1, + gender: '', + sexArry: ['男', '女'], + sexFlag: 1, + height: '', + weight: '' }, /** @@ -40,15 +50,93 @@ Page({ }) }, - getNickName(e) { + getUserInfo(token) { + let that = this; + Http.get({ + url: config.api.getScore, + data: { + token: token + } + }).then(res => { + console.log(res, 'res'); + this.setData({ + avatarUrl: res.data.avatarUrl, + nickName: res.data.nickName, + username: res.data.name, + gender: res.data.sex, + sexFlag: 2, + date: util.fmtDate(parseInt(res.data.birthdate)), + dateFlag: 2, + height: res.data.height, + weight: res.data.weight, + }) + }).catch(err => { + console.log(err, 'err'); + }) + }, + + bindDateChange(e) { + this.setData({ + date: e.detail.value, + dateFlag: 2 + }) + }, + + bindGenderChange(e) { + this.setData({ + gender: e.detail.value, + sexFlag: 2 + }) + }, + + address() { + let that = this; + wx.chooseLocation({ + success: function (res) { + that.setData({ + address: res.name + '(' + res.address + ')', + addressStr: JSON.stringify(res) + }) + }, + fail: function (error) { + console.log(error) + }, + complete: function (data) { + } + }) + }, + + goSetChildren() { + wx.navigateTo({ + url: '/pages/edit/edit?type=1"', + }) + }, + goSetAdress() { + wx.navigateTo({ + url: '/pages/siteUser/siteUser"', + }) }, formSubmit(e) { + const that = this + + let birthdate = null + if (that.data.dateFlag == 2 && that.data.date) { + birthdate = new Date(that.data.date).getTime(); + } + const data = { - avatarUrl: this.data.avatarUrl, - nickName: e.detail.value.nickname + avatarUrl: that.data.avatarUrl, + nickName: e.detail.value.nickname, + name: e.detail.value.username, + sex: that.data.gender, + birthdate: birthdate, + height: e.detail.value.height ? e.detail.value.height : that.data.height, + weight: e.detail.value.weight ? e.detail.value.weight : that.data.weight, + address: that.data.addressStr || null, } + console.log(data, 'data'); if (data.nickName) { Http.post({ url: "/user/updateUserInfo", @@ -56,9 +144,10 @@ Page({ }).then(res => { if (res.code == 200) { wx.showToast({ - title: '更改成功', - icon: 'success', - duration: 2000 + title: "信息提交成功,将在3分钟内生效", + icon: 'none', + duration: 2000, + mask: false }) setTimeout(() => { wx.navigateBack() @@ -76,24 +165,6 @@ Page({ } }, - getUserInfo(token) { - let that = this; - Http.get({ - url: config.api.getScore, - data: { - token: token - } - }).then(res => { - console.log(res, 'res'); - this.setData({ - avatarUrl: res.data.avatarUrl, - nickName: res.data.nickName - }) - }).catch(err => { - console.log(err, 'err'); - }) - }, - /** * 生命周期函数--监听页面加载 */ @@ -101,12 +172,12 @@ Page({ if (app.globalData.token) { this.getUserInfo(app.globalData.token) } - this.getType(), - wx.onThemeChange((result) => { - this.setData({ - theme: result.theme - }) + this.getType() + wx.onThemeChange((result) => { + this.setData({ + theme: result.theme }) + }) }, /** diff --git a/pages/setUserInfo/index.wxml b/pages/setUserInfo/index.wxml index 9648ce0..34ff370 100644 --- a/pages/setUserInfo/index.wxml +++ b/pages/setUserInfo/index.wxml @@ -3,14 +3,99 @@ - 头像 - + 我的头像 + + + + +
- 昵称 - + + 微信昵称 + + + + + + + + 真实姓名 + + + + + + + + 性别 + + + + 请选择性别 + + + {{sexArry[gender]}} + + + + + + + + 出生年月 + + + + {{date}} + + + + + + + 身高 + + + + + + + + 体重 + + + + + + + + 家庭住址 + + {{address}} + 请选择地址 + + + + + + 我的子女信息 + + 前往设置 + + + + + + 收货地址 + + 前往设置 + + + +
diff --git a/pages/setUserInfo/index.wxss b/pages/setUserInfo/index.wxss index 3be3841..0909b13 100644 --- a/pages/setUserInfo/index.wxss +++ b/pages/setUserInfo/index.wxss @@ -5,6 +5,13 @@ padding: 0 40rpx 0 40rpx; } +.next { + float: right; + width: 35rpx; + height: 35rpx; + margin-left: 20rpx; +} + .avatar { display: flex; justify-content: space-between; @@ -12,6 +19,11 @@ margin-bottom: 50rpx; } +.right { + display: flex; + align-items: center; +} + .avatarBtn { width: 100rpx; height: 100rpx; @@ -26,20 +38,22 @@ height: 100%; } -.form { - position: relative; -} - -.nickName { - position: absolute; - top: 18rpx; - width: 60rpx; +.item { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 65rpx; } .input { text-align: right; padding-left: 20rpx; - height: 70rpx; + width: 400rpx; + line-height: 70rpx; +} + +.greyFont { + color: #888888; } .submit {