diff --git a/assets/images/next.png b/assets/images/next.png new file mode 100644 index 0000000..698de03 Binary files /dev/null and b/assets/images/next.png differ diff --git a/ext.json b/ext.json index 34dfe10..3c0587f 100644 --- a/ext.json +++ b/ext.json @@ -1,14 +1,7 @@ { "ext": { "attr": { - "car": { - "etcp": { - "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 {